DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType > Class Template Reference

#include <DataHandlingModel.hpp>

Inheritance diagram for dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >:
[legend]
Collaboration diagram for dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >:
[legend]

Public Types

using RDT = ReadoutType
 
using RHT = RequestHandlerType
 
using LBT = LatencyBufferType
 
using RPT = RawDataProcessorType
 
using IDT = InputDataType
 
using timestamp_t = std::uint64_t
 
- Public Types inherited from dunedaq::opmonlib::MonitorableObject
using NodePtr = std::weak_ptr<MonitorableObject>
 
using NewNodePtr = std::shared_ptr<MonitorableObject>
 
using ElementId = std::string
 

Public Member Functions

 DataHandlingModel (std::atomic< bool > &run_marker)
 
virtual ~DataHandlingModel ()=default
 
void init (const appmodel::DataHandlerModule *modconf)
 Forward calls from the appfwk.
 
void conf (const nlohmann::json &args)
 
void scrap (const nlohmann::json &args)
 
void start (const nlohmann::json &args)
 
void stop (const nlohmann::json &args)
 
void record (const nlohmann::json &args) override
 
void consume_payload (RDT &&payload)
 
- Public Member Functions inherited from dunedaq::datahandlinglibs::DataHandlingConcept
 DataHandlingConcept ()
 
virtual ~DataHandlingConcept ()
 
 DataHandlingConcept (const DataHandlingConcept &)=delete
 DataHandlingConcept is not copy-constructible.
 
DataHandlingConceptoperator= (const DataHandlingConcept &)=delete
 DataHandlingConcept is not copy-assginable.
 
 DataHandlingConcept (DataHandlingConcept &&)=delete
 DataHandlingConcept is not move-constructible.
 
DataHandlingConceptoperator= (DataHandlingConcept &&)=delete
 DataHandlingConcept is not move-assignable.
 
- Public Member Functions inherited from dunedaq::opmonlib::MonitorableObject
 MonitorableObject (const MonitorableObject &)=delete
 
MonitorableObjectoperator= (const MonitorableObject &)=delete
 
 MonitorableObject (MonitorableObject &&)=delete
 
MonitorableObjectoperator= (MonitorableObject &&)=delete
 
virtual ~MonitorableObject ()=default
 
auto get_opmon_id () const noexcept
 
auto get_opmon_level () const noexcept
 

Public Attributes

std::function< void(RDT &&)> m_consume_callback
 

Static Public Attributes

static constexpr timestamp_t ns = 1
 
static constexpr timestamp_t us = 1000 * ns
 
static constexpr timestamp_t ms = 1000 * us
 
static constexpr timestamp_t s = 1000 * ms
 

Protected Types

using metric_t = dunedaq::datahandlinglibs::opmon::DataHandlerInfo
 
using num_payload_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_payloads),metric_t>::type>::type
 
using sum_payload_t = std::remove_const<std::invoke_result<decltype(&metric_t::sum_payloads),metric_t>::type>::type
 
using num_request_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_requests),metric_t>::type>::type
 
using sum_request_t = std::remove_const<std::invoke_result<decltype(&metric_t::sum_requests),metric_t>::type>::type
 
using rawq_timeout_count_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_data_input_timeouts),metric_t>::type>::type
 
using num_lb_insert_failures_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_lb_insert_failures),metric_t>::type>::type
 
using raw_receiver_ct = iomanager::ReceiverConcept<InputDataType>
 
using request_receiver_ct = iomanager::ReceiverConcept<dfmessages::DataRequest>
 
using timesync_sender_ct = iomanager::SenderConcept<dfmessages::TimeSync>
 

Protected Member Functions

void process_item (RDT &payload)
 
void run_consume ()
 Function that will be run in its own thread to read the raw packets from the connection and add them to the LB.
 
void run_timesync ()
 Function that will be run in its own thread and sends periodic timesync messages by pushing them to the connection.
 
void dispatch_requests (dfmessages::DataRequest &data_request)
 
virtual std::vector< RDTtransform_payload (IDT &original) const
 
virtual void generate_opmon_data () override
 
- Protected Member Functions inherited from dunedaq::opmonlib::MonitorableObject
 MonitorableObject ()=default
 
void register_node (ElementId name, NewNodePtr)
 
void publish (google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept
 

Protected Attributes

std::atomic< bool > & m_run_marker
 
bool m_callback_mode
 
bool m_fake_trigger
 
bool m_generate_timesync = false
 
int m_current_fake_trigger_id
 
daqdataformats::SourceID m_sourceid
 
daqdataformats::run_number_t m_run_number
 
uint64_t m_processing_delay_ticks
 
std::atomic< num_payload_tm_num_payloads { 0 }
 
std::atomic< sum_payload_tm_sum_payloads { 0 }
 
std::atomic< num_request_tm_num_requests { 0 }
 
std::atomic< sum_request_tm_sum_requests { 0 }
 
std::atomic< rawq_timeout_count_tm_rawq_timeout_count { 0 }
 
std::atomic< num_lb_insert_failures_tm_num_lb_insert_failures { 0 }
 
std::atomic< int > m_stats_packet_count { 0 }
 
utilities::ReusableThread m_consumer_thread
 
std::chrono::milliseconds m_raw_receiver_timeout_ms
 
std::chrono::microseconds m_raw_receiver_sleep_us
 
std::shared_ptr< raw_receiver_ctm_raw_data_receiver
 
std::string m_raw_data_receiver_connection_name
 
std::shared_ptr< request_receiver_ctm_data_request_receiver
 
std::shared_ptr< timesync_sender_ctm_timesync_sender
 
utilities::ReusableThread m_timesync_thread
 
std::string m_timesync_connection_name
 
uint32_t m_pid_of_current_process
 
std::shared_ptr< LatencyBufferType > m_latency_buffer_impl
 
std::shared_ptr< RawDataProcessorType > m_raw_processor_impl
 
std::shared_ptr< RequestHandlerType > m_request_handler_impl
 
bool m_request_handler_supports_cutoff_timestamp
 
std::unique_ptr< FrameErrorRegistrym_error_registry
 
std::chrono::time_point< std::chrono::high_resolution_clock > m_t0
 

Additional Inherited Members

- Static Public Member Functions inherited from dunedaq::opmonlib::MonitorableObject
static bool publishable_metric (OpMonLevel entry, OpMonLevel system) noexcept
 

Detailed Description

template<class ReadoutType, class RequestHandlerType, class LatencyBufferType, class RawDataProcessorType, class InputDataType = ReadoutType>
class dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >

Definition at line 63 of file DataHandlingModel.hpp.

Member Typedef Documentation

◆ IDT

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::IDT = InputDataType

Definition at line 71 of file DataHandlingModel.hpp.

◆ LBT

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::LBT = LatencyBufferType

Definition at line 69 of file DataHandlingModel.hpp.

◆ metric_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::metric_t = dunedaq::datahandlinglibs::opmon::DataHandlerInfo
protected

Definition at line 171 of file DataHandlingModel.hpp.

◆ num_lb_insert_failures_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::num_lb_insert_failures_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_lb_insert_failures),metric_t>::type>::type
protected

Definition at line 177 of file DataHandlingModel.hpp.

◆ num_payload_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::num_payload_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_payloads),metric_t>::type>::type
protected

Definition at line 172 of file DataHandlingModel.hpp.

◆ num_request_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::num_request_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_requests),metric_t>::type>::type
protected

Definition at line 174 of file DataHandlingModel.hpp.

◆ raw_receiver_ct

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::raw_receiver_ct = iomanager::ReceiverConcept<InputDataType>
protected

Definition at line 193 of file DataHandlingModel.hpp.

◆ rawq_timeout_count_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::rawq_timeout_count_t = std::remove_const<std::invoke_result<decltype(&metric_t::num_data_input_timeouts),metric_t>::type>::type
protected

Definition at line 176 of file DataHandlingModel.hpp.

◆ RDT

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::RDT = ReadoutType

Definition at line 67 of file DataHandlingModel.hpp.

◆ request_receiver_ct

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::request_receiver_ct = iomanager::ReceiverConcept<dfmessages::DataRequest>
protected

Definition at line 198 of file DataHandlingModel.hpp.

◆ RHT

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::RHT = RequestHandlerType

Definition at line 68 of file DataHandlingModel.hpp.

◆ RPT

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::RPT = RawDataProcessorType

Definition at line 70 of file DataHandlingModel.hpp.

◆ sum_payload_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::sum_payload_t = std::remove_const<std::invoke_result<decltype(&metric_t::sum_payloads),metric_t>::type>::type
protected

Definition at line 173 of file DataHandlingModel.hpp.

◆ sum_request_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::sum_request_t = std::remove_const<std::invoke_result<decltype(&metric_t::sum_requests),metric_t>::type>::type
protected

Definition at line 175 of file DataHandlingModel.hpp.

◆ timestamp_t

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::timestamp_t = std::uint64_t

Definition at line 74 of file DataHandlingModel.hpp.

◆ timesync_sender_ct

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
using dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::timesync_sender_ct = iomanager::SenderConcept<dfmessages::TimeSync>
protected

Definition at line 207 of file DataHandlingModel.hpp.

Constructor & Destructor Documentation

◆ DataHandlingModel()

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::DataHandlingModel ( std::atomic< bool > & run_marker)
inlineexplicit

Definition at line 81 of file DataHandlingModel.hpp.

83 , m_callback_mode(false)
84 , m_fake_trigger(false)
89 , m_raw_data_receiver(nullptr)
91 , m_latency_buffer_impl(nullptr)
92 , m_raw_processor_impl(nullptr)
93 {
94 m_pid_of_current_process = getpid();
95 }
std::shared_ptr< raw_receiver_ct > m_raw_data_receiver
std::shared_ptr< LatencyBufferType > m_latency_buffer_impl
std::shared_ptr< RawDataProcessorType > m_raw_processor_impl
std::atomic< bool > run_marker
Global atomic for process lifetime.

◆ ~DataHandlingModel()

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
virtual dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::~DataHandlingModel ( )
virtualdefault

Member Function Documentation

◆ conf()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::conf ( const nlohmann::json & args)
virtual

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 98 of file DataHandlingModel.hxx.

99{
100 // Register callbacks if operating in that mode.
101 if (m_callback_mode) {
102 // Configure and register consume callback
104
105 // Register callback
106 auto dmcbr = DataMoveCallbackRegistry::get();
108 }
109
110 // Configure threads:
114}
static std::shared_ptr< DataMoveCallbackRegistry > get()
void set_name(const std::string &name, int tid)
ID_t id
Unique identifier of the source of the data.
Definition SourceID.hpp:74

◆ consume_payload()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::consume_payload ( RDT && payload)

Definition at line 313 of file DataHandlingModel.hxx.

314{
315 //m_rawq_timeout_count = 0;
316 //m_num_payloads = 0;
317 //m_sum_payloads = 0;
318 //m_stats_packet_count = 0;
319 m_raw_processor_impl->preprocess_item(&payload);
321 int64_t diff1 = payload.get_timestamp() - m_request_handler_impl->get_cutoff_timestamp();
322 if (diff1 <= 0) {
323 //m_request_handler_impl->increment_tardy_tp_count();
324 ers::warning(DataPacketArrivedTooLate(ERS_HERE, m_run_number, payload.get_timestamp(),
325 m_request_handler_impl->get_cutoff_timestamp(), diff1,
326 (static_cast<double>(diff1)/62500.0)));
327 }
328 }
329 if (!m_latency_buffer_impl->write(std::move(payload))) {
330 TLOG_DEBUG(TLVL_TAKE_NOTE) << "***ERROR: Latency buffer is full and data was overwritten!";
332 }
333#warning RS FIXME: Post-processing delay feature is not implemented in callback consume!
334 m_raw_processor_impl->postprocess_item(m_latency_buffer_impl->back());
338}
#define ERS_HERE
std::atomic< num_lb_insert_failures_t > m_num_lb_insert_failures
std::shared_ptr< RequestHandlerType > m_request_handler_impl
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
void warning(const Issue &issue)
Definition ers.hpp:115

◆ dispatch_requests()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::dispatch_requests ( dfmessages::DataRequest & data_request)
protected

Definition at line 423 of file DataHandlingModel.hxx.

424{
425 if (data_request.request_information.component != m_sourceid) {
426 ers::error(RequestSourceIDMismatch(ERS_HERE, m_sourceid, data_request.request_information.component));
427 return;
428 }
429 TLOG_DEBUG(TLVL_QUEUE_POP) << "Received DataRequest"
430 << " for trig/seq_number " << data_request.trigger_number << "." << data_request.sequence_number
431 << ", runno " << data_request.run_number
432 << ", trig timestamp " << data_request.trigger_timestamp
433 << ", SourceID: " << data_request.request_information.component
434 << ", window begin/end " << data_request.request_information.window_begin
435 << "/" << data_request.request_information.window_end
436 << ", dest: " << data_request.data_destination;
437 m_request_handler_impl->issue_request(data_request);
440}
void error(const Issue &issue)
Definition ers.hpp:81

◆ generate_opmon_data()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::generate_opmon_data ( )
overrideprotectedvirtual

Hook for customisable pubblication. The function can throw, exception will be caught by the monitoring thread

Reimplemented from dunedaq::opmonlib::MonitorableObject.

Definition at line 174 of file DataHandlingModel.hxx.

175 {
176 opmon::DataHandlerInfo ri;
177 ri.set_sum_payloads(m_sum_payloads.load());
178 ri.set_num_payloads(m_num_payloads.exchange(0));
179
180 ri.set_num_data_input_timeouts(m_rawq_timeout_count.exchange(0));
181
182 auto now = std::chrono::high_resolution_clock::now();
183 int new_packets = m_stats_packet_count.exchange(0);
184 double seconds = std::chrono::duration_cast<std::chrono::microseconds>(now - m_t0).count() / 1000000.;
185 m_t0 = now;
186
187 // 08-May-2025, KAB: added a message to warn users when latency buffer inserts are failing.
188 int local_num_lb_insert_failures = m_num_lb_insert_failures.exchange(0);
189 if (local_num_lb_insert_failures != 0) {
190 ers::warning(NonZeroLatencyBufferInsertFailures(ERS_HERE, local_num_lb_insert_failures, ri.num_payloads()));
191 }
192
193 ri.set_rate_payloads_consumed(new_packets / seconds / 1000.);
194 ri.set_num_lb_insert_failures(local_num_lb_insert_failures);
195 ri.set_sum_requests(m_sum_requests.load());
196 ri.set_num_requests(m_num_requests.exchange(0));
197 ri.set_last_daq_timestamp(m_raw_processor_impl->get_last_daq_time());
198
199 this->publish(std::move(ri));
200 }
std::chrono::time_point< std::chrono::high_resolution_clock > m_t0
std::atomic< rawq_timeout_count_t > m_rawq_timeout_count
void publish(google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept
static int64_t now()

◆ init()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::init ( const appmodel::DataHandlerModule * mcfg)
virtual

Forward calls from the appfwk.

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 10 of file DataHandlingModel.hxx.

11{
12 // Setup request queues
13 //setup_request_queues(mcfg);
14 try {
15 for (auto input : mcfg->get_inputs()) {
16 if (input->get_data_type() == "DataRequest") {
18 }
19 else {
21 // Parse for prefix
22 std::string conn_name = input->UID();
23 const char delim = '_';
24 std::vector<std::string> words;
25 std::size_t start;
26 std::size_t end = 0;
27 while ((start = conn_name.find_first_not_of(delim, end)) != std::string::npos) {
28 end = conn_name.find(delim, start);
29 words.push_back(conn_name.substr(start, end - start));
30 }
31
32 TLOG_DEBUG(TLVL_WORK_STEPS) << "Initialize connection based on uid: "
33 << m_raw_data_receiver_connection_name << " front word: " << words.front();
34
35 std::string cb_prefix("cb");
36 if (words.front() == cb_prefix) {
37 m_callback_mode = true;
38 }
39
40 if (!m_callback_mode) {
42 m_raw_receiver_timeout_ms = std::chrono::milliseconds(input->get_recv_timeout_ms());
43 }
44 }
45 }
46 for (auto output : mcfg->get_outputs()) {
47 if (output->get_data_type() == "TimeSync") {
50 m_timesync_connection_name = output->UID();
51 break;
52 }
53 }
54 } catch (const ers::Issue& excpt) {
55 throw ResourceQueueError(ERS_HERE, "raw_input or frag_output", "DataHandlingModel", excpt);
56 }
57
58 // Raw input connection sensibility check
59 if (!m_callback_mode && m_raw_data_receiver == nullptr) {
60 ers::error(ConfigurationError(ERS_HERE, m_sourceid, "Non callback mode, and receiver is unset!"));
61 }
62
63 // Instantiate functionalities
64 m_error_registry.reset(new FrameErrorRegistry());
65 m_error_registry->set_ers_metadata("DLH of SourceID[" + std::to_string(mcfg->get_source_id()) + "] ");
66 m_latency_buffer_impl.reset(new LBT());
67 m_raw_processor_impl.reset(new RPT(m_error_registry, mcfg->get_post_processing_enabled()));
69
70 register_node(mcfg->get_module_configuration()->get_latency_buffer()->UID(), m_latency_buffer_impl);
71 register_node(mcfg->get_module_configuration()->get_data_processor()->UID(), m_raw_processor_impl);
72 register_node(mcfg->get_module_configuration()->get_request_handler()->UID(), m_request_handler_impl);
73
74 //m_request_handler_impl->init(args);
75 //m_raw_processor_impl->init(args);
77 m_fake_trigger = false;
78 m_raw_receiver_sleep_us = std::chrono::microseconds::zero();
79 m_sourceid.id = mcfg->get_source_id();
80 m_sourceid.subsystem = RDT::subsystem;
81 m_processing_delay_ticks = mcfg->get_module_configuration()->get_post_processing_delay_ticks();
82
83
84 // Configure implementations:
85 m_raw_processor_impl->conf(mcfg);
86 // Configure the latency buffer before the request handler so the request handler can check for alignment
87 // restrictions
88 try {
89 m_latency_buffer_impl->conf(mcfg->get_module_configuration()->get_latency_buffer());
90 } catch (const std::bad_alloc& be) {
91 ers::error(ConfigurationError(ERS_HERE, m_sourceid, "Latency Buffer can't be allocated with size!"));
92 }
93 m_request_handler_impl->conf(mcfg);
94}
std::unique_ptr< FrameErrorRegistry > m_error_registry
std::shared_ptr< timesync_sender_ct > m_timesync_sender
std::shared_ptr< request_receiver_ct > m_data_request_receiver
void register_node(ElementId name, NewNodePtr)
Base class for any user define issue.
Definition Issue.hpp:69
static std::shared_ptr< iomanager::SenderConcept< Datatype > > get_iom_sender(iomanager::ConnectionId const &id)
ConfigurationError
Definition util.hpp:27
static std::shared_ptr< iomanager::ReceiverConcept< Datatype > > get_iom_receiver(iomanager::ConnectionId const &id)
Subsystem subsystem
The general subsystem of the source of the data.
Definition SourceID.hpp:69

◆ process_item()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::process_item ( RDT & payload)
protected

Definition at line 204 of file DataHandlingModel.hxx.

205{
206 m_raw_processor_impl->preprocess_item(&payload);
208 int64_t diff1 = payload.get_timestamp() - m_request_handler_impl->get_cutoff_timestamp();
209 if (diff1 <= 0) {
210 //m_request_handler_impl->increment_tardy_tp_count();
211 ers::warning(DataPacketArrivedTooLate(ERS_HERE, m_run_number, payload.get_timestamp(),
212 m_request_handler_impl->get_cutoff_timestamp(), diff1,
213 (static_cast<double>(diff1)/62500.0)));
214 }
215 }
216 if (!m_latency_buffer_impl->write(std::move(payload))) {
217 //TLOG_DEBUG(TLVL_TAKE_NOTE) << "***ERROR: Latency buffer is full and data was overwritten!";
219 }
220 if (m_processing_delay_ticks ==0) {
221 m_raw_processor_impl->postprocess_item(m_latency_buffer_impl->back());
225 }
226}

◆ record()

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
void dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::record ( const nlohmann::json & args)
inlineoverridevirtual

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 120 of file DataHandlingModel.hpp.

121 {
122 m_request_handler_impl->record(args);
123 }

◆ run_consume()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::run_consume ( )
protectedvirtual

Function that will be run in its own thread to read the raw packets from the connection and add them to the LB.

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 230 of file DataHandlingModel.hxx.

231{
232
233 TLOG_DEBUG(TLVL_WORK_STEPS) << "Consumer thread started...";
235 m_num_payloads = 0;
236 m_sum_payloads = 0;
238
239 // Variables for book-keeping of delayed post-processing
240 //timestamp_t oldest_ts=0;
241 timestamp_t newest_ts=0;
242 timestamp_t end_win_ts=0;
243 bool first_cycle = true;
244 auto last_post_proc_time = std::chrono::system_clock::now();
245 auto now = last_post_proc_time;
246 std::chrono::milliseconds milliseconds;
247 RDT processed_element;
248
249 while (m_run_marker.load()) {
250 // Try to acquire data
251
252 auto opt_payload = m_raw_data_receiver->try_receive(m_raw_receiver_timeout_ms);
253
254 if (opt_payload) {
255
256 IDT& original = opt_payload.value();
257
258 if constexpr (std::is_same_v<IDT, RDT>) {
259 process_item(original);
260 } else {
261 auto transformed = transform_payload(original);
262 for (auto& i : transformed) {
263 process_item(i);
264 }
265 }
266 } else {
268 // Protection against a zero sleep becoming a yield
269 if ( m_raw_receiver_sleep_us != std::chrono::microseconds::zero())
270 std::this_thread::sleep_for(m_raw_receiver_sleep_us);
271 }
272
273 // Add here a possible deferral of the post processing, to allow elements being reordered in the LB
274 // Basically, find data older than a certain timestamp and process all data since the last post-processed element up to that value
275 if (m_processing_delay_ticks !=0 && m_latency_buffer_impl->occupancy() > 0) {
276 now = std::chrono::system_clock::now();
277 milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(now - last_post_proc_time);
278
279 if (milliseconds.count() > 1) {
280 last_post_proc_time = now;
281 // Get the LB boundaries
282 auto tail = m_latency_buffer_impl->back();
283 newest_ts = tail->get_timestamp();
284
285 if (first_cycle) {
286 auto head = m_latency_buffer_impl->front();
287 processed_element.set_timestamp(head->get_timestamp());
288 first_cycle = false;
289 TLOG() << "***** First pass post processing *****" ;
290 }
291
292 if (newest_ts - processed_element.get_timestamp() > m_processing_delay_ticks) {
293 end_win_ts = newest_ts - m_processing_delay_ticks;
294 auto start_iter=m_latency_buffer_impl->lower_bound(processed_element, false);
295 processed_element.set_timestamp(end_win_ts);
296 auto end_iter=m_latency_buffer_impl->lower_bound(processed_element, false);
297
298 for (auto it = start_iter; it!= end_iter; ++it) {
299 m_raw_processor_impl->postprocess_item(&(*it));
303 }
304 }
305 }
306 }
307 }
308 TLOG_DEBUG(TLVL_WORK_STEPS) << "Consumer thread joins... ";
309}
virtual std::vector< RDT > transform_payload(IDT &original) const
#define TLOG(...)
Definition macro.hpp:22

◆ run_timesync()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::run_timesync ( )
protectedvirtual

Function that will be run in its own thread and sends periodic timesync messages by pushing them to the connection.

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 342 of file DataHandlingModel.hxx.

343{
344 TLOG_DEBUG(TLVL_WORK_STEPS) << "TimeSync thread started...";
345 m_num_requests = 0;
346 m_sum_requests = 0;
347 uint64_t msg_seqno = 0;
348 timestamp_t prev_timestamp = 0;
349 auto once_per_run = true;
350 size_t zero_timestamp_count = 0;
351 size_t duplicate_timestamp_count = 0;
352 size_t total_timestamp_count = 0;
353 while (m_run_marker.load()) {
354 try {
355 auto timesyncmsg = dfmessages::TimeSync(m_raw_processor_impl->get_last_daq_time());
356 ++total_timestamp_count;
357 // daq_time is zero for the first received timesync, and may
358 // be the same as the previous daq_time if the data has
359 // stopped flowing. In both cases we don't send the TimeSync
360 if (timesyncmsg.daq_time != 0 && timesyncmsg.daq_time != prev_timestamp) {
361 prev_timestamp = timesyncmsg.daq_time;
362 timesyncmsg.run_number = m_run_number;
363 timesyncmsg.sequence_number = ++msg_seqno;
364 timesyncmsg.source_pid = m_pid_of_current_process;
365 TLOG_DEBUG(TLVL_TIME_SYNCS) << "New timesync: daq=" << timesyncmsg.daq_time
366 << " wall=" << timesyncmsg.system_time << " run=" << timesyncmsg.run_number
367 << " seqno=" << timesyncmsg.sequence_number << " pid=" << timesyncmsg.source_pid;
368 try {
369 dfmessages::TimeSync timesyncmsg_copy(timesyncmsg);
370 m_timesync_sender->send(std::move(timesyncmsg_copy), std::chrono::milliseconds(500));
371 } catch (ers::Issue& excpt) {
374 }
375
376 if (m_fake_trigger) {
377 dfmessages::DataRequest dr;
379 dr.trigger_number = m_current_fake_trigger_id;
380 dr.trigger_timestamp = timesyncmsg.daq_time > 500 * us ? timesyncmsg.daq_time - 500 * us : 0;
381 auto width = 300000;
382 uint offset = 100;
383 dr.request_information.window_begin = dr.trigger_timestamp > offset ? dr.trigger_timestamp - offset : 0;
384 dr.request_information.window_end = dr.request_information.window_begin + width;
385 dr.request_information.component = m_sourceid;
386 dr.data_destination = "data_fragments_q";
387 TLOG_DEBUG(TLVL_WORK_STEPS) << "Issuing fake trigger based on timesync. "
388 << " ts=" << dr.trigger_timestamp
389 << " window_begin=" << dr.request_information.window_begin
390 << " window_end=" << dr.request_information.window_end;
391 m_request_handler_impl->issue_request(dr);
392
395 }
396 } else {
397 if (timesyncmsg.daq_time == 0) {++zero_timestamp_count;}
398 if (timesyncmsg.daq_time == prev_timestamp) {++duplicate_timestamp_count;}
399 if (once_per_run) {
400 TLOG() << "Timesync with DAQ time 0 won't be sent out as it's an invalid sync.";
401 once_per_run = false;
402 }
403 }
404 } catch (const iomanager::TimeoutExpired& excpt) {
405 // ++m_timesyncqueue_timeout;
406 }
407 // Split up the 100ms sleep into 10 sleeps of 10ms, so we respond to "stop" quicker
408 for (size_t i=0; i<10; ++i) {
409 std::this_thread::sleep_for(std::chrono::milliseconds(10));
410 if (!m_run_marker.load()) {
411 break;
412 }
413 }
414 }
415 once_per_run = true;
416 TLOG_DEBUG(TLVL_WORK_STEPS) << "TimeSync thread joins... (timestamp count, zero/same/total = "
417 << zero_timestamp_count << "/" << duplicate_timestamp_count << "/"
418 << total_timestamp_count << ")";
419}
double offset
SourceID[" << sourceid << "] Command daqdataformats::SourceID Readout Initialization std::string initerror Configuration std::string conferror Configuration std::string conferror TimeSyncTransmissionFailed

◆ scrap()

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
void dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::scrap ( const nlohmann::json & args)
inlinevirtual

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 106 of file DataHandlingModel.hpp.

107 {
108 m_request_handler_impl->scrap(args);
109 m_latency_buffer_impl->scrap(args);
110 m_raw_processor_impl->scrap(args);
111 }

◆ start()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::start ( const nlohmann::json & args)
virtual

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 119 of file DataHandlingModel.hxx.

120{
121 // Reset opmon variables
122 m_sum_payloads = 0;
123 m_num_payloads = 0;
124 m_sum_requests = 0;
125 m_num_requests = 0;
129
130 m_t0 = std::chrono::high_resolution_clock::now();
131
133
134 TLOG_DEBUG(TLVL_WORK_STEPS) << "Starting threads...";
135 m_raw_processor_impl->start(args);
136 m_request_handler_impl->start(args);
137 if (!m_callback_mode) {
139 }
141 // Register callback to receive and dispatch data requests
142 m_data_request_receiver->add_callback(
143 std::bind(&DataHandlingModel<RDT, RHT, LBT, RPT, IDT>::dispatch_requests, this, std::placeholders::_1));
144}
void dispatch_requests(dfmessages::DataRequest &data_request)
void run_consume()
Function that will be run in its own thread to read the raw packets from the connection and add them ...
void run_timesync()
Function that will be run in its own thread and sends periodic timesync messages by pushing them to t...
bool set_work(Function &&f, Args &&... args)
uint32_t run_number_t
Type used to represent run number.
Definition Types.hpp:20

◆ stop()

template<class RDT , class RHT , class LBT , class RPT , class IDT >
void dunedaq::datahandlinglibs::DataHandlingModel< RDT, RHT, LBT, RPT, IDT >::stop ( const nlohmann::json & args)
virtual

Implements dunedaq::datahandlinglibs::DataHandlingConcept.

Definition at line 148 of file DataHandlingModel.hxx.

149{
150 TLOG_DEBUG(TLVL_WORK_STEPS) << "Stoppping threads...";
151
152 // Stop receiving data requests as first thing
153 m_data_request_receiver->remove_callback();
154 // Stop the other threads
155 m_request_handler_impl->stop(args);
158 std::this_thread::sleep_for(std::chrono::milliseconds(10));
159 }
160 }
161 if (!m_callback_mode) {
163 std::this_thread::sleep_for(std::chrono::milliseconds(10));
164 }
165 }
166 TLOG_DEBUG(TLVL_WORK_STEPS) << "Flushing latency buffer with occupancy: " << m_latency_buffer_impl->occupancy();
167 m_latency_buffer_impl->flush();
168 m_raw_processor_impl->stop(args);
169 m_raw_processor_impl->reset_last_daq_time();
170}

◆ transform_payload()

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
virtual std::vector< RDT > dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::transform_payload ( IDT & original) const
inlineprotectedvirtual

Definition at line 149 of file DataHandlingModel.hpp.

150 {
151 return { reinterpret_cast<RDT&>(original) };
152 }

Member Data Documentation

◆ m_callback_mode

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
bool dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_callback_mode
protected

Definition at line 162 of file DataHandlingModel.hpp.

◆ m_consume_callback

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::function<void(RDT&&)> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_consume_callback

Definition at line 132 of file DataHandlingModel.hpp.

◆ m_consumer_thread

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
utilities::ReusableThread dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_consumer_thread
protected

Definition at line 188 of file DataHandlingModel.hpp.

◆ m_current_fake_trigger_id

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
int dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_current_fake_trigger_id
protected

Definition at line 165 of file DataHandlingModel.hpp.

◆ m_data_request_receiver

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<request_receiver_ct> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_data_request_receiver
protected

Definition at line 199 of file DataHandlingModel.hpp.

◆ m_error_registry

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::unique_ptr<FrameErrorRegistry> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_error_registry
protected

Definition at line 224 of file DataHandlingModel.hpp.

◆ m_fake_trigger

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
bool dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_fake_trigger
protected

Definition at line 163 of file DataHandlingModel.hpp.

◆ m_generate_timesync

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
bool dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_generate_timesync = false
protected

Definition at line 164 of file DataHandlingModel.hpp.

◆ m_latency_buffer_impl

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<LatencyBufferType> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_latency_buffer_impl
protected

Definition at line 214 of file DataHandlingModel.hpp.

◆ m_num_lb_insert_failures

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<num_lb_insert_failures_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_num_lb_insert_failures { 0 }
protected

Definition at line 184 of file DataHandlingModel.hpp.

184{ 0 };

◆ m_num_payloads

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<num_payload_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_num_payloads { 0 }
protected

Definition at line 179 of file DataHandlingModel.hpp.

179{ 0 };

◆ m_num_requests

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<num_request_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_num_requests { 0 }
protected

Definition at line 181 of file DataHandlingModel.hpp.

181{ 0 };

◆ m_pid_of_current_process

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
uint32_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_pid_of_current_process
protected

Definition at line 211 of file DataHandlingModel.hpp.

◆ m_processing_delay_ticks

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
uint64_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_processing_delay_ticks
protected

Definition at line 168 of file DataHandlingModel.hpp.

◆ m_raw_data_receiver

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<raw_receiver_ct> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_raw_data_receiver
protected

Definition at line 194 of file DataHandlingModel.hpp.

◆ m_raw_data_receiver_connection_name

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::string dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_raw_data_receiver_connection_name
protected

Definition at line 195 of file DataHandlingModel.hpp.

◆ m_raw_processor_impl

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<RawDataProcessorType> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_raw_processor_impl
protected

Definition at line 217 of file DataHandlingModel.hpp.

◆ m_raw_receiver_sleep_us

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::chrono::microseconds dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_raw_receiver_sleep_us
protected

Definition at line 192 of file DataHandlingModel.hpp.

◆ m_raw_receiver_timeout_ms

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::chrono::milliseconds dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_raw_receiver_timeout_ms
protected

Definition at line 191 of file DataHandlingModel.hpp.

◆ m_rawq_timeout_count

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<rawq_timeout_count_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_rawq_timeout_count { 0 }
protected

Definition at line 183 of file DataHandlingModel.hpp.

183{ 0 };

◆ m_request_handler_impl

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<RequestHandlerType> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_request_handler_impl
protected

Definition at line 220 of file DataHandlingModel.hpp.

◆ m_request_handler_supports_cutoff_timestamp

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
bool dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_request_handler_supports_cutoff_timestamp
protected

Definition at line 221 of file DataHandlingModel.hpp.

◆ m_run_marker

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<bool>& dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_run_marker
protected

Definition at line 158 of file DataHandlingModel.hpp.

◆ m_run_number

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
daqdataformats::run_number_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_run_number
protected

Definition at line 167 of file DataHandlingModel.hpp.

◆ m_sourceid

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
daqdataformats::SourceID dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_sourceid
protected

Definition at line 166 of file DataHandlingModel.hpp.

◆ m_stats_packet_count

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<int> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_stats_packet_count { 0 }
protected

Definition at line 185 of file DataHandlingModel.hpp.

185{ 0 };

◆ m_sum_payloads

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<sum_payload_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_sum_payloads { 0 }
protected

Definition at line 180 of file DataHandlingModel.hpp.

180{ 0 };

◆ m_sum_requests

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::atomic<sum_request_t> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_sum_requests { 0 }
protected

Definition at line 182 of file DataHandlingModel.hpp.

182{ 0 };

◆ m_t0

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::chrono::time_point<std::chrono::high_resolution_clock> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_t0
protected

Definition at line 227 of file DataHandlingModel.hpp.

◆ m_timesync_connection_name

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::string dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_timesync_connection_name
protected

Definition at line 210 of file DataHandlingModel.hpp.

◆ m_timesync_sender

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
std::shared_ptr<timesync_sender_ct> dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_timesync_sender
protected

Definition at line 208 of file DataHandlingModel.hpp.

◆ m_timesync_thread

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
utilities::ReusableThread dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::m_timesync_thread
protected

Definition at line 209 of file DataHandlingModel.hpp.

◆ ms

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
timestamp_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::ms = 1000 * us
inlinestaticconstexpr

Definition at line 77 of file DataHandlingModel.hpp.

◆ ns

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
timestamp_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::ns = 1
inlinestaticconstexpr

Definition at line 75 of file DataHandlingModel.hpp.

◆ s

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
timestamp_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::s = 1000 * ms
inlinestaticconstexpr

Definition at line 78 of file DataHandlingModel.hpp.

◆ us

template<class ReadoutType , class RequestHandlerType , class LatencyBufferType , class RawDataProcessorType , class InputDataType = ReadoutType>
timestamp_t dunedaq::datahandlinglibs::DataHandlingModel< ReadoutType, RequestHandlerType, LatencyBufferType, RawDataProcessorType, InputDataType >::us = 1000 * ns
inlinestaticconstexpr

Definition at line 76 of file DataHandlingModel.hpp.


The documentation for this class was generated from the following files: