ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloByteStream
src
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
10
std::atomic<bool> L1CaloSrcIdMap::s_useSWROD =
false
;
11
12
L1CaloSrcIdMap::L1CaloSrcIdMap
()
13
{
14
}
15
16
// Make a ROD Source ID
17
18
uint32_t
L1CaloSrcIdMap::getRodID
(
int
crate
,
int
slink
,
int
daqOrRoi
,
19
eformat::SubDetector subdet)
const
20
{
21
// module ID = r0sscccc (ROD-spec-version1_06d, P33)
22
uint16_t moduleId = (
daqOrRoi
<< 7) | (
slink
<< 4) |
crate
;
23
if
(s_useSWROD && (
crate
== 6 ||
crate
== 7)) {
24
moduleId |= (0x1<<12);
25
}
26
eformat::helper::SourceIdentifier helpID(subdet, moduleId);
27
return
helpID.code();
28
}
29
30
// Make a ROB Source ID from a ROD source ID
31
32
uint32_t
L1CaloSrcIdMap::getRobID
(uint32_t rod_id)
const
33
{
34
return
rod_id;
35
}
36
37
// Make a ROS Source ID from a ROB source ID
38
39
uint32_t
L1CaloSrcIdMap::getRosID
(uint32_t rob_id)
const
40
{
41
eformat::helper::SourceIdentifier id(rob_id);
42
eformat::helper::SourceIdentifier id2(
id
.subdetector_id(), 0);
43
return
id2.code();
44
}
45
46
// Make a SubDetector ID from ROS source ID
47
48
uint32_t
L1CaloSrcIdMap::getDetID
(uint32_t ros_id)
const
49
{
50
eformat::helper::SourceIdentifier id(ros_id);
51
eformat::helper::SourceIdentifier id2(
id
.subdetector_id(), 0);
52
return
id2.code();
53
}
54
55
// Return crate from unpacked moduleID
56
57
int
L1CaloSrcIdMap::crate
(uint32_t code)
const
58
{
59
eformat::helper::SourceIdentifier id(code);
60
return
id
.module_id() & 0xf;
61
}
62
63
// Return daqOrRoi from unpacked moduleID
64
65
int
L1CaloSrcIdMap::daqOrRoi
(uint32_t code)
const
66
{
67
eformat::helper::SourceIdentifier id(code);
68
return
(
id
.module_id() >> 7) & 0x1;
69
}
70
71
// Return slink from unpacked moduleID
72
73
int
L1CaloSrcIdMap::slink
(uint32_t code)
const
74
{
75
eformat::helper::SourceIdentifier id(code);
76
return
(
id
.module_id() >> 4) & 0x3;
77
}
78
79
// Return the maximum possible number of slinks given number of
80
// bits in module ID
81
82
int
L1CaloSrcIdMap::maxSlinks
()
const
83
{
84
return
4;
85
}
86
87
// Return sub-detector for given ID
88
89
eformat::SubDetector
L1CaloSrcIdMap::subDet
(uint32_t code)
const
{
90
eformat::helper::SourceIdentifier id(code);
91
return
id
.subdetector_id();
92
}
93
94
}
// end namespace
L1CaloSrcIdMap.h
LVL1BS::L1CaloSrcIdMap::crate
int crate(uint32_t code) const
Return crate from unpacked moduleID.
Definition
L1CaloSrcIdMap.cxx:57
LVL1BS::L1CaloSrcIdMap::getRodID
uint32_t getRodID(int crate, int slink, int daqOrRoi, eformat::SubDetector subdet) const
Make a ROD Source ID.
Definition
L1CaloSrcIdMap.cxx:18
LVL1BS::L1CaloSrcIdMap::daqOrRoi
int daqOrRoi(uint32_t code) const
Return daqOrRoi from unpacked moduleID.
Definition
L1CaloSrcIdMap.cxx:65
LVL1BS::L1CaloSrcIdMap::getRobID
uint32_t getRobID(uint32_t rod_id) const
Make a ROB Source ID from a ROD source ID.
Definition
L1CaloSrcIdMap.cxx:32
LVL1BS::L1CaloSrcIdMap::L1CaloSrcIdMap
L1CaloSrcIdMap()
Definition
L1CaloSrcIdMap.cxx:12
LVL1BS::L1CaloSrcIdMap::subDet
eformat::SubDetector subDet(uint32_t code) const
Return sub-detector for given ID.
Definition
L1CaloSrcIdMap.cxx:89
LVL1BS::L1CaloSrcIdMap::slink
int slink(uint32_t code) const
Return slink from unpacked moduleID.
Definition
L1CaloSrcIdMap.cxx:73
LVL1BS::L1CaloSrcIdMap::maxSlinks
int maxSlinks() const
Return the maximum possible number of slinks.
Definition
L1CaloSrcIdMap.cxx:82
LVL1BS::L1CaloSrcIdMap::getRosID
uint32_t getRosID(uint32_t rob_id) const
Make a ROS Source ID from a ROB source ID.
Definition
L1CaloSrcIdMap.cxx:39
LVL1BS::L1CaloSrcIdMap::getDetID
uint32_t getDetID(uint32_t ros_id) const
Make a SubDetector ID from ROS source ID.
Definition
L1CaloSrcIdMap.cxx:48
LVL1BS
Definition
ZdcModifySlices.h:10
Generated on
for ATLAS Offline Software by
1.17.0