DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
TDEFrameProcessor.cpp
Go to the documentation of this file.
1/*
2 * @file TDEFrameProcessor.cpp TDE specific Task based raw processor
3 * implementation
4 *
5 * This is part of the DUNE DAQ , copyright 2020.
6 * Licensing/copyright details are in the COPYING file that you should have
7 * received with this code.
8 */
11
14
15namespace dunedaq {
16namespace fdreadoutlibs {
17
18void
20{
22 std::bind(&TDEFrameProcessor::timestamp_check, this, std::placeholders::_1));
23 // m_tasklist.push_back( std::bind(&TDEFrameProcessor::frame_error_check, this, std::placeholders::_1) );
25
26 m_clock_frequency = 50000000; //FIXME
27}
28
32void
34{
35 //auto tdef.= reinterpret_cast<dunedaq::fddetdataformats::TDE16Frame*>(fp); // NOLINT
36 auto tdef = fp->data; // NOLINT
37 /* Let Source Emulator deal with this
38 // If EMU data, emulate perfectly incrementing timestamp
39 if (inherited::m_emulator_mode) { // emulate perfectly incrementing timestamp
40 if (m_previous_ts[tdef.get_channel()] == 0)
41 m_previous_ts[tdef.get_channel()] = tdef.get_timestamp();
42 auto ts_next = m_previous_ts[tdef.get_channel()] + (dunedaq::fddetdataformats::ticks_between_adc_samples * dunedaq::fddetdataformats::tot_adc16_samples); // NOLINT(build/unsigned)
43 tdef.set_timestamp(ts_next);
44 }
45*/
46 // Acquire timestamp
48 auto ch = tdef.get_channel();
49 auto tdefh = tdef.get_daq_header();
50 TLOG_DEBUG(TLVL_FRAME_RECEIVED) << "Checking TDE frame timestamp value of " << m_current_ts
51 << " , crate " << tdefh->crate_id << ", slot " << tdefh->slot_id << ", stream " << tdefh->stream_id; // NOLINT
52
53 // Check timestamp
56 m_error_registry->add_error("MISSING_FRAMES",
58 if (m_first_ts_missmatch) { // log once
59 //TLOG_DEBUG(TLVL_BOOKKEEPING) << "First timestamp MISSMATCH! -> | previous: " << std::to_string(m_previous_ts[ch])
60 TLOG() << "First timestamp MISSMATCH for channel " << ch<< "! -> | previous: " << std::to_string(m_previous_ts[ch])
61 << " current: " + std::to_string(m_current_ts);
63 }
64 }
65
66 if (m_ts_error_ctr > 1000) {
67 if (!m_problem_reported) {
68 TLOG() << "*** Data Integrity ERROR *** Timestamp continuity is completely broken! "
69 << "Something is wrong with the FE source or with the configuration!";
70 m_problem_reported = true;
71 }
72 }
73
76}
77
81void
83{
84 // check error fields
85}
86
87} // namespace fdreadoutlibs
88} // namespace dunedaq
void conf(const appmodel::DataHandlerModule *conf) override
Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
#define TLOG(...)
Definition macro.hpp:22
static constexpr int tot_adc16_samples
static constexpr int ticks_between_adc_samples
Including Qt Headers.
PDS Frame with unphysical timestamp detected with ch