ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::nsw::NSWTriggerSTGL1AElink Class Reference

#include <NSWTriggerSTGL1AElink.h>

Inheritance diagram for Muon::nsw::NSWTriggerSTGL1AElink:
Collaboration diagram for Muon::nsw::NSWTriggerSTGL1AElink:

Classes

struct  DataHeader
 Helper struct to hold information of the header for each data chunk. More...

Public Member Functions

 NSWTriggerSTGL1AElink (const std::uint32_t *bs, std::uint32_t remaining)
virtual ~NSWTriggerSTGL1AElink ()=default
std::uint32_t head_fragID () const
std::uint32_t head_sectID () const
std::uint32_t head_EC () const
std::uint32_t head_flags () const
std::uint32_t head_BCID () const
std::uint32_t head_orbit () const
std::uint32_t head_spare () const
std::uint32_t L1ID () const
std::uint32_t l1a_versionID () const
std::uint32_t l1a_local_req_BCID () const
std::uint32_t l1a_local_rel_BCID () const
std::uint32_t l1a_open_BCID () const
std::uint32_t l1a_req_BCID () const
std::uint32_t l1a_close_BCID () const
std::uint32_t l1a_timeout () const
std::uint32_t head_overflowCount () const
std::uint32_t l1a_open_BCID_offset () const
std::uint32_t l1a_req_BCID_offset () const
std::uint32_t l1a_close_BCID_offset () const
std::uint32_t l1a_timeout_config () const
std::uint32_t l1a_busy_thr () const
std::uint32_t l1a_engine_snapshot () const
std::uint32_t l1a_link_const () const
std::uint32_t l1a_padding () const
std::uint32_t head_wdw_matching_engines_usage () const
const std::vector< std::uint32_t > & stream_head_nbits () const
const std::vector< std::uint32_t > & stream_head_nwords () const
const std::vector< std::uint32_t > & stream_head_fifo_size () const
const std::vector< std::uint32_t > & stream_head_streamID () const
const std::vector< std::vector< std::vector< std::uint32_t > > > & stream_data () const
std::uint32_t trailer_CRC () const
const std::vector< STGTPPadPacket > & pad_packets () const
const std::vector< STGTPSegmentPacket > & segment_packet () const
const std::vector< STGTPMMPacket > & mm_packet () const
const std::vector< STGTPStripPacket > & strip_packet () const
unsigned int nwords () const
unsigned int nwordsFlx () const
unsigned int status () const
bool suspect () const
uint32_t elinkWord () const
const std::shared_ptr< Muon::nsw::NSWResourceId > & elinkId () const

Protected Attributes

unsigned int m_wordCount {}
unsigned int m_wordCountFlx {}
unsigned int m_packet_status {}
bool m_packet_sus {}
uint32_t m_elinkWord {}
std::shared_ptr< Muon::nsw::NSWResourceIdm_elinkId

Private Member Functions

int parse_version_workaround (std::size_t &readPointer)
 parse version workaround
void decode_header (std::size_t &readPointer, int &version)
 Decode the header.
void decode_header_v3 (std::size_t &readPointer, int &version)
void decode_data (std::size_t &readPointer, int version)
 Decode the pad and segment data.
void decode_data_v3 (std::size_t &readPointer, int version)
DataHeader decode_data_header (std::size_t &readPointer, int version)
 Decode the header of each data segment.
DataHeader decode_data_header_v3 (std::size_t &readPointer, int version)
std::vector< std::vector< std::uint32_t > > decode_data_payload (std::size_t &readPointer, const DataHeader &header, int version) const
 Decode the payload of each data segment.
std::vector< std::vector< std::uint32_t > > decode_data_payload_v3 (std::size_t &readPointer, const DataHeader &header, int version) const
void analyze_data (int version)
 Analyze data chunks and create decoded objects.
void analyze_data_v3 (int version)
void decode_trailer (std::size_t &readPointer)
 Decode the trailer.
std::uint64_t decode (std::size_t &readPointer, std::size_t size) const
 Decode a value.
std::uint64_t decode_v3 (std::size_t &readPointer, std::size_t size) const

Static Private Member Functions

static std::uint64_t correct_size_for_padding (std::uint64_t initial)

Private Attributes

std::span< const std::uint32_t > m_data
std::uint32_t m_head_fragID {}
std::uint32_t m_head_sectID {}
std::uint32_t m_head_EC {}
std::uint32_t m_head_flags {}
std::uint32_t m_head_BCID {}
std::uint32_t m_head_orbit {}
std::uint32_t m_head_spare {}
std::uint32_t m_L1ID {}
std::uint32_t m_l1a_versionID {}
std::uint32_t m_l1a_local_req_BCID {}
std::uint32_t m_l1a_local_rel_BCID {}
std::uint32_t m_l1a_open_BCID {}
std::uint32_t m_l1a_req_BCID {}
std::uint32_t m_l1a_close_BCID {}
std::uint32_t m_l1a_timeout {}
std::uint32_t m_l1a_open_BCID_offset {}
std::uint32_t m_l1a_req_BCID_offset {}
std::uint32_t m_l1a_close_BCID_offset {}
std::uint32_t m_l1a_timeout_config {}
std::uint32_t m_l1a_busy_thr {}
std::uint32_t m_l1a_engine_snapshot {}
std::uint32_t m_l1a_link_const {}
std::uint32_t m_l1a_padding {}
std::uint32_t m_l1a_wdw_matching_engines_usage {}
std::vector< std::uint32_t > m_stream_head_nbits
std::vector< std::uint32_t > m_stream_head_nwords
std::vector< std::uint32_t > m_stream_head_fifo_size
std::vector< std::uint32_t > m_stream_head_streamID
std::vector< std::vector< std::vector< std::uint32_t > > > m_stream_data
std::uint32_t m_trailer_CRC {}
std::vector< STGTPPadPacketm_pad_packets
std::vector< STGTPSegmentPacketm_segment_packets
std::vector< STGTPMMPacketm_mm_packets
std::vector< STGTPStripPacketm_strip_packets
int m_packet_version

Static Private Attributes

static constexpr auto WORD_SIZE = sizeof(decltype(m_data)::element_type) * 8
static constexpr auto WORD_SIZE_DOUBLE = static_cast<double>(WORD_SIZE)

Detailed Description

Definition at line 14 of file NSWTriggerSTGL1AElink.h.

Constructor & Destructor Documentation

◆ NSWTriggerSTGL1AElink()

Muon::nsw::NSWTriggerSTGL1AElink::NSWTriggerSTGL1AElink ( const std::uint32_t * bs,
std::uint32_t remaining )

Definition at line 16 of file NSWTriggerSTGL1AElink.cxx.

17 : NSWTriggerElink(bs, remaining), m_data{bs, remaining} {
18 // TODO: once format finalized, checking a minimum size
19
20 // 2 felix header 32b words already decoded;
21 constexpr static auto START_DATA = std::size_t{2 * 32};
22 auto readPointer = std::size_t{START_DATA};
23
25 decode_header(readPointer, m_packet_version);
26 decode_data(readPointer, m_packet_version);
27 decode_trailer(readPointer);
28}

◆ ~NSWTriggerSTGL1AElink()

virtual Muon::nsw::NSWTriggerSTGL1AElink::~NSWTriggerSTGL1AElink ( )
virtualdefault

Member Function Documentation

◆ analyze_data()

void Muon::nsw::NSWTriggerSTGL1AElink::analyze_data ( int version)
private

Analyze data chunks and create decoded objects.

Definition at line 364 of file NSWTriggerSTGL1AElink.cxx.

364 {
365 if (version >= 3){
366 return analyze_data_v3(version);
367 }
368
369 size_t word_size = WORD_SIZE_DOUBLE;
370 auto counterChunk = std::size_t{0};
371 for (const auto& dataChunk : m_stream_data) {
372 for (const auto& dataWord : dataChunk) {
373 const auto expectedSize =
374 static_cast<std::size_t>(std::ceil(m_stream_head_nbits.at(counterChunk) / word_size));
375 if (std::size(dataWord) != expectedSize) {
376 throw std::length_error(Muon::nsw::format("Stream data size {} does not match expected number of messages {}",
377 std::size(dataWord), expectedSize));
378 }
379 switch (m_stream_head_streamID.at(counterChunk)) {
381 m_pad_packets.emplace_back(dataWord,version);
382 break;
384 m_segment_packets.emplace_back(dataWord,version);
385 break;
387 m_strip_packets.emplace_back(dataWord,version);
388 break;
389 default:
390 throw std::runtime_error(Muon::nsw::format("Invalid stream type {}", m_stream_head_streamID.at(counterChunk)));
391 }
392 }
393 ++counterChunk;
394 }
395}
constexpr std::size_t pad_stream_header
std::string format(const std::string &str, const T &arg)

◆ analyze_data_v3()

void Muon::nsw::NSWTriggerSTGL1AElink::analyze_data_v3 ( int version)
private

Definition at line 330 of file NSWTriggerSTGL1AElink.cxx.

330 {
331
332 size_t word_size = WORD_SIZE_DOUBLE;
333 auto counterChunk = std::size_t{0};
334 for (const auto& dataChunk : m_stream_data) {
335 for (const auto& dataWord : dataChunk) {
336 const auto expectedSize =
337 static_cast<std::size_t>(std::ceil(m_stream_head_nbits.at(counterChunk) / word_size));
338 if (std::size(dataWord) != expectedSize) {
339 throw std::length_error(Muon::nsw::format("Stream data size {} does not match expected number of messages {}",
340 std::size(dataWord), expectedSize));
341 }
342 switch (m_stream_head_streamID.at(counterChunk)) {
344 m_pad_packets.emplace_back(dataWord,version);
345 break;
347 m_segment_packets.emplace_back(dataWord,version);
348 break;
350 m_mm_packets.emplace_back(dataWord,version);
351 break;
353 m_strip_packets.emplace_back(dataWord,version);
354 break;
355 default:
356 throw std::runtime_error(Muon::nsw::format("Invalid stream type {}", m_stream_head_streamID.at(counterChunk)));
357 }
358 }
359 ++counterChunk;
360 }
361
362}

◆ correct_size_for_padding()

std::uint64_t Muon::nsw::NSWTriggerSTGL1AElink::correct_size_for_padding ( std::uint64_t initial)
staticnodiscardprivate

Definition at line 397 of file NSWTriggerSTGL1AElink.cxx.

397 {
398 static constexpr auto PADDING = 16;
399 if (initial % PADDING) {
400 return ((initial + PADDING - 1) / PADDING) * PADDING;
401 } else {
402 return initial;
403 }
404}
@ initial
this is just the initial step we do, nothing really happens here
Definition ManagerStep.h:45

◆ decode()

std::uint64_t Muon::nsw::NSWTriggerSTGL1AElink::decode ( std::size_t & readPointer,
std::size_t size ) const
nodiscardprivate

Decode a value.

Parameters
readPointerCurrent read pointer position (updated by function)
sizeSize of the value to be decoded
Returns
std::uint64_t Decoded value

Definition at line 326 of file NSWTriggerSTGL1AElink.cxx.

326 {
328}
constexpr Target decode_and_advance(const std::span< const Source > words, std::size_t &start, const std::size_t size)
Decode bits from data of words and advance the read pointer.

◆ decode_data()

void Muon::nsw::NSWTriggerSTGL1AElink::decode_data ( std::size_t & readPointer,
int version )
private

Decode the pad and segment data.

Parameters
readPointerCurrent read pointer position (updated by function)

Definition at line 146 of file NSWTriggerSTGL1AElink.cxx.

146 {
147 if (version == 3)
148 {
149 return decode_data_v3(readPointer, version);
150 }
151 auto PADDING_BITS_END = std::size_t{16};
152
153 const auto endOfData = m_wordCountFlx * WORD_SIZE - Muon::nsw::STGTPL1A::size_trailer_CRC - PADDING_BITS_END;
154 while (readPointer < endOfData) {
155 static constexpr auto SIZE_DATA_HEADER = STGTPL1A::size_stream_head_nbits + STGTPL1A::size_stream_head_nwords +
157 if (readPointer + SIZE_DATA_HEADER > endOfData) {
158 throw std::length_error(
159 Muon::nsw::format("Read pointer ({}) would excede memory dedicated to data chunks ({}) while parsing the header (size: {})",
160 readPointer, endOfData, SIZE_DATA_HEADER));
161 }
162 const auto header_data = decode_data_header(readPointer, version);
163
164 if (header_data.total_expected_size > m_wordCountFlx - ceil(readPointer / WORD_SIZE ) + 1) {
165 throw std::length_error(Muon::nsw::format("STG TP stream size {} larger than expected packet size {}",
166 header_data.total_expected_size,
167 m_wordCountFlx - ceil(readPointer / WORD_SIZE ) + 1));
168 }
169 if (header_data.nwords * header_data.data_size + readPointer > endOfData) {
170 throw std::length_error(Muon::nsw::format("Requested to decode {} bits but only {} bits are remaining",
171 header_data.nwords * header_data.data_size, endOfData - readPointer));
172 }
173
174 m_stream_data.push_back(decode_data_payload(readPointer, header_data, version));
175 }
176 analyze_data(version);
177}
constexpr int size_stream_head_fifo_size
constexpr int size_stream_head_streamID
constexpr int size_stream_head_nwords
constexpr int size_stream_head_nbits

◆ decode_data_header()

Muon::nsw::NSWTriggerSTGL1AElink::DataHeader Muon::nsw::NSWTriggerSTGL1AElink::decode_data_header ( std::size_t & readPointer,
int version )
private

Decode the header of each data segment.

Contains information about type, number of words and bits per word

Parameters
readPointerCurrent read pointer position (updated by function)
Returns
DataHeader Information from header

Definition at line 249 of file NSWTriggerSTGL1AElink.cxx.

250 {
251 if (version >= 3){
252 return decode_data_header_v3(readPointer, version);
253 }
254 const auto current_stream_head_nbits = decode(readPointer, STGTPL1A::size_stream_head_nbits);
255 const auto current_stream_head_nwords = decode(readPointer, STGTPL1A::size_stream_head_nwords);
256 const auto current_stream_head_fifo_size = decode(readPointer, STGTPL1A::size_stream_head_fifo_size);
257 const auto current_stream_head_streamID = decode(readPointer, STGTPL1A::size_stream_head_streamID);
258
259 // zero padding to multiples of 16bits - TP logic - this is the real number
260 // of bits to read
261 const auto corrected_current_stream_head_nbits = correct_size_for_padding(current_stream_head_nbits);
262
263 m_stream_head_nbits.push_back(corrected_current_stream_head_nbits);
264 m_stream_head_nwords.push_back(current_stream_head_nwords);
265 m_stream_head_fifo_size.push_back(current_stream_head_fifo_size);
266 m_stream_head_streamID.push_back(current_stream_head_streamID);
267
268 size_t word_size = WORD_SIZE_DOUBLE;
269 const auto data_size = static_cast<std::size_t>(std::ceil(corrected_current_stream_head_nbits / word_size));
270 const auto total_expected_size = data_size * current_stream_head_nwords;
271
272 ERS_DEBUG(2, Muon::nsw::format("stream_head_nbits: {}", corrected_current_stream_head_nbits));
273 ERS_DEBUG(2, Muon::nsw::format("stream_head_nwords: {}", current_stream_head_nwords));
274 ERS_DEBUG(2, Muon::nsw::format("stream_head_fifo_size: {}", current_stream_head_fifo_size));
275 ERS_DEBUG(2, Muon::nsw::format("stream_head_streamID: {}", current_stream_head_streamID));
276 ERS_DEBUG(2, Muon::nsw::format("total_expected_size: {}", data_size * current_stream_head_nwords));
277 ERS_DEBUG(2, Muon::nsw::format("m_wordCountFlx: {}, ceil(readPointer/{}): {}", m_wordCountFlx, word_size,
278 ceil(readPointer / word_size)));
279
280 return {corrected_current_stream_head_nbits, current_stream_head_nwords, current_stream_head_fifo_size,
281 current_stream_head_streamID, total_expected_size, data_size};
282}

◆ decode_data_header_v3()

Muon::nsw::NSWTriggerSTGL1AElink::DataHeader Muon::nsw::NSWTriggerSTGL1AElink::decode_data_header_v3 ( std::size_t & readPointer,
int version )
private

Definition at line 179 of file NSWTriggerSTGL1AElink.cxx.

180 {
181
182
183 if (version != 3){
184 throw std::invalid_argument("decode_data_header_v3 version should be exactly 3");
185 }
186
187 size_t felix_word_size = WORD_SIZE_DOUBLE;
188 auto PADDING_BITS_END = std::size_t{16};
191 const auto current_stream_head_fifo_size = decode(readPointer, STGTPL1A::size_stream_head_fifo_size);
192 const auto current_stream_head_streamID = decode(readPointer, STGTPL1A::size_stream_head_streamID);
193 const auto total_expected_size = stream_head_nbits * stream_head_nwords;
194 auto endOfData = m_wordCountFlx * felix_word_size - Muon::nsw::STGTPL1A::size_trailer_CRC - PADDING_BITS_END;
195 size_t current_stream_head_nbits = 0;
196 size_t current_stream_head_nwords = 0;
197
198 switch (current_stream_head_streamID)
199 {
201 current_stream_head_nbits = STGTPPad::size_v3;
202 break;
204 current_stream_head_nbits = STGTPSegments::size_v3;
205 break;
207 current_stream_head_nbits = STGTPMMData::size_v3;
208 break;
209 default:
210 break;
211 }
212
213 if (current_stream_head_nbits == 0 )
214 {
215 throw std::runtime_error( "Corrupted message - sTGC stream has an unrecognized stream header");
216 }
217
218 if (readPointer + total_expected_size > endOfData)
219 {
220 throw std::runtime_error("Corrupted message - sTGC expected size goes beyond the end of data");
221 }
222
223 current_stream_head_nwords = (stream_head_nwords == 0) ? 0 : total_expected_size / current_stream_head_nbits;
224 size_t data_size = std::ceil(total_expected_size / felix_word_size);
225
226 // in version 3 nbits correspond to either 16 or 32 bits. There is a stable packet size that we use and
227 // we extract it from the code. The 16 or 32 bits is a consequence of an optimization in the firmware that
228 // results in big gains wrt routing and resources
229 m_stream_head_nbits.push_back(current_stream_head_nbits);
230 m_stream_head_nwords.push_back(current_stream_head_nwords);
231 m_stream_head_fifo_size.push_back(current_stream_head_fifo_size);
232 m_stream_head_streamID.push_back(current_stream_head_streamID);
233
234
235
236 ERS_DEBUG(2, Muon::nsw::format("stream_head_nbits: {}", current_stream_head_nbits));
237 ERS_DEBUG(2, Muon::nsw::format("stream_head_nwords: {}", current_stream_head_nwords));
238 ERS_DEBUG(2, Muon::nsw::format("stream_head_fifo_size: {}", current_stream_head_fifo_size));
239 ERS_DEBUG(2, Muon::nsw::format("stream_head_streamID: {}", current_stream_head_streamID));
240 ERS_DEBUG(2, Muon::nsw::format("total_expected_size: {}", total_expected_size));
241 ERS_DEBUG(2, Muon::nsw::format("m_wordCountFlx: {}, ceil(readPointer/{}): {}", m_wordCountFlx,felix_word_size,
242 ceil(readPointer / felix_word_size)));
243
244
245 return {current_stream_head_nbits, current_stream_head_nwords, current_stream_head_fifo_size,
246 current_stream_head_streamID, total_expected_size, data_size};
247}
constexpr std::size_t size_v3
constexpr std::size_t size_v3
constexpr std::size_t size_v3

◆ decode_data_payload()

std::vector< std::vector< std::uint32_t > > Muon::nsw::NSWTriggerSTGL1AElink::decode_data_payload ( std::size_t & readPointer,
const DataHeader & header,
int version ) const
nodiscardprivate

Decode the payload of each data segment.

Contains actual data from pad or segments

Parameters
readPointerCurrent read pointer position (updated by function)
headerInformation from data header
Returns
DataHeader Information from header

Definition at line 303 of file NSWTriggerSTGL1AElink.cxx.

304 {
305 std::vector<std::vector<std::uint32_t>> current_stream_data{};
306
307 if (version >= 3)
308 return decode_data_payload_v3( readPointer, header, version);
309 size_t word_size = WORD_SIZE;
310 for (std::size_t i = 0; i < header.nwords; ++i) {
311 std::vector<std::uint32_t> data{};
312 for (std::size_t j = 0; j < header.data_size; ++j) {
313 data.push_back(decode(readPointer, word_size));
314 }
315 current_stream_data.push_back(std::move(data));
316 }
317 return current_stream_data;
318
319}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ decode_data_payload_v3()

std::vector< std::vector< std::uint32_t > > Muon::nsw::NSWTriggerSTGL1AElink::decode_data_payload_v3 ( std::size_t & readPointer,
const DataHeader & header,
int version ) const
nodiscardprivate

Definition at line 284 of file NSWTriggerSTGL1AElink.cxx.

285 {
286 std::vector<std::vector<std::uint32_t>> current_stream_data{};
287
288 if (version < 3){
289 throw std::invalid_argument("decode_data_header_v3 version should be at least 3");
290 }
291
292 size_t word_size = WORD_SIZE;
293 size_t felix_n_words = (header.nwords == 0 ) ? 0 : std::ceil(header.data_size / header.nwords); // the number of felix words per stream word
294 for (std::size_t i = 0; i < header.nwords; ++i) {
295 std::vector<std::uint32_t> data{};
296 for (std::size_t j = 0; j < felix_n_words; ++j) {
297 data.push_back(decode(readPointer, word_size));
298 }
299 current_stream_data.push_back(std::move(data));
300 }
301 return current_stream_data;
302}

◆ decode_data_v3()

void Muon::nsw::NSWTriggerSTGL1AElink::decode_data_v3 ( std::size_t & readPointer,
int version )
private

Definition at line 116 of file NSWTriggerSTGL1AElink.cxx.

116 {
117
118 auto PADDING_BITS_END = std::size_t{16};
119
120
121 const auto endOfData = m_wordCountFlx * WORD_SIZE - Muon::nsw::STGTPL1A::size_trailer_CRC - PADDING_BITS_END;
122
123 while (readPointer < endOfData) {
124 static constexpr auto SIZE_DATA_HEADER = STGTPL1A::size_stream_head_nbits + STGTPL1A::size_stream_head_nwords +
126 if (readPointer + SIZE_DATA_HEADER > endOfData) {
127 throw std::length_error(
128 Muon::nsw::format("Read pointer ({}) would excede memory dedicated to data chunks ({}) while parsing the header (size: {})",
129 readPointer, endOfData, SIZE_DATA_HEADER));
130 }
131 const auto header_data = decode_data_header_v3(readPointer, version);
132 if (header_data.total_expected_size > m_wordCountFlx * WORD_SIZE - readPointer + 1) {
133 throw std::length_error(Muon::nsw::format("STG TP stream size {} larger than expected packet size {}",
134 header_data.total_expected_size,
135 m_wordCountFlx * WORD_SIZE - readPointer + 1));
136 }
137 if (header_data.nwords * header_data.data_size + readPointer > endOfData) {
138 throw std::length_error(Muon::nsw::format("Requested to decode {} bits but only {} bits are remaining",
139 header_data.nwords * header_data.data_size, endOfData - readPointer));
140 }
141 m_stream_data.push_back(decode_data_payload_v3(readPointer, header_data, version));
142 }
143 analyze_data_v3(version);
144}

◆ decode_header()

void Muon::nsw::NSWTriggerSTGL1AElink::decode_header ( std::size_t & readPointer,
int & version )
private

Decode the header.

Parameters
readPointerCurrent read pointer position (updated by function)

Definition at line 30 of file NSWTriggerSTGL1AElink.cxx.

30 {
31
32 // This part is constant for all versions
41
42 ERS_DEBUG(2, Muon::nsw::format("\n TP header: \n"
43 " fradID: {}\n"
44 " sectID: {}\n"
45 " EC: {}\n"
46 " flags: {}\n"
47 " BCID: {}\n"
48 " orbit: {}\n"
49 " spare: {}\n"
50 " L1ID: {}",
52
53 if (version == 1)
54 {
65
67 }
68 else
69 {
71 if (m_l1a_versionID == 1)
72 {
73 version = 2;
74 }
75 else if (m_l1a_versionID == 3)
76 {
78 }
79 else
80 {
81 Muon::nsw::NSWTriggerException e ( Muon::nsw::format( "Stgc packet version not existent (corrupted message) expected 3, got ({})", m_l1a_versionID));
82 throw e;
83
84 }
99 }
100
101}
constexpr int size_l1a_open_BCID_offset
constexpr int size_l1a_link_const
constexpr int size_l1a_local_req_BCID
constexpr int size_l1a_close_BCID_offset
constexpr int size_l1a_local_rel_BCID
constexpr int size_l1a_timeout_config
constexpr int size_l1a_engine_snapshot
constexpr int size_l1a_req_BCID_offset
constexpr int size_l1a_close_BCID
constexpr int size_l1a_wdw_matching_engines_usage

◆ decode_header_v3()

void Muon::nsw::NSWTriggerSTGL1AElink::decode_header_v3 ( std::size_t & readPointer,
int & version )
private

◆ decode_trailer()

void Muon::nsw::NSWTriggerSTGL1AElink::decode_trailer ( std::size_t & readPointer)
private

Decode the trailer.

Parameters
readPointerCurrent read pointer position (updated by function)

Definition at line 321 of file NSWTriggerSTGL1AElink.cxx.

321 {
322 // TODO: warning: how the swROD is behaving if the last work is a uint16 only? Just 0-padding?
324}

◆ decode_v3()

std::uint64_t Muon::nsw::NSWTriggerSTGL1AElink::decode_v3 ( std::size_t & readPointer,
std::size_t size ) const
nodiscardprivate

◆ elinkId()

const std::shared_ptr< Muon::nsw::NSWResourceId > & Muon::nsw::NSWTriggerElink::elinkId ( ) const
inlineinherited

Definition at line 63 of file NSWTriggerElink.h.

63{return m_elinkId;};

◆ elinkWord()

uint32_t Muon::nsw::NSWTriggerElink::elinkWord ( ) const
inlineinherited

Definition at line 62 of file NSWTriggerElink.h.

62{return m_elinkWord;};

◆ head_BCID()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::head_BCID ( ) const
inline

Definition at line 23 of file NSWTriggerSTGL1AElink.h.

23{ return m_head_BCID; };

◆ head_EC()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::head_EC ( ) const
inline

Definition at line 21 of file NSWTriggerSTGL1AElink.h.

21{ return m_head_EC; };

◆ head_flags()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::head_flags ( ) const
inline

Definition at line 22 of file NSWTriggerSTGL1AElink.h.

22{ return m_head_flags; };

◆ head_fragID()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::head_fragID ( ) const
inline

Definition at line 19 of file NSWTriggerSTGL1AElink.h.

19{ return m_head_fragID; };

◆ head_orbit()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::head_orbit ( ) const
inline

Definition at line 24 of file NSWTriggerSTGL1AElink.h.

24{ return m_head_orbit; };

◆ head_overflowCount()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::head_overflowCount ( ) const
inline

Definition at line 35 of file NSWTriggerSTGL1AElink.h.

35{return m_l1a_timeout;}; // compatibility version 1

◆ head_sectID()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::head_sectID ( ) const
inline

Definition at line 20 of file NSWTriggerSTGL1AElink.h.

20{ return m_head_sectID; };

◆ head_spare()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::head_spare ( ) const
inline

Definition at line 25 of file NSWTriggerSTGL1AElink.h.

25{ return m_head_spare; };

◆ head_wdw_matching_engines_usage()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::head_wdw_matching_engines_usage ( ) const
inline

Definition at line 45 of file NSWTriggerSTGL1AElink.h.

◆ l1a_busy_thr()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_busy_thr ( ) const
inline

Definition at line 40 of file NSWTriggerSTGL1AElink.h.

40{return m_l1a_busy_thr;};

◆ l1a_close_BCID()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_close_BCID ( ) const
inline

Definition at line 33 of file NSWTriggerSTGL1AElink.h.

33{return m_l1a_close_BCID;};

◆ l1a_close_BCID_offset()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_close_BCID_offset ( ) const
inline

Definition at line 38 of file NSWTriggerSTGL1AElink.h.

◆ l1a_engine_snapshot()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_engine_snapshot ( ) const
inline

Definition at line 41 of file NSWTriggerSTGL1AElink.h.

41{return m_l1a_engine_snapshot;};

◆ l1a_link_const()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_link_const ( ) const
inline

Definition at line 42 of file NSWTriggerSTGL1AElink.h.

42{return m_l1a_link_const;};

◆ l1a_local_rel_BCID()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_local_rel_BCID ( ) const
inline

Definition at line 30 of file NSWTriggerSTGL1AElink.h.

30{return m_l1a_local_rel_BCID;};

◆ l1a_local_req_BCID()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_local_req_BCID ( ) const
inline

Definition at line 29 of file NSWTriggerSTGL1AElink.h.

29{return m_l1a_local_req_BCID;};

◆ l1a_open_BCID()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_open_BCID ( ) const
inline

Definition at line 31 of file NSWTriggerSTGL1AElink.h.

31{return m_l1a_open_BCID;};

◆ l1a_open_BCID_offset()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_open_BCID_offset ( ) const
inline

Definition at line 36 of file NSWTriggerSTGL1AElink.h.

◆ l1a_padding()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_padding ( ) const
inline

Definition at line 43 of file NSWTriggerSTGL1AElink.h.

43{return m_l1a_padding;};

◆ l1a_req_BCID()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_req_BCID ( ) const
inline

Definition at line 32 of file NSWTriggerSTGL1AElink.h.

32{return m_l1a_req_BCID;};

◆ l1a_req_BCID_offset()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_req_BCID_offset ( ) const
inline

Definition at line 37 of file NSWTriggerSTGL1AElink.h.

37{return m_l1a_req_BCID_offset;};

◆ l1a_timeout()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_timeout ( ) const
inline

Definition at line 34 of file NSWTriggerSTGL1AElink.h.

34{return m_l1a_timeout;};

◆ l1a_timeout_config()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_timeout_config ( ) const
inline

Definition at line 39 of file NSWTriggerSTGL1AElink.h.

39{return m_l1a_timeout_config;};

◆ l1a_versionID()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::l1a_versionID ( ) const
inline

Definition at line 28 of file NSWTriggerSTGL1AElink.h.

28{return m_l1a_versionID;};

◆ L1ID()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::L1ID ( ) const
inline

Definition at line 26 of file NSWTriggerSTGL1AElink.h.

26{ return m_L1ID; };

◆ mm_packet()

const std::vector< STGTPMMPacket > & Muon::nsw::NSWTriggerSTGL1AElink::mm_packet ( ) const
inline

Definition at line 56 of file NSWTriggerSTGL1AElink.h.

56{ return m_mm_packets; };

◆ nwords()

unsigned int Muon::nsw::NSWTriggerElink::nwords ( ) const
inlineinherited

Definition at line 55 of file NSWTriggerElink.h.

55{return m_wordCount;}; //self counted or expected in case it will be possible

◆ nwordsFlx()

unsigned int Muon::nsw::NSWTriggerElink::nwordsFlx ( ) const
inlineinherited

Definition at line 56 of file NSWTriggerElink.h.

56{return m_wordCountFlx;}; //reading from packet felix header

◆ pad_packets()

const std::vector< STGTPPadPacket > & Muon::nsw::NSWTriggerSTGL1AElink::pad_packets ( ) const
inline

Definition at line 54 of file NSWTriggerSTGL1AElink.h.

54{ return m_pad_packets; };

◆ parse_version_workaround()

int Muon::nsw::NSWTriggerSTGL1AElink::parse_version_workaround ( std::size_t & readPointer)
private

parse version workaround

Parameters
std::size_t&readPointer
Returns
version

Definition at line 103 of file NSWTriggerSTGL1AElink.cxx.

104{
107
108 if (anchor == anchor_value)
109 {
110 return 1;
111 }
112
113 return -1;
114}
constexpr uint32_t version1_anchor_value
constexpr int loc_version1_anchor
constexpr Target decode_at_loc(const std::span< const Source > words, std::size_t &start, const int offset, const std::size_t size)
Decode bits from data of words at read pointer + offset and NOT advance the read pointer.

◆ segment_packet()

const std::vector< STGTPSegmentPacket > & Muon::nsw::NSWTriggerSTGL1AElink::segment_packet ( ) const
inline

Definition at line 55 of file NSWTriggerSTGL1AElink.h.

55{ return m_segment_packets; };

◆ status()

unsigned int Muon::nsw::NSWTriggerElink::status ( ) const
inlineinherited

Definition at line 57 of file NSWTriggerElink.h.

57{return m_packet_status;}; //felix status

◆ stream_data()

const std::vector< std::vector< std::vector< std::uint32_t > > > & Muon::nsw::NSWTriggerSTGL1AElink::stream_data ( ) const
inline

Definition at line 51 of file NSWTriggerSTGL1AElink.h.

51{ return m_stream_data; };

◆ stream_head_fifo_size()

const std::vector< std::uint32_t > & Muon::nsw::NSWTriggerSTGL1AElink::stream_head_fifo_size ( ) const
inline

Definition at line 49 of file NSWTriggerSTGL1AElink.h.

49{ return m_stream_head_fifo_size; };

◆ stream_head_nbits()

const std::vector< std::uint32_t > & Muon::nsw::NSWTriggerSTGL1AElink::stream_head_nbits ( ) const
inline

Definition at line 47 of file NSWTriggerSTGL1AElink.h.

47{ return m_stream_head_nbits; };

◆ stream_head_nwords()

const std::vector< std::uint32_t > & Muon::nsw::NSWTriggerSTGL1AElink::stream_head_nwords ( ) const
inline

Definition at line 48 of file NSWTriggerSTGL1AElink.h.

48{ return m_stream_head_nwords; };

◆ stream_head_streamID()

const std::vector< std::uint32_t > & Muon::nsw::NSWTriggerSTGL1AElink::stream_head_streamID ( ) const
inline

Definition at line 50 of file NSWTriggerSTGL1AElink.h.

50{ return m_stream_head_streamID; };

◆ strip_packet()

const std::vector< STGTPStripPacket > & Muon::nsw::NSWTriggerSTGL1AElink::strip_packet ( ) const
inline

Definition at line 57 of file NSWTriggerSTGL1AElink.h.

57{ return m_strip_packets; };

◆ suspect()

bool Muon::nsw::NSWTriggerElink::suspect ( ) const
inlineinherited

Definition at line 58 of file NSWTriggerElink.h.

58{return m_packet_sus;}; //elink decoded but with triggering suspects

◆ trailer_CRC()

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::trailer_CRC ( ) const
inline

Definition at line 52 of file NSWTriggerSTGL1AElink.h.

52{ return m_trailer_CRC; };

Member Data Documentation

◆ m_data

std::span<const std::uint32_t> Muon::nsw::NSWTriggerSTGL1AElink::m_data
private

Definition at line 145 of file NSWTriggerSTGL1AElink.h.

◆ m_elinkId

std::shared_ptr<Muon::nsw::NSWResourceId> Muon::nsw::NSWTriggerElink::m_elinkId
protectedinherited

Definition at line 73 of file NSWTriggerElink.h.

◆ m_elinkWord

uint32_t Muon::nsw::NSWTriggerElink::m_elinkWord {}
protectedinherited

Definition at line 72 of file NSWTriggerElink.h.

72{};

◆ m_head_BCID

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_head_BCID {}
private

Definition at line 153 of file NSWTriggerSTGL1AElink.h.

153{};

◆ m_head_EC

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_head_EC {}
private

Definition at line 151 of file NSWTriggerSTGL1AElink.h.

151{};

◆ m_head_flags

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_head_flags {}
private

Definition at line 152 of file NSWTriggerSTGL1AElink.h.

152{};

◆ m_head_fragID

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_head_fragID {}
private

Definition at line 149 of file NSWTriggerSTGL1AElink.h.

149{};

◆ m_head_orbit

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_head_orbit {}
private

Definition at line 154 of file NSWTriggerSTGL1AElink.h.

154{};

◆ m_head_sectID

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_head_sectID {}
private

Definition at line 150 of file NSWTriggerSTGL1AElink.h.

150{};

◆ m_head_spare

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_head_spare {}
private

Definition at line 155 of file NSWTriggerSTGL1AElink.h.

155{};

◆ m_l1a_busy_thr

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_busy_thr {}
private

Definition at line 171 of file NSWTriggerSTGL1AElink.h.

171{};

◆ m_l1a_close_BCID

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_close_BCID {}
private

Definition at line 165 of file NSWTriggerSTGL1AElink.h.

165{};

◆ m_l1a_close_BCID_offset

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_close_BCID_offset {}
private

Definition at line 169 of file NSWTriggerSTGL1AElink.h.

169{};

◆ m_l1a_engine_snapshot

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_engine_snapshot {}
private

Definition at line 172 of file NSWTriggerSTGL1AElink.h.

172{};

◆ m_l1a_link_const

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_link_const {}
private

Definition at line 173 of file NSWTriggerSTGL1AElink.h.

173{};

◆ m_l1a_local_rel_BCID

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_local_rel_BCID {}
private

Definition at line 162 of file NSWTriggerSTGL1AElink.h.

162{};

◆ m_l1a_local_req_BCID

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_local_req_BCID {}
private

Definition at line 161 of file NSWTriggerSTGL1AElink.h.

161{};

◆ m_l1a_open_BCID

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_open_BCID {}
private

Definition at line 163 of file NSWTriggerSTGL1AElink.h.

163{};

◆ m_l1a_open_BCID_offset

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_open_BCID_offset {}
private

Definition at line 167 of file NSWTriggerSTGL1AElink.h.

167{};

◆ m_l1a_padding

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_padding {}
private

Definition at line 174 of file NSWTriggerSTGL1AElink.h.

174{};

◆ m_l1a_req_BCID

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_req_BCID {}
private

Definition at line 164 of file NSWTriggerSTGL1AElink.h.

164{};

◆ m_l1a_req_BCID_offset

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_req_BCID_offset {}
private

Definition at line 168 of file NSWTriggerSTGL1AElink.h.

168{};

◆ m_l1a_timeout

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_timeout {}
private

Definition at line 166 of file NSWTriggerSTGL1AElink.h.

166{};

◆ m_l1a_timeout_config

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_timeout_config {}
private

Definition at line 170 of file NSWTriggerSTGL1AElink.h.

170{};

◆ m_l1a_versionID

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_versionID {}
private

Definition at line 160 of file NSWTriggerSTGL1AElink.h.

160{};

◆ m_l1a_wdw_matching_engines_usage

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_l1a_wdw_matching_engines_usage {}
private

Definition at line 176 of file NSWTriggerSTGL1AElink.h.

176{};

◆ m_L1ID

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_L1ID {}
private

Definition at line 157 of file NSWTriggerSTGL1AElink.h.

157{};

◆ m_mm_packets

std::vector<STGTPMMPacket> Muon::nsw::NSWTriggerSTGL1AElink::m_mm_packets
private

Definition at line 190 of file NSWTriggerSTGL1AElink.h.

◆ m_packet_status

unsigned int Muon::nsw::NSWTriggerElink::m_packet_status {}
protectedinherited

Definition at line 68 of file NSWTriggerElink.h.

68{};

◆ m_packet_sus

bool Muon::nsw::NSWTriggerElink::m_packet_sus {}
protectedinherited

Definition at line 69 of file NSWTriggerElink.h.

69{};

◆ m_packet_version

int Muon::nsw::NSWTriggerSTGL1AElink::m_packet_version
private

Definition at line 193 of file NSWTriggerSTGL1AElink.h.

◆ m_pad_packets

std::vector<STGTPPadPacket> Muon::nsw::NSWTriggerSTGL1AElink::m_pad_packets
private

Definition at line 188 of file NSWTriggerSTGL1AElink.h.

◆ m_segment_packets

std::vector<STGTPSegmentPacket> Muon::nsw::NSWTriggerSTGL1AElink::m_segment_packets
private

Definition at line 189 of file NSWTriggerSTGL1AElink.h.

◆ m_stream_data

std::vector<std::vector<std::vector<std::uint32_t> > > Muon::nsw::NSWTriggerSTGL1AElink::m_stream_data
private

Definition at line 182 of file NSWTriggerSTGL1AElink.h.

◆ m_stream_head_fifo_size

std::vector<std::uint32_t> Muon::nsw::NSWTriggerSTGL1AElink::m_stream_head_fifo_size
private

Definition at line 180 of file NSWTriggerSTGL1AElink.h.

◆ m_stream_head_nbits

std::vector<std::uint32_t> Muon::nsw::NSWTriggerSTGL1AElink::m_stream_head_nbits
private

Definition at line 178 of file NSWTriggerSTGL1AElink.h.

◆ m_stream_head_nwords

std::vector<std::uint32_t> Muon::nsw::NSWTriggerSTGL1AElink::m_stream_head_nwords
private

Definition at line 179 of file NSWTriggerSTGL1AElink.h.

◆ m_stream_head_streamID

std::vector<std::uint32_t> Muon::nsw::NSWTriggerSTGL1AElink::m_stream_head_streamID
private

Definition at line 181 of file NSWTriggerSTGL1AElink.h.

◆ m_strip_packets

std::vector<STGTPStripPacket> Muon::nsw::NSWTriggerSTGL1AElink::m_strip_packets
private

Definition at line 191 of file NSWTriggerSTGL1AElink.h.

◆ m_trailer_CRC

std::uint32_t Muon::nsw::NSWTriggerSTGL1AElink::m_trailer_CRC {}
private

Definition at line 186 of file NSWTriggerSTGL1AElink.h.

186{};

◆ m_wordCount

unsigned int Muon::nsw::NSWTriggerElink::m_wordCount {}
protectedinherited

Definition at line 66 of file NSWTriggerElink.h.

66{};

◆ m_wordCountFlx

unsigned int Muon::nsw::NSWTriggerElink::m_wordCountFlx {}
protectedinherited

Definition at line 67 of file NSWTriggerElink.h.

67{};

◆ WORD_SIZE

auto Muon::nsw::NSWTriggerSTGL1AElink::WORD_SIZE = sizeof(decltype(m_data)::element_type) * 8
staticconstexprprivate

Definition at line 146 of file NSWTriggerSTGL1AElink.h.

◆ WORD_SIZE_DOUBLE

auto Muon::nsw::NSWTriggerSTGL1AElink::WORD_SIZE_DOUBLE = static_cast<double>(WORD_SIZE)
staticconstexprprivate

Definition at line 147 of file NSWTriggerSTGL1AElink.h.


The documentation for this class was generated from the following files: