PandaRoot
PndGemStation.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndGemStation header file -----
3 // ----- Created 12/02/2009 by R. Karabowicz -----
4 // -------------------------------------------------------------------------
5 
13 #ifndef PNDGEMSTATION_H
14 #define PNDGEMSTATION_H 1
15 
16 #include "TObjArray.h"
17 #include "TNamed.h"
18 #include "TString.h"
19 #include "PndDetectorList.h"
20 
21 #include <map>
22 
23 class PndGemSensor;
24 
25 class PndGemStation : public TNamed {
26 
27  public:
29  PndGemStation();
30 
37  PndGemStation(const char *name, Int_t stationNr, Double_t z, Double_t rotation);
38 
40  virtual ~PndGemStation();
41 
44  void SetDetectorId(Int_t stationNr) { fDetectorId = static_cast<int>(DetectorId::kGEM) << 27 | 0 << 21 | stationNr << 8 | 0 << 6; }
45  Int_t GetDetectorId() const { return fDetectorId; }
46  Int_t GetSystemId() const { return ((fDetectorId & (31 << 27)) >> 27); }
47  Int_t GetStationNr() const { return ((fDetectorId & (8191 << 8)) >> 8); }
48  Double_t GetZ(Int_t it = 0);
49  Int_t GetNSensors() const { return fSensors->GetEntriesFast(); }
50  Int_t GetNChannels();
51  TObjArray *GetSensors() { return fSensors; }
52  PndGemSensor *GetSensor(Int_t iSensor) { return (PndGemSensor *)fSensors->At(iSensor); }
53  PndGemSensor *GetSensorByNr(Int_t sensorNr);
54 
56  void AddSensor(PndGemSensor *sensor);
57 
58  Int_t GetNofZ();
59 
61  void Reset();
62 
64  virtual void Print(Bool_t kLong);
65 
66  protected:
67  Int_t fDetectorId; // Unique detector ID
68  Double32_t fZ; // z position of station centre [cm]
69  Double32_t fRotation; // Rotation angle in global c.s [rad]
70  TObjArray *fSensors; // Array of PndGemSensors
71  std::map<Int_t, Int_t> fSensorMap;
72  std::map<Int_t, Int_t> fMcIdMap;
73 
74  Double_t fSensorZ[10];
75 
77 };
78 
79 #endif
Int_t GetNofZ()
Int_t GetDetectorId() const
Definition: PndGemStation.h:45
std::map< Int_t, Int_t > fMcIdMap
Map from sensor number to index.
Definition: PndGemStation.h:72
Double_t GetZ(Int_t it=0)
void AddSensor(PndGemSensor *sensor)
PndGemSensor * GetSensor(Int_t iSensor)
Definition: PndGemStation.h:52
TObjArray * GetSensors()
Definition: PndGemStation.h:51
ClassDef(PndGemStation, 1)
Double32_t fRotation
Definition: PndGemStation.h:69
Int_t GetSystemId() const
Definition: PndGemStation.h:46
Double_t fSensorZ[10]
Map from McId to index.
Definition: PndGemStation.h:74
Int_t GetNChannels()
virtual ~PndGemStation()
Int_t GetStationNr() const
Definition: PndGemStation.h:47
TObjArray * fSensors
Definition: PndGemStation.h:70
Double32_t fZ
Definition: PndGemStation.h:68
virtual void Print(Bool_t kLong)
std::map< Int_t, Int_t > fSensorMap
Definition: PndGemStation.h:71
PndGemSensor * GetSensorByNr(Int_t sensorNr)
Int_t GetNSensors() const
Definition: PndGemStation.h:49
void SetDetectorId(Int_t stationNr)
Definition: PndGemStation.h:44