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
12
#include "
ConfigObjectFactory.hpp
"
13
#include "
conffwk/Configuration.hpp
"
14
#include "
oks/kernel.hpp
"
15
#include "
confmodel/Connection.hpp
"
16
#include "
confmodel/NetworkConnection.hpp
"
17
#include "
appmodel/DataSubscriberModule.hpp
"
18
#include "
appmodel/HSIEventToTCApplication.hpp
"
19
#include "
appmodel/HSI2TCTranslatorConf.hpp
"
20
#include "
appmodel/NetworkConnectionRule.hpp
"
21
#include "
appmodel/NetworkConnectionDescriptor.hpp
"
22
#include "
appmodel/QueueConnectionRule.hpp
"
23
#include "
appmodel/QueueDescriptor.hpp
"
24
#include "
confmodel/Service.hpp
"
25
#include "
appmodel/appmodelIssues.hpp
"
26
#include "
logging/Logging.hpp
"
27
28
#include <string>
29
#include <vector>
30
31
namespace
dunedaq
{
32
namespace
appmodel
{
33
34
void
35
HSIEventToTCApplication::generate_modules
(std::shared_ptr<appmodel::ConfigurationHelper>
/*helper*/
)
const
36
{
37
38
ConfigObjectFactory
obj_fac(
this
);
39
40
std::vector<const confmodel::DaqModule*> modules;
41
42
std::string hstcUid(
"module-"
+
UID
());
43
TLOG_DEBUG
(7) <<
"creating OKS configuration object for the DataSubscriberModule class "
;
44
conffwk::ConfigObject
hstcObj = obj_fac.
create
(
"DataSubscriberModule"
, hstcUid);
45
46
auto
hstcConf =
get_hsevent_to_tc_conf
();
47
hstcObj.
set_obj
(
"configuration"
, &hstcConf->config_object());
48
49
if
(hstcConf == 0) {
50
throw
(BadConf(
ERS_HERE
,
"No HSI2TCTranslatorConf configuration given"
));
51
}
52
53
conffwk::ConfigObject
inObj;
54
conffwk::ConfigObject
outObj;
55
56
for
(
auto
rule :
get_network_rules
()) {
57
auto
endpoint_class = rule->get_endpoint_class();
58
auto
descriptor
= rule->get_descriptor();
59
60
if
(
descriptor
->get_data_type() ==
"HSIEvent"
) {
61
inObj = obj_fac.
create_net_obj
(
descriptor
,
""
);
62
}
63
else
if
(
descriptor
->get_data_type() ==
"TriggerCandidate"
) {
64
outObj = obj_fac.
create_net_obj
(
descriptor
,
UID
());
65
}
66
}
67
68
if
(inObj ==
nullptr
) {
69
throw
(BadConf(
ERS_HERE
,
"No HSIEvent input connection descriptor given"
));
70
}
71
if
(outObj ==
nullptr
) {
72
throw
(BadConf(
ERS_HERE
,
"No TriggerCandidate output connection descriptor given"
));
73
}
74
75
hstcObj.
set_objs
(
"inputs"
, {&inObj});
76
hstcObj.
set_objs
(
"outputs"
, {&outObj});
77
78
// Add to our list of modules to return
79
modules.push_back(obj_fac.
get_dal
<
DataSubscriberModule
>(hstcUid));
80
81
obj_fac.
update_modules
(modules);
82
}
83
84
}
// namespace appmodel
85
}
// namespace dunedaq
ConfigObjectFactory.hpp
ERS_HERE
#define ERS_HERE
Definition
LocalContext.hpp:141
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:87
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:90
dunedaq::appmodel::ConfigObjectFactory::get_dal
const T * get_dal(std::string uid) const
Definition
ConfigObjectFactory.hpp:77
dunedaq::appmodel::ConfigObjectFactory::create
conffwk::ConfigObject create(const std::string &class_name, const std::string &id) const
Definition
ConfigObjectFactory.cpp:26
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:35
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:372
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:356
dunedaq::conffwk::DalObject::UID
const std::string & UID() const noexcept
Definition
DalObject.hpp:135
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:112
conffwk.ConfigObject
Definition
ConfigObject.py:1
dunedaq::appmodel
Definition
CardControllerWrapper.hpp:21
dunedaq
Including Qt Headers.
Definition
module.cpp:16
dunedaq::descriptor
CIB Buffer std::string descriptor Message from std::string descriptor CIB process std::string descriptor descriptor
Definition
CIBModuleIssues.hpp:57
Generated on
for DUNE-DAQ by
1.17.0