ATLAS Offline Software
Loading...
Searching...
No Matches
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
16
17// Make a ROD Source ID
18
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
30uint32_t ZdcSrcIdMap::getRobID(uint32_t rod_id)
31{
32 return rod_id;
33}
34
35// Make a ROS Source ID from a ROB source ID
36
37uint32_t ZdcSrcIdMap::getRosID(uint32_t rob_id)
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
46uint32_t ZdcSrcIdMap::getDetID(uint32_t ros_id)
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
55int ZdcSrcIdMap::crate(uint32_t code)
56{
57 eformat::helper::SourceIdentifier id(code);
58 return id.module_id() & 0xf;
59}
60
61// Return daqOrRoi from unpacked moduleID
62
63int ZdcSrcIdMap::daqOrRoi(uint32_t code)
64{
65 eformat::helper::SourceIdentifier id(code);
66 return (id.module_id() >> 7) & 0x1;
67}
68
69// Return slink from unpacked moduleID
70
71int ZdcSrcIdMap::slink(uint32_t code)
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
87eformat::SubDetector ZdcSrcIdMap::subDet(uint32_t code) {
88 eformat::helper::SourceIdentifier id(code);
89 return id.subdetector_id();
90}
91
HWIdentifier id2
ZdcSrcIdMap()
ZdcSrcId.
static uint32_t getRosID(uint32_t rob_id)
ROB -> ROS.
static eformat::SubDetector subDet(uint32_t code)
ID -> sub-detector.
static uint32_t getDetID(uint32_t ros_id)
ROS -> SubDetector.
static uint32_t getRobID(uint32_t rod_id)
ROD -> ROB.
static int crate(uint32_t code)
moduleID -> crate
static uint32_t getRodID(int crate, int slink, int daqOrRoi, eformat::SubDetector subdet)
Make a ROD Source ID.
static int maxSlinks()
Return the maximum possible number of slinks.
static int daqOrRoi(uint32_t code)
moduleID -> daqOrRoi
static int slink(uint32_t code)
moduleID -> slink