ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes | List of all members
MuonTGC_CablingSvc Class Reference

#include <MuonTGC_CablingSvc.h>

Inheritance diagram for MuonTGC_CablingSvc:
Collaboration diagram for MuonTGC_CablingSvc:

Public Member Functions

 MuonTGC_CablingSvc (const std::string &name, ISvcLocator *svc)
 
virtual ~MuonTGC_CablingSvc ()=default
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvIF) override
 
virtual StatusCode initialize (void) override
 
virtual StatusCode finalize (void) override
 
virtual const TGCCablingBasegetTGCCabling (void) const override
 
virtual void getReadoutIDRanges (int &maxRodId, int &maxSRodId, int &maxSswId, int &maxSbloc, int &minChannelId, int &maxChannelId) const override
 
virtual bool getCoveragefromRodID (const int rodID, double &startPhi, double &endPhi) const override
 
virtual bool getCoveragefromRodID (const int rodID, int &startEndcapSector, int &coverageOfEndcapSector, int &startForwardSector, int &coverageOfForwardSector) const override
 
virtual bool getCoveragefromSRodID (const int srodID, double &startPhi, double &endPhi) const override
 
virtual bool getCoveragefromSRodID (const int srodID, int &startEndcapSector, int &coverageOfEndcapSector, int &startForwardSector, int &coverageOfForwardSector) const override
 
virtual bool isOredChannel (const int subDetectorID, const int rodID, const int sswID, const int sbLoc, const int channelID) const override
 
virtual bool hasAdjacentChannel (const Identifier &offlineID) const override
 
virtual bool hasAdjacentChannel (const int subsystemNumber, const int octantNumber, const int moduleNumber, const int layerNumber, const int rNumber, const int wireOrStrip, const int channelNumber) const override
 
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
 
virtual bool getReadoutIDfromOfflineID (const Identifier &offlineID, int &subDetectorID, int &rodID, int &sswID, int &sbLoc, int &channelID, bool adChannel=false) const override
 
virtual bool getOnlineIDfromOfflineID (const Identifier &offlineID, int &subsystemNumber, int &octantNumber, int &moduleNumber, int &layerNumber, int &rNumber, int &wireOrStrip, int &channelNumber) const override
 
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
 
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
 
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
 
virtual bool getReadoutIDfromElementID (const Identifier &elementID, int &subdetectorID, int &rodID) const override
 
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
 
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
 
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
 
virtual bool getSLBAddressfromReadoutID (int &slbAddr, const int subsectorID, const int rodID, const int sswID, const int sbLoc) const override
 
virtual bool getRxIDfromReadoutID (int &rxId, const int subsectorID, const int rodID, const int sswID, const int sbLoc) const override
 
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
 
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
 
virtual bool getSLIDfromReadoutID (int &phi, bool &isAside, bool &isEndcap, const int subsectorID, const int rodID, const int sswID, const int sbLoc) const override
 
virtual bool getSLIDfromSReadoutID (int &phi, bool &isAside, const int subsectorID, const int srodID, const int sector, const bool forward) const override
 
virtual bool getReadoutIDfromSLID (const int phi, const bool isAside, const bool isEndcap, int &subsectorID, int &rodID, int &sswID, int &sbLoc) const override
 
virtual bool getSReadoutIDfromSLID (const int phi, const bool isAside, const bool isEndcap, int &subsectorID, int &srodID, int &sswID, int &sbLoc) const override
 
virtual bool getRDOHighPtIDfromSimHighPtID (const bool isForward, const bool isStrip, int &index, int &chip, int &hitId) const override
 
virtual bool getSimHighPtIDfromRDOHighPtID (const bool isForward, const bool isStrip, int &index, int &chip, int &hitId) const override
 
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
 
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
 
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
 
virtual bool getHighPtIDfromROINumber (int roi, bool isForward, bool isStrip, int &hpb, int &chip, int &hitID, int &sub) const override
 
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
 
virtual bool getLowPtCoincidenceIDfromOfflineID (const Identifier &offlineID, int &subDetectorID, int &rodID, int &sswID, int &sbLoc, int &block, int &pos, bool middle=false) const override
 
MuonTGC_Cabling::TGCChannelIdgetChannel (const MuonTGC_Cabling::TGCChannelId *channelId, TGCIdBase::ChannelIdType type, bool orChannel=false) const
 
MuonTGC_Cabling::TGCModuleMapgetModule (const MuonTGC_Cabling::TGCModuleId *moduleId, MuonTGC_Cabling::TGCModuleId::ModuleIdType type) const
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID (void)
 

Protected Attributes

IntegerProperty m_AsideId
 
IntegerProperty m_CsideId
 
IntegerArrayProperty m_rodId
 
StringProperty m_databaseASDToPP
 
StringProperty m_databaseInPP
 
StringProperty m_databasePPToSL
 
StringProperty m_databaseSLBToROD
 
StringProperty m_databaseASDToPPdiff
 

Private Attributes

MuonTGC_Cabling::TGCCablingm_cabling
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
ToolHandle< ITGCCablingDbToolm_condDataTool {this,"TGCCablingDbTool","TGCCablingDbTool"}
 

Detailed Description

Definition at line 30 of file MuonTGC_CablingSvc.h.

Constructor & Destructor Documentation

◆ MuonTGC_CablingSvc()

MuonTGC_CablingSvc::MuonTGC_CablingSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Definition at line 27 of file MuonTGC_CablingSvc.cxx.

27  :
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 }

◆ ~MuonTGC_CablingSvc()

virtual MuonTGC_CablingSvc::~MuonTGC_CablingSvc ( )
virtualdefault

Member Function Documentation

◆ finalize()

StatusCode MuonTGC_CablingSvc::finalize ( void  )
overridevirtual

Definition at line 167 of file MuonTGC_CablingSvc.cxx.

168 {
169  delete m_cabling;
170  m_cabling = nullptr;
171  return StatusCode::SUCCESS;
172 }

◆ getChannel()

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

Definition at line 1488 of file MuonTGC_CablingSvc.cxx.

1491 {
1492  return m_cabling->getChannel(channelId, type, orChannel);
1493 }

◆ getCoveragefromRodID() [1/2]

bool MuonTGC_CablingSvc::getCoveragefromRodID ( const int  rodID,
double &  startPhi,
double &  endPhi 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 176 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getCoveragefromRodID() [2/2]

bool MuonTGC_CablingSvc::getCoveragefromRodID ( const int  rodID,
int &  startEndcapSector,
int &  coverageOfEndcapSector,
int &  startForwardSector,
int &  coverageOfForwardSector 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 190 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getCoveragefromSRodID() [1/2]

bool MuonTGC_CablingSvc::getCoveragefromSRodID ( const int  srodID,
double &  startPhi,
double &  endPhi 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 213 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getCoveragefromSRodID() [2/2]

bool MuonTGC_CablingSvc::getCoveragefromSRodID ( const int  srodID,
int &  startEndcapSector,
int &  coverageOfEndcapSector,
int &  startForwardSector,
int &  coverageOfForwardSector 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 227 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getElementIDfromReadoutID()

bool MuonTGC_CablingSvc::getElementIDfromReadoutID ( Identifier elementID,
const int  subDetectorID,
const int  rodID,
const int  sswID,
const int  sbLoc,
const int  channelID,
bool  orChannel = false 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1023 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getHighPtIDfromOfflineID()

bool MuonTGC_CablingSvc::getHighPtIDfromOfflineID ( const Identifier offlineID,
int &  subDetectorID,
int &  rodID,
int &  sectorInReadout,
bool &  isStrip,
bool &  isForward,
int &  hpb,
int &  chip,
int &  hitID,
int &  pos 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1798 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getHighPtIDfromROINumber()

bool MuonTGC_CablingSvc::getHighPtIDfromROINumber ( int  roi,
bool  isForward,
bool  isStrip,
int &  hpb,
int &  chip,
int &  hitID,
int &  sub 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1508 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getLowPtCoincidenceIDfromOfflineID()

bool MuonTGC_CablingSvc::getLowPtCoincidenceIDfromOfflineID ( const Identifier offlineID,
int &  subDetectorID,
int &  rodID,
int &  sswID,
int &  sbLoc,
int &  block,
int &  pos,
bool  middle = false 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1888 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getModule()

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

Definition at line 1499 of file MuonTGC_CablingSvc.cxx.

1501 {
1502  return m_cabling->getModule(moduleId, type);
1503 }

◆ getOfflineIDfromHighPtID()

bool MuonTGC_CablingSvc::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
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1735 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getOfflineIDfromLowPtCoincidenceID()

bool MuonTGC_CablingSvc::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
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1852 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getOfflineIDfromOnlineID()

bool MuonTGC_CablingSvc::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
overridevirtual

Implements ITGCcablingSvc.

Definition at line 675 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getOfflineIDfromReadoutID()

bool MuonTGC_CablingSvc::getOfflineIDfromReadoutID ( Identifier offlineID,
const int  subDetectorID,
const int  rodID,
const int  sswID,
const int  sbLoc,
const int  channelID,
bool  orChannel = false 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 326 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getOnlineIDfromOfflineID()

bool MuonTGC_CablingSvc::getOnlineIDfromOfflineID ( const Identifier offlineID,
int &  subsystemNumber,
int &  octantNumber,
int &  moduleNumber,
int &  layerNumber,
int &  rNumber,
int &  wireOrStrip,
int &  channelNumber 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 485 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getOnlineIDfromReadoutID()

bool MuonTGC_CablingSvc::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
overridevirtual

Implements ITGCcablingSvc.

Definition at line 822 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getRDOHighPtIDfromSimHighPtID()

bool MuonTGC_CablingSvc::getRDOHighPtIDfromSimHighPtID ( const bool  isForward,
const bool  isStrip,
int &  index,
int &  chip,
int &  hitId 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1676 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getReadoutIDfromElementID()

bool MuonTGC_CablingSvc::getReadoutIDfromElementID ( const Identifier elementID,
int &  subdetectorID,
int &  rodID 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 983 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getReadoutIDfromHPTID()

bool MuonTGC_CablingSvc::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
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1466 of file MuonTGC_CablingSvc.cxx.

1475 {
1476  return getReadoutIDfromSLID(phi, isAside, isEndcap,
1477  subsectorID,
1478  rodID,
1479  sswID,
1480  sbLoc);
1481 }

◆ getReadoutIDfromOfflineID()

bool MuonTGC_CablingSvc::getReadoutIDfromOfflineID ( const Identifier offlineID,
int &  subDetectorID,
int &  rodID,
int &  sswID,
int &  sbLoc,
int &  channelID,
bool  adChannel = false 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 396 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getReadoutIDfromOnlineID()

bool MuonTGC_CablingSvc::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
overridevirtual

Implements ITGCcablingSvc.

Definition at line 903 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getReadoutIDfromSLBID()

bool MuonTGC_CablingSvc::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
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1227 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getReadoutIDfromSLID()

bool MuonTGC_CablingSvc::getReadoutIDfromSLID ( const int  phi,
const bool  isAside,
const bool  isEndcap,
int &  subsectorID,
int &  rodID,
int &  sswID,
int &  sbLoc 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1378 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getReadoutIDRanges()

void MuonTGC_CablingSvc::getReadoutIDRanges ( int &  maxRodId,
int &  maxSRodId,
int &  maxSswId,
int &  maxSbloc,
int &  minChannelId,
int &  maxChannelId 
) const
overridevirtual

◆ getROINumberfromHighPtID()

bool MuonTGC_CablingSvc::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
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1638 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getRxIDfromReadoutID()

bool MuonTGC_CablingSvc::getRxIDfromReadoutID ( int &  rxId,
const int  subsectorID,
const int  rodID,
const int  sswID,
const int  sbLoc 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1155 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getSimHighPtIDfromRDOHighPtID()

bool MuonTGC_CablingSvc::getSimHighPtIDfromRDOHighPtID ( const bool  isForward,
const bool  isStrip,
int &  index,
int &  chip,
int &  hitId 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1704 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getSLBAddressfromReadoutID()

bool MuonTGC_CablingSvc::getSLBAddressfromReadoutID ( int &  slbAddr,
const int  subsectorID,
const int  rodID,
const int  sswID,
const int  sbLoc 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1119 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getSLBIDfromReadoutID()

bool MuonTGC_CablingSvc::getSLBIDfromReadoutID ( int &  phi,
bool &  isAside,
bool &  isEndcap,
int &  moduleType,
int &  id,
const int  subsectorID,
const int  rodID,
const int  sswID,
const int  sbLoc 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1072 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getSLBIDfromRxID()

bool MuonTGC_CablingSvc::getSLBIDfromRxID ( int &  phi,
bool &  isAside,
bool &  isEndcap,
int &  moduleType,
int &  id,
const int  subsectorID,
const int  rodID,
const int  sswID,
const int  rxId 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1181 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getSLIDfromReadoutID()

bool MuonTGC_CablingSvc::getSLIDfromReadoutID ( int &  phi,
bool &  isAside,
bool &  isEndcap,
const int  subsectorID,
const int  rodID,
const int  sswID,
const int  sbLoc 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1288 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getSLIDfromSReadoutID()

bool MuonTGC_CablingSvc::getSLIDfromSReadoutID ( int &  phi,
bool &  isAside,
const int  subsectorID,
const int  srodID,
const int  sector,
const bool  forward 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1338 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getSReadoutIDfromSLID()

bool MuonTGC_CablingSvc::getSReadoutIDfromSLID ( const int  phi,
const bool  isAside,
const bool  isEndcap,
int &  subsectorID,
int &  srodID,
int &  sswID,
int &  sbLoc 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 1422 of file MuonTGC_CablingSvc.cxx.

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 }

◆ getTGCCabling()

const TGCCablingBase * MuonTGC_CablingSvc::getTGCCabling ( void  ) const
inlineoverridevirtual

Implements ITGCcablingSvc.

Definition at line 412 of file MuonTGC_CablingSvc.h.

413 {
414  return m_cabling;
415 }

◆ hasAdjacentChannel() [1/2]

bool MuonTGC_CablingSvc::hasAdjacentChannel ( const Identifier offlineID) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 270 of file MuonTGC_CablingSvc.cxx.

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 }

◆ hasAdjacentChannel() [2/2]

bool MuonTGC_CablingSvc::hasAdjacentChannel ( const int  subsystemNumber,
const int  octantNumber,
const int  moduleNumber,
const int  layerNumber,
const int  rNumber,
const int  wireOrStrip,
const int  channelNumber 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 289 of file MuonTGC_CablingSvc.cxx.

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 }

◆ initialize()

StatusCode MuonTGC_CablingSvc::initialize ( void  )
overridevirtual

Definition at line 69 of file MuonTGC_CablingSvc.cxx.

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 }

◆ interfaceID()

static const InterfaceID& MuonTGC_CablingSvc::interfaceID ( void  )
inlinestatic

Definition at line 43 of file MuonTGC_CablingSvc.h.

◆ isOredChannel()

bool MuonTGC_CablingSvc::isOredChannel ( const int  subDetectorID,
const int  rodID,
const int  sswID,
const int  sbLoc,
const int  channelID 
) const
overridevirtual

Implements ITGCcablingSvc.

Definition at line 251 of file MuonTGC_CablingSvc.cxx.

256 {
257  Identifier id;
258  return getOfflineIDfromReadoutID(id,
259  subDetectorID,
260  rodID,
261  sswID,
262  sbLoc,
263  channelID,
264  true);
265 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Service >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Service >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Service >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ queryInterface()

StatusCode MuonTGC_CablingSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvIF 
)
overridevirtual

Implements ITGCcablingSvc.

Definition at line 40 of file MuonTGC_CablingSvc.cxx.

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 }

Member Data Documentation

◆ m_AsideId

IntegerProperty ITGCcablingSvc::m_AsideId
protectedinherited

Definition at line 401 of file ITGCcablingSvc.h.

◆ m_cabling

MuonTGC_Cabling::TGCCabling* MuonTGC_CablingSvc::m_cabling
private

Definition at line 413 of file MuonTGC_CablingSvc.h.

◆ m_condDataTool

ToolHandle<ITGCCablingDbTool> MuonTGC_CablingSvc::m_condDataTool {this,"TGCCablingDbTool","TGCCablingDbTool"}
private

Definition at line 415 of file MuonTGC_CablingSvc.h.

◆ m_CsideId

IntegerProperty ITGCcablingSvc::m_CsideId
protectedinherited

Definition at line 402 of file ITGCcablingSvc.h.

◆ m_databaseASDToPP

StringProperty ITGCcablingSvc::m_databaseASDToPP
protectedinherited

Definition at line 405 of file ITGCcablingSvc.h.

◆ m_databaseASDToPPdiff

StringProperty ITGCcablingSvc::m_databaseASDToPPdiff
protectedinherited

Definition at line 410 of file ITGCcablingSvc.h.

◆ m_databaseInPP

StringProperty ITGCcablingSvc::m_databaseInPP
protectedinherited

Definition at line 406 of file ITGCcablingSvc.h.

◆ m_databasePPToSL

StringProperty ITGCcablingSvc::m_databasePPToSL
protectedinherited

Definition at line 407 of file ITGCcablingSvc.h.

◆ m_databaseSLBToROD

StringProperty ITGCcablingSvc::m_databaseSLBToROD
protectedinherited

Definition at line 408 of file ITGCcablingSvc.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonTGC_CablingSvc::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 414 of file MuonTGC_CablingSvc.h.

◆ m_rodId

IntegerArrayProperty ITGCcablingSvc::m_rodId
protectedinherited

Definition at line 403 of file ITGCcablingSvc.h.


The documentation for this class was generated from the following files:
TGCIdBase::getStation
int getStation(void) const
Definition: TGCIdBase.cxx:43
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
TGCIdBase::Endcap
@ Endcap
Definition: TGCIdBase.h:39
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
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
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
TGCIdBase::Wire
@ Wire
Definition: TGCIdBase.h:35
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
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_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
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
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
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_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
TRT::Hit::side
@ side
Definition: HitInfo.h:83
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
TGCIdBase::WI
@ WI
Definition: TGCIdBase.h:33
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
ITGCcablingSvc::ITGCcablingSvc
ITGCcablingSvc(const std::string &name, ISvcLocator *svc)
Definition: ITGCcablingSvc.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
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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_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
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
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
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
dumpTgcDigiThreshold.isStrip
list isStrip
Definition: dumpTgcDigiThreshold.py:33
TGCIdBase::RegionType
RegionType
Definition: TGCIdBase.h:39
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::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonTGC_CablingSvc.h:414
MuonTGC_Cabling::TGCModuleSLB::getSlbAddr
int getSlbAddr(void) const
Definition: TGCModuleSLB.h:31
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
TGCIdBase::Cside
@ Cside
Definition: TGCIdBase.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
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
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
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
TGCIdBase::isForward
bool isForward(void) const
Definition: TGCIdBase.cxx:61
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
TGCIdBase::WD
@ WD
Definition: TGCIdBase.h:33
MuonTGC_Cabling::TGCCabling
Definition: TGCCabling.h:37
Muon::nsw::STGTPSegments::MergedSegmentProperty::rIndex
@ rIndex
MuonTGC_Cabling::TGCCabling::MAXSRODID
@ MAXSRODID
Definition: TGCCabling.h:56