CbmRoot
LitDetectorLayout.h
Go to the documentation of this file.
1 
14 #ifndef LITDETECTORLAYOUT_H_
15 #define LITDETECTORLAYOUT_H_
16 
17 #include "LitStation.h"
18 #include "LitVirtualStation.h"
19 
20 namespace lit {
21  namespace parallel {
22 
32  template<class T>
34  public:
39 
43  virtual ~LitDetectorLayout() {}
44 
49  void AddStation(const LitStation<T>& station) {
50  fStations.push_back(station);
51  }
52 
57  void AddVirtualStation(const LitVirtualStation<T>& virtualStation) {
58  fVirtualStations.push_back(virtualStation);
59  }
60 
65  unsigned char GetNofStations() const { return fStations.size(); }
66 
71  unsigned char GetNofVirtualStations() const {
72  return fVirtualStations.size();
73  }
74 
80  const LitStation<T>& GetStation(unsigned char station) const {
81  return fStations[station];
82  }
83 
90  GetVirtualStation(unsigned char virtualStation) const {
91  return fVirtualStations[virtualStation];
92  }
93 
98  string ToString() const {
99  stringstream ss;
100  ss << "LitDetectorLayout: \n";
101  ss << "virtual stations: nofVirtualStations="
102  << (int) GetNofVirtualStations() << "\n";
103  for (unsigned char i = 0; i < GetNofVirtualStations(); i++) {
104  ss << (int) i << " " << GetVirtualStation(i).ToString() << "\n";
105  }
106  ss << "stations: nofStations=" << (int) GetNofStations() << "\n";
107  for (unsigned char i = 0; i < GetNofStations(); i++) {
108  ss << (int) i << " " << GetStation(i).ToString() << "\n";
109  }
110  return ss.str();
111  }
112 
117  friend ostream& operator<<(ostream& strm,
118  const LitDetectorLayout& layout) {
119  strm << layout.ToString();
120  return strm;
121  }
122 
123  private:
124  vector<LitStation<T>> fStations; // Array with stations
125  vector<LitVirtualStation<T>>
126  fVirtualStations; // Array with virtual stations
128 
134 
140 
141  } // namespace parallel
142 } // namespace lit
143 #endif /* LITDETECTORGEOMETRY_H_ */
lit::parallel::LitDetectorLayout::AddStation
void AddStation(const LitStation< T > &station)
Add station to detector layout.
Definition: LitDetectorLayout.h:49
lit::parallel::LitDetectorLayout::ToString
string ToString() const
Returns string representation of the class.
Definition: LitDetectorLayout.h:98
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
lit::parallel::_fvecalignment
class lit::parallel::LitDetectorLayout _fvecalignment
lit::parallel::LitDetectorLayout::GetVirtualStation
const LitVirtualStation< T > & GetVirtualStation(unsigned char virtualStation) const
Return virtual station by index.
Definition: LitDetectorLayout.h:90
lit::parallel::LitStation
Detector station.
Definition: LitStation.h:31
lit::parallel::LitVirtualStation
Virtual detector station which stores information needed for track propagation.
Definition: LitVirtualStation.h:31
lit::parallel::LitDetectorLayoutVec
LitDetectorLayout< fvec > LitDetectorLayoutVec
Vector version of LitDetectorLayout.
Definition: LitDetectorLayout.h:133
lit::parallel::LitDetectorLayout
Represents detector layout.
Definition: LitDetectorLayout.h:33
lit::parallel::LitDetectorLayout::operator<<
friend ostream & operator<<(ostream &strm, const LitDetectorLayout &layout)
Operator << for convenient output to ostream.
Definition: LitDetectorLayout.h:117
lit::parallel::LitDetectorLayout::~LitDetectorLayout
virtual ~LitDetectorLayout()
Destructor.
Definition: LitDetectorLayout.h:43
lit::parallel::LitDetectorLayout::fStations
vector< LitStation< T > > fStations
Definition: LitDetectorLayout.h:124
lit::parallel::LitDetectorLayout::LitDetectorLayout
LitDetectorLayout()
Constructor.
Definition: LitDetectorLayout.h:38
lit::parallel::LitDetectorLayout::GetNofVirtualStations
unsigned char GetNofVirtualStations() const
Return number of virtual stations.
Definition: LitDetectorLayout.h:71
lit::parallel::LitDetectorLayoutScal
LitDetectorLayout< fscal > LitDetectorLayoutScal
Scalar version of LitDetectorLayout.
Definition: LitDetectorLayout.h:139
lit::parallel::LitDetectorLayout::fVirtualStations
vector< LitVirtualStation< T > > fVirtualStations
Definition: LitDetectorLayout.h:126
lit::parallel::LitDetectorLayout::AddVirtualStation
void AddVirtualStation(const LitVirtualStation< T > &virtualStation)
Add virtual station to detector layout.
Definition: LitDetectorLayout.h:57
LitStation.h
lit::parallel::LitDetectorLayout::GetStation
const LitStation< T > & GetStation(unsigned char station) const
Return station by index.
Definition: LitDetectorLayout.h:80
lit::parallel::LitDetectorLayout::GetNofStations
unsigned char GetNofStations() const
Return number of stations.
Definition: LitDetectorLayout.h:65
LitVirtualStation.h
lit
Definition: LitTrackFinderNNVecElectron.h:19