LDMX Software
DAQSampleHeader.h
1#ifndef PACKING_DAQSAMPLEHEADER_H
2#define PACKING_DAQSAMPLEHEADER_H
3
4#include <cstdint>
5#include <ostream>
6
7namespace packing {
8
33 uint32_t version_{0};
35 uint32_t econd_id_{0};
37 uint32_t i_l1a_{0};
39 bool is_soi_{false};
41 uint32_t econd_len_{0};
42
44 static const uint32_t VERSION{1};
45
47 void from(uint32_t word);
48
50 uint32_t to() const;
51
59 static bool isValid(uint32_t word);
60
67 bool isEndingTrailer() const;
68
70 static uint32_t trailerNumSamples(uint32_t word);
71
73 static uint32_t endingTrailer(uint32_t n_samples = 0);
74
76 friend std::ostream& operator<<(std::ostream& o, const DAQSampleHeader& h);
77};
78
79} // namespace packing
80
81#endif // PACKING_DAQSAMPLEHEADER_H
The capture header that the DAQ firmware inserts before each ECON-D event packet (one per sample) and...
uint32_t version_
format version
bool is_soi_
is this the sample of interest?
bool isEndingTrailer() const
A special form of this DAQ header is used to signal the end of a multi-sample sequence.
friend std::ostream & operator<<(std::ostream &o, const DAQSampleHeader &h)
output stream operator to make logging easier
uint32_t i_l1a_
index of this sample within the event
void from(uint32_t word)
decode a DAQSampleHeader from the input word
static uint32_t endingTrailer(uint32_t n_samples=0)
construct the special trailer form of this header
uint32_t econd_id_
configured ID of the ECON
static const uint32_t VERSION
expected format version
uint32_t to() const
construct a header word from our data
uint32_t econd_len_
length of the ECON-D packet following this header in 32b words
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