DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TAProcessor.hpp
Go to the documentation of this file.
1
8#ifndef TRIGGER_SRC_TRIGGER_TAPROCESSOR_HPP_
9#define TRIGGER_SRC_TRIGGER_TAPROCESSOR_HPP_
10
12#include "iomanager/Sender.hpp"
13#include "logging/Logging.hpp"
14
16
18
19#include "trigger/Issues.hpp"
20#include "trigger/TAWrapper.hpp"
21#include "trigger/Latency.hpp"
24
26#include "triggeralgs/Types.hpp"
28
29namespace dunedaq {
30namespace trigger {
31
33{
34
35public:
37 using taptr = TAWrapper*;
38 using consttaptr = const TAWrapper*;
39
40
41 explicit TAProcessor(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_tc(const TAWrapper* ta, std::shared_ptr<triggeralgs::TriggerCandidateMaker> tcm);
65
66 private:
67
68 std::vector<std::shared_ptr<triggeralgs::TriggerCandidateMaker>> m_tcms;
69
70 std::shared_ptr<iomanager::SenderConcept<triggeralgs::TriggerCandidate>> m_tc_sink;
71
73
74 using metric_counter_type = uint64_t;
75 std::atomic<metric_counter_type> m_ta_received_count{ 0 }; // NOLINT(build/unsigned)
76 std::atomic<metric_counter_type> m_tc_made_count{ 0 };
77 std::atomic<metric_counter_type> m_tc_sent_count{ 0 };
78 std::atomic<metric_counter_type> m_tc_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_
std::atomic< metric_counter_type > m_ta_received_count
dunedaq::daqdataformats::timestamp_t m_previous_ts
std::atomic< bool > m_running_flag
void generate_opmon_data() override
dunedaq::trigger::Latency m_latency_instance
std::atomic< metric_counter_type > m_tc_failed_sent_count
dunedaq::daqdataformats::timestamp_t m_current_ts
void find_tc(const TAWrapper *ta, std::shared_ptr< triggeralgs::TriggerCandidateMaker > tcm)
std::vector< std::shared_ptr< triggeralgs::TriggerCandidateMaker > > m_tcms
std::atomic< metric_counter_type > m_latency_out
void start(const nlohmann::json &args) override
Start operation.
daqdataformats::SourceID m_sourceid
TAProcessor(std::unique_ptr< datahandlinglibs::FrameErrorRegistry > &error_registry, bool post_processing_enabled)
std::atomic< metric_counter_type > m_tc_made_count
std::atomic< metric_counter_type > m_tc_sent_count
void scrap(const nlohmann::json &args) override
Unconfigure.
std::atomic< bool > m_latency_monitoring
std::shared_ptr< iomanager::SenderConcept< triggeralgs::TriggerCandidate > > m_tc_sink
std::atomic< metric_counter_type > m_latency_in
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.
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