DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DAPHNEEthFrameProcessor.hpp
Go to the documentation of this file.
1
8#ifndef FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNEETH_DAPHNEETHFRAMEPROCESSOR_HPP_
9#define FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNEETH_DAPHNEETHFRAMEPROCESSOR_HPP_
10
11#include "logging/Logging.hpp"
12
16
18#include "iomanager/Sender.hpp"
19
23
27
30
32
35
36#include <atomic>
37#include <functional>
38#include <memory>
39#include <string>
40
42
43namespace dunedaq {
44namespace fdreadoutlibs {
45
47{
48
49public:
53 using timestamp_t = std::uint64_t; // NOLINT(build/unsigned)
55
56 // Constructor
57 explicit DAPHNEEthFrameProcessor(std::unique_ptr<datahandlinglibs::FrameErrorRegistry>& error_registry,
58 bool post_processing_enabled)
59 : datahandlinglibs::TaskRawDataProcessorModel<types::DAPHNEEthTypeAdapter>(error_registry, post_processing_enabled)
60 {
61 }
62
63 // Override config for pipeline setup
64 void conf(const appmodel::DataHandlerModule* conf) override;
65
66 void start(const appfwk::DAQModule::CommandData_t& args) override;
67 void stop(const appfwk::DAQModule::CommandData_t& args) override;
68
69protected:
70 virtual void generate_opmon_data() override;
71
75 void timestamp_check(frameptr /*fp*/);
76
80 void frame_error_check(frameptr /*fp*/);
81
82 // Internals
85 bool m_first_ts_fake = true;
87 bool m_problem_reported = false;
88 std::atomic<int> m_ts_error_ctr{ 0 };
89
91
92private:
93 // PDSChannelMap
94 std::shared_ptr<detchannelmaps::PDSChannelMap> m_channel_map;
95 std::vector<std::pair<trgdataformats::channel_t, int16_t>> m_channel_plane_numbers;
96
97 uint32_t m_det_id; // NOLINT(build/unsigned)
98 uint32_t m_crate_id; // NOLINT(build/unsigned)
99 uint32_t m_slot_id; // NOLINT(build/unsigned)
100 uint32_t m_stream_id; // NOLINT(build/unsigned)
101
102 std::set<unsigned int> m_channel_mask_set;
104
105 std::shared_ptr<iomanager::SenderConcept<std::vector<trigger::TriggerPrimitiveTypeAdapter>>> m_tp_sink;
106
107 std::atomic<uint64_t> m_num_new_tps{ 0 }; // NOLINT(build/unsigned)
108 std::atomic<uint64_t> m_tps_suppressed_too_long{ 0 };
109 std::atomic<uint64_t> m_tps_send_failed{ 0 };
110 std::atomic<uint64_t> m_frame_counter{ 0 };
111
112 std::chrono::time_point<std::chrono::high_resolution_clock> m_t0;
113};
114
115} // namespace fdreadoutlibs
116} // namespace dunedaq
117
118#endif // FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNEETH_DAPHNEETHFRAMEPROCESSOR_HPP_
TaskRawDataProcessorModel(std::unique_ptr< FrameErrorRegistry > &error_registry, bool post_processing_enabled)
std::chrono::time_point< std::chrono::high_resolution_clock > m_t0
std::shared_ptr< detchannelmaps::PDSChannelMap > m_channel_map
std::shared_ptr< iomanager::SenderConcept< std::vector< trigger::TriggerPrimitiveTypeAdapter > > > m_tp_sink
DAPHNEEthFrameProcessor(std::unique_ptr< datahandlinglibs::FrameErrorRegistry > &error_registry, bool post_processing_enabled)
dunedaq::fddetdataformats::DAPHNEEthFrame * daphneframeptr
datahandlinglibs::TaskRawDataProcessorModel< types::DAPHNEEthTypeAdapter > inherited
void stop(const appfwk::DAQModule::CommandData_t &args) override
Stop operation.
std::vector< std::pair< trgdataformats::channel_t, int16_t > > m_channel_plane_numbers
void start(const appfwk::DAQModule::CommandData_t &args) override
Start operation.
void conf(const appmodel::DataHandlerModule *conf) override
Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.
The DUNE-DAQ namespace.
Struct for accessing raw DAPHNE eth frames.