Line data Source code
1 : /**
2 : * @file CRTBernFrameProcessor.hpp CRTBern specific Task based raw processor
3 : *
4 : * This is part of the DUNE DAQ , copyright 2023.
5 : * Licensing/copyright details are in the COPYING file that you should have
6 : * received with this code.
7 : */
8 :
9 : #include "fdreadoutlibs/crt/CRTBernFrameProcessor.hpp" // NOLINT(build/include)
10 :
11 : namespace dunedaq {
12 : namespace fdreadoutlibs {
13 :
14 0 : void CRTBernFrameProcessor::conf(const appmodel::DataHandlerModule* /*conf*/)
15 : {
16 0 : TLOG() << "Registering processing tasks...";
17 0 : datahandlinglibs::TaskRawDataProcessorModel<types::CRTBernTypeAdapter>::add_preprocess_task(std::bind(&CRTBernFrameProcessor::timestamp_check, this, std::placeholders::_1));
18 0 : }
19 :
20 0 : void CRTBernFrameProcessor::timestamp_check(types::CRTBernTypeAdapter* fp)
21 : {
22 0 : static const uint64_t k_clock_frequency = 62500000; // NOLINT(build/unsigned)
23 0 : auto current_ts = fp->get_timestamp();
24 0 : TLOG_DEBUG(TLVL_FRAME_RECEIVED) << "Received CRTBern frame timestamp value of " << current_ts << " ticks (..." << std::fixed << std::setprecision(8) << (static_cast<double>(current_ts % (k_clock_frequency*1000)) / static_cast<double>(k_clock_frequency)) << " sec)";// NOLINT
25 :
26 0 : if(current_ts > m_last_processed_daq_ts) m_last_processed_daq_ts = current_ts;
27 0 : }
28 :
29 :
30 : } // namespace fdreadoutlibs
31 : } // namespace dunedaq
|