CbmRoot
Loading...
Searching...
No Matches
LitAbsorber.h
Go to the documentation of this file.
1/* Copyright (C) 2009-2012 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer] */
4
12#ifndef LITABSORBER_H_
13#define LITABSORBER_H_
14
15#include "LitFieldGrid.h"
16
17namespace lit
18{
19 namespace parallel
20 {
21
28 template<class T>
30 public:
35
39 virtual ~LitAbsorber() {}
40
45 const T& GetZ() const { return fZ; }
46
51 void SetZ(const T& z) { fZ = z; }
52
57 const LitMaterialInfo<T>& GetMaterial() const { return fMaterial; }
58
63 void SetMaterial(const LitMaterialInfo<T>& material) { fMaterial = material; }
64
70
75 void SetFieldGridFront(const LitFieldGrid& fieldGrid) { fFieldGridFront = fieldGrid; }
76
82
87 void SetFieldGridMiddle(const LitFieldGrid& fieldGrid) { fFieldGridMiddle = fieldGrid; }
88
93 const LitFieldGrid& GetFieldGridBack() const { return fFieldGridBack; }
94
99 void SetFieldGridBack(const LitFieldGrid& fieldGrid) { fFieldGridBack = fieldGrid; }
100
105 std::string ToString() const
106 {
107 return "LitAbsorber: Z=" + lit::parallel::ToString<T>(GetZ()) + ", material=" + GetMaterial().ToString();
108 }
109
114 friend std::ostream& operator<<(std::ostream& strm, const LitAbsorber& absorber)
115 {
116 strm << absorber.ToString();
117 return strm;
118 }
119
120 private:
121 T fZ; // Z position of the absorber in [cm]
122 LitMaterialInfo<T> fMaterial; // Absorber material
123 LitFieldGrid fFieldGridFront; // Magnetic field approximation in front of absorber
124 LitFieldGrid fFieldGridMiddle; // Magnetic field approximation in the middle of absorber
125 LitFieldGrid fFieldGridBack; // Magnetic field approximation in the back of absorber
127
128 /* Some typedefs for convenience */
131
132 } // namespace parallel
133} // namespace lit
134
135#endif /* LITABSORBER_H_ */
Class stores a grid of magnetic field values in XY slice at Z position.
Absorber in muon detector layout.
Definition LitAbsorber.h:29
const LitFieldGrid & GetFieldGridFront() const
Return magnetic field grid in front of the absorber.
Definition LitAbsorber.h:69
void SetZ(const T &z)
Set Z position of absorber.
Definition LitAbsorber.h:51
void SetMaterial(const LitMaterialInfo< T > &material)
Set absorber material.
Definition LitAbsorber.h:63
void SetFieldGridBack(const LitFieldGrid &fieldGrid)
Set magnetic field grid in the back of the absorber.
Definition LitAbsorber.h:99
const LitFieldGrid & GetFieldGridMiddle() const
Return magnetic field grid in the middle of the absorber.
Definition LitAbsorber.h:81
virtual ~LitAbsorber()
Destructor.
Definition LitAbsorber.h:39
std::string ToString() const
Return std::string representation of the class.
const T & GetZ() const
Return Z position of absorber.
Definition LitAbsorber.h:45
const LitMaterialInfo< T > & GetMaterial() const
Return absorber material.
Definition LitAbsorber.h:57
friend std::ostream & operator<<(std::ostream &strm, const LitAbsorber &absorber)
Operator << for convenient output to std::ostream.
void SetFieldGridMiddle(const LitFieldGrid &fieldGrid)
Set magnetic field grid in the middle of the absorber.
Definition LitAbsorber.h:87
LitMaterialInfo< T > fMaterial
const LitFieldGrid & GetFieldGridBack() const
Return magnetic field grid in the back of the absorber.
Definition LitAbsorber.h:93
void SetFieldGridFront(const LitFieldGrid &fieldGrid)
Set magnetic field grid in front of the absorber.
Definition LitAbsorber.h:75
Class stores a grid of magnetic field values in XY slice at Z position.
LitAbsorber< fscal > LitAbsorberScal
class lit::parallel::LitDetectorLayout _fvecalignment
std::string ToString(const T &value)
Function converts object into a std::string.
Definition LitUtils.h:37
LitAbsorber< fvec > LitAbsorberVec