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

#include <CSC_Hid2RESrcID.h>

Collaboration diagram for CSC_Hid2RESrcID:

Public Member Functions

 CSC_Hid2RESrcID ()
 default constrcutor you must then use the set method to set the cabling service and the id helper More...
 
 CSC_Hid2RESrcID (CSCcablingSvc *p_cabling, const CscIdHelper *cscId)
 the full constructor More...
 
 ~CSC_Hid2RESrcID ()=default
 destructor More...
 
void set (CSCcablingSvc *p_cabling, const CscIdHelper *cscId)
 initialize the identifier helper More...
 
void set_isCosmic ()
 this is cosmic data More...
 
void set_isOldCosmic ()
 to read the old cosmic data before the ROB id = ROD id fix More...
 
uint32_t getRodID (const CscRawDataCollection *rdo) const
 Make a ROD Source ID for CSC RDO. More...
 
uint32_t getRodID (uint16_t subId, uint16_t rodId) const
 get source ID for a RDO More...
 
uint32_t getRodID (const Identifier &offlineId) const
 Make a ROD Source ID for CscDigitCollection. 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...
 
const std::vector< uint32_t > & allRobIds () const
 return all the ROB IDs More...
 

Private Member Functions

void fillAllRobIds ()
 fill all the ROB ids More...
 

Private Attributes

bool m_isCosmic
 
bool m_isOldCosmic
 
CSCcablingSvcm_cabling
 
const CscIdHelperm_cscIdHelper
 
std::vector< uint32_t > m_robIDs
 

Detailed Description

Definition at line 24 of file CSC_Hid2RESrcID.h.

Constructor & Destructor Documentation

◆ CSC_Hid2RESrcID() [1/2]

CSC_Hid2RESrcID::CSC_Hid2RESrcID ( )
inline

default constrcutor you must then use the set method to set the cabling service and the id helper

Definition at line 29 of file CSC_Hid2RESrcID.h.

29  {
30  m_cabling = nullptr;
31  m_cscIdHelper = nullptr;
32  m_isCosmic = false;
33  m_isOldCosmic = false;
34  m_robIDs.clear();
35  }

◆ CSC_Hid2RESrcID() [2/2]

CSC_Hid2RESrcID::CSC_Hid2RESrcID ( CSCcablingSvc p_cabling,
const CscIdHelper cscId 
)
inline

the full constructor

Definition at line 39 of file CSC_Hid2RESrcID.h.

39 { this->set(p_cabling, cscId); }

◆ ~CSC_Hid2RESrcID()

CSC_Hid2RESrcID::~CSC_Hid2RESrcID ( )
default

destructor

Member Function Documentation

◆ allRobIds()

const std::vector<uint32_t>& CSC_Hid2RESrcID::allRobIds ( ) const
inline

return all the ROB IDs

Definition at line 85 of file CSC_Hid2RESrcID.h.

85 { return m_robIDs; }

◆ fillAllRobIds()

void CSC_Hid2RESrcID::fillAllRobIds ( )
private

fill all the ROB ids

fill all the ROB IDs

Definition at line 63 of file CSC_Hid2RESrcID.cxx.

63  {
64  uint16_t sub_detector[] = {eformat::MUON_CSC_ENDCAP_C_SIDE, eformat::MUON_CSC_ENDCAP_A_SIDE};
65 
66  m_robIDs.clear();
67 
68  for (uint16_t i = 0; i < m_cabling->nSide(); ++i) {
69  uint16_t rodId = (m_cabling->nROD() == 8) ? 0 : 16;
70  // for (uint16_t rodId=0; rodId<m_cabling->nROD(); ++rodId) {
71  for (unsigned int j = 0; j < m_cabling->nROD(); ++j) {
72  uint16_t onlineRodId = 0x0;
73  bool check = m_cabling->onlineId(rodId, onlineRodId);
74  assert(check);
75  if (!check) onlineRodId = 0xFFFF;
76  uint32_t theROD = this->getRodID(sub_detector[i], onlineRodId);
77 
78  if (m_isCosmic) {
79  int jj = i * 8 + rodId;
80  if (jj == 8)
81  theROD = 0x0069000a;
82  else if (jj == 9)
83  theROD = 0x0069000c;
84  }
85 
86  uint32_t theROB = this->getRobID(theROD);
87 
88  m_robIDs.push_back(theROB);
89  ++rodId;
90  }
91  }
92 }

◆ getDetID()

uint32_t CSC_Hid2RESrcID::getDetID ( uint32_t  ros_id) const

Make a SubDetector ID from ROS source ID.

mapping SrcID from ROS to Det

Definition at line 105 of file CSC_Hid2RESrcID.cxx.

105  {
106  // ROS to DET
107  SourceIdentifier id(ros_id);
108  SourceIdentifier id2(id.subdetector_id(), 0);
109 
110  // return Source ID
111  return id2.code();
112 }

◆ getRobID()

uint32_t CSC_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 49 of file CSC_Hid2RESrcID.cxx.

49  {
50  uint32_t rob_id = rod_id;
51 
52  if (m_isCosmic && m_isOldCosmic) {
53  if (rod_id == 0x0069000a)
54  rob_id = 0x0;
55  else if (rod_id == 0x0069000c)
56  rob_id = 0x1;
57  }
58 
59  return rob_id;
60 }

◆ getRodID() [1/3]

uint32_t CSC_Hid2RESrcID::getRodID ( const CscRawDataCollection rdo) const

Make a ROD Source ID for CSC RDO.

get source ID for a RDO

Definition at line 16 of file CSC_Hid2RESrcID.cxx.

16  {
17  uint16_t rodId = rdo->rodId();
18  uint16_t subDetectorId = rdo->subDetectorId();
19 
20  return this->getRodID(subDetectorId, rodId);
21 }

◆ getRodID() [2/3]

uint32_t CSC_Hid2RESrcID::getRodID ( const Identifier offlineId) const

Make a ROD Source ID for CscDigitCollection.

get source ID for a CscRdoCollection

Definition at line 35 of file CSC_Hid2RESrcID.cxx.

35  {
36  int eta = m_cscIdHelper->stationEta(offlineId);
37  int phi = m_cscIdHelper->stationPhi(offlineId);
38  uint16_t subDetectorId = (eta == -1) ? eformat::MUON_CSC_ENDCAP_C_SIDE : eformat::MUON_CSC_ENDCAP_A_SIDE;
39  uint16_t rodId = uint16_t(phi - 1);
40  // if(offlineId >= 0x10 && offlineId <= 0x1F) rodId = 0x10 +
41  uint16_t onlineRodId = 0x0;
42  bool check = m_cabling->onlineId(rodId, onlineRodId);
43  assert(check);
44  if (!check) onlineRodId = 0xFFFF;
45  return this->getRodID(subDetectorId, onlineRodId);
46 }

◆ getRodID() [3/3]

uint32_t CSC_Hid2RESrcID::getRodID ( uint16_t  subId,
uint16_t  rodId 
) const

get source ID for a RDO

Definition at line 24 of file CSC_Hid2RESrcID.cxx.

24  {
25  // get Source ID
26  assert(subDetectorId == eformat::MUON_CSC_ENDCAP_C_SIDE || subDetectorId == eformat::MUON_CSC_ENDCAP_A_SIDE);
27 
28  assert(m_cabling->is_rodId(rodId));
29 
30  SourceIdentifier sid(static_cast<eformat::SubDetector>(subDetectorId), static_cast<uint16_t>(rodId));
31  return sid.code();
32 }

◆ getRosID()

uint32_t CSC_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 95 of file CSC_Hid2RESrcID.cxx.

95  {
96  // Change Module Type to ROS, moduleid = 0
97  SourceIdentifier id(rob_id);
98  SourceIdentifier id2(id.subdetector_id(), 0);
99 
100  // return Source ID
101  return id2.code();
102 }

◆ set()

void CSC_Hid2RESrcID::set ( CSCcablingSvc p_cabling,
const CscIdHelper cscId 
)
inline

initialize the identifier helper

Definition at line 48 of file CSC_Hid2RESrcID.h.

48  {
49  m_cabling = p_cabling;
50  m_cscIdHelper = cscId;
51  m_isCosmic = false;
52  m_isOldCosmic = false;
53  this->fillAllRobIds();
54  }

◆ set_isCosmic()

void CSC_Hid2RESrcID::set_isCosmic ( )
inline

this is cosmic data

Definition at line 57 of file CSC_Hid2RESrcID.h.

57 { m_isCosmic = true; }

◆ set_isOldCosmic()

void CSC_Hid2RESrcID::set_isOldCosmic ( )
inline

to read the old cosmic data before the ROB id = ROD id fix

Definition at line 60 of file CSC_Hid2RESrcID.h.

60 { m_isOldCosmic = true; }

Member Data Documentation

◆ m_cabling

CSCcablingSvc* CSC_Hid2RESrcID::m_cabling
private

Definition at line 94 of file CSC_Hid2RESrcID.h.

◆ m_cscIdHelper

const CscIdHelper* CSC_Hid2RESrcID::m_cscIdHelper
private

Definition at line 95 of file CSC_Hid2RESrcID.h.

◆ m_isCosmic

bool CSC_Hid2RESrcID::m_isCosmic
private

Definition at line 92 of file CSC_Hid2RESrcID.h.

◆ m_isOldCosmic

bool CSC_Hid2RESrcID::m_isOldCosmic
private

Definition at line 93 of file CSC_Hid2RESrcID.h.

◆ m_robIDs

std::vector<uint32_t> CSC_Hid2RESrcID::m_robIDs
private

Definition at line 96 of file CSC_Hid2RESrcID.h.


The documentation for this class was generated from the following files:
CSC_Hid2RESrcID::m_robIDs
std::vector< uint32_t > m_robIDs
Definition: CSC_Hid2RESrcID.h:96
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CSC_Hid2RESrcID::getRodID
uint32_t getRodID(const CscRawDataCollection *rdo) const
Make a ROD Source ID for CSC RDO.
Definition: CSC_Hid2RESrcID.cxx:16
CSCcablingSvc::nSide
unsigned int nSide() const
Definition: CSCcablingSvc.h:50
CSCcablingSvc::onlineId
bool onlineId(const uint16_t subdetectorID, const uint16_t offlineID, uint32_t &rodId) const
map offline ROD identifier to online ID
Definition: CSCcablingSvc.cxx:74
CSC_Hid2RESrcID::getRobID
uint32_t getRobID(uint32_t rod_id) const
Make a ROB Source ID from a ROD source ID.
Definition: CSC_Hid2RESrcID.cxx:49
CSCcablingSvc::nROD
unsigned int nROD() const
Definition: CSCcablingSvc.h:51
CSCcablingSvc::is_rodId
bool is_rodId(const uint16_t rodId) const
check that we have the correct online ROD id
Definition: CSCcablingSvc.cxx:177
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:562
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
CSC_Hid2RESrcID::m_isOldCosmic
bool m_isOldCosmic
Definition: CSC_Hid2RESrcID.h:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
CscRawDataCollection::rodId
uint16_t rodId() const
Definition: CscRawDataCollection.h:112
CSC_Hid2RESrcID::m_cscIdHelper
const CscIdHelper * m_cscIdHelper
Definition: CSC_Hid2RESrcID.h:95
CSC_Hid2RESrcID::m_isCosmic
bool m_isCosmic
Definition: CSC_Hid2RESrcID.h:92
MuonIdHelper::stationPhi
int stationPhi(const Identifier &id) const
Definition: MuonIdHelper.cxx:810
CSC_Hid2RESrcID::fillAllRobIds
void fillAllRobIds()
fill all the ROB ids
Definition: CSC_Hid2RESrcID.cxx:63
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition: MuonIdHelper.cxx:805
LArNewCalib_Delay_OFC_Cali.check
check
Definition: LArNewCalib_Delay_OFC_Cali.py:267
CSC_Hid2RESrcID::set
void set(CSCcablingSvc *p_cabling, const CscIdHelper *cscId)
initialize the identifier helper
Definition: CSC_Hid2RESrcID.h:48
createCablingJSON.sub_detector
int sub_detector
Definition: createCablingJSON.py:17
CscRawDataCollection::subDetectorId
uint16_t subDetectorId() const
Definition: CscRawDataCollection.h:113
CSC_Hid2RESrcID::m_cabling
CSCcablingSvc * m_cabling
Definition: CSC_Hid2RESrcID.h:94