Geometry parameters of Beamabort.
More...
#include <BeamabortGeo.h>
|
| BeamabortGeo () |
| Default constructor.
|
|
double | getParameter (const std::string &name) const |
| Get parameter value.
|
|
double | getParameter (const std::string &name, double def) const |
| Get parameter value with giving default value in case parameter doesn't exist in DB.
|
|
std::vector< double > | getParArray (const std::string &name) const |
| Get parameter value array.
|
|
std::vector< double > | getParArray (const std::string &name, std::vector< double > def) const |
| Get parameter value array with giving default array in case parameter doesn't exist in DB.
|
|
void | addParameter (const std::string &name, double val) |
| Add parameter to map of parameters.
|
|
void | addArray (const std::string &name, std::vector< double > arr) |
| Add parameter array to map of parameters.
|
|
const std::map< std::string, double > & | getParameters () const |
| Get map of all parameters.
|
|
const std::map< std::string, std::vector< double > > & | getParArrays () const |
| Get map of all parameter arrays.
|
|
void | print () const |
| Print all parameters.
|
|
void | initialize (const GearDir &content) |
| Initialze from the gearbox (xml file)
|
|
|
std::map< std::string, double > | m_params |
| map of numeric parameters
|
|
std::map< std::string, std::vector< double > > | m_par_arrays |
| map of numeric parameter arrays
|
|
Geometry parameters of Beamabort.
Definition at line 27 of file BeamabortGeo.h.
◆ BeamabortGeo()
◆ addArray()
void addArray |
( |
const std::string & |
name, |
|
|
std::vector< double > |
arr |
|
) |
| |
|
inline |
Add parameter array to map of parameters.
- Parameters
-
name | parameter name |
arr | parameter array |
Definition at line 101 of file BeamabortGeo.h.
102 {
103 if (
m_par_arrays.insert(std::pair<std::string, std::vector<double>>(name, arr)).second)
return;
104 else {
106 }
107 }
std::map< std::string, std::vector< double > > m_par_arrays
map of numeric parameter arrays
◆ addParameter()
void addParameter |
( |
const std::string & |
name, |
|
|
double |
val |
|
) |
| |
|
inline |
Add parameter to map of parameters.
- Parameters
-
name | parameter name |
val | parameter value |
Definition at line 88 of file BeamabortGeo.h.
89 {
90 if (
m_params.insert(std::pair<std::string, double>(name, val)).second)
return;
91 else {
93 }
94 }
std::map< std::string, double > m_params
map of numeric parameters
◆ getParameter() [1/2]
double getParameter |
( |
const std::string & |
name | ) |
const |
|
inline |
Get parameter value.
- Parameters
-
Definition at line 41 of file BeamabortGeo.h.
42 {
43 std::map<std::string, double>::const_iterator it =
m_params.find(name);
44 if (it !=
m_params.end())
return (*it).second;
45 B2FATAL("Requested parameter from BEAMABORT database not found: " << name);
46 }
◆ getParameter() [2/2]
double getParameter |
( |
const std::string & |
name, |
|
|
double |
def |
|
) |
| const |
|
inline |
Get parameter value with giving default value in case parameter doesn't exist in DB.
- Parameters
-
name | parameter name |
def | default parameter value |
Definition at line 53 of file BeamabortGeo.h.
54 {
55 std::map<std::string, double>::const_iterator it =
m_params.find(name);
56 if (it !=
m_params.end())
return (*it).second;
57 return def;
58 }
◆ getParameters()
const std::map< std::string, double > & getParameters |
( |
| ) |
const |
|
inline |
◆ getParArray() [1/2]
std::vector< double > getParArray |
( |
const std::string & |
name | ) |
const |
|
inline |
Get parameter value array.
- Parameters
-
Definition at line 64 of file BeamabortGeo.h.
65 {
66 std::map<std::string, std::vector<double>>::const_iterator it =
m_par_arrays.find(name);
68 B2FATAL("Requested parameter from BEAMABORT database not found: " << name);
69 }
◆ getParArray() [2/2]
std::vector< double > getParArray |
( |
const std::string & |
name, |
|
|
std::vector< double > |
def |
|
) |
| const |
|
inline |
Get parameter value array with giving default array in case parameter doesn't exist in DB.
- Parameters
-
name | parameter name |
def | default parameter value |
Definition at line 76 of file BeamabortGeo.h.
77 {
78 std::map<std::string, std::vector<double>>::const_iterator it =
m_par_arrays.find(name);
80 return def;
81 }
◆ getParArrays()
const std::map< std::string, std::vector< double > > & getParArrays |
( |
| ) |
const |
|
inline |
◆ initialize()
void initialize |
( |
const GearDir & |
content | ) |
|
Initialze from the gearbox (xml file)
- Parameters
-
Definition at line 13 of file BeamabortGeo.cc.
14{
15
16
17
18
19 addParameter(
"stepSize", content.getWithUnit(
"stepSize"));
20 addParameter(
"BeamBackgroundStudy", content.getInt(
"BeamBackgroundStudy"));
23 addArray(
"bar", content.getArray(
"bar"));
24 addParameter(
"WorkFunction", content.getDouble(
"WorkFunction"));
25 addParameter(
"FanoFactor", content.getDouble(
"FanoFactor"));
26
27 GearDir cActive(content,
"Active/");
29 addArray(
"Active.z", cActive.getArray(
"z"));
30 addArray(
"Active.r_dia", cActive.getArray(
"r_dia"));
31 addArray(
"Active.ThetaZ", cActive.getArray(
"ThetaZ"));
32 addArray(
"Active.Phi", cActive.getArray(
"Phi"));
33 addArray(
"Active.deltaX", cActive.getArray(
"deltaX"));
34 addArray(
"Active.addAngle", cActive.getArray(
"addAngle"));
35}
void addParameter(const std::string &name, double val)
Add parameter to map of parameters.
void addArray(const std::string &name, std::vector< double > arr)
Add parameter array to map of parameters.
GearDir is the basic class used for accessing the parameter store.
◆ print()
Print all parameters.
Definition at line 122 of file BeamabortGeo.h.
123 {
124 for (std::pair<std::string, double> element :
m_params) {
125 std::cout << element.first << " " << element.second << std::endl;
126 }
127 }
◆ m_par_arrays
std::map<std::string, std::vector<double> > m_par_arrays |
|
protected |
◆ m_params
std::map<std::string, double> m_params |
|
protected |
The documentation for this class was generated from the following files: