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
 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
 Data fields associated with a TriggerRecordHeader. More...
struct  TypeDefaults
 Default values for daqdataformats types. More...

Typedefs

using run_number_t = uint32_t
using trigger_number_t = uint64_t
using fragment_type_t = uint32_t
 Type used to represent Fragment type ID.
using fragment_size_t = uint64_t
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

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
}
 All defined status bits, with a short documentation of their meaning if non-obvious. 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
}
 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 lists all defined status bits, as well as a short documentation of their meaning when not obvious. More...

Functions

std::ostream & operator<< (std::ostream &o, ComponentRequest const &cr)
std::string fragment_type_to_string (const FragmentType &type)
FragmentType string_to_fragment_type (const std::string &name)
std::ostream & operator<< (std::ostream &o, FragmentHeader const &hdr)
std::ostream & operator<< (std::ostream &o, SourceID::Subsystem const &type)
std::ostream & operator<< (std::ostream &o, SourceID const &source_id)
std::istream & operator>> (std::istream &is, SourceID::Subsystem &t)
std::istream & operator>> (std::istream &is, SourceID &source_id)
std::ostream & operator<< (std::ostream &o, TimeSliceHeader const &hdr)
std::ostream & operator<< (std::ostream &o, TriggerRecordHeaderData const &hdr)
std::map< FragmentType, std::string > get_fragment_type_names ()
 This map relates FragmentType values to string names.

Typedef Documentation

◆ fragment_size_t

Definition at line 23 of file Types.hpp.

◆ fragment_type_t

Type used to represent Fragment type ID.

Definition at line 21 of file Types.hpp.

◆ run_number_t

Definition at line 17 of file Types.hpp.

◆ sequence_number_t

Type used to represent sequence within a trigger record.

Definition at line 38 of file Types.hpp.

◆ timeslice_number_t

Definition at line 40 of file Types.hpp.

◆ timestamp_diff_t

Used to represent differences between timestamps.

Definition at line 27 of file Types.hpp.

◆ timestamp_t

Type used to represent DUNE timing system timestamps.

Definition at line 26 of file Types.hpp.

◆ trigger_number_t

Definition at line 18 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 35 of file Types.hpp.

Enumeration Type Documentation

◆ FragmentStatusBits

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

All defined status bits, with a short documentation of their meaning if non-obvious.

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 
kUnassigned8 
kUnassigned9 
kUnassigned10 
kUnassigned11 
kUnassigned12 
kUnassigned13 
kUnassigned14 
kUnassigned15 
kUnassigned16 
kUnassigned17 
kUnassigned18 
kUnassigned19 
kUnassigned20 
kUnassigned21 
kUnassigned22 
kUnassigned23 
kUnassigned24 
kUnassigned25 
kUnassigned26 
kUnassigned27 
kUnassigned28 
kUnassigned29 
kUnassigned30 
kUnassigned31 
kInvalid 

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

Definition at line 75 of file FragmentHeader.hpp.

76{
78 kIncomplete = 1,
80 kRequestTimeout = 3,
83 kEmptyFragment = 6,
84 kUnassigned7 = 7,
85 kUnassigned8 = 8,
86 kUnassigned9 = 9,
87 kUnassigned10 = 10,
88 kUnassigned11 = 11,
89 kUnassigned12 = 12,
90 kUnassigned13 = 13,
91 kUnassigned14 = 14,
92 kUnassigned15 = 15,
93 kUnassigned16 = 16,
94 kUnassigned17 = 17,
95 kUnassigned18 = 18,
96 kUnassigned19 = 19,
97 kUnassigned20 = 20,
98 kUnassigned21 = 21,
99 kUnassigned22 = 22,
100 kUnassigned23 = 23,
101 kUnassigned24 = 24,
102 kUnassigned25 = 25,
103 kUnassigned26 = 26,
104 kUnassigned27 = 27,
105 kUnassigned28 = 28,
106 kUnassigned29 = 29,
107 kUnassigned30 = 30,
108 kUnassigned31 = 31,
109 kInvalid = 32
110};
@ kRequestWindowBeforeBuffer
The request window extends before the latency buffer start.
@ kIncomplete
Only part of the requested data is present in the fragment.
@ kInvalidRequestWindow
The requested data window was too large.
@ kLatencyBufferEmpty
The latency buffer had zero occupancy when the data request was made.
@ 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).
@ kEmptyFragment
This Fragment contains no data.
@ kRequestTimeout
A timeout occurred while processing the data request.

◆ FragmentType

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 113 of file FragmentHeader.hpp.

114{
115 kUnknown = 0,
116 kProtoWIB = 1,
117 kWIB = 2,
118 kDAPHNE = 3,
119 kTDE_AMC = 4,
120 // This fragment type is for the "raw" data from the firmware
121 // trigger primitive generation. We store this in fragments for the
122 // purposes of inspecting/debugging the firmware TPG
124 // This fragment type is for TPs saved via the trigger subsystem's
125 // TP buffer, which are in the format defined by
126 // dunedaq::trgdataformats::TriggerPrimitive. It is also
127 // used for the stream of TPs that are sent directly from the readout
128 // subsystem to the dataflow subsystem for storage on disk.
129 // TPs stored in this format may have been _originally_ produced
130 // by either software _or_ firmware.
134 kHardwareSignal = 9,
135 kPACMAN = 10,
136 kMPD = 11,
137 kWIBEth = 12,
138 kDAPHNEStream = 13,
139 kCRT = 14,
140 kTDEEth = 15,
141 kCRTBern = 16,
142 kCRTGrenoble = 17,
143 kDAPHNEEth = 18,
145};
@ kTriggerPrimitive
Trigger format TPs produced by trigger code.

◆ TriggerRecordStatusBits

This enumeration lists all defined status bits, as well as a short documentation of their meaning when not obvious.

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 
kUnassigned3 
kUnassigned4 
kUnassigned5 
kUnassigned6 
kUnassigned7 
kUnassigned8 
kUnassigned9 
kUnassigned10 
kUnassigned11 
kUnassigned12 
kUnassigned13 
kUnassigned14 
kUnassigned15 
kUnassigned16 
kUnassigned17 
kUnassigned18 
kUnassigned19 
kUnassigned20 
kUnassigned21 
kUnassigned22 
kUnassigned23 
kUnassigned24 
kUnassigned25 
kUnassigned26 
kUnassigned27 
kUnassigned28 
kUnassigned29 
kUnassigned30 
kUnassigned31 
kInvalid 

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

Definition at line 69 of file TriggerRecordHeaderData.hpp.

70{
71 kIncomplete = 0,
72 kMismatch = 1,
73 kUnassigned2 = 2,
74 kUnassigned3 = 3,
75 kUnassigned4 = 4,
76 kUnassigned5 = 5,
77 kUnassigned6 = 6,
78 kUnassigned7 = 7,
79 kUnassigned8 = 8,
80 kUnassigned9 = 9,
81 kUnassigned10 = 10,
82 kUnassigned11 = 11,
83 kUnassigned12 = 12,
84 kUnassigned13 = 13,
85 kUnassigned14 = 14,
86 kUnassigned15 = 15,
87 kUnassigned16 = 16,
88 kUnassigned17 = 17,
89 kUnassigned18 = 18,
90 kUnassigned19 = 19,
91 kUnassigned20 = 20,
92 kUnassigned21 = 21,
93 kUnassigned22 = 22,
94 kUnassigned23 = 23,
95 kUnassigned24 = 24,
96 kUnassigned25 = 25,
97 kUnassigned26 = 26,
98 kUnassigned27 = 27,
99 kUnassigned28 = 28,
100 kUnassigned29 = 29,
101 kUnassigned30 = 30,
102 kUnassigned31 = 31,
103 kInvalid = 32
104};
@ kMismatch
We have as many fragments as requested but they do not match the requested components.

Function Documentation

◆ fragment_type_to_string()

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

Definition at line 36 of file FragmentHeader.hxx.

37{
38 try {
39 return get_fragment_type_names().at(type);
40 } catch (std::exception& e) {
41 }
42 return "Unknown";
43}
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 153 of file FragmentHeader.hpp.

154{
155 return {
156 { FragmentType::kUnknown, "Unknown" },
157 { FragmentType::kProtoWIB, "ProtoWIB" },
158 { FragmentType::kWIB, "WIB" },
159 { FragmentType::kDAPHNE, "DAPHNE" },
160 { FragmentType::kDAPHNEStream, "DAPHNEStream" },
161 { FragmentType::kTDE_AMC, "TDE_AMC" },
162 { FragmentType::kFW_TriggerPrimitive, "FW_Trigger_Primitive" },
163 { FragmentType::kTriggerPrimitive, "Trigger_Primitive" },
164 { FragmentType::kTriggerActivity, "Trigger_Activity" },
165 { FragmentType::kTriggerCandidate, "Trigger_Candidate" },
166 { FragmentType::kHardwareSignal, "Hardware_Signal" },
167 { FragmentType::kPACMAN, "PACMAN" },
168 { FragmentType::kMPD, "MPD" },
169 { FragmentType::kWIBEth, "WIBEth" },
170 { FragmentType::kCRT, "CRT" },
171 { FragmentType::kTDEEth, "TDEEth" },
172 { FragmentType::kCRTBern, "CRTBern" },
173 { FragmentType::kCRTGrenoble, "CRTGrenoble" },
174 { FragmentType::kDAPHNEEth, "DAPHNEEth" },
175 { FragmentType::kDAPHNEEthStream, "DAPHNEEthStream" },
176 };
177}

◆ operator<<() [1/6]

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

Definition at line 22 of file ComponentRequest.hxx.

24{
25 return o << cr.component << ", begin: " << cr.window_begin << ", end: " << cr.window_end;
26}

◆ operator<<() [2/6]

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

Definition at line 55 of file FragmentHeader.hxx.

57{
58 return o << "check_word: " << std::hex << hdr.fragment_header_marker << std::dec << ", " << "version: " << hdr.version
59 << ", " << "size: " << hdr.size << ", " << "trigger_number: " << hdr.trigger_number << ", "
60 << "run_number: " << hdr.run_number << ", " << "trigger_timestamp: " << hdr.trigger_timestamp << ", "
61 << "window_begin: " << hdr.window_begin << ", " << "window_end: " << hdr.window_end << ", "
62 << "status_bits: " << hdr.status_bits << ", " << "fragment_type: " << hdr.fragment_type << ", "
63 << "sequence_number: " << hdr.sequence_number << ", " << "detector_id: " << hdr.detector_id << ", "
64 << "element_id: " << hdr.element_id;
65}

◆ operator<<() [3/6]

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

Definition at line 24 of file SourceID.hxx.

26{
27 return o << "subsystem: " << source_id.subsystem << " id: " << source_id.id;
28}

◆ operator<<() [4/6]

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

Definition at line 18 of file SourceID.hxx.

20{
22}
static std::string subsystem_to_string(const Subsystem &type)
Definition SourceID.hxx:63

◆ operator<<() [5/6]

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

Definition at line 22 of file TimeSliceHeader.hxx.

24{
25 return o << "check_word: " << std::hex << hdr.timeslice_header_marker << std::dec << ", "
26 << "version: " << hdr.version << ", "
27
28 << "timeslice_number: " << hdr.timeslice_number << ", "
29 << "run_number: " << hdr.run_number << ", "
30 << "element_id: { " << hdr.element_id << " }";
31}

◆ operator<<() [6/6]

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

Definition at line 41 of file TriggerRecordHeaderData.hxx.

43{
44 return o << "check_word: " << std::hex << hdr.trigger_record_header_marker << std::dec << ", "
45 << "version: " << hdr.version << ", "
46
47 << "trigger_number: " << hdr.trigger_number << ", " << "run_number: " << hdr.run_number << ", "
48 << "trigger_timestamp: " << hdr.trigger_timestamp << ", " << "trigger_type: " << hdr.trigger_type << ", "
49
50 << "status_bits: " << hdr.status_bits << ", "
51
52 << "num_requested_components: " << hdr.num_requested_components << ", "
53 << "sequence_number: " << hdr.sequence_number << ", " << "max_sequence_number: " << hdr.max_sequence_number
54 << ", " << "element_id: { " << hdr.element_id << " }";
55}

◆ operator>>() [1/2]

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

Definition at line 42 of file SourceID.hxx.

43{
44 std::string tmp;
45 is >> tmp >> source_id.subsystem >> tmp >> source_id.id; // Eat last three tokens, e.g. "-> (314, 159)"
46
47 return is;
48}
Subsystem subsystem
The general subsystem of the source of the data.
Definition SourceID.hpp:56
ID_t id
Unique identifier of the source of the data.
Definition SourceID.hpp:59

◆ operator>>() [2/2]

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

Definition at line 31 of file SourceID.hxx.

32{
33 std::string tmp;
34 is >> tmp;
35
37
38 return is;
39}
static Subsystem string_to_subsystem(const std::string &typestring)
Definition SourceID.hxx:81

◆ string_to_fragment_type()

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

Definition at line 46 of file FragmentHeader.hxx.

47{
48 for (auto& it : get_fragment_type_names()) {
49 if (it.second == name)
50 return it.first;
51 }
53}