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