69 std::vector<const confmodel::DaqModule*> modules;
77 auto tch_class = tch_conf->get_template_for();
80 auto mlt_class = mlt_conf->get_template_for();
81 std::string handler_name(tch_conf->UID());
84 throw(BadConf(
ERS_HERE,
"No MLT configuration in MLTApplication given"));
93 auto destination_class = rule->get_destination_class();
94 auto data_type = rule->get_descriptor()->get_data_type();
95 if (destination_class == tch_class) {
96 tc_inputq_desc = rule->get_descriptor();
97 }
else if (destination_class == mlt_class) {
98 td_outputq_desc = rule->get_descriptor();
102 if (tc_inputq_desc ==
nullptr) {
103 throw(BadConf(
ERS_HERE,
"No TC input queue descriptor given"));
105 if (td_outputq_desc ==
nullptr) {
106 throw(BadConf(
ERS_HERE,
"No TD output-input queue descriptor given"));
121 std::string data_type = rule->get_descriptor()->get_data_type();
124 if (data_type ==
"TriggerInhibit") {
125 ti_net_desc = rule->get_descriptor();
127 if (data_type ==
"TriggerDecision") {
128 td_net_desc = rule->get_descriptor();
130 if (data_type ==
"TriggerCandidate") {
131 tc_net_desc = rule->get_descriptor();
133 if (data_type ==
"TimeSync") {
134 timesync_net_desc = rule->get_descriptor();
136 if (data_type ==
"DataRequest") {
137 req_net_desc = rule->get_descriptor();
140 TLOG_DEBUG(3) <<
"Endpoint class (currently not used in for networkconnections): data_type: " << data_type;
144 throw(BadConf(
ERS_HERE,
"No MLT network connection for the output TriggerDecision given"));
147 throw(BadConf(
ERS_HERE,
"No MLT network connection for the output TriggerInhibit given"));
150 throw(BadConf(
ERS_HERE,
"No MLT network connection for the Input of TriggerCandidates given"));
153 throw(BadConf(
ERS_HERE,
"No MLT network connection for the Input of DataRequests given"));
172 if (timesync_net_desc !=
nullptr) {
182 std::vector<conffwk::ConfigObject> generated_tc_conns;
183 generated_tc_conns.reserve(standalone_TC_maker_confs.size());
184 for (
auto gen_conf : standalone_TC_maker_confs) {
187 gen_obj.
set_obj(
"configuration", &(gen_conf->config_object()));
188 if (gen_conf->get_timestamp_method() ==
"kTimeSync" && !timesync_net_obj.
is_null()) {
189 gen_obj.
set_objs(
"inputs", { ×ync_net_obj });
193 generated_tc_conns.push_back(tc_net_gen);
195 gen_obj.
set_objs(
"outputs", { &generated_tc_conns.back() });
203 if (rdr_conf ==
nullptr) {
204 throw(BadConf(
ERS_HERE,
"No DataReaderModule configuration given"));
207 std::string reader_uid(
"data-reader-" +
UID());
208 std::string reader_class = rdr_conf->get_template_for();
209 TLOG_DEBUG(7) <<
"creating OKS configuration object for Data subscriber class " << reader_class;
211 reader_obj.
set_objs(
"inputs", { &tc_net_obj });
212 reader_obj.
set_objs(
"outputs", { &input_queue_obj });
213 reader_obj.
set_obj(
"configuration", &rdr_conf->config_object());
221 std::vector<const dunedaq::confmodel::Application*> apps =
session->get_enabled_applications();
223 std::vector<const conffwk::ConfigObject*> sourceIds;
225 for (
auto app : apps) {
227 if (ro_app !=
nullptr) {
228 auto resources = ro_app->get_contains();
230 for (
auto d2d_conn_res : resources) {
231 if (d2d_conn_res->disabled(*
session)) {
232 TLOG_DEBUG(7) <<
"Ignoring disabled Detector2DaqConnection " << d2d_conn_res->UID();
237 if (d2d_conn ==
nullptr) {
240 "MLTApplication's detectordaq connections list contains something other than DetectorToDaqConnection"));
242 if (d2d_conn->get_contains().empty()) {
243 throw(BadConf(
ERS_HERE,
"DetectorToDaqConnection does not contain interfaces"));
247 for (
auto stream : d2d_conn->get_streams()) {
248 if (stream ==
nullptr) {
249 throw(BadConf(
ERS_HERE,
"ReadoutInterface contains something other than DetectorStream"));
251 if (stream->disabled(*
session)) {
252 TLOG_DEBUG(7) <<
"Ignoring disabled DetectorStream " << stream->UID();
257 auto id = stream->get_source_id();
258 std::string sourceIdConfUID =
"dro-mlt-stream-config-" + std::to_string(
id);
260 obj_fac.
create(
"SourceIDConf", sourceIdConfUID));
261 sourceIdConf->
set_by_val<uint32_t>(
"sid", id);
263 sourceIdConf->
set_by_val<std::string>(
"subsystem",
"Detector_Readout");
264 sourceIds.push_back(sourceIdConf);
267 if (ro_app->get_tp_generation_enabled()) {
268 for (
auto sid : ro_app->get_tp_source_ids()) {
269 sourceIds.push_back(&(sid->config_object()));
280 if (tpreplay_app !=
nullptr) {
281 for (
auto sid : tpreplay_app->get_tp_source_ids()) {
282 sourceIds.push_back(&(sid->config_object()));
287 if (fd_app !=
nullptr) {
289 auto resources = fd_app->get_contains();
291 for (
auto stream_res : resources) {
293 if (stream_res->disabled(*
session)) {
294 TLOG_DEBUG(7) <<
"Ignoring disabled FakeDataProdConf " << stream_res->UID();
302 std::string sourceIdConfUID =
"dro-mlt-stream-config-" + std::to_string(
id);
304 obj_fac.
create(
"SourceIDConf", sourceIdConfUID));
305 sourceIdConf->
set_by_val<uint32_t>(
"sid", id);
307 sourceIdConf->
set_by_val<std::string>(
"subsystem",
"Detector_Readout");
308 sourceIds.push_back(sourceIdConf);
315 if (trg_app !=
nullptr && trg_app->get_source_id() !=
nullptr) {
319 trg_app->UID() +
"-" + std::to_string(trg_app->get_source_id()->get_sid())
321 tcSourceIdConf->
set_by_val<uint32_t>(
"sid", trg_app->get_source_id()->get_sid());
322 tcSourceIdConf->
set_by_val<std::string>(
"subsystem", trg_app->get_source_id()->get_subsystem());
323 sourceIds.push_back(tcSourceIdConf);
329 if (hsi_app !=
nullptr && hsi_app->get_source_id() !=
nullptr) {
333 hsi_app->UID() +
"-" + std::to_string(hsi_app->get_source_id()->get_sid())));
334 hsEventSourceIdConf->
set_by_val<uint32_t>(
"sid", hsi_app->get_source_id()->get_sid());
335 hsEventSourceIdConf->
set_by_val<std::string>(
"subsystem", hsi_app->get_source_id()->get_subsystem());
336 sourceIds.push_back(hsEventSourceIdConf);
340 if (dts_hsi_app !=
nullptr && dts_hsi_app->get_source_id() !=
nullptr) {
344 dts_hsi_app->UID() +
"-" + std::to_string(dts_hsi_app->get_source_id()->get_sid())
347 hsEventSourceIdConf->
set_by_val<uint32_t>(
"sid", dts_hsi_app->get_source_id()->get_sid());
348 hsEventSourceIdConf->
set_by_val<std::string>(
"subsystem", dts_hsi_app->get_source_id()->get_subsystem());
349 sourceIds.push_back(hsEventSourceIdConf);
354 auto sources = ctb_app->get_sources();
355 for (
const auto & s : sources ) {
357 ctb_app->UID() +
"-" + s.first ) );
358 src_id_conf_ptr->set_by_val<uint32_t>(
"sid", s.second->get_sid());
359 src_id_conf_ptr->set_by_val<std::string>(
"subsystem", s.second->get_subsystem());
360 sourceIds.push_back(src_id_conf_ptr);
367 std::vector<const conffwk::ConfigObject*> mandatory_sids;
369 if (tc_dp !=
nullptr) {
371 mandatory_sids.push_back(&m->config_object());
381 auto sessionApps =
session->get_enabled_applications();
382 std::vector<conffwk::ConfigObject> fragOutObjs;
383 for (
auto app : sessionApps) {
385 if (dfapp ==
nullptr)
389 for (
auto rule : dfNRules) {
390 auto descriptor = rule->get_descriptor();
391 auto data_type = descriptor->get_data_type();
392 if (data_type ==
"Fragment") {
393 fragOutObjs.emplace_back(obj_fac.
create_net_obj(descriptor, dfapp->UID()));
399 std::vector<const conffwk::ConfigObject*> ti_output_objs;
400 for (
auto& fNet : fragOutObjs) {
401 ti_output_objs.push_back(&fNet);
403 ti_output_objs.push_back(&output_queue_obj);
405 auto tch_conf_obj = tch_conf->config_object();
407 throw(BadConf(
ERS_HERE,
"No source_id associated with this TriggerApplication!"));
410 std::string ti_uid(handler_name +
"-" + std::to_string(source_id));
412 ti_obj.
set_by_val<uint32_t>(
"source_id", source_id);
413 ti_obj.
set_by_val<uint32_t>(
"detector_id", 1);
414 ti_obj.
set_obj(
"module_configuration", &tch_conf_obj);
415 ti_obj.
set_objs(
"enabled_source_ids", sourceIds);
416 ti_obj.
set_objs(
"mandatory_source_ids", mandatory_sids);
417 ti_obj.
set_objs(
"inputs", { &input_queue_obj, &dr_net_obj });
418 ti_obj.
set_objs(
"outputs", ti_output_objs);
429 mlt_obj.
set_obj(
"configuration", &(mlt_conf->config_object()));
430 mlt_obj.
set_objs(
"inputs", { &output_queue_obj, &ti_net_obj });
431 mlt_obj.
set_objs(
"outputs", { &td_net_obj });