LDMX Software
ldmx::ECONDEventInfo Class Reference

Supporting data for one event decoded from a single ECON-D. More...

#include <ECONDEventInfo.h>

Public Types

enum  Corruption {
  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 , BAD_FRAME_SIZE = 9 , NO_FRAME = 10
}
 Bits of the frame corruption mask. More...
 

Public Member Functions

void clear ()
 reset to the default state
 
void setFrame (int corruption, int trailer_n_samples, int i_soi, int n_skipped_words)
 set the frame-level data
 
void setDigisFilled (bool filled)
 set if the digis were filled from this event
 
void addSample (const ECONDSampleInfo &sample)
 add the next sample
 
int getCorruption () const
 frame corruption mask, bits from Corruption
 
bool isCorrupt (Corruption c) const
 check a single frame corruption bit
 
int getTrailerNumSamples () const
 number of samples in the ending trailer (-1 if missing)
 
int getSOIIndex () const
 index of the sample of interest
 
int getNumSkippedWords () const
 number of words skipped searching for capture headers
 
bool areDigisFilled () const
 were all samples good so the digis were filled
 
const std::vector< ECONDSampleInfo > & getSamples () const
 samples in order of transmission
 

Private Member Functions

 ClassDef (ECONDEventInfo, 1)
 

Private Attributes

int corruption_ {0}
 frame corruption mask
 
int trailer_n_samples_ {-1}
 number of samples in the trailer
 
int i_soi_ {0}
 index of the sample of interest
 
int n_skipped_words_ {0}
 words skipped while searching for capture headers
 
bool digis_filled_ {false}
 digis were filled from this event
 
std::vector< ECONDSampleInfo > samples_
 per-sample data
 

Friends

std::ostream & operator<< (std::ostream &o, const ECONDEventInfo &e)
 

Detailed Description

Supporting data for one event decoded from a single ECON-D.

Holds the frame-level checks and the per-sample data that HgcrocDigiCollection does not store.

Definition at line 222 of file ECONDEventInfo.h.

Member Enumeration Documentation

◆ Corruption

Bits of the frame corruption mask.

Same order as packing::MultiSampleECONDEventPacket::Corruption

Definition at line 229 of file ECONDEventInfo.h.

229 {
230 RESYNC = 0,
231 LOST_SYNC = 1,
232 NO_TRAILER = 2,
233 TRAILER_COUNT_MISMATCH = 3,
234 ECON_ID_MISMATCH = 4,
235 SAMPLE_INDEX_MISMATCH = 5,
236 TRUNCATED_FRAME = 6,
237 EXTRA_WORDS = 7,
238 NO_SOI = 8,
239 BAD_FRAME_SIZE = 9,
240 NO_FRAME = 10
241 };

Member Function Documentation

◆ addSample()

void ldmx::ECONDEventInfo::addSample ( const ECONDSampleInfo & sample)
inline

add the next sample

Definition at line 262 of file ECONDEventInfo.h.

262{ samples_.push_back(sample); }
std::vector< ECONDSampleInfo > samples_
per-sample data

References samples_.

◆ areDigisFilled()

bool ldmx::ECONDEventInfo::areDigisFilled ( ) const
inline

were all samples good so the digis were filled

Definition at line 275 of file ECONDEventInfo.h.

275{ return digis_filled_; }
bool digis_filled_
digis were filled from this event

References digis_filled_.

◆ clear()

void ldmx::ECONDEventInfo::clear ( )

reset to the default state

Definition at line 9 of file ECONDEventInfo.cxx.

9 {
10 corruption_ = 0;
12 i_soi_ = 0;
14 digis_filled_ = false;
15 samples_.clear();
16}
int corruption_
frame corruption mask
int n_skipped_words_
words skipped while searching for capture headers
int i_soi_
index of the sample of interest
int trailer_n_samples_
number of samples in the trailer

References corruption_, digis_filled_, i_soi_, n_skipped_words_, samples_, and trailer_n_samples_.

◆ getCorruption()

int ldmx::ECONDEventInfo::getCorruption ( ) const
inline

frame corruption mask, bits from Corruption

Definition at line 265 of file ECONDEventInfo.h.

265{ return corruption_; }

References corruption_.

◆ getNumSkippedWords()

int ldmx::ECONDEventInfo::getNumSkippedWords ( ) const
inline

number of words skipped searching for capture headers

Definition at line 273 of file ECONDEventInfo.h.

273{ return n_skipped_words_; }

References n_skipped_words_.

◆ getSamples()

const std::vector< ECONDSampleInfo > & ldmx::ECONDEventInfo::getSamples ( ) const
inline

samples in order of transmission

Definition at line 277 of file ECONDEventInfo.h.

277{ return samples_; }

References samples_.

◆ getSOIIndex()

int ldmx::ECONDEventInfo::getSOIIndex ( ) const
inline

index of the sample of interest

Definition at line 271 of file ECONDEventInfo.h.

271{ return i_soi_; }

References i_soi_.

◆ getTrailerNumSamples()

int ldmx::ECONDEventInfo::getTrailerNumSamples ( ) const
inline

number of samples in the ending trailer (-1 if missing)

Definition at line 269 of file ECONDEventInfo.h.

269{ return trailer_n_samples_; }

References trailer_n_samples_.

◆ isCorrupt()

bool ldmx::ECONDEventInfo::isCorrupt ( Corruption c) const
inline

check a single frame corruption bit

Definition at line 267 of file ECONDEventInfo.h.

267{ return (corruption_ >> c) & 0b1; }

References corruption_.

◆ setDigisFilled()

void ldmx::ECONDEventInfo::setDigisFilled ( bool filled)
inline

set if the digis were filled from this event

Definition at line 259 of file ECONDEventInfo.h.

259{ digis_filled_ = filled; }

References digis_filled_.

◆ setFrame()

void ldmx::ECONDEventInfo::setFrame ( int corruption,
int trailer_n_samples,
int i_soi,
int n_skipped_words )
inline

set the frame-level data

Definition at line 250 of file ECONDEventInfo.h.

251 {
252 corruption_ = corruption;
253 trailer_n_samples_ = trailer_n_samples;
254 i_soi_ = i_soi;
255 n_skipped_words_ = n_skipped_words;
256 }

References corruption_, i_soi_, n_skipped_words_, and trailer_n_samples_.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
const ECONDEventInfo & e )
friend

Definition at line 33 of file ECONDEventInfo.cxx.

33 {
34 return o << "ECONDEventInfo { corruption: " << e.corruption_
35 << ", n_samples: " << e.samples_.size()
36 << ", trailer_n_samples: " << e.trailer_n_samples_
37 << ", soi: " << e.i_soi_ << ", skipped: " << e.n_skipped_words_
38 << ", digis_filled: " << e.digis_filled_ << " }";
39}

Member Data Documentation

◆ corruption_

int ldmx::ECONDEventInfo::corruption_ {0}
private

frame corruption mask

Definition at line 283 of file ECONDEventInfo.h.

283{0};

Referenced by clear(), getCorruption(), isCorrupt(), and setFrame().

◆ digis_filled_

bool ldmx::ECONDEventInfo::digis_filled_ {false}
private

digis were filled from this event

Definition at line 291 of file ECONDEventInfo.h.

291{false};

Referenced by areDigisFilled(), clear(), and setDigisFilled().

◆ i_soi_

int ldmx::ECONDEventInfo::i_soi_ {0}
private

index of the sample of interest

Definition at line 287 of file ECONDEventInfo.h.

287{0};

Referenced by clear(), getSOIIndex(), and setFrame().

◆ n_skipped_words_

int ldmx::ECONDEventInfo::n_skipped_words_ {0}
private

words skipped while searching for capture headers

Definition at line 289 of file ECONDEventInfo.h.

289{0};

Referenced by clear(), getNumSkippedWords(), and setFrame().

◆ samples_

std::vector<ECONDSampleInfo> ldmx::ECONDEventInfo::samples_
private

per-sample data

Definition at line 293 of file ECONDEventInfo.h.

Referenced by addSample(), clear(), and getSamples().

◆ trailer_n_samples_

int ldmx::ECONDEventInfo::trailer_n_samples_ {-1}
private

number of samples in the trailer

Definition at line 285 of file ECONDEventInfo.h.

285{-1};

Referenced by clear(), getTrailerNumSamples(), and setFrame().


The documentation for this class was generated from the following files: