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