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>

Inheritance diagram for MuonTGC_Cabling::TGCCabling:
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 TGCIdBasegetASDOutChannel (const TGCIdBase *slb_in) const
 
const TGCModuleIdgetSLBFromReadout (TGCIdBase::SideType side, int rodId, int sswId, int sbLoc) const
 
int getRxIdFromReadout (TGCIdBase::SideType side, int rodId, int sswId, int sbLoc) const
 
TGCModuleIdgetSLBFromRxId (TGCIdBase::SideType side, int rodId, int sswId, int rxId) const
 
bool getReadoutFromSLB (const TGCModuleSLB *slb, TGCIdBase::SideType &side, int &rodId, int &sswId, int &sbLoc) const
 
TGCChannelIdgetASDOutFromReadout (TGCIdBase::SideType side, int rodId, int sswId, int sbLoc, int channel, bool orChannel=false) const
 
bool getReadoutFromASDOut (const TGCChannelASDOut *asdout, TGCIdBase::SideType &side, int &rodId, int &sswId, int &sbLoc, int &channel, bool orChannel=false) const
 
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
 
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
 
bool getLowPtCoincidenceFromReadout (TGCIdBase::SideType side, int rodId, int sswId, int sbLoc, int channel, int &block, int &pos, bool middle=false) const
 
bool getReadoutFromLowPtCoincidence (TGCIdBase::SideType side, int rodId, int sswId, int sbLoc, int &channel, int block, int pos, bool middle=false) const
 
TGCChannelIdgetChannel (const TGCChannelId *channelId, TGCIdBase::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 TGCIdBase::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 36 of file TGCCabling.h.

Member Enumeration Documentation

◆ MAXMINREADOUTIDS

Enumerator
MAXRODID 
MINRODID 
MAXSRODID 
MINSRODID 
MAXSSWID 
MINSSWID 
MAXSBLOC 
MINSBLOC 
MINCHANNELID 
MAXCHANNELID 

Definition at line 53 of file TGCCabling.h.

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

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  : TGCCablingBase()
33 {
34  m_cableInASD = new TGCCableInASD(filenameASDToPP);
35  m_cableASDToPP = new TGCCableASDToPP(filenameASDToPP);
36  m_cableInPP = new TGCCableInPP(filenameInPP);
37  m_cablePPToSLB = new TGCCablePPToSLB(filenamePPToSL);
38  m_cableInSLB = new TGCCableInSLB();
39  m_cableSLBToHPB = new TGCCableSLBToHPB(filenamePPToSL);
40  m_cableHPBToSL = new TGCCableHPBToSL(filenamePPToSL);
41  m_cableSLBToSSW = new TGCCableSLBToSSW(filenameSLBToROD);
42  m_cableSSWToROD = new TGCCableSSWToROD(filenameSLBToROD);
43 }

◆ ~TGCCabling()

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

Definition at line 45 of file TGCCabling.cxx.

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

Member Function Documentation

◆ getASDOutChannel()

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

Implements TGCCablingBase.

Definition at line 70 of file TGCCabling.cxx.

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

◆ getASDOutFromReadout()

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

Definition at line 557 of file TGCCabling.cxx.

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

◆ getChannel()

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

Definition at line 618 of file TGCCabling.cxx.

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

◆ getHighPtIDFromReadout()

bool MuonTGC_Cabling::TGCCabling::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 at line 430 of file TGCCabling.cxx.

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

◆ getIndexFromReadoutWithoutChannel()

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

Definition at line 816 of file TGCCabling.cxx.

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

◆ getLowPtCoincidenceFromReadout()

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

Definition at line 522 of file TGCCabling.cxx.

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

◆ getModule()

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

Definition at line 775 of file TGCCabling.cxx.

776  {
777  switch(moduleId->getModuleIdType()){
778  case TGCModuleId::PP:
780  return m_cablePPToSLB->getModule(moduleId);
781  break;
782  case TGCModuleId::SLB:
783  if(type==TGCModuleId::PP)
784  return m_cablePPToSLB->getModule(moduleId);
786  return m_cableSLBToHPB->getModule(moduleId);
788  return m_cableSLBToSSW->getModule(moduleId);
789  break;
790  case TGCModuleId::HPB:
792  return m_cableSLBToHPB->getModule(moduleId);
793  if(type==TGCModuleId::SL)
794  return m_cableHPBToSL->getModule(moduleId);
795  break;
796  case TGCModuleId::SL:
798  return m_cableHPBToSL->getModule(moduleId);
799  break;
800  case TGCModuleId::SSW:
802  return m_cableSLBToSSW->getModule(moduleId);
804  return m_cableSSWToROD->getModule(moduleId);
805  break;
806  case TGCModuleId::ROD:
808  return m_cableSSWToROD->getModule(moduleId);
809  break;
810  default:
811  break;
812  }
813  return nullptr;
814 }

◆ getReadoutFromASDOut()

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

Definition at line 582 of file TGCCabling.cxx.

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

◆ getReadoutFromHighPtID()

bool MuonTGC_Cabling::TGCCabling::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 at line 351 of file TGCCabling.cxx.

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

◆ getReadoutFromLowPtCoincidence()

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

Definition at line 484 of file TGCCabling.cxx.

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

◆ getReadoutFromSLB()

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

Definition at line 261 of file TGCCabling.cxx.

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

◆ getRxIdFromReadout()

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

Definition at line 161 of file TGCCabling.cxx.

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

◆ getSLBFromReadout()

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

Definition at line 85 of file TGCCabling.cxx.

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

◆ getSLBFromRxId()

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

Definition at line 211 of file TGCCabling.cxx.

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

◆ operator=()

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

◆ updateCableASDToPP()

StatusCode MuonTGC_Cabling::TGCCabling::updateCableASDToPP ( )

Definition at line 63 of file TGCCabling.cxx.

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

Member Data Documentation

◆ ATLAS_THREAD_SAFE

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

Definition at line 194 of file TGCCabling.h.

◆ m_cableASDToPP

TGCCableASDToPP* MuonTGC_Cabling::TGCCabling::m_cableASDToPP
private

Definition at line 184 of file TGCCabling.h.

◆ m_cableHPBToSL

TGCCableHPBToSL* MuonTGC_Cabling::TGCCabling::m_cableHPBToSL
private

Definition at line 189 of file TGCCabling.h.

◆ m_cableInASD

TGCCableInASD* MuonTGC_Cabling::TGCCabling::m_cableInASD
private

Definition at line 183 of file TGCCabling.h.

◆ m_cableInPP

TGCCableInPP* MuonTGC_Cabling::TGCCabling::m_cableInPP
private

Definition at line 185 of file TGCCabling.h.

◆ m_cableInSLB

TGCCableInSLB* MuonTGC_Cabling::TGCCabling::m_cableInSLB
private

Definition at line 187 of file TGCCabling.h.

◆ m_cablePPToSLB

TGCCablePPToSLB* MuonTGC_Cabling::TGCCabling::m_cablePPToSLB
private

Definition at line 186 of file TGCCabling.h.

◆ m_cableSLBToHPB

TGCCableSLBToHPB* MuonTGC_Cabling::TGCCabling::m_cableSLBToHPB
private

Definition at line 188 of file TGCCabling.h.

◆ m_cableSLBToSSW

TGCCableSLBToSSW* MuonTGC_Cabling::TGCCabling::m_cableSLBToSSW
private

Definition at line 190 of file TGCCabling.h.

◆ m_cableSSWToROD

TGCCableSSWToROD* MuonTGC_Cabling::TGCCabling::m_cableSSWToROD
private

Definition at line 191 of file TGCCabling.h.

◆ m_mutex

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

Definition at line 195 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:57
MuonTGC_Cabling::TGCId::NumberOfReadoutSector
@ NumberOfReadoutSector
Definition: TGCId.h:49
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
MuonTGC_Cabling::TGCCabling::m_cableSSWToROD
TGCCableSSWToROD * m_cableSSWToROD
Definition: TGCCabling.h:191
MuonTGC_Cabling::TGCCabling::MAXSBLOC
@ MAXSBLOC
Definition: TGCCabling.h:60
MuonTGC_Cabling::TGCModuleId::ROD
@ ROD
Definition: TGCModuleId.h:17
MuonTGC_Cabling::TGCCabling::m_cableInASD
TGCCableInASD * m_cableInASD
Definition: TGCCabling.h:183
MuonTGC_Cabling::TGCCabling::m_cableInPP
TGCCableInPP * m_cableInPP
Definition: TGCCabling.h:185
MuonTGC_Cabling::TGCCabling::m_cableSLBToHPB
TGCCableSLBToHPB * m_cableSLBToHPB
Definition: TGCCabling.h:188
MuonTGC_Cabling::TGCCablePPToSLB::getModule
virtual TGCModuleMap * getModule(const TGCModuleId *moduleId) const
Definition: TGCCablePPToSLB.cxx:73
MuonTGC_Cabling::TGCCabling::MAXSSWID
@ MAXSSWID
Definition: TGCCabling.h:58
skel.it
it
Definition: skel.GENtoEVGEN.py:423
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::TGCModuleId::SLB
@ SLB
Definition: TGCModuleId.h:17
MuonTGC_Cabling::TGCCabling::MAXRODID
@ MAXRODID
Definition: TGCCabling.h:54
MuonTGC_Cabling::TGCCabling::MAXCHANNELID
@ MAXCHANNELID
Definition: TGCCabling.h:63
MuonTGC_Cabling::TGCCabling::m_mutex
std::mutex m_mutex
Definition: TGCCabling.h:195
MuonTGC_Cabling::TGCCabling::m_cableSLBToSSW
TGCCableSLBToSSW * m_cableSLBToSSW
Definition: TGCCabling.h:190
TGCIdBase::PPIn
@ PPIn
Definition: TGCIdBase.h:43
MuonTGC_Cabling::TGCCableSLBToHPB::getChannelInforHPB
TGCChannelId * getChannelInforHPB(const TGCChannelId *hpbin, TGCIdBase::ModuleType moduleType, bool orChannel=false) const
Definition: TGCCableSLBToHPB.cxx:129
TGCIdBase::SLBIn
@ SLBIn
Definition: TGCIdBase.h:43
TRT::Hit::side
@ side
Definition: HitInfo.h:83
MuonTGC_Cabling::TGCModuleId::PP
@ PP
Definition: TGCModuleId.h:17
MuonTGC_Cabling::TGCModuleId::SSW
@ SSW
Definition: TGCModuleId.h:17
MuonTGC_Cabling::TGCCabling::getIndexFromReadoutWithoutChannel
int getIndexFromReadoutWithoutChannel(const TGCIdBase::SideType side, const int rodId, const int sswId, const int sbLoc) const
Definition: TGCCabling.cxx:816
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::TGCId::NumberOfEndcapSector
@ NumberOfEndcapSector
Definition: TGCId.h:53
TGCIdBase::WI
@ WI
Definition: TGCIdBase.h:33
TGCIdBase::PPOut
@ PPOut
Definition: TGCIdBase.h:43
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:189
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:184
MuonTGC_Cabling::TGCCableSSWToROD::getModule
virtual TGCModuleMap * getModule(const TGCModuleId *moduleId) const
Definition: TGCCableSSWToROD.cxx:53
lumiFormat.i
int i
Definition: lumiFormat.py:92
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
TGCIdBase::HPBIn
@ HPBIn
Definition: TGCIdBase.h:43
TGCIdBase::ASDOut
@ ASDOut
Definition: TGCIdBase.h:43
MuonTGC_Cabling::TGCCabling::MINSSWID
@ MINSSWID
Definition: TGCCabling.h:59
MuonTGC_Cabling::TGCCabling::MINCHANNELID
@ MINCHANNELID
Definition: TGCCabling.h:62
master.flag
bool flag
Definition: master.py:29
TGCIdBase::ASDIn
@ ASDIn
Definition: TGCIdBase.h:43
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
MuonTGC_Cabling::TGCId::NumberOfSReadoutSector
@ NumberOfSReadoutSector
Definition: TGCId.h:50
MuonTGC_Cabling::TGCId::NumberOfForwardSector
@ NumberOfForwardSector
Definition: TGCId.h:51
MuonTGC_Cabling::TGCModuleId::SL
@ SL
Definition: TGCModuleId.h:17
MuonTGC_Cabling::TGCCabling::getModule
TGCModuleMap * getModule(const TGCModuleId *moduleId, TGCModuleId::ModuleIdType type) const
Definition: TGCCabling.cxx:775
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
MuonTGC_Cabling::TGCCabling::MINRODID
@ MINRODID
Definition: TGCCabling.h:55
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
MuonTGC_Cabling::TGCCableASDToPP::updateDatabase
StatusCode updateDatabase()
Definition: TGCCableASDToPP.cxx:109
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:186
MuonTGC_Cabling::TGCModuleId::HPB
@ HPB
Definition: TGCModuleId.h:17
MuonTGC_Cabling::TGCCabling::m_cableInSLB
TGCCableInSLB * m_cableInSLB
Definition: TGCCabling.h:187
Cut::signal
@ signal
Definition: SUSYToolsAlg.cxx:64
TGCIdBase::SLBOut
@ SLBOut
Definition: TGCIdBase.h:43
TGCIdBase::NoSignalType
@ NoSignalType
Definition: TGCIdBase.h:35
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
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
TGCIdBase::NoSideType
@ NoSideType
Definition: TGCIdBase.h:31
TGCIdBase::Forward
@ Forward
Definition: TGCIdBase.h:39
TGCIdBase::SideType
SideType
Definition: TGCIdBase.h:31
MuonTGC_Cabling::TGCCableInSLB::getChannel
virtual TGCChannelId * getChannel(const TGCChannelId *channelId, bool orChannel=false) const
Definition: TGCCableInSLB.cxx:13
MuonTGC_Cabling::TGCCableASDToPP::getChannel
virtual TGCChannelId * getChannel(const TGCChannelId *channelId, bool orChannel=false) const
Definition: TGCCableASDToPP.cxx:292
MuonTGC_Cabling::TGCCableHPBToSL::getModule
virtual TGCModuleMap * getModule(const TGCModuleId *moduleId) const
Definition: TGCCableHPBToSL.cxx:36
merge.status
status
Definition: merge.py:17
TGCCablingBase::TGCCablingBase
TGCCablingBase()
Definition: TGCCablingBase.h:25
MuonTGC_Cabling::TGCCabling::MINSBLOC
@ MINSBLOC
Definition: TGCCabling.h:61
TGCIdBase::SI
@ SI
Definition: TGCIdBase.h:33
MuonTGC_Cabling::TGCCabling::MAXSRODID
@ MAXSRODID
Definition: TGCCabling.h:56