DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
FragmentHeader.hpp
Go to the documentation of this file.
1
10
11#ifndef DAQDATAFORMATS_INCLUDE_DAQDATAFORMATS_FRAGMENTHEADER_HPP_
12#define DAQDATAFORMATS_INCLUDE_DAQDATAFORMATS_FRAGMENTHEADER_HPP_
13
16
17#include <bitset>
18#include <cstddef>
19#include <cstdlib>
20#include <map>
21#include <numeric>
22#include <string>
23#include <vector>
24
26
73
111
114{
117 kWIB = 2,
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.
136 kMPD = 11,
139 kCRT = 14,
145};
146
152inline std::map<FragmentType, std::string>
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}
178
179std::string
181
183string_to_fragment_type(const std::string& name);
184
185std::ostream&
186operator<<(std::ostream& o, FragmentHeader const& hdr);
187
188} // namespace dunedaq::daqdataformats
189
191
192#endif // DAQDATAFORMATS_INCLUDE_DAQDATAFORMATS_FRAGMENTHEADER_HPP_
FragmentType
All defined Fragment types.
@ kTriggerPrimitive
Trigger format TPs produced by trigger code.
uint64_t trigger_number_t
Definition Types.hpp:18
FragmentType string_to_fragment_type(const std::string &name)
uint16_t sequence_number_t
Type used to represent sequence within a trigger record.
Definition Types.hpp:38
std::string fragment_type_to_string(const FragmentType &type)
uint64_t timestamp_t
Type used to represent DUNE timing system timestamps.
Definition Types.hpp:26
uint32_t fragment_type_t
Type used to represent Fragment type ID.
Definition Types.hpp:21
uint64_t fragment_size_t
Definition Types.hpp:23
std::ostream & operator<<(std::ostream &o, ComponentRequest const &cr)
std::map< FragmentType, std::string > get_fragment_type_names()
This map relates FragmentType values to string names.
FragmentStatusBits
All defined status bits, with a short documentation of their meaning if non-obvious.
@ 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.
The header for a DUNE Fragment.
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.
static constexpr uint32_t s_fragment_header_marker
Marker bytes to identify a FragmentHeader entry in a raw data stream.
static constexpr uint32_t s_default_status_bits
sequence_number_t sequence_number
Sequence number of this Fragment within a trigger record.
static constexpr uint32_t s_fragment_header_version
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).
SourceID is a generalized representation of the source of a piece of data in the DAQ....
Definition SourceID.hpp:32
static constexpr sequence_number_t s_invalid_sequence_number
Definition Types.hpp:56
static constexpr trigger_number_t s_invalid_trigger_number
Definition Types.hpp:48
static constexpr fragment_type_t s_invalid_fragment_type
Definition Types.hpp:49
static constexpr fragment_size_t s_invalid_fragment_size
Invalid size for a Fragment (as FragmentHeader is counted as well).
Definition Types.hpp:50
static constexpr timestamp_t s_invalid_timestamp
Definition Types.hpp:52
static constexpr run_number_t s_invalid_run_number
Definition Types.hpp:47