ATLAS Offline Software
Loading...
Searching...
No Matches
NtupleStationId.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 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
16class MdtIdHelper;
17namespace MuonGM {
19}
20
21namespace MuonCalib {
22
29
30
35
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),
46 m_n_ml(-1),
47 m_geom_ok(false) {
49 }
50
53 inline NtupleStationId(const MuonFixedId &id) : m_region_hash(0), m_n_ml(-1) {
55 Initialize(id);
56 }
57
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 }
66
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 }
95
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 }
139
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 }
151
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 }
162
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:
209 int m_station{}, m_eta{}, m_phi{}, m_ml{};
210 int m_author{};
213 int m_layer_min[2]{}, m_layer_max[2]{};
214 int m_tube_min[2]{}, m_tube_max[2]{};
215 bool m_geom_ok{};
216 };
217
218} // namespace MuonCalib
219
220#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
This is a "hash" representation of an Identifier.
Implements fixed identifiers not dependent upon Athena Identifier for internal use in the calibration...
Definition MuonFixedId.h:50
void Initialize(const MuonFixedId &id)
initialize function
bool InitializeGeometry(const MdtIdHelper &mdtIdHelper, const MuonGM::MuonDetectorManager *detMgr)
initialize geometry information
NtupleStationId()
Default constructor.
NtupleStationId(const std::string &station, const int &eta, const int &phi, const int &ml=0, const int &author=0)
Initializing Constructor.
const int & GetAuthor() const
int NMultilayers() const
return geometry information
void SetAuthor(const int &author)
void SetMultilayer(const int &ml)
void SetStation(const std::string &station)
set station, eta or phi seperately
void Initialize(const int &station, const int &eta, const int &phi, const int &ml=0, const int &author=0)
bool operator==(const NtupleStationId &id) const
return true if the regions are the same
bool operator==(const MuonFixedId &id) const
return true if icdentifier matches selection
NtupleStationId(const MuonFixedId &id)
Initializing Constructor.
int m_region_hash
geo model information
void SetEta(const int &eta)
bool operator<(const NtupleStationId &other) const
comparision operators for the use as map ids
void SetPhi(const int &phi)
set phi
int GetStation() const
get station eta and phi
bool operator>(const NtupleStationId &other) const
std::string regionId() const
return the region id string
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Identifier MdtBasicRegionId
define type MdtBasicRegionId for the smallest possible MDT calibration region
IdentifierHash MdtBasicRegionHash
define type MdtBasicRegionHash for the smallest possible MDT calibration region
IdentifierHash MdtRegionHash
define type MdtRegionHash
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27