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