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
31
33
34
37
38#include <atomic>
39#include <functional>
40#include <memory>
41#include <string>
42
44
45namespace dunedaq {
46namespace fdreadoutlibs {
47
49{
50
51public:
55 using timestamp_t = std::uint64_t; // NOLINT(build/unsigned)
57
58 // Constructor
59 explicit DAPHNEEthFrameProcessor(std::unique_ptr<datahandlinglibs::FrameErrorRegistry>& error_registry, bool post_processing_enabled)
60 : datahandlinglibs::TaskRawDataProcessorModel<types::DAPHNEEthTypeAdapter>(error_registry, post_processing_enabled)
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
90 void extract_tps( constframeptr fp);
91
92private:
93
94 //PDSChannelMap
95 std::shared_ptr<detchannelmaps::PDSChannelMap> m_channel_map;
96 std::vector<std::pair<trgdataformats::channel_t, int16_t>> m_channel_plane_numbers;
97
98 uint32_t m_det_id; // NOLINT(build/unsigned)
99 uint32_t m_crate_id; // NOLINT(build/unsigned)
100 uint32_t m_slot_id; // NOLINT(build/unsigned)
101 uint32_t m_stream_id; // NOLINT(build/unsigned)
102
103 std::set<unsigned int> m_channel_mask_set;
105
106
107
108 std::shared_ptr<iomanager::SenderConcept<std::vector<trigger::TriggerPrimitiveTypeAdapter>>> m_tp_sink;
109
110 std::atomic<uint64_t> m_num_new_tps{ 0 }; // NOLINT(build/unsigned)
111 std::atomic<uint64_t> m_tps_suppressed_too_long{ 0 };
112 std::atomic<uint64_t> m_tps_send_failed{ 0 };
113 std::atomic<uint64_t> m_frame_counter{ 0 };
114
115 std::chrono::time_point<std::chrono::high_resolution_clock> m_t0;
116
117
118};
119
120} // namespace fdreadoutlibs
121} // namespace dunedaq
122
123#endif // FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNEETH_DAPHNEETHFRAMEPROCESSOR_HPP_
124
TaskRawDataProcessorModel(std::unique_ptr< FrameErrorRegistry > &error_registry, bool post_processing_enabled)
Class for accessing raw WIB eth frames, as used in ProtoDUNE-II.
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)
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.