ATLAS Offline Software
NtupleStationId.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef NtupleStationId_H
6 #define NtupleStationId_H
7 
8 // c - c++
9 #include "sstream"
10 
11 // MuonCalib
13 #include "Identifier/Identifier.h"
15 
16 class MdtIdHelper;
17 namespace MuonGM {
18  class MuonDetectorManager;
19 }
20 
21 namespace MuonCalib {
22 
29 
30 
37  public:
39  inline NtupleStationId() :
40  m_station(-1),
41  m_eta(-99),
42  m_phi(-1),
43  m_ml(0),
44  m_author(0),
45  m_region_hash(0),
46  m_n_ml(-1),
47  m_geom_ok(false) {
48  ResetVectors();
49  }
53  inline NtupleStationId(const MuonFixedId &id) : m_region_hash(0), m_n_ml(-1) {
54  ResetVectors();
55  Initialize(id);
56  }
62  inline NtupleStationId(const std::string &station, const int &eta, const int &phi, const int &ml = 0, const int &author = 0) :
63  m_region_hash(0), m_n_ml(-1) {
64  Initialize(station, eta, phi, ml, author);
65  }
69  inline void Initialize(const MuonFixedId &id) {
70  m_station = id.stationName();
71  m_eta = id.eta();
72  m_phi = id.phi();
73  m_ml = id.mdtMultilayer();
74  m_author = 0;
75  m_geom_ok = false;
76  }
77  inline void Initialize(const int &station, const int &eta, const int &phi, const int &ml = 0, const int &author = 0) {
78  m_station = station;
79  m_eta = eta;
80  m_phi = phi;
81  m_ml = ml;
82  m_author = author;
83  m_geom_ok = false;
84  }
85  inline void ResetVectors() {
86  for (unsigned int ii = 0; ii < 2; ii++) {
87  m_n_layer[ii] = -1;
88  m_n_tubes[ii] = -1;
89  m_layer_min[ii] = -1;
90  m_layer_max[ii] = -1;
91  m_tube_min[ii] = -1;
92  m_tube_max[ii] = -1;
93  }
94  }
100  bool Initialize(const std::string &station, const int &eta, const int &phi, const int &ml = 0, const int &author = 0);
102  void SetStation(const std::string &station);
104  inline void SetPhi(const int &phi) {
105  m_phi = phi;
106  }
107  inline void SetEta(const int &eta) {
108  m_eta = eta;
109  }
110  inline void SetMultilayer(const int &ml) {
111  m_ml = ml;
112  }
113  inline void SetAuthor(const int &author) { m_author = author; }
115  inline bool operator<(const NtupleStationId &other) const {
116  if (m_station < other.m_station) return true;
117  if (m_station > other.m_station) return false;
118  if (m_eta < other.m_eta) return true;
119  if (m_eta > other.m_eta) return false;
120  if (m_phi < other.m_phi) return true;
121  if (m_phi > other.m_phi) return false;
122  if (m_ml < other.m_ml) return true;
123  if (m_ml > other.m_ml) return false;
124  if (m_author < other.m_author) return true;
125  return false;
126  }
127  inline bool operator>(const NtupleStationId &other) const {
128  if (m_station > other.m_station) return true;
129  if (m_station < other.m_station) return false;
130  if (m_eta > other.m_eta) return true;
131  if (m_eta < other.m_eta) return false;
132  if (m_phi > other.m_phi) return true;
133  if (m_phi < other.m_phi) return false;
134  if (m_ml > other.m_ml) return true;
135  if (m_ml < other.m_ml) return false;
136  if (m_author > other.m_author) return true;
137  return false;
138  }
140  inline bool operator==(const MuonFixedId &id) const {
141  if (m_station >= 0)
142  if (id.stationName() != m_station) return false;
143  if (m_eta != -99)
144  if (id.eta() != m_eta) return false;
145  if (m_phi >= 0)
146  if (id.phi() != m_phi) return false;
147  if (m_ml > 0)
148  if (id.mdtMultilayer() != m_ml) return false;
149  return true;
150  }
152  inline bool operator==(const NtupleStationId &id) const {
153  if (m_station != id.m_station) return false;
154  if (m_eta != id.m_eta) return false;
155  if (m_phi != id.m_phi) return false;
156  if (m_ml && id.m_ml)
157  if (m_ml != id.m_ml) return false;
158  if (m_author && id.m_author)
159  if (m_author != id.m_author) return false;
160  return true;
161  }
163  std::string regionId() const;
165  bool InitializeGeometry(const MdtIdHelper &mdtIdHelper, const MuonGM::MuonDetectorManager *detMgr);
167  inline int GetStation() const { return m_station; }
168  inline int GetEta() const { return m_eta; }
169  inline int GetPhi() const { return m_phi; }
170  inline int GetMl() const { return m_ml; }
171  inline const int &GetAuthor() const { return m_author; }
173  inline int NMultilayers() const {
174  if (!m_geom_ok) return -1;
175  return m_n_ml;
176  }
177  inline int NLayers(int ml) const {
178  if (!m_geom_ok || ml >= m_n_ml) return -1;
179  return m_n_layer[ml];
180  }
181  inline int NTubes(int ml) const {
182  if (!m_geom_ok || ml >= m_n_ml) return -1;
183  return m_n_tubes[ml];
184  }
185  inline int LayerMin(int ml) const {
186  if (!m_geom_ok || ml >= m_n_ml) return -1;
187  return m_layer_min[ml];
188  }
189  inline int LayerMax(int ml) const {
190  if (!m_geom_ok || ml >= m_n_ml) return -1;
191  return m_layer_max[ml];
192  }
193  inline int TubeMin(int ml) const {
194  if (!m_geom_ok || ml >= m_n_ml) return -1;
195  return m_tube_min[ml];
196  }
197  inline int TubeMax(int ml) const {
198  if (!m_geom_ok || ml >= m_n_ml) return -1;
199  return m_tube_max[ml];
200  }
201  inline int RegionHash() const {
202  if (!m_geom_ok) return -1;
203  return m_region_hash;
204  }
205  int FixedId() const;
206  //=============================================================================
207  private:
210  int m_author;
214  int m_tube_min[2], m_tube_max[2];
215  bool m_geom_ok;
216  };
217 
218 } // namespace MuonCalib
219 
220 #endif
MuonCalib::NtupleStationId::operator<
bool operator<(const NtupleStationId &other) const
comparision operators for the use as map ids
Definition: NtupleStationId.h:115
MuonCalib::NtupleStationId::GetEta
int GetEta() const
Definition: NtupleStationId.h:168
MuonCalib::NtupleStationId::NMultilayers
int NMultilayers() const
return geometry information
Definition: NtupleStationId.h:173
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
MuonCalib::NtupleStationId::Initialize
void Initialize(const MuonFixedId &id)
initialize function
Definition: NtupleStationId.h:69
MuonCalib::NtupleStationId::SetMultilayer
void SetMultilayer(const int &ml)
Definition: NtupleStationId.h:110
MuonCalib::NtupleStationId::NLayers
int NLayers(int ml) const
Definition: NtupleStationId.h:177
MuonCalib::NtupleStationId::InitializeGeometry
bool InitializeGeometry(const MdtIdHelper &mdtIdHelper, const MuonGM::MuonDetectorManager *detMgr)
initialize geometry information
Definition: NtupleStationId.cxx:37
MuonCalib::NtupleStationId::regionId
std::string regionId() const
return the region id string
Definition: NtupleStationId.cxx:69
MuonCalib::NtupleStationId::m_layer_min
int m_layer_min[2]
Definition: NtupleStationId.h:213
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
MuonCalib::NtupleStationId::m_layer_max
int m_layer_max[2]
Definition: NtupleStationId.h:213
MuonCalib::NtupleStationId
Definition: NtupleStationId.h:36
MuonCalib::NtupleStationId::operator==
bool operator==(const MuonFixedId &id) const
return true if icdentifier matches selection
Definition: NtupleStationId.h:140
MuonCalib::NtupleStationId::TubeMin
int TubeMin(int ml) const
Definition: NtupleStationId.h:193
MuonCalib::NtupleStationId::FixedId
int FixedId() const
Definition: NtupleStationId.cxx:93
MuonCalib::NtupleStationId::RegionHash
int RegionHash() const
Definition: NtupleStationId.h:201
MuonCalib::NtupleStationId::Initialize
void Initialize(const int &station, const int &eta, const int &phi, const int &ml=0, const int &author=0)
Definition: NtupleStationId.h:77
MuonCalib::NtupleStationId::m_n_ml
int m_n_ml
Definition: NtupleStationId.h:212
MuonCalib::NtupleStationId::NtupleStationId
NtupleStationId()
Default constructor.
Definition: NtupleStationId.h:39
MuonCalib::NtupleStationId::m_tube_min
int m_tube_min[2]
Definition: NtupleStationId.h:214
MuonCalib::NtupleStationId::GetMl
int GetMl() const
Definition: NtupleStationId.h:170
MuonCalib::NtupleStationId::m_author
int m_author
Definition: NtupleStationId.h:210
MuonCalib::NtupleStationId::m_eta
int m_eta
Definition: NtupleStationId.h:209
MuonCalib::NtupleStationId::m_region_hash
int m_region_hash
geo model information
Definition: NtupleStationId.h:212
MuonCalib::NtupleStationId::NtupleStationId
NtupleStationId(const MuonFixedId &id)
Initializing Constructor.
Definition: NtupleStationId.h:53
MuonCalib::NtupleStationId::NTubes
int NTubes(int ml) const
Definition: NtupleStationId.h:181
MuonCalib::NtupleStationId::operator>
bool operator>(const NtupleStationId &other) const
Definition: NtupleStationId.h:127
MdtIdHelper
Definition: MdtIdHelper.h:61
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::NtupleStationId::ResetVectors
void ResetVectors()
Definition: NtupleStationId.h:85
MuonCalib::MdtRegionHash
IdentifierHash MdtRegionHash
define type MdtRegionHash
Definition: NtupleStationId.h:28
MuonCalib::NtupleStationId::TubeMax
int TubeMax(int ml) const
Definition: NtupleStationId.h:197
MuonCalib::NtupleStationId::m_n_tubes
int m_n_tubes[2]
Definition: NtupleStationId.h:212
MuonCalib::NtupleStationId::GetPhi
int GetPhi() const
Definition: NtupleStationId.h:169
MuonCalib::NtupleStationId::m_phi
int m_phi
Definition: NtupleStationId.h:209
MuonCalib::NtupleStationId::GetAuthor
const int & GetAuthor() const
Definition: NtupleStationId.h:171
IdentifierHash.h
MuonCalib::MuonFixedId
Definition: MuonFixedId.h:50
MuonCalib::NtupleStationId::LayerMin
int LayerMin(int ml) const
Definition: NtupleStationId.h:185
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
MuonCalib::NtupleStationId::m_tube_max
int m_tube_max[2]
Definition: NtupleStationId.h:214
MuonCalib::MdtBasicRegionHash
IdentifierHash MdtBasicRegionHash
define type MdtBasicRegionHash for the smallest possible MDT calibration region
Definition: NtupleStationId.h:26
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
MuonCalib::NtupleStationId::m_geom_ok
bool m_geom_ok
Definition: NtupleStationId.h:215
CaloCondBlobAlgs_fillNoiseFromASCII.author
string author
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:26
createDCubeDigitHistograms.mdtMultilayer
mdtMultilayer
Definition: createDCubeDigitHistograms.py:112
MuonCalib::NtupleStationId::LayerMax
int LayerMax(int ml) const
Definition: NtupleStationId.h:189
MuonCalib::MdtBasicRegionId
Identifier MdtBasicRegionId
define type MdtBasicRegionId for the smallest possible MDT calibration region
Definition: NtupleStationId.h:24
MuonCalib::NtupleStationId::SetAuthor
void SetAuthor(const int &author)
Definition: NtupleStationId.h:113
MuonCalib::NtupleStationId::operator==
bool operator==(const NtupleStationId &id) const
return true if the regions are the same
Definition: NtupleStationId.h:152
MuonCalib::NtupleStationId::NtupleStationId
NtupleStationId(const std::string &station, const int &eta, const int &phi, const int &ml=0, const int &author=0)
Initializing Constructor.
Definition: NtupleStationId.h:62
MuonCalib::NtupleStationId::m_ml
int m_ml
Definition: NtupleStationId.h:209
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
MuonCalib::NtupleStationId::m_n_layer
int m_n_layer[2]
Definition: NtupleStationId.h:212
MuonCalib::NtupleStationId::m_station
int m_station
id
Definition: NtupleStationId.h:209
MuonCalib::NtupleStationId::SetStation
void SetStation(const std::string &station)
set station, eta or phi seperately
Definition: NtupleStationId.cxx:32
MuonCalib::NtupleStationId::GetStation
int GetStation() const
get station eta and phi
Definition: NtupleStationId.h:167
MuonFixedId.h
MuonCalib::NtupleStationId::SetEta
void SetEta(const int &eta)
Definition: NtupleStationId.h:107
MuonCalib::NtupleStationId::SetPhi
void SetPhi(const int &phi)
set phi
Definition: NtupleStationId.h:104
Identifier
Definition: IdentifierFieldParser.cxx:14