CbmRoot
Loading...
Searching...
No Matches
LitDetectorLayoutMuon.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
18#ifndef LITDETECTORLAYOUTMUON_H_
19#define LITDETECTORLAYOUTMUON_H_
20
21#include "LitStationGroupMuon.h"
22
23#include <vector>
24
25namespace lit
26{
27 namespace parallel
28 {
29
36 template<class T>
38 public:
43
48
53 void AddStationGroup(const LitStationGroupMuon<T>& stationGroup) { fStationGroups.push_back(stationGroup); }
54
59 unsigned char GetNofStationGroups() const { return fStationGroups.size(); }
60
66 unsigned char GetNofStations(unsigned char stationGroup) const
67 {
68 return fStationGroups[stationGroup].GetNofStations();
69 }
70
77 unsigned char GetNofSubstations(unsigned char stationGroup, unsigned char station) const
78 {
79 return fStationGroups[stationGroup].GetStation(station).GetNofSubstations();
80 }
81
87 const LitStationGroupMuon<T>& GetStationGroup(unsigned char stationGroup) const
88 {
89 return fStationGroups[stationGroup];
90 }
91
98 const LitStationMuon<T>& GetStation(unsigned char stationGroup, unsigned char station) const
99 {
100 return fStationGroups[stationGroup].GetStation(station);
101 }
102
110 const LitSubstationMuon<T>& GetSubstation(unsigned char stationGroup, unsigned char station,
111 unsigned char substation) const
112 {
113 return fStationGroups[stationGroup].GetStation(station).GetSubstation(substation);
114 }
115
120 std::string ToString() const
121 {
122 std::string str =
123 "LitDetectorLayoutMuon: nofStationGroups=" + lit::parallel::ToString<int>((int) GetNofStationGroups()) + "\n";
124 for (unsigned char i = 0; i < GetNofStationGroups(); i++) {
125 str += lit::parallel::ToString<int>((int) i) + " " + GetStationGroup(i).ToString();
126 }
127 return str;
128 }
129
134 friend std::ostream& operator<<(std::ostream& strm, const LitDetectorLayoutMuon& layout)
135 {
136 strm << layout.ToString();
137 return strm;
138 }
139
140 private:
141 std::vector<LitStationGroupMuon<T>> fStationGroups; // Array of station groups
143
144 /* Some typedefs for convenience */
147
148 } // namespace parallel
149} // namespace lit
150#endif /*LITDETECTORLAYOUTMUON_H_*/
unsigned char GetNofStationGroups() const
Return number of station groups.
const LitStationMuon< T > & GetStation(unsigned char stationGroup, unsigned char station) const
Return station for specified station group and station indices.
unsigned char GetNofStations(unsigned char stationGroup) const
Return number of stations for specified station group.
std::vector< LitStationGroupMuon< T > > fStationGroups
void AddStationGroup(const LitStationGroupMuon< T > &stationGroup)
Add station group to the layout.
unsigned char GetNofSubstations(unsigned char stationGroup, unsigned char station) const
Return number of substations for specified station group and station.
friend std::ostream & operator<<(std::ostream &strm, const LitDetectorLayoutMuon &layout)
Operator << for convenient output to std::ostream.
const LitSubstationMuon< T > & GetSubstation(unsigned char stationGroup, unsigned char station, unsigned char substation) const
Return substation for specified station group, station and substation indices.
const LitStationGroupMuon< T > & GetStationGroup(unsigned char stationGroup) const
Return station group for specified station group index.
std::string ToString() const
Return std::string representation of the class.
Station in muon detector layout.
Substation in muon detector layout.
LitDetectorLayoutMuon< fvec > LitDetectorLayoutMuonVec
class lit::parallel::LitDetectorLayout _fvecalignment
LitDetectorLayoutMuon< fscal > LitDetectorLayoutMuonScal
std::string ToString(const T &value)
Function converts object into a std::string.
Definition LitUtils.h:37