GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
Public Member Functions
GGSTGeoParams Class Reference

Class for storing the geometry parameters on Root output file. More...

#include <GGSTGeoParams.h>

Inheritance diagram for GGSTGeoParams:
Inheritance graph
[legend]
Collaboration diagram for GGSTGeoParams:
Collaboration graph
[legend]

Public Member Functions

void SetIntGeoParams (const std::map< std::string, int > &intGeoParams)
 Sets the integer geometry parameters. More...
 
void SetBoolGeoParams (const std::map< std::string, bool > &boolGeoParams)
 Sets the boolean geometry parameters. More...
 
void SetRealGeoParams (const std::map< std::string, double > &realGeoParams)
 Sets the real geometry parameters. More...
 
void SetStringGeoParams (const std::map< std::string, std::string > &stringGeoParams)
 Sets the string geometry parameters. More...
 
void SetVectIntGeoParams (const std::map< std::string, std::vector< int >> &vectIntGeoParams)
 Sets the vector-of-integers geometry parameters. More...
 
void SetVectBoolGeoParams (const std::map< std::string, std::vector< bool >> &vectBoolGeoParams)
 Sets the vector-of-booleans geometry parameters. More...
 
void SetVectRealGeoParams (const std::map< std::string, std::vector< double >> &vectRealGeoParams)
 Sets the vector-of-reals geometry parameters. More...
 
void SetVectStringGeoParams (const std::map< std::string, std::vector< std::string >> &vectStringGeoParams)
 Sets the vector-of-strings geometry parameters. More...
 
int GetIntGeoParam (const std::string &name) const
 Gets an integer geometry parameter. More...
 
bool GetBoolGeoParam (const std::string &name) const
 Gets a boolean geometry parameter. More...
 
double GetRealGeoParam (const std::string &name) const
 Gets a real geometry parameter. More...
 
std::string GetStringGeoParam (const std::string &name) const
 Gets a string geometry parameter. More...
 
std::vector< int > GetVectIntGeoParam (const std::string &name) const
 Gets a vector-of-integers geometry parameter. More...
 
std::vector< bool > GetVectBoolGeoParam (const std::string &name) const
 Gets a vector-of-booleans geometry parameter. More...
 
std::vector< double > GetVectRealGeoParam (const std::string &name) const
 Gets a vector-of-reals geometry parameter. More...
 
std::vector< std::string > GetVectStringGeoParam (const std::string &name) const
 Gets a vector-of-strings geometry parameter. More...
 
bool AreSameParamsAs (const GGSTGeoParams &params) const
 Compares two geometry parameter objects. More...
 

Detailed Description

Class for storing the geometry parameters on Root output file.

Definition at line 18 of file GGSTGeoParams.h.

Member Function Documentation

bool GGSTGeoParams::AreSameParamsAs ( const GGSTGeoParams params) const

Compares two geometry parameter objects.

This method returns true if the parameters of the argument object are identical in number, names and values to those of this object.

(Note: this method is defined for similarity with GGSTSimInfo::IsSameSimAs, instead of defining GGSTGeoParams::operator= )

Parameters
paramsThe geometry parameters object to be compared with this.
Returns
true if #params carries the same parameters as this.

Definition at line 112 of file GGSTGeoParams.cpp.

112  {
113  if (&params == this)
114  return true;
115  return ((_intGeoParams == params._intGeoParams) && (_realGeoParams == params._realGeoParams) &&
116  (_stringGeoParams == params._stringGeoParams) && (_boolGeoParams == params._boolGeoParams) &&
117  (_vectIntGeoParams == params._vectIntGeoParams) && (_vectRealGeoParams == params._vectRealGeoParams) &&
118  (_vectStringGeoParams == params._vectStringGeoParams) && (_vectBoolGeoParams == params._vectBoolGeoParams));
119 }
bool GGSTGeoParams::GetBoolGeoParam ( const std::string &  name) const

Gets a boolean geometry parameter.

Parameters
namethe name of the desired parameter.
Returns
the value of the desired parameter
Exceptions
std::runtime_errorif the requested parameter does not exist.

Definition at line 52 of file GGSTGeoParams.cpp.

52  {
53  auto valueIter = _boolGeoParams.find(name);
54  if (valueIter == _boolGeoParams.end()) {
55  throw(std::runtime_error(std::string("Can't find boolean geometry parameter \"").append(name).append("\"")));
56  }
57  return valueIter->second;
58 }
int GGSTGeoParams::GetIntGeoParam ( const std::string &  name) const

Gets an integer geometry parameter.

Parameters
namethe name of the desired parameter.
Returns
the value of the desired parameter
Exceptions
std::runtime_errorif the requested parameter does not exist.

Definition at line 44 of file GGSTGeoParams.cpp.

44  {
45  auto valueIter = _intGeoParams.find(name);
46  if (valueIter == _intGeoParams.end()) {
47  throw(std::runtime_error(std::string("Can't find integer geometry parameter \"").append(name).append("\"")));
48  }
49  return valueIter->second;
50 }
double GGSTGeoParams::GetRealGeoParam ( const std::string &  name) const

Gets a real geometry parameter.

Parameters
namethe name of the desired parameter.
Returns
the value of the desired parameter
Exceptions
std::runtime_errorif the requested parameter does not exist.

Definition at line 60 of file GGSTGeoParams.cpp.

60  {
61  auto valueIter = _realGeoParams.find(name);
62  if (valueIter == _realGeoParams.end()) {
63  throw(std::runtime_error(std::string("Can't find real geometry parameter \"").append(name).append("\"")));
64  }
65  return valueIter->second;
66 }
std::string GGSTGeoParams::GetStringGeoParam ( const std::string &  name) const

Gets a string geometry parameter.

Parameters
namethe name of the desired parameter.
Returns
the value of the desired parameter
Exceptions
std::runtime_errorif the requested parameter does not exist.

Definition at line 68 of file GGSTGeoParams.cpp.

68  {
69  auto valueIter = _stringGeoParams.find(name);
70  if (valueIter == _stringGeoParams.end()) {
71  throw(std::runtime_error(std::string("Can't find string geometry parameter \"").append(name).append("\"")));
72  }
73  return valueIter->second;
74 }
std::vector< bool > GGSTGeoParams::GetVectBoolGeoParam ( const std::string &  name) const

Gets a vector-of-booleans geometry parameter.

Parameters
namethe name of the desired parameter.
Returns
the value of the desired parameter
Exceptions
std::runtime_errorif the requested parameter does not exist.

Definition at line 85 of file GGSTGeoParams.cpp.

85  {
86  auto valueIter = _vectBoolGeoParams.find(name);
87  if (valueIter == _vectBoolGeoParams.end()) {
88  throw(std::runtime_error(
89  std::string("Can't find vector-of-booleans geometry parameter \"").append(name).append("\"")));
90  }
91  return valueIter->second;
92 }
std::vector< int > GGSTGeoParams::GetVectIntGeoParam ( const std::string &  name) const

Gets a vector-of-integers geometry parameter.

Parameters
namethe name of the desired parameter.
Returns
the value of the desired parameter
Exceptions
std::runtime_errorif the requested parameter does not exist.

Definition at line 76 of file GGSTGeoParams.cpp.

76  {
77  auto valueIter = _vectIntGeoParams.find(name);
78  if (valueIter == _vectIntGeoParams.end()) {
79  throw(std::runtime_error(
80  std::string("Can't find vector-of-integers geometry parameter \"").append(name).append("\"")));
81  }
82  return valueIter->second;
83 }
std::vector< double > GGSTGeoParams::GetVectRealGeoParam ( const std::string &  name) const

Gets a vector-of-reals geometry parameter.

Parameters
namethe name of the desired parameter.
Returns
the value of the desired parameter
Exceptions
std::runtime_errorif the requested parameter does not exist.

Definition at line 94 of file GGSTGeoParams.cpp.

94  {
95  auto valueIter = _vectRealGeoParams.find(name);
96  if (valueIter == _vectRealGeoParams.end()) {
97  throw(
98  std::runtime_error(std::string("Can't find vector-of-reals geometry parameter \"").append(name).append("\"")));
99  }
100  return valueIter->second;
101 }
std::vector< std::string > GGSTGeoParams::GetVectStringGeoParam ( const std::string &  name) const

Gets a vector-of-strings geometry parameter.

Parameters
namethe name of the desired parameter.
Returns
the value of the desired parameter
Exceptions
std::runtime_errorif the requested parameter does not exist.

Definition at line 103 of file GGSTGeoParams.cpp.

103  {
104  auto valueIter = _vectStringGeoParams.find(name);
105  if (valueIter == _vectStringGeoParams.end()) {
106  throw(std::runtime_error(
107  std::string("Can't find vector-of-strings geometry parameter \"").append(name).append("\"")));
108  }
109  return valueIter->second;
110 }
void GGSTGeoParams::SetBoolGeoParams ( const std::map< std::string, bool > &  boolGeoParams)

Sets the boolean geometry parameters.

Parameters
boolGeoParams(name,value) map of the boolean geometry parameters.

Definition at line 16 of file GGSTGeoParams.cpp.

16  {
17  _boolGeoParams = boolGeoParams;
18 }
void GGSTGeoParams::SetIntGeoParams ( const std::map< std::string, int > &  intGeoParams)

Sets the integer geometry parameters.

Parameters
intGeoParams(name,value) map of the integer geometry parameters.

Definition at line 14 of file GGSTGeoParams.cpp.

14 { _intGeoParams = intGeoParams; }
void GGSTGeoParams::SetRealGeoParams ( const std::map< std::string, double > &  realGeoParams)

Sets the real geometry parameters.

Parameters
realGeoParams(name,value) map of the real geometry parameters.

Definition at line 20 of file GGSTGeoParams.cpp.

20  {
21  _realGeoParams = realGeoParams;
22 }
void GGSTGeoParams::SetStringGeoParams ( const std::map< std::string, std::string > &  stringGeoParams)

Sets the string geometry parameters.

Parameters
stringGeoParams(name,value) map of the string geometry parameters.

Definition at line 24 of file GGSTGeoParams.cpp.

24  {
25  _stringGeoParams = stringGeoParams;
26 }
void GGSTGeoParams::SetVectBoolGeoParams ( const std::map< std::string, std::vector< bool >> &  vectBoolGeoParams)

Sets the vector-of-booleans geometry parameters.

Parameters
vectBoolGeoParams(name,value) map of the vector-of-booleans geometry parameters.

Definition at line 32 of file GGSTGeoParams.cpp.

32  {
33  _vectBoolGeoParams = vectBoolGeoParams;
34 }
void GGSTGeoParams::SetVectIntGeoParams ( const std::map< std::string, std::vector< int >> &  vectIntGeoParams)

Sets the vector-of-integers geometry parameters.

Parameters
vectIntGeoParams(name,value) map of the vector-of-integers geometry parameters.

Definition at line 28 of file GGSTGeoParams.cpp.

28  {
29  _vectIntGeoParams = vectIntGeoParams;
30 }
void GGSTGeoParams::SetVectRealGeoParams ( const std::map< std::string, std::vector< double >> &  vectRealGeoParams)

Sets the vector-of-reals geometry parameters.

Parameters
vectrEALGeoParams(name,value) map of the vector-of-reals geometry parameters.

Definition at line 36 of file GGSTGeoParams.cpp.

36  {
37  _vectRealGeoParams = vectRealGeoParams;
38 }
void GGSTGeoParams::SetVectStringGeoParams ( const std::map< std::string, std::vector< std::string >> &  vectStringGeoParams)

Sets the vector-of-strings geometry parameters.

Parameters
vectStringGeoParams(name,value) map of the vector-of-strings geometry parameters.

Definition at line 40 of file GGSTGeoParams.cpp.

40  {
41  _vectStringGeoParams = vectStringGeoParams;
42 }

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