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/FrameErrorRegistry.hpp
"
14
#include "
datahandlinglibs/DataHandlingIssues.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 "
trigger/TriggerPrimitiveTypeAdapter.hpp
"
22
#include "
fdreadoutlibs/FDReadoutIssues.hpp
"
23
24
#include "
fddetdataformats/DAPHNEEthFrame.hpp
"
25
#include "
trgdataformats/TriggerPrimitive.hpp
"
26
#include "
fdreadoutlibs/DAPHNEEthTypeAdapter.hpp
"
27
28
#include "
appmodel/TPCRawDataProcessor.hpp
"
29
#include "
appmodel/PDSRawDataProcessor.hpp
"
30
31
32
#include "
detchannelmaps/PDSChannelMap.hpp
"
33
34
35
#include "
appmodel/DataHandlerModule.hpp
"
36
#include "
confmodel/Connection.hpp
"
37
38
#include <atomic>
39
#include <functional>
40
#include <memory>
41
#include <string>
42
43
using
dunedaq::datahandlinglibs::logging::TLVL_BOOKKEEPING
;
44
45
namespace
dunedaq
{
46
namespace
fdreadoutlibs
{
47
48
class
DAPHNEEthFrameProcessor
:
public
datahandlinglibs::TaskRawDataProcessorModel
<types::DAPHNEEthTypeAdapter>
49
{
50
51
public
:
52
using
inherited
=
datahandlinglibs::TaskRawDataProcessorModel<types::DAPHNEEthTypeAdapter>
;
53
using
frameptr
=
types::DAPHNEEthTypeAdapter
*;
54
using
daphneframeptr
=
dunedaq::fddetdataformats::DAPHNEEthFrame
*;
55
using
timestamp_t
= std::uint64_t;
// NOLINT(build/unsigned)
56
using
constframeptr
=
const
types::DAPHNEEthTypeAdapter
*;
57
58
// Constructor
59
explicit
DAPHNEEthFrameProcessor
(std::unique_ptr<datahandlinglibs::FrameErrorRegistry>& error_registry,
bool
post_processing_enabled)
60
:
datahandlinglibs
::
TaskRawDataProcessorModel
<
types
::DAPHNEEthTypeAdapter>(error_registry, post_processing_enabled)
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
94
//PDSChannelMap
95
std::shared_ptr<detchannelmaps::PDSChannelMap>
m_channel_map
;
96
std::vector<std::pair<trgdataformats::channel_t, int16_t>>
m_channel_plane_numbers
;
97
98
uint32_t
m_det_id
;
// NOLINT(build/unsigned)
99
uint32_t
m_crate_id
;
// NOLINT(build/unsigned)
100
uint32_t
m_slot_id
;
// NOLINT(build/unsigned)
101
uint32_t
m_stream_id
;
// NOLINT(build/unsigned)
102
103
std::set<unsigned int>
m_channel_mask_set
;
104
uint32_t
m_def_adc_intg_thresh
= 0;
105
106
107
108
std::shared_ptr<iomanager::SenderConcept<std::vector<trigger::TriggerPrimitiveTypeAdapter>>>
m_tp_sink
;
109
110
std::atomic<uint64_t>
m_num_new_tps
{ 0 };
// NOLINT(build/unsigned)
111
std::atomic<uint64_t>
m_tps_suppressed_too_long
{ 0 };
112
std::atomic<uint64_t>
m_tps_send_failed
{ 0 };
113
std::atomic<uint64_t>
m_frame_counter
{ 0 };
114
115
std::chrono::time_point<std::chrono::high_resolution_clock>
m_t0
;
116
117
118
};
119
120
}
// namespace fdreadoutlibs
121
}
// namespace dunedaq
122
123
#endif
// FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNEETH_DAPHNEETHFRAMEPROCESSOR_HPP_
124
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:113
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::timestamp_t
std::uint64_t timestamp_t
Definition
DAPHNEEthFrameProcessor.hpp:55
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::generate_opmon_data
virtual void generate_opmon_data() override
Definition
DAPHNEEthFrameProcessor.cpp:212
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:112
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:56
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_tps_send_failed
std::atomic< uint64_t > m_tps_send_failed
Definition
DAPHNEEthFrameProcessor.hpp:112
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_num_new_tps
std::atomic< uint64_t > m_num_new_tps
Definition
DAPHNEEthFrameProcessor.hpp:110
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_t0
std::chrono::time_point< std::chrono::high_resolution_clock > m_t0
Definition
DAPHNEEthFrameProcessor.hpp:115
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::frame_error_check
void frame_error_check(frameptr)
Definition
DAPHNEEthFrameProcessor.cpp:149
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_tps_suppressed_too_long
std::atomic< uint64_t > m_tps_suppressed_too_long
Definition
DAPHNEEthFrameProcessor.hpp:111
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_channel_map
std::shared_ptr< detchannelmaps::PDSChannelMap > m_channel_map
Definition
DAPHNEEthFrameProcessor.hpp:95
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_tp_sink
std::shared_ptr< iomanager::SenderConcept< std::vector< trigger::TriggerPrimitiveTypeAdapter > > > m_tp_sink
Definition
DAPHNEEthFrameProcessor.hpp:108
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::DAPHNEEthFrameProcessor
DAPHNEEthFrameProcessor(std::unique_ptr< datahandlinglibs::FrameErrorRegistry > &error_registry, bool post_processing_enabled)
Definition
DAPHNEEthFrameProcessor.hpp:59
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_def_adc_intg_thresh
uint32_t m_def_adc_intg_thresh
Definition
DAPHNEEthFrameProcessor.hpp:104
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::frameptr
types::DAPHNEEthTypeAdapter * frameptr
Definition
DAPHNEEthFrameProcessor.hpp:53
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_channel_mask_set
std::set< unsigned int > m_channel_mask_set
Definition
DAPHNEEthFrameProcessor.hpp:103
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_crate_id
uint32_t m_crate_id
Definition
DAPHNEEthFrameProcessor.hpp:99
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::daphneframeptr
dunedaq::fddetdataformats::DAPHNEEthFrame * daphneframeptr
Definition
DAPHNEEthFrameProcessor.hpp:54
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::extract_tps
void extract_tps(constframeptr fp)
Definition
DAPHNEEthFrameProcessor.cpp:155
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::inherited
datahandlinglibs::TaskRawDataProcessorModel< types::DAPHNEEthTypeAdapter > inherited
Definition
DAPHNEEthFrameProcessor.hpp:52
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::stop
void stop(const appfwk::DAQModule::CommandData_t &args) override
Stop operation.
Definition
DAPHNEEthFrameProcessor.cpp:104
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_stream_id
uint32_t m_stream_id
Definition
DAPHNEEthFrameProcessor.hpp:101
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::m_slot_id
uint32_t m_slot_id
Definition
DAPHNEEthFrameProcessor.hpp:100
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:98
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:96
dunedaq::fdreadoutlibs::DAPHNEEthFrameProcessor::start
void start(const appfwk::DAQModule::CommandData_t &args) override
Start operation.
Definition
DAPHNEEthFrameProcessor.cpp:89
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
Including Qt Headers.
Definition
module.cpp:16
dunedaq::fddetdataformats::DAPHNEEthFrame
Struct for accessing raw DAPHNE eth frames.
Definition
DAPHNEEthFrame.hpp:42
dunedaq::fdreadoutlibs::types::DAPHNEEthTypeAdapter
Definition
DAPHNEEthTypeAdapter.hpp:26
TriggerPrimitive.hpp
Generated on
for DUNE-DAQ by
1.17.0