ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/RODHeader.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef TRIGT1CALO_RODHEADER_H
5#define TRIGT1CALO_RODHEADER_H
6
7#include <stdint.h>
8#include <vector>
9
10namespace LVL1 {
11
16
17class RODHeader {
18
19 public:
20
21 RODHeader() = default;
22 RODHeader(uint32_t version, uint32_t sourceId, uint32_t run,
23 uint32_t lvl1Id, uint32_t bcId, uint32_t trigType,
24 uint32_t detType, const std::vector<uint32_t>& statusWords,
25 uint32_t nData);
26
27
28 // Header data
29 int version() const;
30 int majorVersion() const;
31 int minorVersion() const;
32 int sourceID() const;
33 int subDetectorID() const;
34 int moduleID() const;
35 int crate() const;
36 int sLink() const;
37 int dataType() const;
38 int run() const;
39 int runType() const;
40 int runNumber() const;
41 int extendedL1ID() const;
42 int ecrID() const;
43 int l1ID() const;
44 int bunchCrossing() const;
45 int l1TriggerType() const;
46 int detEventType() const;
47 int orbitCount() const;
48 int stepNumber() const;
49 int stepType() const;
50
51 // Status bits - word 1
52 bool bcnMismatch() const;
53 bool gLinkTimeout() const;
54 bool dataTransportError() const;
55 bool rodFifoOverflow() const;
56 bool lvdsLinkError() const;
57 bool cmmParityError() const;
58 bool gLinkError() const;
59 // Status bits - word 2
60 bool limitedRoISet() const;
61 bool triggerTypeTimeout() const;
62
63 // Status words
64 const std::vector<uint32_t>& statusWords() const;
65
66 // Payload
67 int payloadSize() const;
68
69 private:
70
71 uint32_t m_version{};
72 uint32_t m_sourceId{};
73 uint32_t m_run{};
74 uint32_t m_lvl1Id{};
75 uint32_t m_bcId{};
76 uint32_t m_trigType{};
77 uint32_t m_detType{};
78 std::vector<uint32_t> m_statusWords{0};
79 uint32_t m_payloadSize{};
80
81};
82
83inline int RODHeader::version() const
84{
85 return m_version;
86}
87
88inline int RODHeader::majorVersion() const
89{
90 return (m_version >> 16) & 0xffff;
91}
92
93inline int RODHeader::minorVersion() const
94{
95 return m_version & 0xffff;
96}
97
98inline int RODHeader::sourceID() const
99{
100 return m_sourceId;
101}
102
103inline int RODHeader::subDetectorID() const
104{
105 return (m_sourceId >> 16) & 0xff;
106}
107
108inline int RODHeader::moduleID() const
109{
110 return m_sourceId & 0xffff;
111}
112
113inline int RODHeader::crate() const
114{
115 return m_sourceId & 0xf;
116}
117
118inline int RODHeader::sLink() const
119{
120 return (m_sourceId >> 4) & 0x3;
121}
122
123inline int RODHeader::dataType() const
124{
125 return (m_sourceId >> 7) & 0x1;
126}
127
128inline int RODHeader::run() const
129{
130 return m_run;
131}
132
133inline int RODHeader::runType() const
134{
135 return (m_run >> 24) & 0xff;
136}
137
138inline int RODHeader::runNumber() const
139{
140 return m_run & 0xffffff;
141}
142
143inline int RODHeader::extendedL1ID() const
144{
145 return m_lvl1Id;
146}
147
148inline int RODHeader::ecrID() const
149{
150 return (m_lvl1Id >> 24) & 0xff;
151}
152
153inline int RODHeader::l1ID() const
154{
155 return m_lvl1Id & 0xffffff;
156}
157
158inline int RODHeader::bunchCrossing() const
159{
160 return m_bcId;
161}
162
163inline int RODHeader::l1TriggerType() const
164{
165 return m_trigType;
166}
167
168inline int RODHeader::detEventType() const
169{
170 return m_detType;
171}
172
173inline int RODHeader::orbitCount() const
174{
175 return (m_detType >> 16) & 0xffff;
176}
177
178inline int RODHeader::stepNumber() const
179{
180 return (m_detType >> 4) & 0xfff;
181}
182
183inline int RODHeader::stepType() const
184{
185 return m_detType & 0xf;
186}
187
188inline bool RODHeader::bcnMismatch() const
189{
190 return (m_statusWords.empty()) ? false : m_statusWords[0] & 0x1;
191}
192
193inline bool RODHeader::gLinkTimeout() const
194{
195 return (m_statusWords.empty()) ? false : m_statusWords[0] & 0x4;
196}
197
199{
200 return (m_statusWords.empty()) ? false : m_statusWords[0] & 0x8;
201}
202
203inline bool RODHeader::rodFifoOverflow() const
204{
205 return (m_statusWords.empty()) ? false : m_statusWords[0] & 0x10;
206}
207
208inline bool RODHeader::lvdsLinkError() const
209{
210 return (m_statusWords.empty()) ? false : m_statusWords[0] & 0x10000;
211}
212
213inline bool RODHeader::cmmParityError() const
214{
215 return (m_statusWords.empty()) ? false : m_statusWords[0] & 0x20000;
216}
217
218inline bool RODHeader::gLinkError() const
219{
220 return (m_statusWords.empty()) ? false : m_statusWords[0] & 0x40000;
221}
222
223inline bool RODHeader::limitedRoISet() const
224{
225 return (m_statusWords.size() < 2) ? false : m_statusWords[1] & 0x2;
226}
227
229{
230 return (m_statusWords.size() < 2) ? false : m_statusWords[1] & 0x10000;
231}
232
233inline const std::vector<uint32_t>& RODHeader::statusWords() const
234{
235 return m_statusWords;
236}
237
238inline int RODHeader::payloadSize() const
239{
240 return m_payloadSize;
241}
242
243} // end namespace
244
245#ifndef RODHeader_ClassDEF_H
247#endif
248
249#endif
uint16_t bcId(uint32_t data)
const std::vector< uint32_t > & statusWords() const
RODHeader()=default
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition run.py:1