CbmRoot
Loading...
Searching...
No Matches
LitDetectorLayout.h
Go to the documentation of this file.
1/* Copyright (C) 2009-2014 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer] */
4
18#ifndef LITDETECTORLAYOUT_H_
19#define LITDETECTORLAYOUT_H_
20
21#include "LitStation.h"
22#include "LitVirtualStation.h"
23
24namespace lit
25{
26 namespace parallel
27 {
28
38 template<class T>
40 public:
45
49 virtual ~LitDetectorLayout() {}
50
55 void AddStation(const LitStation<T>& station) { fStations.push_back(station); }
56
61 void AddVirtualStation(const LitVirtualStation<T>& virtualStation) { fVirtualStations.push_back(virtualStation); }
62
67 unsigned char GetNofStations() const { return fStations.size(); }
68
73 unsigned char GetNofVirtualStations() const { return fVirtualStations.size(); }
74
80 const LitStation<T>& GetStation(unsigned char station) const { return fStations[station]; }
81
87 const LitVirtualStation<T>& GetVirtualStation(unsigned char virtualStation) const
88 {
89 return fVirtualStations[virtualStation];
90 }
91
96 string ToString() const
97 {
98 stringstream ss;
99 ss << "LitDetectorLayout: \n";
100 ss << "virtual stations: nofVirtualStations=" << (int) GetNofVirtualStations() << "\n";
101 for (unsigned char i = 0; i < GetNofVirtualStations(); i++) {
102 ss << (int) i << " " << GetVirtualStation(i).ToString() << "\n";
103 }
104 ss << "stations: nofStations=" << (int) GetNofStations() << "\n";
105 for (unsigned char i = 0; i < GetNofStations(); i++) {
106 ss << (int) i << " " << GetStation(i).ToString() << "\n";
107 }
108 return ss.str();
109 }
110
115 friend ostream& operator<<(ostream& strm, const LitDetectorLayout& layout)
116 {
117 strm << layout.ToString();
118 return strm;
119 }
120
121 private:
122 vector<LitStation<T>> fStations; // Array with stations
123 vector<LitVirtualStation<T>> fVirtualStations; // Array with virtual stations
125
131
137
138 } // namespace parallel
139} // namespace lit
140#endif /* LITDETECTORGEOMETRY_H_ */
Represents detector layout.
const LitStation< T > & GetStation(unsigned char station) const
Return station by index.
virtual ~LitDetectorLayout()
Destructor.
unsigned char GetNofVirtualStations() const
Return number of virtual stations.
const LitVirtualStation< T > & GetVirtualStation(unsigned char virtualStation) const
Return virtual station by index.
vector< LitVirtualStation< T > > fVirtualStations
void AddVirtualStation(const LitVirtualStation< T > &virtualStation)
Add virtual station to detector layout.
vector< LitStation< T > > fStations
string ToString() const
Returns string representation of the class.
unsigned char GetNofStations() const
Return number of stations.
friend ostream & operator<<(ostream &strm, const LitDetectorLayout &layout)
Operator << for convenient output to ostream.
void AddStation(const LitStation< T > &station)
Add station to detector layout.
Detector station.
Definition LitStation.h:38
Virtual detector station which stores information needed for track propagation.
class lit::parallel::LitDetectorLayout _fvecalignment
LitDetectorLayout< fvec > LitDetectorLayoutVec
Vector version of LitDetectorLayout.
LitDetectorLayout< fscal > LitDetectorLayoutScal
Scalar version of LitDetectorLayout.