LDMX Software
EventSummary.h
Go to the documentation of this file.
1
6#ifndef EVENT_EVENTSUMMARY_H_
7#define EVENT_EVENTSUMMARY_H_
8
9// ROOT
10#include "TObject.h" // For ClassDef
11#include <vector>
12#include <cstdint>
13
14namespace ldmx {
15
25class EventSummary : public TObject {
26 public:
39
43 static const std::string BRANCH;
44
48 EventSummary() = default;
49
53 virtual ~EventSummary() = default;
54
60 void clear(Option_t* o = "");
61
62
63
68 uint64_t getEventNumber() const { return event_number_; }
69
74 void setEventNumber(uint64_t num) { event_number_ = num; }
75
80 uint64_t getTimestampNs() const { return timestamp_ns_; }
81
86 void setTimestampNs(uint64_t ts) { timestamp_ns_ = ts; }
87
92 uint32_t getNSystems() const { return nsystems_; }
93
98 void setNSystems(uint32_t ns) { nsystems_ = ns; }
99
104 const std::vector<uint64_t>& getSystemIds() const { return system_ids_; }
105
110 void setSystemIds(const std::vector<uint64_t>& ids) { system_ids_ = ids; }
111
116 uint64_t getPayloadSize() const { return payload_size_; }
117
122 void setPayloadSize(uint64_t size) { payload_size_ = size; }
123
128 uint32_t getErrorFlags() const { return error_flags_; }
129
134 void setErrorFlags(uint32_t flags) { error_flags_ = flags; }
135
141 bool hasError(ErrorFlags flag) const { return (error_flags_ & flag) != 0; }
142
147 void setError(ErrorFlags flag) { error_flags_ |= flag; }
148
149 private:
153 uint64_t event_number_ = 0;
154
158 uint64_t timestamp_ns_ = 0;
159
163 uint32_t nsystems_ = 0;
164
168 std::vector<uint64_t> system_ids_;
169
173 uint64_t payload_size_ = 0;
174
178 uint32_t error_flags_ = 0;
179
184};
185
186} // namespace ldmx
187
188#endif /* EVENT_EVENTSUMMARY_H_ */
Provides summary information about an assembled event, including error flags for data quality assessm...
uint32_t nsystems_
Number of subsystems that contributed to this event.
uint64_t getTimestampNs() const
Get the timestamp in nanoseconds.
const std::vector< uint64_t > & getSystemIds() const
Get the system IDs that participated in this event.
EventSummary()=default
Class constructor.
uint32_t error_flags_
Error flags bitmask.
void setSystemIds(const std::vector< uint64_t > &ids)
Set the system IDs.
void clear(Option_t *o="")
Clear information from this object.
void setNSystems(uint32_t ns)
Set the number of systems in this event.
virtual ~EventSummary()=default
Class destructor.
ClassDef(EventSummary, 1)
ROOT class definition.
static const std::string BRANCH
Name of EventSummary branch.
uint64_t getPayloadSize() const
Get the total payload size in bytes.
void setPayloadSize(uint64_t size)
Set the total payload size.
uint64_t event_number_
The event number.
void setTimestampNs(uint64_t ts)
Set the timestamp in nanoseconds.
std::vector< uint64_t > system_ids_
List of subsystem IDs that participated in this event.
uint32_t getErrorFlags() const
Get the error flags for this event.
void setEventNumber(uint64_t num)
Set the event number.
uint64_t timestamp_ns_
The event timestamp in nanoseconds.
void setErrorFlags(uint32_t flags)
Set the error flags.
uint64_t getEventNumber() const
Get the event number.
void setError(ErrorFlags flag)
Set a specific error flag.
uint32_t getNSystems() const
Get the number of systems in this event.
uint64_t payload_size_
Total payload size in bytes.
bool hasError(ErrorFlags flag) const
Check if a specific error flag is set.
ErrorFlags
Error flag bit definitions.
@ 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.