DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TCWrapper.hpp
Go to the documentation of this file.
1
9#ifndef TRIGGER_INCLUDE_TRIGGER_TCWRAPPER_HPP_
10#define TRIGGER_INCLUDE_TRIGGER_TCWRAPPER_HPP_
11
13
17
18namespace dunedaq {
19namespace trigger {
20 struct TCWrapper
21 {
24 std::vector<uint8_t> candidate_overlay_buffer;
25 // Don't really want this default ctor, but IterableQueueModel requires it
26 //TCWrapper() {}
27
33
39
40 // comparable based on first timestamp
41 bool operator<(const TCWrapper& other) const
42 {
43 return std::tie(this->candidate.time_start, this->candidate.type) < std::tie(other.candidate.time_start, other.candidate.type);
44 }
45
46 uint64_t get_timestamp() const // NOLINT(build/unsigned)
47 {
48 return candidate.time_start;
49 }
50
51 void set_timestamp(uint64_t ts) // NOLINT(build/unsigned)
52 {
54 }
55
56 void fake_timestamps(uint64_t first_timestamp, uint64_t /*offset */ = 0) // NOLINT(build/unsigned)
57 {
58 candidate.time_start = first_timestamp;
60 }
61
62 size_t get_payload_size() { return candidate_overlay_buffer.size(); }
63
64 size_t get_num_frames() { return 1; }
65
66 size_t get_frame_size() { return get_payload_size(); }
67
69 {
70 return (TCWrapper*)(candidate_overlay_buffer.data());
71 }
72
74 {
76 }
77
78 //static const constexpr size_t fixed_payload_size = 5568;
81 // No idea what this should really be set to
82 static const constexpr uint64_t expected_tick_difference = 1; // NOLINT(build/unsigned)
83
84};
85} // namespace trigger
86} // namespace dunedaq
87#endif // TRIGGER_INCLUDE_TRIGGER_TCWRAPPER_HPP_
FragmentType
This enumeration should list all defined Fragment types.
Including Qt Headers.
PDS Frame with unphysical timestamp detected with ts
void write_overlay(const Object &object, void *buffer)
size_t get_overlay_nbytes(const Object &object)
Subsystem
The Subsystem enum describes the kind of source we're dealing with.
Definition SourceID.hpp:43
void set_timestamp(uint64_t ts)
Definition TCWrapper.hpp:51
void fake_timestamps(uint64_t first_timestamp, uint64_t=0)
Definition TCWrapper.hpp:56
TCWrapper(triggeralgs::TriggerCandidate c=triggeralgs::TriggerCandidate())
Definition TCWrapper.hpp:28
bool operator<(const TCWrapper &other) const
Definition TCWrapper.hpp:41
uint64_t get_timestamp() const
Definition TCWrapper.hpp:46
static const constexpr daqdataformats::FragmentType fragment_type
Definition TCWrapper.hpp:80
std::vector< uint8_t > candidate_overlay_buffer
Definition TCWrapper.hpp:24
static const constexpr uint64_t expected_tick_difference
Definition TCWrapper.hpp:82
triggeralgs::TriggerCandidate candidate
Definition TCWrapper.hpp:23
static const constexpr daqdataformats::SourceID::Subsystem subsystem
Definition TCWrapper.hpp:79