fisx: fisx_transmissiontable.h Source File

fisx

fisx_transmissiontable.h
1 #/*##########################################################################
2 #
3 # The fisx library for X-Ray Fluorescence
4 #
5 # Copyright (c) 2020 European Synchrotron Radiation Facility
6 #
7 # This file is part of the fisx X-ray library 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_TRANSMISSIONTABLE_H
29 #define FISX_TRANSMISSIONTABLE_H
30 #include <string>
31 #include <vector>
32 #include <map>
33
34 namespace fisx
35 {
36
46 class TransmissionTable
47 {
48 public:
52 TransmissionTable();
53
59 TransmissionTable(const std::string & name, const std::string & comment = "");
60
61 void setName(const std::string & name);
62
63 void setComment(const std::string & comment);
64
68 void setTransmissionTable(const std::map<double, double> & table, \
69 const std::string & name="", const std::string & comment = "");
70
74 void setTransmissionTable(const std::vector<double> & energy, const std::vector<double> & transmission, \
75 const std::string & name="", const std::string & comment = "");
76
80 std::map<double, double> getTransmissionTable() const;
81
85 double getTransmission(const double &energy) const;
86
90 std::vector<double> getTransmission(const std::vector<double> & energy) const;
91
92 std::string getName() const;
93 std::string getComment() const;
94
95 private:
96 std::string name;
97 std::string comment;
98 std::map<double, double> transmissionTable;
99 };
100
101 } // namespace fisx
102
103 #endif //FISX_TRANSMISSIONTABLE_H
fisx::TransmissionTable::getTransmission
double getTransmission(const double &energy) const
Definition: fisx_transmissiontable.cpp:209
fisx::TransmissionTable::TransmissionTable
TransmissionTable()
Definition: fisx_transmissiontable.cpp:35
fisx
Definition: fisx_element.cpp:34
fisx::TransmissionTable
Definition: fisx_transmissiontable.h:46
fisx::TransmissionTable::getTransmissionTable
std::map< double, double > getTransmissionTable() const
Definition: fisx_transmissiontable.cpp:261
fisx::TransmissionTable::setTransmissionTable
void setTransmissionTable(const std::map< double, double > &table, const std::string &name="", const std::string &comment="")
Definition: fisx_transmissiontable.cpp:63