CbmRoot
Loading...
Searching...
No Matches
LitStationMuon.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 LITSTATIONMUON_H_
13#define LITSTATIONMUON_H_
14
15#include "LitEnums.h"
16#include "LitSubstationMuon.h"
17
18#include <vector>
19
20namespace lit
21{
22 namespace parallel
23 {
24
31 template<class T>
33 public:
38
42 virtual ~LitStationMuon() {}
43
48 void AddSubstation(const LitSubstationMuon<T>& substation) { fSubstations.push_back(substation); }
49
55 const LitSubstationMuon<T>& GetSubstation(unsigned short index) const { return fSubstations[index]; }
56
61 unsigned char GetNofSubstations() const { return fSubstations.size(); }
62
67 LitHitType GetType() const { return fType; }
68
73 void SetType(LitHitType type) { fType = type; }
74
79 std::string ToString() const
80 {
81 std::string str = "LitStationMuon: type=" + lit::parallel::ToString<LitHitType>(GetType())
82 + ", nofSubstations=" + lit::parallel::ToString<int>((int) GetNofSubstations()) + "\n";
83 for (unsigned char i = 0; i < GetNofSubstations(); i++) {
84 str += " " + lit::parallel::ToString<int>((int) i) + " " + GetSubstation(i).ToString();
85 }
86 return str;
87 }
88
93 friend std::ostream& operator<<(std::ostream& strm, const LitStationMuon& station)
94 {
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>> fSubstations; // Array of substations in the station
103
104 /* Some typedefs for convenience */
107
108 } // namespace parallel
109} // namespace lit
110#endif /* LITSTATIONMUON_H_ */
Enumerations used in the parallel track reconstruction.
Station in muon detector layout.
virtual ~LitStationMuon()
Destructor.
LitHitType GetType() const
Return type of hits for station.
void AddSubstation(const LitSubstationMuon< T > &substation)
Add substation to station.
std::string ToString() const
Return std::string representation for the class.
const LitSubstationMuon< T > & GetSubstation(unsigned short index) const
Return substation by index.
friend std::ostream & operator<<(std::ostream &strm, const LitStationMuon &station)
Operator << for convenient output to std::ostream.
unsigned char GetNofSubstations() const
Return number of substations in station.
void SetType(LitHitType type)
Set type of hits for station.
std::vector< LitSubstationMuon< T > > fSubstations
Substation in muon detector layout.
class lit::parallel::LitDetectorLayout _fvecalignment
LitHitType
Type of the hit and station.
Definition LitEnums.h:28
std::string ToString(const T &value)
Function converts object into a std::string.
Definition LitUtils.h:37
LitStationMuon< fscal > LitStationMuonScal
LitStationMuon< fvec > LitStationMuonVec