8#ifndef FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNE_DAPHNEFRAMEPROCESSOR_HPP_
9#define FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNE_DAPHNEFRAMEPROCESSOR_HPP_
49 "Ignoring PDS Peak with ts=" << timestamp <<
", ch=" << channel <<
", sc_iframe=" << superchunk_iframe <<
", ipeak=" << ipeak,
50 ((uint64_t)timestamp) ((uint64_t)channel) ((
size_t)superchunk_iframe) ((
size_t)ipeak))
54 "PDS Frame with unphysical timestamp detected with ts=" << timestamp <<
", ch=" << channel <<
", sc_iframe=" << superchunk_iframe,
55 ((uint64_t)timestamp) ((uint64_t)channel) ((
size_t)superchunk_iframe))
58namespace fdreadoutlibs {
65 using frameptr = types::DAPHNESuperChunkTypeAdapter*;
67 using timestamp_t = std::uint64_t;
68 using constframeptr =
const types::DAPHNESuperChunkTypeAdapter*;
71 explicit DAPHNEFrameProcessor(std::unique_ptr<datahandlinglibs::FrameErrorRegistry>& error_registry,
bool post_processing_enabled)
80 void start(
const nlohmann::json& args)
override;
81 void stop(
const nlohmann::json& args)
override;
84 virtual void generate_opmon_data()
override;
89 void timestamp_check(frameptr );
94 void frame_error_check(frameptr );
97 timestamp_t m_previous_ts = 0;
98 timestamp_t m_current_ts = 0;
99 bool m_first_ts_fake =
true;
100 bool m_first_ts_missmatch =
true;
101 bool m_problem_reported =
false;
102 std::atomic<int> m_ts_error_ctr{ 0 };
104 void extract_tps( constframeptr fp);
110 std::shared_ptr<detchannelmaps::PDSChannelMap> m_channel_map;
111 std::vector<std::pair<trgdataformats::channel_t, int16_t>> m_channel_plane_numbers;
116 uint32_t m_stream_id;
118 std::set<unsigned int> m_channel_mask_set;
119 uint32_t m_def_adc_intg_thresh = 0;
123 std::shared_ptr<iomanager::SenderConcept<std::vector<trigger::TriggerPrimitiveTypeAdapter>>> m_tp_sink;
125 std::atomic<uint64_t> m_new_hits{ 0 };
126 std::atomic<uint64_t> m_new_tps{ 0 };
127 std::atomic<uint64_t> m_tps_suppressed_too_long{ 0 };
128 std::atomic<uint64_t> m_tps_send_failed{ 0 };
129 std::atomic<uint64_t> m_frame_counter{ 0 };
131 std::chrono::time_point<std::chrono::high_resolution_clock> m_t0;
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message, attributes)
PDSUnphysicalFrameTimestamp