ATLAS Offline Software
MuonTGC_CablingSvc.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  MuonTGC_CablingSvc.cxx
7  Description : online-offline ID mapper for TGC
8 ***************************************************************************/
9 
11 
18 
19 #include <cmath>
20 #include <fstream>
21 
23 MuonTGC_CablingSvc::MuonTGC_CablingSvc(const std::string& name, ISvcLocator* svc)
24  : AthService(name, svc),
25  m_cabling(nullptr) {
26  declareProperty("AsideId", m_AsideId=103);
27  declareProperty("CsideId", m_CsideId=104);
28  declareProperty("rodId", m_rodId); //obsolete
29  declareProperty("databaseASDToPP", m_databaseASDToPP="MuonTGC_Cabling_ASD2PP.db");
30  declareProperty("databaseInPP", m_databaseInPP="MuonTGC_Cabling_PP.db");
31  declareProperty("databasePPToSL", m_databasePPToSL="MuonTGC_Cabling_PP2SL.db");
32  declareProperty("databaseSLBToROD", m_databaseSLBToROD="MuonTGC_Cabling_SLB2ROD.db");
33 }
34 
36 StatusCode MuonTGC_CablingSvc::queryInterface(const InterfaceID& riid, void** ppvIF)
37 {
38  if(MuonTGC_CablingSvc::interfaceID().versionMatch(riid)) {
39  *ppvIF = dynamic_cast<MuonTGC_CablingSvc*>(this);
40  } else {
41  return Service::queryInterface(riid, ppvIF);
42  }
43 
44  addRef();
45  return StatusCode::SUCCESS;
46 }
47 
50  int& maxSRodId,
51  int& maxSswId,
52  int& maxSbloc,
53  int& minChannelId,
54  int& maxChannelId) const
55 {
62 }
63 
66 {
67  ATH_MSG_INFO("for 1/12 sector initialize");
68 
69  SmartIF<StoreGateSvc> detStore{serviceLocator()->service("DetectorStore")};
70  ATH_CHECK(detStore.isValid());
71  ATH_CHECK(m_idHelperSvc.retrieve());
72 
73  // private databases
74  std::string dbASDToPP = PathResolver::find_file(m_databaseASDToPP, "DATAPATH");
75  ATH_MSG_DEBUG("found " << dbASDToPP);
76  std::ifstream inASDToPP;
77  if(dbASDToPP!= "") {
78  inASDToPP.open(dbASDToPP.c_str());
79  } else {
80  ATH_MSG_FATAL("Could not find input file " << m_databaseASDToPP);
81  return StatusCode::FAILURE;
82  }
83  if(inASDToPP.bad()) {
84  ATH_MSG_FATAL("Could not open file " << dbASDToPP);
85  return StatusCode::FAILURE;
86  }
87  inASDToPP.close();
88 
89 
90  std::string dbInPP = PathResolver::find_file(m_databaseInPP, "DATAPATH");
91  ATH_MSG_DEBUG("found " << dbInPP);
92  std::ifstream inInPP;
93  if(dbInPP!="") {
94  inInPP.open(dbInPP.c_str());
95  } else {
96  ATH_MSG_FATAL("Could not find input file " << m_databaseInPP);
97  return StatusCode::FAILURE;
98  }
99  if(inInPP.bad()) {
100  ATH_MSG_FATAL("Could not open file " << dbInPP);
101  return StatusCode::FAILURE;
102  }
103  inInPP.close();
104 
105 
106  std::string dbPPToSL = PathResolver::find_file(m_databasePPToSL, "DATAPATH");
107  ATH_MSG_DEBUG("found " << dbPPToSL);
108  std::ifstream inPPToSL;
109  if(dbPPToSL!="") {
110  inPPToSL.open(dbPPToSL.c_str());
111  } else {
112  ATH_MSG_FATAL("Could not find input file " << m_databasePPToSL);
113  return StatusCode::FAILURE;
114  }
115  if(inPPToSL.bad()) {
116  ATH_MSG_FATAL("Could not open file " << dbPPToSL);
117  return StatusCode::FAILURE;
118  }
119  inPPToSL.close();
120 
121 
122 
123  std::string dbSLBToROD = PathResolver::find_file(m_databaseSLBToROD, "DATAPATH");
124  ATH_MSG_DEBUG("found " << dbSLBToROD);
125  std::ifstream inSLBToROD;
126  if(dbSLBToROD!="") {
127  inSLBToROD.open(dbSLBToROD.c_str());
128  } else {
129  ATH_MSG_FATAL("Could not find input file " << m_databaseSLBToROD);
130  return StatusCode::FAILURE;
131  }
132  if(inSLBToROD.bad()) {
133  ATH_MSG_FATAL("Could not open file " << dbSLBToROD);
134  return StatusCode::FAILURE;
135  }
136  inSLBToROD.close();
137 
138 
139  // instantiate TGC cabling manager
140  m_cabling = new MuonTGC_Cabling::TGCCabling(dbASDToPP,
141  dbInPP,
142  dbPPToSL,
143  dbSLBToROD);
144 
145  ATH_CHECK(m_condDataTool.retrieve());
146  std::string folderName = m_condDataTool->getFolderName();
147 
148  // temorarily commenting out this check to fix ATLASRECTS-7396. Will check again in the future if this whole tool can go
149 // bool isContained = detStore->contains<CondAttrListCollection>(folderName);
150 // if(!isContained) {
151 // ATH_MSG_FATAL("Could not found " << folderName << " in DetectorStore.");
152 // return StatusCode::FAILURE;
153 // }
154 
155  if(!m_cabling->updateCableASDToPP().isSuccess()) {
156  ATH_MSG_WARNING("updateCableASDToPP failed");
157  return StatusCode::SUCCESS;
158  }
159 
160  return StatusCode::SUCCESS;
161 }
162 
165 {
166  delete m_cabling;
167  m_cabling = nullptr;
168  return StatusCode::SUCCESS;
169 }
170 
172 // give phi-range which a ROD covers
174  double & startPhi,
175  double & endPhi) const
176 {
177  int sectorInReadout = rodID - 1; //rodID = 1..12
178  if(sectorInReadout>= MuonTGC_Cabling::TGCId::N_RODS) return false;
179 
180  startPhi = 2.*M_PI*(sectorInReadout-0.5)/MuonTGC_Cabling::TGCId::N_RODS;
181  endPhi = startPhi + 2.*M_PI/MuonTGC_Cabling::TGCId::N_RODS;
182 
183  return true;
184 }
185 
188  int & startEndcapSector,
189  int & coverageOfEndcapSector,
190  int & startForwardSector,
191  int & coverageOfForwardSector) const
192 {
193  int sectorInReadout = rodID - 1; //rodID = 1..12
194  if(sectorInReadout>= MuonTGC_Cabling::TGCId::N_RODS) return false;
195 
196  coverageOfEndcapSector =
199  startEndcapSector = sectorInReadout * coverageOfEndcapSector;
200  coverageOfForwardSector =
203  startForwardSector = sectorInReadout *coverageOfForwardSector;
204 
205  return true;
206 }
207 
209 // give phi-range which a ROD covers
211  double & startPhi,
212  double & endPhi) const
213 {
214  int sectorInReadout = srodID - 17; //rodID = 17..19
215  if(sectorInReadout>= MuonTGC_Cabling::TGCModuleId::NumberOfSReadoutSector) return false;
216 
217  startPhi = 2.*M_PI*(sectorInReadout-0.5)/MuonTGC_Cabling::TGCModuleId::NumberOfSReadoutSector;
219 
220  return true;
221 }
222 
225  int & startEndcapSector,
226  int & coverageOfEndcapSector,
227  int & startForwardSector,
228  int & coverageOfForwardSector) const
229 {
230  int sectorInReadout = srodID - 17; //srodID = 17..19
231  if(sectorInReadout>= MuonTGC_Cabling::TGCModuleId::NumberOfSReadoutSector) return false;
232 
233  coverageOfEndcapSector =
236  startEndcapSector = sectorInReadout * coverageOfEndcapSector;
237  coverageOfForwardSector =
240  startForwardSector = sectorInReadout *coverageOfForwardSector;
241 
242  return true;
243 }
244 
245 
247 // Readout ID is ored
248 bool MuonTGC_CablingSvc::isOredChannel(const int subDetectorID,
249  const int rodID,
250  const int sswID,
251  const int sbLoc,
252  const int channelID) const
253 {
254  Identifier id;
255  return getOfflineIDfromReadoutID(id,
256  subDetectorID,
257  rodID,
258  sswID,
259  sbLoc,
260  channelID,
261  true);
262 }
263 
264 
266 // Offline ID has adjacent Readout ID
268 {
269  int subDetectorID;
270  int rodID;
271  int sswID;
272  int sbLoc;
273  int channelID;
274  return getReadoutIDfromOfflineID(offlineID,
275  subDetectorID,
276  rodID,
277  sswID,
278  sbLoc,
279  channelID,
280  true);
281 }
282 
283 
285 // Online ID has adjacent Readout ID
286 bool MuonTGC_CablingSvc::hasAdjacentChannel(const int subsystemNumber,
287  const int octantNumber,
288  const int moduleNumber,
289  const int layerNumber,
290  const int rNumber,
291  const int wireOrStrip,
292  const int channelNumber) const
293 {
294  int subDetectorID;
295  int rodID;
296  int sswID;
297  int sbLoc;
298  int channelID;
299  ATH_MSG_DEBUG("hasAdjacentChannel() "
300  << " side=" << subsystemNumber << " octant=" << octantNumber
301  << " module=" << moduleNumber << " layer=" << layerNumber
302  << " chamber=" << rNumber << " w/s=" << wireOrStrip
303  << " channel=" << channelNumber);
304 
305  return getReadoutIDfromOnlineID(subDetectorID,
306  rodID,
307  sswID,
308  sbLoc,
309  channelID,
310  subsystemNumber,
311  octantNumber,
312  moduleNumber,
313  layerNumber,
314  rNumber,
315  wireOrStrip,
316  channelNumber,
317  true);
318 }
319 
320 
322 // readout IDs -> offline IDs
324  const int subDetectorID,
325  const int rodID,
326  const int sswID,
327  const int sbLoc,
328  const int channelID,
329  bool orChannel) const
330 {
331  int subsystemNumber;
332  int octantNumber;
333  int moduleNumber;
334  int layerNumber;
335  int rNumber;
336  int wireOrStrip;
337  int channelNumber;
338 
339  // ReadoutID -> OnlineID
340  bool status = getOnlineIDfromReadoutID(subDetectorID,
341  rodID,
342  sswID,
343  sbLoc,
344  channelID,
345  subsystemNumber,
346  octantNumber,
347  moduleNumber,
348  layerNumber,
349  rNumber,
350  wireOrStrip,
351  channelNumber,
352  orChannel);
353  if((!status) && (!orChannel)) {
355  " getOfflineIDfromReadoutID :"
356  << " Cannot get OnineID for "
357  << " subdetectorID=" << subDetectorID
358  << " rodID=" << rodID
359  << " sswID=" << sswID
360  << " sbLoc=" << sbLoc
361  << " channel=" << channelID
362  << " [ Or =" << orChannel <<"] ");
363  }
364  if(!status) {
365  return status;
366  }
367 
368  // OnlineID -> OfflineID
369  status = getOfflineIDfromOnlineID(offlineID,
370  subsystemNumber,
371  octantNumber,
372  moduleNumber,
373  layerNumber,
374  rNumber,
375  wireOrStrip,
376  channelNumber);
377 
378  if(!status) {
379  ATH_MSG_VERBOSE(" getOfflineIDfromReadoutID :"
380  << " Cannot get OfflineID for "
381  << " side=" << subsystemNumber << " octant=" << octantNumber
382  << " module=" << moduleNumber << " layer=" << layerNumber
383  << " chamber=" << rNumber << " w/s=" << wireOrStrip
384  << " channel=" << channelNumber);
385  }
386 
387  return status;
388 }
389 
390 
392 // offline IDs -> readout IDs
394  int & subDetectorID,
395  int & rodID,
396  int & sswID,
397  int & sbLoc,
398  int & channelID,
399  bool adChannel) const
400 {
401  int subsystemNumber;
402  int octantNumber;
403  int moduleNumber;
404  int layerNumber;
405  int rNumber;
406  int wireOrStrip;
407  int channelNumber;
408 
409  // OfflineID -> OnlineID
410  bool status = getOnlineIDfromOfflineID(offlineID,
411  subsystemNumber,
412  octantNumber,
413  moduleNumber,
414  layerNumber,
415  rNumber,
416  wireOrStrip,
417  channelNumber);
418 
419 
420  if(!status) {
421  ATH_MSG_WARNING(" Fail to getOnlineIDfromOfflineID " << " for OfflineID=" << offlineID);
422  }
423  if(!status) return status;
424 
425  ATH_MSG_DEBUG("getOnlineIDfromOfflineID() "
426  << " offlineID=" << offlineID
427  << " onlineID: "
428  << " side=" << subsystemNumber << " octant=" << octantNumber
429  << " module=" << moduleNumber << " layer=" << layerNumber
430  << " chamber=" << rNumber << " w/s=" << wireOrStrip
431  << " channel=" << channelNumber);
432 
433  // OnlineID -> ReadoutID
434  status = getReadoutIDfromOnlineID(subDetectorID,
435  rodID,
436  sswID,
437  sbLoc,
438  channelID,
439  subsystemNumber,
440  octantNumber,
441  moduleNumber,
442  layerNumber,
443  rNumber,
444  wireOrStrip,
445  channelNumber,
446  adChannel);
447 
448  if(!status) {
449  if(adChannel) {
450  ATH_MSG_DEBUG(" Fail to getReadoutIDfromOnlineID");
451  ATH_MSG_DEBUG(" side=" << subsystemNumber << " octant=" << octantNumber
452  << " module=" << moduleNumber << " layer=" << layerNumber
453  << " chamber=" << rNumber << " w/s=" << wireOrStrip
454  << " channel=" << channelNumber);
455  } else {
456  ATH_MSG_WARNING(" getReadoutIDfromOnlineID: "
457  << " Cannot get ReadoutID for "
458  << " side=" << subsystemNumber << " octant=" << octantNumber
459  << " module=" << moduleNumber << " layer=" << layerNumber
460  << " chamber=" << rNumber << " w/s=" << wireOrStrip
461  << " channel=" << channelNumber);
462  }
463  } else {
464  ATH_MSG_DEBUG(" SUCCESS getReadoutIDfromOnlineID");
465  ATH_MSG_DEBUG(" side=" << subsystemNumber << " octant=" << octantNumber
466  << " module=" << moduleNumber << " layer=" << layerNumber
467  << " chamber=" << rNumber << " w/s=" << wireOrStrip
468  << " channel=" << channelNumber
469  << "adjacent=" << adChannel);
470  ATH_MSG_DEBUG(" subDetectorID" << subDetectorID
471  << " rodID=" << rodID
472  << " sswID=" << sswID
473  << " channelID=" << channelID);
474  }
475 
476  return status;
477 }
478 
479 
481 // offline ID -> online IDs
483  int & subSystemNumber,
484  int & octantNumber,
485  int & moduleNumber,
486  int & layerNumber,
487  int & rNumber,
488  int & wireOrStrip,
489  int & channelNumber) const
490 {
491  // get station name in string format : T1F,T1E,T2F...
492  const int iStation = m_idHelperSvc->tgcIdHelper().stationName(offlineId);
493  const int stationType = (iStation - 39)/2;
494 
495  if((stationType <1) || (stationType >4)) return false;
496 
497  // eta and phi
498  int iEta = m_idHelperSvc->tgcIdHelper().stationEta(offlineId);
499  int iPhi = m_idHelperSvc->tgcIdHelper().stationPhi(offlineId);
500 
501  // forward/endcap
502  enum {FORWARD, ENDCAP};
503  const int regionType = m_idHelperSvc->tgcIdHelper().isForward(offlineId) ? FORWARD : ENDCAP;
504 
505  // octant index and module index
506  const int sectorEI[] = {-1, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11,
507  12, 13, 14, 15, 16, 18, 19, 20, 22, 23,
508  0};
509  int sector = -1;
510  if(regionType==ENDCAP) {
511  if(stationType!=4) {
512  // Endcap
514  } else {
515  // EI
516  sector = sectorEI[ iPhi ];
517  // iPhi is redefined for internal use
518  if(sector == 0) {
520  } else {
521  iPhi = sector;
522  }
523  }
524  } else {
525  if(stationType!=4) {
526  // Forward
528  } else {
529  // FI
531  }
532  }
533  int max_module = (regionType==FORWARD||stationType==4) ?
537  const int iOctant = static_cast<int>(sector/max_module);
538  const int iModule = sector % max_module;
539 
540  // R index
541  const int rIndex = std::abs(iEta);
542 
543  // Gas gap
544  const int iGasGap = m_idHelperSvc->tgcIdHelper().gasGap(offlineId);
545 
546  // convert to ASD-Out index
547 
548  subSystemNumber = (iEta > 0) ? 1 : -1;
549 
550  octantNumber = iOctant;
551 
552  // module# convention
553  // <---- phi ----
554  //
555  // 7 6 4 3 1 0 11 10 9
556  // 8 5 2 14 13 12
557  //
558  // [M1,M2, M3] [EI/FI]
559 
560  // module mapping N/A A B C D E F
561  const int modmapE[7] = { -1, 0, 1, 3, 4, 6, 7 };
562  const int modmapF[4] = { -1, 2, 5, 8 };
563  const int modmapEI[4] = { -1, 9, 10, 11 };
564  const int modmapFI[4] = { -1, 12, 13, 14 };
565 
566  if(stationType != 4) { // T1, T2, T3
567  if(regionType==ENDCAP) {
568  moduleNumber = modmapE[iModule+1];
569  rNumber = 5-rIndex;
570  } else {
571  moduleNumber = modmapF[iModule+1];
572  rNumber = rIndex-1;
573  }
574  } else {// TI
575  if(regionType==ENDCAP) {
576  moduleNumber = modmapEI[iModule+1];
577  rNumber = rIndex-1; // 0-offset
578  } else {
579  moduleNumber = modmapFI[iModule+1];
580  rNumber = rIndex-1;
581  }
582  }
583 
584  // layer#
585  // 0, (1), 2, ... 5, 6 (pivot) / 7, 8 (EI/FI)
586  // N/A T1 T2 T3 TI
587  const int lyr_offset[5]= { 0, -1, 2, 4, 6 };
588  layerNumber = iGasGap + lyr_offset[stationType];
589 
590  // wire (0) or strip (1)
591  wireOrStrip = m_idHelperSvc->tgcIdHelper().isStrip(offlineId);
592 
593 
594  // Offline ID channel
595  int channel = m_idHelperSvc->tgcIdHelper().channel(offlineId);
596 
597  // Offline ID cahnnel -> Online ID channel
598  // T11S : EI @ phi=2,11,13,14,15,19,20,21
599  // total number of wire channel = 16
600  // (T11 : 24 channel)
601  const int OffsetForT11S = 8;
602  // T10S : FI @ phi =2,5,8,11,14,17,20,23
603  // total number of wire channel = 30
604  // (T10 32 channel)
605 
606  if((wireOrStrip ==0) && (stationType == 4)) { // TI wire
607  if(regionType==ENDCAP) { // EI
608  // iPhi here is onlineID from 1 to 24.
609  switch(iPhi) {
610  case 2:
611  case 12:
612  case 14:
613  case 15:
614  case 16:
615  case 22:
616  case 23:
617  case 24:
618  // T11S
619  channel += OffsetForT11S;
620  break;
621  default:
622  break;
623  }
624  }
625  }
626  // SideType
628  if(subSystemNumber==1) sideType = MuonTGC_Cabling::TGCId::Aside;
629  if(subSystemNumber==-1) sideType = MuonTGC_Cabling::TGCId::Cside;
630 
631  // SignalType
633  if(wireOrStrip==0) signalType = MuonTGC_Cabling::TGCId::Wire;
634  if(wireOrStrip==1) signalType = MuonTGC_Cabling::TGCId::Strip;
635 
636  // RegionType
638  if(regionType==FORWARD) region = MuonTGC_Cabling::TGCId::Forward;
639  if(regionType==ENDCAP) region = MuonTGC_Cabling::TGCId::Endcap;
640 
641 
642  // ASDIn
643  MuonTGC_Cabling::TGCChannelASDIn asdin(sideType,
644  signalType,
645  region,
646  iPhi,
647  layerNumber,
648  rIndex,
649  channel);
650  if(!asdin.isValid()) return false;
651 
652  // offline Id -> online Id
654  m_cabling->getChannel(&asdin,
656  false);
657  if(asdout==nullptr) return false;
658  if(!asdout->isValid()) {
659  delete asdout;
660  asdout=nullptr;
661  return false;
662  }
663  channelNumber = asdout->getChannel();
664  delete asdout;
665  asdout=nullptr;
666 
667  return true;
668 }
669 
671 // online IDs -> offline ID
673  const int subSystemNumber,
674  const int octantNumber,
675  const int moduleNumber,
676  const int layerNumber,
677  const int rNumber,
678  const int wireOrStrip,
679  const int channelNumber) const
680 {
681  // SideType
683  if(subSystemNumber==1) sideType = MuonTGC_Cabling::TGCId::Aside;
684  if(subSystemNumber==-1) sideType = MuonTGC_Cabling::TGCId::Cside;
685 
686  // SignalType
688  if(wireOrStrip==0) signalType = MuonTGC_Cabling::TGCId::Wire;
689  if(wireOrStrip==1) signalType = MuonTGC_Cabling::TGCId::Strip;
690 
691  ATH_MSG_VERBOSE("getOfflineIDfromOnlineID for "
692  << " side=" << sideType << " octant=" << octantNumber
693  << " module=" << moduleNumber << " layer=" << layerNumber
694  << " chamber=" << rNumber << " w/s=" << signalType
695  << " channel=" << channelNumber);
696 
697  // ASDOut
698  MuonTGC_Cabling::TGCChannelASDOut asdout(sideType,
699  signalType,
700  octantNumber,
701  moduleNumber,
702  layerNumber,
703  rNumber,
704  channelNumber);
705  if(!asdout.isValid()) {
706  ATH_MSG_WARNING(" Illegal AsdOut for "
707  << " side=" << sideType << " octant=" << octantNumber
708  << " module=" << moduleNumber << " layer=" << layerNumber
709  << " chamber=" << rNumber << " w/s=" << signalType
710  << " channel=" << channelNumber);
711  }
712  if(!asdout.isValid()) return false;
713 
714  // online Id -> offline Id
716  m_cabling->getChannel(&asdout,
718  false);
719  if(!asdin || !asdin->isValid()) {
720  ATH_MSG_WARNING(" getOfflineIDfromOnlineID :"
721  << " Illegal AsdIn for "
722  << " side=" << sideType << " octant=" << octantNumber
723  << " module=" << moduleNumber << " layer=" << layerNumber
724  << " chamber=" << rNumber << " w/s=" << signalType
725  << " channel=" << channelNumber);
726  }
727  if(asdin==nullptr) return false;
728  if(!asdin->isValid()) {
729  delete asdin;
730  asdin = nullptr;
731  return false;
732  }
733  // build identifier
734  std::string stationNameStr;
735  switch(asdin->getStation()) {
736  case 0: // Triplet
737  stationNameStr = (asdin->isForward()) ? "T1F" : "T1E";
738  break;
739  case 1: // Middle Doublet
740  stationNameStr = (asdin->isForward()) ? "T2F" : "T2E";
741  break;
742  case 2: //Pivot Doublet
743  stationNameStr = (asdin->isForward()) ? "T3F" : "T3E";
744  break;
745  case 3: // Inner
746  stationNameStr = (asdin->isForward()) ? "T4F" : "T4E";
747  break;
748  default:
749  delete asdin; asdin = nullptr;
750  return false;
751  }
752  int stationEta = asdin->getChamber();
754  int stationPhi = asdin->getSector();
755  int gasGap = asdin->getGasGap();
756  int isStrip = (asdin->isStrip()) ? 1 : 0;
757  int channel = asdin->getChannel();
758 
759  if((asdin->getStation()==3) && (asdin->isEndcap())) {
760  // special treatment for EI
761  const int phiIE[] = { -1, 1, 2, 3, 4, 5, 6, 7, 8, -1, 9, 10,
762  11, 12, 13, 14, 15, -1, 16, 17, 18, -1, 19, 20,
763  21};
764  stationPhi = phiIE[ asdin->getSector() ];
765  if(stationPhi<0) {
766  delete asdin;
767  asdin = nullptr;
768  return false;
769  }
770  }
771 
772  // OnlineID --> OfflineID
773  // T11S : EI @ stationPhi=2,11,13,14,15,19,20,21
774  // total number of wire channel = 16
775  // (T11 24 channel)
776  const int OffsetForT11S = 8;
777  // T10S : FI @ statioPhi =2,5,8,11,14,17,20,23
778  // total number of wire channel = 30
779  // (T10 32 channel)
780  if((asdin->getStation()==3) && (!isStrip)) { // Inner Wire
781  if(asdin->isEndcap()) {
782  switch(stationPhi) {
783  case 2:
784  case 11:
785  case 13:
786  case 14:
787  case 15:
788  case 19:
789  case 20:
790  case 21:
791  // T11S
792  channel -= OffsetForT11S;
793  if(channel<=0) {
794  delete asdin;
795  return false;
796  }
797  break;
798  default:
799  break;
800  }
801  }
802  }
803 
804 
805  offlineId = m_idHelperSvc->tgcIdHelper().channelID(stationNameStr,
806  stationEta,
807  stationPhi,
808  gasGap,
809  isStrip,
810  channel);
811 
812  delete asdin;
813  asdin = nullptr;
814  return true;
815 }
816 
818 // readout IDs -> online IDs
819 bool MuonTGC_CablingSvc::getOnlineIDfromReadoutID(const int subDetectorID,
820  const int rodID,
821  const int sswID,
822  const int sbLoc,
823  const int channelID,
824  int & subsystemNumber,
825  int & octantNumber,
826  int & moduleNumber,
827  int & layerNumber,
828  int & rNumber,
829  int & wireOrStrip,
830  int & channelNumber,
831  bool orChannel) const
832 {
833  // SideType
835  if(subDetectorID==m_AsideId.value()) sideType = MuonTGC_Cabling::TGCId::Aside;
836  if(subDetectorID==m_CsideId.value()) sideType = MuonTGC_Cabling::TGCId::Cside;
837 
838  // readout channel -> chamber channel
841  rodID,
842  sswID,
843  sbLoc,
844  channelID,
845  orChannel);
846  if(asdout==nullptr) {
847  if(!orChannel) {
848  ATH_MSG_VERBOSE(" getOnlineIDfromReadoutID :"
849  << " Cannot get OnlineID of "
850  << " side=" << sideType
851  << " rodID=" << rodID
852  << " sswID=" << sswID
853  << " sbLoc=" << sbLoc
854  << " channel=" << channelID
855  << " [ Or =" << orChannel <<"] ");
856  }
857  return false;
858  }
859  if(!asdout->isValid()) {
860  ATH_MSG_WARNING(" getOnlineIDfromReadoutID :"
861  << " Illegal ASDout for "
862  << " side=" << sideType
863  << " rodID=" << rodID
864  << " sswID=" << sswID
865  << " sbLoc=" << sbLoc
866  << " channel=" << channelID
867  << " [ Or =" << orChannel <<"] ");
868 
869  delete asdout;
870  asdout = nullptr;
871  return false;
872  }
873  // SubsystemNumber
874  subsystemNumber = (asdout->isAside()) ? 1 : -1;
875 
876  // OctantNumber
877  octantNumber = asdout->getOctant();
878 
879  // RNumber
880  rNumber = asdout->getChamber();
881 
882  // ModuleNumber
883  moduleNumber = asdout->getSectorModule();
884 
885  layerNumber = asdout->getLayer();
886 
887  // WireOrStrip
888  wireOrStrip = (asdout->isStrip()) ? 1 : 0;
889 
890  // ChannelNumber
891  channelNumber = asdout->getChannel();
892 
893  delete asdout;
894  asdout = nullptr;
895  return true;
896 }
897 
899 // online IDs -> readout IDs
901  int & rodID,
902  int & sswID,
903  int & sbLoc,
904  int & channelID,
905  const int subsystemNumber,
906  const int octantNumber,
907  const int moduleNumber,
908  const int layerNumber,
909  const int rNumber,
910  const int wireOrStrip,
911  const int channelNumber,
912  bool adChannel) const
913 {
914  // SideType
916  if(subsystemNumber==1) sideType = MuonTGC_Cabling::TGCId::Aside;
917  if(subsystemNumber==-1) sideType = MuonTGC_Cabling::TGCId::Cside;
918 
919  // SignalType
921  if(wireOrStrip==0) signalType = MuonTGC_Cabling::TGCId::Wire;
922  if(wireOrStrip==1) signalType = MuonTGC_Cabling::TGCId::Strip;
923 
924  // ASDOut
925  MuonTGC_Cabling::TGCChannelASDOut asdout(sideType,
926  signalType,
927  octantNumber,
928  moduleNumber,
929  layerNumber,
930  rNumber,
931  channelNumber);
932  if(!asdout.isValid()) {
933  ATH_MSG_WARNING(" getReadoutIDfromOnlineID() :"
934  << " Cannot get ASDout for "
935  << " side=" << sideType
936  << " signal=" << signalType
937  << " octant=" << octantNumber
938  << " module=" << moduleNumber
939  << " layer=" << layerNumber
940  << " chamber=" << rNumber
941  << " channel=" << channelNumber);
942  }
943 
944  if(!asdout.isValid()) return false;
945 
946  // chamber channel -> readout channel
947  bool status = m_cabling->getReadoutFromASDOut(&asdout,
948  sideType,
949  rodID,
950  sswID,
951  sbLoc,
952  channelID,
953  adChannel);
954  if(!status) {
955  if(adChannel) {
956  ATH_MSG_DEBUG("getReadoutIDfromASDOut fails for adjacent");
957  }
958  else {
959  ATH_MSG_WARNING(" getReadoutIDfromASDOut :"
960  << " Cannot get ReadoutID for "
961  << " side=" << sideType
962  << " signal=" << signalType
963  << " octant=" << octantNumber
964  << " module=" << moduleNumber
965  << " layer=" << layerNumber
966  << " chamber=" << rNumber
967  << " channel=" << channelNumber);
968  }
969  }
970  if(!status) return false;
971 
972  // SubDetectorID
973  if(sideType==MuonTGC_Cabling::TGCId::Aside) subDetectorID = m_AsideId.value();
974  if(sideType==MuonTGC_Cabling::TGCId::Cside) subDetectorID = m_CsideId.value();
975 
976  return status;
977 }
978 
979 // element ID -> readout IDs
981  int & subdetectorID,
982  int & rodID) const
983 {
984  // get station name in string format : T1F,T1E,T2F...
985  const int iStation = m_idHelperSvc->tgcIdHelper().stationName(elementID);
986  const int stationType = (iStation - 39)/2;
987 
988  int iEta = m_idHelperSvc->tgcIdHelper().stationEta(elementID);
989  int iPhi = m_idHelperSvc->tgcIdHelper().stationPhi(elementID);
990 
991  // forward/endcap
992  enum {FORWARD, ENDCAP};
993  const int regionType = m_idHelperSvc->tgcIdHelper().isForward(elementID) ? FORWARD : ENDCAP;
994 
995  // SideType
996  subdetectorID = (iEta > 0) ? m_AsideId.value() : m_CsideId.value();
997 
998  // sector index and module index
999  const int max_phi = (regionType==FORWARD||stationType==4) ?
1002  const int max_module = max_phi / MuonTGC_Cabling::TGCId::N_RODS;
1003  const int sector = ((iPhi-1)+ max_phi/24 + max_phi)%max_phi;
1004  int readoutSector = static_cast<int>(sector/max_module);
1005  // Inner case
1006  if(stationType==4) {
1007  readoutSector = (readoutSector /3);
1008  readoutSector = 3*readoutSector + 1;
1009  }
1010 
1011 
1012  rodID = readoutSector +1;
1013 
1014 
1015  return true;
1016 }
1017 
1019 // readout IDs -> element ID
1021  const int subDetectorID,
1022  const int rodID,
1023  const int sswID,
1024  const int sbLoc,
1025  const int channelID,
1026  bool orChannel) const
1027 {
1028  Identifier offlineID;
1029 
1030  // get min/max values for ReadoutID parameters
1031  int maxRodId, maxSRodId, maxSswId, maxSbloc, minChannelId ,maxChannelId;
1032  getReadoutIDRanges(maxRodId, maxSRodId, maxSswId, maxSbloc,
1033  minChannelId, maxChannelId);
1034 
1035  // check sswID and channelID in allowed range
1036  if((sswID > maxSswId) ||
1037  (channelID < minChannelId) ||
1038  (channelID > maxChannelId)) {
1039  ATH_MSG_DEBUG(" getElementIDfromReadoutID() :"
1040  << " Illeagal channel ID"
1041  << " subdetectorID=" << subDetectorID
1042  << " rodID=" << rodID
1043  << " sswID=" << sswID
1044  << " sbLoc=" << sbLoc
1045  << " channel=" << channelID
1046  << " [ Or =" << orChannel <<"] ");
1047  return false;
1048  }
1049 
1050  bool status = getOfflineIDfromReadoutID(offlineID,
1051  subDetectorID,
1052  rodID,
1053  sswID,
1054  sbLoc,
1055  channelID,
1056  orChannel);
1057  if(!status) {
1058  ATH_MSG_DEBUG(" getElementIDfromReadoutID :"
1059  << " Cannot get OfflineID ");
1060  return false;
1061  }
1062 
1063  elementID = m_idHelperSvc->tgcIdHelper().elementID(offlineID);
1064  return true;
1065 }
1066 
1068 // readout ID -> SLB ID
1070  bool & isAside,
1071  bool & isEndcap,
1072  int & moduleType,
1073  int & id,
1074  const int subsectorID,
1075  const int rodID,
1076  const int sswID,
1077  const int sbLoc) const
1078 {
1079  isAside = (subsectorID==m_AsideId);
1080 
1082 
1083  const MuonTGC_Cabling::TGCModuleId * slb = m_cabling->getSLBFromReadout(side, rodID, sswID, sbLoc);
1084  if(!slb) {
1085  ATH_MSG_VERBOSE(" getSLBIDfromReadoutID :"
1086  << " Cannot get SLB of "
1087  << " side" << side
1088  << " rodID=" << rodID
1089  << " sswID=" << sswID
1090  << " sbLoc=" << sbLoc);
1091  return false;
1092  }
1093 
1094  isEndcap = (slb->getRegionType()==MuonTGC_Cabling::TGCId::Endcap);
1095  moduleType = (int)slb->getModuleType();
1096  bool isInner = (moduleType==MuonTGC_Cabling::TGCId::WI || moduleType==MuonTGC_Cabling::TGCId::SI);
1097  int offset, numOfSector;
1098  if(isInner) {
1100  } else {
1101  if(isEndcap) {
1103  }else{
1105  }
1106  }
1107  offset = numOfSector - numOfSector/24;
1108  phi = (slb->getSector()+offset)%numOfSector +1;
1109  id = slb->getId();
1110 
1111  return true;
1112 }
1113 
1115 // readout ID -> rxID
1117  const int subsectorID,
1118  const int rodID,
1119  const int sswID,
1120  const int sbLoc) const
1121 {
1122  slbAddr = -1;
1123 
1124  bool isAside = (subsectorID==m_AsideId);
1125 
1127 
1128  const MuonTGC_Cabling::TGCModuleId * slb = m_cabling->getSLBFromReadout(side, rodID, sswID, sbLoc);
1129  if(!slb) {
1130  ATH_MSG_WARNING(" getSLBAddressfromReadoutID :"
1131  << " Cannot get SLB of "
1132  << " side" << side
1133  << " rodID=" << rodID
1134  << " sswID=" << sswID
1135  << " sbLoc=" << sbLoc);
1136  return false;
1137  }
1138 
1139  const MuonTGC_Cabling::TGCModuleSLB* modSlb = dynamic_cast<const MuonTGC_Cabling::TGCModuleSLB*>(slb);
1140  if(!modSlb) {
1141  ATH_MSG_WARNING("MuonTGC_CablingSvc::getSLBAddressfromReadoutID "
1142  << "dynamic_cast<const MuonTGC_Cabling::TGCModuleSLB*>(slb) failed.");
1143  return false;
1144  }
1145 
1146  slbAddr = modSlb->getSlbAddr();
1147  return true;
1148 }
1149 
1151 // readout ID -> RxID
1153  const int subsectorID,
1154  const int rodID,
1155  const int sswID,
1156  const int sbLoc) const
1157 {
1158  rxId = -1;
1159 
1160  bool isAside = (subsectorID==m_AsideId);
1162 
1163  rxId = m_cabling->getRxIdFromReadout(side, rodID, sswID, sbLoc);
1164  if(rxId<0) {
1165  ATH_MSG_WARNING(" getRxIDfromReadoutID :"
1166  << " Cannot get rxId of "
1167  << " side" << side
1168  << " rodID=" << rodID
1169  << " sswID=" << sswID
1170  << " sbLoc=" << sbLoc);
1171  return false;
1172  }
1173  return true;
1174 }
1175 
1177 // ROD_ID / SSW_ID / RX_ID -> SLB ID
1179  bool &isAside,
1180  bool &isEndcap,
1181  int &moduleType,
1182  int &id,
1183  const int subsectorID,
1184  const int rodID,
1185  const int sswID,
1186  const int rxId) const
1187 {
1188  isAside = (subsectorID==m_AsideId);
1190 
1191  MuonTGC_Cabling::TGCModuleId * slb = m_cabling->getSLBFromRxId(side, rodID, sswID, rxId);
1192  if(!slb) {
1193  ATH_MSG_WARNING("geSLBIDfromRxID :"
1194  << " Cannot get SLB of "
1195  << " side" << side
1196  << " rodID=" << rodID
1197  << " sswID=" << sswID
1198  << " rxId=" << rxId);
1199  return false;
1200  }
1201 
1202  isEndcap = (slb->getRegionType()==MuonTGC_Cabling::TGCId::Endcap);
1203  moduleType = (int)slb->getModuleType();
1204  bool isInner = (moduleType==MuonTGC_Cabling::TGCId::WI || moduleType==MuonTGC_Cabling::TGCId::SI);
1205  int offset, numOfSector;
1206  if(isInner) {
1208  } else {
1209  if(isEndcap) {
1211  } else {
1213  }
1214  }
1215  offset = numOfSector - numOfSector/24;
1216  phi = (slb->getSector()+offset)%numOfSector +1;
1217  id = slb->getId();
1218  delete slb; slb = nullptr;
1219  return true;
1220 }
1221 
1223 // SLB ID -> readout ID
1225  const bool isAside,
1226  const bool isEndcap,
1227  const int moduleType,
1228  const int id,
1229  int & subsectorID,
1230  int & rodID,
1231  int & sswID,
1232  int & sbLoc) const
1233 {
1237  int sector = -1;// sector=0-47(EC), 0-23(FWD), 0-23(INNER)
1238  if(isInner) {
1240  } else if(isEndcap) {
1242  } else {
1244  }
1246 
1247  MuonTGC_Cabling::TGCModuleSLB slb(side, module, region, sector, id);
1248 
1249  if(!slb.isValid()) {
1250  ATH_MSG_WARNING("getReadoutIDfromSLBID "
1251  << " phi=" << phi
1252  << " side=" << ((isAside) ? "A" : "C")
1253  << " region=" << ((isEndcap) ? "Endcap" : "Forward")
1254  << " type=" << moduleType
1255  << " id=" << id
1256  << " Invalid SLB");
1257  }
1258  if(!slb.isValid()) return false;
1259 
1260  subsectorID = (isAside ? m_AsideId : m_CsideId);
1261 
1262  bool status = m_cabling->getReadoutFromSLB(&slb, side, rodID, sswID, sbLoc);
1263 
1264  if(!status) {
1265  ATH_MSG_DEBUG(" FAIL getReadoutIDfromSLBID");
1266  } else {
1267  ATH_MSG_DEBUG(" SUCCESS getReadoutIDfromSLBID");
1268  ATH_MSG_DEBUG(" phi=" << phi
1269  << " side=" << ((isAside) ? "A" : "C")
1270  << " region=" << ((isEndcap) ? "Endcap" : "Forward")
1271  << " type=" << moduleType
1272  << " id=" << id
1273  << " side" << side
1274  << " rodID=" << rodID
1275  << " sswID=" << sswID
1276  << " sbLoc=" << sbLoc);
1277  }
1278  if(!status) return false;
1279  return true;
1280 }
1281 
1282 
1284 // readout ID -> SL ID
1286  bool & isAside,
1287  bool & isEndcap,
1288  const int subsectorID,
1289  const int rodID,
1290  const int sswID,
1291  const int sbLoc) const
1292 {
1293  isAside = (subsectorID==m_AsideId);
1294  if(!isAside && (subsectorID!=m_CsideId)) {
1295  ATH_MSG_WARNING(" getSLIDfromReadoutID : "
1296  << " ERROR illegal subsectorID [="
1297  << subsectorID <<"] ");
1298  return false;
1299  }
1300  int sectorInReadout = (rodID -1); // rodID = 1..12 for both sides
1301  if(sectorInReadout>= MuonTGC_Cabling::TGCId::N_RODS) return false;
1302 
1303  // sswID check removed
1304  if(sswID!= 9) {
1305  ATH_MSG_WARNING(" getSLIDfromReadoutID : "
1306  << " ERROR sswID for SL should be 9 [now ="
1307  << sswID <<"] ");
1308  return false;
1309  }
1310 
1311  int offset, numOfSector, sector;
1312  if(0<=sbLoc && sbLoc <= 3) {
1313  isEndcap=true;
1314  numOfSector = MuonTGC_Cabling::TGCId::NUM_ENDCAP_SECTOR; // 48
1315  offset = numOfSector - numOfSector/24; // 48 - 2 = 46
1316  sector = numOfSector * sectorInReadout / MuonTGC_Cabling::TGCId::N_RODS;
1317  phi = (sector + sbLoc + offset)%numOfSector+1;
1318  } else if(sbLoc==4 || sbLoc==5) {
1319  isEndcap=false;
1321  offset = numOfSector - numOfSector/24;
1322  sector = numOfSector * sectorInReadout / MuonTGC_Cabling::TGCId::N_RODS;
1323  phi = (sector + (sbLoc-4) + offset)% numOfSector+1;
1324  } else {
1325  ATH_MSG_WARNING(" getSLIDfromReadoutID : "
1326  << " ERROR illegal sbLoc for SL [="
1327  << sbLoc <<"] ");
1328  return false;
1329  }
1330  return true;
1331 }
1332 
1334 // readout ID (only SROD) -> SL ID
1336  bool & isAside,
1337  const int subsectorID,
1338  const int srodID,
1339  const int sector,
1340  const bool forward) const
1341 {
1342  isAside = (subsectorID==m_AsideId);
1343  if(!isAside && (subsectorID!=m_CsideId)) {
1344  ATH_MSG_WARNING(" getSLIDfromReadoutID : "
1345  << " ERROR illegal subsectorID [="
1346  << subsectorID <<"] ");
1347  return false;
1348  }
1349 
1350  int sectorInReadout = (srodID - 17); // 0-2, srodID : 0x11-0x13 (17-19)
1351  if((sectorInReadout >= MuonTGC_Cabling::TGCModuleId::NumberOfSReadoutSector) ||
1352  (sectorInReadout < 0)){
1353  ATH_MSG_WARNING(" Invalid SROD ID : " << srodID );
1354  return false;
1355  }
1356 
1357  int offset, tmpsector, numOfSector;
1358  // sswID check removed
1359  if(forward) {
1361  offset = numOfSector - numOfSector/24; // 24 - 1
1362  tmpsector = numOfSector * sectorInReadout / MuonTGC_Cabling::TGCModuleId::NumberOfSReadoutSector; // 8*[0-2]
1363  phi = (sector + tmpsector + offset)%numOfSector + 1;
1364  }else{
1366  offset = numOfSector - numOfSector/24; // 48 - 2
1367  tmpsector = numOfSector * sectorInReadout / MuonTGC_Cabling::TGCModuleId::NumberOfSReadoutSector; // 16*[0-2]
1368  phi = (sector + tmpsector + offset)%numOfSector + 1;
1369  }
1370  return true;
1371 }
1372 
1374 // SL ID -> readout ID
1376  const bool isAside,
1377  const bool isEndcap,
1378  int & subsectorID,
1379  int & rodID,
1380  int & sswID,
1381  int & sbLoc) const
1382 {
1383  if(isAside)subsectorID=m_AsideId;
1384  else subsectorID=m_CsideId;
1385 
1386  if(isEndcap) {
1387  if(phi<1 || phi>MuonTGC_Cabling::TGCId::NUM_ENDCAP_SECTOR) return false;
1388  } else {
1389  if(phi<1 || phi>MuonTGC_Cabling::TGCId::NUM_FORWARD_SECTOR) return false;
1390  }
1391 
1392  int sector;
1393  int sectorInReadout;
1394  if(isEndcap) {
1396  sectorInReadout = sector %
1398  sbLoc = sectorInReadout;
1399  rodID = (sector-sectorInReadout)/
1401  + 1;
1402  } else {
1404  sectorInReadout = sector %
1406  sbLoc = sectorInReadout +4;
1407  rodID = (sector-sectorInReadout)/
1409  + 1;
1410  }
1411  // Fixed SSWID for SL
1412  sswID = 9;
1413 
1414  return true;
1415 }
1416 
1418 // SL ID -> readout ID
1420  const bool isAside,
1421  const bool isEndcap,
1422  int & subsectorID,
1423  int & srodID,
1424  int & sswID,
1425  int & sbLoc) const
1426 {
1427  if(isAside)subsectorID=m_AsideId;
1428  else subsectorID=m_CsideId;
1429 
1430  if(isEndcap) {
1431  if(phi<1 || phi>MuonTGC_Cabling::TGCId::NUM_ENDCAP_SECTOR) return false;
1432  } else {
1433  if(phi<1 || phi>MuonTGC_Cabling::TGCId::NUM_FORWARD_SECTOR) return false;
1434  }
1435 
1436  int sector;
1437  int sectorInReadout;
1438  if(isEndcap) {
1440  sectorInReadout = sector %
1442  sbLoc = sectorInReadout;
1443  srodID = (sector-sectorInReadout)/
1445  + 0x11 ;
1446  } else {
1448  sectorInReadout = sector %
1450  sbLoc = sectorInReadout;
1451  srodID = (sector-sectorInReadout)/
1453  + 0x11;
1454  }
1455  // Fixed SSWID for SL
1456  sswID = 9;
1457 
1458  return true;
1459 }
1460 
1462 // HPT ID -> readout ID
1464  const bool isAside,
1465  const bool isEndcap,
1466  const bool ,
1467  const int ,
1468  int & subsectorID,
1469  int & rodID,
1470  int & sswID,
1471  int & sbLoc) const
1472 {
1473  return getReadoutIDfromSLID(phi, isAside, isEndcap,
1474  subsectorID,
1475  rodID,
1476  sswID,
1477  sbLoc);
1478 }
1479 
1480 
1481 
1483 // channel connection
1487  bool orChannel) const
1488 {
1489  return m_cabling->getChannel(channelId, type, orChannel);
1490 }
1491 
1492 
1494 // module connection
1498 {
1499  return m_cabling->getModule(moduleId, type);
1500 }
1501 
1502 
1504 // CAUTION!!: return RDO value (not the value for simulation)
1506  bool isForward,
1507  bool isStrip,
1508  int & hpb,
1509  int & chip,
1510  int & hitId,
1511  int & sub) const
1512 {
1513  // for Strip, there is some ambiguity in the relation between hitID and ROI
1514  bool status = true;
1515  int RoiRow = static_cast<int>(roi/4);
1516  int RoiColumn = static_cast<int>(roi%4);
1517 
1518  if(!isStrip) {
1519  if(isForward) {
1520  switch(RoiRow) {
1521  case 0: chip=0; hitId=1; sub=0; break;
1522  case 1: chip=0; hitId=1; sub=1; break;
1523  case 2: chip=0; hitId=2; sub=0; break;
1524  case 3: chip=0; hitId=2; sub=1; break;
1525  case 4: chip=0; hitId=3; sub=0; break;
1526  case 5: chip=0; hitId=3; sub=1; break;
1527  case 6: chip=0; hitId=4; sub=0; break;
1528  case 7: chip=0; hitId=4; sub=1; break;
1529  case 8: chip=0; hitId=5; sub=0; break;
1530  case 9: chip=0; hitId=5; sub=1; break;
1531  case 10: chip=0; hitId=6; sub=0; break;
1532  case 11: chip=0; hitId=6; sub=1; break;
1533  case 12: chip=1; hitId=1; sub=0; break;
1534  case 13: chip=1; hitId=1; sub=1; break;
1535  case 14: chip=1; hitId=2; sub=0; break;
1536  case 15: chip=1; hitId=2; sub=1; break;
1537  default: status=false; break;
1538  }
1539  } else {
1540  switch(RoiRow) {
1541  case 0: chip=0; hitId=1; sub=1; break;
1542  case 1: chip=1; hitId=1; sub=0; break;
1543  case 2: chip=1; hitId=1; sub=1; break;
1544  case 3: chip=1; hitId=2; sub=0; break;
1545  case 4: chip=1; hitId=2; sub=1; break;
1546  case 5: chip=1; hitId=3; sub=0; break;
1547  case 6: chip=1; hitId=3; sub=1; break;
1548  case 7: chip=1; hitId=4; sub=0; break;
1549  case 8: chip=1; hitId=4; sub=1; break;
1550  case 9: chip=1; hitId=5; sub=0; break;
1551  case 10: chip=1; hitId=5; sub=1; break;
1552  case 11: chip=1; hitId=6; sub=0; break;
1553  case 12: chip=1; hitId=6; sub=1; break;
1554  case 13: chip=2; hitId=1; sub=0; break;
1555  case 14: chip=2; hitId=1; sub=1; break;
1556  case 15: chip=2; hitId=2; sub=0; break;
1557  case 16: chip=2; hitId=2; sub=1; break;
1558  case 17: chip=2; hitId=3; sub=0; break;
1559  case 18: chip=2; hitId=3; sub=1; break;
1560  case 19: chip=2; hitId=4; sub=0; break;
1561  case 20: chip=2; hitId=4; sub=1; break;
1562  case 21: chip=2; hitId=5; sub=0; break;
1563  case 22: chip=2; hitId=5; sub=1; break;
1564  case 23: chip=2; hitId=6; sub=0; break;
1565  case 24: chip=2; hitId=6; sub=1; break;
1566  case 25: chip=3; hitId=1; sub=0; break;
1567  case 26: chip=3; hitId=1; sub=1; break;
1568  case 27: chip=3; hitId=2; sub=0; break;
1569  case 28: chip=3; hitId=2; sub=1; break;
1570  case 29: chip=3; hitId=3; sub=0; break;
1571  case 30: chip=3; hitId=3; sub=1; break;
1572  case 31: chip=3; hitId=4; sub=0; break;
1573  case 32: chip=3; hitId=4; sub=1; break;
1574  case 33: chip=3; hitId=5; sub=0; break;
1575  case 34: chip=3; hitId=5; sub=1; break;
1576  case 35: chip=3; hitId=6; sub=0; break;
1577  case 36: chip=3; hitId=6; sub=1; break;
1578  default: status=false; break;
1579  }
1580  }
1581  } else if(isStrip) {
1582  if(isForward) {
1583  switch(RoiColumn) {
1584  case 0: chip=0; hitId=1; sub=0; break;
1585  case 1: chip=0; hitId=1; sub=1; break;
1586  case 2: chip=0; hitId=2; sub=0; break;
1587  case 3: chip=0; hitId=2; sub=1; break;
1588  default: status=false; break;
1589  }
1590  } else {
1591  switch(RoiColumn) {
1592  case 0:
1593  if(RoiRow < 5) { chip=0; hitId=1; sub=0; }
1594  else if(RoiRow < 8) { chip=0; hitId=3; sub=0; }
1595  else if(RoiRow < 12) { chip=0; hitId=5; sub=0; }
1596  else if(RoiRow < 25) { chip=1; hitId=1; sub=0; }
1597  else if(RoiRow < 37) { chip=1; hitId=5; sub=0; }
1598  else status=false;
1599  break;
1600  case 1:
1601  if(RoiRow < 5) { chip=0; hitId=1; sub=1; }
1602  else if(RoiRow < 8) { chip=0; hitId=3; sub=1; }
1603  else if(RoiRow < 12) { chip=0; hitId=5; sub=1; }
1604  else if(RoiRow < 25) { chip=1; hitId=1; sub=1; }
1605  else if(RoiRow < 37) { chip=1; hitId=5; sub=1; }
1606  else status=false;
1607  break;
1608  case 2:
1609  if(RoiRow < 5) { chip=0; hitId=2; sub=0; }
1610  else if(RoiRow < 8) { chip=0; hitId=4; sub=0; }
1611  else if(RoiRow < 12) { chip=0; hitId=6; sub=0; }
1612  else if(RoiRow < 25) { chip=1; hitId=2; sub=0; }
1613  else if(RoiRow < 37) { chip=1; hitId=6; sub=0; }
1614  else status=false;
1615  break;
1616  case 3:
1617  if(RoiRow < 5) { chip=0; hitId=2; sub=1; }
1618  else if(RoiRow < 8) { chip=0; hitId=4; sub=1; }
1619  else if(RoiRow < 12) { chip=0; hitId=6; sub=1; }
1620  else if(RoiRow < 25) { chip=1; hitId=2; sub=1; }
1621  else if(RoiRow < 37) { chip=1; hitId=6; sub=1; }
1622  else status=false;
1623  break;
1624  default: status=false; break;
1625  }
1626  }
1627  }
1628 
1629  hpb = 0;
1630 
1631  return status;
1632 }
1633 
1636  bool isForward,
1637  int , // hpb_wire
1638  int chip_wire,
1639  int hitId_wire,
1640  int sub_wire,
1641  int , // chip_strip
1642  int hitId_strip,
1643  int sub_strip) const
1644 {
1645  // for Strip, there is some ambiguity in the relation between hitID and ROI
1646  // CAUTION!!: return RDO value (not the value for simulation)
1647  bool status = true;
1648  int RoiRow = 0;
1649  int RoiColumn = 0;
1650 
1651  if(isForward) {
1652  RoiRow = 12*chip_wire + 2*(hitId_wire - 1) + sub_wire;
1653  RoiColumn = 2*((hitId_strip - 1)%2) + sub_strip;
1654  } else if(!isForward) {
1655  RoiColumn = 2*((hitId_strip - 1)%2) + sub_strip;
1656  switch(chip_wire) {
1657  case 0: RoiRow=0; break;
1658  case 1:
1659  case 2:
1660  case 3: RoiRow=12*(chip_wire-1) + 2*(hitId_wire - 1) + sub_wire + 1; break;
1661  default: break;
1662  }
1663  }
1664 
1665  roi = 4*RoiRow + RoiColumn;
1666 
1667  return status;
1668 }
1669 
1670 
1672 // HighPtID used in Simulation -> HighPtID in RDO
1674  const bool isStrip,
1675  int & index,
1676  int & chip,
1677  int & hitId) const
1678 {
1679  if(isForward) {
1680  if(isStrip) {//FS
1681  index=0; hitId--;
1682  } else if(!isStrip) {//FW
1683  index=0; hitId++;
1684  }
1685  } else {
1686  if(isStrip) {//ES
1687  index=0; hitId++;
1688  } else if(!isStrip) {//EW
1689  if(index==0 && chip==0) hitId=1;
1690  else if(index==0 && chip==1) hitId++;
1691  else if(index==1 && chip==0) {chip=2; hitId++;}
1692  else if(index==1 && chip==1) {chip=3; hitId++;}
1693  }
1694  }
1695 
1696  return true;
1697 }
1698 
1700 // HighPtID in RDO -> HighPtID used in Simulation
1702  const bool isStrip,
1703  int & index,
1704  int & chip,
1705  int & hitId) const
1706 {
1707  if(isForward) {
1708  if(isStrip) {//FS
1709  index=0; hitId++;
1710  } else if(!isStrip) {//FW
1711  index=0; hitId--;
1712  }
1713  } else {
1714  if(isStrip) {//ES
1715  index=0; hitId--;
1716  } else if(!isStrip) {//EW
1717  switch(chip) {
1718  case 0: index=0; hitId=5; break;
1719  case 1: index=0; hitId--; break;
1720  case 2: index=1; chip=0; hitId--; break;
1721  case 3: index=1; chip=1; hitId--; break;
1722  default: break;
1723  }
1724  }
1725  }
1726 
1727  return true;
1728 }
1729 
1731 // high pt coincidence IDs -> offline IDs
1733  const int subDetectorID,
1734  const int rodID,
1735  const int sectorInReadout,
1736  const bool isStrip,
1737  const bool isForward,
1738  const int hpb,
1739  const int chip,
1740  const int hitID,
1741  const int pos) const
1742 {
1743  // all input is derived from TgcRawData
1744  int sswID = -1;
1745  int sbLoc = -1;
1746  int channelID = -1;
1747 
1748  // SideType
1750  if(subDetectorID==m_AsideId.value()) sideType = MuonTGC_Cabling::TGCId::Aside;
1751  if(subDetectorID==m_CsideId.value()) sideType = MuonTGC_Cabling::TGCId::Cside;
1752 
1753  // SignalType, RegionType
1756 
1757  // ModuleType
1759  if(signalType==MuonTGC_Cabling::TGCId::Wire) {
1760  moduleType=MuonTGC_Cabling::TGCId::WD;
1761  } else {
1762  moduleType=MuonTGC_Cabling::TGCId::SD;
1763  }
1764 
1765  // Get ReadoutID for pivot plane
1766  bool status = m_cabling->getReadoutFromHighPtID(sideType,
1767  rodID,
1768  sswID,
1769  sbLoc,
1770  channelID,
1771  signalType,
1772  regionType,
1773  sectorInReadout,
1774  hpb,
1775  chip,
1776  hitID,
1777  pos,
1778  moduleType,
1779  false);
1780 
1781  if(!status) return false;
1782 
1783  // get OfflineID for pivot plane
1784  return getOfflineIDfromReadoutID(offlineID,
1785  subDetectorID,
1786  rodID,
1787  sswID,
1788  sbLoc,
1789  channelID);
1790 
1791 }
1792 
1794 // offline IDs -> high pt coincidence IDs
1796  int & subDetectorID,
1797  int & rodID,
1798  int & sectorInReadout,
1799  bool & isStrip,
1800  bool & isForward,
1801  int & hpb,
1802  int & chip,
1803  int & hitID,
1804  int & pos) const
1805 {
1806  int sswID = -1;
1807  int sbLoc = -1;
1808  int channelID = -1;
1809 
1810  bool status = getReadoutIDfromOfflineID(offlineID,
1811  subDetectorID,
1812  rodID,
1813  sswID,
1814  sbLoc,
1815  channelID);
1816  if(!status) return false;
1817 
1818  // SideType
1820  if(subDetectorID==m_AsideId.value()) sideType = MuonTGC_Cabling::TGCId::Aside;
1821  if(subDetectorID==m_CsideId.value()) sideType = MuonTGC_Cabling::TGCId::Cside;
1822 
1825 
1827  rodID,
1828  sswID,
1829  sbLoc,
1830  channelID,
1831  signalType,
1832  regionType,
1833  sectorInReadout,
1834  hpb,
1835  chip,
1836  hitID,
1837  pos);
1838  if(!status) return false;
1839 
1840  isStrip = (signalType==MuonTGC_Cabling::TGCId::Strip);
1841  isForward = (regionType==MuonTGC_Cabling::TGCId::Forward);
1842 
1843  return true;
1844 }
1845 
1846 
1848 // low pt coincidence IDs -> offline IDs
1850  const int subDetectorID,
1851  const int rodID,
1852  const int sswID,
1853  const int sbLoc,
1854  const int block,
1855  const int pos,
1856  bool middle) const
1857 {
1858  int channelID = -1;
1859 
1860  // SideType
1862  if(subDetectorID==m_AsideId.value()) sideType = MuonTGC_Cabling::TGCId::Aside;
1863  if(subDetectorID==m_CsideId.value()) sideType = MuonTGC_Cabling::TGCId::Cside;
1864 
1866  rodID,
1867  sswID,
1868  sbLoc,
1869  channelID,
1870  block,
1871  pos,
1872  middle);
1873  if(!status) return false;
1874 
1875  return getOfflineIDfromReadoutID(offlineID,
1876  subDetectorID,
1877  rodID,
1878  sswID,
1879  sbLoc,
1880  channelID);
1881 }
1882 
1884 // offline IDs -> low pt coincidence IDs
1886  int & subDetectorID,
1887  int & rodID,
1888  int & sswID,
1889  int & sbLoc,
1890  int & block,
1891  int & pos,
1892  bool middle) const
1893 {
1894  int channelID = -1;
1895 
1896  bool status = getReadoutIDfromOfflineID(offlineID,
1897  subDetectorID,
1898  rodID,
1899  sswID,
1900  sbLoc,
1901  channelID);
1902  if(!status) return false;
1903 
1904  // SideType
1906  if(subDetectorID==m_AsideId.value()) sideType = MuonTGC_Cabling::TGCId::Aside;
1907  if(subDetectorID==m_CsideId.value()) sideType = MuonTGC_Cabling::TGCId::Cside;
1908 
1909  return m_cabling->getLowPtCoincidenceFromReadout(sideType,
1910  rodID,
1911  sswID,
1912  sbLoc,
1913  channelID,
1914  block,
1915  pos,
1916  middle);
1917 }
MuonTGC_Cabling::TGCId::getChamber
int getChamber() const
Definition: TGCId.h:131
MuonTGC_CablingSvc::getSLIDfromSReadoutID
bool getSLIDfromSReadoutID(int &phi, bool &isAside, const int subsectorID, const int srodID, const int sector, const bool forward) const
Definition: MuonTGC_CablingSvc.cxx:1335
MuonTGC_Cabling::TGCId::isEndcap
bool isEndcap() const
Definition: TGCId.h:142
MuonTGC_Cabling::TGCCabling::getReadoutFromHighPtID
bool getReadoutFromHighPtID(TGCId::SideType side, int rodId, int &sswId, int &sbLoc, int &channel, TGCId::SignalType signal, TGCId::RegionType region, int sectorInReadout, int hpbId, int block, int hitId, int pos, TGCId::ModuleType moduleType, bool orChannel) const
Definition: TGCCabling.cxx:349
MuonTGC_CablingSvc::MuonTGC_CablingSvc
MuonTGC_CablingSvc(const std::string &name, ISvcLocator *svc)
Definition: MuonTGC_CablingSvc.cxx:23
MuonTGC_Cabling::TGCId::getStation
int getStation() const
Definition: TGCId.h:128
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:158
MuonTGC_CablingSvc::getOnlineIDfromOfflineID
bool getOnlineIDfromOfflineID(const Identifier &offlineID, int &subsystemNumber, int &octantNumber, int &moduleNumber, int &layerNumber, int &rNumber, int &wireOrStrip, int &channelNumber) const
Definition: MuonTGC_CablingSvc.cxx:482
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
MuonTGC_Cabling::TGCChannelId::isValid
virtual bool isValid() const
Definition: TGCChannelId.h:34
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MuonTGC_Cabling::TGCId::SI
@ SI
Definition: TGCId.h:47
MuonTGC_CablingSvc.h
MuonTGC_Cabling::TGCCabling::getChannel
TGCChannelId * getChannel(const TGCChannelId *channelId, TGCChannelId::ChannelIdType type, bool orChannel=false) const
Definition: TGCCabling.cxx:616
MuonTGC_CablingSvc::getReadoutIDfromOfflineID
bool getReadoutIDfromOfflineID(const Identifier &offlineID, int &subDetectorID, int &rodID, int &sswID, int &sbLoc, int &channelID, bool adChannel=false) const
Definition: MuonTGC_CablingSvc.cxx:393
TGCChannelASDOut.h
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
MuonTGC_Cabling::TGCId::getSideType
SideType getSideType(void) const
Definition: TGCId.h:122
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MuonTGC_CablingSvc::m_AsideId
IntegerProperty m_AsideId
Definition: MuonTGC_CablingSvc.h:376
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
AthMsgStreamMacros.h
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
MuonTGC_Cabling::TGCCabling::MAXSBLOC
@ MAXSBLOC
Definition: TGCCabling.h:58
MuonTGC_CablingSvc::getReadoutIDRanges
void getReadoutIDRanges(int &maxRodId, int &maxSRodId, int &maxSswId, int &maxSbloc, int &minChannelId, int &maxChannelId) const
Definition: MuonTGC_CablingSvc.cxx:49
MuonTGC_Cabling::TGCChannelASDIn
Definition: TGCChannelASDIn.h:14
index
Definition: index.py:1
MuonTGC_Cabling::TGCChannelId::getGasGap
virtual int getGasGap() const
Definition: TGCChannelId.cxx:31
MuonTGC_CablingSvc::m_databaseSLBToROD
StringProperty m_databaseSLBToROD
Definition: MuonTGC_CablingSvc.h:383
MuonTGC_Cabling::TGCId::getRegionType
RegionType getRegionType(void) const
Definition: TGCId.h:126
MuonTGC_Cabling::TGCCabling::getRxIdFromReadout
int getRxIdFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc) const
Definition: TGCCabling.cxx:159
MuonTGC_Cabling::TGCId::N_RODS
static constexpr int N_RODS
Definition: TGCId.h:43
MuonTGC_Cabling::TGCChannelId::ChannelIdType::ASDOut
@ ASDOut
MuonTGC_Cabling::TGCId::isAside
bool isAside() const
Definition: TGCId.h:134
MuonTGC_Cabling::TGCCabling::MAXSSWID
@ MAXSSWID
Definition: TGCCabling.h:56
MuonTGC_Cabling::TGCModuleSLB
Definition: TGCModuleSLB.h:14
MuonTGC_CablingSvc::m_cabling
MuonTGC_Cabling::TGCCabling * m_cabling
Definition: MuonTGC_CablingSvc.h:371
MuonTGC_CablingSvc::finalize
virtual StatusCode finalize(void) override
Definition: MuonTGC_CablingSvc.cxx:164
M_PI
#define M_PI
Definition: ActiveFraction.h:11
MuonTGC_Cabling::TGCId::SignalType
SignalType
Definition: TGCId.h:49
MuonTGC_Cabling::TGCId::ModuleType
ModuleType
Definition: TGCId.h:47
MuonTGC_Cabling::TGCCabling::MAXRODID
@ MAXRODID
Definition: TGCCabling.h:52
MuonTGC_Cabling::TGCId::getModuleType
ModuleType getModuleType(void) const
Definition: TGCId.h:123
MuonTGC_Cabling::TGCCabling::MAXCHANNELID
@ MAXCHANNELID
Definition: TGCCabling.h:61
MuonTGC_CablingSvc::initialize
virtual StatusCode initialize(void) override
Definition: MuonTGC_CablingSvc.cxx:65
MuonTGC_Cabling::TGCChannelId::ChannelIdType::ASDIn
@ ASDIn
MuonTGC_Cabling::TGCId::NUM_INNER_SECTOR
static constexpr int NUM_INNER_SECTOR
Definition: TGCId.h:42
MuonTGC_Cabling::TGCChannelASDIn::isValid
virtual bool isValid(void) const
Definition: TGCChannelASDIn.cxx:52
MuonTGC_CablingSvc::getCoveragefromRodID
bool getCoveragefromRodID(const int rodID, double &startPhi, double &endPhi) const
Definition: MuonTGC_CablingSvc.cxx:173
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonTGC_Cabling::TGCId::isStrip
bool isStrip() const
Definition: TGCId.h:136
MuonTGC_CablingSvc::getElementIDfromReadoutID
bool getElementIDfromReadoutID(Identifier &elementID, const int subDetectorID, const int rodID, const int sswID, const int sbLoc, const int channelID, bool orChannel=false) const
Definition: MuonTGC_CablingSvc.cxx:1020
MuonTGC_CablingSvc::getOfflineIDfromHighPtID
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
Definition: MuonTGC_CablingSvc.cxx:1732
MuonTGC_Cabling::TGCModuleMap
Definition: TGCModuleMap.h:16
MuonTGC_CablingSvc::getModule
MuonTGC_Cabling::TGCModuleMap * getModule(const MuonTGC_Cabling::TGCModuleId *moduleId, MuonTGC_Cabling::TGCModuleId::ModuleIdType type) const
Definition: MuonTGC_CablingSvc.cxx:1496
MuonTGC_Cabling::TGCId::isForward
bool isForward() const
Definition: TGCId.h:141
MuonTGC_CablingSvc::getCoveragefromSRodID
bool getCoveragefromSRodID(const int srodID, double &startPhi, double &endPhi) const
Definition: MuonTGC_CablingSvc.cxx:210
MuonTGC_Cabling::TGCCabling::getSLBFromReadout
const TGCModuleId * getSLBFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc) const
Definition: TGCCabling.cxx:83
MuonTGC_Cabling::TGCId::SD
@ SD
Definition: TGCId.h:47
TRT::Hit::side
@ side
Definition: HitInfo.h:83
MuonTGC_Cabling::TGCId::NUM_FORWARD_SECTOR
static constexpr int NUM_FORWARD_SECTOR
Definition: TGCId.h:41
MuonTGC_CablingSvc::getRDOHighPtIDfromSimHighPtID
bool getRDOHighPtIDfromSimHighPtID(const bool isForward, const bool isStrip, int &index, int &chip, int &hitId) const
Definition: MuonTGC_CablingSvc.cxx:1673
MuonTGC_CablingSvc::getSLIDfromReadoutID
bool getSLIDfromReadoutID(int &phi, bool &isAside, bool &isEndcap, const int subsectorID, const int rodID, const int sswID, const int sbLoc) const
Definition: MuonTGC_CablingSvc.cxx:1285
python.PyAthena.module
module
Definition: PyAthena.py:131
MuonTGC_Cabling::TGCChannelASDOut::isValid
virtual bool isValid(void) const
Definition: TGCChannelASDOut.cxx:47
MuonTGC_Cabling::TGCId::NUM_OCTANT
static constexpr int NUM_OCTANT
Definition: TGCId.h:39
ENDCAP
@ ENDCAP
Definition: TRTRadiatorParameters.h:10
MuonTGC_CablingSvc::m_rodId
IntegerArrayProperty m_rodId
Definition: MuonTGC_CablingSvc.h:378
MuonTGC_CablingSvc::getReadoutIDfromOnlineID
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
Definition: MuonTGC_CablingSvc.cxx:900
MuonTGC_Cabling::TGCCabling::getASDOutFromReadout
TGCChannelId * getASDOutFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, bool orChannel=false) const
Definition: TGCCabling.cxx:555
MuonTGC_CablingSvc::getHighPtIDfromROINumber
bool getHighPtIDfromROINumber(int roi, bool isForward, bool isStrip, int &hpb, int &chip, int &hitID, int &sub) const
Definition: MuonTGC_CablingSvc.cxx:1505
MuonTGC_CablingSvc::getHighPtIDfromOfflineID
bool getHighPtIDfromOfflineID(const Identifier &offlineID, int &subDetectorID, int &rodID, int &sectorInReadout, bool &isStrip, bool &isForward, int &hpb, int &chip, int &hitID, int &pos) const
Definition: MuonTGC_CablingSvc.cxx:1795
MuonTGC_CablingSvc::getOfflineIDfromLowPtCoincidenceID
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
Definition: MuonTGC_CablingSvc.cxx:1849
MuonTGC_CablingSvc::getReadoutIDfromHPTID
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
Definition: MuonTGC_CablingSvc.cxx:1463
MuonTGC_CablingSvc::getLowPtCoincidenceIDfromOfflineID
bool getLowPtCoincidenceIDfromOfflineID(const Identifier &offlineID, int &subDetectorID, int &rodID, int &sswID, int &sbLoc, int &block, int &pos, bool middle=false) const
Definition: MuonTGC_CablingSvc.cxx:1885
MuonTGC_Cabling::TGCId::getOctant
int getOctant() const
Definition: TGCId.h:129
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
MuonTGC_CablingSvc::getSLBIDfromRxID
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
Definition: MuonTGC_CablingSvc.cxx:1178
FORWARD
#define FORWARD
Definition: ALFA_SvdCalc.h:34
AthService
Definition: AthService.h:32
MuonTGC_Cabling::TGCCabling::MINCHANNELID
@ MINCHANNELID
Definition: TGCCabling.h:60
MuonTGC_Cabling::TGCId::getId
int getId() const
Definition: TGCId.h:132
MuonTGC_Cabling::TGCId::Strip
@ Strip
Definition: TGCId.h:49
MuonTGC_CablingSvc::m_databaseInPP
StringProperty m_databaseInPP
Definition: MuonTGC_CablingSvc.h:381
MuonTGC_CablingSvc::getReadoutIDfromElementID
bool getReadoutIDfromElementID(const Identifier &elementID, int &subdetectorID, int &rodID) const
Definition: MuonTGC_CablingSvc.cxx:980
MuonTGC_CablingSvc::getOfflineIDfromOnlineID
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
Definition: MuonTGC_CablingSvc.cxx:672
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
MuonTGC_Cabling::TGCId::WD
@ WD
Definition: TGCId.h:47
MuonTGC_Cabling::TGCCabling::getModule
TGCModuleMap * getModule(const TGCModuleId *moduleId, TGCModuleId::ModuleIdType type) const
Definition: TGCCabling.cxx:773
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
MuonTGC_Cabling::TGCId::Endcap
@ Endcap
Definition: TGCId.h:53
MuonTGC_Cabling::TGCId::WI
@ WI
Definition: TGCId.h:47
MuonTGC_CablingSvc::m_condDataTool
ToolHandle< ITGCCablingDbTool > m_condDataTool
Definition: MuonTGC_CablingSvc.h:373
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
dumpTgcDigiThreshold.isStrip
list isStrip
Definition: dumpTgcDigiThreshold.py:33
MuonTGC_Cabling::TGCModuleId::ModuleIdType
ModuleIdType
Definition: TGCModuleId.h:15
PathResolver.h
CaloCellTimeCorrFiller.folderName
string folderName
Definition: CaloCellTimeCorrFiller.py:20
MuonTGC_Cabling::TGCChannelId::ChannelIdType
ChannelIdType
Definition: TGCChannelId.h:17
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonTGC_Cabling::TGCModuleId::NumberOfSReadoutSector
@ NumberOfSReadoutSector
Definition: TGCModuleId.h:27
MuonTGC_CablingSvc::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonTGC_CablingSvc.h:372
MuonTGC_Cabling::TGCId::NoRegionType
@ NoRegionType
Definition: TGCId.h:53
MuonTGC_Cabling::TGCModuleSLB::getSlbAddr
int getSlbAddr(void) const
Definition: TGCModuleSLB.h:31
MuonTGC_Cabling::TGCId::NoModuleType
@ NoModuleType
Definition: TGCId.h:47
MuonTGC_Cabling::TGCCabling::getReadoutFromLowPtCoincidence
bool getReadoutFromLowPtCoincidence(TGCId::SideType side, int rodId, int sswId, int sbLoc, int &channel, int block, int pos, bool middle=false) const
Definition: TGCCabling.cxx:482
MuonTGC_CablingSvc::getChannel
MuonTGC_Cabling::TGCChannelId * getChannel(const MuonTGC_Cabling::TGCChannelId *channelId, MuonTGC_Cabling::TGCChannelId::ChannelIdType type, bool orChannel=false) const
Definition: MuonTGC_CablingSvc.cxx:1485
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:47
MuonTGC_CablingSvc::hasAdjacentChannel
bool hasAdjacentChannel(const Identifier &offlineID) const
Definition: MuonTGC_CablingSvc.cxx:267
MuonTGC_CablingSvc::getSLBAddressfromReadoutID
bool getSLBAddressfromReadoutID(int &slbAddr, const int subsectorID, const int rodID, const int sswID, const int sbLoc) const
Definition: MuonTGC_CablingSvc.cxx:1116
MuonTGC_Cabling::TGCCabling::getLowPtCoincidenceFromReadout
bool getLowPtCoincidenceFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, int &block, int &pos, bool middle=false) const
Definition: TGCCabling.cxx:520
MuonTGC_Cabling::TGCId::getSector
virtual int getSector() const
Definition: TGCId.h:130
MuonTGC_Cabling::TGCId::Cside
@ Cside
Definition: TGCId.h:45
MuonTGC_Cabling::TGCId::NoSideType
@ NoSideType
Definition: TGCId.h:45
MuonTGC_CablingSvc::getROINumberfromHighPtID
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
Definition: MuonTGC_CablingSvc.cxx:1635
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonTGC_Cabling::TGCChannelId
Definition: TGCChannelId.h:15
MuonTGC_Cabling::TGCId::NUM_ENDCAP_SECTOR
static constexpr int NUM_ENDCAP_SECTOR
Definition: TGCId.h:40
MuonTGC_Cabling::TGCCabling::getHighPtIDFromReadout
bool getHighPtIDFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, TGCId::SignalType &signal, TGCId::RegionType &region, int &sectorInReadout, int &hpbId, int &block, int &hitId, int &pos) const
Definition: TGCCabling.cxx:428
MuonTGC_CablingSvc::getSReadoutIDfromSLID
bool getSReadoutIDfromSLID(const int phi, const bool isAside, const bool isEndcap, int &subsectorID, int &srodID, int &sswID, int &sbLoc) const
Definition: MuonTGC_CablingSvc.cxx:1419
MuonTGC_CablingSvc::m_databasePPToSL
StringProperty m_databasePPToSL
Definition: MuonTGC_CablingSvc.h:382
MuonTGC_CablingSvc::getOnlineIDfromReadoutID
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
Definition: MuonTGC_CablingSvc.cxx:819
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
MuonTGC_Cabling::TGCModuleSLB::isValid
virtual bool isValid(void) const
Definition: TGCModuleSLB.cxx:29
MuonTGC_Cabling::TGCId::Wire
@ Wire
Definition: TGCId.h:49
MuonTGC_CablingSvc::getSimHighPtIDfromRDOHighPtID
bool getSimHighPtIDfromRDOHighPtID(const bool isForward, const bool isStrip, int &index, int &chip, int &hitId) const
Definition: MuonTGC_CablingSvc.cxx:1701
MuonTGC_Cabling::TGCChannelId::getLayer
int getLayer() const
Definition: TGCChannelId.cxx:27
MuonTGC_CablingSvc::getReadoutIDfromSLID
bool getReadoutIDfromSLID(const int phi, const bool isAside, const bool isEndcap, int &subsectorID, int &rodID, int &sswID, int &sbLoc) const
Definition: MuonTGC_CablingSvc.cxx:1375
merge.status
status
Definition: merge.py:17
MuonTGC_CablingSvc::getOfflineIDfromReadoutID
bool getOfflineIDfromReadoutID(Identifier &offlineID, const int subDetectorID, const int rodID, const int sswID, const int sbLoc, const int channelID, bool orChannel=false) const
Definition: MuonTGC_CablingSvc.cxx:323
MuonTGC_Cabling::TGCChannelASDOut
Definition: TGCChannelASDOut.h:12
MuonTGC_Cabling::TGCId::RegionType
RegionType
Definition: TGCId.h:53
MuonTGC_Cabling::TGCModuleId
Definition: TGCModuleId.h:13
MuonTGC_CablingSvc::getRxIDfromReadoutID
bool getRxIDfromReadoutID(int &rxId, const int subsectorID, const int rodID, const int sswID, const int sbLoc) const
Definition: MuonTGC_CablingSvc.cxx:1152
MuonTGC_Cabling::TGCId::NoSignalType
@ NoSignalType
Definition: TGCId.h:49
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:156
MuonTGC_CablingSvc
Definition: MuonTGC_CablingSvc.h:31
MuonTGC_Cabling::TGCId::SideType
SideType
Definition: TGCId.h:45
TGCModuleSLB.h
MuonTGC_Cabling::TGCId::Aside
@ Aside
Definition: TGCId.h:45
MuonTGC_CablingSvc::m_CsideId
IntegerProperty m_CsideId
Definition: MuonTGC_CablingSvc.h:377
MuonTGC_CablingSvc::getReadoutIDfromSLBID
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
Definition: MuonTGC_CablingSvc.cxx:1224
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
MuonTGC_CablingSvc::getSLBIDfromReadoutID
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
Definition: MuonTGC_CablingSvc.cxx:1069
MuonTGC_Cabling::TGCId::Forward
@ Forward
Definition: TGCId.h:53
MuonTGC_Cabling::TGCCabling::updateCableASDToPP
StatusCode updateCableASDToPP()
Definition: TGCCabling.cxx:62
MuonTGC_CablingSvc::isOredChannel
bool isOredChannel(const int subDetectorID, const int rodID, const int sswID, const int sbLoc, const int channelID) const
Definition: MuonTGC_CablingSvc.cxx:248
MuonTGC_Cabling::TGCChannelId::getChannel
int getChannel() const
Definition: TGCChannelId.cxx:29
MuonTGC_CablingSvc::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvIF) override
Definition: MuonTGC_CablingSvc.cxx:36
TGCChannelASDIn.h
MuonTGC_Cabling::TGCCabling
Definition: TGCCabling.h:35
MuonTGC_Cabling::TGCId::getSectorModule
virtual int getSectorModule() const
Definition: TGCId.cxx:139
MuonTGC_CablingSvc::m_databaseASDToPP
StringProperty m_databaseASDToPP
Definition: MuonTGC_CablingSvc.h:380
MuonTGC_Cabling::TGCCabling::MAXSRODID
@ MAXSRODID
Definition: TGCCabling.h:54
MuonTGC_Cabling::TGCCabling::getReadoutFromASDOut
bool getReadoutFromASDOut(const TGCChannelASDOut *asdout, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc, int &channel, bool orChannel=false) const
Definition: TGCCabling.cxx:580
MuonTGC_Cabling::TGCCabling::getSLBFromRxId
TGCModuleId * getSLBFromRxId(TGCId::SideType side, int rodId, int sswId, int rxId) const
Definition: TGCCabling.cxx:209
MuonTGC_Cabling::TGCCabling::getReadoutFromSLB
bool getReadoutFromSLB(const TGCModuleSLB *slb, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc) const
Definition: TGCCabling.cxx:259
Identifier
Definition: IdentifierFieldParser.cxx:14