DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
appmodel
src
HSIEventToTCApplication.cpp
Go to the documentation of this file.
1
10
11
#include "
appmodel/HSIEventToTCApplication.hpp
"
12
#include "
ConfigObjectFactory.hpp
"
13
#include "
appmodel/DataSubscriberModule.hpp
"
14
#include "
appmodel/HSI2TCTranslatorConf.hpp
"
15
#include "
appmodel/NetworkConnectionDescriptor.hpp
"
16
#include "
appmodel/NetworkConnectionRule.hpp
"
17
#include "
appmodel/QueueConnectionRule.hpp
"
18
#include "
appmodel/QueueDescriptor.hpp
"
19
#include "
appmodel/appmodelIssues.hpp
"
20
#include "
conffwk/Configuration.hpp
"
21
#include "
confmodel/Connection.hpp
"
22
#include "
confmodel/NetworkConnection.hpp
"
23
#include "
confmodel/Service.hpp
"
24
#include "
logging/Logging.hpp
"
25
#include "
oks/kernel.hpp
"
26
27
#include <string>
28
#include <vector>
29
30
namespace
dunedaq
{
31
namespace
appmodel
{
32
33
void
34
HSIEventToTCApplication::generate_modules
(std::shared_ptr<appmodel::ConfigurationHelper>
/*helper*/
)
const
35
{
36
37
ConfigObjectFactory
obj_fac(
this
);
38
39
std::vector<const confmodel::DaqModule*> modules;
40
41
std::string hstcUid(
"module-"
+
UID
());
42
TLOG_DEBUG
(7) <<
"creating OKS configuration object for the DataSubscriberModule class "
;
43
conffwk::ConfigObject
hstcObj = obj_fac.
create
(
"DataSubscriberModule"
, hstcUid);
44
45
auto
hstcConf =
get_hsevent_to_tc_conf
();
46
hstcObj.
set_obj
(
"configuration"
, &hstcConf->config_object());
47
48
if
(hstcConf == 0) {
49
throw
(BadConf(
ERS_HERE
,
"No HSI2TCTranslatorConf configuration given"
));
50
}
51
52
conffwk::ConfigObject
inObj;
53
conffwk::ConfigObject
outObj;
54
55
for
(
auto
rule :
get_network_rules
()) {
56
auto
endpoint_class = rule->get_endpoint_class();
57
auto
descriptor
= rule->get_descriptor();
58
59
if
(
descriptor
->get_data_type() ==
"HSIEvent"
) {
60
inObj = obj_fac.
create_net_obj
(
descriptor
,
""
);
61
}
else
if
(
descriptor
->get_data_type() ==
"TriggerCandidate"
) {
62
outObj = obj_fac.
create_net_obj
(
descriptor
,
UID
());
63
}
64
}
65
66
if
(inObj ==
nullptr
) {
67
throw
(BadConf(
ERS_HERE
,
"No HSIEvent input connection descriptor given"
));
68
}
69
if
(outObj ==
nullptr
) {
70
throw
(BadConf(
ERS_HERE
,
"No TriggerCandidate output connection descriptor given"
));
71
}
72
73
hstcObj.
set_objs
(
"inputs"
, { &inObj });
74
hstcObj.
set_objs
(
"outputs"
, { &outObj });
75
76
// Add to our list of modules to return
77
modules.push_back(obj_fac.
get_dal
<
DataSubscriberModule
>(hstcUid));
78
79
obj_fac.
update_modules
(modules);
80
}
81
82
}
// namespace appmodel
83
}
// namespace dunedaq
ConfigObjectFactory.hpp
ERS_HERE
#define ERS_HERE
Definition
LocalContext.hpp:127
appmodelIssues.hpp
dunedaq::appmodel::ConfigObjectFactory
Definition
ConfigObjectFactory.hpp:32
dunedaq::appmodel::ConfigObjectFactory::update_modules
void update_modules(const std::vector< const confmodel::DaqModule * > &modules)
Definition
ConfigObjectFactory.hpp:83
dunedaq::appmodel::ConfigObjectFactory::create_net_obj
conffwk::ConfigObject create_net_obj(const NetworkConnectionDescriptor *ndesc, std::string uid) const
Helper function that gets a network connection config.
Definition
ConfigObjectFactory.cpp:94
dunedaq::appmodel::ConfigObjectFactory::get_dal
const T * get_dal(std::string uid) const
Definition
ConfigObjectFactory.hpp:72
dunedaq::appmodel::ConfigObjectFactory::create
conffwk::ConfigObject create(const std::string &class_name, const std::string &id) const
Definition
ConfigObjectFactory.cpp:28
dunedaq::appmodel::DataSubscriberModule
Definition
DataSubscriberModule.hpp:32
dunedaq::appmodel::HSIEventToTCApplication::generate_modules
void generate_modules(std::shared_ptr< appmodel::ConfigurationHelper >) const override
Definition
HSIEventToTCApplication.cpp:34
dunedaq::appmodel::HSIEventToTCApplication::get_hsevent_to_tc_conf
const dunedaq::appmodel::HSI2TCTranslatorConf * get_hsevent_to_tc_conf() const
Get "hsevent_to_tc_conf" relationship value.
Definition
HSIEventToTCApplication.hpp:103
dunedaq::appmodel::SmartDaqApplication::get_network_rules
const std::vector< const dunedaq::appmodel::NetworkConnectionRule * > & get_network_rules() const
Get "network_rules" relationship value.
Definition
SmartDaqApplication.hpp:168
dunedaq::conffwk::ConfigObject::set_objs
void set_objs(const std::string &name, const std::vector< const ConfigObject * > &o, bool skip_non_null_check=false)
Set relationship multi-value.
Definition
ConfigObject.hpp:345
dunedaq::conffwk::ConfigObject::set_obj
void set_obj(const std::string &name, const ConfigObject *o, bool skip_non_null_check=false)
Set relationship single-value.
Definition
ConfigObject.hpp:329
dunedaq::conffwk::DalObject::UID
const std::string & UID() const noexcept
Definition
DalObject.hpp:119
Configuration.hpp
conffwk entry point
DataSubscriberModule.hpp
HSI2TCTranslatorConf.hpp
HSIEventToTCApplication.hpp
NetworkConnectionDescriptor.hpp
NetworkConnectionRule.hpp
QueueConnectionRule.hpp
QueueDescriptor.hpp
Connection.hpp
NetworkConnection.hpp
Service.hpp
kernel.hpp
Logging.hpp
TLOG_DEBUG
#define TLOG_DEBUG(lvl,...)
Definition
Logging.hpp:116
conffwk.ConfigObject
Definition
ConfigObject.py:1
dunedaq::appmodel
Definition
CardControllerWrapper.hpp:21
dunedaq
The DUNE-DAQ namespace.
Definition
cib_utilities.cpp:5
dunedaq::descriptor
CIB Buffer std::string descriptor Message from std::string descriptor CIB process std::string descriptor descriptor
Definition
CIBModuleIssues.hpp:35
Generated on
for DUNE-DAQ by
1.18.0