Belle II Software  release-08-01-10
BeamabortGeo Class Reference

Geometry parameters of Beamabort. More...

#include <BeamabortGeo.h>

Inheritance diagram for BeamabortGeo:
Collaboration diagram for BeamabortGeo:

Public Member Functions

 BeamabortGeo ()
 Default constructor.
 
double getParameter (const std::string &name) const
 Get parameter value. More...
 
double getParameter (const std::string &name, double def) const
 Get parameter value with giving default value in case parameter doesn't exist in DB. More...
 
std::vector< double > getParArray (const std::string &name) const
 Get parameter value array. More...
 
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. More...
 
void addParameter (const std::string &name, double val)
 Add parameter to map of parameters. More...
 
void addArray (const std::string &name, std::vector< double > arr)
 Add parameter array to map of parameters. More...
 
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) More...
 

Protected Attributes

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
 

Private Member Functions

 ClassDef (BeamabortGeo, 1)
 ClassDef.
 

Detailed Description

Geometry parameters of Beamabort.

Definition at line 27 of file BeamabortGeo.h.

Member Function Documentation

◆ addArray()

void addArray ( const std::string &  name,
std::vector< double >  arr 
)
inline

Add parameter array to map of parameters.

Parameters
nameparameter name
arrparameter 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 {
105  m_par_arrays.find(name)->second = arr;
106  }
107  }
std::map< std::string, std::vector< double > > m_par_arrays
map of numeric parameter arrays
Definition: BeamabortGeo.h:142

◆ addParameter()

void addParameter ( const std::string &  name,
double  val 
)
inline

Add parameter to map of parameters.

Parameters
nameparameter name
valparameter value

Definition at line 88 of file BeamabortGeo.h.

◆ getParameter() [1/2]

double getParameter ( const std::string &  name) const
inline

Get parameter value.

Parameters
nameparameter name

Definition at line 41 of file BeamabortGeo.h.

◆ 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
nameparameter name
defdefault parameter value

Definition at line 53 of file BeamabortGeo.h.

◆ getParArray() [1/2]

std::vector<double> getParArray ( const std::string &  name) const
inline

Get parameter value array.

Parameters
nameparameter name

Definition at line 64 of file BeamabortGeo.h.

◆ 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
nameparameter name
defdefault parameter value

Definition at line 76 of file BeamabortGeo.h.

◆ initialize()

void initialize ( const GearDir content)

Initialze from the gearbox (xml file)

Parameters
contentgearbox folder

Definition at line 13 of file BeamabortGeo.cc.

14 {
15  //------------------------------
16  // Get BEAMABORT geometry parameters from the gearbox
17  //------------------------------
18 
19  addParameter("stepSize", content.getWithUnit("stepSize"));
20  addParameter("BeamBackgroundStudy", content.getInt("BeamBackgroundStudy"));
21  addParameter("divisions", content.getInt("divisions"));
22  addParameter("foo", content.getBool("foo"));
23  addArray("bar", content.getArray("bar"));
24  addParameter("WorkFunction", content.getDouble("WorkFunction"));
25  addParameter("FanoFactor", content.getDouble("FanoFactor"));
26 
27  GearDir cActive(content, "Active/");
28  addParameter("Active.phase", cActive.getInt("phase"));
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.
Definition: BeamabortGeo.h:88
void addArray(const std::string &name, std::vector< double > arr)
Add parameter array to map of parameters.
Definition: BeamabortGeo.h:101
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:31

The documentation for this class was generated from the following files: