LDMX Software
ldmx::ECONDSampleInfo Class Reference

Capture header and ECON-D header data for one sample (L1A) More...

#include <ECONDEventInfo.h>

Public Types

enum  Corruption {
  BAD_HEADER_MARKER = 0 , BAD_LENGTH = 1 , BAD_HEADER_CRC = 2 , BAD_CRC32 = 3 ,
  BAD_PAYLOAD = 4 , TRUNCATED = 5
}
 Bits of the corruption mask. More...
 

Public Member Functions

void setCaptureHeader (int econ_id, int i_sample, bool is_soi, int length)
 Set the capture header data.
 
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.
 
void setCorruption (int mask)
 set the corruption mask
 
void addLink (const ECONDLinkInfo &link)
 add the data from the next link
 
int getEconID () const
 ECON ID from the capture header.
 
int getSampleIndex () const
 sample index from the capture header
 
bool isSOI () const
 sample of interest flag from the capture header
 
int getCaptureLength () const
 ECON-D packet length from the capture header.
 
int getPayloadLength () const
 payload length from the ECON-D header
 
bool isPassthrough () const
 P flag, pass through mode.
 
bool isExpected () const
 E flag, HGCROC event header/trailer expected.
 
bool isMatch () const
 M flag, E/B/O match with the L1A FIFO.
 
bool isTruncated () const
 T flag, truncated.
 
bool hasSubpacketError () const
 S flag, sub-packet error.
 
int getHT () const
 2-bit H/T status
 
int getEBO () const
 2-bit E/B/O status
 
int getBX () const
 bunch crossing
 
int getL1A () const
 6-bit L1A number
 
int getOrbit () const
 3-bit orbit number
 
int getResetRequest () const
 2-bit reset request
 
int getCorruption () const
 corruption mask, bits from Corruption
 
bool isCorrupt (Corruption c) const
 check a single corruption bit
 
bool isCorrupt () const
 any corruption bit is set
 
const std::vector< ECONDLinkInfo > & getLinks () const
 link data in order of transmission
 

Private Member Functions

 ClassDef (ECONDSampleInfo, 1)
 

Private Attributes

int econ_id_ {-1}
 ECON ID.
 
int i_sample_ {-1}
 sample index
 
bool is_soi_ {false}
 sample of interest flag
 
int capture_length_ {0}
 ECON-D packet length from capture header.
 
int payload_length_ {0}
 payload length from ECON-D header
 
int flags_ {0}
 packed P, E, M, T, S flags
 
int ht_ {0}
 H/T status.
 
int ebo_ {0}
 E/B/O status.
 
int bx_ {0}
 bunch crossing
 
int l1a_ {0}
 L1A number.
 
int orbit_ {0}
 orbit number
 
int reset_request_ {0}
 reset request
 
int corruption_ {0}
 corruption mask
 
std::vector< ECONDLinkInfo > links_
 link data
 

Friends

std::ostream & operator<< (std::ostream &o, const ECONDSampleInfo &s)
 

Detailed Description

Capture header and ECON-D header data for one sample (L1A)

Definition at line 81 of file ECONDEventInfo.h.

Member Enumeration Documentation

◆ Corruption

Bits of the corruption mask.

Same order as packing::ECONDEventPacket::Corruption

Definition at line 88 of file ECONDEventInfo.h.

88 {
89 BAD_HEADER_MARKER = 0,
90 BAD_LENGTH = 1,
91 BAD_HEADER_CRC = 2,
92 BAD_CRC32 = 3,
93 BAD_PAYLOAD = 4,
94 TRUNCATED = 5
95 };

Member Function Documentation

◆ addLink()

void ldmx::ECONDSampleInfo::addLink ( const ECONDLinkInfo & link)
inline

add the data from the next link

Definition at line 137 of file ECONDEventInfo.h.

137{ links_.push_back(link); }
std::vector< ECONDLinkInfo > links_
link data

References links_.

Referenced by packing::ECONDDecoder::produce().

◆ getBX()

int ldmx::ECONDSampleInfo::getBX ( ) const
inline

bunch crossing

Definition at line 164 of file ECONDEventInfo.h.

164{ return bx_; }
int bx_
bunch crossing

References bx_.

◆ getCaptureLength()

int ldmx::ECONDSampleInfo::getCaptureLength ( ) const
inline

ECON-D packet length from the capture header.

Definition at line 146 of file ECONDEventInfo.h.

146{ return capture_length_; }
int capture_length_
ECON-D packet length from capture header.

References capture_length_.

◆ getCorruption()

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

corruption mask, bits from Corruption

Definition at line 172 of file ECONDEventInfo.h.

172{ return corruption_; }
int corruption_
corruption mask

References corruption_.

◆ getEBO()

int ldmx::ECONDSampleInfo::getEBO ( ) const
inline

2-bit E/B/O status

Definition at line 162 of file ECONDEventInfo.h.

162{ return ebo_; }
int ebo_
E/B/O status.

References ebo_.

◆ getEconID()

int ldmx::ECONDSampleInfo::getEconID ( ) const
inline

ECON ID from the capture header.

Definition at line 140 of file ECONDEventInfo.h.

140{ return econ_id_; }

References econ_id_.

◆ getHT()

int ldmx::ECONDSampleInfo::getHT ( ) const
inline

2-bit H/T status

Definition at line 160 of file ECONDEventInfo.h.

160{ return ht_; }

References ht_.

◆ getL1A()

int ldmx::ECONDSampleInfo::getL1A ( ) const
inline

6-bit L1A number

Definition at line 166 of file ECONDEventInfo.h.

166{ return l1a_; }

References l1a_.

◆ getLinks()

const std::vector< ECONDLinkInfo > & ldmx::ECONDSampleInfo::getLinks ( ) const
inline

link data in order of transmission

Definition at line 178 of file ECONDEventInfo.h.

178{ return links_; }

References links_.

◆ getOrbit()

int ldmx::ECONDSampleInfo::getOrbit ( ) const
inline

3-bit orbit number

Definition at line 168 of file ECONDEventInfo.h.

168{ return orbit_; }
int orbit_
orbit number

References orbit_.

◆ getPayloadLength()

int ldmx::ECONDSampleInfo::getPayloadLength ( ) const
inline

payload length from the ECON-D header

Definition at line 148 of file ECONDEventInfo.h.

148{ return payload_length_; }
int payload_length_
payload length from ECON-D header

References payload_length_.

◆ getResetRequest()

int ldmx::ECONDSampleInfo::getResetRequest ( ) const
inline

2-bit reset request

Definition at line 170 of file ECONDEventInfo.h.

170{ return reset_request_; }
int reset_request_
reset request

References reset_request_.

◆ getSampleIndex()

int ldmx::ECONDSampleInfo::getSampleIndex ( ) const
inline

sample index from the capture header

Definition at line 142 of file ECONDEventInfo.h.

142{ return i_sample_; }
int i_sample_
sample index

References i_sample_.

◆ hasSubpacketError()

bool ldmx::ECONDSampleInfo::hasSubpacketError ( ) const
inline

S flag, sub-packet error.

Definition at line 158 of file ECONDEventInfo.h.

158{ return (flags_ >> 4) & 0b1; }
int flags_
packed P, E, M, T, S flags

References flags_.

◆ isCorrupt() [1/2]

bool ldmx::ECONDSampleInfo::isCorrupt ( ) const
inline

any corruption bit is set

Definition at line 176 of file ECONDEventInfo.h.

176{ return corruption_ != 0; }

References corruption_.

◆ isCorrupt() [2/2]

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

check a single corruption bit

Definition at line 174 of file ECONDEventInfo.h.

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

References corruption_.

◆ isExpected()

bool ldmx::ECONDSampleInfo::isExpected ( ) const
inline

E flag, HGCROC event header/trailer expected.

Definition at line 152 of file ECONDEventInfo.h.

152{ return (flags_ >> 1) & 0b1; }

References flags_.

◆ isMatch()

bool ldmx::ECONDSampleInfo::isMatch ( ) const
inline

M flag, E/B/O match with the L1A FIFO.

Definition at line 154 of file ECONDEventInfo.h.

154{ return (flags_ >> 2) & 0b1; }

References flags_.

◆ isPassthrough()

bool ldmx::ECONDSampleInfo::isPassthrough ( ) const
inline

P flag, pass through mode.

Definition at line 150 of file ECONDEventInfo.h.

150{ return flags_ & 0b1; }

References flags_.

◆ isSOI()

bool ldmx::ECONDSampleInfo::isSOI ( ) const
inline

sample of interest flag from the capture header

Definition at line 144 of file ECONDEventInfo.h.

144{ return is_soi_; }
bool is_soi_
sample of interest flag

References is_soi_.

◆ isTruncated()

bool ldmx::ECONDSampleInfo::isTruncated ( ) const
inline

T flag, truncated.

Definition at line 156 of file ECONDEventInfo.h.

156{ return (flags_ >> 3) & 0b1; }

References flags_.

◆ setCaptureHeader()

void ldmx::ECONDSampleInfo::setCaptureHeader ( int econ_id,
int i_sample,
bool is_soi,
int length )
inline

Set the capture header data.

Parameters
[in]econ_idECON ID
[in]i_samplesample index within the event
[in]is_soisample of interest flag
[in]lengthECON-D packet length in 32b words

Definition at line 108 of file ECONDEventInfo.h.

108 {
109 econ_id_ = econ_id;
110 i_sample_ = i_sample;
111 is_soi_ = is_soi;
112 capture_length_ = length;
113 }

References capture_length_, econ_id_, i_sample_, and is_soi_.

Referenced by packing::ECONDDecoder::produce().

◆ setCorruption()

void ldmx::ECONDSampleInfo::setCorruption ( int mask)
inline

set the corruption mask

Definition at line 134 of file ECONDEventInfo.h.

134{ corruption_ = mask; }

References corruption_.

Referenced by packing::ECONDDecoder::produce().

◆ setHeader()

void ldmx::ECONDSampleInfo::setHeader ( int payload_length,
int flags,
int ht,
int ebo,
int bx,
int l1a,
int orbit,
int reset_request )
inline

Set the ECON-D event header data.

The flags are packed as P (bit 0), E (1), M (2), T (3), S (4).

Definition at line 121 of file ECONDEventInfo.h.

122 {
123 payload_length_ = payload_length;
124 flags_ = flags;
125 ht_ = ht;
126 ebo_ = ebo;
127 bx_ = bx;
128 l1a_ = l1a;
129 orbit_ = orbit;
130 reset_request_ = reset_request;
131 }

References bx_, ebo_, flags_, ht_, l1a_, orbit_, payload_length_, and reset_request_.

Referenced by packing::ECONDDecoder::produce().

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
const ECONDSampleInfo & s )
friend

Definition at line 24 of file ECONDEventInfo.cxx.

24 {
25 return o << "ECONDSampleInfo { econ: " << s.econ_id_
26 << ", i_sample: " << s.i_sample_ << ", soi: " << s.is_soi_
27 << ", length: " << s.payload_length_ << ", bx: " << s.bx_
28 << ", l1a: " << s.l1a_ << ", orbit: " << s.orbit_
29 << ", corruption: " << s.corruption_
30 << ", n_links: " << s.links_.size() << " }";
31}

Member Data Documentation

◆ bx_

int ldmx::ECONDSampleInfo::bx_ {0}
private

bunch crossing

Definition at line 200 of file ECONDEventInfo.h.

200{0};

Referenced by getBX(), and setHeader().

◆ capture_length_

int ldmx::ECONDSampleInfo::capture_length_ {0}
private

ECON-D packet length from capture header.

Definition at line 190 of file ECONDEventInfo.h.

190{0};

Referenced by getCaptureLength(), and setCaptureHeader().

◆ corruption_

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

corruption mask

Definition at line 208 of file ECONDEventInfo.h.

208{0};

Referenced by getCorruption(), isCorrupt(), isCorrupt(), and setCorruption().

◆ ebo_

int ldmx::ECONDSampleInfo::ebo_ {0}
private

E/B/O status.

Definition at line 198 of file ECONDEventInfo.h.

198{0};

Referenced by getEBO(), and setHeader().

◆ econ_id_

int ldmx::ECONDSampleInfo::econ_id_ {-1}
private

ECON ID.

Definition at line 184 of file ECONDEventInfo.h.

184{-1};

Referenced by getEconID(), and setCaptureHeader().

◆ flags_

int ldmx::ECONDSampleInfo::flags_ {0}
private

packed P, E, M, T, S flags

Definition at line 194 of file ECONDEventInfo.h.

194{0};

Referenced by hasSubpacketError(), isExpected(), isMatch(), isPassthrough(), isTruncated(), and setHeader().

◆ ht_

int ldmx::ECONDSampleInfo::ht_ {0}
private

H/T status.

Definition at line 196 of file ECONDEventInfo.h.

196{0};

Referenced by getHT(), and setHeader().

◆ i_sample_

int ldmx::ECONDSampleInfo::i_sample_ {-1}
private

sample index

Definition at line 186 of file ECONDEventInfo.h.

186{-1};

Referenced by getSampleIndex(), and setCaptureHeader().

◆ is_soi_

bool ldmx::ECONDSampleInfo::is_soi_ {false}
private

sample of interest flag

Definition at line 188 of file ECONDEventInfo.h.

188{false};

Referenced by isSOI(), and setCaptureHeader().

◆ l1a_

int ldmx::ECONDSampleInfo::l1a_ {0}
private

L1A number.

Definition at line 202 of file ECONDEventInfo.h.

202{0};

Referenced by getL1A(), and setHeader().

◆ links_

std::vector<ECONDLinkInfo> ldmx::ECONDSampleInfo::links_
private

link data

Definition at line 210 of file ECONDEventInfo.h.

Referenced by addLink(), and getLinks().

◆ orbit_

int ldmx::ECONDSampleInfo::orbit_ {0}
private

orbit number

Definition at line 204 of file ECONDEventInfo.h.

204{0};

Referenced by getOrbit(), and setHeader().

◆ payload_length_

int ldmx::ECONDSampleInfo::payload_length_ {0}
private

payload length from ECON-D header

Definition at line 192 of file ECONDEventInfo.h.

192{0};

Referenced by getPayloadLength(), and setHeader().

◆ reset_request_

int ldmx::ECONDSampleInfo::reset_request_ {0}
private

reset request

Definition at line 206 of file ECONDEventInfo.h.

206{0};

Referenced by getResetRequest(), and setHeader().


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