DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
fdreadoutlibs
src
crt
CRTBernFrameProcessor.cpp
Go to the documentation of this file.
1
8
9
#include "
fdreadoutlibs/crt/CRTBernFrameProcessor.hpp
"
// NOLINT(build/include)
10
11
namespace
dunedaq
{
12
namespace
fdreadoutlibs
{
13
14
void
15
CRTBernFrameProcessor::conf
(
const
appmodel::DataHandlerModule
*
/*conf*/
)
16
{
17
TLOG
() <<
"Registering processing tasks..."
;
18
datahandlinglibs::TaskRawDataProcessorModel<types::CRTBernTypeAdapter>::add_preprocess_task
(
19
std::bind(&
CRTBernFrameProcessor::timestamp_check
,
this
, std::placeholders::_1));
20
}
21
22
void
23
CRTBernFrameProcessor::timestamp_check
(
types::CRTBernTypeAdapter
* fp)
24
{
25
static
const
uint64_t k_clock_frequency = 62500000;
// NOLINT(build/unsigned)
26
auto
current_ts = fp->
get_timestamp
();
27
TLOG_DEBUG
(
TLVL_FRAME_RECEIVED
) <<
"Received CRTBern frame timestamp value of "
<< current_ts <<
" ticks (..."
28
<< std::fixed << std::setprecision(8)
29
<< (
static_cast<
double
>
(current_ts % (k_clock_frequency * 1000)) /
30
static_cast<
double
>
(k_clock_frequency))
31
<<
" sec)"
;
// NOLINT
32
33
if
(current_ts >
m_last_processed_daq_ts
)
34
m_last_processed_daq_ts
= current_ts;
35
}
36
37
}
// namespace fdreadoutlibs
38
}
// namespace dunedaq
CRTBernFrameProcessor.hpp
TLVL_FRAME_RECEIVED
@ TLVL_FRAME_RECEIVED
Definition
ReadoutLogging.hpp:28
dunedaq::appmodel::DataHandlerModule
Definition
DataHandlerModule.hpp:36
dunedaq::datahandlinglibs::TaskRawDataProcessorModel::add_preprocess_task
void add_preprocess_task(Task &&task)
Definition
TaskRawDataProcessorModel.hxx:73
dunedaq::datahandlinglibs::TaskRawDataProcessorModel< types::CRTBernTypeAdapter >::m_last_processed_daq_ts
std::atomic< uint64_t > m_last_processed_daq_ts
Definition
TaskRawDataProcessorModel.hpp:127
dunedaq::fdreadoutlibs::CRTBernFrameProcessor::timestamp_check
void timestamp_check(types::CRTBernTypeAdapter *fp)
Definition
CRTBernFrameProcessor.cpp:23
dunedaq::fdreadoutlibs::CRTBernFrameProcessor::conf
void conf(const appmodel::DataHandlerModule *conf) override
Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.
Definition
CRTBernFrameProcessor.cpp:15
TLOG_DEBUG
#define TLOG_DEBUG(lvl,...)
Definition
Logging.hpp:116
TLOG
#define TLOG(...)
Definition
macro.hpp:21
dunedaq::fdreadoutlibs
Definition
CRTBernFrameProcessor.hpp:16
dunedaq
The DUNE-DAQ namespace.
Definition
cib_utilities.cpp:5
dunedaq::fdreadoutlibs::types::CRTBernTypeAdapter
Definition
CRTBernTypeAdapter.hpp:21
dunedaq::fdreadoutlibs::types::CRTBernTypeAdapter::get_timestamp
uint64_t get_timestamp() const
Definition
CRTBernTypeAdapter.hpp:33
Generated on
for DUNE-DAQ by
1.18.0