CbmRoot
LitStationMuon.h
Go to the documentation of this file.
1 
8 #ifndef LITSTATIONMUON_H_
9 #define LITSTATIONMUON_H_
10 
11 #include "../LitEnums.h"
12 #include "LitSubstationMuon.h"
13 
14 #include <vector>
15 
16 namespace lit {
17  namespace parallel {
18 
25  template<class T>
27  public:
32 
36  virtual ~LitStationMuon() {}
37 
42  void AddSubstation(const LitSubstationMuon<T>& substation) {
43  fSubstations.push_back(substation);
44  }
45 
51  const LitSubstationMuon<T>& GetSubstation(unsigned short index) const {
52  return fSubstations[index];
53  }
54 
59  unsigned char GetNofSubstations() const { return fSubstations.size(); }
60 
65  LitHitType GetType() const { return fType; }
66 
71  void SetType(LitHitType type) { fType = type; }
72 
77  std::string ToString() const {
78  std::string str =
79  "LitStationMuon: type="
80  + lit::parallel::ToString<LitHitType>(GetType()) + ", nofSubstations="
81  + lit::parallel::ToString<int>((int) GetNofSubstations()) + "\n";
82  for (unsigned char i = 0; i < GetNofSubstations(); i++) {
83  str += " " + lit::parallel::ToString<int>((int) i) + " "
84  + GetSubstation(i).ToString();
85  }
86  return str;
87  }
88 
93  friend std::ostream& operator<<(std::ostream& strm,
94  const LitStationMuon& station) {
95  strm << station.ToString();
96  return strm;
97  }
98 
99  private:
100  LitHitType fType; // Type of hits on the station
101  std::vector<LitSubstationMuon<T>>
102  fSubstations; // Array of substations in the station
103  } _fvecalignment;
104 
105  /* Some typedefs for convenience */
108 
109  } // namespace parallel
110 } // namespace lit
111 #endif /* LITSTATIONMUON_H_ */
lit::parallel::LitSubstationMuon
Substation in muon detector layout.
Definition: LitSubstationMuon.h:23
lit::parallel::LitStationMuon::fSubstations
std::vector< LitSubstationMuon< T > > fSubstations
Definition: LitStationMuon.h:102
lit::parallel::LitStationMuon::GetNofSubstations
unsigned char GetNofSubstations() const
Return number of substations in station.
Definition: LitStationMuon.h:59
lit::parallel::kLITPIXELHIT
@ kLITPIXELHIT
Definition: LitEnums.h:23
lit::parallel::LitStationMuon::ToString
std::string ToString() const
Return std::string representation for the class.
Definition: LitStationMuon.h:77
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
lit::parallel::_fvecalignment
class lit::parallel::LitDetectorLayout _fvecalignment
lit::parallel::LitHitType
LitHitType
Type of the hit and station.
Definition: LitEnums.h:21
lit::parallel::LitStationMuon::operator<<
friend std::ostream & operator<<(std::ostream &strm, const LitStationMuon &station)
Operator << for convenient output to std::ostream.
Definition: LitStationMuon.h:93
lit::parallel::LitStationMuon::GetType
LitHitType GetType() const
Return type of hits for station.
Definition: LitStationMuon.h:65
lit::parallel::LitStationMuon::~LitStationMuon
virtual ~LitStationMuon()
Destructor.
Definition: LitStationMuon.h:36
lit::parallel::LitStationMuon::GetSubstation
const LitSubstationMuon< T > & GetSubstation(unsigned short index) const
Return substation by index.
Definition: LitStationMuon.h:51
lit::parallel::LitStationMuon::AddSubstation
void AddSubstation(const LitSubstationMuon< T > &substation)
Add substation to station.
Definition: LitStationMuon.h:42
lit::parallel::LitStationMuon::LitStationMuon
LitStationMuon()
Constructor.
Definition: LitStationMuon.h:31
lit::parallel::LitStationMuonVec
LitStationMuon< fvec > LitStationMuonVec
Definition: LitStationMuon.h:106
lit::parallel::LitStationMuon::fType
LitHitType fType
Definition: LitStationMuon.h:100
lit::parallel::LitStationMuonScal
LitStationMuon< fscal > LitStationMuonScal
Definition: LitStationMuon.h:107
lit::parallel::LitStationMuon
Station in muon detector layout.
Definition: LitStationMuon.h:26
LitSubstationMuon.h
lit
Definition: LitTrackFinderNNVecElectron.h:19
lit::parallel::LitStationMuon::SetType
void SetType(LitHitType type)
Set type of hits for station.
Definition: LitStationMuon.h:71