|
LDMX Software
|
The capture header that the DAQ firmware inserts before each ECON-D event packet (one per sample) and the trailer word that it appends after the last sample of an event. More...
#include <DAQSampleHeader.h>
Public Member Functions | |
| void | from (uint32_t word) |
| decode a DAQSampleHeader from the input word | |
| uint32_t | to () const |
| construct a header word from our data | |
| bool | isEndingTrailer () const |
| A special form of this DAQ header is used to signal the end of a multi-sample sequence. | |
Static Public Member Functions | |
| static bool | isValid (uint32_t word) |
| check if the decoded word looks like a capture header | |
| static uint32_t | trailerNumSamples (uint32_t word) |
| number of samples written in the ending trailer | |
| static uint32_t | endingTrailer (uint32_t n_samples=0) |
| construct the special trailer form of this header | |
Public Attributes | |
| uint32_t | version_ {0} |
| format version | |
| uint32_t | econd_id_ {0} |
| configured ID of the ECON | |
| uint32_t | i_l1a_ {0} |
| index of this sample within the event | |
| bool | is_soi_ {false} |
| is this the sample of interest? | |
| uint32_t | econd_len_ {0} |
| length of the ECON-D packet following this header in 32b words | |
Static Public Attributes | |
| static const uint32_t | VERSION {1} |
| expected format version | |
Friends | |
| std::ostream & | operator<< (std::ostream &o, const DAQSampleHeader &h) |
| output stream operator to make logging easier | |
The capture header that the DAQ firmware inserts before each ECON-D event packet (one per sample) and the trailer word that it appends after the last sample of an event.
Header:
4b vers | 10b ECON ID | 5b i_l1a | S | 12b length
Trailer:
4b vers | 10b 0x3ff | 5b 0x1f | 0 | last | 6b 0 | 5b n_samples
Definition at line 31 of file DAQSampleHeader.h.
|
static |
construct the special trailer form of this header
Definition at line 38 of file DAQSampleHeader.cxx.
| void packing::DAQSampleHeader::from | ( | uint32_t | word | ) |
decode a DAQSampleHeader from the input word
Definition at line 9 of file DAQSampleHeader.cxx.
References econd_id_, econd_len_, i_l1a_, is_soi_, and version_.
Referenced by packing::MultiSampleECONDEventPacket::from(), isValid(), and packing::MultiSampleECONDEventPacket::resync().
| bool packing::DAQSampleHeader::isEndingTrailer | ( | ) | const |
A special form of this DAQ header is used to signal the end of a multi-sample sequence.
Both i_l1a and econd_id are set to their maximum values.
Definition at line 30 of file DAQSampleHeader.cxx.
References econd_id_, and i_l1a_.
Referenced by packing::MultiSampleECONDEventPacket::from(), isValid(), and packing::MultiSampleECONDEventPacket::resync().
|
static |
check if the decoded word looks like a capture header
The version must be the expected one and the three bits between the S flag and the 9-bit length must be zero. The trailer does not pass this check.
Definition at line 23 of file DAQSampleHeader.cxx.
References from(), isEndingTrailer(), VERSION, and version_.
Referenced by packing::MultiSampleECONDEventPacket::from(), and packing::MultiSampleECONDEventPacket::resync().
| uint32_t packing::DAQSampleHeader::to | ( | ) | const |
construct a header word from our data
Definition at line 17 of file DAQSampleHeader.cxx.
References econd_id_, econd_len_, i_l1a_, is_soi_, and version_.
Referenced by endingTrailer().
|
static |
number of samples written in the ending trailer
Definition at line 34 of file DAQSampleHeader.cxx.
Referenced by packing::MultiSampleECONDEventPacket::from().
|
friend |
output stream operator to make logging easier
Definition at line 47 of file DAQSampleHeader.cxx.
| uint32_t packing::DAQSampleHeader::econd_id_ {0} |
configured ID of the ECON
Definition at line 35 of file DAQSampleHeader.h.
Referenced by from(), packing::MultiSampleECONDEventPacket::from(), isEndingTrailer(), packing::MultiSampleECONDEventPacket::resync(), and to().
| uint32_t packing::DAQSampleHeader::econd_len_ {0} |
length of the ECON-D packet following this header in 32b words
Definition at line 41 of file DAQSampleHeader.h.
Referenced by from(), packing::MultiSampleECONDEventPacket::from(), and to().
| uint32_t packing::DAQSampleHeader::i_l1a_ {0} |
index of this sample within the event
Definition at line 37 of file DAQSampleHeader.h.
Referenced by from(), packing::MultiSampleECONDEventPacket::from(), isEndingTrailer(), packing::MultiSampleECONDEventPacket::resync(), and to().
| bool packing::DAQSampleHeader::is_soi_ {false} |
is this the sample of interest?
Definition at line 39 of file DAQSampleHeader.h.
Referenced by from(), packing::MultiSampleECONDEventPacket::from(), and to().
|
static |
expected format version
Definition at line 44 of file DAQSampleHeader.h.
Referenced by endingTrailer(), packing::MultiSampleECONDEventPacket::from(), isValid(), and packing::MultiSampleECONDEventPacket::resync().
| uint32_t packing::DAQSampleHeader::version_ {0} |
format version
Definition at line 33 of file DAQSampleHeader.h.
Referenced by from(), packing::MultiSampleECONDEventPacket::from(), isValid(), packing::MultiSampleECONDEventPacket::resync(), and to().