DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
hsilibs
src
HSIFrameProcessor.cpp
Go to the documentation of this file.
1
9
#include "
hsilibs/Types.hpp
"
10
#include "
HSIFrameProcessor.hpp
"
11
12
#include <atomic>
13
#include <functional>
14
#include <memory>
15
#include <string>
16
17
using
dunedaq::datahandlinglibs::logging::TLVL_FRAME_RECEIVED
;
18
19
namespace
dunedaq
{
20
namespace
hsilibs
{
21
22
void
23
HSIFrameProcessor::conf
(
const
appmodel::DataHandlerModule
*
conf
)
24
{
25
inherited::add_preprocess_task
(
26
std::bind(&
HSIFrameProcessor::timestamp_check
,
this
, std::placeholders::_1));
27
// m_tasklist.push_back( std::bind(&HSIFrameProcessor::frame_error_check, this, std::placeholders::_1) );
28
inherited::conf
(
conf
);
29
}
30
31
void
32
HSIFrameProcessor::timestamp_check
(
frameptr
fp)
33
{
34
// Acquire timestamp
35
timestamp_t
current_ts = fp->
get_timestamp
();
36
uint64_t k_clock_frequency = 62500000;
// NOLINT(build/unsigned)
37
TLOG_DEBUG
(
TLVL_FRAME_RECEIVED
) <<
"Received HSI frame timestamp value of "
<< current_ts <<
" ticks (..."
38
<< std::fixed << std::setprecision(8) << (static_cast<double>(current_ts % (k_clock_frequency*1000)) /
static_cast<
double
>
(k_clock_frequency)) <<
" sec)"
;
// NOLINT
39
40
if
(current_ts <
m_previous_ts
) {
41
TLOG
() <<
"*** Data Integrity ERROR *** Current HSIFrame timestamp "
<< current_ts <<
" is before previous timestamp "
<<
m_previous_ts
;
42
}
43
44
if
(current_ts == 0) {
45
TLOG
() <<
"*** Data Integrity ERROR *** Current HSIFrame timestamp "
<< current_ts <<
" is 0"
;
46
}
47
48
m_previous_ts
= current_ts;
49
m_last_processed_daq_ts
= current_ts;
50
}
51
55
void
56
HSIFrameProcessor::frame_error_check
(
frameptr
/*fp*/
)
57
{
58
// check error fields
59
}
60
61
}
// namespace hsilibs
62
}
// namespace dunedaq
TLVL_FRAME_RECEIVED
@ TLVL_FRAME_RECEIVED
Definition
ReadoutLogging.hpp:28
dunedaq::appmodel::DataHandlerModule
Definition
DataHandlerModule.hpp:36
dunedaq::datahandlinglibs::TaskRawDataProcessorModel< hsilibs::HSI_FRAME_STRUCT >::add_preprocess_task
void add_preprocess_task(Task &&task)
dunedaq::datahandlinglibs::TaskRawDataProcessorModel< hsilibs::HSI_FRAME_STRUCT >::conf
void conf(const appmodel::DataHandlerModule *conf) override
dunedaq::datahandlinglibs::TaskRawDataProcessorModel< hsilibs::HSI_FRAME_STRUCT >::m_last_processed_daq_ts
std::atomic< uint64_t > m_last_processed_daq_ts
Definition
TaskRawDataProcessorModel.hpp:126
dunedaq::hsilibs::HSIFrameProcessor::m_previous_ts
timestamp_t m_previous_ts
Definition
HSIFrameProcessor.hpp:57
dunedaq::hsilibs::HSIFrameProcessor::frameptr
hsilibs::HSI_FRAME_STRUCT * frameptr
Definition
HSIFrameProcessor.hpp:32
dunedaq::hsilibs::HSIFrameProcessor::frame_error_check
void frame_error_check(frameptr)
Definition
HSIFrameProcessor.cpp:56
dunedaq::hsilibs::HSIFrameProcessor::timestamp_check
void timestamp_check(frameptr)
Definition
HSIFrameProcessor.cpp:32
dunedaq::hsilibs::HSIFrameProcessor::timestamp_t
std::uint64_t timestamp_t
Definition
HSIFrameProcessor.hpp:33
dunedaq::hsilibs::HSIFrameProcessor::conf
void conf(const appmodel::DataHandlerModule *conf) override
Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.
Definition
HSIFrameProcessor.cpp:23
dunedaq::hsilibs::HSI_FRAME_STRUCT::get_timestamp
uint64_t get_timestamp() const
Definition
Types.hpp:48
Types.hpp
TLOG_DEBUG
#define TLOG_DEBUG(lvl,...)
Definition
Logging.hpp:112
TLOG
#define TLOG(...)
Definition
macro.hpp:22
dunedaq::datahandlinglibs::logging::TLVL_FRAME_RECEIVED
@ TLVL_FRAME_RECEIVED
Definition
ReadoutLogging.hpp:28
dunedaq::hsilibs
Definition
HSIEventSender.hpp:27
dunedaq
Including Qt Headers.
Definition
module.cpp:16
HSIFrameProcessor.hpp
Generated on
for DUNE-DAQ by
1.17.0