LDMX Software
ldmx::EventSummary Class Reference

Provides summary information about an assembled event, including error flags for data quality assessment. More...

#include <EventSummary.h>

Public Types

enum  ErrorFlags : uint32_t {
  ERROR_CRC_MISMATCH = (1 << 0) , ERROR_PARSE_FAILURE = (1 << 1) , ERROR_INCOHERENT_TIMING = (1 << 2) , ERROR_MISSING_SUBSYSTEM = (1 << 3) ,
  ERROR_INCOMPLETE_EVENT = (1 << 4) , ERROR_TRUNCATED_EVENT = (1 << 5) , ERROR_DUPLICATE_SUBSYSTEM = (1 << 6)
}
 Error flag bit definitions. More...
 

Public Member Functions

 EventSummary ()=default
 Class constructor.
 
virtual ~EventSummary ()=default
 Class destructor.
 
void clear (Option_t *o="")
 Clear information from this object.
 
uint64_t getEventNumber () const
 Get the event number.
 
void setEventNumber (uint64_t num)
 Set the event number.
 
uint64_t getTimestampNs () const
 Get the timestamp in nanoseconds.
 
void setTimestampNs (uint64_t ts)
 Set the timestamp in nanoseconds.
 
uint32_t getNSystems () const
 Get the number of systems in this event.
 
void setNSystems (uint32_t ns)
 Set the number of systems in this event.
 
const std::vector< uint64_t > & getSystemIds () const
 Get the system IDs that participated in this event.
 
void setSystemIds (const std::vector< uint64_t > &ids)
 Set the system IDs.
 
uint64_t getPayloadSize () const
 Get the total payload size in bytes.
 
void setPayloadSize (uint64_t size)
 Set the total payload size.
 
uint32_t getErrorFlags () const
 Get the error flags for this event.
 
void setErrorFlags (uint32_t flags)
 Set the error flags.
 
bool hasError (ErrorFlags flag) const
 Check if a specific error flag is set.
 
void setError (ErrorFlags flag)
 Set a specific error flag.
 

Static Public Attributes

static const std::string BRANCH = "EventSummary"
 Name of EventSummary branch.
 

Private Member Functions

 ClassDef (EventSummary, 1)
 ROOT class definition.
 

Private Attributes

uint64_t event_number_ = 0
 The event number.
 
uint64_t timestamp_ns_ = 0
 The event timestamp in nanoseconds.
 
uint32_t nsystems_ = 0
 Number of subsystems that contributed to this event.
 
std::vector< uint64_t > system_ids_
 List of subsystem IDs that participated in this event.
 
uint64_t payload_size_ = 0
 Total payload size in bytes.
 
uint32_t error_flags_ = 0
 Error flags bitmask.
 

Detailed Description

Provides summary information about an assembled event, including error flags for data quality assessment.

This object tracks event assembly metadata such as which subsystems participated, total payload size, and any errors encountered during the assembly process.

Definition at line 25 of file EventSummary.h.

Member Enumeration Documentation

◆ ErrorFlags

Error flag bit definitions.

Enumerator
ERROR_CRC_MISMATCH 

CRC/checksum validation failed.

ERROR_PARSE_FAILURE 

Frame parsing error.

ERROR_INCOHERENT_TIMING 

Fragment timestamps outside coherence window.

ERROR_MISSING_SUBSYSTEM 

Expected subsystem data missing.

ERROR_INCOMPLETE_EVENT 

Event lacks expected number of fragments.

ERROR_TRUNCATED_EVENT 

Event was truncated (EOF reached)

ERROR_DUPLICATE_SUBSYSTEM 

Duplicate subsystem in single event.

Definition at line 30 of file EventSummary.h.

30 : uint32_t {
31 ERROR_CRC_MISMATCH = (1 << 0),
32 ERROR_PARSE_FAILURE = (1 << 1),
33 ERROR_INCOHERENT_TIMING = (1 << 2),
34 ERROR_MISSING_SUBSYSTEM = (1 << 3),
35 ERROR_INCOMPLETE_EVENT = (1 << 4),
36 ERROR_TRUNCATED_EVENT = (1 << 5),
38 };
@ ERROR_PARSE_FAILURE
Frame parsing error.
@ ERROR_DUPLICATE_SUBSYSTEM
Duplicate subsystem in single event.
@ ERROR_INCOHERENT_TIMING
Fragment timestamps outside coherence window.
@ ERROR_MISSING_SUBSYSTEM
Expected subsystem data missing.
@ ERROR_TRUNCATED_EVENT
Event was truncated (EOF reached)
@ ERROR_INCOMPLETE_EVENT
Event lacks expected number of fragments.
@ ERROR_CRC_MISMATCH
CRC/checksum validation failed.

Member Function Documentation

◆ clear()

void ldmx::EventSummary::clear ( Option_t * o = "")

Clear information from this object.

Parameters
[in]oROOT-style Option (ignored)

Definition at line 11 of file EventSummary.cxx.

11 {
12 event_number_ = 0;
13 timestamp_ns_ = 0;
14 nsystems_ = 0;
15 system_ids_.clear();
16 payload_size_ = 0;
17 error_flags_ = 0;
18}
uint32_t nsystems_
Number of subsystems that contributed to this event.
uint32_t error_flags_
Error flags bitmask.
uint64_t event_number_
The event number.
std::vector< uint64_t > system_ids_
List of subsystem IDs that participated in this event.
uint64_t timestamp_ns_
The event timestamp in nanoseconds.
uint64_t payload_size_
Total payload size in bytes.

References error_flags_, event_number_, nsystems_, payload_size_, system_ids_, and timestamp_ns_.

◆ getErrorFlags()

uint32_t ldmx::EventSummary::getErrorFlags ( ) const
inline

Get the error flags for this event.

Returns
Error flags bitmask

Definition at line 128 of file EventSummary.h.

128{ return error_flags_; }

References error_flags_.

◆ getEventNumber()

uint64_t ldmx::EventSummary::getEventNumber ( ) const
inline

Get the event number.

Returns
The event number

Definition at line 68 of file EventSummary.h.

68{ return event_number_; }

References event_number_.

◆ getNSystems()

uint32_t ldmx::EventSummary::getNSystems ( ) const
inline

Get the number of systems in this event.

Returns
Number of subsystems

Definition at line 92 of file EventSummary.h.

92{ return nsystems_; }

References nsystems_.

◆ getPayloadSize()

uint64_t ldmx::EventSummary::getPayloadSize ( ) const
inline

Get the total payload size in bytes.

Returns
Payload size

Definition at line 116 of file EventSummary.h.

116{ return payload_size_; }

References payload_size_.

◆ getSystemIds()

const std::vector< uint64_t > & ldmx::EventSummary::getSystemIds ( ) const
inline

Get the system IDs that participated in this event.

Returns
Vector of system IDs

Definition at line 104 of file EventSummary.h.

104{ return system_ids_; }

References system_ids_.

◆ getTimestampNs()

uint64_t ldmx::EventSummary::getTimestampNs ( ) const
inline

Get the timestamp in nanoseconds.

Returns
The timestamp

Definition at line 80 of file EventSummary.h.

80{ return timestamp_ns_; }

References timestamp_ns_.

◆ hasError()

bool ldmx::EventSummary::hasError ( ErrorFlags flag) const
inline

Check if a specific error flag is set.

Parameters
[in]flagThe error flag to check
Returns
true if the flag is set, false otherwise

Definition at line 141 of file EventSummary.h.

141{ return (error_flags_ & flag) != 0; }

References error_flags_.

◆ setError()

void ldmx::EventSummary::setError ( ErrorFlags flag)
inline

Set a specific error flag.

Parameters
[in]flagThe error flag to set

Definition at line 147 of file EventSummary.h.

147{ error_flags_ |= flag; }

References error_flags_.

◆ setErrorFlags()

void ldmx::EventSummary::setErrorFlags ( uint32_t flags)
inline

Set the error flags.

Parameters
[in]flagsError flags bitmask

Definition at line 134 of file EventSummary.h.

134{ error_flags_ = flags; }

References error_flags_.

Referenced by eventbuilder::EventBuilder::produce().

◆ setEventNumber()

void ldmx::EventSummary::setEventNumber ( uint64_t num)
inline

Set the event number.

Parameters
[in]numThe event number

Definition at line 74 of file EventSummary.h.

74{ event_number_ = num; }

References event_number_.

Referenced by eventbuilder::EventBuilder::produce().

◆ setNSystems()

void ldmx::EventSummary::setNSystems ( uint32_t ns)
inline

Set the number of systems in this event.

Parameters
[in]nsNumber of subsystems

Definition at line 98 of file EventSummary.h.

98{ nsystems_ = ns; }

References nsystems_.

Referenced by eventbuilder::EventBuilder::produce().

◆ setPayloadSize()

void ldmx::EventSummary::setPayloadSize ( uint64_t size)
inline

Set the total payload size.

Parameters
[in]sizePayload size in bytes

Definition at line 122 of file EventSummary.h.

122{ payload_size_ = size; }

References payload_size_.

Referenced by eventbuilder::EventBuilder::produce().

◆ setSystemIds()

void ldmx::EventSummary::setSystemIds ( const std::vector< uint64_t > & ids)
inline

Set the system IDs.

Parameters
[in]idsVector of system IDs

Definition at line 110 of file EventSummary.h.

110{ system_ids_ = ids; }

References system_ids_.

Referenced by eventbuilder::EventBuilder::produce().

◆ setTimestampNs()

void ldmx::EventSummary::setTimestampNs ( uint64_t ts)
inline

Set the timestamp in nanoseconds.

Parameters
[in]tsThe timestamp

Definition at line 86 of file EventSummary.h.

86{ timestamp_ns_ = ts; }

References timestamp_ns_.

Referenced by eventbuilder::EventBuilder::produce().

Member Data Documentation

◆ BRANCH

const std::string ldmx::EventSummary::BRANCH = "EventSummary"
static

Name of EventSummary branch.

Definition at line 43 of file EventSummary.h.

◆ error_flags_

uint32_t ldmx::EventSummary::error_flags_ = 0
private

Error flags bitmask.

Definition at line 178 of file EventSummary.h.

Referenced by clear(), getErrorFlags(), hasError(), setError(), and setErrorFlags().

◆ event_number_

uint64_t ldmx::EventSummary::event_number_ = 0
private

The event number.

Definition at line 153 of file EventSummary.h.

Referenced by clear(), getEventNumber(), and setEventNumber().

◆ nsystems_

uint32_t ldmx::EventSummary::nsystems_ = 0
private

Number of subsystems that contributed to this event.

Definition at line 163 of file EventSummary.h.

Referenced by clear(), getNSystems(), and setNSystems().

◆ payload_size_

uint64_t ldmx::EventSummary::payload_size_ = 0
private

Total payload size in bytes.

Definition at line 173 of file EventSummary.h.

Referenced by clear(), getPayloadSize(), and setPayloadSize().

◆ system_ids_

std::vector<uint64_t> ldmx::EventSummary::system_ids_
private

List of subsystem IDs that participated in this event.

Definition at line 168 of file EventSummary.h.

Referenced by clear(), getSystemIds(), and setSystemIds().

◆ timestamp_ns_

uint64_t ldmx::EventSummary::timestamp_ns_ = 0
private

The event timestamp in nanoseconds.

Definition at line 158 of file EventSummary.h.

Referenced by clear(), getTimestampNs(), and setTimestampNs().


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