DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TPRequestHandler.hpp
Go to the documentation of this file.
1
9#ifndef TRIGGER_SRC_TRIGGER_TPREQUESTHANDLER_HPP_
10#define TRIGGER_SRC_TRIGGER_TPREQUESTHANDLER_HPP_
11
13#include "iomanager/Sender.hpp"
14
16
22
24#include "trigger/TPSet.hpp"
25
26#include "logging/Logging.hpp" // NOTE: if ISSUES ARE DECLARED BEFORE include logging/Logging.hpp, TLOG_DEBUG<<issue wont work.
27
28#include <atomic>
29#include <memory>
30#include <string>
31
33
34
35namespace dunedaq {
37 DroppedTPSet,
38 "Failed to send TPs from " << s_ts << " to " << e_ts,
39 ((uint64_t)s_ts)
40 ((uint64_t)e_ts))
41ERS_DECLARE_ISSUE(trigger,
44 ((std::string) infomsg))
45
46namespace trigger {
47
49{
50public:
52
53 // Constructor that binds LB and error registry
54
56 std::unique_ptr<datahandlinglibs::FrameErrorRegistry>& error_registry)
58 latency_buffer,
59 error_registry)
60 {
61 TLOG_DEBUG(TLVL_WORK_STEPS) << "TPRequestHandler created...";
62 }
63
64 void conf(const appmodel::DataHandlerModule* conf) override;
65 void start(const nlohmann::json& args) override;
66 void scrap(const nlohmann::json& args) override;
67 void periodic_data_transmission() override;
68
69private:
70 using timestamp_t = std::uint64_t;
71 std::shared_ptr<iomanager::SenderConcept<dunedaq::trigger::TPSet>> m_tpset_sink;
72 uint64_t m_run_number;
74
79 bool m_first_cycle = true;
80 uint64_t m_ts_set_sender_offset_ticks = 6250000; // 100 ms delay in transmission
81
82};
83
84} // namespace trigger
85} // namespace dunedaq
86
87
88#endif // TRIGGER_SRC_TRIGGER_TPREQUESTHANDLER_HPP_
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message, attributes)
DefaultSkipListRequestHandler(std::shared_ptr< datahandlinglibs::SkipListLatencyBufferModel< TriggerPrimitiveTypeAdapter > > &latency_buffer, std::unique_ptr< datahandlinglibs::FrameErrorRegistry > &error_registry)
TPRequestHandler(std::shared_ptr< datahandlinglibs::SkipListLatencyBufferModel< TriggerPrimitiveTypeAdapter > > &latency_buffer, std::unique_ptr< datahandlinglibs::FrameErrorRegistry > &error_registry)
void start(const nlohmann::json &args) override
std::shared_ptr< iomanager::SenderConcept< dunedaq::trigger::TPSet > > m_tpset_sink
void conf(const appmodel::DataHandlerModule *conf) override
void periodic_data_transmission() override
Periodic data transmission - relevant for trigger in particular.
void scrap(const nlohmann::json &args) override
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
Including Qt Headers.