75 std::vector<const confmodel::DaqModule*> modules;
80 auto ti_class = ti_conf->get_template_for();
81 std::string handler_name(
"");
86 auto destination_class = rule->get_destination_class();
87 auto data_type = rule->get_descriptor()->get_data_type();
88 if (destination_class ==
"DataHandlerModule" || destination_class == ti_class) {
89 ti_inputq_desc = rule->get_descriptor();
98 auto endpoint_class = rule->get_endpoint_class();
99 auto data_type = rule->get_descriptor()->get_data_type();
101 if (data_type ==
"DataRequest") {
102 req_net_desc = rule->get_descriptor();
103 }
else if (data_type ==
"TASet" || data_type ==
"TCSet") {
104 tset_out_net_desc = rule->get_descriptor();
105 }
else if (endpoint_class ==
"DataSubscriberModule") {
107 tin_net_desc = rule->get_descriptor();
108 }
else if (rule->get_descriptor()->get_data_type() == tin_net_desc->
get_data_type()) {
111 throw(BadConf(
ERS_HERE,
"Have two network connections of the same data_type and the same endpoint_class"));
112 }
else if (tin_net_desc->
get_data_type() ==
"TriggerActivity" &&
113 rule->get_descriptor()->get_data_type() ==
"TriggerCandidate") {
115 tout_net_desc = rule->get_descriptor();
116 handler_name =
"tahandler";
117 }
else if (tin_net_desc->
get_data_type() ==
"TriggerCandidate" &&
118 rule->get_descriptor()->get_data_type() ==
"TriggerActivity") {
120 tout_net_desc = tin_net_desc;
121 tin_net_desc = rule->get_descriptor();
122 handler_name =
"tahandler";
124 throw(BadConf(
ERS_HERE,
"Unexpected input & output network connection descriptors provided"));
126 }
else if (data_type ==
"TriggerActivity" || data_type ==
"TriggerCandidate") {
127 tout_net_desc = rule->get_descriptor();
128 if (data_type ==
"TriggerActivity")
129 handler_name =
"tphandler";
131 handler_name =
"tahandler";
136 std::vector<conffwk::ConfigObject> fragOutObjs;
137 for (
auto [uid,
descriptor] : helper->get_netdescriptors(
"Fragment",
"DFApplication")) {
140 if (req_net_desc ==
nullptr) {
141 throw(BadConf(
ERS_HERE,
"No network descriptor given to receive request and send data was set"));
143 if (tin_net_desc ==
nullptr) {
144 throw(BadConf(
ERS_HERE,
"No network descriptor given to receive trigger objects"));
146 if (tout_net_desc ==
nullptr) {
147 throw(BadConf(
ERS_HERE,
"No network descriptor given to publish trigger objects"));
149 if (ti_inputq_desc ==
nullptr) {
150 throw(BadConf(
ERS_HERE,
"No data input queue descriptor given"));
161 if (tset_out_net_desc) {
166 std::vector<const conffwk::ConfigObject*> ti_output_objs;
167 for (
auto& fNet : fragOutObjs) {
168 ti_output_objs.push_back(&fNet);
170 ti_output_objs.push_back(&tout_net_obj);
171 if (tset_out_net_desc !=
nullptr) {
172 ti_output_objs.push_back(&tset_out_net_obj);
176 throw(BadConf(
ERS_HERE,
"No source_id associated with this TriggerApplication!"));
179 std::string ti_uid(handler_name +
"-" + std::to_string(source_id));
180 auto ti_obj = obj_fac.
create(ti_class, ti_uid);
182 ti_obj.
set_by_val<uint32_t>(
"source_id", source_id);
183 ti_obj.set_by_val<uint32_t>(
"detector_id", 1);
186 auto ti_conf_obj = ti_conf->config_object();
187 ti_obj.set_obj(
"module_configuration", &ti_conf_obj);
188 ti_obj.set_objs(
"inputs", { &input_queue_obj, &req_net_obj });
189 ti_obj.set_objs(
"outputs", ti_output_objs);
195 if (rdr_conf ==
nullptr) {
196 throw(BadConf(
ERS_HERE,
"No DataReaderModule configuration given"));
201 std::string reader_uid(
"data-reader-" +
UID());
202 std::string reader_class = rdr_conf->get_template_for();
203 TLOG_DEBUG(7) <<
"creating OKS configuration object for Data subscriber class " << reader_class;
204 auto reader_obj = obj_fac.
create(reader_class, reader_uid);
205 reader_obj.
set_objs(
"inputs", { &tin_net_obj });
206 reader_obj.set_objs(
"outputs", { &input_queue_obj });
207 reader_obj.set_obj(
"configuration", &rdr_conf->config_object());
conffwk::ConfigObject create_network_connection(std::string uid, const NetworkConnectionDescriptor *ntDesc, conffwk::Configuration *confdb, const std::string &dbfile)
Helper function that gets a network connection config.