8#ifndef FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNE_DAPHNEFRAMEPROCESSOR_HPP_
9#define FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNE_DAPHNEFRAMEPROCESSOR_HPP_
40 "Ignoring PDS Peak with ts=" << timestamp <<
", ch=" << channel <<
", sc_iframe=" << superchunk_iframe <<
", ipeak=" << ipeak,
41 ((uint64_t)timestamp) ((uint64_t)channel) ((
size_t)superchunk_iframe) ((
size_t)ipeak))
45 "PDS Frame with unphysical timestamp detected with ts=" << timestamp <<
", ch=" << channel <<
", sc_iframe=" << superchunk_iframe,
46 ((uint64_t)timestamp) ((uint64_t)channel) ((
size_t)superchunk_iframe))
49namespace fdreadoutlibs {
56 using frameptr = types::DAPHNESuperChunkTypeAdapter*;
58 using timestamp_t = std::uint64_t;
59 using constframeptr =
const types::DAPHNESuperChunkTypeAdapter*;
62 explicit DAPHNEFrameProcessor(std::unique_ptr<datahandlinglibs::FrameErrorRegistry>& error_registry,
bool post_processing_enabled)
69 void start(
const nlohmann::json& args)
override;
70 void stop(
const nlohmann::json& args)
override;
73 virtual void generate_opmon_data()
override;
78 void timestamp_check(frameptr );
83 void frame_error_check(frameptr );
86 timestamp_t m_previous_ts = 0;
87 timestamp_t m_current_ts = 0;
88 bool m_first_ts_fake =
true;
89 bool m_first_ts_missmatch =
true;
90 bool m_problem_reported =
false;
91 std::atomic<int> m_ts_error_ctr{ 0 };
93 void extract_tps( constframeptr fp);
98 std::shared_ptr<iomanager::SenderConcept<std::vector<trigger::TriggerPrimitiveTypeAdapter>>> m_tp_sink;
100 std::atomic<uint64_t> m_new_hits{ 0 };
101 std::atomic<uint64_t> m_new_tps{ 0 };
102 std::atomic<uint64_t> m_tps_suppressed_too_long{ 0 };
103 std::atomic<uint64_t> m_tps_send_failed{ 0 };
104 std::atomic<uint64_t> m_frame_counter{ 0 };
106 std::chrono::time_point<std::chrono::high_resolution_clock> m_t0;
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message, attributes)
PDSUnphysicalFrameTimestamp