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

#include <Hid2RESrcID.h>

Collaboration diagram for Hid2RESrcID:

Public Types

typedef HWIdentifier COLLECTION_ID
 

Public Member Functions

 Hid2RESrcID ()
 constructor More...
 
StatusCode initialize (const LArFebRodMapping &rodMapping)
 
bool isInitialized () const
 
uint32_t getRodID (const LArFebRodMapping &rodMapping, const HWIdentifier &hid) const
 make a ROD SrcID for a HWIdentifier More...
 
uint32_t getRodIDFromROM (const COLLECTION_ID &hid) const
 make a ROD SrcID for a COLLECTION_ID More...
 
uint32_t getRobID (uint32_t rod_id) const
 Make a ROB Source ID from a ROD source ID. More...
 
uint32_t getRosID (uint32_t rob_id) const
 Make a ROS Source ID from a ROB source ID. More...
 
uint32_t getDetID (uint32_t ros_id) const
 Make a SubDetector ID from ROS source ID. More...
 

Private Types

typedef std::map< HWIdentifier, uint32_t > COLL_MAP
 

Private Member Functions

StatusCode initialize (const std::vector< HWIdentifier > &roms)
 

Private Attributes

bool m_initialized
 
const LArOnlineIDm_onlineHelper
 
COLL_MAP m_coll2ROD
 
LArReadoutModuleService m_readoutModuleSvc
 
RodRobIdMap m_rodRobIdMap
 

Detailed Description

Definition at line 38 of file Hid2RESrcID.h.

Member Typedef Documentation

◆ COLL_MAP

typedef std::map<HWIdentifier, uint32_t> Hid2RESrcID::COLL_MAP
private

Definition at line 78 of file Hid2RESrcID.h.

◆ COLLECTION_ID

Definition at line 42 of file Hid2RESrcID.h.

Constructor & Destructor Documentation

◆ Hid2RESrcID()

Hid2RESrcID::Hid2RESrcID ( )

constructor

Definition at line 31 of file Hid2RESrcID.cxx.

31  :
32  m_initialized(false),
34 {
35 
36 }

Member Function Documentation

◆ getDetID()

uint32_t Hid2RESrcID::getDetID ( uint32_t  ros_id) const

Make a SubDetector ID from ROS source ID.

mapping SrcID from ROS to Det

Definition at line 120 of file Hid2RESrcID.cxx.

121 {
122 // ROS to DET
123 
124  SourceIdentifier id = SourceIdentifier(ros_id);
125  SourceIdentifier id2 = SourceIdentifier(id.subdetector_id(), 0);
126  return id2.code();
127 }

◆ getRobID()

uint32_t Hid2RESrcID::getRobID ( uint32_t  rod_id) const

Make a ROB Source ID from a ROD source ID.

mapping SrcID from ROD to ROB

Definition at line 100 of file Hid2RESrcID.cxx.

101 {
102  return m_rodRobIdMap.getRobID (rod_id);
103 }

◆ getRodID()

uint32_t Hid2RESrcID::getRodID ( const LArFebRodMapping rodMapping,
const HWIdentifier hid 
) const

make a ROD SrcID for a HWIdentifier

Definition at line 88 of file Hid2RESrcID.cxx.

90 { // this method returns a RESrcID for the ROD, for a given LArOnlineID
91  // channel number is ignored.
92  HWIdentifier febId = m_onlineHelper->feb_Id(hid) ;
93  HWIdentifier romId = rodMapping.getReadoutModuleID(febId);
94 
95  return getRodIDFromROM(romId);
96 }

◆ getRodIDFromROM()

uint32_t Hid2RESrcID::getRodIDFromROM ( const COLLECTION_ID hid) const

make a ROD SrcID for a COLLECTION_ID

Definition at line 75 of file Hid2RESrcID.cxx.

76 { // this method returns a RESrcID for the ROD, for a given COLLECTION_ID
77 
78  COLL_MAP::const_iterator it = m_coll2ROD.find( id );
79  if(it == m_coll2ROD.end()){
80  std::cout <<" H2d2RESrcID invalid COLL ID in hex "<<std::hex<<id.get_compact()<<std::dec<<std::endl;
81  std::abort();
82  }
83 
84  return (*it).second ;
85 }

◆ getRosID()

uint32_t Hid2RESrcID::getRosID ( uint32_t  rob_id) const

Make a ROS Source ID from a ROB source ID.

mapping SrcID from ROB to ROS

Definition at line 108 of file Hid2RESrcID.cxx.

109 {
110 // Change Module Type to ROS, moduleid = 0
111 
112  SourceIdentifier id = SourceIdentifier(rob_id);
113  SourceIdentifier id2 = SourceIdentifier(id.subdetector_id(), 0);
114  return id2.code();
115 
116 }

◆ initialize() [1/2]

StatusCode Hid2RESrcID::initialize ( const LArFebRodMapping rodMapping)

Definition at line 38 of file Hid2RESrcID.cxx.

39 {
40  ATH_CHECK( initialize (rodMapping.getLArRoModIDvec()) );
41  return StatusCode::SUCCESS;
42 }

◆ initialize() [2/2]

StatusCode Hid2RESrcID::initialize ( const std::vector< HWIdentifier > &  roms)
private

Definition at line 45 of file Hid2RESrcID.cxx.

46 {
47  // retrieve onlineHelper
48  ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "Hid2RESrcID");
49  ATH_CHECK( detStore.retrieve() );
50  ATH_CHECK( detStore->retrieve(m_onlineHelper, "LArOnlineID") );
51 
52  // make internal maps
53 
54  eformat::SubDetector detid ;
55  for (const HWIdentifier& mId : roms)
56  {
57  detid = (eformat::SubDetector) m_readoutModuleSvc.subDet(mId);
59 
60  SourceIdentifier sid = SourceIdentifier(detid,m);
61  uint32_t rod_id = sid.code();
62 
63  assert( m_coll2ROD.count(mId) == 0 );
64  m_coll2ROD[ mId ]=rod_id;
65 
66  }
67 
68 
69  m_initialized = true ;
70 
71  return StatusCode::SUCCESS;
72 }

◆ isInitialized()

bool Hid2RESrcID::isInitialized ( ) const
inline

Definition at line 50 of file Hid2RESrcID.h.

50 { return m_initialized;}

Member Data Documentation

◆ m_coll2ROD

COLL_MAP Hid2RESrcID::m_coll2ROD
private

Definition at line 79 of file Hid2RESrcID.h.

◆ m_initialized

bool Hid2RESrcID::m_initialized
private

Definition at line 76 of file Hid2RESrcID.h.

◆ m_onlineHelper

const LArOnlineID* Hid2RESrcID::m_onlineHelper
private

Definition at line 77 of file Hid2RESrcID.h.

◆ m_readoutModuleSvc

LArReadoutModuleService Hid2RESrcID::m_readoutModuleSvc
private

Definition at line 80 of file Hid2RESrcID.h.

◆ m_rodRobIdMap

RodRobIdMap Hid2RESrcID::m_rodRobIdMap
private

Definition at line 81 of file Hid2RESrcID.h.


The documentation for this class was generated from the following files:
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
LArFebRodMapping::getReadoutModuleID
HWIdentifier getReadoutModuleID(const HWIdentifier &id) const
Definition: LArFebRodMapping.cxx:15
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
LArReadoutModuleService::subDet
static int subDet(const HWIdentifier &id)
return sub-detector identifier
Definition: LArReadoutModuleService.cxx:162
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
RodRobIdMap::getRobID
uint32_t getRobID(uint32_t rod_id) const
Make a ROB Source ID from a ROD source ID.
Definition: RodRobIdMap.cxx:18
LArReadoutModuleService::rodFragId
static int rodFragId(const HWIdentifier &id)
return ROD fragment identifier ( == ROL == ROB identifier )
Definition: LArReadoutModuleService.cxx:211
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Hid2RESrcID::m_initialized
bool m_initialized
Definition: Hid2RESrcID.h:76
HWIdentifier
Definition: HWIdentifier.h:13
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:562
Hid2RESrcID::initialize
StatusCode initialize(const LArFebRodMapping &rodMapping)
Definition: Hid2RESrcID.cxx:38
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArOnlineID_Base::feb_Id
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
Definition: LArOnlineID_Base.cxx:1479
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
LArFebRodMapping::getLArRoModIDvec
const std::vector< HWIdentifier > & getLArRoModIDvec() const
"iterator" on LArReadoutModuleIDs
Definition: LArFebRodMapping.h:46
Hid2RESrcID::getRodIDFromROM
uint32_t getRodIDFromROM(const COLLECTION_ID &hid) const
make a ROD SrcID for a COLLECTION_ID
Definition: Hid2RESrcID.cxx:75
Hid2RESrcID::m_coll2ROD
COLL_MAP m_coll2ROD
Definition: Hid2RESrcID.h:79
Hid2RESrcID::m_rodRobIdMap
RodRobIdMap m_rodRobIdMap
Definition: Hid2RESrcID.h:81
Hid2RESrcID::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: Hid2RESrcID.h:77
Hid2RESrcID::m_readoutModuleSvc
LArReadoutModuleService m_readoutModuleSvc
Definition: Hid2RESrcID.h:80
ServiceHandle< StoreGateSvc >