DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TriggerPrimitiveTypeAdapter.hpp
Go to the documentation of this file.
1#ifndef TRIGGER_INCLUDE_TRIGGER_TRIGGERPRIMITIVETYPEADAPTER_HPP_
2#define TRIGGER_INCLUDE_TRIGGER_TRIGGERPRIMITIVETYPEADAPTER_HPP_
3
4
9
10#include <cstdint> // uint_t types
11#include <memory> // unique_ptr
12#include <vector>
13#include <cstring> // memcpy
14#include <tuple> // tie
15
16namespace dunedaq {
17namespace trigger {
18
19const constexpr std::size_t kTriggerPrimitiveSize = sizeof(trgdataformats::TriggerPrimitive);
21{
23 // data
25 // comparable based on start timestamp
26 bool operator<(const TriggerPrimitiveTypeAdapter& other) const
27 {
28 return std::tie(this->tp.time_start, this->tp.channel) < std::tie(other.tp.time_start, other.tp.channel);
29 }
30
31 uint64_t get_timestamp() const // NOLINT(build/unsigned)
32 {
33 return tp.time_start;
34 }
35
36 void set_timestamp(uint64_t ts) // NOLINT(build/unsigned)
37 {
39 }
40
41 void fake_timestamps(uint64_t first_timestamp, uint64_t /*offset */ = 0) // NOLINT(build/unsigned)
42 {
43 tp.time_start = first_timestamp;
44 }
45
46 void fake_geoid(uint16_t /*crate_id*/, uint16_t /*slot_id*/, uint16_t /*link_id*/) {}
47
48 void fake_adc_pattern(int /*channel*/) {}
49
50 FrameType* begin() { return this; }
51
52 FrameType* end() { return (this + 1); } // NOLINT
53
55
56 size_t get_num_frames() { return 1; }
57
59
62 static const constexpr uint64_t expected_tick_difference = 1; // NOLINT(build/unsigned)
63};
64
66 "Check your assumptions on TriggerPrimitiveTypeAdapter");
67
68} // namespace trigger
69} // namespace dunedaq
70
71#endif // TRIGGER_INCLUDE_TRIGGER_TRIGGERPRIMITIVETYPEADAPTER_HPP_
FragmentType
This enumeration should list all defined Fragment types.
@ kTriggerPrimitive
Trigger format TPs produced by trigger code.
const constexpr std::size_t kTriggerPrimitiveSize
Including Qt Headers.
PDS Frame with unphysical timestamp detected with ts
Subsystem
The Subsystem enum describes the kind of source we're dealing with.
Definition SourceID.hpp:43
A single energy deposition on a TPC or PDS channel.
static const constexpr daqdataformats::FragmentType fragment_type
static const constexpr daqdataformats::SourceID::Subsystem subsystem
bool operator<(const TriggerPrimitiveTypeAdapter &other) const
void fake_timestamps(uint64_t first_timestamp, uint64_t=0)