ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
MuonTGC_Cabling::TGCCabling Class Reference

#include <TGCCabling.h>

Collaboration diagram for MuonTGC_Cabling::TGCCabling:

Public Types

enum  MAXMINREADOUTIDS {
  MAXRODID = 12, MINRODID = 1, MAXSRODID = 3, MINSRODID = 1,
  MAXSSWID = 9, MINSSWID = 0, MAXSBLOC = 31, MINSBLOC = 0,
  MINCHANNELID = 40, MAXCHANNELID = 199
}
 

Public Member Functions

 TGCCabling (const std::string &filenameASDToPP, const std::string &filenameInPP, const std::string &filenamePPToSL, const std::string &filenameSLBToROD)
 
virtual ~TGCCabling (void)
 
virtual TGCChannelIdgetASDOutChannel (const TGCChannelId *slb_in) const
 
const TGCModuleIdgetSLBFromReadout (TGCId::SideType side, int rodId, int sswId, int sbLoc) const
 
int getRxIdFromReadout (TGCId::SideType side, int rodId, int sswId, int sbLoc) const
 
TGCModuleIdgetSLBFromRxId (TGCId::SideType side, int rodId, int sswId, int rxId) const
 
bool getReadoutFromSLB (const TGCModuleSLB *slb, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc) const
 
TGCChannelIdgetASDOutFromReadout (TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, bool orChannel=false) const
 
bool getReadoutFromASDOut (const TGCChannelASDOut *asdout, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc, int &channel, bool orChannel=false) const
 
bool getHighPtIDFromReadout (TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, TGCId::SignalType &signal, TGCId::RegionType &region, int &sectorInReadout, int &hpbId, int &block, int &hitId, int &pos) const
 
bool getReadoutFromHighPtID (TGCId::SideType side, int rodId, int &sswId, int &sbLoc, int &channel, TGCId::SignalType signal, TGCId::RegionType region, int sectorInReadout, int hpbId, int block, int hitId, int pos, TGCId::ModuleType moduleType, bool orChannel) const
 
bool getLowPtCoincidenceFromReadout (TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, int &block, int &pos, bool middle=false) const
 
bool getReadoutFromLowPtCoincidence (TGCId::SideType side, int rodId, int sswId, int sbLoc, int &channel, int block, int pos, bool middle=false) const
 
TGCChannelIdgetChannel (const TGCChannelId *channelId, TGCChannelId::ChannelIdType type, bool orChannel=false) const
 
TGCModuleMapgetModule (const TGCModuleId *moduleId, TGCModuleId::ModuleIdType type) const
 
StatusCode updateCableASDToPP ()
 

Private Member Functions

 TGCCabling ()=delete
 
 TGCCabling (const TGCCabling &)=delete
 
TGCCablingoperator= (const TGCCabling &)=delete
 
int getIndexFromReadoutWithoutChannel (const TGCId::SideType side, const int rodId, const int sswId, const int sbLoc) const
 

Private Attributes

TGCCableInASDm_cableInASD
 
TGCCableASDToPPm_cableASDToPP
 
TGCCableInPPm_cableInPP
 
TGCCablePPToSLBm_cablePPToSLB
 
TGCCableInSLBm_cableInSLB
 
TGCCableSLBToHPBm_cableSLBToHPB
 
TGCCableHPBToSLm_cableHPBToSL
 
TGCCableSLBToSSWm_cableSLBToSSW
 
TGCCableSSWToRODm_cableSSWToROD
 
std::map< int, TGCModuleId * > m_slbModuleIdMap ATLAS_THREAD_SAFE
 
std::mutex m_mutex
 

Detailed Description

Definition at line 34 of file TGCCabling.h.

Member Enumeration Documentation

◆ MAXMINREADOUTIDS

Enumerator
MAXRODID 
MINRODID 
MAXSRODID 
MINSRODID 
MAXSSWID 
MINSSWID 
MAXSBLOC 
MINSBLOC 
MINCHANNELID 
MAXCHANNELID 

Definition at line 51 of file TGCCabling.h.

51  {
52  MAXRODID = 12,
53  MINRODID = 1,
54  MAXSRODID = 3,
55  MINSRODID = 1,
56  MAXSSWID = 9,
57  MINSSWID = 0,
58  MAXSBLOC = 31,
59  MINSBLOC = 0,
60  MINCHANNELID = 40,
61  MAXCHANNELID = 199
62  };

Constructor & Destructor Documentation

◆ TGCCabling() [1/3]

MuonTGC_Cabling::TGCCabling::TGCCabling ( )
privatedelete

◆ TGCCabling() [2/3]

MuonTGC_Cabling::TGCCabling::TGCCabling ( const TGCCabling )
privatedelete

◆ TGCCabling() [3/3]

MuonTGC_Cabling::TGCCabling::TGCCabling ( const std::string &  filenameASDToPP,
const std::string &  filenameInPP,
const std::string &  filenamePPToSL,
const std::string &  filenameSLBToROD 
)

Definition at line 28 of file TGCCabling.cxx.

32 {
33  m_cableInASD = new TGCCableInASD(filenameASDToPP);
34  m_cableASDToPP = new TGCCableASDToPP(filenameASDToPP);
35  m_cableInPP = new TGCCableInPP(filenameInPP);
36  m_cablePPToSLB = new TGCCablePPToSLB(filenamePPToSL);
37  m_cableInSLB = new TGCCableInSLB();
38  m_cableSLBToHPB = new TGCCableSLBToHPB(filenamePPToSL);
39  m_cableHPBToSL = new TGCCableHPBToSL(filenamePPToSL);
40  m_cableSLBToSSW = new TGCCableSLBToSSW(filenameSLBToROD);
41  m_cableSSWToROD = new TGCCableSSWToROD(filenameSLBToROD);
42 }

◆ ~TGCCabling()

MuonTGC_Cabling::TGCCabling::~TGCCabling ( void  )
virtual

Definition at line 44 of file TGCCabling.cxx.

45 {
46  delete m_cableInASD;
47  delete m_cableASDToPP;
48  delete m_cableInPP;
49  delete m_cablePPToSLB;
50  delete m_cableInSLB;
51  delete m_cableSLBToHPB;
52  delete m_cableHPBToSL;
53  delete m_cableSLBToSSW;
54  delete m_cableSSWToROD;
55 
56  for (auto& p : m_slbModuleIdMap) {
57  delete p.second;
58  }
59 }

Member Function Documentation

◆ getASDOutChannel()

TGCChannelId * MuonTGC_Cabling::TGCCabling::getASDOutChannel ( const TGCChannelId slb_in) const
virtual

Definition at line 68 of file TGCCabling.cxx.

69 {
70  TGCChannelSLBIn slb_in(in->getSideType(),
71  in->getModuleType(),
72  in->getRegionType(),
73  in->getSector(),
74  in->getId(),
75  in->getChannel());
76  return getChannel(&slb_in,
78 }

◆ getASDOutFromReadout()

TGCChannelId * MuonTGC_Cabling::TGCCabling::getASDOutFromReadout ( TGCId::SideType  side,
int  rodId,
int  sswId,
int  sbLoc,
int  channel,
bool  orChannel = false 
) const

Definition at line 555 of file TGCCabling.cxx.

560  {
561  const TGCModuleId* slb = getSLBFromReadout(side,
562  rodId,
563  sswId,
564  sbLoc);
565  if(!slb) return nullptr;
566 
567  TGCChannelSLBIn slbin(slb->getSideType(),
568  slb->getModuleType(),
569  slb->getRegionType(),
570  slb->getSector(),
571  slb->getId(),
572  channel);
573  if(!slbin.isValid()) return nullptr;
574 
575  return getChannel(&slbin,TGCChannelId::ChannelIdType::ASDOut,orChannel);
576 }

◆ getChannel()

TGCChannelId * MuonTGC_Cabling::TGCCabling::getChannel ( const TGCChannelId channelId,
TGCChannelId::ChannelIdType  type,
bool  orChannel = false 
) const

Definition at line 616 of file TGCCabling.cxx.

618  {
619  switch(channelId->getChannelIdType()){
622  return m_cableInASD->getChannel(channelId,orChannel);
624  TGCChannelId* asdout = m_cableInASD->getChannel(channelId,false);
625  if(!asdout) return nullptr;
626  if(!asdout->isValid()){
627  delete asdout;
628  return nullptr;
629  }
630  TGCChannelId* ppin = m_cableASDToPP->getChannel(asdout,false);
631  delete asdout;
632  if(!ppin) return nullptr;
633  if(!ppin->isValid()){
634  delete ppin;
635  return nullptr;
636  }
637  TGCChannelId* ppout = m_cableInPP->getChannel(ppin,orChannel);
638  delete ppin;
639  if(!ppout) return nullptr;
640  if(!ppout->isValid()){
641  delete ppout;
642  return nullptr;
643  }
644  TGCChannelId* slbin = m_cablePPToSLB->getChannel(ppout,false);
645  delete ppout;
646  return slbin;
647  }
648  break;
651  return m_cableInASD->getChannel(channelId,orChannel);
653  return m_cableASDToPP->getChannel(channelId,orChannel);
655  TGCChannelId* ppin = m_cableASDToPP->getChannel(channelId,false);
656  if(!ppin) return nullptr;
657  if(!ppin->isValid()){
658  delete ppin;
659  return nullptr;
660  }
661  TGCChannelId* ppout = m_cableInPP->getChannel(ppin,orChannel);
662  delete ppin;
663  if(!ppout) return nullptr;
664  if(!ppout->isValid()){
665  delete ppout;
666  return nullptr;
667  }
668  TGCChannelId* slbin = m_cablePPToSLB->getChannel(ppout,false);
669  delete ppout;
670  return slbin;
671  }
672  break;
675  return m_cableASDToPP->getChannel(channelId,orChannel);
677  return m_cableInPP->getChannel(channelId,orChannel);
678  break;
681  return m_cableInPP->getChannel(channelId,orChannel);
683  return m_cablePPToSLB->getChannel(channelId,orChannel);
684  break;
687  return m_cableInSLB->getChannel(channelId,orChannel);
689  TGCChannelId* slbout = m_cableInSLB->getChannel(channelId,orChannel);
690  if(!slbout) return nullptr;
691  if(!slbout->isValid()) {
692  delete slbout;
693  return nullptr;
694  }
695  TGCChannelId* hpbin = m_cableSLBToHPB->getChannel(slbout,false);
696  delete slbout;
697  return hpbin;
698  }
700  return m_cablePPToSLB->getChannel(channelId,orChannel);
702  TGCChannelId* ppout = m_cablePPToSLB->getChannel(channelId,false);
703  if(!ppout) return nullptr;
704  if(!ppout->isValid()){
705  delete ppout;
706  return nullptr;
707  }
708  TGCChannelId* ppin = m_cableInPP->getChannel(ppout,orChannel);
709  delete ppout;
710  if(!ppin) return nullptr;
711  if(!ppin->isValid()){
712  delete ppin;
713  return nullptr;
714  }
715  TGCChannelId* asdout = m_cableASDToPP->getChannel(ppin,false);
716  delete ppin;
717  return asdout;
718  }
720  TGCChannelId* ppout = m_cablePPToSLB->getChannel(channelId,false);
721  if(!ppout) return nullptr;
722  if(!ppout->isValid()){
723  delete ppout;
724  return nullptr;
725  }
726  TGCChannelId* ppin = m_cableInPP->getChannel(ppout,orChannel);
727  delete ppout;
728  if(!ppin) return nullptr;
729  if(!ppin->isValid()){
730  delete ppin;
731  return nullptr;
732  }
733  TGCChannelId* asdout = m_cableASDToPP->getChannel(ppin,false);
734  delete ppin;
735  if(!asdout) return nullptr;
736  if(!asdout->isValid()){
737  delete asdout;
738  return nullptr;
739  }
740  TGCChannelId* asdin = m_cableInASD->getChannel(asdout,false);
741  delete asdout;
742  return asdin;
743  }
744  break;
747  return m_cableInSLB->getChannel(channelId,orChannel);
749  return m_cableSLBToHPB->getChannel(channelId,orChannel);
750  }
751  break;
754  TGCChannelId* slbout = m_cableSLBToHPB->getChannel(channelId,false);
755  if(!slbout) return nullptr;
756  if(!slbout->isValid()){
757  delete slbout;
758  return nullptr;
759  }
760  TGCChannelId* slbin = m_cableInSLB->getChannel(slbout,orChannel);
761  delete slbout;
762  return slbin;
763  }
765  return m_cableSLBToHPB->getChannel(channelId,orChannel);
766  break;
767  default:
768  break;
769  }
770  return nullptr;
771 }

◆ getHighPtIDFromReadout()

bool MuonTGC_Cabling::TGCCabling::getHighPtIDFromReadout ( TGCId::SideType  side,
int  rodId,
int  sswId,
int  sbLoc,
int  channel,
TGCId::SignalType signal,
TGCId::RegionType region,
int &  sectorInReadout,
int &  hpbId,
int &  block,
int &  hitId,
int &  pos 
) const

Definition at line 428 of file TGCCabling.cxx.

440 {
442  region = TGCId::NoRegionType;
443  sectorInReadout = -1;
444  hpbId = -1;
445  block = -1;
446  hitId = -1;
447  pos = -1;
448 
449  const TGCModuleId* slb = getSLBFromReadout(side,
450  rodId,
451  sswId,
452  sbLoc);
453  if(!slb) return 0;
454 
455  TGCChannelSLBIn slbin(slb->getSideType(),
456  slb->getModuleType(),
457  slb->getRegionType(),
458  slb->getSector(),
459  slb->getId(),
460  channel);
461 
462  TGCChannelId* hpbin = getChannel(&slbin,TGCChannelId::ChannelIdType::HPBIn,false);
463  if(!hpbin) return 0;
464  if(!hpbin->isValid()) {
465  delete hpbin;
466  return 0;
467  }
468  signal = hpbin->getSignalType();
469  region = hpbin->getRegionType();
470  sectorInReadout = hpbin->getSectorInReadout();
471  hpbId = hpbin->getId();
472  block = hpbin->getBlock();
473  pos = hpbin->getChannel()%2;
474  hitId = (hpbin->getChannel() - pos)/2;
475 
476  delete hpbin;
477  return true;
478 }

◆ getIndexFromReadoutWithoutChannel()

int MuonTGC_Cabling::TGCCabling::getIndexFromReadoutWithoutChannel ( const TGCId::SideType  side,
const int  rodId,
const int  sswId,
const int  sbLoc 
) const
private

Definition at line 814 of file TGCCabling.cxx.

817  {
818  return ((((side-TGCId::Aside)
819  *(MAXRODID-MINRODID+1) + rodId-MINRODID)
820  *(MAXSSWID-MINSSWID+1) + sswId-MINSSWID)
821  *(MAXSBLOC-MINSBLOC+1) + sbLoc-MINSBLOC);
822 }

◆ getLowPtCoincidenceFromReadout()

bool MuonTGC_Cabling::TGCCabling::getLowPtCoincidenceFromReadout ( TGCId::SideType  side,
int  rodId,
int  sswId,
int  sbLoc,
int  channel,
int &  block,
int &  pos,
bool  middle = false 
) const

Definition at line 520 of file TGCCabling.cxx.

527  {
528 
529  const TGCModuleId* slb = getSLBFromReadout(side,
530  rodId,
531  sswId,
532  sbLoc);
533  if(!slb) return 0;
534 
535  TGCChannelSLBIn slbin(slb->getSideType(),
536  slb->getModuleType(),
537  slb->getRegionType(),
538  slb->getSector(),
539  slb->getId(),
540  channel);
541  if(!slbin.isValid()) return false;
542 
543  TGCChannelId* slbout = getChannel(&slbin,TGCChannelId::ChannelIdType::SLBOut,middle);
544  if(!slbout) return false;
545 
546  block = slbout->getBlock();
547  pos = slbout->getChannel();
548  delete slbout;
549 
550  return true;
551 }

◆ getModule()

TGCModuleMap * MuonTGC_Cabling::TGCCabling::getModule ( const TGCModuleId moduleId,
TGCModuleId::ModuleIdType  type 
) const

Definition at line 773 of file TGCCabling.cxx.

774  {
775  switch(moduleId->getModuleIdType()){
776  case TGCModuleId::PP:
778  return m_cablePPToSLB->getModule(moduleId);
779  break;
780  case TGCModuleId::SLB:
781  if(type==TGCModuleId::PP)
782  return m_cablePPToSLB->getModule(moduleId);
784  return m_cableSLBToHPB->getModule(moduleId);
786  return m_cableSLBToSSW->getModule(moduleId);
787  break;
788  case TGCModuleId::HPB:
790  return m_cableSLBToHPB->getModule(moduleId);
791  if(type==TGCModuleId::SL)
792  return m_cableHPBToSL->getModule(moduleId);
793  break;
794  case TGCModuleId::SL:
796  return m_cableHPBToSL->getModule(moduleId);
797  break;
798  case TGCModuleId::SSW:
800  return m_cableSLBToSSW->getModule(moduleId);
802  return m_cableSSWToROD->getModule(moduleId);
803  break;
804  case TGCModuleId::ROD:
806  return m_cableSSWToROD->getModule(moduleId);
807  break;
808  default:
809  break;
810  }
811  return nullptr;
812 }

◆ getReadoutFromASDOut()

bool MuonTGC_Cabling::TGCCabling::getReadoutFromASDOut ( const TGCChannelASDOut asdout,
TGCId::SideType side,
int &  rodId,
int &  sswId,
int &  sbLoc,
int &  channel,
bool  orChannel = false 
) const

Definition at line 580 of file TGCCabling.cxx.

586  {
587  // initialize
589  rodId = -1;
590  sswId = -1;
591  sbLoc = -1;
592  channel = -1;
593 
594 
595  // SLBIn channel
596  TGCChannelId* slbin = getChannel(asdout,TGCChannelId::ChannelIdType::SLBIn,orChannel);
597 
598  if(!slbin) return false;
599  channel = slbin->getChannel();
600 
601  TGCModuleSLB* slb = dynamic_cast<TGCModuleSLB*>(slbin->getModule());
602  delete slbin;
603  if(!slb) return false;
604 
605  // SLB Module -> readout ID
606  bool status = getReadoutFromSLB(slb,
607  side,
608  rodId,
609  sswId,
610  sbLoc);
611  delete slb;
612 
613  return status;
614 }

◆ getReadoutFromHighPtID()

bool MuonTGC_Cabling::TGCCabling::getReadoutFromHighPtID ( TGCId::SideType  side,
int  rodId,
int &  sswId,
int &  sbLoc,
int &  channel,
TGCId::SignalType  signal,
TGCId::RegionType  region,
int  sectorInReadout,
int  hpbId,
int  block,
int  hitId,
int  pos,
TGCId::ModuleType  moduleType,
bool  orChannel 
) const

Definition at line 349 of file TGCCabling.cxx.

363 {
364  // initialize
365  sswId = -1;
366  sbLoc = -1;
367  channel = -1;
368 
369  // get sector number
370 
371  int readoutSector = (rodId -1);
372  int sector = sectorInReadout;
373  if (rodId<13){
374  if(region==TGCId::Forward) {
375  sector += readoutSector*(TGCId::NUM_FORWARD_SECTOR/TGCId::N_RODS);
376  } else {
377  sector += readoutSector*(TGCId::NUM_ENDCAP_SECTOR/TGCId::N_RODS);
378  }
379  }else if(rodId<20){
380  readoutSector -= 16;
381  if(region==TGCId::Forward) {
383  } else {
385  }
386  }
387 
388  TGCChannelHPBIn hpbin(side,
389  signal,
390  region,
391  sector,
392  hpbId,
393  block,
394  hitId*2+pos);
395  if(!hpbin.isValid()) return false;
396 
397  TGCChannelId* slbout = m_cableSLBToHPB->getChannelInforHPB(&hpbin,moduleType,false);
398  if(!slbout) return 0;
399  if(!slbout->isValid()){
400  delete slbout;
401  return 0;
402  }
403  TGCChannelId* slbin = m_cableInSLB->getChannel(slbout,orChannel);
404  delete slbout;
405 
406  if(!slbin) return false;
407  channel = slbin->getChannel();
408 
409  TGCModuleSLB* slb = dynamic_cast<TGCModuleSLB*>(slbin->getModule());
410  delete slbin;
411  if(!slb) return false;
412 
413  // SLB Module -> readout ID
414  TGCId::SideType sideType;
415  int rodid; // dummy
416  bool status = getReadoutFromSLB(slb,
417  sideType,
418  rodid,
419  sswId,
420  sbLoc);
421 
422  delete slb;
423 
424  return status;
425 }

◆ getReadoutFromLowPtCoincidence()

bool MuonTGC_Cabling::TGCCabling::getReadoutFromLowPtCoincidence ( TGCId::SideType  side,
int  rodId,
int  sswId,
int  sbLoc,
int &  channel,
int  block,
int  pos,
bool  middle = false 
) const

Definition at line 482 of file TGCCabling.cxx.

490 {
491  bool orChannel = flag;
492 
493  const TGCModuleId* slb = getSLBFromReadout(side,
494  rodId,
495  sswId,
496  sbLoc);
497  if(!slb) return 0;
498 
499  TGCChannelSLBOut slbout(slb->getSideType(),
500  slb->getModuleType(),
501  slb->getRegionType(),
502  slb->getSector(),
503  slb->getId(),
504  block,
505  pos);
506 
507  TGCChannelId* slbin = getChannel(&slbout,TGCChannelId::ChannelIdType::SLBIn, orChannel);
508 
509  if(!slbin) return false;
510 
511  channel = slbin->getChannel();
512 
513  delete slbin;
514 
515  return true;
516 }

◆ getReadoutFromSLB()

bool MuonTGC_Cabling::TGCCabling::getReadoutFromSLB ( const TGCModuleSLB slb,
TGCId::SideType side,
int &  rodId,
int &  sswId,
int &  sbLoc 
) const

Definition at line 259 of file TGCCabling.cxx.

264 {
265  // initialize
267  rodId = -1;
268  sswId = -1;
269  sbLoc = -1;
270 
271  if(!slb) return false;
272 
273  // Fill side
274  side = slb->getSideType();
275 
276  TGCModuleMap* sswMap = getModule(slb,TGCModuleId::SSW);
277 
278  if(!sswMap) return false;
279 
280  // SSW Module
281  TGCModuleId* ssw = sswMap->popModuleId(0);
282  delete sswMap;
283  if(!ssw) return false;
284 
285 
286  // Fill SSW ID
287  sswId = ssw->getId();
288 
289 
290  // Fill SBLoc
291  sbLoc = slb->getSBLoc();
292 
293 
294  if(sbLoc < 0) {
295  TGCModuleMap* slbMap = getModule(ssw,TGCModuleId::SLB);
296  if(!slbMap){
297  delete ssw; ssw = nullptr;
298  return false;
299  }
300 
301  TGCModuleSLB* pSlb=nullptr;
302  //bool found = false;
303  const int size = slbMap->size();
304  for(int i=0; i<size; i++){
305  pSlb = dynamic_cast<TGCModuleSLB*>(slbMap->moduleId(i));
306 
307  if(pSlb &&
308  slb->getRegionType() == pSlb->getRegionType() &&
309  slb->getSector() == pSlb->getSector() &&
310  slb->getId() == pSlb->getId()){
311  if(slb->getModuleType() == pSlb->getModuleType()) {
312  sbLoc = pSlb->getSBLoc();
313  //found = true;
314  break;
315  }
316  // SI is connected to the SLB corrsponding WI
317  if((slb->getModuleType()==TGCId::SI) && (pSlb->getModuleType()==TGCId::WI)) {
318  sbLoc = pSlb->getSBLoc();
319  //found = true;
320  break;
321  }
322  }
323  }
324  delete slbMap;
325  if(sbLoc < 0) {
326  delete ssw;
327  return false;
328  }
329  }
330 
331 
332  TGCModuleMap* rodMap = getModule(ssw,TGCModuleId::ROD);
333  delete ssw;
334  if(!rodMap) return false;
335 
336  // ROD Module
337  TGCModuleId* rod = rodMap->popModuleId(0);
338  delete rodMap;
339  if(!rod) return false;
340 
341  // Fill ROD ID
342  rodId = rod->getId();
343  delete rod;
344 
345  return true;
346 }

◆ getRxIdFromReadout()

int MuonTGC_Cabling::TGCCabling::getRxIdFromReadout ( TGCId::SideType  side,
int  rodId,
int  sswId,
int  sbLoc 
) const

Definition at line 159 of file TGCCabling.cxx.

163 {
164  int rxId = -1;
165 
166  // ROD Module
167  int readoutSector = rodId -1 ; //rodID = 1..12
168  TGCModuleROD rod(side,readoutSector);
169 
170  // SSW Module
171  TGCModuleMap* sswMap = getModule(&rod,TGCModuleId::SSW);
172  if(!sswMap) return rxId;
173 
174  TGCModuleId* ssw = nullptr;
175  bool found = false;
176  const int sswMapsize = sswMap->size();
177  for(int i=0; i<sswMapsize; i++){
178  if((sswMap->moduleId(i))->getId()==sswId){
179  ssw = sswMap->popModuleId(i);
180  found = true;
181  break;
182  }
183  }
184  delete sswMap;
185  if(!found || !ssw) return rxId; // Do not need to delete ssw here.
186  // We can delete ssw but nothing will be done.
187 
188  // SLB Module
189  TGCModuleMap* slbMap = getModule(ssw,TGCModuleId::SLB);
190  delete ssw;
191  if(!slbMap) return rxId;
192 
193  TGCModuleSLB* slb=nullptr;
194  found = false;
195  const int slbMapsize = slbMap->size();
196  for(int i=0; i<slbMapsize; i++){
197  slb = dynamic_cast<TGCModuleSLB*>(slbMap->moduleId(i));
198  if(slb && slb->getSBLoc()== sbLoc){
199  rxId = slbMap->connector(i);
200  break;
201  }
202  }
203  delete slbMap;
204 
205  return rxId;
206 }

◆ getSLBFromReadout()

const TGCModuleId * MuonTGC_Cabling::TGCCabling::getSLBFromReadout ( TGCId::SideType  side,
int  rodId,
int  sswId,
int  sbLoc 
) const

Definition at line 83 of file TGCCabling.cxx.

87 {
88  std::scoped_lock lock (m_mutex);
89 
90  int indexFromReadoutWithoutChannel
91  = getIndexFromReadoutWithoutChannel(side, rodId, sswId, sbLoc);
93  = m_slbModuleIdMap.find(indexFromReadoutWithoutChannel);
94  if(it!=m_slbModuleIdMap.end()) {
95  // Already seen this ReadoutID without channel.
96  // Stored pointer is returned.
97  return (*it).second;
98  }
99 
100  // ROD Module
101  int readoutSector = rodId -1 ; //rodID = 1..12
102  TGCModuleROD rod(side,readoutSector);
103 
104  // SSW Module
105  TGCModuleMap* sswMap = getModule(&rod,TGCModuleId::SSW);
106  if(!sswMap) {
107  m_slbModuleIdMap.insert(std::pair<int, TGCModuleId*>(indexFromReadoutWithoutChannel, 0));
108  return nullptr;
109  }
110 
111  TGCModuleId* ssw = nullptr;
112  bool found = false;
113  const int sswMapsize = sswMap->size();
114  for(int i=0; i<sswMapsize; i++){
115  if((sswMap->moduleId(i))->getId()==sswId){
116  ssw = sswMap->popModuleId(i);
117  found = true;
118  break;
119  }
120  }
121  delete sswMap;
122  if(!found || !ssw) {
123  m_slbModuleIdMap.insert(std::pair<int, TGCModuleId*>(indexFromReadoutWithoutChannel, 0));
124  return nullptr; // Do not need to delete ssw here.
125  // We can delete ssw but nothing will be done.
126  }
127 
128  // SLB Module
129  TGCModuleMap* slbMap = getModule(ssw,TGCModuleId::SLB);
130  delete ssw;
131  if(!slbMap) {
132  m_slbModuleIdMap.insert(std::pair<int, TGCModuleId*>(indexFromReadoutWithoutChannel, 0));
133  return nullptr;
134  }
135 
136  TGCModuleSLB* slb=nullptr;
137  found = false;
138  const int slbMapsize = slbMap->size();
139  for(int i=0; i<slbMapsize; i++){
140  slb = dynamic_cast<TGCModuleSLB*>(slbMap->moduleId(i));
141  if(slb && slb->getSBLoc()== sbLoc){
142  found = true;
143  slb = dynamic_cast<TGCModuleSLB*>(slbMap->popModuleId(i));
144  break;
145  }
146  }
147  delete slbMap;
148 
149  if(!found || !slb) {
150  m_slbModuleIdMap.insert(std::pair<int, TGCModuleId*>(indexFromReadoutWithoutChannel, 0));
151  return nullptr; // Do not delete slb here.
152  }
153 
154  m_slbModuleIdMap.insert(std::pair<int, TGCModuleId*>(indexFromReadoutWithoutChannel, slb));
155  return slb;
156 }

◆ getSLBFromRxId()

TGCModuleId * MuonTGC_Cabling::TGCCabling::getSLBFromRxId ( TGCId::SideType  side,
int  rodId,
int  sswId,
int  rxId 
) const

Definition at line 209 of file TGCCabling.cxx.

213 {
214  bool found;
215 
216  // ROD Module
217  int readoutSector = rodId -1 ; //rodID = 1..12
218  TGCModuleROD rod(side,readoutSector);
219 
220  // SSW Module
221  TGCModuleMap* sswMap = getModule(&rod,TGCModuleId::SSW);
222  if(!sswMap) return nullptr;
223 
224  TGCModuleId* ssw = nullptr;
225  found = false;
226  const int size = sswMap->size();
227  for(int i=0; i<size; i++){
228  if((sswMap->moduleId(i))->getId()==sswId){
229  ssw = sswMap->popModuleId(i);
230  found = true;
231  break;
232  }
233  }
234  delete sswMap;
235  if(!found || !ssw) return nullptr; // Do not need to delete ssw here.
236  // We can delete ssw but nothing will be done.
237 
238  // SLB Module
239  TGCModuleMap* slbMap = getModule(ssw,TGCModuleId::SLB);
240  delete ssw;
241  if(!slbMap) return nullptr;
242 
243  TGCModuleSLB* slb=nullptr;
244  int ip = slbMap->find(rxId);
245  if(ip <0 || ip >= slbMap->size()){
246  delete slbMap; slbMap = nullptr;
247  return nullptr;
248  }
249  slb = dynamic_cast<TGCModuleSLB*>(slbMap->popModuleId(ip));
250  delete slbMap;
251 
252  if(!slb) return nullptr;
253 
254  return slb;
255 }

◆ operator=()

TGCCabling& MuonTGC_Cabling::TGCCabling::operator= ( const TGCCabling )
privatedelete

◆ updateCableASDToPP()

StatusCode MuonTGC_Cabling::TGCCabling::updateCableASDToPP ( )

Definition at line 62 of file TGCCabling.cxx.

63 {
64  return m_cableASDToPP->updateDatabase();
65 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::map<int, TGCModuleId*> m_slbModuleIdMap MuonTGC_Cabling::TGCCabling::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 191 of file TGCCabling.h.

◆ m_cableASDToPP

TGCCableASDToPP* MuonTGC_Cabling::TGCCabling::m_cableASDToPP
private

Definition at line 181 of file TGCCabling.h.

◆ m_cableHPBToSL

TGCCableHPBToSL* MuonTGC_Cabling::TGCCabling::m_cableHPBToSL
private

Definition at line 186 of file TGCCabling.h.

◆ m_cableInASD

TGCCableInASD* MuonTGC_Cabling::TGCCabling::m_cableInASD
private

Definition at line 180 of file TGCCabling.h.

◆ m_cableInPP

TGCCableInPP* MuonTGC_Cabling::TGCCabling::m_cableInPP
private

Definition at line 182 of file TGCCabling.h.

◆ m_cableInSLB

TGCCableInSLB* MuonTGC_Cabling::TGCCabling::m_cableInSLB
private

Definition at line 184 of file TGCCabling.h.

◆ m_cablePPToSLB

TGCCablePPToSLB* MuonTGC_Cabling::TGCCabling::m_cablePPToSLB
private

Definition at line 183 of file TGCCabling.h.

◆ m_cableSLBToHPB

TGCCableSLBToHPB* MuonTGC_Cabling::TGCCabling::m_cableSLBToHPB
private

Definition at line 185 of file TGCCabling.h.

◆ m_cableSLBToSSW

TGCCableSLBToSSW* MuonTGC_Cabling::TGCCabling::m_cableSLBToSSW
private

Definition at line 187 of file TGCCabling.h.

◆ m_cableSSWToROD

TGCCableSSWToROD* MuonTGC_Cabling::TGCCabling::m_cableSSWToROD
private

Definition at line 188 of file TGCCabling.h.

◆ m_mutex

std::mutex MuonTGC_Cabling::TGCCabling::m_mutex
mutableprivate

Definition at line 192 of file TGCCabling.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MuonTGC_Cabling::TGCCabling::MINSRODID
@ MINSRODID
Definition: TGCCabling.h:55
MuonTGC_Cabling::TGCId::SI
@ SI
Definition: TGCId.h:47
MuonTGC_Cabling::TGCCabling::getChannel
TGCChannelId * getChannel(const TGCChannelId *channelId, TGCChannelId::ChannelIdType type, bool orChannel=false) const
Definition: TGCCabling.cxx:616
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
MuonTGC_Cabling::TGCCabling::m_cableSSWToROD
TGCCableSSWToROD * m_cableSSWToROD
Definition: TGCCabling.h:188
MuonTGC_Cabling::TGCCabling::MAXSBLOC
@ MAXSBLOC
Definition: TGCCabling.h:58
MuonTGC_Cabling::TGCModuleId::ROD
@ ROD
Definition: TGCModuleId.h:16
MuonTGC_Cabling::TGCCabling::m_cableInASD
TGCCableInASD * m_cableInASD
Definition: TGCCabling.h:180
MuonTGC_Cabling::TGCCabling::m_cableInPP
TGCCableInPP * m_cableInPP
Definition: TGCCabling.h:182
MuonTGC_Cabling::TGCCabling::m_cableSLBToHPB
TGCCableSLBToHPB * m_cableSLBToHPB
Definition: TGCCabling.h:185
MuonTGC_Cabling::TGCCablePPToSLB::getModule
virtual TGCModuleMap * getModule(const TGCModuleId *moduleId) const
Definition: TGCCablePPToSLB.cxx:73
MuonTGC_Cabling::TGCId::N_RODS
static constexpr int N_RODS
Definition: TGCId.h:43
MuonTGC_Cabling::TGCChannelId::ChannelIdType::ASDOut
@ ASDOut
MuonTGC_Cabling::TGCCabling::MAXSSWID
@ MAXSSWID
Definition: TGCCabling.h:56
skel.it
it
Definition: skel.GENtoEVGEN.py:396
MuonTGC_Cabling::TGCModuleId::SLB
@ SLB
Definition: TGCModuleId.h:16
MuonTGC_Cabling::TGCCabling::MAXRODID
@ MAXRODID
Definition: TGCCabling.h:52
MuonTGC_Cabling::TGCCabling::MAXCHANNELID
@ MAXCHANNELID
Definition: TGCCabling.h:61
MuonTGC_Cabling::TGCCabling::m_mutex
std::mutex m_mutex
Definition: TGCCabling.h:192
MuonTGC_Cabling::TGCChannelId::ChannelIdType::HPBIn
@ HPBIn
Cut::signal
@ signal
Definition: SUSYToolsAlg.cxx:67
MuonTGC_Cabling::TGCChannelId::ChannelIdType::ASDIn
@ ASDIn
MuonTGC_Cabling::TGCCabling::m_cableSLBToSSW
TGCCableSLBToSSW * m_cableSLBToSSW
Definition: TGCCabling.h:187
MuonTGC_Cabling::TGCCabling::getSLBFromReadout
const TGCModuleId * getSLBFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc) const
Definition: TGCCabling.cxx:83
TRT::Hit::side
@ side
Definition: HitInfo.h:83
MuonTGC_Cabling::TGCModuleId::PP
@ PP
Definition: TGCModuleId.h:16
MuonTGC_Cabling::TGCModuleId::SSW
@ SSW
Definition: TGCModuleId.h:16
MuonTGC_Cabling::TGCChannelId::ChannelIdType::SLBIn
@ SLBIn
MuonTGC_Cabling::TGCId::NUM_FORWARD_SECTOR
static constexpr int NUM_FORWARD_SECTOR
Definition: TGCId.h:41
MuonTGC_Cabling::TGCCableSLBToSSW::getModule
virtual TGCModuleMap * getModule(const TGCModuleId *moduleId) const
Definition: TGCCableSLBToSSW.cxx:68
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
MuonTGC_Cabling::TGCCableInASD::getChannel
virtual TGCChannelId * getChannel(const TGCChannelId *channelId, bool orChannel=false) const
Definition: TGCCableInASD.cxx:59
MuonTGC_Cabling::TGCCabling::m_cableHPBToSL
TGCCableHPBToSL * m_cableHPBToSL
Definition: TGCCabling.h:186
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MuonTGC_Cabling::TGCCablePPToSLB::getChannel
virtual TGCChannelId * getChannel(const TGCChannelId *channelId, bool orChannel=false) const
Definition: TGCCablePPToSLB.cxx:62
MuonTGC_Cabling::TGCCabling::m_cableASDToPP
TGCCableASDToPP * m_cableASDToPP
Definition: TGCCabling.h:181
MuonTGC_Cabling::TGCCableSSWToROD::getModule
virtual TGCModuleMap * getModule(const TGCModuleId *moduleId) const
Definition: TGCCableSSWToROD.cxx:52
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonTGC_Cabling::TGCCableSLBToHPB::getChannelInforHPB
TGCChannelId * getChannelInforHPB(const TGCChannelId *hpbin, TGCId::ModuleType moduleType, bool orChannel=false) const
Definition: TGCCableSLBToHPB.cxx:129
MuonTGC_Cabling::TGCCableSLBToHPB::getModule
virtual TGCModuleMap * getModule(const TGCModuleId *moduleId) const
Definition: TGCCableSLBToHPB.cxx:60
MuonTGC_Cabling::TGCCableInPP::getChannel
virtual TGCChannelId * getChannel(const TGCChannelId *channelId, bool orChannel=false) const
Definition: TGCCableInPP.cxx:50
MuonTGC_Cabling::TGCCabling::MINSSWID
@ MINSSWID
Definition: TGCCabling.h:57
MuonTGC_Cabling::TGCCabling::MINCHANNELID
@ MINCHANNELID
Definition: TGCCabling.h:60
master.flag
bool flag
Definition: master.py:29
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
MuonTGC_Cabling::TGCModuleId::SL
@ SL
Definition: TGCModuleId.h:16
MuonTGC_Cabling::TGCCabling::getModule
TGCModuleMap * getModule(const TGCModuleId *moduleId, TGCModuleId::ModuleIdType type) const
Definition: TGCCabling.cxx:773
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
MuonTGC_Cabling::TGCCabling::MINRODID
@ MINRODID
Definition: TGCCabling.h:53
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
MuonTGC_Cabling::TGCCableASDToPP::updateDatabase
StatusCode updateDatabase()
Definition: TGCCableASDToPP.cxx:68
MuonTGC_Cabling::TGCId::WI
@ WI
Definition: TGCId.h:47
MuonTGC_Cabling::TGCCableSLBToHPB::getChannel
virtual TGCChannelId * getChannel(const TGCChannelId *channelId, bool orChannel=false) const
Definition: TGCCableSLBToHPB.cxx:49
MuonTGC_Cabling::TGCCabling::m_cablePPToSLB
TGCCablePPToSLB * m_cablePPToSLB
Definition: TGCCabling.h:183
MuonTGC_Cabling::TGCModuleId::HPB
@ HPB
Definition: TGCModuleId.h:16
MuonTGC_Cabling::TGCCabling::m_cableInSLB
TGCCableInSLB * m_cableInSLB
Definition: TGCCabling.h:184
MuonTGC_Cabling::TGCModuleId::NumberOfSReadoutSector
@ NumberOfSReadoutSector
Definition: TGCModuleId.h:27
MuonTGC_Cabling::TGCId::NoRegionType
@ NoRegionType
Definition: TGCId.h:53
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
MuonTGC_Cabling::TGCId::NoSideType
@ NoSideType
Definition: TGCId.h:45
MuonTGC_Cabling::TGCChannelId::ChannelIdType::PPOut
@ PPOut
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonTGC_Cabling::TGCId::NUM_ENDCAP_SECTOR
static constexpr int NUM_ENDCAP_SECTOR
Definition: TGCId.h:40
MuonTGC_Cabling::TGCCabling::getIndexFromReadoutWithoutChannel
int getIndexFromReadoutWithoutChannel(const TGCId::SideType side, const int rodId, const int sswId, const int sbLoc) const
Definition: TGCCabling.cxx:814
MuonTGC_Cabling::TGCChannelId::ChannelIdType::PPIn
@ PPIn
MuonTGC_Cabling::TGCCableInSLB::getChannel
virtual TGCChannelId * getChannel(const TGCChannelId *channelId, bool orChannel=false) const
Definition: TGCCableInSLB.cxx:12
MuonTGC_Cabling::TGCCableASDToPP::getChannel
virtual TGCChannelId * getChannel(const TGCChannelId *channelId, bool orChannel=false) const
Definition: TGCCableASDToPP.cxx:250
MuonTGC_Cabling::TGCCableHPBToSL::getModule
virtual TGCModuleMap * getModule(const TGCModuleId *moduleId) const
Definition: TGCCableHPBToSL.cxx:21
merge.status
status
Definition: merge.py:17
MuonTGC_Cabling::TGCId::NoSignalType
@ NoSignalType
Definition: TGCId.h:49
MuonTGC_Cabling::TGCId::SideType
SideType
Definition: TGCId.h:45
MuonTGC_Cabling::TGCId::Aside
@ Aside
Definition: TGCId.h:45
MuonTGC_Cabling::TGCId::Forward
@ Forward
Definition: TGCId.h:53
MuonTGC_Cabling::TGCChannelId::ChannelIdType::SLBOut
@ SLBOut
MuonTGC_Cabling::TGCCabling::MINSBLOC
@ MINSBLOC
Definition: TGCCabling.h:59
MuonTGC_Cabling::TGCCabling::MAXSRODID
@ MAXSRODID
Definition: TGCCabling.h:54
MuonTGC_Cabling::TGCCabling::getReadoutFromSLB
bool getReadoutFromSLB(const TGCModuleSLB *slb, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc) const
Definition: TGCCabling.cxx:259