GGS(GenericGEANT4Simulation)Software  2.6.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...
 
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...
 
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 60 of file GGSTGeoParams.cpp.

60  {
61  if (&params == this)
62  return true;
63  return ((_intGeoParams == params._intGeoParams) && (_realGeoParams == params._realGeoParams)
64  && (_stringGeoParams == params._stringGeoParams));
65 }
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 36 of file GGSTGeoParams.cpp.

36  {
37  auto valueIter = _boolGeoParams.find(name);
38  if (valueIter == _boolGeoParams.end()) {
39  throw(std::runtime_error(std::string("Can't find boolean geometry parameter \"").append(name).append("\"")));
40  }
41  return valueIter->second;
42 }
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 28 of file GGSTGeoParams.cpp.

28  {
29  auto valueIter = _intGeoParams.find(name);
30  if (valueIter == _intGeoParams.end()) {
31  throw(std::runtime_error(std::string("Can't find integer geometry parameter \"").append(name).append("\"")));
32  }
33  return valueIter->second;
34 }
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 44 of file GGSTGeoParams.cpp.

44  {
45  auto valueIter = _realGeoParams.find(name);
46  if (valueIter == _realGeoParams.end()) {
47  throw(std::runtime_error(std::string("Can't find real geometry parameter \"").append(name).append("\"")));
48  }
49  return valueIter->second;
50 }
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 52 of file GGSTGeoParams.cpp.

52  {
53  auto valueIter = _stringGeoParams.find(name);
54  if (valueIter == _stringGeoParams.end()) {
55  throw(std::runtime_error(std::string("Can't find string geometry parameter \"").append(name).append("\"")));
56  }
57  return valueIter->second;
58 }
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 12 of file GGSTGeoParams.cpp.

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

Sets the real geometry parameters.

Parameters
intGeoParams(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
intGeoParams(name,value) map of the string geometry parameters.

Definition at line 24 of file GGSTGeoParams.cpp.

24  {
25  _stringGeoParams = stringGeoParams;
26 }

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