7#ifndef RECON_EVENT_ECONDEVENTINFO_H_
8#define RECON_EVENT_ECONDEVENTINFO_H_
39 void set(
int stat,
bool is_empty,
int adc_cm0,
int adc_cm1, uint32_t calib) {
60 friend std::ostream& operator<<(std::ostream& o,
const ECONDLinkInfo& l);
89 BAD_HEADER_MARKER = 0,
121 void setHeader(
int payload_length,
int flags,
int ht,
int ebo,
int bx,
122 int l1a,
int orbit,
int reset_request) {
180 friend std::ostream& operator<<(std::ostream& o,
const ECONDSampleInfo& s);
233 TRAILER_COUNT_MISMATCH = 3,
234 ECON_ID_MISMATCH = 4,
235 SAMPLE_INDEX_MISMATCH = 5,
250 void setFrame(
int corruption,
int trailer_n_samples,
int i_soi,
251 int n_skipped_words) {
279 friend std::ostream& operator<<(std::ostream& o,
const ECONDEventInfo& e);
Supporting data for one event decoded from a single ECON-D.
void setDigisFilled(bool filled)
set if the digis were filled from this event
int getTrailerNumSamples() const
number of samples in the ending trailer (-1 if missing)
int getNumSkippedWords() const
number of words skipped searching for capture headers
int getCorruption() const
frame corruption mask, bits from Corruption
void setFrame(int corruption, int trailer_n_samples, int i_soi, int n_skipped_words)
set the frame-level data
void clear()
reset to the default state
int corruption_
frame corruption mask
const std::vector< ECONDSampleInfo > & getSamples() const
samples in order of transmission
bool isCorrupt(Corruption c) const
check a single frame corruption bit
int n_skipped_words_
words skipped while searching for capture headers
Corruption
Bits of the frame corruption mask.
void addSample(const ECONDSampleInfo &sample)
add the next sample
bool areDigisFilled() const
were all samples good so the digis were filled
int getSOIIndex() const
index of the sample of interest
int i_soi_
index of the sample of interest
int trailer_n_samples_
number of samples in the trailer
bool digis_filled_
digis were filled from this event
std::vector< ECONDSampleInfo > samples_
per-sample data
Data from one eRx ("link") sub-packet of an ECON-D packet that is not a normal channel.
int getADCCM1() const
common mode 1 ADC
void set(int stat, bool is_empty, int adc_cm0, int adc_cm1, uint32_t calib)
Set the link data.
int getADCCM0() const
common mode 0 ADC
bool isEmpty() const
sub-packet had no channel data
uint32_t calib_
calibration channel sample word
int adc_cm1_
common mode 1 ADC
int getStat() const
3-bit Stat field, all ones is good
uint32_t getCalib() const
calibration channel sample word (HgcrocDigiCollection::Sample format)
int stat_
3-bit Stat field
bool hasBadStat() const
any of the Stat bits are bad
int adc_cm0_
common mode 0 ADC
Capture header and ECON-D header data for one sample (L1A)
int getResetRequest() const
2-bit reset request
int getBX() const
bunch crossing
bool isTruncated() const
T flag, truncated.
void setHeader(int payload_length, int flags, int ht, int ebo, int bx, int l1a, int orbit, int reset_request)
Set the ECON-D event header data.
std::vector< ECONDLinkInfo > links_
link data
int corruption_
corruption mask
int i_sample_
sample index
bool isMatch() const
M flag, E/B/O match with the L1A FIFO.
void setCaptureHeader(int econ_id, int i_sample, bool is_soi, int length)
Set the capture header data.
bool hasSubpacketError() const
S flag, sub-packet error.
int getEconID() const
ECON ID from the capture header.
int capture_length_
ECON-D packet length from capture header.
int getCorruption() const
corruption mask, bits from Corruption
void addLink(const ECONDLinkInfo &link)
add the data from the next link
bool isExpected() const
E flag, HGCROC event header/trailer expected.
int getSampleIndex() const
sample index from the capture header
bool isSOI() const
sample of interest flag from the capture header
int reset_request_
reset request
int getEBO() const
2-bit E/B/O status
bool is_soi_
sample of interest flag
int getOrbit() const
3-bit orbit number
int getCaptureLength() const
ECON-D packet length from the capture header.
int payload_length_
payload length from ECON-D header
bool isCorrupt() const
any corruption bit is set
Corruption
Bits of the corruption mask.
int getL1A() const
6-bit L1A number
bool isCorrupt(Corruption c) const
check a single corruption bit
int getHT() const
2-bit H/T status
const std::vector< ECONDLinkInfo > & getLinks() const
link data in order of transmission
int flags_
packed P, E, M, T, S flags
bool isPassthrough() const
P flag, pass through mode.
void setCorruption(int mask)
set the corruption mask
int getPayloadLength() const
payload length from the ECON-D header