|
LDMX Software
|
Single ECON-D event packet. More...
#include <ECONDEventPacket.h>
Public Types | |
| enum | Corruption : std::size_t { BAD_HEADER_MARKER = 0 , BAD_LENGTH = 1 , BAD_HEADER_CRC = 2 , BAD_CRC32 = 3 , BAD_PAYLOAD = 4 , TRUNCATED = 5 , N_CORRUPTION = 6 } |
| index of corruption flags More... | |
Public Member Functions | |
| ECONDEventPacket (std::size_t n_links) | |
| construct an event packet with the number of eRx "links" | |
| bool | isEmpty () const |
| payload length of zero, no link sub-packets | |
| bool | isCorrupt () const |
| any of the corruption flags are set | |
| bool | from (std::span< const uint32_t > data) |
| parse into the packet from the passed data span | |
Public Attributes | |
| std::array< bool, N_CORRUPTION > | corruption_ {} |
| corruption flags indexed by Corruption | |
| uint32_t | header_marker_ {0} |
| 9b header marker | |
| uint32_t | payload_length_ {0} |
| payload length in 32b words (not including the two header words) | |
| bool | passthrough_ {false} |
| P: pass through mode. | |
| bool | expected_ {false} |
| E: HGCROC event header/trailer expected. | |
| uint32_t | ht_ {0} |
| H/T: status of HGCROC header/trailer reconstruction. | |
| uint32_t | ebo_ {0} |
| E/B/O: status of event/BX/orbit reconstruction. | |
| bool | match_ {false} |
| M: transmitted E/B/O matches the L1A FIFO. | |
| bool | truncated_ {false} |
| T: packet truncated for buffer overflow. | |
| uint32_t | hamming_ {0} |
| 6b Hamming code of the header | |
| uint32_t | bx_ {0} |
| bunch crossing | |
| uint32_t | l1a_ {0} |
| 6b L1A (event) number | |
| uint32_t | orbit_ {0} |
| 3b orbit number | |
| bool | subpacket_error_ {false} |
| S: error in a link sub-packet. | |
| uint32_t | reset_request_ {0} |
| RR: reset request. | |
| uint32_t | crc8_ {0} |
| transmitted 8b header CRC | |
| std::vector< ECONDLinkSubpacket > | links_ |
| storage of unpacked link data | |
Static Public Attributes | |
| static const uint32_t | HEADER_MARKER_SPEC {0xaa << 1} |
| spec default and common CMS header markers (8b marker + 0) | |
| static const uint32_t | HEADER_MARKER_CMS {0xf3 << 1} |
Private Member Functions | |
| std::size_t | unpackLinkSubpacket (std::span< const uint32_t > data, ECONDLinkSubpacket &link) const |
| Unpack a eRx ("link") sub-packet. | |
| enableLogging ("ECONDEventPacket") | |
| handle to logging source | |
Single ECON-D event packet.
The ECON-D is the CONcentrator mezzanine for the Data path and it has many different configuration modes. The two most important to us for decoding are
The format is described in Section 18 of the ECON-D specification (ECON-D_specification_working_doc_v1.4_5jan2023.pdf).
Definition at line 64 of file ECONDEventPacket.h.
| enum packing::ECONDEventPacket::Corruption : std::size_t |
index of corruption flags
Definition at line 67 of file ECONDEventPacket.h.
|
explicit |
construct an event packet with the number of eRx "links"
Definition at line 214 of file ECONDEventPacket.cxx.
| bool packing::ECONDEventPacket::from | ( | std::span< const uint32_t > | data | ) |
parse into the packet from the passed data span
The span should start at the first ECON-D header word and contain the full packet (as given by the DAQ capture header length). This function never reads outside of the span. On corruption, the corresponding flag is set and parsing stops early.
Definition at line 221 of file ECONDEventPacket.cxx.
References BAD_CRC32, BAD_HEADER_CRC, BAD_HEADER_MARKER, BAD_LENGTH, BAD_PAYLOAD, bx_, corruption_, crc8_, ebo_, expected_, hamming_, header_marker_, HEADER_MARKER_SPEC, ht_, isCorrupt(), isEmpty(), l1a_, links_, match_, orbit_, passthrough_, payload_length_, reset_request_, subpacket_error_, TRUNCATED, truncated_, and unpackLinkSubpacket().
| bool packing::ECONDEventPacket::isCorrupt | ( | ) | const |
any of the corruption flags are set
Definition at line 216 of file ECONDEventPacket.cxx.
References corruption_.
Referenced by from().
|
inline |
payload length of zero, no link sub-packets
Definition at line 130 of file ECONDEventPacket.h.
References payload_length_.
Referenced by from().
|
private |
Unpack a eRx ("link") sub-packet.
| [in] | data | words from the start of the sub-packet to the CRC word (not included) |
| [out] | link | sub-packet to update with unpacked data |
Definition at line 37 of file ECONDEventPacket.cxx.
References packing::ECONDLinkSubpacket::adc_cm0_, packing::ECONDLinkSubpacket::adc_cm1_, packing::ECONDLinkSubpacket::badStat(), packing::ECONDLinkSubpacket::calib_, packing::ECONDLinkSubpacket::channel_map_, packing::ECONDLinkSubpacket::channels_, packing::ECONDLinkSubpacket::error_caused_empty_, packing::ECONDLinkSubpacket::hamming_, packing::ECONDLinkSubpacket::is_empty_, passthrough_, and packing::ECONDLinkSubpacket::stat_.
Referenced by from().
| uint32_t packing::ECONDEventPacket::bx_ {0} |
| std::array<bool, N_CORRUPTION> packing::ECONDEventPacket::corruption_ {} |
corruption flags indexed by Corruption
Definition at line 85 of file ECONDEventPacket.h.
Referenced by from(), and isCorrupt().
| uint32_t packing::ECONDEventPacket::crc8_ {0} |
transmitted 8b header CRC
Definition at line 116 of file ECONDEventPacket.h.
Referenced by from().
| uint32_t packing::ECONDEventPacket::ebo_ {0} |
E/B/O: status of event/BX/orbit reconstruction.
Definition at line 98 of file ECONDEventPacket.h.
Referenced by from().
| bool packing::ECONDEventPacket::expected_ {false} |
E: HGCROC event header/trailer expected.
Definition at line 94 of file ECONDEventPacket.h.
Referenced by from().
| uint32_t packing::ECONDEventPacket::hamming_ {0} |
6b Hamming code of the header
Definition at line 104 of file ECONDEventPacket.h.
Referenced by from().
| uint32_t packing::ECONDEventPacket::header_marker_ {0} |
|
static |
Definition at line 149 of file ECONDEventPacket.h.
|
static |
spec default and common CMS header markers (8b marker + 0)
Definition at line 148 of file ECONDEventPacket.h.
Referenced by from().
| uint32_t packing::ECONDEventPacket::ht_ {0} |
H/T: status of HGCROC header/trailer reconstruction.
Definition at line 96 of file ECONDEventPacket.h.
Referenced by from().
| uint32_t packing::ECONDEventPacket::l1a_ {0} |
6b L1A (event) number
Definition at line 108 of file ECONDEventPacket.h.
Referenced by from().
| std::vector<ECONDLinkSubpacket> packing::ECONDEventPacket::links_ |
storage of unpacked link data
This is very space in-efficient since we store zero words for any channel or measurement that was zero suppressed.
Definition at line 124 of file ECONDEventPacket.h.
Referenced by from().
| bool packing::ECONDEventPacket::match_ {false} |
M: transmitted E/B/O matches the L1A FIFO.
Definition at line 100 of file ECONDEventPacket.h.
Referenced by from().
| uint32_t packing::ECONDEventPacket::orbit_ {0} |
| bool packing::ECONDEventPacket::passthrough_ {false} |
P: pass through mode.
Definition at line 92 of file ECONDEventPacket.h.
Referenced by from(), and unpackLinkSubpacket().
| uint32_t packing::ECONDEventPacket::payload_length_ {0} |
payload length in 32b words (not including the two header words)
Definition at line 90 of file ECONDEventPacket.h.
| uint32_t packing::ECONDEventPacket::reset_request_ {0} |
| bool packing::ECONDEventPacket::subpacket_error_ {false} |
S: error in a link sub-packet.
Definition at line 112 of file ECONDEventPacket.h.
Referenced by from().
| bool packing::ECONDEventPacket::truncated_ {false} |
T: packet truncated for buffer overflow.
Definition at line 102 of file ECONDEventPacket.h.
Referenced by from().