ATLAS Offline Software
ZdcSrcIdMap.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 
14 {
15 }
16 
17 // Make a ROD Source ID
18 
19 uint32_t ZdcSrcIdMap::getRodID(int crate, int slink, int daqOrRoi,
20  eformat::SubDetector subdet)
21 {
22  // module ID = r0sscccc (ROD-spec-version1_06d, P33)
23  uint16_t moduleId = (daqOrRoi << 7) | (slink << 4) | crate;
24  eformat::helper::SourceIdentifier helpID(subdet, moduleId);
25  return helpID.code();
26 }
27 
28 // Make a ROB Source ID from a ROD source ID
29 
31 {
32  return rod_id;
33 }
34 
35 // Make a ROS Source ID from a ROB source ID
36 
38 {
39  eformat::helper::SourceIdentifier id(rob_id);
40  eformat::helper::SourceIdentifier id2(id.subdetector_id(), 0);
41  return id2.code();
42 }
43 
44 // Make a SubDetector ID from ROS source ID
45 
47 {
48  eformat::helper::SourceIdentifier id(ros_id);
49  eformat::helper::SourceIdentifier id2(id.subdetector_id(), 0);
50  return id2.code();
51 }
52 
53 // Return crate from unpacked moduleID
54 
56 {
57  eformat::helper::SourceIdentifier id(code);
58  return id.module_id() & 0xf;
59 }
60 
61 // Return daqOrRoi from unpacked moduleID
62 
64 {
65  eformat::helper::SourceIdentifier id(code);
66  return (id.module_id() >> 7) & 0x1;
67 }
68 
69 // Return slink from unpacked moduleID
70 
72 {
73  eformat::helper::SourceIdentifier id(code);
74  return (id.module_id() >> 4) & 0x3;
75 }
76 
77 // Return the maximum possible number of slinks given number of
78 // bits in module ID
79 
81 {
82  return 4;
83 }
84 
85 // Return sub-detector for given ID
86 
87 eformat::SubDetector ZdcSrcIdMap::subDet(uint32_t code) {
88  eformat::helper::SourceIdentifier id(code);
89  return id.subdetector_id();
90 }
91 
ZdcSrcIdMap::crate
static int crate(uint32_t code)
moduleID -> crate
Definition: ZdcSrcIdMap.cxx:55
ZdcSrcIdMap::getRosID
static uint32_t getRosID(uint32_t rob_id)
ROB -> ROS.
Definition: ZdcSrcIdMap.cxx:37
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ZdcSrcIdMap::ZdcSrcIdMap
ZdcSrcIdMap()
ZdcSrcId.
Definition: ZdcSrcIdMap.cxx:13
ZdcSrcIdMap::getRobID
static uint32_t getRobID(uint32_t rod_id)
ROD -> ROB.
Definition: ZdcSrcIdMap.cxx:30
histSizes.code
code
Definition: histSizes.py:129
ZdcSrcIdMap::subDet
static eformat::SubDetector subDet(uint32_t code)
ID -> sub-detector.
Definition: ZdcSrcIdMap.cxx:87
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:562
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
ZdcSrcIdMap::daqOrRoi
static int daqOrRoi(uint32_t code)
moduleID -> daqOrRoi
Definition: ZdcSrcIdMap.cxx:63
ZdcSrcIdMap::maxSlinks
static int maxSlinks()
Return the maximum possible number of slinks.
Definition: ZdcSrcIdMap.cxx:80
ZdcSrcIdMap.h
ZdcSrcIdMap::slink
static int slink(uint32_t code)
moduleID -> slink
Definition: ZdcSrcIdMap.cxx:71
ZdcSrcIdMap::getDetID
static uint32_t getDetID(uint32_t ros_id)
ROS -> SubDetector.
Definition: ZdcSrcIdMap.cxx:46
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
ZdcSrcIdMap::getRodID
static uint32_t getRodID(int crate, int slink, int daqOrRoi, eformat::SubDetector subdet)
Make a ROD Source ID.
Definition: ZdcSrcIdMap.cxx:19