DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TPProcessor.hpp
Go to the documentation of this file.
1
8#ifndef TRIGGER_SRC_TRIGGER_TPPROCESSOR_HPP_
9#define TRIGGER_SRC_TRIGGER_TPPROCESSOR_HPP_
10
12#include "iomanager/Sender.hpp"
13#include "logging/Logging.hpp"
14
16
17//#include "triggger/Issues.hpp"
19#include "trigger/Latency.hpp"
22
24#include "triggeralgs/Types.hpp"
26
28
29namespace dunedaq {
30namespace trigger {
31
32class TPProcessor : public datahandlinglibs::TaskRawDataProcessorModel<TriggerPrimitiveTypeAdapter>
33{
34
35public:
39
40
41 explicit TPProcessor(std::unique_ptr<datahandlinglibs::FrameErrorRegistry>& error_registry, bool post_processing_enabled);
42
44
45 void start(const nlohmann::json& args) override;
46
47 void stop(const nlohmann::json& args) override;
48
49 void conf(const appmodel::DataHandlerModule* conf) override;
50
51 void scrap(const nlohmann::json& args) override;
52
53 void generate_opmon_data() override;
54
55protected:
56 // Internals
59
64 void find_ta(const TriggerPrimitiveTypeAdapter* tp, std::shared_ptr<triggeralgs::TriggerActivityMaker> tam);
65
66 private:
67
68 std::vector<std::shared_ptr<triggeralgs::TriggerActivityMaker>> m_tams;
69
70 std::shared_ptr<iomanager::SenderConcept<triggeralgs::TriggerActivity>> m_ta_sink;
71
73
74 using metric_counter_type = uint64_t;
75 std::atomic<metric_counter_type> m_tp_received_count{ 0 }; // NOLINT(build/unsigned)
76 std::atomic<metric_counter_type> m_ta_made_count{ 0 };
77 std::atomic<metric_counter_type> m_ta_sent_count{ 0 };
78 std::atomic<metric_counter_type> m_ta_failed_sent_count{ 0 };
79 void print_opmon_stats();
80
81 // Create an instance of the Latency class
82 std::atomic<bool> m_running_flag{ false };
83 std::atomic<bool> m_latency_monitoring{ false };
85 std::atomic<metric_counter_type> m_latency_in{ 0 };
86 std::atomic<metric_counter_type> m_latency_out{ 0 };
87
88};
89
90} // namespace trigger
91} // namespace dunedaq
92
93#endif // TRIGGER_SRC_TRIGGER_TPPROCESSOR_HPP_
dunedaq::trigger::Latency m_latency_instance
std::atomic< bool > m_latency_monitoring
std::atomic< metric_counter_type > m_latency_out
void start(const nlohmann::json &args) override
Start operation.
daqdataformats::SourceID m_sourceid
std::vector< std::shared_ptr< triggeralgs::TriggerActivityMaker > > m_tams
std::atomic< metric_counter_type > m_ta_failed_sent_count
dunedaq::daqdataformats::timestamp_t m_current_ts
std::atomic< metric_counter_type > m_tp_received_count
std::atomic< metric_counter_type > m_ta_sent_count
TPProcessor(std::unique_ptr< datahandlinglibs::FrameErrorRegistry > &error_registry, bool post_processing_enabled)
void scrap(const nlohmann::json &args) override
Unconfigure.
void find_ta(const TriggerPrimitiveTypeAdapter *tp, std::shared_ptr< triggeralgs::TriggerActivityMaker > tam)
std::shared_ptr< iomanager::SenderConcept< triggeralgs::TriggerActivity > > m_ta_sink
dunedaq::daqdataformats::timestamp_t m_previous_ts
std::atomic< metric_counter_type > m_ta_made_count
void stop(const nlohmann::json &args) override
Stop operation.
void conf(const appmodel::DataHandlerModule *conf) override
Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.
std::atomic< bool > m_running_flag
std::atomic< metric_counter_type > m_latency_in
void generate_opmon_data() override
uint64_t timestamp_t
Type used to represent DUNE timing system timestamps.
Definition Types.hpp:36
Including Qt Headers.
SourceID is a generalized representation of the source of a piece of data in the DAQ....
Definition SourceID.hpp:32