1#ifndef PACKING_ECONDEVENTPACKET_H
2#define PACKING_ECONDEVENTPACKET_H
9#include "Framework/Logger.h"
145 bool from(std::span<const uint32_t> data);
149 static const uint32_t HEADER_MARKER_CMS{0xf3 << 1};
162 ECONDLinkSubpacket& link)
const;
Single ECON-D event packet.
std::array< bool, N_CORRUPTION > corruption_
corruption flags indexed by Corruption
bool subpacket_error_
S: error in a link sub-packet.
uint32_t payload_length_
payload length in 32b words (not including the two header words)
std::vector< ECONDLinkSubpacket > links_
storage of unpacked link data
uint32_t ht_
H/T: status of HGCROC header/trailer reconstruction.
bool passthrough_
P: pass through mode.
bool match_
M: transmitted E/B/O matches the L1A FIFO.
bool truncated_
T: packet truncated for buffer overflow.
uint32_t reset_request_
RR: reset request.
bool isEmpty() const
payload length of zero, no link sub-packets
uint32_t header_marker_
9b header marker
bool isCorrupt() const
any of the corruption flags are set
Corruption
index of corruption flags
@ TRUNCATED
T flag set, link sub-packets not transmitted.
@ BAD_HEADER_CRC
8b header CRC mismatch
@ BAD_HEADER_MARKER
9b header marker is not the ECOND spec or common CMS config
@ BAD_PAYLOAD
link sub-packets do not fit or do not end at the CRC word
@ BAD_LENGTH
stored payload length does not equal packet length
@ BAD_CRC32
32b sub-packet CRC mismatch
@ N_CORRUPTION
number of corruption flags
enableLogging("ECONDEventPacket")
handle to logging source
std::size_t unpackLinkSubpacket(std::span< const uint32_t > data, ECONDLinkSubpacket &link) const
Unpack a eRx ("link") sub-packet.
bool from(std::span< const uint32_t > data)
parse into the packet from the passed data span
uint32_t hamming_
6b Hamming code of the header
uint32_t ebo_
E/B/O: status of event/BX/orbit reconstruction.
uint32_t crc8_
transmitted 8b header CRC
static const uint32_t HEADER_MARKER_SPEC
spec default and common CMS header markers (8b marker + 0)
uint32_t l1a_
6b L1A (event) number
bool expected_
E: HGCROC event header/trailer expected.
uint32_t bx_
bunch crossing
ECONDEventPacket(std::size_t n_links)
construct an event packet with the number of eRx "links"
uint32_t orbit_
3b orbit number
Data from a single eRx ("link") sub-packet of an ECON-D event packet.
bool error_caused_empty_
E flag of an empty sub-packet: suppressed due to unmasked Stat errors.
bool badStat() const
any of the three Stat bits are bad (not 1)
std::array< uint32_t, 36 > channels_
sample words of the 36 normal channels
uint32_t hamming_
3-bit Hamming code of the sub-packet header
uint32_t calib_
sample word of the calibration channel
int adc_cm1_
ADC readout of common mode 1.
uint64_t channel_map_
37-bit channel map (bit 18 is the calibration channel)
bool is_empty_
F flag: sub-packet is a single header word without channel data.
int adc_cm0_
ADC readout of common mode 0.
uint32_t stat_
3-bit Stat field (HT, EBO, CRC match), all ones is good