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