DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::daqdataformats Namespace Reference

Namespaces

namespace  python
 

Classes

struct  ComponentRequest
 A request sent to a Component, including the SourceID of the component and the window offset and width. More...
 
class  Fragment
 C++ Representation of a DUNE Fragment, wrapping the flat byte array that is the Fragment's "actual" form. More...
 
struct  FragmentHeader
 The header for a DUNE Fragment. More...
 
struct  SourceID
 SourceID is a generalized representation of the source of a piece of data in the DAQ. That source could be a physical location in the detector, a running process in the DAQ (e.g. a dataflow app, the source of a data request), etc. More...
 
class  TimeSlice
 C++ Representation of a DUNE TimeSlice, consisting of a TimeSliceHeader object and a vector of pointers to Fragment objects. More...
 
struct  TimeSliceHeader
 Additional data fields associated with a TimeSliceHeader. More...
 
class  TriggerRecord
 C++ Representation of a DUNE TriggerRecord, consisting of a TriggerRecordHeader object and a vector of pointers to Fragment objects. More...
 
class  TriggerRecordHeader
 C++ representation of a TriggerRecordHeader, which wraps a flat array that is the TriggerRecordHeader's "actual" form. More...
 
struct  TriggerRecordHeaderData
 Additional data fields associated with a TriggerRecordHeader. More...
 
class  TypeDefaults
 Default values for daqdataformats types. More...
 

Typedefs

using run_number_t = uint32_t
 Type used to represent run number.
 
using trigger_number_t = uint64_t
 Type used to represent trigger number.
 
using fragment_type_t = uint32_t
 Type used to represent Fragment type ID.
 
using fragment_size_t = uint64_t
 Type used to represent Fragment size.
 
using timestamp_t = uint64_t
 Type used to represent DUNE timing system timestamps.
 
using timestamp_diff_t = int64_t
 Used to represent differences between timestamps.
 
using trigger_type_t = uint64_t
 Type used to represent Trigger Decision trigger types.
 
using sequence_number_t = uint16_t
 Type used to represent sequence within a trigger record.
 
using timeslice_number_t = uint64_t
 Type used to represent timeslice number.
 

Enumerations

enum class  FragmentStatusBits : size_t {
  kLatencyBufferEmpty = 0 , kIncomplete = 1 , kInvalidRequestWindow = 2 , kRequestTimeout = 3 ,
  kRequestWindowBeforeBuffer = 4 , kRequestWindowAfterBuffer = 5 , kEmptyFragment = 6 , kUnassigned7 = 7 ,
  kUnassigned8 = 8 , kUnassigned9 = 9 , kUnassigned10 = 10 , kUnassigned11 = 11 ,
  kUnassigned12 = 12 , kUnassigned13 = 13 , kUnassigned14 = 14 , kUnassigned15 = 15 ,
  kUnassigned16 = 16 , kUnassigned17 = 17 , kUnassigned18 = 18 , kUnassigned19 = 19 ,
  kUnassigned20 = 20 , kUnassigned21 = 21 , kUnassigned22 = 22 , kUnassigned23 = 23 ,
  kUnassigned24 = 24 , kUnassigned25 = 25 , kUnassigned26 = 26 , kUnassigned27 = 27 ,
  kUnassigned28 = 28 , kUnassigned29 = 29 , kUnassigned30 = 30 , kUnassigned31 = 31 ,
  kInvalid = 32
}
 This enumeration should list all defined status bits, as well as a short documentation of their meaning. More...
 
enum class  FragmentType : fragment_type_t {
  kUnknown = 0 , kProtoWIB = 1 , kWIB = 2 , kDAPHNE = 3 ,
  kTDE_AMC = 4 , kFW_TriggerPrimitive = 5 , kTriggerPrimitive = 6 , kTriggerActivity = 7 ,
  kTriggerCandidate = 8 , kHardwareSignal = 9 , kPACMAN = 10 , kMPD = 11 ,
  kWIBEth = 12 , kDAPHNEStream = 13 , kCRT = 14 , kTDEEth = 15 ,
  kCRTBern = 16 , kCRTGrenoble = 17 , kDAPHNEEth = 18 , kDAPHNEEthStream = 19
}
 This enumeration should list all defined Fragment types. More...
 
enum class  TriggerRecordStatusBits : size_t {
  kIncomplete = 0 , kMismatch = 1 , kUnassigned2 = 2 , kUnassigned3 = 3 ,
  kUnassigned4 = 4 , kUnassigned5 = 5 , kUnassigned6 = 6 , kUnassigned7 = 7 ,
  kUnassigned8 = 8 , kUnassigned9 = 9 , kUnassigned10 = 10 , kUnassigned11 = 11 ,
  kUnassigned12 = 12 , kUnassigned13 = 13 , kUnassigned14 = 14 , kUnassigned15 = 15 ,
  kUnassigned16 = 16 , kUnassigned17 = 17 , kUnassigned18 = 18 , kUnassigned19 = 19 ,
  kUnassigned20 = 20 , kUnassigned21 = 21 , kUnassigned22 = 22 , kUnassigned23 = 23 ,
  kUnassigned24 = 24 , kUnassigned25 = 25 , kUnassigned26 = 26 , kUnassigned27 = 27 ,
  kUnassigned28 = 28 , kUnassigned29 = 29 , kUnassigned30 = 30 , kUnassigned31 = 31 ,
  kInvalid = 32
}
 This enumeration should list all defined status bits, as well as a short documentation of their meaning. More...
 

Functions

std::ostream & operator<< (std::ostream &o, ComponentRequest const &cr)
 Write out a ComponentRequest in human-readable form.
 
std::istream & operator>> (std::istream &is, ComponentRequest &cr)
 Read a ComponentRequest from a string stream.
 
std::ostream & operator<< (std::ostream &o, SourceID::Subsystem const &type)
 Stream a Subsystem instance in a human-readable form.
 
std::ostream & operator<< (std::ostream &o, SourceID const &source_id)
 Stream a SourceID instance in a human-readable form.
 
std::istream & operator>> (std::istream &is, SourceID::Subsystem &t)
 Read a SourceID::Subsystem from a string stream.
 
std::istream & operator>> (std::istream &is, SourceID &source_id)
 Read a SourceID from a string stream.
 
std::map< FragmentType, std::string > get_fragment_type_names ()
 This map relates FragmentType values to string names.
 
std::string fragment_type_to_string (const FragmentType &type)
 Convert a FragmentType enum value to string.
 
FragmentType string_to_fragment_type (const std::string &name)
 Convert a string to a FragmentType value.
 
std::ostream & operator<< (std::ostream &o, FragmentHeader const &hdr)
 Stream a Fragment Header in human-readable form.
 
std::istream & operator>> (std::istream &o, FragmentHeader &hdr)
 Read a FragmentHeader instance from a string stream.
 
std::ostream & operator<< (std::ostream &o, TimeSliceHeader const &hdr)
 Stream a TimeSliceHeader instance in human-readable form.
 
std::istream & operator>> (std::istream &o, TimeSliceHeader &hdr)
 Read a TimeSliceHeader instance from a string stream.
 
std::ostream & operator<< (std::ostream &o, TriggerRecordHeaderData const &hdr)
 Stream a TriggerRecordHeaderData instance in human-readable form.
 
std::istream & operator>> (std::istream &o, TriggerRecordHeaderData &hdr)
 Read a TriggerRecordHeaderData instance from a string stream.
 

Typedef Documentation

◆ fragment_size_t

Type used to represent Fragment size.

Definition at line 32 of file Types.hpp.

◆ fragment_type_t

Type used to represent Fragment type ID.

Definition at line 28 of file Types.hpp.

◆ run_number_t

Type used to represent run number.

Definition at line 20 of file Types.hpp.

◆ sequence_number_t

Type used to represent sequence within a trigger record.

Definition at line 48 of file Types.hpp.

◆ timeslice_number_t

Type used to represent timeslice number.

Definition at line 52 of file Types.hpp.

◆ timestamp_diff_t

Used to represent differences between timestamps.

Definition at line 37 of file Types.hpp.

◆ timestamp_t

Type used to represent DUNE timing system timestamps.

Definition at line 36 of file Types.hpp.

◆ trigger_number_t

Type used to represent trigger number.

Definition at line 24 of file Types.hpp.

◆ trigger_type_t

Type used to represent Trigger Decision trigger types.

This field is a bitset mapping to this enum: https://github.com/DUNE-DAQ/trgdataformats/blob/develop/include/trgdataformats/TriggerCandidateData.hpp#L22

Definition at line 44 of file Types.hpp.

Enumeration Type Documentation

◆ FragmentStatusBits

enum class dunedaq::daqdataformats::FragmentStatusBits : size_t
strong

This enumeration should list all defined status bits, as well as a short documentation of their meaning.

Enumerator
kLatencyBufferEmpty 

The latency buffer had zero occupancy when the data request was made.

kIncomplete 

Only part of the requested data is present in the fragment.

kInvalidRequestWindow 

The requested data window was too large.

kRequestTimeout 

A timeout occurred while processing the data request.

kRequestWindowBeforeBuffer 

The request window extends before the latency buffer start.

kRequestWindowAfterBuffer 

The request window extends after the latency buffer end.

kEmptyFragment 

This Fragment contains no data.

kUnassigned7 

Status bit 7 is not assigned.

kUnassigned8 

Status bit 8 is not assigned.

kUnassigned9 

Status bit 9 is not assigned.

kUnassigned10 

Status bit 10 is not assigned.

kUnassigned11 

Status bit 11 is not assigned.

kUnassigned12 

Status bit 12 is not assigned.

kUnassigned13 

Status bit 13 is not assigned.

kUnassigned14 

Status bit 14 is not assigned.

kUnassigned15 

Status bit 15 is not assigned.

kUnassigned16 

Status bit 16 is not assigned.

kUnassigned17 

Status bit 17 is not assigned.

kUnassigned18 

Status bit 18 is not assigned.

kUnassigned19 

Status bit 19 is not assigned.

kUnassigned20 

Status bit 20 is not assigned.

kUnassigned21 

Status bit 21 is not assigned.

kUnassigned22 

Status bit 22 is not assigned.

kUnassigned23 

Status bit 23 is not assigned.

kUnassigned24 

Status bit 24 is not assigned.

kUnassigned25 

Status bit 25 is not assigned.

kUnassigned26 

Status bit 26 is not assigned.

kUnassigned27 

Status bit 27 is not assigned.

kUnassigned28 

Status bit 28 is not assigned.

kUnassigned29 

Status bit 29 is not assigned.

kUnassigned30 

Status bit 30 is not assigned.

kUnassigned31 

Status bit 31 is not assigned.

kInvalid 

Status bit 32 and higher are not valid (status_bits is only 32 bits)

Definition at line 144 of file FragmentHeader.hpp.

145{
147 kIncomplete = 1,
149 kRequestTimeout = 3,
152 kEmptyFragment = 6,
153 kUnassigned7 = 7,
154 kUnassigned8 = 8,
155 kUnassigned9 = 9,
156 kUnassigned10 = 10,
157 kUnassigned11 = 11,
158 kUnassigned12 = 12,
159 kUnassigned13 = 13,
160 kUnassigned14 = 14,
161 kUnassigned15 = 15,
162 kUnassigned16 = 16,
163 kUnassigned17 = 17,
164 kUnassigned18 = 18,
165 kUnassigned19 = 19,
166 kUnassigned20 = 20,
167 kUnassigned21 = 21,
168 kUnassigned22 = 22,
169 kUnassigned23 = 23,
170 kUnassigned24 = 24,
171 kUnassigned25 = 25,
172 kUnassigned26 = 26,
173 kUnassigned27 = 27,
174 kUnassigned28 = 28,
175 kUnassigned29 = 29,
176 kUnassigned30 = 30,
177 kUnassigned31 = 31,
178 kInvalid = 32
179};
@ kUnassigned20
Status bit 20 is not assigned.
@ kUnassigned13
Status bit 13 is not assigned.
@ kUnassigned26
Status bit 26 is not assigned.
@ kUnassigned14
Status bit 14 is not assigned.
@ kRequestWindowBeforeBuffer
The request window extends before the latency buffer start.
@ kUnassigned16
Status bit 16 is not assigned.
@ kUnassigned27
Status bit 27 is not assigned.
@ kUnassigned10
Status bit 10 is not assigned.
@ kIncomplete
Only part of the requested data is present in the fragment.
@ kUnassigned9
Status bit 9 is not assigned.
@ kUnassigned24
Status bit 24 is not assigned.
@ kInvalidRequestWindow
The requested data window was too large.
@ kLatencyBufferEmpty
The latency buffer had zero occupancy when the data request was made.
@ kUnassigned7
Status bit 7 is not assigned.
@ kUnassigned28
Status bit 28 is not assigned.
@ kUnassigned21
Status bit 21 is not assigned.
@ kUnassigned31
Status bit 31 is not assigned.
@ kRequestWindowAfterBuffer
The request window extends after the latency buffer end.
@ kInvalid
Status bit 32 and higher are not valid (status_bits is only 32 bits)
@ kUnassigned18
Status bit 18 is not assigned.
@ kUnassigned25
Status bit 25 is not assigned.
@ kUnassigned19
Status bit 19 is not assigned.
@ kEmptyFragment
This Fragment contains no data.
@ kRequestTimeout
A timeout occurred while processing the data request.
@ kUnassigned29
Status bit 29 is not assigned.
@ kUnassigned23
Status bit 23 is not assigned.
@ kUnassigned11
Status bit 11 is not assigned.
@ kUnassigned15
Status bit 15 is not assigned.
@ kUnassigned17
Status bit 17 is not assigned.
@ kUnassigned22
Status bit 22 is not assigned.
@ kUnassigned12
Status bit 12 is not assigned.
@ kUnassigned30
Status bit 30 is not assigned.
@ kUnassigned8
Status bit 8 is not assigned.

◆ FragmentType

This enumeration should list all defined Fragment types.

Enumerator
kUnknown 
kProtoWIB 
kWIB 
kDAPHNE 
kTDE_AMC 
kFW_TriggerPrimitive 

FW TP frame format.

kTriggerPrimitive 

Trigger format TPs produced by trigger code.

kTriggerActivity 
kTriggerCandidate 
kHardwareSignal 
kPACMAN 
kMPD 
kWIBEth 
kDAPHNEStream 
kCRT 
kTDEEth 
kCRTBern 
kCRTGrenoble 
kDAPHNEEth 
kDAPHNEEthStream 

Definition at line 184 of file FragmentHeader.hpp.

185{
186 kUnknown = 0,
187 kProtoWIB = 1,
188 kWIB = 2,
189 kDAPHNE = 3,
190 kTDE_AMC = 4,
191 // This fragment type is for the "raw" data from the firmware
192 // trigger primitive generation. We store this in fragments for the
193 // purposes of inspecting/debugging the firmware TPG
195 // This fragment type is for TPs saved via the trigger subsystem's
196 // TP buffer, which are in the format defined by
197 // dunedaq::trgdataformats::TriggerPrimitive. It is also
198 // used for the stream of TPs that are sent directly from the readout
199 // subsystem to the dataflow subsystem for storage on disk.
200 // TPs stored in this format may have been _originally_ produced
201 // by either software _or_ firmware.
205 kHardwareSignal = 9,
206 kPACMAN = 10,
207 kMPD = 11,
208 kWIBEth = 12,
209 kDAPHNEStream = 13,
210 kCRT = 14,
211 kTDEEth = 15,
212 kCRTBern = 16,
213 kCRTGrenoble = 17,
214 kDAPHNEEth = 18,
216};
@ kTriggerPrimitive
Trigger format TPs produced by trigger code.
@ kFW_TriggerPrimitive
FW TP frame format.

◆ TriggerRecordStatusBits

This enumeration should list all defined status bits, as well as a short documentation of their meaning.

Enumerator
kIncomplete 

Indicates a trigger record that is missing requested components.

kMismatch 

We have as many fragments as requested but they do not match the requested components.

kUnassigned2 

Status bit 2 is not assigned.

kUnassigned3 

Status bit 3 is not assigned.

kUnassigned4 

Status bit 4 is not assigned.

kUnassigned5 

Status bit 5 is not assigned.

kUnassigned6 

Status bit 6 is not assigned.

kUnassigned7 

Status bit 7 is not assigned.

kUnassigned8 

Status bit 8 is not assigned.

kUnassigned9 

Status bit 9 is not assigned.

kUnassigned10 

Status bit 10 is not assigned.

kUnassigned11 

Status bit 11 is not assigned.

kUnassigned12 

Status bit 12 is not assigned.

kUnassigned13 

Status bit 13 is not assigned.

kUnassigned14 

Status bit 14 is not assigned.

kUnassigned15 

Status bit 15 is not assigned.

kUnassigned16 

Status bit 16 is not assigned.

kUnassigned17 

Status bit 17 is not assigned.

kUnassigned18 

Status bit 18 is not assigned.

kUnassigned19 

Status bit 19 is not assigned.

kUnassigned20 

Status bit 20 is not assigned.

kUnassigned21 

Status bit 21 is not assigned.

kUnassigned22 

Status bit 22 is not assigned.

kUnassigned23 

Status bit 23 is not assigned.

kUnassigned24 

Status bit 24 is not assigned.

kUnassigned25 

Status bit 25 is not assigned.

kUnassigned26 

Status bit 26 is not assigned.

kUnassigned27 

Status bit 27 is not assigned.

kUnassigned28 

Status bit 28 is not assigned.

kUnassigned29 

Status bit 29 is not assigned.

kUnassigned30 

Status bit 30 is not assigned.

kUnassigned31 

Status bit 31 is not assigned.

kInvalid 

Status bit 32 and higher are not valid (status_bits is only 32 bits)

Definition at line 140 of file TriggerRecordHeaderData.hpp.

141{
142 kIncomplete = 0,
143 kMismatch = 1,
144 kUnassigned2 = 2,
145 kUnassigned3 = 3,
146 kUnassigned4 = 4,
147 kUnassigned5 = 5,
148 kUnassigned6 = 6,
149 kUnassigned7 = 7,
150 kUnassigned8 = 8,
151 kUnassigned9 = 9,
152 kUnassigned10 = 10,
153 kUnassigned11 = 11,
154 kUnassigned12 = 12,
155 kUnassigned13 = 13,
156 kUnassigned14 = 14,
157 kUnassigned15 = 15,
158 kUnassigned16 = 16,
159 kUnassigned17 = 17,
160 kUnassigned18 = 18,
161 kUnassigned19 = 19,
162 kUnassigned20 = 20,
163 kUnassigned21 = 21,
164 kUnassigned22 = 22,
165 kUnassigned23 = 23,
166 kUnassigned24 = 24,
167 kUnassigned25 = 25,
168 kUnassigned26 = 26,
169 kUnassigned27 = 27,
170 kUnassigned28 = 28,
171 kUnassigned29 = 29,
172 kUnassigned30 = 30,
173 kUnassigned31 = 31,
174 kInvalid = 32
175};
@ kUnassigned6
Status bit 6 is not assigned.
@ kMismatch
We have as many fragments as requested but they do not match the requested components.
@ kUnassigned4
Status bit 4 is not assigned.
@ kUnassigned2
Status bit 2 is not assigned.
@ kUnassigned3
Status bit 3 is not assigned.
@ kUnassigned5
Status bit 5 is not assigned.

Function Documentation

◆ fragment_type_to_string()

std::string dunedaq::daqdataformats::fragment_type_to_string ( const FragmentType & type)
inline

Convert a FragmentType enum value to string.

Parameters
typeType to convert
Returns
String representation of the given type

Definition at line 256 of file FragmentHeader.hpp.

257{
258 try {
259 return get_fragment_type_names().at(type);
260 } catch (std::exception& e) {
261 }
262 return "Unknown";
263}
std::map< FragmentType, std::string > get_fragment_type_names()
This map relates FragmentType values to string names.

◆ get_fragment_type_names()

std::map< FragmentType, std::string > dunedaq::daqdataformats::get_fragment_type_names ( )
inline

This map relates FragmentType values to string names.

These names can be used, for example, as HDF5 Group names

Definition at line 224 of file FragmentHeader.hpp.

225{
226 return {
227 { FragmentType::kUnknown, "Unknown" },
228 { FragmentType::kProtoWIB, "ProtoWIB" },
229 { FragmentType::kWIB, "WIB" },
230 { FragmentType::kDAPHNE, "DAPHNE" },
231 { FragmentType::kDAPHNEStream, "DAPHNEStream" },
232 { FragmentType::kTDE_AMC, "TDE_AMC" },
233 { FragmentType::kFW_TriggerPrimitive, "FW_Trigger_Primitive" },
234 { FragmentType::kTriggerPrimitive, "Trigger_Primitive" },
235 { FragmentType::kTriggerActivity, "Trigger_Activity" },
236 { FragmentType::kTriggerCandidate, "Trigger_Candidate" },
237 { FragmentType::kHardwareSignal, "Hardware_Signal" },
238 { FragmentType::kPACMAN, "PACMAN" },
239 { FragmentType::kMPD, "MPD" },
240 { FragmentType::kWIBEth, "WIBEth" },
241 { FragmentType::kCRT, "CRT" },
242 { FragmentType::kTDEEth, "TDEEth" },
243 { FragmentType::kCRTBern, "CRTBern" },
244 { FragmentType::kCRTGrenoble, "CRTGrenoble" },
245 { FragmentType::kDAPHNEEth, "DAPHNEEth" },
246 { FragmentType::kDAPHNEEthStream, "DAPHNEEthStream" },
247 };
248}

◆ operator<<() [1/6]

std::ostream & dunedaq::daqdataformats::operator<< ( std::ostream & o,
ComponentRequest const & cr )
inline

Write out a ComponentRequest in human-readable form.

Parameters
oOutput stream
crComponentRequest to write
Returns
Stream instance for continued streaming

Definition at line 70 of file ComponentRequest.hpp.

72{
73 return o << cr.component << ", begin: " << cr.window_begin << ", end: " << cr.window_end;
74}

◆ operator<<() [2/6]

std::ostream & dunedaq::daqdataformats::operator<< ( std::ostream & o,
FragmentHeader const & hdr )
inline

Stream a Fragment Header in human-readable form.

Parameters
oStream to write to
hdrFragmentHeader to stream
Returns
Stream instance for further streaming

Definition at line 286 of file FragmentHeader.hpp.

288{
289 return o << "check_word: " << std::hex << hdr.fragment_header_marker << std::dec << ", " << "version: " << hdr.version
290 << ", " << "size: " << hdr.size << ", " << "trigger_number: " << hdr.trigger_number << ", "
291 << "run_number: " << hdr.run_number << ", " << "trigger_timestamp: " << hdr.trigger_timestamp << ", "
292 << "window_begin: " << hdr.window_begin << ", " << "window_end: " << hdr.window_end << ", "
293 << "status_bits: " << hdr.status_bits << ", " << "fragment_type: " << hdr.fragment_type << ", "
294 << "sequence_number: " << hdr.sequence_number << ", " << "detector_id: " << hdr.detector_id << ", "
295 << "element_id: " << hdr.element_id;
296}

◆ operator<<() [3/6]

std::ostream & dunedaq::daqdataformats::operator<< ( std::ostream & o,
SourceID const & source_id )
inline

Stream a SourceID instance in a human-readable form.

Parameters
oStream to output to
idSourceID to stream
Returns
Stream instance for further streaming

Definition at line 30 of file SourceID.hxx.

32{
33 return o << "subsystem: " << source_id.subsystem << " id: " << source_id.id;
34}

◆ operator<<() [4/6]

std::ostream & dunedaq::daqdataformats::operator<< ( std::ostream & o,
SourceID::Subsystem const & type )
inline

Stream a Subsystem instance in a human-readable form.

Parameters
oStream to output to
idSubsystem to stream
Returns
Stream instance for further streaming

Definition at line 18 of file SourceID.hxx.

20{
21 return o << SourceID::subsystem_to_string(type);
22}

◆ operator<<() [5/6]

std::ostream & dunedaq::daqdataformats::operator<< ( std::ostream & o,
TimeSliceHeader const & hdr )
inline

Stream a TimeSliceHeader instance in human-readable form.

Parameters
oStream to write to
hdrTimeSliceHeader to write
Returns
Stream instance for continued streaming

Definition at line 82 of file TimeSliceHeader.hpp.

84{
85 return o << "check_word: " << std::hex << hdr.timeslice_header_marker << std::dec << ", "
86 << "version: " << hdr.version << ", "
87
88 << "timeslice_number: " << hdr.timeslice_number << ", "
89 << "run_number: " << hdr.run_number << ", "
90 << "element_id: { " << hdr.element_id << " }";
91}

◆ operator<<() [6/6]

std::ostream & dunedaq::daqdataformats::operator<< ( std::ostream & o,
TriggerRecordHeaderData const & hdr )
inline

Stream a TriggerRecordHeaderData instance in human-readable form.

Parameters
oStream to write to
hdrTriggerRecordHeaderData to write
Returns
Stream instance for continued streaming

Definition at line 183 of file TriggerRecordHeaderData.hpp.

185{
186 return o << "check_word: " << std::hex << hdr.trigger_record_header_marker << std::dec << ", "
187 << "version: " << hdr.version << ", "
188
189 << "trigger_number: " << hdr.trigger_number << ", " << "run_number: " << hdr.run_number << ", "
190 << "trigger_timestamp: " << hdr.trigger_timestamp << ", " << "trigger_type: " << hdr.trigger_type << ", "
191
192 << "status_bits: " << hdr.status_bits << ", "
193
194 << "num_requested_components: " << hdr.num_requested_components << ", "
195 << "sequence_number: " << hdr.sequence_number << ", " << "max_sequence_number: " << hdr.max_sequence_number
196 << ", " << "element_id: { " << hdr.element_id << " }";
197}

◆ operator>>() [1/6]

std::istream & dunedaq::daqdataformats::operator>> ( std::istream & is,
ComponentRequest & cr )
inline

Read a ComponentRequest from a string stream.

Parameters
isInput stream
crComponentRequest to read
Returns
Stream instance for continued streaming

Definition at line 83 of file ComponentRequest.hpp.

84{
85 std::string tmp;
86 return is >> cr.component >> tmp >> tmp >> cr.window_begin >> tmp >> tmp >> cr.window_end;
87}
timestamp_t window_end
End of the data collection window.
SourceID component
The Requested Component.
timestamp_t window_begin
Start of the data collection window.

◆ operator>>() [2/6]

std::istream & dunedaq::daqdataformats::operator>> ( std::istream & is,
SourceID & source_id )
inline

Read a SourceID from a string stream.

Parameters
isStream to read from
idSourceID to fill
Returns
Stream instance for further streaming

Definition at line 60 of file SourceID.hxx.

61{
62 std::string tmp ;
63 is >> tmp >> source_id.subsystem >> tmp >> source_id.id; // Eat last three tokens, e.g. "-> (314, 159)"
64
65 return is;
66}
Subsystem subsystem
The general subsystem of the source of the data.
Definition SourceID.hpp:69
ID_t id
Unique identifier of the source of the data.
Definition SourceID.hpp:74

◆ operator>>() [3/6]

std::istream & dunedaq::daqdataformats::operator>> ( std::istream & is,
SourceID::Subsystem & t )
inline

Read a SourceID::Subsystem from a string stream.

Parameters
isStream to read from
idSubsystem to fill
Returns
Stream instance for further streaming

Definition at line 43 of file SourceID.hxx.

44{
45 std::string tmp;
46 is >> tmp;
47
48 t = SourceID::string_to_subsystem(tmp);
49
50 return is;
51}

◆ operator>>() [4/6]

std::istream & dunedaq::daqdataformats::operator>> ( std::istream & o,
FragmentHeader & hdr )
inline

Read a FragmentHeader instance from a string stream.

Parameters
isStream to read from
hdrFragmentHeader to read
Returns
Stream instance for continued streaming

Definition at line 305 of file FragmentHeader.hpp.

306{
307 std::string tmp;
308 return o >> tmp >> std::hex >> hdr.fragment_header_marker >> std::dec >> tmp >> tmp >> hdr.version >> tmp >> tmp >>
309 hdr.size >> tmp >> tmp >> hdr.trigger_number >> tmp >> tmp >> hdr.run_number >> tmp >> tmp >>
310 hdr.trigger_timestamp >> tmp >> tmp >> hdr.window_begin >> tmp >> tmp >> hdr.window_end >> tmp >> tmp >>
311 hdr.status_bits >> tmp >> tmp >> hdr.fragment_type >> tmp >> tmp >> hdr.sequence_number >> tmp >> tmp >>
312 hdr.detector_id >> tmp >> tmp >> hdr.element_id;
313}
timestamp_t trigger_timestamp
Timestamp of the TriggerDecision.
fragment_type_t fragment_type
Type of the Fragment, indicating the format of the contained payload.
SourceID element_id
Component that generated the data in this Fragment.
uint16_t detector_id
Identifier for the subdetector that produced the raw data in the Fragment payload.
uint32_t fragment_header_marker
Marker Bytes used to identify FragmentHeaders in a raw data stream.
uint32_t version
Version of the FragmentHeader.
run_number_t run_number
Run number this Fragment is associated with.
sequence_number_t sequence_number
Sequence number of this Fragment within a trigger record.
uint32_t status_bits
Status bits set by the Upstream DAQ.
trigger_number_t trigger_number
Trigger Number this Fragment is associated with.
timestamp_t window_end
Window end of data in the Fragment.
timestamp_t window_begin
Window begin of data in the Fragment.
fragment_size_t size
Size of the Fragment (including header and payload)

◆ operator>>() [5/6]

std::istream & dunedaq::daqdataformats::operator>> ( std::istream & o,
TimeSliceHeader & hdr )
inline

Read a TimeSliceHeader instance from a string stream.

Parameters
isStream to read from
hdrTimeSliceHeader toread
Returns
Stream instance for continued streaming

Definition at line 100 of file TimeSliceHeader.hpp.

101{
102 std::string tmp;
103 return o >> tmp >> std::hex >> hdr.timeslice_header_marker >> std::dec >> tmp >> tmp >> hdr.version >> tmp >> tmp >>
104 hdr.timeslice_number >> tmp >> tmp >> hdr.run_number >> tmp >> tmp >> tmp >> hdr.element_id;
105}
run_number_t run_number
Run Number for the TimeSlice.
uint32_t version
Version of the TimeSliceHeader structure.
uint32_t timeslice_header_marker
Marker bytes used to identify a TimeSliceHeader struct in a raw data stream.
timeslice_number_t timeslice_number
Slice number of this TimeSlice within the stream.

◆ operator>>() [6/6]

std::istream & dunedaq::daqdataformats::operator>> ( std::istream & o,
TriggerRecordHeaderData & hdr )
inline

Read a TriggerRecordHeaderData instance from a string stream.

Parameters
isStream to read from
hdrTriggerRecordHeaderData toread
Returns
Stream instance for continued streaming

Definition at line 206 of file TriggerRecordHeaderData.hpp.

207{
208 std::string tmp;
209 return o >> tmp >> std::hex >> hdr.trigger_record_header_marker >> std::dec >> tmp >> tmp >> hdr.version >> tmp >>
210 tmp >> hdr.trigger_number >> tmp >> tmp >> hdr.run_number >> tmp >> tmp >> hdr.trigger_timestamp >> tmp >>
211 tmp >> hdr.trigger_type >> tmp >> tmp >> hdr.status_bits >> tmp >> tmp >> hdr.num_requested_components >>
212 tmp >> tmp >> hdr.sequence_number >> tmp >> tmp >> hdr.max_sequence_number >> tmp >> tmp >> tmp >>
213 hdr.element_id;
214}
uint32_t version
Version of the TriggerRecordHeaderData structure.
sequence_number_t max_sequence_number
Maximum sequence number of TriggerRecords corresponding to this trigger.
sequence_number_t sequence_number
Sequence number of this TriggerRecord within the trigger response.
timestamp_t trigger_timestamp
Timestamp of the TriggerDecision.
uint64_t num_requested_components
Number of ComponentRequest objects stored in the TriggerRecordHeader.
uint32_t status_bits
Status bits for the TriggerRecord.
trigger_type_t trigger_type
Type of the TriggerDecision.
uint32_t trigger_record_header_marker
Magic bytes used to identify a TriggerRecordHeaderData struct in a raw data stream.
run_number_t run_number
Run Number for the TriggerRecord.

◆ string_to_fragment_type()

FragmentType dunedaq::daqdataformats::string_to_fragment_type ( const std::string & name)
inline

Convert a string to a FragmentType value.

Parameters
nameName of the type
Returns
FragmentType corresponding to given string

Definition at line 271 of file FragmentHeader.hpp.

272{
273 for (auto& it : get_fragment_type_names()) {
274 if (it.second == name)
275 return it.first;
276 }
277 return FragmentType::kUnknown;
278}