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