DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
datahandlinglibs
include
datahandlinglibs
detail
RawDataHandlerBase.hxx
Go to the documentation of this file.
1
namespace
dunedaq
{
2
namespace
datahandlinglibs
{
3
4
RawDataHandlerBase::RawDataHandlerBase
(
const
std::string& name)
5
:
m_configured
(false)
6
,
m_name
(name)
7
,
m_readout_impl
(nullptr)
8
,
m_run_marker
{ false }
9
{
10
/*
11
register_command("conf", &RawDataHandlerBase::do_conf);
12
register_command("scrap", &RawDataHandlerBase::do_scrap);
13
register_command("start", &RawDataHandlerBase::do_start);
14
register_command("stop_trigger_sources", &RawDataHandlerBase::do_stop);
15
register_command("record", &RawDataHandlerBase::do_record);
16
*/
17
}
18
19
void
20
RawDataHandlerBase::init
(std::shared_ptr<appfwk::ConfigurationManager> cfg)
21
{
22
23
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
24
<<
get_dlh_name
() <<
": Entering init() method"
;
25
const
appmodel::DataHandlerModule
* modconf = cfg->get_dal<
appmodel::DataHandlerModule
>(
get_dlh_name
());
26
if
(modconf ==
nullptr
) {
27
throw
dunedaq::datahandlinglibs::FailedReadoutInitialization(
ERS_HERE
,
get_dlh_name
(),
"not a DataHandlerModule"
);
28
}
29
m_readout_impl
=
create_readout
(modconf,
m_run_marker
);
30
if
(
m_readout_impl
==
nullptr
) {
31
TLOG
() <<
get_dlh_name
() <<
"Initialize readout implementation FAILED! "
32
<<
"Failed to find specialization for given queue setup!"
;
33
throw
dunedaq::datahandlinglibs::FailedReadoutInitialization(
ERS_HERE
,
get_dlh_name
(),
""
);
// 4 json ident
34
}
35
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
36
<<
get_dlh_name
() <<
": Exiting init() method"
;
37
}
38
39
// void
40
// RawDataHandlerBase::get_info(opmonlib::InfoCollector& ci, int level)
41
// {
42
// m_readout_impl->get_info(ci, level);
43
// }
44
45
void
46
RawDataHandlerBase::do_conf
(
const
appfwk::DAQModule::CommandData_t& args)
47
{
48
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
49
<<
get_dlh_name
() <<
": Entering do_conf() method"
;
50
m_readout_impl
->conf(args);
51
m_configured
=
true
;
52
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
53
<<
get_dlh_name
() <<
": Exiting do_conf() method"
;
54
}
55
56
void
57
RawDataHandlerBase::do_scrap
(
const
appfwk::DAQModule::CommandData_t& args)
58
{
59
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
60
<<
get_dlh_name
() <<
": Entering do_scrap() method"
;
61
m_readout_impl
->scrap(args);
62
m_configured
=
false
;
63
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
64
<<
get_dlh_name
() <<
": Exiting do_scrap() method"
;
65
}
66
void
67
RawDataHandlerBase::do_start
(
const
appfwk::DAQModule::CommandData_t& args)
68
{
69
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
70
<<
get_dlh_name
() <<
": Entering do_start() method"
;
71
m_run_marker
.store(
true
);
72
m_readout_impl
->start(args);
73
rcif::cmd::StartParams
start_params = args.get<
rcif::cmd::StartParams
>();
74
m_run_number
= start_params.
run
;
75
TLOG
() <<
get_dlh_name
() <<
" successfully started for run number "
<<
m_run_number
;
76
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
77
<<
get_dlh_name
() <<
": Exiting do_start() method"
;
78
}
79
80
void
81
RawDataHandlerBase::do_stop
(
const
appfwk::DAQModule::CommandData_t& args)
82
{
83
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
84
<<
get_dlh_name
() <<
": Entering do_stop() method"
;
85
m_run_marker
.store(
false
);
86
m_readout_impl
->stop(args);
87
TLOG
() <<
get_dlh_name
() <<
" successfully stopped for run number "
<<
m_run_number
;
88
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
89
<<
get_dlh_name
() <<
": Exiting do_stop() method"
;
90
}
91
92
void
93
RawDataHandlerBase::do_record
(
const
appfwk::DAQModule::CommandData_t& args)
94
{
95
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
96
<<
get_dlh_name
() <<
": Entering do_issue_recording() method"
;
97
m_readout_impl
->record(args);
98
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
)
99
<<
get_dlh_name
() <<
": Exiting do_issue_recording() method"
;
100
}
101
102
}
// namespace datahandlinglibs
103
}
// namespace dunedaq
ERS_HERE
#define ERS_HERE
Definition
LocalContext.hpp:127
dunedaq::appmodel::DataHandlerModule
Definition
DataHandlerModule.hpp:36
dunedaq::datahandlinglibs::RawDataHandlerBase::create_readout
virtual std::shared_ptr< dunedaq::datahandlinglibs::DataHandlingConcept > create_readout(const appmodel::DataHandlerModule *modconf, std::atomic< bool > &run_marker)=0
dunedaq::datahandlinglibs::RawDataHandlerBase::m_run_number
daqdataformats::run_number_t m_run_number
Definition
RawDataHandlerBase.hpp:68
dunedaq::datahandlinglibs::RawDataHandlerBase::do_conf
void do_conf(const appfwk::DAQModule::CommandData_t &)
Definition
RawDataHandlerBase.hxx:46
dunedaq::datahandlinglibs::RawDataHandlerBase::RawDataHandlerBase
RawDataHandlerBase(const std::string &name)
RawDataHandlerBase Constructor.
Definition
RawDataHandlerBase.hxx:4
dunedaq::datahandlinglibs::RawDataHandlerBase::init
void init(std::shared_ptr< appfwk::ConfigurationManager > cfg)
Definition
RawDataHandlerBase.hxx:20
dunedaq::datahandlinglibs::RawDataHandlerBase::do_stop
void do_stop(const appfwk::DAQModule::CommandData_t &)
Definition
RawDataHandlerBase.hxx:81
dunedaq::datahandlinglibs::RawDataHandlerBase::m_configured
bool m_configured
Definition
RawDataHandlerBase.hpp:67
dunedaq::datahandlinglibs::RawDataHandlerBase::do_start
void do_start(const appfwk::DAQModule::CommandData_t &)
Definition
RawDataHandlerBase.hxx:67
dunedaq::datahandlinglibs::RawDataHandlerBase::get_dlh_name
std::string get_dlh_name()
Definition
RawDataHandlerBase.hpp:63
dunedaq::datahandlinglibs::RawDataHandlerBase::m_run_marker
std::atomic< bool > m_run_marker
Definition
RawDataHandlerBase.hpp:77
dunedaq::datahandlinglibs::RawDataHandlerBase::m_name
std::string m_name
Definition
RawDataHandlerBase.hpp:71
dunedaq::datahandlinglibs::RawDataHandlerBase::do_scrap
void do_scrap(const appfwk::DAQModule::CommandData_t &)
Definition
RawDataHandlerBase.hxx:57
dunedaq::datahandlinglibs::RawDataHandlerBase::do_record
void do_record(const appfwk::DAQModule::CommandData_t &)
Definition
RawDataHandlerBase.hxx:93
dunedaq::datahandlinglibs::RawDataHandlerBase::m_readout_impl
std::shared_ptr< datahandlinglibs::DataHandlingConcept > m_readout_impl
Definition
RawDataHandlerBase.hpp:74
TLOG_DEBUG
#define TLOG_DEBUG(lvl,...)
Definition
Logging.hpp:116
TLOG
#define TLOG(...)
Definition
macro.hpp:21
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
@ TLVL_ENTER_EXIT_METHODS
Definition
ReadoutLogging.hpp:22
dunedaq::datahandlinglibs
Definition
DataHandlingConcept.hpp:16
dunedaq
The DUNE-DAQ namespace.
Definition
cib_utilities.cpp:5
dunedaq::rcif::cmd::StartParams
Definition
Structs.hpp:75
dunedaq::rcif::cmd::StartParams::run
RunNumber run
Definition
Structs.hpp:78
Generated on
for DUNE-DAQ by
1.18.0