CbmRoot
LitStation.h
Go to the documentation of this file.
1 
8 #ifndef LITSTATION_H_
9 #define LITSTATION_H_
10 
11 #include "LitVirtualStation.h"
12 #include <sstream>
13 #include <vector>
14 using std::ostream;
15 using std::stringstream;
16 using std::vector;
17 
18 namespace lit {
19  namespace parallel {
20 
30  template<class T>
31  class LitStation {
32  public:
37 
41  virtual ~LitStation() {}
42 
47  void AddVirtualStation(const LitVirtualStation<T>& virtualStation) {
48  fVirtualStations.push_back(virtualStation);
49  }
50 
55  unsigned char GetNofVirtualStations() const {
56  return fVirtualStations.size();
57  }
58 
65  GetVirtualStation(unsigned char virtualStation) const {
66  return fVirtualStations[virtualStation];
67  }
68 
73  string ToString() const {
74  stringstream ss;
75  ss << "LitVirtualStation:\n";
76  ss << "virtual stations: nofVirtualStations="
77  << (int) GetNofVirtualStations() << "\n";
78  for (unsigned char i = 0; i < GetNofVirtualStations(); i++) {
79  ss << (int) i << " " << GetVirtualStation(i).ToString() << "\n";
80  }
81  return ss.str();
82  }
83 
88  friend ostream& operator<<(ostream& strm, const LitStation& station) {
89  strm << station.ToString();
90  return strm;
91  }
92 
93  private:
94  vector<LitVirtualStation<T>>
95  fVirtualStations; // List of virtual stations
97 
103 
109 
110  } // namespace parallel
111 } // namespace lit
112 #endif /* LITSTATION_H_ */
lit::parallel::LitStation::AddVirtualStation
void AddVirtualStation(const LitVirtualStation< T > &virtualStation)
Add virtual station to detector layout.
Definition: LitStation.h:47
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
lit::parallel::_fvecalignment
class lit::parallel::LitDetectorLayout _fvecalignment
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::LitStation::fVirtualStations
vector< LitVirtualStation< T > > fVirtualStations
Definition: LitStation.h:95
lit::parallel::LitStation::~LitStation
virtual ~LitStation()
Destructor.
Definition: LitStation.h:41
lit::parallel::LitStation::GetVirtualStation
const LitVirtualStation< T > & GetVirtualStation(unsigned char virtualStation) const
Return virtual station by index.
Definition: LitStation.h:65
lit::parallel::LitStation::ToString
string ToString() const
Returns string representation of the class.
Definition: LitStation.h:73
lit::parallel::LitStation::operator<<
friend ostream & operator<<(ostream &strm, const LitStation &station)
Operator << for convenient output to ostream.
Definition: LitStation.h:88
lit::parallel::LitStationScal
LitStation< fscal > LitStationScal
Scalar version of LitStation.
Definition: LitStation.h:108
lit::parallel::LitStation::GetNofVirtualStations
unsigned char GetNofVirtualStations() const
Return number of virtual stations.
Definition: LitStation.h:55
lit::parallel::LitStationVec
LitStation< fvec > LitStationVec
Vector version of LitStation.
Definition: LitStation.h:102
lit::parallel::LitStation::LitStation
LitStation()
Constructor.
Definition: LitStation.h:36
LitVirtualStation.h
lit
Definition: LitTrackFinderNNVecElectron.h:19