CbmRoot
Loading...
Searching...
No Matches
LitStationGroupMuon.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 LITSTATIONGROUP_H_
13#define LITSTATIONGROUP_H_
14
15#include "LitAbsorber.h"
16#include "LitFieldGrid.h"
17#include "LitFieldRegion.h"
18#include "LitStationMuon.h"
19
20namespace lit
21{
22 namespace parallel
23 {
24
31 template<class T>
33 public:
38
43
49
54 void SetFieldGridFront(const LitFieldGrid& fieldGrid) { fFieldGridFront = fieldGrid; }
55
61
66 void SetFieldGridMiddle(const LitFieldGrid& fieldGrid) { fFieldGridMiddle = fieldGrid; }
67
72 const LitFieldGrid& GetFieldGridBack() const { return fFieldGridBack; }
73
78 void SetFieldGridBack(const LitFieldGrid& fieldGrid) { fFieldGridBack = fieldGrid; }
79
84 void AddStation(const LitStationMuon<T>& station) { fStations.push_back(station); }
85
91 const LitStationMuon<T>& GetStation(unsigned short index) const { return fStations[index]; }
92
97 unsigned char GetNofStations() const { return fStations.size(); }
98
103 const LitAbsorber<T>& GetAbsorber() const { return fAbsorber; }
104
109 void SetAbsorber(const LitAbsorber<T>& absorber) { fAbsorber = absorber; }
110
117 void GetFieldRegion(T x, T y, LitFieldRegion<T>& field) const
118 {
119 LitFieldValue<T> v1, v2, v3;
124 }
125
130 std::string ToString() const
131 {
132 std::string str =
133 "LitStationGroupMuon: nofStations=" + lit::parallel::ToString<int>((int) GetNofStations()) + "\n";
134 for (unsigned char i = 0; i < GetNofStations(); i++) {
135 str += " " + lit::parallel::ToString<int>((int) i) + " " + GetStation(i).ToString();
136 }
137 str += " " + GetAbsorber().ToString();
138 return str;
139 }
140
145 friend std::ostream& operator<<(std::ostream& strm, const LitStationGroupMuon& stationGroup)
146 {
147 strm << stationGroup.ToString();
148 return strm;
149 }
150
151 private:
152 // This field slices are used to construct LitFieldRegion
153 // in the group of stations. We need 3 values in order to use
154 // parabolic approximation. So the values are in front, middle
155 // and back of the gap.
156 LitFieldGrid fFieldGridFront; // Magnetic field approximation in front
157 LitFieldGrid fFieldGridMiddle; // Magnetic field approximation in the middle
158 LitFieldGrid fFieldGridBack; // Magnetic field approximation in the back
159
160 std::vector<LitStationMuon<T>> fStations; // Array with stations
163
164 /* Some typedefs for convenience */
167
168 } // namespace parallel
169} // namespace lit
170
171#endif /* LITSTATIONGROUP_H_ */
Absorber in muon detector layout.
Class stores a grid of magnetic field values in XY slice at Z position.
Absorber in muon detector layout.
Definition LitAbsorber.h:29
Class stores a grid of magnetic field values in XY slice at Z position.
fscal GetZ() const
Returns Z position of the grid.
void GetFieldValue(fscal x, fscal y, LitFieldValue< fscal > &B) const
Return field value for (X, Y) position (scalar version).
Storage for field approximation along Z.
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.
Magnetic field value at a certain point in the space.
friend std::ostream & operator<<(std::ostream &strm, const LitStationGroupMuon &stationGroup)
Operator << for convenient output to std::ostream.
void SetFieldGridFront(const LitFieldGrid &fieldGrid)
Set field grid in front of the absorber.
std::string ToString() const
Return std::string representation for the class.
const LitFieldGrid & GetFieldGridFront() const
Return magnetic field grid in front of the absorber.
void GetFieldRegion(T x, T y, LitFieldRegion< T > &field) const
Calculate field region for the group of stations.
const LitFieldGrid & GetFieldGridMiddle() const
Return magnetic field grid in the middle of the absorber.
unsigned char GetNofStations() const
Return number of stations in this station group.
void SetAbsorber(const LitAbsorber< T > &absorber)
Set absorber.
std::vector< LitStationMuon< T > > fStations
void SetFieldGridBack(const LitFieldGrid &fieldGrid)
Set magnetic field grid in the back of the absorber.
const LitStationMuon< T > & GetStation(unsigned short index) const
Return station by index.
const LitAbsorber< T > & GetAbsorber() const
Return absorber.
void SetFieldGridMiddle(const LitFieldGrid &fieldGrid)
Set field grid in the middle of the absorber.
const LitFieldGrid & GetFieldGridBack() const
Return magnetic field grid in the back of the absorber.
void AddStation(const LitStationMuon< T > &station)
Add station to the station group.
Station in muon detector layout.
class lit::parallel::LitDetectorLayout _fvecalignment
std::string ToString(const T &value)
Function converts object into a std::string.
Definition LitUtils.h:37
LitStationGroupMuon< fscal > LitStationGroupMuonScal
LitStationGroupMuon< fvec > LitStationGroupMuonVec