Line data Source code
1 : /**
2 : * @file CRTGrenobleFrameProcessor.hpp CRTGrenoble 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/CRTGrenobleFrameProcessor.hpp" // NOLINT(build/include)
10 :
11 : namespace dunedaq {
12 : namespace fdreadoutlibs {
13 :
14 : void
15 0 : CRTGrenobleFrameProcessor::conf(const appmodel::DataHandlerModule* /*conf*/)
16 : {
17 0 : TLOG() << "Registering processing tasks...";
18 0 : datahandlinglibs::TaskRawDataProcessorModel<types::CRTGrenobleTypeAdapter>::add_preprocess_task(
19 0 : std::bind(&CRTGrenobleFrameProcessor::timestamp_check, this, std::placeholders::_1));
20 0 : }
21 :
22 : void
23 0 : CRTGrenobleFrameProcessor::timestamp_check(types::CRTGrenobleTypeAdapter* fp)
24 : {
25 0 : static const uint64_t k_clock_frequency = 62500000; // NOLINT(build/unsigned)
26 0 : auto current_ts = fp->get_timestamp();
27 0 : TLOG_DEBUG(TLVL_FRAME_RECEIVED) << "Received CRTGrenoble frame timestamp value of " << current_ts << " ticks (..."
28 0 : << std::fixed << std::setprecision(8)
29 0 : << (static_cast<double>(current_ts % (k_clock_frequency * 1000)) /
30 0 : static_cast<double>(k_clock_frequency))
31 0 : << " sec)"; // NOLINT
32 :
33 0 : if (current_ts > m_last_processed_daq_ts)
34 0 : m_last_processed_daq_ts = current_ts;
35 0 : }
36 :
37 : } // namespace fdreadoutlibs
38 : } // namespace dunedaq
|