PandaRoot
PndGemStation.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndGemStation header file -----
15 // ----- Created 12/02/2009 by R. Karabowicz -----
16 // -------------------------------------------------------------------------
17 
25 #ifndef PNDGEMSTATION_H
26 #define PNDGEMSTATION_H 1
27 
28 #include "TObjArray.h"
29 #include "TNamed.h"
30 #include "TString.h"
31 #include "PndDetectorList.h"
32 
33 #include <map>
34 
35 class PndGemSensor;
36 
37 class PndGemStation : public TNamed {
38 
39  public:
41  PndGemStation();
42 
49  PndGemStation(const char *name, Int_t stationNr, Double_t z, Double_t rotation);
50 
52  virtual ~PndGemStation();
53 
56  void SetDetectorId(Int_t stationNr) { fDetectorId = static_cast<int>(DetectorId::kGEM) << 27 | 0 << 21 | stationNr << 8 | 0 << 6; }
57  Int_t GetDetectorId() const { return fDetectorId; }
58  Int_t GetSystemId() const { return ((fDetectorId & (31 << 27)) >> 27); }
59  Int_t GetStationNr() const { return ((fDetectorId & (8191 << 8)) >> 8); }
60  Double_t GetZ(Int_t it = 0);
61  Int_t GetNSensors() const { return fSensors->GetEntriesFast(); }
62  Int_t GetNChannels();
63  TObjArray *GetSensors() { return fSensors; }
64  PndGemSensor *GetSensor(Int_t iSensor) { return (PndGemSensor *)fSensors->At(iSensor); }
65  PndGemSensor *GetSensorByNr(Int_t sensorNr);
66 
68  void AddSensor(PndGemSensor *sensor);
69 
70  Int_t GetNofZ();
71 
73  void Reset();
74 
76  virtual void Print(Bool_t kLong);
77 
78  protected:
79  Int_t fDetectorId; // Unique detector ID
80  Double32_t fZ; // z position of station centre [cm]
81  Double32_t fRotation; // Rotation angle in global c.s [rad]
82  TObjArray *fSensors; // Array of PndGemSensors
83  std::map<Int_t, Int_t> fSensorMap;
84  std::map<Int_t, Int_t> fMcIdMap;
85 
86  Double_t fSensorZ[10];
87 
89 };
90 
91 #endif
Int_t GetNofZ()
Int_t GetDetectorId() const
Definition: PndGemStation.h:57
std::map< Int_t, Int_t > fMcIdMap
Map from sensor number to index.
Definition: PndGemStation.h:84
Double_t GetZ(Int_t it=0)
void AddSensor(PndGemSensor *sensor)
PndGemSensor * GetSensor(Int_t iSensor)
Definition: PndGemStation.h:64
TObjArray * GetSensors()
Definition: PndGemStation.h:63
ClassDef(PndGemStation, 1)
Double32_t fRotation
Definition: PndGemStation.h:81
Int_t GetSystemId() const
Definition: PndGemStation.h:58
Double_t fSensorZ[10]
Map from McId to index.
Definition: PndGemStation.h:86
Int_t GetNChannels()
virtual ~PndGemStation()
Int_t GetStationNr() const
Definition: PndGemStation.h:59
TObjArray * fSensors
Definition: PndGemStation.h:82
Double32_t fZ
Definition: PndGemStation.h:80
virtual void Print(Bool_t kLong)
std::map< Int_t, Int_t > fSensorMap
Definition: PndGemStation.h:83
PndGemSensor * GetSensorByNr(Int_t sensorNr)
Int_t GetNSensors() const
Definition: PndGemStation.h:61
void SetDetectorId(Int_t stationNr)
Definition: PndGemStation.h:56