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 "
HSIFrameProcessor.hpp
"
10
#include "
hsilibs/Types.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
(std::bind(&
HSIFrameProcessor::timestamp_check
,
this
, std::placeholders::_1));
26
// m_tasklist.push_back( std::bind(&HSIFrameProcessor::frame_error_check, this, std::placeholders::_1) );
27
inherited::conf
(
conf
);
28
}
29
30
void
31
HSIFrameProcessor::timestamp_check
(
frameptr
fp)
32
{
33
// Acquire timestamp
34
timestamp_t
current_ts = fp->
get_timestamp
();
35
uint64_t k_clock_frequency = 62500000;
// NOLINT(build/unsigned)
36
TLOG_DEBUG
(
TLVL_FRAME_RECEIVED
) <<
"Received HSI frame timestamp value of "
<< current_ts <<
" ticks (..."
37
<< std::fixed << std::setprecision(8)
38
<< (
static_cast<
double
>
(current_ts % (k_clock_frequency * 1000)) /
39
static_cast<
double
>
(k_clock_frequency))
40
<<
" sec)"
;
// NOLINT
41
42
if
(current_ts <
m_previous_ts
) {
43
TLOG
() <<
"*** Data Integrity ERROR *** Current HSIFrame timestamp "
<< current_ts
44
<<
" is before previous timestamp "
<<
m_previous_ts
;
45
}
46
47
if
(current_ts == 0) {
48
TLOG
() <<
"*** Data Integrity ERROR *** Current HSIFrame timestamp "
<< current_ts <<
" is 0"
;
49
}
50
51
m_previous_ts
= current_ts;
52
m_last_processed_daq_ts
= current_ts;
53
}
54
58
void
59
HSIFrameProcessor::frame_error_check
(
frameptr
/*fp*/
)
60
{
61
// check error fields
62
}
63
64
}
// namespace hsilibs
65
}
// 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:127
dunedaq::hsilibs::HSIFrameProcessor::m_previous_ts
timestamp_t m_previous_ts
Definition
HSIFrameProcessor.hpp:58
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:59
dunedaq::hsilibs::HSIFrameProcessor::timestamp_check
void timestamp_check(frameptr)
Definition
HSIFrameProcessor.cpp:31
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:45
Types.hpp
TLOG_DEBUG
#define TLOG_DEBUG(lvl,...)
Definition
Logging.hpp:116
TLOG
#define TLOG(...)
Definition
macro.hpp:21
dunedaq::datahandlinglibs::logging::TLVL_FRAME_RECEIVED
@ TLVL_FRAME_RECEIVED
Definition
ReadoutLogging.hpp:28
dunedaq::hsilibs
Definition
HSIEventSender.hpp:27
dunedaq
The DUNE-DAQ namespace.
Definition
cib_utilities.cpp:5
HSIFrameProcessor.hpp
Generated on
for DUNE-DAQ by
1.18.0