DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TAWrapper.hpp
Go to the documentation of this file.
1
9#ifndef TRIGGER_INCLUDE_TRIGGER_TAWRAPPER_HPP_
10#define TRIGGER_INCLUDE_TRIGGER_TAWRAPPER_HPP_
11
17
18namespace dunedaq {
19namespace trigger {
20 struct TAWrapper
21 {
22
24
26 std::vector<uint8_t> activity_overlay_buffer;
27
28 // Don't really want this default ctor, but IterableQueueModel requires it
29 //TAWrapper() {}
30
36
42
43 // comparable based on first timestamp
44 bool operator<(const TAWrapper& other) const
45 {
46 return std::tie(this->activity.time_start, this->activity.channel_start) < std::tie(other.activity.time_start, other.activity.channel_start);
47 }
48
49 uint64_t get_timestamp() const // NOLINT(build/unsigned)
50 {
51 return activity.time_start;
52 }
53
54 void set_timestamp(uint64_t ts) // NOLINT(build/unsigned)
55 {
57 }
58
59 void fake_timestamps(uint64_t first_timestamp, uint64_t /*offset */ = 0) // NOLINT(build/unsigned)
60 {
61 activity.time_start = first_timestamp;
63 }
64
65 size_t get_payload_size() { return activity_overlay_buffer.size(); }
66
67 size_t get_num_frames() { return 1; }
68
69 size_t get_frame_size() { return get_payload_size(); }
70
72 {
73 return (TAWrapper*)(activity_overlay_buffer.data());
74 }
75
77 {
79 }
80
83 // No idea what this should really be set to
84 static const constexpr uint64_t expected_tick_difference = 1; // NOLINT(build/unsigned)
85
86};
87
88} // namespace trigger
89} // namespace dunedaq
90/*
91namespace dunedaq {
92namespace datahandlinglibs {
93
94template<>
95uint64_t
96get_frame_iterator_timestamp(uint8_t* it)
97{
98 trgdataformats::TriggerActivity* activity = reinterpret_cast<trgdataformats::TriggerActivity*>(it);
99 return activity->data.time_start;
100}
101
102}
103}
104*/
105#endif // TRIGGER_INCLUDE_TRIGGER_TAWRAPPER_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
static const constexpr daqdataformats::SourceID::Subsystem subsystem
Definition TAWrapper.hpp:81
static const constexpr daqdataformats::FragmentType fragment_type
Definition TAWrapper.hpp:82
void set_timestamp(uint64_t ts)
Definition TAWrapper.hpp:54
std::vector< uint8_t > activity_overlay_buffer
Definition TAWrapper.hpp:26
static const constexpr uint64_t expected_tick_difference
Definition TAWrapper.hpp:84
triggeralgs::TriggerActivity activity
Definition TAWrapper.hpp:25
bool operator<(const TAWrapper &other) const
Definition TAWrapper.hpp:44
void fake_timestamps(uint64_t first_timestamp, uint64_t=0)
Definition TAWrapper.hpp:59
uint64_t get_timestamp() const
Definition TAWrapper.hpp:49
TAWrapper(triggeralgs::TriggerActivity a=triggeralgs::TriggerActivity())
Definition TAWrapper.hpp:31