CbmRoot
LitDetectorLayoutMuon.h
Go to the documentation of this file.
1 
14 #ifndef LITDETECTORLAYOUTMUON_H_
15 #define LITDETECTORLAYOUTMUON_H_
16 
17 #include "LitStationGroupMuon.h"
18 
19 #include <vector>
20 
21 namespace lit {
22  namespace parallel {
23 
30  template<class T>
32  public:
37 
42 
47  void AddStationGroup(const LitStationGroupMuon<T>& stationGroup) {
48  fStationGroups.push_back(stationGroup);
49  }
50 
55  unsigned char GetNofStationGroups() const {
56  return fStationGroups.size();
57  }
58 
64  unsigned char GetNofStations(unsigned char stationGroup) const {
65  return fStationGroups[stationGroup].GetNofStations();
66  }
67 
74  unsigned char GetNofSubstations(unsigned char stationGroup,
75  unsigned char station) const {
76  return fStationGroups[stationGroup]
77  .GetStation(station)
78  .GetNofSubstations();
79  }
80 
87  GetStationGroup(unsigned char stationGroup) const {
88  return fStationGroups[stationGroup];
89  }
90 
97  const LitStationMuon<T>& GetStation(unsigned char stationGroup,
98  unsigned char station) const {
99  return fStationGroups[stationGroup].GetStation(station);
100  }
101 
109  const LitSubstationMuon<T>&
110  GetSubstation(unsigned char stationGroup,
111  unsigned char station,
112  unsigned char substation) const {
113  return fStationGroups[stationGroup].GetStation(station).GetSubstation(
114  substation);
115  }
116 
121  std::string ToString() const {
122  std::string str =
123  "LitDetectorLayoutMuon: nofStationGroups="
124  + lit::parallel::ToString<int>((int) GetNofStationGroups()) + "\n";
125  for (unsigned char i = 0; i < GetNofStationGroups(); i++) {
126  str += lit::parallel::ToString<int>((int) i) + " "
127  + GetStationGroup(i).ToString();
128  }
129  return str;
130  }
131 
136  friend std::ostream& operator<<(std::ostream& strm,
137  const LitDetectorLayoutMuon& layout) {
138  strm << layout.ToString();
139  return strm;
140  }
141 
142  private:
143  std::vector<LitStationGroupMuon<T>>
144  fStationGroups; // Array of station groups
145  } _fvecalignment;
146 
147  /* Some typedefs for convenience */
150 
151  } // namespace parallel
152 } // namespace lit
153 #endif /*LITDETECTORLAYOUTMUON_H_*/
lit::parallel::LitSubstationMuon
Substation in muon detector layout.
Definition: LitSubstationMuon.h:23
lit::parallel::LitDetectorLayoutMuon::fStationGroups
std::vector< LitStationGroupMuon< T > > fStationGroups
Definition: LitDetectorLayoutMuon.h:144
lit::parallel::LitDetectorLayoutMuonVec
LitDetectorLayoutMuon< fvec > LitDetectorLayoutMuonVec
Definition: LitDetectorLayoutMuon.h:148
lit::parallel::LitStationGroupMuon
Definition: LitStationGroupMuon.h:26
lit::parallel::LitDetectorLayoutMuon::AddStationGroup
void AddStationGroup(const LitStationGroupMuon< T > &stationGroup)
Add station group to the layout.
Definition: LitDetectorLayoutMuon.h:47
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
lit::parallel::_fvecalignment
class lit::parallel::LitDetectorLayout _fvecalignment
lit::parallel::LitDetectorLayoutMuon
Muon detector layout.
Definition: LitDetectorLayoutMuon.h:31
lit::parallel::LitDetectorLayoutMuon::GetSubstation
const LitSubstationMuon< T > & GetSubstation(unsigned char stationGroup, unsigned char station, unsigned char substation) const
Return substation for specified station group, station and substation indices.
Definition: LitDetectorLayoutMuon.h:110
lit::parallel::LitDetectorLayoutMuonScal
LitDetectorLayoutMuon< fscal > LitDetectorLayoutMuonScal
Definition: LitDetectorLayoutMuon.h:149
lit::parallel::LitDetectorLayoutMuon::GetStation
const LitStationMuon< T > & GetStation(unsigned char stationGroup, unsigned char station) const
Return station for specified station group and station indices.
Definition: LitDetectorLayoutMuon.h:97
lit::parallel::LitDetectorLayoutMuon::GetStationGroup
const LitStationGroupMuon< T > & GetStationGroup(unsigned char stationGroup) const
Return station group for specified station group index.
Definition: LitDetectorLayoutMuon.h:87
lit::parallel::LitDetectorLayoutMuon::GetNofStations
unsigned char GetNofStations(unsigned char stationGroup) const
Return number of stations for specified station group.
Definition: LitDetectorLayoutMuon.h:64
lit::parallel::LitDetectorLayoutMuon::~LitDetectorLayoutMuon
virtual ~LitDetectorLayoutMuon()
Destructor.
Definition: LitDetectorLayoutMuon.h:41
lit::parallel::LitDetectorLayoutMuon::LitDetectorLayoutMuon
LitDetectorLayoutMuon()
Constructor.
Definition: LitDetectorLayoutMuon.h:36
lit::parallel::LitDetectorLayoutMuon::GetNofSubstations
unsigned char GetNofSubstations(unsigned char stationGroup, unsigned char station) const
Return number of substations for specified station group and station.
Definition: LitDetectorLayoutMuon.h:74
LitStationGroupMuon.h
lit::parallel::LitDetectorLayoutMuon::ToString
std::string ToString() const
Return std::string representation of the class.
Definition: LitDetectorLayoutMuon.h:121
lit::parallel::LitStationMuon
Station in muon detector layout.
Definition: LitStationMuon.h:26
lit::parallel::LitDetectorLayoutMuon::operator<<
friend std::ostream & operator<<(std::ostream &strm, const LitDetectorLayoutMuon &layout)
Operator << for convenient output to std::ostream.
Definition: LitDetectorLayoutMuon.h:136
lit::parallel::LitDetectorLayoutMuon::GetNofStationGroups
unsigned char GetNofStationGroups() const
Return number of station groups.
Definition: LitDetectorLayoutMuon.h:55
lit
Definition: LitTrackFinderNNVecElectron.h:19