ATLAS Offline Software
Loading...
Searching...
No Matches
MuonTGC_CablingSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5/***************************************************************************
6 MuonTGC_CablingSvc.h
7 Description : online-offline ID mapper for TGC
8***************************************************************************/
9
10#ifndef MUONTGC_CABLING_MUONTGC_CABLINGSVC_H
11#define MUONTGC_CABLING_MUONTGC_CABLINGSVC_H
12
14#include "GaudiKernel/ServiceHandle.h"
15#include "GaudiKernel/ToolHandle.h"
16
19#include "GaudiKernel/Service.h"
22
23#include <memory>
24#include <string>
25#include <vector>
26#include <algorithm>
27
28class Identifier;
29
31{
32 public:
33 MuonTGC_CablingSvc(const std::string& name, ISvcLocator* svc);
34 virtual ~MuonTGC_CablingSvc() = default;
35
36 virtual StatusCode initialize(void) override;
37
39
40 // give max value of the ROD ID
42
43 // give max value of ReadoutID parameters
44 void getReadoutIDRanges(int& maxRodId,
45 int& maxSRodId,
46 int& maxSswId,
47 int& maxSbloc,
48 int& minChannelId,
49 int& maxChannelId) const;
50
51 // give phi-range which a ROD covers
52 bool getCoveragefromRodID(const int rodID,
53 double & startPhi,
54 double & endPhi) const;
55
56 bool getCoveragefromRodID(const int rodID,
57 int & startEndcapSector,
58 int & coverageOfEndcapSector,
59 int & startForwardSector,
60 int & coverageOfForwardSector) const;
61
62 // give phi-range which a SROD covers
63 bool getCoveragefromSRodID(const int srodID,
64 double & startPhi,
65 double & endPhi) const;
66
67 bool getCoveragefromSRodID(const int srodID,
68 int & startEndcapSector,
69 int & coverageOfEndcapSector,
70 int & startForwardSector,
71 int & coverageOfForwardSector) const;
72
73 // Readout ID is ored
74 bool isOredChannel(const int subDetectorID,
75 const int rodID,
76 const int sswID,
77 const int sbLoc,
78 const int channelID) const;
79
80
81 // Offline ID has adjacent Readout ID
82 bool hasAdjacentChannel(const Identifier & offlineID) const;
83
84
85 // Online ID has adjacent Readout ID
86 bool hasAdjacentChannel(const int subsystemNumber,
87 const int octantNumber,
88 const int moduleNumber,
89 const int layerNumber,
90 const int rNumber,
91 const int wireOrStrip,
92 const int channelNumber) const;
93
94
95 // readout IDs -> offline IDs
97 const int subDetectorID,
98 const int rodID,
99 const int sswID,
100 const int sbLoc,
101 const int channelID,
102 bool orChannel=false) const;
103
104
105 // offline IDs -> readout IDs
106 bool getReadoutIDfromOfflineID(const Identifier & offlineID,
107 int & subDetectorID,
108 int & rodID,
109 int & sswID,
110 int & sbLoc,
111 int & channelID,
112 bool adChannel=false) const;
113
114 // offline ID -> online IDs
115 bool getOnlineIDfromOfflineID(const Identifier & offlineID,
116 int & subsystemNumber,
117 int & octantNumber,
118 int & moduleNumber,
119 int & layerNumber,
120 int & rNumber,
121 int & wireOrStrip,
122 int & channelNumber) const;
123
124 // online IDs -> offline ID
125 bool getOfflineIDfromOnlineID(Identifier & offlineID,
126 const int subsystemNumber,
127 const int octantNumber,
128 const int moduleNumber,
129 const int layerNumber,
130 const int rNumber,
131 const int wireOrStrip,
132 const int channelNumber) const;
133
134 // readout IDs -> online IDs
135 bool getOnlineIDfromReadoutID(const int subDetectorID,
136 const int rodID,
137 const int sswID,
138 const int sbLoc,
139 const int channelID,
140 int & subsystemNumber,
141 int & octantNumber,
142 int & moduleNumber,
143 int & layerNumber,
144 int & rNumber,
145 int & wireOrStrip,
146 int & channelNumber,
147 bool orChannel=false) const;
148
149 // online IDs -> readout IDs
150 bool getReadoutIDfromOnlineID(int & subDetectorID,
151 int & rodID,
152 int & sswID,
153 int & sbLoc,
154 int & channelID,
155 const int subsystemNumber,
156 const int octantNumber,
157 const int moduleNumber,
158 const int layerNumber,
159 const int rNumber,
160 const int wireOrStrip,
161 const int channelNumber,
162 bool adChannel=false) const;
163
164 // element ID -> readout IDs
165 bool getReadoutIDfromElementID(const Identifier & elementID,
166 int & subdetectorID,
167 int & rodID) const;
168
169 // readout IDs -> element ID
170 bool getElementIDfromReadoutID(Identifier & elementID,
171 const int subDetectorID,
172 const int rodID,
173 const int sswID,
174 const int sbLoc,
175 const int channelID,
176 bool orChannel=false) const;
177
178 // HPT ID -> readout ID
179 bool getReadoutIDfromHPTID(const int phi,
180 const bool isAside,
181 const bool isEndcap,
182 const bool isStrip,
183 const int id,
184 int & subsectorID,
185 int & rodID,
186 int & sswID,
187 int & sbLoc) const;
188
189 // readout ID -> SLB ID
190 bool getSLBIDfromReadoutID(int &phi,
191 bool & isAside,
192 bool & isEndcap,
193 int & moduleType,
194 int & id,
195 const int subsectorID,
196 const int rodID,
197 const int sswID,
198 const int sbLoc) const;
199
200 // readout ID -> slbAddr
201 bool getSLBAddressfromReadoutID(int & slbAddr,
202 const int subsectorID,
203 const int rodID,
204 const int sswID,
205 const int sbLoc) const;
206
207 // readout ID -> RxID
208 bool getRxIDfromReadoutID(int & rxId,
209 const int subsectorID,
210 const int rodID,
211 const int sswID,
212 const int sbLoc) const;
213
214 // ROD_ID / SSW_ID / RX_ID -> SLB ID
215 bool getSLBIDfromRxID(int &phi,
216 bool & isAside,
217 bool & isEndcap,
218 int & moduleType,
219 int & id,
220 const int subsectorID,
221 const int rodID,
222 const int sswID,
223 const int rxId) const;
224
225 // SLB ID -> readout ID
226 bool getReadoutIDfromSLBID(const int phi,
227 const bool isAside,
228 const bool isEndcap,
229 const int moduleType,
230 const int id,
231 int & subsectorID,
232 int & rodID,
233 int & sswID,
234 int & sbLoc) const;
235
236 // readout ID (ROD) -> SL ID
237 bool getSLIDfromReadoutID(int & phi,
238 bool & isAside,
239 bool & isEndcap,
240 const int subsectorID,
241 const int rodID,
242 const int sswID,
243 const int sbLoc) const;
244
245 // readout ID (SROD) -> SL ID
246 bool getSLIDfromSReadoutID(int & phi,
247 bool & isAside,
248 const int subsectorID,
249 const int srodID,
250 const int sector,
251 const bool forward) const;
252
253 // SL ID -> readout ID ( ROD )
254 bool getReadoutIDfromSLID(const int phi,
255 const bool isAside,
256 const bool isEndcap,
257 int & subsectorID,
258 int & rodID,
259 int & sswID,
260 int & sbLoc) const;
261
262 // SL ID -> readout ID ( SROD )
263 bool getSReadoutIDfromSLID(const int phi,
264 const bool isAside,
265 const bool isEndcap,
266 int & subsectorID,
267 int & srodID,
268 int & sswID,
269 int & sbLoc) const;
270
271 // HighPtID used in Simulation -> HighPtID in RDO
272 bool getRDOHighPtIDfromSimHighPtID(const bool isForward,
273 const bool isStrip,
274 int & index,
275 int & chip,
276 int & hitId) const;
277
278 // HighPtID in RDO -> HighPtID used in Simulation
279 bool getSimHighPtIDfromRDOHighPtID(const bool isForward,
280 const bool isStrip,
281 int & index,
282 int & chip,
283 int & hitId) const;
284
285
286 // high pt coincidence IDs -> offline IDs
287 bool getOfflineIDfromHighPtID(Identifier & offlineID,
288 const int subDetectorID,
289 const int rodID,
290 const int sectorInReadout,
291 const bool isStrip,
292 const bool isForward,
293 const int hpb,
294 const int chip,
295 const int hitID,
296 const int pos ) const;
297
298 // offline IDs -> high pt coincidence IDs
299 bool getHighPtIDfromOfflineID(const Identifier & offlineID,
300 int & subDetectorID,
301 int & rodID,
302 int & sectorInReadout,
303 bool & isStrip,
304 bool & isForward,
305 int & hpb,
306 int & chip,
307 int & hitID,
308 int & pos) const;
309
310 // HPT HitID -> ROI Number
311 bool getROINumberfromHighPtID(int &roi,
312 bool isForward,
313 int hpb_wire,
314 int chip_wire,
315 int hitId_wire,
316 int sub_wire,
317 int chip_strip,
318 int hitId_strip,
319 int sub_strip) const;
320
321 // HPT HitID -> ROI Number
322 bool getHighPtIDfromROINumber(int roi,
323 bool isForward,
324 bool isStrip,
325 int & hpb,
326 int & chip,
327 int & hitID,
328 int & sub) const;
329
330 // low pt coincidence IDs -> offline IDs
332 const int subDetectorID,
333 const int rodID,
334 const int sswID,
335 const int sbLoc,
336 const int block,
337 const int pos,
338 bool middle=false) const;
339
340 // offline IDs -> low pt coincidence IDs
341 bool getLowPtCoincidenceIDfromOfflineID(const Identifier & offlineID,
342 int & subDetectorID,
343 int & rodID,
344 int & sswID,
345 int & sbLoc,
346 int & block,
347 int & pos,
348 bool middle=false) const;
349
350
352 // channel connection
356 bool orChannel=false) const;
357
358 // module connection
362
364
365 private:
366 std::unique_ptr<MuonTGC_Cabling::TGCCabling> m_cabling;
367 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
368 ToolHandle<ITGCCablingDbTool> m_condDataTool{this,"TGCCablingDbTool","TGCCablingDbTool"};
369
370 protected:
371 IntegerProperty m_AsideId;
372 IntegerProperty m_CsideId;
373 IntegerArrayProperty m_rodId;
374
375 StringProperty m_databaseASDToPP;
376 StringProperty m_databaseInPP;
377 StringProperty m_databasePPToSL;
378 StringProperty m_databaseSLBToROD;
379
380 StringProperty m_databaseASDToPPdiff;
381};
382
383
385{
386 return m_cabling.get();
387}
388
389#endif // MUONTGC_CABLING_MUONTGC_CABLINGSVC_H
Scalar phi() const
phi method
defines and typedefs for IOVSvc
bool getRDOHighPtIDfromSimHighPtID(const bool isForward, const bool isStrip, int &index, int &chip, int &hitId) const
bool getROINumberfromHighPtID(int &roi, bool isForward, int hpb_wire, int chip_wire, int hitId_wire, int sub_wire, int chip_strip, int hitId_strip, int sub_strip) const
bool getSLBIDfromRxID(int &phi, bool &isAside, bool &isEndcap, int &moduleType, int &id, const int subsectorID, const int rodID, const int sswID, const int rxId) const
MuonTGC_CablingSvc(const std::string &name, ISvcLocator *svc)
StringProperty m_databaseSLBToROD
IntegerArrayProperty m_rodId
bool getReadoutIDfromSLID(const int phi, const bool isAside, const bool isEndcap, int &subsectorID, int &rodID, int &sswID, int &sbLoc) const
bool isOredChannel(const int subDetectorID, const int rodID, const int sswID, const int sbLoc, const int channelID) const
MuonTGC_Cabling::TGCChannelId * getChannel(const MuonTGC_Cabling::TGCChannelId *channelId, MuonTGC_Cabling::TGCChannelId::ChannelIdType type, bool orChannel=false) const
StringProperty m_databaseASDToPP
bool getOfflineIDfromHighPtID(Identifier &offlineID, const int subDetectorID, const int rodID, const int sectorInReadout, const bool isStrip, const bool isForward, const int hpb, const int chip, const int hitID, const int pos) const
MuonTGC_Cabling::TGCModuleMap * getModule(const MuonTGC_Cabling::TGCModuleId *moduleId, MuonTGC_Cabling::TGCModuleId::ModuleIdType type) const
bool getReadoutIDfromOfflineID(const Identifier &offlineID, int &subDetectorID, int &rodID, int &sswID, int &sbLoc, int &channelID, bool adChannel=false) const
bool getSLBAddressfromReadoutID(int &slbAddr, const int subsectorID, const int rodID, const int sswID, const int sbLoc) const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
StringProperty m_databaseInPP
bool getOnlineIDfromOfflineID(const Identifier &offlineID, int &subsystemNumber, int &octantNumber, int &moduleNumber, int &layerNumber, int &rNumber, int &wireOrStrip, int &channelNumber) const
IntegerProperty m_CsideId
bool getCoveragefromSRodID(const int srodID, double &startPhi, double &endPhi) const
bool getHighPtIDfromOfflineID(const Identifier &offlineID, int &subDetectorID, int &rodID, int &sectorInReadout, bool &isStrip, bool &isForward, int &hpb, int &chip, int &hitID, int &pos) const
bool getSReadoutIDfromSLID(const int phi, const bool isAside, const bool isEndcap, int &subsectorID, int &srodID, int &sswID, int &sbLoc) const
bool getHighPtIDfromROINumber(int roi, bool isForward, bool isStrip, int &hpb, int &chip, int &hitID, int &sub) const
bool getOfflineIDfromReadoutID(Identifier &offlineID, const int subDetectorID, const int rodID, const int sswID, const int sbLoc, const int channelID, bool orChannel=false) const
bool getOfflineIDfromOnlineID(Identifier &offlineID, const int subsystemNumber, const int octantNumber, const int moduleNumber, const int layerNumber, const int rNumber, const int wireOrStrip, const int channelNumber) const
bool getLowPtCoincidenceIDfromOfflineID(const Identifier &offlineID, int &subDetectorID, int &rodID, int &sswID, int &sbLoc, int &block, int &pos, bool middle=false) const
bool getSLIDfromReadoutID(int &phi, bool &isAside, bool &isEndcap, const int subsectorID, const int rodID, const int sswID, const int sbLoc) const
bool getReadoutIDfromSLBID(const int phi, const bool isAside, const bool isEndcap, const int moduleType, const int id, int &subsectorID, int &rodID, int &sswID, int &sbLoc) const
bool getSLBIDfromReadoutID(int &phi, bool &isAside, bool &isEndcap, int &moduleType, int &id, const int subsectorID, const int rodID, const int sswID, const int sbLoc) const
bool getOnlineIDfromReadoutID(const int subDetectorID, const int rodID, const int sswID, const int sbLoc, const int channelID, int &subsystemNumber, int &octantNumber, int &moduleNumber, int &layerNumber, int &rNumber, int &wireOrStrip, int &channelNumber, bool orChannel=false) const
StringProperty m_databasePPToSL
bool getRxIDfromReadoutID(int &rxId, const int subsectorID, const int rodID, const int sswID, const int sbLoc) const
bool getReadoutIDfromElementID(const Identifier &elementID, int &subdetectorID, int &rodID) const
bool getOfflineIDfromLowPtCoincidenceID(Identifier &offlineID, const int subDetectorID, const int rodID, const int sswID, const int sbLoc, const int block, const int pos, bool middle=false) const
ToolHandle< ITGCCablingDbTool > m_condDataTool
bool getSLIDfromSReadoutID(int &phi, bool &isAside, const int subsectorID, const int srodID, const int sector, const bool forward) const
StringProperty m_databaseASDToPPdiff
virtual StatusCode initialize(void) override
bool getReadoutIDfromHPTID(const int phi, const bool isAside, const bool isEndcap, const bool isStrip, const int id, int &subsectorID, int &rodID, int &sswID, int &sbLoc) const
bool getReadoutIDfromOnlineID(int &subDetectorID, int &rodID, int &sswID, int &sbLoc, int &channelID, const int subsystemNumber, const int octantNumber, const int moduleNumber, const int layerNumber, const int rNumber, const int wireOrStrip, const int channelNumber, bool adChannel=false) const
const MuonTGC_Cabling::TGCCabling * getTGCCabling() const
bool getCoveragefromRodID(const int rodID, double &startPhi, double &endPhi) const
IntegerProperty m_AsideId
std::unique_ptr< MuonTGC_Cabling::TGCCabling > m_cabling
bool getSimHighPtIDfromRDOHighPtID(const bool isForward, const bool isStrip, int &index, int &chip, int &hitId) const
void getReadoutIDRanges(int &maxRodId, int &maxSRodId, int &maxSswId, int &maxSbloc, int &minChannelId, int &maxChannelId) const
bool hasAdjacentChannel(const Identifier &offlineID) const
bool getElementIDfromReadoutID(Identifier &elementID, const int subDetectorID, const int rodID, const int sswID, const int sbLoc, const int channelID, bool orChannel=false) const
virtual ~MuonTGC_CablingSvc()=default
Definition index.py:1