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

#include <MDT_Hid2RESrcID.h>

Collaboration diagram for MDT_Hid2RESrcID:

Public Member Functions

 MDT_Hid2RESrcID ()
 constrcutor More...
 
StatusCode set (const MdtIdHelper *mdtId)
 intialize the cabling service More...
 
void setSpecialROBNumber (int specialROBNumber)
 TMP method for sector 13 data. More...
 
uint32_t getRodID (const Identifier &offlineId) const
 

Static Public Member Functions

static uint32_t getRobID (uint32_t rod_id)
 Make a ROB Source ID from a ROD source ID. More...
 
static uint32_t getRosID (uint32_t rob_id)
 Make a ROS Source ID from a ROB source ID. More...
 
static uint32_t getDetID (uint32_t ros_id)
 Make a SubDetector ID from ROS source ID. More...
 

Private Attributes

const MdtIdHelperm_mdtIdHelper
 
int m_specialROBNumber
 
SG::ReadCondHandleKey< MuonMDT_CablingMapm_readKey
 

Detailed Description

Definition at line 30 of file MDT_Hid2RESrcID.h.

Constructor & Destructor Documentation

◆ MDT_Hid2RESrcID()

MDT_Hid2RESrcID::MDT_Hid2RESrcID ( )

constrcutor

Definition at line 23 of file MDT_Hid2RESrcID.cxx.

23 : m_mdtIdHelper(nullptr), m_specialROBNumber(0), m_readKey("MuonMDT_CablingMap") {}

Member Function Documentation

◆ getDetID()

uint32_t MDT_Hid2RESrcID::getDetID ( uint32_t  ros_id)
static

Make a SubDetector ID from ROS source ID.

mapping SrcID from ROS to Det

Definition at line 116 of file MDT_Hid2RESrcID.cxx.

116  {
117  // ROS to DET
118 
119  SourceIdentifier id(ros_id);
120  SourceIdentifier id2(id.subdetector_id(), 0);
121  return id2.code();
122 }

◆ getRobID()

uint32_t MDT_Hid2RESrcID::getRobID ( uint32_t  rod_id)
static

Make a ROB Source ID from a ROD source ID.

mapping SrcID from ROD to ROB

Definition at line 92 of file MDT_Hid2RESrcID.cxx.

92  {
93  SourceIdentifier id = SourceIdentifier(rod_id);
94  SourceIdentifier id2 = SourceIdentifier(id.subdetector_id(), id.module_id());
95  // return id2.code();
96 
97  // FIXME ! the rob ID in the first data taken is wrong !
98  // return 0x610003;
99 
100  // After data will be fixed the correct version should be:
101  return rod_id;
102 }

◆ getRodID()

uint32_t MDT_Hid2RESrcID::getRodID ( const Identifier offlineId) const

Definition at line 32 of file MDT_Hid2RESrcID.cxx.

32  {
33  // this method returns a RESrcID for the ROD, for a
34  // given MDT ID offline ID
35 
36  IMessageSvc* msgSvc = nullptr;
37  ISvcLocator* svcLocator = Gaudi::svcLocator();
38  StatusCode sc = svcLocator->service("MessageSvc", msgSvc);
39  if (sc == StatusCode::FAILURE) throw std::runtime_error("Unable to get MessageSvc");
40 
41  MsgStream log(msgSvc, "MDT_Hid2RESrcID::getRodID");
42 
43  log << MSG::DEBUG << "Getting RODId of the Station " << MSG::hex << offlineId << MSG::dec << endmsg;
44 
46  const MuonMDT_CablingMap* readCdo{*readHandle};
47  if (!readCdo) {
48  // ATH_MSG_ERROR("Null pointer to the read conditions object");
49  log << MSG::ERROR << "Null pointer to the read conditions object" << endmsg;
50  return 0;
51  }
53  if (!readCdo->convert(offlineId, cabling_data)) {
54  log << MSG::ERROR << " Invalid identifier given " << endmsg;
55  return 0;
56  }
57  bool online = readCdo->getOnlineId(cabling_data, log);
58 
59  if (!online) {
60  log << MSG::DEBUG << "ROD Id of the Station " << MSG::hex << "0x" << offlineId << " not found" << endmsg;
61  cabling_data.mrod = 0xff;
62  } else {
63  log << MSG::DEBUG << "The ROD ID of the station "
64  << "is " << MSG::hex << "0x" << cabling_data.mrod << MSG::dec << endmsg;
65  }
66 
67  eformat::SubDetector detid = (eformat::SubDetector)cabling_data.subdetectorId;
68 
69  // if (SubsystemId == eformat::MUON_MDT_BARREL_A_SIDE) {
70  // detid = eformat::MUON_MDT_BARREL_A_SIDE;
71  //}
72  // else if (SubsystemId == eformat::MUON_MDT_BARREL_C_SIDE) {
73  // detid = eformat::MUON_MDT_BARREL_C_SIDE;
74  //}
75  // else if (SubsystemId == eformat::MUON_MDT_ENDCAP_A_SIDE) {
76  // detid = eformat::MUON_MDT_ENDCAP_A_SIDE;
77  //}
78  // else if (SubsystemId == eformat::MUON_MDT_ENDCAP_C_SIDE) {
79  // detid = eformat::MUON_MDT_ENDCAP_C_SIDE;
80  //}
81 
82  // uint8_t m = (uint8_t) MrodId;
83  SourceIdentifier sid(detid, cabling_data.mrod);
84 
85  uint32_t rod_id = sid.code();
86 
87  return rod_id;
88 }

◆ getRosID()

uint32_t MDT_Hid2RESrcID::getRosID ( uint32_t  rob_id)
static

Make a ROS Source ID from a ROB source ID.

mapping SrcID from ROB to ROS

Definition at line 106 of file MDT_Hid2RESrcID.cxx.

106  {
107  // Change Module Type to ROS, moduleid = 0
108 
109  SourceIdentifier id(rob_id);
110  SourceIdentifier id2(id.subdetector_id(), 0);
111  return id2.code();
112 }

◆ set()

StatusCode MDT_Hid2RESrcID::set ( const MdtIdHelper mdtId)

intialize the cabling service

Definition at line 25 of file MDT_Hid2RESrcID.cxx.

25  {
26  // Initialize the cabling Service
27  m_mdtIdHelper = mdtId;
29  return StatusCode::SUCCESS;
30 }

◆ setSpecialROBNumber()

void MDT_Hid2RESrcID::setSpecialROBNumber ( int  specialROBNumber)
inline

TMP method for sector 13 data.

Definition at line 41 of file MDT_Hid2RESrcID.h.

41 { m_specialROBNumber = specialROBNumber; }

Member Data Documentation

◆ m_mdtIdHelper

const MdtIdHelper* MDT_Hid2RESrcID::m_mdtIdHelper
private

Definition at line 59 of file MDT_Hid2RESrcID.h.

◆ m_readKey

SG::ReadCondHandleKey<MuonMDT_CablingMap> MDT_Hid2RESrcID::m_readKey
private

Definition at line 63 of file MDT_Hid2RESrcID.h.

◆ m_specialROBNumber

int MDT_Hid2RESrcID::m_specialROBNumber
private

Definition at line 61 of file MDT_Hid2RESrcID.h.


The documentation for this class was generated from the following files:
MDT_Hid2RESrcID::m_specialROBNumber
int m_specialROBNumber
Definition: MDT_Hid2RESrcID.h:61
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
createCablingJSON.cabling_data
dictionary cabling_data
Definition: createCablingJSON.py:18
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TileSynchronizeBch.online
online
Definition: TileSynchronizeBch.py:88
MuonMDT_CablingMap
Definition: MuonMDT_CablingMap.h:24
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:564
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MDT_Hid2RESrcID::m_readKey
SG::ReadCondHandleKey< MuonMDT_CablingMap > m_readKey
Definition: MDT_Hid2RESrcID.h:63
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MdtCablingData
Definition: MdtCablingData.h:82
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:191
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MDT_Hid2RESrcID::m_mdtIdHelper
const MdtIdHelper * m_mdtIdHelper
Definition: MDT_Hid2RESrcID.h:59