|
LDMX Software
|
Unpack an event that has potentially more than one sample collected from a single ECOND. More...
#include <MultiSampleECONDEventPacket.h>
Public Types | |
| enum | Corruption : std::size_t { RESYNC = 0 , LOST_SYNC = 1 , NO_TRAILER = 2 , TRAILER_COUNT_MISMATCH = 3 , ECON_ID_MISMATCH = 4 , SAMPLE_INDEX_MISMATCH = 5 , TRUNCATED_FRAME = 6 , EXTRA_WORDS = 7 , NO_SOI = 8 , N_CORRUPTION = 9 } |
| index of frame-level corruption flags More... | |
Public Member Functions | |
| MultiSampleECONDEventPacket (int n_links) | |
| constructor defining how many links are connected to this ECOND | |
| const ECONDEventPacket & | soi () const |
| get the sample of interest | |
| bool | isCorrupt () const |
| any of the frame-level corruption flags are set | |
| void | from (std::span< const uint32_t > frame) |
| unpack the given frame into this structure | |
Public Attributes | |
| std::array< bool, N_CORRUPTION > | corruption_ {} |
| corruption flags indexed by Corruption | |
| std::size_t | i_soi_ {0} |
| index of the sample of interest (SOI) | |
| int | econd_id_ {-1} |
| ID for this econ from the first capture header (-1 if none) | |
| int | trailer_n_samples_ {-1} |
| number of samples written in the trailer (-1 if no trailer) | |
| std::size_t | n_skipped_words_ {0} |
| number of words skipped while searching for capture headers | |
| std::vector< DAQSampleHeader > | headers_ |
| capture headers stored in order of transmission | |
| std::vector< ECONDEventPacket > | samples_ |
| samples from ECOND stored in order of transmission | |
Private Member Functions | |
| std::size_t | resync (std::span< const uint32_t > frame, std::size_t start, std::size_t i_sample) const |
| find the next capture header for sample i_sample or the trailer | |
| enableLogging ("MultiSampleECONDEventPacket") | |
| handle to logging source | |
Private Attributes | |
| int | n_links_ |
| number of links connected to the ECOND | |
Unpack an event that has potentially more than one sample collected from a single ECOND.
The frame is what SingleSubsystemUnpacker puts on the event bus (the data after the LDMX RoR header) as 32-bit words: for each sample a DAQSampleHeader followed by the ECON-D packet, then the DAQSampleHeader::endingTrailer and zero padding.
Corrupted ECON-D packets are flagged in their ECONDEventPacket and we move on to the next capture header using the length. If the word at that position is not a capture header, we search forward for the capture header of the next sample (or the trailer) and count the skipped words.
Definition at line 29 of file MultiSampleECONDEventPacket.h.
| enum packing::MultiSampleECONDEventPacket::Corruption : std::size_t |
index of frame-level corruption flags
Definition at line 32 of file MultiSampleECONDEventPacket.h.
|
explicit |
constructor defining how many links are connected to this ECOND
Definition at line 11 of file MultiSampleECONDEventPacket.cxx.
| void packing::MultiSampleECONDEventPacket::from | ( | std::span< const uint32_t > | frame | ) |
unpack the given frame into this structure
Definition at line 42 of file MultiSampleECONDEventPacket.cxx.
References corruption_, ECON_ID_MISMATCH, packing::DAQSampleHeader::econd_id_, econd_id_, packing::DAQSampleHeader::econd_len_, EXTRA_WORDS, packing::DAQSampleHeader::from(), headers_, packing::DAQSampleHeader::i_l1a_, i_soi_, packing::DAQSampleHeader::is_soi_, packing::DAQSampleHeader::isEndingTrailer(), packing::DAQSampleHeader::isValid(), LOST_SYNC, n_links_, n_skipped_words_, NO_SOI, NO_TRAILER, RESYNC, resync(), SAMPLE_INDEX_MISMATCH, samples_, TRAILER_COUNT_MISMATCH, trailer_n_samples_, packing::DAQSampleHeader::trailerNumSamples(), TRUNCATED_FRAME, packing::DAQSampleHeader::VERSION, and packing::DAQSampleHeader::version_.
| bool packing::MultiSampleECONDEventPacket::isCorrupt | ( | ) | const |
any of the frame-level corruption flags are set
Definition at line 18 of file MultiSampleECONDEventPacket.cxx.
References corruption_.
|
private |
find the next capture header for sample i_sample or the trailer
Definition at line 23 of file MultiSampleECONDEventPacket.cxx.
References packing::DAQSampleHeader::econd_id_, econd_id_, packing::DAQSampleHeader::from(), packing::DAQSampleHeader::i_l1a_, packing::DAQSampleHeader::isEndingTrailer(), packing::DAQSampleHeader::isValid(), packing::DAQSampleHeader::VERSION, and packing::DAQSampleHeader::version_.
Referenced by from().
| const ECONDEventPacket & packing::MultiSampleECONDEventPacket::soi | ( | ) | const |
| std::array<bool, N_CORRUPTION> packing::MultiSampleECONDEventPacket::corruption_ {} |
corruption flags indexed by Corruption
Definition at line 56 of file MultiSampleECONDEventPacket.h.
Referenced by from(), and isCorrupt().
| int packing::MultiSampleECONDEventPacket::econd_id_ {-1} |
ID for this econ from the first capture header (-1 if none)
Definition at line 60 of file MultiSampleECONDEventPacket.h.
| std::vector<DAQSampleHeader> packing::MultiSampleECONDEventPacket::headers_ |
capture headers stored in order of transmission
Definition at line 66 of file MultiSampleECONDEventPacket.h.
Referenced by from().
| std::size_t packing::MultiSampleECONDEventPacket::i_soi_ {0} |
index of the sample of interest (SOI)
Definition at line 58 of file MultiSampleECONDEventPacket.h.
|
private |
number of links connected to the ECOND
Definition at line 88 of file MultiSampleECONDEventPacket.h.
Referenced by from().
| std::size_t packing::MultiSampleECONDEventPacket::n_skipped_words_ {0} |
number of words skipped while searching for capture headers
Definition at line 64 of file MultiSampleECONDEventPacket.h.
Referenced by from().
| std::vector<ECONDEventPacket> packing::MultiSampleECONDEventPacket::samples_ |
samples from ECOND stored in order of transmission
Definition at line 68 of file MultiSampleECONDEventPacket.h.
| int packing::MultiSampleECONDEventPacket::trailer_n_samples_ {-1} |
number of samples written in the trailer (-1 if no trailer)
Definition at line 62 of file MultiSampleECONDEventPacket.h.
Referenced by from().