CbmRoot
CbmLitMaterialInfo.h
Go to the documentation of this file.
1 
9 #ifndef CBMLITMATERIALINFO_H_
10 #define CBMLITMATERIALINFO_H_
11 
12 #include "base/CbmLitFloat.h"
13 
14 #include <sstream>
15 #include <string>
16 
17 using std::string;
18 
20 public:
21  /* Constructor */
23  : fLength(0.), fRL(0.), fRho(0.), fZ(0.), fA(0.), fZpos(0.), fName("") {}
24 
25  // This constructor never used!
26  // /* Constructor with assignment
27  // * @param length Length of the material [cm]
28  // * @param rl Radiation length [cm]
29  // * @param rho Density [g/cm^3]
30  // * @param Z
31  // * @param A
32  // * @param zpos Z position of the material
33  // */
34  // CbmLitMaterialInfo(
35  // litfloat length,
36  // litfloat rl,
37  // litfloat rho,
38  // litfloat Z,
39  // litfloat A,
40  // litfloat zpos,
41  // string name):
42  // fLength(length),
43  // fRL(rl),
44  // fRho(rho),
45  // fZ(Z),
46  // fA(A),
47  // fZpos(zpos),
48  // fName(name) {}
49 
50  /* Destructor */
51  virtual ~CbmLitMaterialInfo() {};
52 
53  /*@return Length of the material */
54  litfloat GetLength() const { return fLength; }
55 
56  /*@return Radiation length */
57  litfloat GetRL() const { return fRL; }
58 
59  /*@return Density */
60  litfloat GetRho() const { return fRho; }
61 
62  /*@return Atomic number */
63  litfloat GetZ() const { return fZ; }
64 
65  /*@return Atomic mass */
66  litfloat GetA() const { return fA; }
67 
68  /*@return Z position of the material */
69  litfloat GetZpos() const { return fZpos; }
70 
71  const string& GetName() const { return fName; }
72 
73  /* Sets length of the material */
74  void SetLength(litfloat length) { fLength = length; }
75 
76  /* Sets radiation length of the material */
77  void SetRL(litfloat rl) { fRL = rl; }
78 
79  /* Sets density */
80  void SetRho(litfloat rho) { fRho = rho; }
81 
82  /* Sets atomic number */
83  void SetZ(litfloat Z) { fZ = Z; }
84 
85  /* Sets atomic mass */
86  void SetA(litfloat A) { fA = A; }
87 
88  /* Sets Z position of the material */
89  void SetZpos(litfloat zpos) { fZpos = zpos; }
90 
91  void SetName(const string& name) { fName = name; }
92 
93  /* @return String representation of the class */
94  virtual std::string ToString() const {
95  std::stringstream ss;
96  ss << "MaterialInfo: length=" << fLength << " rl=" << fRL << " rho=" << fRho
97  << " Z=" << fZ << " A=" << fA << " zpos=" << fZpos << " name=" << fName
98  << std::endl;
99  return ss.str();
100  }
101 
102 private:
103  litfloat fLength; // Length of the material [cm]
104  litfloat fRL; // Radiation length [cm]
105  litfloat fRho; // Density [g/cm^3]
106  litfloat fZ; // Atomic number
107  litfloat fA; // Atomic mass
108  litfloat fZpos; // Z position of the material
109  string fName; // Name of material
110 };
111 
112 #endif /*CBMLITMATERIALINFO_H_*/
CbmLitMaterialInfo::fZ
litfloat fZ
Definition: CbmLitMaterialInfo.h:106
litfloat
double litfloat
Definition: CbmLitFloat.h:15
CbmLitMaterialInfo::SetZpos
void SetZpos(litfloat zpos)
Definition: CbmLitMaterialInfo.h:89
CbmLitMaterialInfo::SetZ
void SetZ(litfloat Z)
Definition: CbmLitMaterialInfo.h:83
CbmLitMaterialInfo::GetRL
litfloat GetRL() const
Definition: CbmLitMaterialInfo.h:57
CbmLitMaterialInfo::fZpos
litfloat fZpos
Definition: CbmLitMaterialInfo.h:108
CbmLitMaterialInfo::fRho
litfloat fRho
Definition: CbmLitMaterialInfo.h:105
CbmLitMaterialInfo::fA
litfloat fA
Definition: CbmLitMaterialInfo.h:107
CbmLitMaterialInfo
Definition: CbmLitMaterialInfo.h:19
CbmLitMaterialInfo::~CbmLitMaterialInfo
virtual ~CbmLitMaterialInfo()
Definition: CbmLitMaterialInfo.h:51
CbmLitMaterialInfo::GetZpos
litfloat GetZpos() const
Definition: CbmLitMaterialInfo.h:69
CbmLitMaterialInfo::fLength
litfloat fLength
Definition: CbmLitMaterialInfo.h:103
CbmLitMaterialInfo::SetRL
void SetRL(litfloat rl)
Definition: CbmLitMaterialInfo.h:77
CbmLitMaterialInfo::SetRho
void SetRho(litfloat rho)
Definition: CbmLitMaterialInfo.h:80
CbmLitMaterialInfo::ToString
virtual std::string ToString() const
Definition: CbmLitMaterialInfo.h:94
CbmLitFloat.h
Define floating point number type litfloat.
CbmLitMaterialInfo::GetLength
litfloat GetLength() const
Definition: CbmLitMaterialInfo.h:54
CbmLitMaterialInfo::SetName
void SetName(const string &name)
Definition: CbmLitMaterialInfo.h:91
CbmLitMaterialInfo::SetLength
void SetLength(litfloat length)
Definition: CbmLitMaterialInfo.h:74
CbmLitMaterialInfo::GetZ
litfloat GetZ() const
Definition: CbmLitMaterialInfo.h:63
CbmLitMaterialInfo::SetA
void SetA(litfloat A)
Definition: CbmLitMaterialInfo.h:86
CbmLitMaterialInfo::GetA
litfloat GetA() const
Definition: CbmLitMaterialInfo.h:66
CbmLitMaterialInfo::GetName
const string & GetName() const
Definition: CbmLitMaterialInfo.h:71
CbmLitMaterialInfo::fRL
litfloat fRL
Definition: CbmLitMaterialInfo.h:104
CbmLitMaterialInfo::fName
string fName
Definition: CbmLitMaterialInfo.h:109
CbmLitMaterialInfo::GetRho
litfloat GetRho() const
Definition: CbmLitMaterialInfo.h:60
CbmLitMaterialInfo::CbmLitMaterialInfo
CbmLitMaterialInfo()
Definition: CbmLitMaterialInfo.h:22