Belle II Software  release-05-02-19
BeamPipeGeo Class Reference

Geometry parameters of BeamPipe. More...

#include <BeamPipeGeo.h>

Inheritance diagram for BeamPipeGeo:
Collaboration diagram for BeamPipeGeo:

Public Member Functions

 BeamPipeGeo ()
 Default constructor.
 
void initialize (const GearDir &content)
 Initialze from the gearbox (xml file) More...
 
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...
 
const std::string & getParameterStr (const std::string &name) const
 Get string parameter. More...
 
const std::string & getParameterStr (const std::string &name, const std::string &def) const
 Get string parameter with giving default value in case of non-existence. More...
 
const std::map< std::string, double > & getParameters () const
 Get map of all parameters.
 
const std::map< std::string, std::string > & getParametersStr () const
 Get map of all string parameters.
 
void addParameter (const std::string &name, double val)
 Add parameter to map of parameters. More...
 
void addParameter (const std::string &name, const std::string &val)
 Add string parameter to map of parameters. More...
 
void addParameters (const GearDir &content, const std::string &section)
 Add parameters from Gearbox. More...
 
void print () const
 Print all parameters.
 

Protected Member Functions

 ClassDef (IRGeoBase, 1)
 ClassDef.
 

Protected Attributes

std::map< std::string, double > m_params
 map of numeric parameters
 
std::map< std::string, std::string > m_strparams
 map of string parameters
 

Private Member Functions

 ClassDef (BeamPipeGeo, 1)
 ClassDef.
 

Detailed Description

Geometry parameters of BeamPipe.

Definition at line 33 of file BeamPipeGeo.h.

Member Function Documentation

◆ addParameter() [1/2]

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

Add string parameter to map of parameters.

Parameters
nameparameter name
valparameter value

Definition at line 120 of file IRGeoBase.h.

126  {

◆ addParameter() [2/2]

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

Add parameter to map of parameters.

Parameters
nameparameter name
valparameter value

Definition at line 107 of file IRGeoBase.h.

◆ addParameters()

void addParameters ( const GearDir content,
const std::string &  section 
)
inlineinherited

Add parameters from Gearbox.

Parameters
contentgearbox folder
sectionname of section of parameters to add

Definition at line 133 of file IRGeoBase.h.

◆ getParameter() [1/2]

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

Get parameter value.

Parameters
nameparameter name

Definition at line 51 of file IRGeoBase.h.

◆ getParameter() [2/2]

double getParameter ( const std::string &  name,
double  def 
) const
inlineinherited

Get parameter value with giving default value in case parameter doesn't exist in DB.

Parameters
nameparameter name
defdefault parameter value

Definition at line 63 of file IRGeoBase.h.

◆ getParameterStr() [1/2]

const std::string& getParameterStr ( const std::string &  name) const
inlineinherited

Get string parameter.

Parameters
nameparameter name

Definition at line 74 of file IRGeoBase.h.

◆ getParameterStr() [2/2]

const std::string& getParameterStr ( const std::string &  name,
const std::string &  def 
) const
inlineinherited

Get string parameter with giving default value in case of non-existence.

Parameters
nameparameter name

Definition at line 85 of file IRGeoBase.h.

◆ initialize()

void initialize ( const GearDir content)

Initialze from the gearbox (xml file)

Parameters
contentgearbox folder

Definition at line 17 of file BeamPipeGeo.cc.

18 {
19  //------------------------------
20  // Get BeamPipe geometry parameters from the gearbox
21  //------------------------------
22 
23  GearDir cSafety(content, "Safety/");
24  addParameter("Safety.L1", cSafety.getLength("L1"));
25 
26  addParameter("LimitStepLength", content.getInt("LimitStepLength"));
27 
28  std::vector<std::string> names = {"Lv1SUS", "Lv2OutTi", "Lv2OutBe", "Lv2InBe", "Lv2Paraf", "Lv2Vacuum", "Lv3AuCoat", "Lv1TaFwd", "Lv2VacFwd", "Lv1TaBwd", "Lv2VacBwd", "Flange", "AreaTubeFwd", "Lv1TaLERUp", "Lv2VacLERUp", "Lv1TaHERDwn", "Lv2VacHERDwn", "AreaTubeBwd", "Lv1TaHERUp", "Lv2VacHERUp", "Lv1TaLERDwn", "Lv2VacLERDwn"};
29 
30 
31  for (auto name : names) {
32  GearDir sect(content, name + "/");
33  addParameters(sect, name);
34  }
35 
36 }

The documentation for this class was generated from the following files:
Belle2::GearDir
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:41
Belle2::IRGeoBase::addParameters
void addParameters(const GearDir &content, const std::string &section)
Add parameters from Gearbox.
Definition: IRGeoBase.h:133
Belle2::IRGeoBase::addParameter
void addParameter(const std::string &name, double val)
Add parameter to map of parameters.
Definition: IRGeoBase.h:107