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
20
void
21
RawDataHandlerBase::init
(std::shared_ptr<appfwk::ConfigurationManager> cfg)
22
{
23
24
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
) <<
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
) <<
get_dlh_name
() <<
": Exiting init() method"
;
36
}
37
38
// void
39
// RawDataHandlerBase::get_info(opmonlib::InfoCollector& ci, int level)
40
// {
41
// m_readout_impl->get_info(ci, level);
42
// }
43
44
void
45
RawDataHandlerBase::do_conf
(
const
appfwk::DAQModule::CommandData_t& args)
46
{
47
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
) <<
get_dlh_name
() <<
": Entering do_conf() method"
;
48
m_readout_impl
->conf(args);
49
m_configured
=
true
;
50
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
) <<
get_dlh_name
() <<
": Exiting do_conf() method"
;
51
}
52
53
void
54
RawDataHandlerBase::do_scrap
(
const
appfwk::DAQModule::CommandData_t& args)
55
{
56
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
) <<
get_dlh_name
() <<
": Entering do_scrap() method"
;
57
m_readout_impl
->scrap(args);
58
m_configured
=
false
;
59
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
) <<
get_dlh_name
() <<
": Exiting do_scrap() method"
;
60
}
61
void
62
RawDataHandlerBase::do_start
(
const
appfwk::DAQModule::CommandData_t& args)
63
{
64
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
) <<
get_dlh_name
() <<
": Entering do_start() method"
;
65
m_run_marker
.store(
true
);
66
m_readout_impl
->start(args);
67
rcif::cmd::StartParams
start_params = args.get<
rcif::cmd::StartParams
>();
68
m_run_number
= start_params.
run
;
69
TLOG
() <<
get_dlh_name
() <<
" successfully started for run number "
<<
m_run_number
;
70
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
) <<
get_dlh_name
() <<
": Exiting do_start() method"
;
71
}
72
73
void
74
RawDataHandlerBase::do_stop
(
const
appfwk::DAQModule::CommandData_t& args)
75
{
76
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
) <<
get_dlh_name
() <<
": Entering do_stop() method"
;
77
m_run_marker
.store(
false
);
78
m_readout_impl
->stop(args);
79
TLOG
() <<
get_dlh_name
() <<
" successfully stopped for run number "
<<
m_run_number
;
80
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
) <<
get_dlh_name
() <<
": Exiting do_stop() method"
;
81
}
82
83
void
84
RawDataHandlerBase::do_record
(
const
appfwk::DAQModule::CommandData_t& args)
85
{
86
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
) <<
get_dlh_name
() <<
": Entering do_issue_recording() method"
;
87
m_readout_impl
->record(args);
88
TLOG_DEBUG
(
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
) <<
get_dlh_name
() <<
": Exiting do_issue_recording() method"
;
89
}
90
91
}
// namespace datahandlinglibs
92
}
// namespace dunedaq
93
ERS_HERE
#define ERS_HERE
Definition
LocalContext.hpp:141
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:45
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:21
dunedaq::datahandlinglibs::RawDataHandlerBase::do_stop
void do_stop(const appfwk::DAQModule::CommandData_t &)
Definition
RawDataHandlerBase.hxx:74
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:62
dunedaq::datahandlinglibs::RawDataHandlerBase::get_dlh_name
std::string get_dlh_name()
Definition
RawDataHandlerBase.hpp:62
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:54
dunedaq::datahandlinglibs::RawDataHandlerBase::do_record
void do_record(const appfwk::DAQModule::CommandData_t &)
Definition
RawDataHandlerBase.hxx:84
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:112
TLOG
#define TLOG(...)
Definition
macro.hpp:22
dunedaq::datahandlinglibs::logging::TLVL_ENTER_EXIT_METHODS
@ TLVL_ENTER_EXIT_METHODS
Definition
ReadoutLogging.hpp:22
dunedaq::datahandlinglibs
Definition
DataHandlingConcept.hpp:16
dunedaq
Including Qt Headers.
Definition
module.cpp:16
dunedaq::rcif::cmd::StartParams
Definition
Structs.hpp:77
dunedaq::rcif::cmd::StartParams::run
RunNumber run
Definition
Structs.hpp:80
Generated on
for DUNE-DAQ by
1.17.0