fisx
fisx_layer.h
1 #/*##########################################################################
2 #
3 # The fisx library for X-Ray Fluorescence
4 #
5 # Copyright (c) 2014-2016 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_LAYER_H
29 #define FISX_LAYER_H
30 #include <string>
31 #include <vector>
32 #include <iostream>
33 #include "fisx_elements.h"
34 
35 namespace fisx
36 {
37 
43 class Layer
44 {
45 public:
46 
47  Layer(const std::string & name="", const double & density = 0.0,
48  const double & thickness = 0.0,
49  const double & funnyFactor = 1.0);
50 
51  friend std::ostream& operator<< (std::ostream& o, Layer const & layer);
52 
53  void setMaterial(const std::string & materialName);
54 
55  void setMaterial(const Material & material);
56 
57  std::string name;
58 
63  std::map<std::string, double> getComposition(const Elements & elements) const;
64 
68  const Material & getMaterial() const {return this->material;};
69 
76  double getTransmission(const double & energy, const Elements & elements, const double & angle = 90.0) const;
77 
78 
84  std::map<std::string, double> getMassAttenuationCoefficients(const double & energy,
85  const Elements & elements) const;
86 
87 
93  std::map<std::string, std::vector<double> > getMassAttenuationCoefficients( \
94  const std::vector<double> & energies,
95  const Elements & elements) const;
96 
97 
104  std::vector<double> getTransmission(const std::vector<double> & energy,
105  const Elements & elements, const double & angle = 90.0) const;
106 
111  bool hasMaterialComposition() const;
112 
117  std::vector<std::pair<std::string, double> > getPeakFamilies(const double & energy, \
118  const Elements & elements) const;
119 
120 
121  const std::string & getMaterialName()const {return this->materialName;};
122 
123  void setDensity(const double & density);
124  void setThickness(const double & thickness);
125  const double & getDensity()const {return this->density;};
126  const double & getThickness()const {return this->thickness;};
127  const double & getFunnyFactor()const {return this->funnyFactor;};
128 
129  std::map<std::string, double> getComposition(const Elements & elements);
130 
131 private:
132  std::string materialName;
133  bool hasMaterial;
134  Material material;
135  double funnyFactor;
136  double density;
137  double thickness;
138 };
139 
140 } // namespace fisx
141 
142 #endif //FISX_LAYER_H
std::vector< std::pair< std::string, double > > getPeakFamilies(const double &energy, const Elements &elements) const
Definition: fisx_layer.cpp:226
std::map< std::string, double > getComposition(const Elements &elements) const
Definition: fisx_layer.cpp:129
Class containing the composition of a material.
Definition: fisx_material.h:45
Definition: fisx_element.cpp:34
double getTransmission(const double &energy, const Elements &elements, const double &angle=90.0) const
Definition: fisx_layer.cpp:141
Class containing the composition of a layer.
Definition: fisx_layer.h:43
const Material & getMaterial() const
Definition: fisx_layer.h:68
Class handling the physical properties.
Definition: fisx_elements.h:60
std::map< std::string, double > getMassAttenuationCoefficients(const double &energy, const Elements &elements) const
Definition: fisx_layer.cpp:90
bool hasMaterialComposition() const
Definition: fisx_layer.cpp:85
Elements properties.