CbmRoot
LitAbsorber.h
Go to the documentation of this file.
1 
8 #ifndef LITABSORBER_H_
9 #define LITABSORBER_H_
10 
11 #include "../LitFieldGrid.h"
12 
13 namespace lit {
14  namespace parallel {
15 
22  template<class T>
23  class LitAbsorber {
24  public:
29  : fZ(0.)
30  , fMaterial()
31  , fFieldGridFront()
33  , fFieldGridBack() {}
34 
38  virtual ~LitAbsorber() {}
39 
44  const T& GetZ() const { return fZ; }
45 
50  void SetZ(const T& z) { fZ = z; }
51 
56  const LitMaterialInfo<T>& GetMaterial() const { return fMaterial; }
57 
62  void SetMaterial(const LitMaterialInfo<T>& material) {
63  fMaterial = material;
64  }
65 
70  const LitFieldGrid& GetFieldGridFront() const { return fFieldGridFront; }
71 
76  void SetFieldGridFront(const LitFieldGrid& fieldGrid) {
77  fFieldGridFront = fieldGrid;
78  }
79 
85  return fFieldGridMiddle;
86  }
87 
92  void SetFieldGridMiddle(const LitFieldGrid& fieldGrid) {
93  fFieldGridMiddle = fieldGrid;
94  }
95 
100  const LitFieldGrid& GetFieldGridBack() const { return fFieldGridBack; }
101 
106  void SetFieldGridBack(const LitFieldGrid& fieldGrid) {
107  fFieldGridBack = fieldGrid;
108  }
109 
114  std::string ToString() const {
115  return "LitAbsorber: Z=" + lit::parallel::ToString<T>(GetZ())
116  + ", material=" + GetMaterial().ToString();
117  }
118 
123  friend std::ostream& operator<<(std::ostream& strm,
124  const LitAbsorber& absorber) {
125  strm << absorber.ToString();
126  return strm;
127  }
128 
129  private:
130  T fZ; // Z position of the absorber in [cm]
131  LitMaterialInfo<T> fMaterial; // Absorber material
133  fFieldGridFront; // Magnetic field approximation in front of absorber
135  fFieldGridMiddle; // Magnetic field approximation in the middle of absorber
137  fFieldGridBack; // Magnetic field approximation in the back of absorber
138  } _fvecalignment;
139 
140  /* Some typedefs for convenience */
143 
144  } // namespace parallel
145 } // namespace lit
146 
147 #endif /* LITABSORBER_H_ */
lit::parallel::LitAbsorber::LitAbsorber
LitAbsorber()
Constructor.
Definition: LitAbsorber.h:28
lit::parallel::LitAbsorberScal
LitAbsorber< fscal > LitAbsorberScal
Definition: LitAbsorber.h:142
lit::parallel::LitAbsorber::GetZ
const T & GetZ() const
Return Z position of absorber.
Definition: LitAbsorber.h:44
lit::parallel::_fvecalignment
class lit::parallel::LitDetectorLayout _fvecalignment
lit::parallel::LitAbsorber::GetFieldGridMiddle
const LitFieldGrid & GetFieldGridMiddle() const
Return magnetic field grid in the middle of the absorber.
Definition: LitAbsorber.h:84
lit::parallel::LitAbsorber::GetFieldGridBack
const LitFieldGrid & GetFieldGridBack() const
Return magnetic field grid in the back of the absorber.
Definition: LitAbsorber.h:100
lit::parallel::LitAbsorber::SetFieldGridBack
void SetFieldGridBack(const LitFieldGrid &fieldGrid)
Set magnetic field grid in the back of the absorber.
Definition: LitAbsorber.h:106
lit::parallel::LitFieldGrid
Class stores a grid of magnetic field values in XY slice at Z position.
Definition: LitFieldGrid.h:44
lit::parallel::LitAbsorber::fFieldGridFront
LitFieldGrid fFieldGridFront
Definition: LitAbsorber.h:133
lit::parallel::LitAbsorber::GetFieldGridFront
const LitFieldGrid & GetFieldGridFront() const
Return magnetic field grid in front of the absorber.
Definition: LitAbsorber.h:70
lit::parallel::LitAbsorber::SetMaterial
void SetMaterial(const LitMaterialInfo< T > &material)
Set absorber material.
Definition: LitAbsorber.h:62
lit::parallel::LitAbsorberVec
LitAbsorber< fvec > LitAbsorberVec
Definition: LitAbsorber.h:141
lit::parallel::LitAbsorber::fZ
T fZ
Definition: LitAbsorber.h:130
lit::parallel::LitAbsorber::fFieldGridMiddle
LitFieldGrid fFieldGridMiddle
Definition: LitAbsorber.h:135
lit::parallel::LitAbsorber::SetFieldGridMiddle
void SetFieldGridMiddle(const LitFieldGrid &fieldGrid)
Set magnetic field grid in the middle of the absorber.
Definition: LitAbsorber.h:92
lit::parallel::LitAbsorber::GetMaterial
const LitMaterialInfo< T > & GetMaterial() const
Return absorber material.
Definition: LitAbsorber.h:56
lit::parallel::LitAbsorber::ToString
std::string ToString() const
Return std::string representation of the class.
Definition: LitAbsorber.h:114
lit::parallel::LitAbsorber
Absorber in muon detector layout.
Definition: LitAbsorber.h:23
lit::parallel::LitAbsorber::SetZ
void SetZ(const T &z)
Set Z position of absorber.
Definition: LitAbsorber.h:50
lit::parallel::LitAbsorber::fMaterial
LitMaterialInfo< T > fMaterial
Definition: LitAbsorber.h:131
lit::parallel::LitAbsorber::fFieldGridBack
LitFieldGrid fFieldGridBack
Definition: LitAbsorber.h:137
lit::parallel::LitAbsorber::~LitAbsorber
virtual ~LitAbsorber()
Destructor.
Definition: LitAbsorber.h:38
lit::parallel::LitAbsorber::operator<<
friend std::ostream & operator<<(std::ostream &strm, const LitAbsorber &absorber)
Operator << for convenient output to std::ostream.
Definition: LitAbsorber.h:123
lit::parallel::LitAbsorber::SetFieldGridFront
void SetFieldGridFront(const LitFieldGrid &fieldGrid)
Set magnetic field grid in front of the absorber.
Definition: LitAbsorber.h:76
lit
Definition: LitTrackFinderNNVecElectron.h:19