CbmRoot
LitStationGroupMuon.h
Go to the documentation of this file.
1 
8 #ifndef LITSTATIONGROUP_H_
9 #define LITSTATIONGROUP_H_
10 
11 #include "../LitFieldGrid.h"
12 #include "../LitFieldRegion.h"
13 #include "LitAbsorber.h"
14 #include "LitStationMuon.h"
15 
16 namespace lit {
17  namespace parallel {
18 
25  template<class T>
27  public:
32  : fFieldGridFront()
34  , fFieldGridBack()
35  , fStations()
36  , fAbsorber() {}
37 
41  virtual ~LitStationGroupMuon() {}
42 
47  const LitFieldGrid& GetFieldGridFront() const { return fFieldGridFront; }
48 
53  void SetFieldGridFront(const LitFieldGrid& fieldGrid) {
54  fFieldGridFront = fieldGrid;
55  }
56 
62  return fFieldGridMiddle;
63  }
64 
69  void SetFieldGridMiddle(const LitFieldGrid& fieldGrid) {
70  fFieldGridMiddle = fieldGrid;
71  }
72 
77  const LitFieldGrid& GetFieldGridBack() const { return fFieldGridBack; }
78 
83  void SetFieldGridBack(const LitFieldGrid& fieldGrid) {
84  fFieldGridBack = fieldGrid;
85  }
86 
91  void AddStation(const LitStationMuon<T>& station) {
92  fStations.push_back(station);
93  }
94 
100  const LitStationMuon<T>& GetStation(unsigned short index) const {
101  return fStations[index];
102  }
103 
108  unsigned char GetNofStations() const { return fStations.size(); }
109 
114  const LitAbsorber<T>& GetAbsorber() const { return fAbsorber; }
115 
120  void SetAbsorber(const LitAbsorber<T>& absorber) { fAbsorber = absorber; }
121 
128  void GetFieldRegion(T x, T y, LitFieldRegion<T>& field) const {
129  LitFieldValue<T> v1, v2, v3;
133  field.Set(v1,
135  v2,
137  v3,
138  fFieldGridBack.GetZ());
139  }
140 
145  std::string ToString() const {
146  std::string str = "LitStationGroupMuon: nofStations="
147  + lit::parallel::ToString<int>((int) GetNofStations())
148  + "\n";
149  for (unsigned char i = 0; i < GetNofStations(); i++) {
150  str += " " + lit::parallel::ToString<int>((int) i) + " "
151  + GetStation(i).ToString();
152  }
153  str += " " + GetAbsorber().ToString();
154  return str;
155  }
156 
161  friend std::ostream& operator<<(std::ostream& strm,
162  const LitStationGroupMuon& stationGroup) {
163  strm << stationGroup.ToString();
164  return strm;
165  }
166 
167  private:
168  // This field slices are used to construct LitFieldRegion
169  // in the group of stations. We need 3 values in order to use
170  // parabolic approximation. So the values are in front, middle
171  // and back of the gap.
172  LitFieldGrid fFieldGridFront; // Magnetic field approximation in front
174  fFieldGridMiddle; // Magnetic field approximation in the middle
175  LitFieldGrid fFieldGridBack; // Magnetic field approximation in the back
176 
177  std::vector<LitStationMuon<T>> fStations; // Array with stations
179  } _fvecalignment;
180 
181  /* Some typedefs for convenience */
184 
185  } // namespace parallel
186 } // namespace lit
187 
188 #endif /* LITSTATIONGROUP_H_ */
lit::parallel::LitStationGroupMuon::fFieldGridBack
LitFieldGrid fFieldGridBack
Definition: LitStationGroupMuon.h:175
lit::parallel::LitStationGroupMuon::SetFieldGridBack
void SetFieldGridBack(const LitFieldGrid &fieldGrid)
Set magnetic field grid in the back of the absorber.
Definition: LitStationGroupMuon.h:83
lit::parallel::LitFieldGrid::GetFieldValue
void GetFieldValue(fscal x, fscal y, LitFieldValue< fscal > &B) const
Return field value for (X, Y) position (scalar version).
Definition: LitFieldGrid.h:113
LitAbsorber.h
Absorber in muon detector layout.
lit::parallel::LitStationGroupMuon::AddStation
void AddStation(const LitStationMuon< T > &station)
Add station to the station group.
Definition: LitStationGroupMuon.h:91
lit::parallel::LitStationGroupMuon::SetFieldGridMiddle
void SetFieldGridMiddle(const LitFieldGrid &fieldGrid)
Set field grid in the middle of the absorber.
Definition: LitStationGroupMuon.h:69
lit::parallel::LitStationGroupMuon::SetAbsorber
void SetAbsorber(const LitAbsorber< T > &absorber)
Set absorber.
Definition: LitStationGroupMuon.h:120
lit::parallel::LitStationGroupMuon::fFieldGridMiddle
LitFieldGrid fFieldGridMiddle
Definition: LitStationGroupMuon.h:174
lit::parallel::LitStationGroupMuon
Definition: LitStationGroupMuon.h:26
LitStationMuon.h
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
lit::parallel::LitStationGroupMuon::fAbsorber
LitAbsorber< T > fAbsorber
Definition: LitStationGroupMuon.h:178
lit::parallel::LitStationGroupMuon::ToString
std::string ToString() const
Return std::string representation for the class.
Definition: LitStationGroupMuon.h:145
lit::parallel::_fvecalignment
class lit::parallel::LitDetectorLayout _fvecalignment
lit::parallel::LitStationGroupMuonScal
LitStationGroupMuon< fscal > LitStationGroupMuonScal
Definition: LitStationGroupMuon.h:183
lit::parallel::LitStationGroupMuon::GetAbsorber
const LitAbsorber< T > & GetAbsorber() const
Return absorber.
Definition: LitStationGroupMuon.h:114
lit::parallel::LitStationGroupMuon::SetFieldGridFront
void SetFieldGridFront(const LitFieldGrid &fieldGrid)
Set field grid in front of the absorber.
Definition: LitStationGroupMuon.h:53
lit::parallel::LitStationGroupMuonVec
LitStationGroupMuon< fvec > LitStationGroupMuonVec
Definition: LitStationGroupMuon.h:182
lit::parallel::LitStationGroupMuon::GetFieldGridBack
const LitFieldGrid & GetFieldGridBack() const
Return magnetic field grid in the back of the absorber.
Definition: LitStationGroupMuon.h:77
lit::parallel::LitFieldGrid
Class stores a grid of magnetic field values in XY slice at Z position.
Definition: LitFieldGrid.h:44
lit::parallel::LitFieldRegion
Storage for field approximation along Z.
Definition: LitFieldRegion.h:26
lit::parallel::LitFieldValue
Magnetic field value at a certain point in the space.
Definition: LitFieldValue.h:29
lit::parallel::LitStationGroupMuon::GetFieldGridFront
const LitFieldGrid & GetFieldGridFront() const
Return magnetic field grid in front of the absorber.
Definition: LitStationGroupMuon.h:47
lit::parallel::LitStationGroupMuon::GetNofStations
unsigned char GetNofStations() const
Return number of stations in this station group.
Definition: LitStationGroupMuon.h:108
lit::parallel::LitStationGroupMuon::operator<<
friend std::ostream & operator<<(std::ostream &strm, const LitStationGroupMuon &stationGroup)
Operator << for convenient output to std::ostream.
Definition: LitStationGroupMuon.h:161
lit::parallel::LitStationGroupMuon::fFieldGridFront
LitFieldGrid fFieldGridFront
Definition: LitStationGroupMuon.h:172
lit::parallel::LitStationGroupMuon::GetFieldGridMiddle
const LitFieldGrid & GetFieldGridMiddle() const
Return magnetic field grid in the middle of the absorber.
Definition: LitStationGroupMuon.h:61
lit::parallel::LitStationGroupMuon::~LitStationGroupMuon
virtual ~LitStationGroupMuon()
Destructor.
Definition: LitStationGroupMuon.h:41
lit::parallel::LitFieldRegion::Set
void Set(const LitFieldValue< T > &B0, const T B0z, const LitFieldValue< T > &B1, const T B1z, const LitFieldValue< T > &B2, const T B2z)
Sets field region using three field values.
Definition: LitFieldRegion.h:40
lit::parallel::LitFieldGrid::GetZ
fscal GetZ() const
Returns Z position of the grid.
Definition: LitFieldGrid.h:65
lit::parallel::LitStationGroupMuon::LitStationGroupMuon
LitStationGroupMuon()
Constructor.
Definition: LitStationGroupMuon.h:31
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
lit::parallel::LitStationGroupMuon::GetFieldRegion
void GetFieldRegion(T x, T y, LitFieldRegion< T > &field) const
Calculate field region for the group of stations.
Definition: LitStationGroupMuon.h:128
lit::parallel::LitAbsorber
Absorber in muon detector layout.
Definition: LitAbsorber.h:23
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
lit::parallel::LitStationGroupMuon::GetStation
const LitStationMuon< T > & GetStation(unsigned short index) const
Return station by index.
Definition: LitStationGroupMuon.h:100
lit::parallel::LitStationMuon
Station in muon detector layout.
Definition: LitStationMuon.h:26
lit::parallel::LitStationGroupMuon::fStations
std::vector< LitStationMuon< T > > fStations
Definition: LitStationGroupMuon.h:177
lit
Definition: LitTrackFinderNNVecElectron.h:19