fisx
fisx_detector.h
1 #/*##########################################################################
2 #
3 # The fisx library for X-Ray Fluorescence
4 #
5 # Copyright (c) 2014-2018 European Synchrotron Radiation Facility
6 #
7 # This file is part of the fisx X-ray developed by V.A. Sole
8 #
9 # Permission is hereby granted, free of charge, to any person obtaining a copy
10 # of this software and associated documentation files (the "Software"), to deal
11 # in the Software without restriction, including without limitation the rights
12 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 # copies of the Software, and to permit persons to whom the Software is
14 # furnished to do so, subject to the following conditions:
15 #
16 # The above copyright notice and this permission notice shall be included in
17 # all copies or substantial portions of the Software.
18 #
19 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 # THE SOFTWARE.
26 #
27 #############################################################################*/
28 #ifndef FISX_DETECTOR_H
29 #define FISX_DETECTOR_H
30 #include "fisx_layer.h"
31 
32 namespace fisx
33 {
34 
40 class Detector:public Layer
41 {
42 public:
43 
48  Detector(const std::string & name="", const double & density = 0.0,
49  const double & thickness = 0.0,
50  const double & funnyFactor = 1.0);
51 
52  void setMaterial(const std::string & materialName);
53 
54  void setMaterial(const Material & material);
55 
56 
57 
62  void setActiveArea(const double & area);
63 
68  void setDiameter(const double & diameter);
69 
73  double getActiveArea() const;
74 
78  const double & getDiameter() const;
79 
83  void setDistance(const double & distance);
84 
88  const double & getDistance() const;
89 
93  void clearEscapePeakCache();
94 
98  const double getEscapePeakEnergyThreshold() const {return this->escapePeakEnergyThreshold;};
99  const double getEscapePeakIntensityThreshold() const {return this->escapePeakIntensityThreshold;};
100  const int getEscapePeakNThreshold() const {return this->escapePeakNThreshold;};
101  const double getEscapePeakAlphaIn() const {return this->escapePeakAlphaIn;};
102 
110  std::map<std::string, std::map<std::string, double> > getEscape(const double & energy, \
111  const Elements & elementsLibrary, \
112  const std::string & label = "", \
113  const int & update = 1);
114  void setMinimumEscapePeakEnergy(const double & energy);
115  void setMinimumEscapePeakIntensity(const double & intensity);
116  void setMaximumNumberOfEscapePeaks(const int & nPeaks);
117 
118 private:
119  double diameter ;
120  double distance ;
121  // Escape peak related parameters
122  double escapePeakEnergyThreshold;
123  double escapePeakIntensityThreshold;
124  int escapePeakNThreshold;
125  double escapePeakAlphaIn;
126  std::map< std::string, std::map< double, std::map<std::string, std::map<std::string, double> > > >escapePeakCache;
127  // TODO: Calibration, fano, noise, and so on.
128 };
129 
130 } // namespace fisx
131 
132 #endif //FISX_DETECTOR_H
Class containing the composition of a material.
Definition: fisx_material.h:45
Definition: fisx_element.cpp:34
const double & getDistance() const
Definition: fisx_detector.cpp:123
Class containing the composition of a layer.
Definition: fisx_layer.h:43
Class handling the physical properties.
Definition: fisx_elements.h:60
Detector(const std::string &name="", const double &density=0.0, const double &thickness=0.0, const double &funnyFactor=1.0)
Definition: fisx_detector.cpp:35
std::map< std::string, std::map< std::string, double > > getEscape(const double &energy, const Elements &elementsLibrary, const std::string &label="", const int &update=1)
Definition: fisx_detector.cpp:128
const double & getDiameter() const
Definition: fisx_detector.cpp:118
void clearEscapePeakCache()
Definition: fisx_detector.cpp:77
void setDistance(const double &distance)
Definition: fisx_detector.cpp:109
void setDiameter(const double &diameter)
Definition: fisx_detector.cpp:100
double getActiveArea() const
Definition: fisx_detector.cpp:82
const double getEscapePeakEnergyThreshold() const
Definition: fisx_detector.h:98
Class describing the detector.
Definition: fisx_detector.h:40
void setActiveArea(const double &area)
Definition: fisx_detector.cpp:89