DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
fdreadoutlibs
include
fdreadoutlibs
daphneeth
DAPHNEEthFrameProcessor.hpp
Go to the documentation of this file.
1
8
#ifndef FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNEETH_DAPHNEETHFRAMEPROCESSOR_HPP_
9
#define FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNEETH_DAPHNEETHFRAMEPROCESSOR_HPP_
10
11
#include "
logging/Logging.hpp
"
12
13
#include "
datahandlinglibs/DataHandlingIssues.hpp
"
14
#include "
datahandlinglibs/FrameErrorRegistry.hpp
"
15
#include "
datahandlinglibs/ReadoutLogging.hpp
"
16
17
#include "
iomanager/IOManager.hpp
"
18
#include "
iomanager/Sender.hpp
"
19
20
#include "
datahandlinglibs/models/TaskRawDataProcessorModel.hpp
"
21
#include "
fdreadoutlibs/FDReadoutIssues.hpp
"
22
#include "
trigger/TriggerPrimitiveTypeAdapter.hpp
"
23
24
#include "
fddetdataformats/DAPHNEEthFrame.hpp
"
25
#include "
fdreadoutlibs/DAPHNEEthTypeAdapter.hpp
"
26
#include "
trgdataformats/TriggerPrimitive.hpp
"
27
28
#include "
appmodel/PDSRawDataProcessor.hpp
"
29
#include "
appmodel/TPCRawDataProcessor.hpp
"
30
31
#include "
detchannelmaps/PDSChannelMap.hpp
"
32
33
#include "
appmodel/DataHandlerModule.hpp
"
34
#include "
confmodel/Connection.hpp
"
35
36
#include <atomic>
37
#include <functional>
38
#include <memory>
39
#include <string>
40
41
using
dunedaq::datahandlinglibs::logging::TLVL_BOOKKEEPING
;
42
43
namespace
dunedaq
{
44
namespace
fdreadoutlibs
{
45
46
class
DAPHNEEthFrameProcessor
:
public
datahandlinglibs::TaskRawDataProcessorModel
<types::DAPHNEEthTypeAdapter>
47
{
48
49
public
:
50
using
inherited
=
datahandlinglibs::TaskRawDataProcessorModel<types::DAPHNEEthTypeAdapter>
;
51
using
frameptr
=
types::DAPHNEEthTypeAdapter
*;
52
using
daphneframeptr
=
dunedaq::fddetdataformats::DAPHNEEthFrame
*;
53
using
timestamp_t
= std::uint64_t;
// NOLINT(build/unsigned)
54
using
constframeptr
=
const
types::DAPHNEEthTypeAdapter
*;
55
56
// Constructor
57
explicit
DAPHNEEthFrameProcessor
(std::unique_ptr<datahandlinglibs::FrameErrorRegistry>& error_registry,
58
bool
post_processing_enabled)
59
:
datahandlinglibs
::
TaskRawDataProcessorModel
<
types
::DAPHNEEthTypeAdapter>(error_registry, post_processing_enabled)
60
{
61
}
62
63
// Override config for pipeline setup
64
void
conf
(
const
appmodel::DataHandlerModule
*
conf
)
override
;
65
66
void
start
(
const
appfwk::DAQModule::CommandData_t& args)
override
;
67
void
stop
(
const
appfwk::DAQModule::CommandData_t& args)
override
;
68
69
protected
:
70
virtual
void
generate_opmon_data
()
override
;
71
75
void
timestamp_check
(
frameptr
/*fp*/
);
76
80
void
frame_error_check
(
frameptr
/*fp*/
);
81
82
// Internals
83
timestamp_t
m_previous_ts
= 0;
84
timestamp_t
m_current_ts
= 0;
85
bool
m_first_ts_fake
=
true
;
86
bool
m_first_ts_missmatch
=
true
;
87
bool
m_problem_reported
=
false
;
88
std::atomic<int>
m_ts_error_ctr
{ 0 };
89
90
void
extract_tps
(
constframeptr
fp);
91
92
private
:
93
// PDSChannelMap
94
std::shared_ptr<detchannelmaps::PDSChannelMap>
m_channel_map
;
95
std::vector<std::pair<trgdataformats::channel_t, int16_t>>
m_channel_plane_numbers
;
96
97
uint32_t
m_det_id
;
// NOLINT(build/unsigned)
98
uint32_t
m_crate_id
;
// NOLINT(build/unsigned)
99
uint32_t
m_slot_id
;
// NOLINT(build/unsigned)
100
uint32_t
m_stream_id
;
// NOLINT(build/unsigned)
101
102
std::set<unsigned int>
m_channel_mask_set
;
103
uint32_t
m_def_adc_intg_thresh
= 0;
104
105
std::shared_ptr<iomanager::SenderConcept<std::vector<trigger::TriggerPrimitiveTypeAdapter>>>
m_tp_sink
;
106
107
std::atomic<uint64_t>
m_num_new_tps
{ 0 };
// NOLINT(build/unsigned)
108
std::atomic<uint64_t>
m_tps_suppressed_too_long
{ 0 };
109
std::atomic<uint64_t>
m_tps_send_failed
{ 0 };
110
std::atomic<uint64_t>
m_frame_counter
{ 0 };
111
112
std::chrono::time_point<std::chrono::high_resolution_clock>
m_t0
;
113
};
114
115
}
// namespace fdreadoutlibs
116
}
// namespace dunedaq
117
118
#endif
// FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNEETH_DAPHNEETHFRAMEPROCESSOR_HPP_
DAPHNEEthFrame.hpp
DAPHNEEthTypeAdapter.hpp
DataHandlingIssues.hpp
FDReadoutIssues.hpp
FrameErrorRegistry.hpp
IOManager.hpp
PDSChannelMap.hpp
ReadoutLogging.hpp
TaskRawDataProcessorModel.hpp
TriggerPrimitiveTypeAdapter.hpp
dunedaq::appmodel::DataHandlerModule
Definition
DataHandlerModule.hpp:36
dunedaq::datahandlinglibs::TaskRawDataProcessorModel
Definition
TaskRawDataProcessorModel.hpp:47
dunedaq::datahandlinglibs::TaskRawDataProcessorModel< types::DAPHNEEthTypeAdapter >::TaskRawDataProcessorModel
TaskRawDataProcessorModel(std::unique_ptr< FrameErrorRegistry > &error_registry, bool post_processing_enabled)
Definition
TaskRawDataProcessorModel.hpp:50
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_frame_counter
std::atomic< uint64_t > m_frame_counter
Definition
DAPHNEEthFrameProcessor.hpp:110
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::timestamp_t
std::uint64_t timestamp_t
Definition
DAPHNEEthFrameProcessor.hpp:53
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::generate_opmon_data
virtual void generate_opmon_data() override
Definition
DAPHNEEthFrameProcessor.cpp:220
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_current_ts
timestamp_t m_current_ts
Definition
DAPHNEEthFrameProcessor.hpp:84
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_first_ts_fake
bool m_first_ts_fake
Definition
DAPHNEEthFrameProcessor.hpp:85
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_ts_error_ctr
std::atomic< int > m_ts_error_ctr
Definition
DAPHNEEthFrameProcessor.hpp:88
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::timestamp_check
void timestamp_check(frameptr)
Definition
DAPHNEEthFrameProcessor.cpp:116
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_problem_reported
bool m_problem_reported
Definition
DAPHNEEthFrameProcessor.hpp:87
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::constframeptr
const types::DAPHNEEthTypeAdapter * constframeptr
Definition
DAPHNEEthFrameProcessor.hpp:54
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_tps_send_failed
std::atomic< uint64_t > m_tps_send_failed
Definition
DAPHNEEthFrameProcessor.hpp:109
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_num_new_tps
std::atomic< uint64_t > m_num_new_tps
Definition
DAPHNEEthFrameProcessor.hpp:107
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_t0
std::chrono::time_point< std::chrono::high_resolution_clock > m_t0
Definition
DAPHNEEthFrameProcessor.hpp:112
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::frame_error_check
void frame_error_check(frameptr)
Definition
DAPHNEEthFrameProcessor.cpp:156
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_tps_suppressed_too_long
std::atomic< uint64_t > m_tps_suppressed_too_long
Definition
DAPHNEEthFrameProcessor.hpp:108
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_channel_map
std::shared_ptr< detchannelmaps::PDSChannelMap > m_channel_map
Definition
DAPHNEEthFrameProcessor.hpp:94
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_tp_sink
std::shared_ptr< iomanager::SenderConcept< std::vector< trigger::TriggerPrimitiveTypeAdapter > > > m_tp_sink
Definition
DAPHNEEthFrameProcessor.hpp:105
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::DAPHNEEthFrameProcessor
DAPHNEEthFrameProcessor(std::unique_ptr< datahandlinglibs::FrameErrorRegistry > &error_registry, bool post_processing_enabled)
Definition
DAPHNEEthFrameProcessor.hpp:57
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_def_adc_intg_thresh
uint32_t m_def_adc_intg_thresh
Definition
DAPHNEEthFrameProcessor.hpp:103
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::frameptr
types::DAPHNEEthTypeAdapter * frameptr
Definition
DAPHNEEthFrameProcessor.hpp:51
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_channel_mask_set
std::set< unsigned int > m_channel_mask_set
Definition
DAPHNEEthFrameProcessor.hpp:102
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_crate_id
uint32_t m_crate_id
Definition
DAPHNEEthFrameProcessor.hpp:98
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::daphneframeptr
dunedaq::fddetdataformats::DAPHNEEthFrame * daphneframeptr
Definition
DAPHNEEthFrameProcessor.hpp:52
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::extract_tps
void extract_tps(constframeptr fp)
Definition
DAPHNEEthFrameProcessor.cpp:162
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::inherited
datahandlinglibs::TaskRawDataProcessorModel< types::DAPHNEEthTypeAdapter > inherited
Definition
DAPHNEEthFrameProcessor.hpp:50
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::stop
void stop(const appfwk::DAQModule::CommandData_t &args) override
Stop operation.
Definition
DAPHNEEthFrameProcessor.cpp:108
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_stream_id
uint32_t m_stream_id
Definition
DAPHNEEthFrameProcessor.hpp:100
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_slot_id
uint32_t m_slot_id
Definition
DAPHNEEthFrameProcessor.hpp:99
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_previous_ts
timestamp_t m_previous_ts
Definition
DAPHNEEthFrameProcessor.hpp:83
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_det_id
uint32_t m_det_id
Definition
DAPHNEEthFrameProcessor.hpp:97
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_first_ts_missmatch
bool m_first_ts_missmatch
Definition
DAPHNEEthFrameProcessor.hpp:86
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_channel_plane_numbers
std::vector< std::pair< trgdataformats::channel_t, int16_t > > m_channel_plane_numbers
Definition
DAPHNEEthFrameProcessor.hpp:95
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::start
void start(const appfwk::DAQModule::CommandData_t &args) override
Start operation.
Definition
DAPHNEEthFrameProcessor.cpp:93
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::conf
void conf(const appmodel::DataHandlerModule *conf) override
Set the emulator mode, if active, timestamps of processed packets are overwritten with new ones.
Definition
DAPHNEEthFrameProcessor.cpp:31
DataHandlerModule.hpp
PDSRawDataProcessor.hpp
TPCRawDataProcessor.hpp
Connection.hpp
Sender.hpp
Logging.hpp
dunedaq::datahandlinglibs::logging::TLVL_BOOKKEEPING
@ TLVL_BOOKKEEPING
Definition
ReadoutLogging.hpp:26
dunedaq::datahandlinglibs
Definition
DataHandlingConcept.hpp:16
dunedaq::fdreadoutlibs::types
Definition
CRTBernTypeAdapter.hpp:16
dunedaq::fdreadoutlibs
Definition
CRTBernFrameProcessor.hpp:16
dunedaq
The DUNE-DAQ namespace.
Definition
cib_utilities.cpp:5
dunedaq::fddetdataformats::DAPHNEEthFrame
Struct for accessing raw DAPHNE eth frames.
Definition
DAPHNEEthFrame.hpp:42
dunedaq::fdreadoutlibs::types::DAPHNEEthTypeAdapter
Definition
DAPHNEEthTypeAdapter.hpp:25
TriggerPrimitive.hpp
Generated on
for DUNE-DAQ by
1.18.0