BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnMaterialInfo.h
Go to the documentation of this file.
1/** BmnMaterialInfo.h
2 * \author Andrey Lebedev <andrey.lebedev@gsi.de> - Original author. First version of code for CBM experiment.
3 * \author Sergey Merts <Sergey.Merts@gmail.com> - Modification for BMN experiment.
4 * @since 2008-2014
5 * @version 1.0
6 **
7 ** Data class to store information about detector material.
8 **/
9
10#ifndef BMNMATERIALINFO_H_
11#define BMNMATERIALINFO_H_
12
13#include "Rtypes.h"
14
15#include <sstream>
16#include <string>
17
18using std::string;
19
21{
22 public:
23 /* Constructor */
25 : fLength(0.)
26 , fRL(0.)
27 , fRho(0.)
28 , fZ(0.)
29 , fA(0.)
30 , fZpos(0.)
31 , fName("")
32 {}
33
34 // This constructor never used!
35 // /* Constructor with assignment
36 // * @param length Length of the material [cm]
37 // * @param rl Radiation length [cm]
38 // * @param rho Density [g/cm^3]
39 // * @param Z
40 // * @param A
41 // * @param zpos Z position of the material
42 // */
43 // BmnMaterialInfo(
44 // Float_t length,
45 // Float_t rl,
46 // Float_t rho,
47 // Float_t Z,
48 // Float_t A,
49 // Float_t zpos,
50 // string name):
51 // fLength(length),
52 // fRL(rl),
53 // fRho(rho),
54 // fZ(Z),
55 // fA(A),
56 // fZpos(zpos),
57 // fName(name) {}
58
59 /* Destructor */
60 virtual ~BmnMaterialInfo() {};
61
62 /*@return Length of the material */
63 Float_t GetLength() const { return fLength; }
64
65 /*@return Radiation length */
66 Float_t GetRL() const { return fRL; }
67
68 /*@return Density */
69 Float_t GetRho() const { return fRho; }
70
71 /*@return Atomic number */
72 Float_t GetZ() const { return fZ; }
73
74 /*@return Atomic mass */
75 Float_t GetA() const { return fA; }
76
77 /*@return Z position of the material */
78 Float_t GetZpos() const { return fZpos; }
79
80 const string& GetName() const { return fName; }
81
82 /* Sets length of the material */
83 void SetLength(Float_t length) { fLength = length; }
84
85 /* Sets radiation length of the material */
86 void SetRL(Float_t rl) { fRL = rl; }
87
88 /* Sets density */
89 void SetRho(Float_t rho) { fRho = rho; }
90
91 /* Sets atomic number */
92 void SetZ(Float_t Z) { fZ = Z; }
93
94 /* Sets atomic mass */
95 void SetA(Float_t A) { fA = A; }
96
97 /* Sets Z position of the material */
98 void SetZpos(Float_t zpos) { fZpos = zpos; }
99
100 void SetName(const string& name) { fName = name; }
101
102 /* @return String representation of the class */
103 virtual std::string ToString() const
104 {
105 std::stringstream ss;
106 ss << "MaterialInfo: length=" << fLength << " rl=" << fRL << " rho=" << fRho << " Z=" << fZ << " A=" << fA
107 << " zpos=" << fZpos << " name=" << fName << std::endl;
108 return ss.str();
109 }
110
111 private:
112 Float_t fLength; // Length of the material [cm]
113 Float_t fRL; // Radiation length [cm]
114 Float_t fRho; // Density [g/cm^3]
115 Float_t fZ; // Atomic number
116 Float_t fA; // Atomic mass
117 Float_t fZpos; // Z position of the material
118 string fName; // Name of material
119};
120
121#endif /*BMNMATERIALINFO_H_*/
float Float_t
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)