CbmRoot
Loading...
Searching...
No Matches
LitStation.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
12#ifndef LITSTATION_H_
13#define LITSTATION_H_
14
15#include "LitVirtualStation.h"
16
17#include <sstream>
18#include <vector>
19using std::ostream;
20using std::stringstream;
21using std::vector;
22
23namespace lit
24{
25 namespace parallel
26 {
27
37 template<class T>
38 class LitStation {
39 public:
44
48 virtual ~LitStation() {}
49
54 void AddVirtualStation(const LitVirtualStation<T>& virtualStation) { fVirtualStations.push_back(virtualStation); }
55
60 unsigned char GetNofVirtualStations() const { return fVirtualStations.size(); }
61
67 const LitVirtualStation<T>& GetVirtualStation(unsigned char virtualStation) const
68 {
69 return fVirtualStations[virtualStation];
70 }
71
76 string ToString() const
77 {
78 stringstream ss;
79 ss << "LitVirtualStation:\n";
80 ss << "virtual stations: nofVirtualStations=" << (int) GetNofVirtualStations() << "\n";
81 for (unsigned char i = 0; i < GetNofVirtualStations(); i++) {
82 ss << (int) i << " " << GetVirtualStation(i).ToString() << "\n";
83 }
84 return ss.str();
85 }
86
91 friend ostream& operator<<(ostream& strm, const LitStation& station)
92 {
93 strm << station.ToString();
94 return strm;
95 }
96
97 private:
98 vector<LitVirtualStation<T>> fVirtualStations; // List of virtual stations
100
106
112
113 } // namespace parallel
114} // namespace lit
115#endif /* LITSTATION_H_ */
Detector station.
Definition LitStation.h:38
friend ostream & operator<<(ostream &strm, const LitStation &station)
Operator << for convenient output to ostream.
Definition LitStation.h:91
LitStation()
Constructor.
Definition LitStation.h:43
vector< LitVirtualStation< T > > fVirtualStations
Definition LitStation.h:98
const LitVirtualStation< T > & GetVirtualStation(unsigned char virtualStation) const
Return virtual station by index.
Definition LitStation.h:67
unsigned char GetNofVirtualStations() const
Return number of virtual stations.
Definition LitStation.h:60
string ToString() const
Returns string representation of the class.
Definition LitStation.h:76
void AddVirtualStation(const LitVirtualStation< T > &virtualStation)
Add virtual station to detector layout.
Definition LitStation.h:54
virtual ~LitStation()
Destructor.
Definition LitStation.h:48
Virtual detector station which stores information needed for track propagation.
class lit::parallel::LitDetectorLayout _fvecalignment
LitStation< fscal > LitStationScal
Scalar version of LitStation.
Definition LitStation.h:111
LitStation< fvec > LitStationVec
Vector version of LitStation.
Definition LitStation.h:105