ATLAS Offline Software
MuonIdHelperSvc.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <iostream>
8 
9 #include "GaudiKernel/MsgStream.h"
10 
11 namespace Muon {
12 
13  MuonIdHelperSvc::MuonIdHelperSvc(const std::string& name, ISvcLocator* svc) :
14  base_class(name, svc) {}
15 
17  ATH_CHECK(m_detStore.retrieve());
18  if (m_hasMDT) ATH_CHECK(m_detStore->retrieve(m_mdtIdHelper));
19  if (m_hasRPC) ATH_CHECK(m_detStore->retrieve(m_rpcIdHelper));
20  if (m_hasTGC) ATH_CHECK(m_detStore->retrieve(m_tgcIdHelper));
21  if (m_hasCSC) ATH_CHECK(m_detStore->retrieve(m_cscIdHelper));
23  if (m_hasMM) ATH_CHECK(m_detStore->retrieve(m_mmIdHelper));
24 
26  const std::array<const MuonIdHelper*, 6> all_helpers{m_mdtIdHelper, m_rpcIdHelper, m_tgcIdHelper,
28  std::array<const MuonIdHelper*, 6>::const_iterator itr = std::find_if(all_helpers.begin(),
29  all_helpers.end(),
30  [](const MuonIdHelper* h){return h != nullptr;});
31  if (itr == all_helpers.end()){
32  ATH_MSG_WARNING("No MuonIdHelper has been created before. Please do not setup the service if no muon layout is loaded");
33  return StatusCode::SUCCESS;
34  }
35  m_primaryHelper = (*itr);
36 
37  std::stringstream techStr{};
38 
39  for (int tech = 0; tech <= m_primaryHelper->technologyNameIndexMax(); ++tech) {
40  std::string name = m_primaryHelper->technologyString(tech);
41  if (name == "MDT") m_technologies.push_back(MuonStationIndex::MDT);
42  if (name == "CSC") m_technologies.push_back(MuonStationIndex::CSCI);
43  if (name == "RPC") m_technologies.push_back(MuonStationIndex::RPC);
44  if (name == "TGC") m_technologies.push_back(MuonStationIndex::TGC);
45  if (name == "STGC") m_technologies.push_back(MuonStationIndex::STGC);
46  if (name == "MM") m_technologies.push_back(MuonStationIndex::MM);
47  techStr<< ", " << tech << " " << name;
48  }
49  ATH_MSG_DEBUG(" Technologies: size " << m_primaryHelper->technologyNameIndexMax()<<" "<<techStr.str());
50 
51  unsigned int nstationsNames = m_primaryHelper->stationNameIndexMax() + 1;
52  m_stationNameData.resize(nstationsNames);
53  for (int i = 0; i <= m_primaryHelper->stationNameIndexMax(); ++i) {
54  std::string name = m_primaryHelper->stationNameString(i);
55  if (name.compare(MuonIdHelper::BAD_NAME) == 0) continue;
56 
58 
59  data.stationName = name;
60  data.isEndcap = m_primaryHelper->isEndcap(i);
61  data.isSmall = m_primaryHelper->isSmall(i);
62 
64  if (data.isEndcap) {
65  if (data.stationName[1] == '1')
66  data.chIndex = MuonStationIndex::EML;
67  else if (data.stationName[1] == '2')
68  data.chIndex = MuonStationIndex::EML;
69  else if (data.stationName[1] == '3')
70  data.chIndex = MuonStationIndex::EML;
71  else if (data.stationName[1] == '4')
72  data.chIndex = MuonStationIndex::EIL;
73 
74  if (data.stationName[1] == 'O') {
75  if (data.stationName[2] == 'L')
76  data.chIndex = MuonStationIndex::EOL;
77  else
78  data.chIndex = MuonStationIndex::EOS;
79  } else if (data.stationName[1] == 'M') {
80  if (data.stationName[2] == 'L')
81  data.chIndex = MuonStationIndex::EML;
82  else
83  data.chIndex = MuonStationIndex::EMS;
84  } else if (data.stationName[1] == 'I') {
85  if (data.stationName[2] == 'L')
86  data.chIndex = MuonStationIndex::EIL;
87  else
88  data.chIndex = MuonStationIndex::EIS;
89  } else if (data.stationName[1] == 'E') {
90  if (data.stationName[0] == 'B') {
91  data.chIndex = MuonStationIndex::BEE;
92  } else {
93  if (data.stationName[2] == 'L')
94  data.chIndex = MuonStationIndex::EEL;
95  else
96  data.chIndex = MuonStationIndex::EES;
97  }
98  } else if (data.stationName[0] == 'C') {
99  if (data.stationName[2] == 'L')
100  data.chIndex = MuonStationIndex::CSL;
101  else
102  data.chIndex = MuonStationIndex::CSS;
103  }
104  if (data.stationName[0] == 'S' || data.stationName[0] == 'M') {
105  if (data.isSmall)
106  data.chIndex = MuonStationIndex::EIS;
107  else
108  data.chIndex = MuonStationIndex::EIL;
109  }
110 
111  } else {
112  if (data.stationName[1] == 'O') {
113  if (data.stationName[2] == 'L')
114  data.chIndex = MuonStationIndex::BOL;
115  else
116  data.chIndex = MuonStationIndex::BOS;
117  } else if (data.stationName[1] == 'M') {
118  if (data.stationName[2] == 'L' || data.stationName[2] == 'E')
119  data.chIndex = MuonStationIndex::BML;
120  else
121  data.chIndex = MuonStationIndex::BMS;
122  } else if (data.stationName[1] == 'I') {
123  if (data.stationName[2] == 'L' || data.stationName[2] == 'M' || data.stationName[2] == 'R')
124  data.chIndex = MuonStationIndex::BIL;
125  else
126  data.chIndex = MuonStationIndex::BIS;
127  }
128  }
129  if (data.chIndex <0){
130  ATH_MSG_ERROR("data.chIndex is negative in MuonIdHelperSvc::initialize ");
131  return StatusCode::FAILURE;
132  }
133  data.stIndex = MuonStationIndex::toStationIndex(data.chIndex);
134 
135  if (msgLvl(MSG::DEBUG)) {
136  msg(MSG::DEBUG) << "Adding station " << i << " " << data.stationName << " ";
137  if (data.isEndcap)
138  msg(MSG::DEBUG) << " Endcap, ";
139  else
140  msg(MSG::DEBUG) << " Barrel, ";
141  if (data.isSmall)
142  msg(MSG::DEBUG) << " Small, ";
143  else
144  msg(MSG::DEBUG) << " Large, ";
145 
147  }
148  }
150  // now, let's check if we are in the inner barrel layer, and if there are RPCs installed
151  // if yes, the MDT chambers must be sMDTs
152  if (m_mdtIdHelper && m_rpcIdHelper) {
154  for (int eta = MdtIdHelper::stationEtaMin(true); eta <= MdtIdHelper::stationEtaMax(true); ++eta) {
155  for (int phi = 1; phi <= 8; ++phi) {
156  // now, let's check if we are in the inner barrel layer, and if there are RPCs installed
157  // if yes, the MDT chambers must be sMDTs
158  // now try to retrieve RPC identifier with the same station name/eta/phi and check if it is valid
159  bool isValid = false;
161  // last 4 arguments are: doubletR, check, isValid
162  // there is a BI RPC in the same station, thus, this station was already upgraded and sMDTs are present
163  if (!isValid) continue;
165  }
166  }
167  }
168  ATH_MSG_DEBUG("Configured the service with the following flags --- hasMDT: "<< hasMDT()<<" hasRPC: "<<hasRPC()
169  <<" hasTGC"<< hasTGC() << " hasCSC: "<< hasCSC() << " hasSTGC: " << hasSTGC() << " hasMM: " << hasMM() );
170  return StatusCode::SUCCESS;
171  }
172 
173  int MuonIdHelperSvc::gasGap(const Identifier& id) const {
174  if (isRpc(id)) {
175  return m_rpcIdHelper->gasGap(id);
176  } else if (isTgc(id)) {
177  return m_tgcIdHelper->gasGap(id);
178 
179  } else if (isCsc(id)) {
180  return m_cscIdHelper->wireLayer(id);
181 
182  } else if (issTgc(id)) {
183  return m_stgcIdHelper->gasGap(id);
184 
185  } else if (isMM(id)) {
186  return m_mmIdHelper->gasGap(id);
187  } else {
188  return m_mdtIdHelper->channel(id);
189  }
190  return 1;
191  }
192 
193  bool MuonIdHelperSvc::isMuon(const Identifier& id) const {
194  return m_primaryHelper && m_primaryHelper->is_muon(id);
195  }
196  bool MuonIdHelperSvc::isMdt(const Identifier& id) const {
197  return m_mdtIdHelper && m_mdtIdHelper->is_mdt(id);
198  }
199  bool MuonIdHelperSvc::isMM(const Identifier& id) const {
200  return m_mmIdHelper && m_mmIdHelper->is_mm(id);
201  }
202  bool MuonIdHelperSvc::isCsc(const Identifier& id) const {
203  return m_cscIdHelper && m_cscIdHelper->is_csc(id);
204  }
205  bool MuonIdHelperSvc::isRpc(const Identifier& id) const {
206  return m_rpcIdHelper && m_rpcIdHelper->is_rpc(id);
207  }
208 
209  bool MuonIdHelperSvc::isTgc(const Identifier& id) const {
210  return m_tgcIdHelper && m_tgcIdHelper->is_tgc(id);
211  }
212 
213  bool MuonIdHelperSvc::issTgc(const Identifier& id) const {
214  return m_stgcIdHelper && m_stgcIdHelper->is_stgc(id);
215  }
216 
217  bool MuonIdHelperSvc::issMdt(const Identifier& id) const {
218  if (!isMdt(id))
219  return false;
220  if (stationName(id) == m_BIS_stat) {
221  return m_smdt_stat.find(m_mdtIdHelper->elementID(id)) != m_smdt_stat.end();
222  }
223  return m_mdtIdHelper->isBME(id) || m_mdtIdHelper->isBMG(id);
224  }
225 
226  bool MuonIdHelperSvc::hasHPTDC(const Identifier& id) const {
229  // the remaining sMDTs (installed in BI in LS1) all have an HPTDC in Run3
230  // all BME sMDTs have no HPTDC
231  return issMdt(id) && !m_mdtIdHelper->isBME(id);
232  }
233 
234  bool MuonIdHelperSvc::measuresPhi(const Identifier& id) const {
235  if (isRpc(id)) {
236  return m_rpcIdHelper->measuresPhi(id);
237  } else if (isTgc(id)) {
238  return m_tgcIdHelper->measuresPhi(id);
239  } else if (isCsc(id)) {
240  return m_cscIdHelper->measuresPhi(id);
241  } else if (issTgc(id)) {
242  return m_stgcIdHelper->measuresPhi(id);
243  }
244  // MM and MDTs only measure eta
245  return false;
246  }
247 
248  bool MuonIdHelperSvc::isTrigger(const Identifier& id) const {
249  return isRpc(id) || isTgc(id);
250  }
251 
252  bool MuonIdHelperSvc::isEndcap(const Identifier& id) const { return m_primaryHelper->isEndcap(id); }
253 
254  bool MuonIdHelperSvc::isSmallChamber(const Identifier& id) const { return m_primaryHelper->isSmall(id); }
255 
257  if (!id.is_valid() || !isMuon(id)) {
258  if (id.is_valid()) ATH_MSG_WARNING("chamberIndex: invalid ID " << m_primaryHelper->print_to_string(id));
260  }
261  return m_stationNameData[stationName(id)].chIndex;
262  }
263 
265  if (!id.is_valid() || !isMuon(id)) {
266  if (id.is_valid()) ATH_MSG_WARNING("stationIndex: invalid ID " << m_primaryHelper->print_to_string(id));
268  }
269  return m_stationNameData[stationName(id)].stIndex;
270  }
271 
273  if (!id.is_valid() || !isMuon(id)) {
274  if (id.is_valid()) ATH_MSG_WARNING("phiIndex: invalid ID " << m_primaryHelper->print_to_string(id));
276  }
277  if (isMdt(id) || isMM(id)) {
278  ATH_MSG_WARNING("phiIndex: not supported for " << toString(id));
280  }
283  if (stIndex == MuonStationIndex::BI) {
284  if (m_rpcIdHelper->doubletR(id) == 1)
286  else
288  } else if (stIndex == MuonStationIndex::BM) {
289  if (m_rpcIdHelper->doubletR(id) == 1)
291  else
293  } else if (stIndex == MuonStationIndex::BO) {
294  if (m_rpcIdHelper->doubletR(id) == 1)
296  else
298  } else if (stIndex == MuonStationIndex::EI) {
299  if (isCsc(id))
301  else if (isTgc(id))
303  else if (m_stgcIdHelper->multilayer(id) == 1)
305  else
307  } else if (stIndex == MuonStationIndex::EM) {
308  std::string chamberName = chamberNameString(id);
309  if (chamberName[1] == '1')
311  else if (chamberName[1] == '2')
313  else
315  }
316  return index;
317  }
318 
322  }
323 
326  }
327 
329  if (isMdt(id)) return MuonStationIndex::MDT;
330  if (isCsc(id)) return MuonStationIndex::CSCI;
331  if (isTgc(id)) return MuonStationIndex::TGC;
332  if (isRpc(id)) return MuonStationIndex::RPC;
333  if (issTgc(id)) return MuonStationIndex::STGC;
334  if (isMM(id)) return MuonStationIndex::MM;
336  }
337 
338  std::string MuonIdHelperSvc::toString(const Identifier& id) const {
339  std::ostringstream sout;
340  if (!id.is_valid()) return " Invalid Identifier";
341  sout << toStringGasGap(id);
342  if (isRpc(id)) {
343  sout << (m_rpcIdHelper->measuresPhi(id) ? " phi" : " eta") << " channel " << std::setw(2) << m_rpcIdHelper->channel(id);
344  } else if (isTgc(id)) {
345  sout << (m_tgcIdHelper->measuresPhi(id) ? " phi" : " eta") << " channel " << std::setw(2) << m_tgcIdHelper->channel(id);
346  } else if (isCsc(id)) {
347  sout << (m_cscIdHelper->measuresPhi(id) ? " phi" : " eta") << " channel " << std::setw(2) << m_cscIdHelper->channel(id);
348  } else if (issTgc(id)) {
349  int channelType = m_stgcIdHelper->channelType(id);
350  if (channelType == 0)
351  sout << " pad ";
352  else if (channelType == 1)
353  sout << " eta ";
354  else if (channelType == 2)
355  sout << " phi ";
356  sout << " channel " << std::setw(2) << m_stgcIdHelper->channel(id);
357  } else if (isMM(id)) {
358  sout << " channel " << std::setw(2) << m_mmIdHelper->channel(id);
359  }
360  return sout.str();
361  }
362 
363  std::string MuonIdHelperSvc::toStringTech(const Identifier& id) const {
364  std::ostringstream sout;
365  if (!id.is_valid()) return " Invalid Identifier";
366  if (isRpc(id)) {
368  } else if (isTgc(id)) {
370  } else if (isCsc(id)) {
372  } else if (issTgc(id)) {
374  } else if (isMM(id)) {
376  } else {
378  }
379  return sout.str();
380  }
381 
382  std::string MuonIdHelperSvc::chamberNameString(const Identifier& id) const {
384  }
385 
386  std::string MuonIdHelperSvc::toStringStation(const Identifier& id) const {
387  std::ostringstream sout;
388  if (!id.is_valid()) return " Invalid Identifier";
389  if (isRpc(id)) {
391  << m_rpcIdHelper->stationNameString(m_rpcIdHelper->stationName(id)) << " eta " << std::setw(2)
392  << m_rpcIdHelper->stationEta(id) << " phi " << std::setw(2) << m_rpcIdHelper->stationPhi(id);
393  } else if (isTgc(id)) {
395  << m_tgcIdHelper->stationNameString(m_tgcIdHelper->stationName(id)) << " eta " << std::setw(2)
396  << m_tgcIdHelper->stationEta(id) << " phi " << std::setw(2) << m_tgcIdHelper->stationPhi(id);
397  } else if (isCsc(id)) {
399  << m_cscIdHelper->stationNameString(m_cscIdHelper->stationName(id)) << " eta " << std::setw(2)
400  << m_cscIdHelper->stationEta(id) << " phi " << std::setw(2) << m_cscIdHelper->stationPhi(id);
401  } else if (isMM(id)) {
403  << m_mmIdHelper->stationNameString(m_mmIdHelper->stationName(id)) << " eta " << std::setw(2)
404  << m_mmIdHelper->stationEta(id) << " phi " << std::setw(2) << m_mmIdHelper->stationPhi(id);
405  } else if (issTgc(id)) {
407  << m_stgcIdHelper->stationNameString(m_stgcIdHelper->stationName(id)) << " eta " << std::setw(2)
408  << m_stgcIdHelper->stationEta(id) << " phi " << std::setw(2) << m_stgcIdHelper->stationPhi(id);
409  } else {
411  << m_mdtIdHelper->stationNameString(m_mdtIdHelper->stationName(id)) << " eta " << std::setw(2)
412  << m_mdtIdHelper->stationEta(id) << " phi " << std::setw(2) << m_mdtIdHelper->stationPhi(id);
413  }
414  return sout.str();
415  }
416 
417  std::string MuonIdHelperSvc::toStringChamber(const Identifier& id) const {
418  std::ostringstream sout;
419  if (!id.is_valid()) return " Invalid Identifier";
420  if (isRpc(id)) {
422  << m_rpcIdHelper->stationNameString(m_rpcIdHelper->stationName(id)) << " eta " << std::setw(2)
423  << m_rpcIdHelper->stationEta(id) << " phi " << std::setw(2) << m_rpcIdHelper->stationPhi(id) << " dbR "
424  << m_rpcIdHelper->doubletR(id);
425  } else if (isTgc(id)) {
427  << m_tgcIdHelper->stationNameString(m_tgcIdHelper->stationName(id)) << " eta " << std::setw(2)
428  << m_tgcIdHelper->stationEta(id) << " phi " << std::setw(2) << m_tgcIdHelper->stationPhi(id);
429  } else if (isCsc(id)) {
431  << m_cscIdHelper->stationNameString(m_cscIdHelper->stationName(id)) << " eta " << std::setw(2)
432  << m_cscIdHelper->stationEta(id) << " phi " << std::setw(2) << m_cscIdHelper->stationPhi(id);
433  } else if (issTgc(id)) {
435  << m_stgcIdHelper->stationNameString(m_stgcIdHelper->stationName(id)) << " eta " << std::setw(2)
436  << m_stgcIdHelper->stationEta(id) << " phi " << std::setw(2) << m_stgcIdHelper->stationPhi(id);
437  } else if (isMM(id)) {
439  << m_mmIdHelper->stationNameString(m_mmIdHelper->stationName(id)) << " eta " << std::setw(2)
440  << m_mmIdHelper->stationEta(id) << " phi " << std::setw(2) << m_mmIdHelper->stationPhi(id);
441  } else {
443  << m_mdtIdHelper->stationNameString(m_mdtIdHelper->stationName(id)) << " eta " << std::setw(2)
444  << m_mdtIdHelper->stationEta(id) << " phi " << std::setw(2) << m_mdtIdHelper->stationPhi(id);
445  }
446  return sout.str();
447  }
448 
449  std::string MuonIdHelperSvc::toStringDetEl(const Identifier& id) const {
450  std::ostringstream sout;
451  if (!id.is_valid()) return " Invalid Identifier";
452  if (isRpc(id)) {
453  sout << toStringChamber(id) << " dbZ " << m_rpcIdHelper->doubletZ(id) << " dbPhi " << m_rpcIdHelper->doubletPhi(id);
454  } else if (isTgc(id)) {
455  sout << toStringChamber(id);
456  } else if (isCsc(id)) {
457  sout << toStringChamber(id) << " chlay " << m_cscIdHelper->chamberLayer(id);
458  } else if (isMM(id)) {
459  sout << toStringChamber(id) << " chlay " << m_mmIdHelper->multilayer(id);
460  } else if (issTgc(id)) {
461  sout << toStringChamber(id) << " chlay " << m_stgcIdHelper->multilayer(id);
462  } else {
463  sout << toStringChamber(id) << " ml " << m_mdtIdHelper->multilayer(id);
464  }
465  return sout.str();
466  }
467 
468  std::string MuonIdHelperSvc::toStringGasGap(const Identifier& id) const {
469  std::ostringstream sout;
470  if (!id.is_valid()) return " Invalid Identifier";
471  if (isRpc(id)) {
472  sout << toStringDetEl(id) << " gap " << m_rpcIdHelper->gasGap(id);
473  } else if (isTgc(id)) {
474  sout << toStringDetEl(id) << " gap " << m_tgcIdHelper->gasGap(id);
475  } else if (isCsc(id)) {
476  sout << toStringDetEl(id) << " lay " << m_cscIdHelper->wireLayer(id);
477  } else if (issTgc(id)) {
478  sout << toStringDetEl(id) << " lay " << m_stgcIdHelper->gasGap(id);
479  } else if (isMM(id)) {
480  sout << toStringDetEl(id) << " lay " << m_mmIdHelper->gasGap(id);
481  } else {
482  sout << toStringDetEl(id) << " lay " << m_mdtIdHelper->tubeLayer(id) << " tube " << std::setw(2) << m_mdtIdHelper->channel(id);
483  }
484  return sout.str();
485  }
486 
488  Identifier chId;
489  // use phi hits on segment
490  if (isTgc(id)) {
491  chId = m_tgcIdHelper->elementID(id);
492 
493  } else if (isRpc(id)) {
494  chId = m_rpcIdHelper->elementID(id);
495 
496  } else if (isMM(id)) {
497  chId = m_mmIdHelper->elementID(id);
498 
499  } else if (issTgc(id)) {
500  chId = m_stgcIdHelper->elementID(id);
501 
502  } else if (isCsc(id)) {
503  Identifier elId = m_cscIdHelper->elementID(id);
504  chId = m_cscIdHelper->channelID(elId, 2, 1, 1, 1);
505 
506  } else if (isMdt(id)) {
507  chId = m_mdtIdHelper->elementID(id);
508  }
509  return chId;
510  }
511 
514  // use phi hits on segment
515  if (isTgc(id)) {
517 
518  } else if (isRpc(id)) {
519  Identifier elId = m_rpcIdHelper->elementID(id);
520  int doubZ = m_rpcIdHelper->doubletZ(id);
521  int doubPhi = m_rpcIdHelper->doubletPhi(id);
522  detElId = m_rpcIdHelper->channelID(elId, doubZ, doubPhi, 1, 0, 1);
523 
524  } else if (isCsc(id)) {
525  Identifier elId = m_cscIdHelper->elementID(id);
526  detElId = m_cscIdHelper->channelID(elId, 2, 1, 1, 1);
527 
528  } else if (issTgc(id)) {
529  Identifier elId = m_stgcIdHelper->elementID(id);
530  detElId = m_stgcIdHelper->channelID(elId, m_stgcIdHelper->multilayer(id), 1, 1, 1);
531 
532  } else if (isMM(id)) {
533  Identifier elId = m_mmIdHelper->elementID(id);
535 
536  } else {
537  Identifier elId = m_mdtIdHelper->elementID(id);
539  }
540  return detElId;
541  }
542 
545  // use phi hits on segment
546  if (isTgc(id)) {
547  Identifier elId = m_tgcIdHelper->elementID(id);
548  int gasGap = m_tgcIdHelper->gasGap(id);
551 
552  } else if (isRpc(id)) {
553  Identifier elId = m_rpcIdHelper->elementID(id);
554  int doubZ = m_rpcIdHelper->doubletZ(id);
555  int doubPhi = m_rpcIdHelper->doubletPhi(id);
556  int gasGap = m_rpcIdHelper->gasGap(id);
558  layerId = m_rpcIdHelper->channelID(elId, doubZ, doubPhi, gasGap, measuresPhi, 1);
559 
560  } else if (isCsc(id)) {
561  Identifier elId = m_cscIdHelper->elementID(id);
562  int chLayer = m_cscIdHelper->chamberLayer(id);
563  int wireLayer = m_cscIdHelper->wireLayer(id);
565  layerId = m_cscIdHelper->channelID(elId, chLayer, wireLayer, measuresPhi, 1);
566 
567  } else if (isMM(id)) {
568  Identifier elId = m_mmIdHelper->elementID(id);
569  int chLayer = m_mmIdHelper->multilayer(id);
570  int wireLayer = m_mmIdHelper->gasGap(id);
571  layerId = m_mmIdHelper->channelID(elId, chLayer, wireLayer, 1);
572 
573  } else if (issTgc(id)) {
574  Identifier elId = m_stgcIdHelper->elementID(id);
575  int chLayer = m_stgcIdHelper->multilayer(id);
576  int wireLayer = m_stgcIdHelper->gasGap(id);
577  layerId = m_stgcIdHelper->channelID(elId, chLayer, wireLayer, m_stgcIdHelper->channelType(id), 1);
578 
579  } else {
580  layerId = id;
581  }
582  return layerId;
583  }
584 
587  // use phi hits on segment
588  if (isTgc(id)) {
589  Identifier elId = m_tgcIdHelper->elementID(id);
590  int gasGap = m_tgcIdHelper->gasGap(id);
591  gasGapId = m_tgcIdHelper->channelID(elId, gasGap, 0, 1);
592 
593  } else if (isRpc(id)) {
594  Identifier elId = m_rpcIdHelper->elementID(id);
595  int doubZ = m_rpcIdHelper->doubletZ(id);
596  int doubPhi = m_rpcIdHelper->doubletPhi(id);
597  int gasGap = m_rpcIdHelper->gasGap(id);
598  gasGapId = m_rpcIdHelper->channelID(elId, doubZ, doubPhi, gasGap, 0, 1);
599 
600  } else if (isCsc(id)) {
601  Identifier elId = m_cscIdHelper->elementID(id);
602  int chLayer = m_cscIdHelper->chamberLayer(id);
603  int wireLayer = m_cscIdHelper->wireLayer(id);
604  gasGapId = m_cscIdHelper->channelID(elId, chLayer, wireLayer, 1, 1);
605  } else if (isMM(id)) {
606  Identifier elId = m_mmIdHelper->elementID(id);
607  int chLayer = m_mmIdHelper->multilayer(id);
608  int wireLayer = m_mmIdHelper->gasGap(id);
609  gasGapId = m_mmIdHelper->channelID(elId, chLayer, wireLayer, 1);
610 
611  } else if (issTgc(id)) {
612  Identifier elId = m_stgcIdHelper->elementID(id);
613  int chLayer = m_stgcIdHelper->multilayer(id);
614  int wireLayer = m_stgcIdHelper->gasGap(id);
615  gasGapId = m_stgcIdHelper->channelID(elId, chLayer, wireLayer, 1, 1);
616 
617  } else {
618  Identifier elId = m_mdtIdHelper->elementID(id);
619  int ml = m_mdtIdHelper->multilayer(id);
620  int lay = m_mdtIdHelper->tubeLayer(id);
621  gasGapId = m_mdtIdHelper->channelID(elId, ml, lay, 1);
622  }
623  return gasGapId;
624  }
625 
627  if (!id.is_valid()) {
628  ATH_MSG_WARNING("stationPhi: invalid ID");
629  return 0;
630  }
631  if (isRpc(id)) {
632  return m_rpcIdHelper->stationPhi(id);
633  } else if (isTgc(id)) {
634  return m_tgcIdHelper->stationPhi(id);
635  } else if (isMdt(id)) {
636  return m_mdtIdHelper->stationPhi(id);
637  } else if (isCsc(id)) {
638  return m_cscIdHelper->stationPhi(id);
639  } else if (issTgc(id)) {
640  return m_stgcIdHelper->stationPhi(id);
641  } else if (isMM(id)) {
642  return m_mmIdHelper->stationPhi(id);
643  }
644  return 0;
645  }
646 
648  if (!id.is_valid()) {
649  ATH_MSG_WARNING("stationEta: invalid ID");
650  return 0;
651  }
652  if (isRpc(id)) {
653  return m_rpcIdHelper->stationEta(id);
654  } else if (isTgc(id)) {
655  return m_tgcIdHelper->stationEta(id);
656  } else if (isMdt(id)) {
657  return m_mdtIdHelper->stationEta(id);
658  } else if (isCsc(id)) {
659  return m_cscIdHelper->stationEta(id);
660  } else if (issTgc(id)) {
661  return m_stgcIdHelper->stationEta(id);
662  } else if (isMM(id)) {
663  return m_mmIdHelper->stationEta(id);
664  }
665  return 0;
666  }
667 
669  if (!id.is_valid()) {
670  ATH_MSG_WARNING("stationName: invalid ID");
671  return 0;
672  }
673  if (isRpc(id)) {
674  return m_rpcIdHelper->stationName(id);
675  } else if (isTgc(id)) {
676  return m_tgcIdHelper->stationName(id);
677  } else if (isMdt(id)) {
678  return m_mdtIdHelper->stationName(id);
679  } else if (isCsc(id)) {
680  return m_cscIdHelper->stationName(id);
681  } else if (issTgc(id)) {
682  return m_stgcIdHelper->stationName(id);
683  } else if (isMM(id)) {
684  return m_mmIdHelper->stationName(id);
685  }
686  return 0;
687  }
688 
690  if (!id.is_valid()) {
691  ATH_MSG_WARNING("stationRegion: invalid ID");
692  return 0;
693  }
694  if (isRpc(id)) {
695  return m_rpcIdHelper->stationRegion(id);
696  } else if (isTgc(id)) {
697  return m_tgcIdHelper->stationRegion(id);
698  } else if (isMdt(id)) {
699  return m_mdtIdHelper->stationRegion(id);
700  } else if (isCsc(id)) {
701  return m_cscIdHelper->stationRegion(id);
702  } else if (issTgc(id)) {
703  return m_stgcIdHelper->stationRegion(id);
704  } else if (isMM(id)) {
705  return m_mmIdHelper->stationRegion(id);
706  }
707  return 0;
708  }
709 
710  int MuonIdHelperSvc::sector(const Identifier& id) const {
711  // TGC has different segmentation, return 0 for the moment
712  if (isTgc(id)) {
713  auto initTgcSectorMapping = [&]() -> std::vector<int>* {
714  std::vector<int>* mapping = nullptr;
715  StatusCode sc = m_detStore->retrieve(mapping, "TGC_SectorMapping");
716  if (sc.isFailure() || !mapping) {
717  ATH_MSG_WARNING("sector: failed to retrieve TGC sector mapping");
718  return nullptr;
719  }
720  ATH_MSG_DEBUG("sector: retrieve TGC sector mapping " << mapping->size());
721  return mapping;
722  };
723  static const std::vector<int> tgcSectorMapping = *initTgcSectorMapping();
724 
727  if (hash >= tgcSectorMapping.size()) {
728  ATH_MSG_WARNING("sector: TGC not yet supported");
729  return 0;
730  }
731  return tgcSectorMapping[hash];
732  }
733  int sect = 2 * stationPhi(id);
734  if (!isSmallChamber(id)) --sect;
735  return sect;
736  }
737 
738  bool MuonIdHelperSvc::hasRPC() const { return m_rpcIdHelper != nullptr; }
739  bool MuonIdHelperSvc::hasTGC() const { return m_tgcIdHelper != nullptr; }
740  bool MuonIdHelperSvc::hasMDT() const { return m_mdtIdHelper != nullptr; }
741  bool MuonIdHelperSvc::hasCSC() const { return m_hasCSC; }
742  bool MuonIdHelperSvc::hasSTGC() const { return m_hasSTGC; }
743  bool MuonIdHelperSvc::hasMM() const { return m_hasMM; }
744 
745  std::string MuonIdHelperSvc::stationNameString(const Identifier& id) const {
746  const int station = stationName(id);
747  if (isMdt(id)) return m_mdtIdHelper->stationNameString(station);
748  else if (isRpc(id)) return m_rpcIdHelper->stationNameString(station);
749  else if (isTgc(id)) return m_tgcIdHelper->stationNameString(station);
750  else if (isMM(id)) return m_mmIdHelper->stationNameString(station);
751  else if (issTgc(id)) return m_stgcIdHelper->stationNameString(station);
752  else if (isCsc(id)) return m_cscIdHelper->stationNameString(station);
753  return "UNKNOWN";
754  }
755  inline IdentifierHash MuonIdHelperSvc::moduleHash(const MuonIdHelper& idHelper, const Identifier& id) const{
757  if (idHelper.get_module_hash(id, hash) ||
758  static_cast<unsigned int>(hash) >= idHelper.module_hash_max()){
759  ATH_MSG_VERBOSE("Failed to deduce module hash "<<toString(id));
760  }
761  return hash;
762  }
763  inline IdentifierHash MuonIdHelperSvc::detElementHash(const MuonIdHelper& idHelper, const Identifier& id) const{
765  if (idHelper.get_detectorElement_hash(id, hash) ||
766  static_cast<unsigned int>(hash)>= idHelper.detectorElement_hash_max()) {
767  ATH_MSG_VERBOSE("Failed to deduce detector element hash "<<toString(id));
768  }
769  return hash;
770  }
772  if (isMdt(id)) return moduleHash(*m_mdtIdHelper, id);
773  else if (isRpc(id)) return moduleHash(*m_rpcIdHelper, id);
774  else if (isTgc(id)) return moduleHash(*m_tgcIdHelper, id);
775  else if (isMM(id)) return moduleHash(*m_mmIdHelper, id);
776  else if (issTgc(id)) return moduleHash(*m_stgcIdHelper, id);
777  else if (isCsc(id)) return moduleHash(*m_cscIdHelper, id);
778  ATH_MSG_WARNING("moduleHash(): No muon Identifier "<<id);
779  return IdentifierHash{};
780  }
782  if (isMdt(id)) return detElementHash(*m_mdtIdHelper, id);
783  else if (isRpc(id)) return detElementHash(*m_rpcIdHelper, id);
784  else if (isTgc(id)) return detElementHash(*m_tgcIdHelper, id);
785  else if (isMM(id)) return detElementHash(*m_mmIdHelper, id);
786  else if (issTgc(id)) return detElementHash(*m_stgcIdHelper, id);
787  else if (isCsc(id)) return detElementHash(*m_cscIdHelper, id);
788  ATH_MSG_WARNING("detElementHash(): No muon Identifier "<<id);
789  return IdentifierHash{};
790  }
791 
792 } // namespace Muon
MdtIdHelper::isBMG
bool isBMG(const Identifier &id) const
is this a BMG chamber
Definition: MdtIdHelper.cxx:734
MuonIdHelper::is_muon
bool is_muon(const Identifier &id) const
Definition: MuonIdHelper.cxx:783
Muon::MuonStationIndex::BIS
@ BIS
Definition: MuonStationIndex.h:17
Muon::MuonStationIndex::chName
static const std::string & chName(ChIndex index)
convert ChIndex into a string
Definition: MuonStationIndex.cxx:157
MdtIdHelper::multilayer
int multilayer(const Identifier &id) const
Access to components of the ID.
Definition: MdtIdHelper.cxx:722
Muon::MuonStationIndex::StUnknown
@ StUnknown
Definition: MuonStationIndex.h:24
Muon::MuonIdHelperSvc::m_mmIdHelper
const MmIdHelper * m_mmIdHelper
Definition: MuonIdHelperSvc.h:181
Muon::MuonIdHelperSvc::initialize
virtual StatusCode initialize() override
AlgTool initilize.
Definition: MuonIdHelperSvc.cxx:16
Muon::MuonIdHelperSvc::isTgc
virtual bool isTgc(const Identifier &id) const override
returns whether this is a TGC Identifier or not
Definition: MuonIdHelperSvc.cxx:209
MuonIdHelper::stationNameIndex
int stationNameIndex(const std::string &name) const
Definition: MuonIdHelper.cxx:846
sTgcIdHelper::multilayer
int multilayer(const Identifier &id) const
Definition: sTgcIdHelper.cxx:1017
Muon::MuonStationIndex::CSS
@ CSS
Definition: MuonStationIndex.h:18
Muon::MuonStationIndex::toStationIndex
static StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
Definition: MuonStationIndex.cxx:43
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
MuonIdHelper::stationRegion
int stationRegion(const Identifier &id) const
Definition: MuonIdHelper.cxx:715
Muon::MuonIdHelperSvc::m_hasSTGC
Gaudi::Property< bool > m_hasSTGC
Definition: MuonIdHelperSvc.h:190
MdtIdHelper::stationEtaMin
static int stationEtaMin(bool barrel)
Access to min and max of level ranges.
Definition: MdtIdHelper.cxx:740
Muon::MuonStationIndex::EndcapA
@ EndcapA
Definition: MuonStationIndex.h:49
MuonIdHelper::is_rpc
bool is_rpc(const Identifier &id) const
Definition: MuonIdHelper.cxx:792
Muon::MuonIdHelperSvc::m_hasMDT
Gaudi::Property< bool > m_hasMDT
Definition: MuonIdHelperSvc.h:186
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
Muon::MuonIdHelperSvc::m_rpcIdHelper
const RpcIdHelper * m_rpcIdHelper
Sub detector specific IdHelpers.
Definition: MuonIdHelperSvc.h:177
Muon::MuonStationIndex::STGC1
@ STGC1
Definition: MuonStationIndex.h:33
Muon::MuonStationIndex::T1
@ T1
Definition: MuonStationIndex.h:33
TgcIdHelper::gasGap
int gasGap(const Identifier &id) const override
get the hashes
Definition: TgcIdHelper.cxx:642
Muon::MuonStationIndex::EEL
@ EEL
Definition: MuonStationIndex.h:18
Muon::MuonIdHelperSvc::stationName
virtual int stationName(const Identifier &id) const override
Return stationName for all technologies.
Definition: MuonIdHelperSvc.cxx:668
RpcIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi, int doubletR) const
Definition: RpcIdHelper.cxx:802
Muon::MuonIdHelperSvc::layerIndex
virtual MuonStationIndex::LayerIndex layerIndex(const Identifier &id) const override
calculate layer index from Identifier
Definition: MuonIdHelperSvc.cxx:324
Muon::MuonIdHelperSvc::toString
virtual std::string toString(const Identifier &id) const override
print all fields to string
Definition: MuonIdHelperSvc.cxx:338
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
MuonIdHelper::is_mdt
bool is_mdt(const Identifier &id) const
Definition: MuonIdHelper.cxx:786
RpcIdHelper::doubletZ
int doubletZ(const Identifier &id) const
Definition: RpcIdHelper.cxx:1062
index
Definition: index.py:1
Muon::MuonStationIndex::TechnologyUnknown
@ TechnologyUnknown
Definition: MuonStationIndex.h:55
sTgcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
Definition: sTgcIdHelper.cxx:886
Muon::MuonIdHelperSvc::isCsc
virtual bool isCsc(const Identifier &id) const override
returns whether this is a CSC Identifier or not
Definition: MuonIdHelperSvc.cxx:202
MuonIdHelper::detectorElement_hash_max
size_type detectorElement_hash_max() const
Definition: MuonIdHelper.h:186
Muon::MuonIdHelperSvc::m_primaryHelper
const MuonIdHelper * m_primaryHelper
Definition: MuonIdHelperSvc.h:184
Muon::MuonStationIndex::BO1
@ BO1
Definition: MuonStationIndex.h:33
Muon::MuonIdHelperSvc::m_hasRPC
Gaudi::Property< bool > m_hasRPC
Definition: MuonIdHelperSvc.h:187
Muon::MuonStationIndex::BML
@ BML
Definition: MuonStationIndex.h:17
sTgcIdHelper::measuresPhi
bool measuresPhi(const Identifier &id) const override
returns measuresPhi
Definition: sTgcIdHelper.cxx:1025
Muon::MuonIdHelperSvc::chamberIndex
virtual MuonStationIndex::ChIndex chamberIndex(const Identifier &id) const override
calculate chamber index from Identifier
Definition: MuonIdHelperSvc.cxx:256
Muon::MuonStationIndex::LayerIndex
LayerIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:38
Muon::MuonStationIndex::BI1
@ BI1
Definition: MuonStationIndex.h:33
RpcIdHelper::measuresPhi
bool measuresPhi(const Identifier &id) const override
Definition: RpcIdHelper.cxx:1068
Muon::MuonIdHelperSvc::stationNameString
virtual std::string stationNameString(const Identifier &id) const override
Return the station name string for all technologies.
Definition: MuonIdHelperSvc.cxx:745
Muon::MuonIdHelperSvc::isEndcap
virtual bool isEndcap(const Identifier &id) const override
returns whether this is an endcap Identifier or not
Definition: MuonIdHelperSvc.cxx:252
MuonIdHelper::is_csc
bool is_csc(const Identifier &id) const
Definition: MuonIdHelper.cxx:789
MdtIdHelper::tubeLayer
int tubeLayer(const Identifier &id) const
Definition: MdtIdHelper.cxx:724
Muon::MuonIdHelperSvc::isSmallChamber
virtual bool isSmallChamber(const Identifier &id) const override
returns whether this is a small chamber, always returns true for TGCs
Definition: MuonIdHelperSvc.cxx:254
Muon::MuonStationIndex::BI
@ BI
Definition: MuonStationIndex.h:25
MuonIdHelper::technologyString
const std::string & technologyString(const int &index) const
Definition: MuonIdHelper.cxx:865
Muon::MuonIdHelperSvc::m_BIS_stat
int m_BIS_stat
Definition: MuonIdHelperSvc.h:205
Muon::MuonIdHelperSvc::sector
virtual int sector(const Identifier &id) const override
return sector number 1-16, odd=large, even=small
Definition: MuonIdHelperSvc.cxx:710
Muon::MuonStationIndex::BOS
@ BOS
Definition: MuonStationIndex.h:17
Muon::MuonIdHelperSvc::m_detStore
ServiceHandle< StoreGateSvc > m_detStore
Definition: MuonIdHelperSvc.h:193
Muon::MuonIdHelperSvc::m_stgcIdHelper
const sTgcIdHelper * m_stgcIdHelper
Definition: MuonIdHelperSvc.h:182
Muon::MuonStationIndex::T4
@ T4
Definition: MuonStationIndex.h:33
Muon::MuonStationIndex::BMS
@ BMS
Definition: MuonStationIndex.h:17
MuonIdHelper::stationName
int stationName(const Identifier &id) const
Definition: MuonIdHelper.cxx:804
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
isValid
bool isValid(const T &p)
Definition: AtlasPID.h:214
RpcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
Definition: RpcIdHelper.cxx:940
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
Muon::MuonStationIndex::MM
@ MM
Definition: MuonStationIndex.h:56
MuonIdHelper::stationNameIndexMax
int stationNameIndexMax() const
Definition: MuonIdHelper.cxx:824
Muon::MuonIdHelperSvc::m_technologies
std::vector< MuonStationIndex::TechnologyIndex > m_technologies
Definition: MuonIdHelperSvc.h:203
Muon::MuonStationIndex::PhiIndex
PhiIndex
enum to classify the different phi layers in the muon spectrometer
Definition: MuonStationIndex.h:31
Muon::MuonStationIndex::EIS
@ EIS
Definition: MuonStationIndex.h:18
find_tgc_unfilled_channelids.mapping
mapping
Definition: find_tgc_unfilled_channelids.py:17
TgcIdHelper::measuresPhi
bool measuresPhi(const Identifier &id) const override
Definition: TgcIdHelper.cxx:647
Muon::MuonStationIndex::BI2
@ BI2
Definition: MuonStationIndex.h:33
MuonIdHelperSvc.h
Muon::MuonIdHelperSvc::m_stationNameData
std::vector< StationNameData > m_stationNameData
Definition: MuonIdHelperSvc.h:202
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Muon::MuonStationIndex::T2
@ T2
Definition: MuonStationIndex.h:33
Muon::MuonStationIndex::EOS
@ EOS
Definition: MuonStationIndex.h:18
CscIdHelper::channel
int channel(const Identifier &id) const override
Definition: CscIdHelper.cxx:778
MuonIdHelper::is_tgc
bool is_tgc(const Identifier &id) const
Definition: MuonIdHelper.cxx:795
MmIdHelper::multilayer
int multilayer(const Identifier &id) const
Definition: MmIdHelper.cxx:796
Muon::MuonIdHelperSvc::m_hasMM
Gaudi::Property< bool > m_hasMM
Definition: MuonIdHelperSvc.h:191
RpcIdHelper::gasGap
int gasGap(const Identifier &id) const override
get the hashes
Definition: RpcIdHelper.cxx:1066
MuonIdHelper::isSmall
bool isSmall(const Identifier &id) const
Definition: MuonIdHelper.cxx:835
Muon::MuonIdHelperSvc::isMM
virtual bool isMM(const Identifier &id) const override
returns whether this is a MM Identifier or not
Definition: MuonIdHelperSvc.cxx:199
TgcIdHelper::channel
int channel(const Identifier &id) const override
Definition: TgcIdHelper.cxx:649
Muon::MuonIdHelperSvc::stationPhi
virtual int stationPhi(const Identifier &id) const override
Return stationPhi for all technologies.
Definition: MuonIdHelperSvc.cxx:626
Muon::MuonIdHelperSvc::chamberId
virtual Identifier chamberId(const Identifier &id) const override
create a chamber ID
Definition: MuonIdHelperSvc.cxx:487
CscIdHelper::wireLayer
int wireLayer(const Identifier &id) const
Definition: CscIdHelper.cxx:772
MuonIdHelper::is_stgc
bool is_stgc(const Identifier &id) const
Definition: MuonIdHelper.cxx:798
Muon::MuonIdHelperSvc::regionIndex
virtual MuonStationIndex::DetectorRegionIndex regionIndex(const Identifier &id) const override
calculate detector region index from Identifier
Definition: MuonIdHelperSvc.cxx:319
Muon::MuonStationIndex::T3
@ T3
Definition: MuonStationIndex.h:33
Muon::MuonIdHelperSvc::m_mdtIdHelper
const MdtIdHelper * m_mdtIdHelper
Definition: MuonIdHelperSvc.h:180
Muon::MuonIdHelperSvc::issTgc
virtual bool issTgc(const Identifier &id) const override
returns whether this is a sTGC Identifier or not
Definition: MuonIdHelperSvc.cxx:213
Muon::MuonStationIndex::PhiUnknown
@ PhiUnknown
Definition: MuonStationIndex.h:32
Muon::MuonIdHelperSvc::toStringGasGap
virtual std::string toStringGasGap(const Identifier &id) const override
print all fields up to gas gap to string
Definition: MuonIdHelperSvc.cxx:468
MuonIdHelper
Definition: MuonIdHelper.h:80
sTgcIdHelper::channel
int channel(const Identifier &id) const override
Definition: sTgcIdHelper.cxx:1027
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Muon::MuonStationIndex::BM1
@ BM1
Definition: MuonStationIndex.h:33
Muon::MuonIdHelperSvc::m_hasCSC
Gaudi::Property< bool > m_hasCSC
Definition: MuonIdHelperSvc.h:189
RpcIdHelper::doubletR
int doubletR(const Identifier &id) const
Definition: RpcIdHelper.cxx:1060
Muon::MuonIdHelperSvc::m_smdt_stat
std::set< Identifier > m_smdt_stat
Definition: MuonIdHelperSvc.h:206
Muon::MuonIdHelperSvc::layerId
virtual Identifier layerId(const Identifier &id) const override
create a layer ID, returns tube id for the MDTs
Definition: MuonIdHelperSvc.cxx:543
Muon::MuonStationIndex::BO2
@ BO2
Definition: MuonStationIndex.h:33
Muon::MuonIdHelperSvc::MuonIdHelperSvc
MuonIdHelperSvc(const std::string &name, ISvcLocator *svc)
default AlgService constructor
Definition: MuonIdHelperSvc.cxx:13
lumiFormat.i
int i
Definition: lumiFormat.py:92
MdtIdHelper::stationEtaMax
static int stationEtaMax(bool barrel)
Definition: MdtIdHelper.cxx:748
Muon::MuonStationIndex::BM
@ BM
Definition: MuonStationIndex.h:25
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
Muon::MuonStationIndex::STGC
@ STGC
Definition: MuonStationIndex.h:56
Muon::MuonIdHelperSvc::hasHPTDC
virtual bool hasHPTDC(const Identifier &id) const override
returns whether this Identifier belongs to an MDT with HPTDC or not NOTE that in Run4,...
Definition: MuonIdHelperSvc.cxx:226
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MdtIdHelper::channel
int channel(const Identifier &id) const override
Definition: MdtIdHelper.cxx:736
Muon::MuonStationIndex::EI
@ EI
Definition: MuonStationIndex.h:26
Muon::MuonStationIndex::Barrel
@ Barrel
Definition: MuonStationIndex.h:49
Muon::MuonIdHelperSvc::isMdt
virtual bool isMdt(const Identifier &id) const override
returns whether this is a MDT Identifier or not
Definition: MuonIdHelperSvc.cxx:196
Muon::MuonIdHelperSvc::detElId
virtual Identifier detElId(const Identifier &id) const override
create a detector element ID
Definition: MuonIdHelperSvc.cxx:512
TgcIdHelper::get_module_hash
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const override
Definition: TgcIdHelper.cxx:233
Muon::MuonIdHelperSvc::isTrigger
virtual bool isTrigger(const Identifier &id) const override
returns whether trigger chamber id or not
Definition: MuonIdHelperSvc.cxx:248
MuonIdHelper::get_module_hash
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const
Definition: MuonIdHelper.cxx:98
sTgcIdHelper::gasGap
int gasGap(const Identifier &id) const override
get the hashes
Definition: sTgcIdHelper.cxx:1020
Muon::MuonStationIndex::STGC2
@ STGC2
Definition: MuonStationIndex.h:33
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonIdHelper::get_detectorElement_hash
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const
Definition: MuonIdHelper.cxx:119
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
Muon::MuonStationIndex::CSCI
@ CSCI
Definition: MuonStationIndex.h:56
Muon::MuonStationIndex::toLayerIndex
static LayerIndex toLayerIndex(ChIndex index)
convert ChIndex into LayerIndex
Definition: MuonStationIndex.cxx:56
MuonIdHelper::is_mm
bool is_mm(const Identifier &id) const
Definition: MuonIdHelper.cxx:801
Muon::MuonIdHelperSvc::hasCSC
bool hasCSC() const override
Definition: MuonIdHelperSvc.cxx:741
Muon::MuonIdHelperSvc::m_tgcIdHelper
const TgcIdHelper * m_tgcIdHelper
Definition: MuonIdHelperSvc.h:178
MuonIdHelper::technologyNameIndexMax
int technologyNameIndexMax() const
Definition: MuonIdHelper.cxx:826
Muon::MuonIdHelperSvc::hasTGC
bool hasTGC() const override
Definition: MuonIdHelperSvc.cxx:739
Muon::MuonIdHelperSvc::isRpc
virtual bool isRpc(const Identifier &id) const override
returns whether this is a RPC Identifier or not
Definition: MuonIdHelperSvc.cxx:205
Muon::MuonStationIndex::EES
@ EES
Definition: MuonStationIndex.h:18
Muon::MuonStationIndex::ChUnknown
@ ChUnknown
Definition: MuonStationIndex.h:16
TgcIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: TgcIdHelper.cxx:556
MuonIdHelper::stationPhi
int stationPhi(const Identifier &id) const
Definition: MuonIdHelper.cxx:814
Muon::MuonStationIndex::DetectorRegionIndex
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:47
Muon::MuonIdHelperSvc::m_hasTGC
Gaudi::Property< bool > m_hasTGC
Definition: MuonIdHelperSvc.h:188
RpcIdHelper::channel
int channel(const Identifier &id) const override
Definition: RpcIdHelper.cxx:1072
MuonIdHelper::stationNameString
const std::string & stationNameString(const int &index) const
Definition: MuonIdHelper.cxx:858
AtlasDetectorID::print_to_string
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:655
Muon::MuonIdHelperSvc::stationEta
virtual int stationEta(const Identifier &id) const override
Return stationEta for all technologies.
Definition: MuonIdHelperSvc.cxx:647
Muon::MuonIdHelperSvc::gasGapId
virtual Identifier gasGapId(const Identifier &id) const override
create a gasGap ID (will return layer Id for MDTs)
Definition: MuonIdHelperSvc.cxx:585
MmIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: MmIdHelper.cxx:706
Muon::MuonIdHelperSvc::detElementHash
virtual IdentifierHash detElementHash(const Identifier &id) const override
Returns the detector element hash associated to an Identifier.
Definition: MuonIdHelperSvc.cxx:781
Muon::MuonIdHelperSvc::toStringTech
virtual std::string toStringTech(const Identifier &id) const override
print all fields up to technology to string
Definition: MuonIdHelperSvc.cxx:363
CscIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip) const
Definition: CscIdHelper.cxx:706
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MdtIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
Definition: MdtIdHelper.cxx:659
Muon::MuonIdHelperSvc::stationIndex
virtual MuonStationIndex::StIndex stationIndex(const Identifier &id) const override
calculate station index from Identifier
Definition: MuonIdHelperSvc.cxx:264
Muon::MuonIdHelperSvc::chamberNameString
virtual std::string chamberNameString(const Identifier &id) const override
print chamber name to string
Definition: MuonIdHelperSvc.cxx:382
Muon::MuonIdHelperSvc::stationRegion
virtual int stationRegion(const Identifier &id) const override
Return stationRegion for all technologies.
Definition: MuonIdHelperSvc.cxx:689
Muon::MuonIdHelperSvc::measuresPhi
virtual bool measuresPhi(const Identifier &id) const override
returns whether channel measures phi or not
Definition: MuonIdHelperSvc.cxx:234
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition: MuonIdHelper.cxx:809
Muon::MuonIdHelperSvc::isMuon
virtual bool isMuon(const Identifier &id) const override
returns whether this is a Muon Identifier or not
Definition: MuonIdHelperSvc.cxx:193
Muon::MuonIdHelperSvc::technologyIndex
virtual MuonStationIndex::TechnologyIndex technologyIndex(const Identifier &id) const override
calculate layer index from Identifier
Definition: MuonIdHelperSvc.cxx:328
Muon::MuonIdHelperSvc::issMdt
virtual bool issMdt(const Identifier &id) const override
returns whether this is a sMDT Identifier or not
Definition: MuonIdHelperSvc.cxx:217
Muon::MuonIdHelperSvc::toStringDetEl
virtual std::string toStringDetEl(const Identifier &id) const override
print all fields up to detector element to string
Definition: MuonIdHelperSvc.cxx:449
MuonIdHelper::module_hash_max
size_type module_hash_max() const
the maximum hash value
Definition: MuonIdHelper.cxx:752
MdtIdHelper::isBME
bool isBME(const Identifier &id) const
is this a BME chamber
Definition: MdtIdHelper.cxx:732
CscIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: CscIdHelper.cxx:678
MuonIdHelper::isEndcap
bool isEndcap(const Identifier &id) const
Definition: MuonIdHelper.cxx:831
Muon::MuonStationIndex::EML
@ EML
Definition: MuonStationIndex.h:18
sTgcIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: sTgcIdHelper.cxx:856
Muon::MuonStationIndex::MDT
@ MDT
Definition: MuonStationIndex.h:56
Muon::MuonIdHelperSvc::hasMDT
bool hasMDT() const override
Definition: MuonIdHelperSvc.cxx:740
MdtIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: MdtIdHelper.cxx:630
DeMoScan.index
string index
Definition: DeMoScan.py:362
MmIdHelper::channel
int channel(const Identifier &id) const override
Definition: MmIdHelper.cxx:800
h
MmIdHelper::gasGap
int gasGap(const Identifier &id) const override
get the hashes
Definition: MmIdHelper.cxx:798
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
Muon::MuonStationIndex::BO
@ BO
Definition: MuonStationIndex.h:25
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Muon::MuonStationIndex::BIL
@ BIL
Definition: MuonStationIndex.h:17
MuonIdHelper::technology
int technology(const Identifier &id) const
Definition: MuonIdHelper.cxx:819
Muon::MuonStationIndex::EndcapC
@ EndcapC
Definition: MuonStationIndex.h:49
Muon::MuonStationIndex::BEE
@ BEE
Definition: MuonStationIndex.h:17
DEBUG
#define DEBUG
Definition: page_access.h:11
Muon::MuonStationIndex::TGC
@ TGC
Definition: MuonStationIndex.h:56
Muon::MuonStationIndex::CSC
@ CSC
Definition: MuonStationIndex.h:33
Muon::MuonIdHelperSvc::m_cscIdHelper
const CscIdHelper * m_cscIdHelper
Definition: MuonIdHelperSvc.h:179
Muon::MuonStationIndex::RPC
@ RPC
Definition: MuonStationIndex.h:56
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
Muon::MuonIdHelperSvc::moduleHash
virtual IdentifierHash moduleHash(const Identifier &id) const override
Returns the module hash associated to an Identifier.
Definition: MuonIdHelperSvc.cxx:771
Muon::MuonIdHelperSvc::hasSTGC
bool hasSTGC() const override
Definition: MuonIdHelperSvc.cxx:742
Muon::MuonStationIndex::stName
static const std::string & stName(StIndex index)
convert StIndex into a string
Definition: MuonStationIndex.cxx:141
Muon::MuonIdHelperSvc::toStringStation
virtual std::string toStringStation(const Identifier &id) const override
print all fields up to stationName to string
Definition: MuonIdHelperSvc.cxx:386
TgcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
Definition: TgcIdHelper.cxx:583
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
Muon::MuonIdHelperSvc::hasRPC
bool hasRPC() const override
Definition: MuonIdHelperSvc.cxx:738
CscIdHelper::measuresPhi
bool measuresPhi(const Identifier &id) const override
Definition: CscIdHelper.cxx:774
Muon::MuonIdHelperSvc::phiIndex
virtual MuonStationIndex::PhiIndex phiIndex(const Identifier &id) const override
calculate phi index from Identifier (not supported for MDT hits)
Definition: MuonIdHelperSvc.cxx:272
Muon::MuonIdHelperSvc::toStringChamber
virtual std::string toStringChamber(const Identifier &id) const override
print all fields up to chamber to string
Definition: MuonIdHelperSvc.cxx:417
IdentifierHash
Definition: IdentifierHash.h:38
Muon::MuonStationIndex::EMS
@ EMS
Definition: MuonStationIndex.h:18
Muon::MuonStationIndex::EOL
@ EOL
Definition: MuonStationIndex.h:18
Muon::MuonIdHelperSvc::hasMM
bool hasMM() const override
Definition: MuonIdHelperSvc.cxx:743
MmIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
Definition: MmIdHelper.cxx:736
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:54
sTgcIdHelper::channelType
int channelType(const Identifier &id) const
Definition: sTgcIdHelper.cxx:1022
Muon::MuonStationIndex::BOL
@ BOL
Definition: MuonStationIndex.h:17
Muon::MuonStationIndex::BM2
@ BM2
Definition: MuonStationIndex.h:33
Muon::MuonIdHelperSvc::StationNameData
Definition: MuonIdHelperSvc.h:195
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Muon::MuonStationIndex::EM
@ EM
Definition: MuonStationIndex.h:26
CscIdHelper::chamberLayer
int chamberLayer(const Identifier &id) const
Definition: CscIdHelper.cxx:770
Muon::MuonStationIndex::CSL
@ CSL
Definition: MuonStationIndex.h:18
Muon::MuonIdHelperSvc::gasGap
virtual int gasGap(const Identifier &id) const override
returns gas gap: gasGap for RPC + TGC, wireLayer for CSC, tube for MDT
Definition: MuonIdHelperSvc.cxx:173
RpcIdHelper::doubletPhi
int doubletPhi(const Identifier &id) const
Definition: RpcIdHelper.cxx:1064
Muon::MuonStationIndex::EIL
@ EIL
Definition: MuonStationIndex.h:18
MuonIdHelper::BAD_NAME
static const std::string BAD_NAME
Definition: MuonIdHelper.h:224