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->enabled_applications();
223 std::vector<const conffwk::ConfigObject*> sourceIds;
225 for (
auto app : apps) {
227 if (ro_app !=
nullptr) {
228 auto connections = ro_app->get_detector_connections();
230 for (
auto d2d_conn : connections) {
231 if (d2d_conn->is_disabled(*
session)) {
232 TLOG_DEBUG(7) <<
"Ignoring disabled Detector2DaqConnection " << d2d_conn->UID();
236 if (d2d_conn->contained_resources().empty()) {
237 throw(BadConf(
ERS_HERE,
"DetectorToDaqConnection does not contain interfaces"));
241 for (
auto stream : d2d_conn->streams()) {
242 if (stream ==
nullptr) {
243 throw(BadConf(
ERS_HERE,
"ReadoutInterface contains something other than DetectorStream"));
245 if (stream->is_disabled(*
session)) {
246 TLOG_DEBUG(7) <<
"Ignoring disabled DetectorStream " << stream->UID();
251 auto id = stream->get_source_id();
252 std::string sourceIdConfUID =
"dro-mlt-stream-config-" + std::to_string(
id);
254 obj_fac.
create(
"SourceIDConf", sourceIdConfUID));
255 sourceIdConf->
set_by_val<uint32_t>(
"sid", id);
257 sourceIdConf->
set_by_val<std::string>(
"subsystem",
"Detector_Readout");
258 sourceIds.push_back(sourceIdConf);
261 if (ro_app->get_tp_generation_enabled()) {
262 for (
auto sid : ro_app->get_tp_source_ids()) {
263 sourceIds.push_back(&(sid->config_object()));
274 if (tpreplay_app !=
nullptr) {
275 for (
auto sid : tpreplay_app->get_tp_source_ids()) {
276 sourceIds.push_back(&(sid->config_object()));
281 if (fd_app !=
nullptr) {
283 auto producers = fd_app->get_producers();
285 for (
auto stream : producers) {
287 if (stream->is_disabled(*
session)) {
288 TLOG_DEBUG(7) <<
"Ignoring disabled FakeDataProdConf " << stream->UID();
293 auto id = stream->get_source_id();
294 std::string sourceIdConfUID =
"dro-mlt-stream-config-" + std::to_string(
id);
296 obj_fac.
create(
"SourceIDConf", sourceIdConfUID));
297 sourceIdConf->
set_by_val<uint32_t>(
"sid", id);
299 sourceIdConf->
set_by_val<std::string>(
"subsystem",
"Detector_Readout");
300 sourceIds.push_back(sourceIdConf);
307 if (trg_app !=
nullptr && trg_app->get_source_id() !=
nullptr) {
311 trg_app->UID() +
"-" + std::to_string(trg_app->get_source_id()->get_sid())
313 tcSourceIdConf->
set_by_val<uint32_t>(
"sid", trg_app->get_source_id()->get_sid());
314 tcSourceIdConf->
set_by_val<std::string>(
"subsystem", trg_app->get_source_id()->get_subsystem());
315 sourceIds.push_back(tcSourceIdConf);
321 if (hsi_app !=
nullptr && hsi_app->get_source_id() !=
nullptr) {
325 hsi_app->UID() +
"-" + std::to_string(hsi_app->get_source_id()->get_sid())));
326 hsEventSourceIdConf->
set_by_val<uint32_t>(
"sid", hsi_app->get_source_id()->get_sid());
327 hsEventSourceIdConf->
set_by_val<std::string>(
"subsystem", hsi_app->get_source_id()->get_subsystem());
328 sourceIds.push_back(hsEventSourceIdConf);
332 if (dts_hsi_app !=
nullptr && dts_hsi_app->get_source_id() !=
nullptr) {
336 dts_hsi_app->UID() +
"-" + std::to_string(dts_hsi_app->get_source_id()->get_sid())
339 hsEventSourceIdConf->
set_by_val<uint32_t>(
"sid", dts_hsi_app->get_source_id()->get_sid());
340 hsEventSourceIdConf->
set_by_val<std::string>(
"subsystem", dts_hsi_app->get_source_id()->get_subsystem());
341 sourceIds.push_back(hsEventSourceIdConf);
346 auto sources = ctb_app->get_sources();
347 for (
const auto & s : sources ) {
349 ctb_app->UID() +
"-" + s.first ) );
350 src_id_conf_ptr->set_by_val<uint32_t>(
"sid", s.second->get_sid());
351 src_id_conf_ptr->set_by_val<std::string>(
"subsystem", s.second->get_subsystem());
352 sourceIds.push_back(src_id_conf_ptr);
359 std::vector<const conffwk::ConfigObject*> mandatory_sids;
361 if (tc_dp !=
nullptr) {
363 mandatory_sids.push_back(&m->config_object());
373 auto sessionApps =
session->enabled_applications();
374 std::vector<conffwk::ConfigObject> fragOutObjs;
375 for (
auto app : sessionApps) {
377 if (dfapp ==
nullptr)
381 for (
auto rule : dfNRules) {
382 auto descriptor = rule->get_descriptor();
383 auto data_type = descriptor->get_data_type();
384 if (data_type ==
"Fragment") {
385 fragOutObjs.emplace_back(obj_fac.
create_net_obj(descriptor, dfapp->UID()));
391 std::vector<const conffwk::ConfigObject*> ti_output_objs;
392 for (
auto& fNet : fragOutObjs) {
393 ti_output_objs.push_back(&fNet);
395 ti_output_objs.push_back(&output_queue_obj);
397 auto tch_conf_obj = tch_conf->config_object();
399 throw(BadConf(
ERS_HERE,
"No source_id associated with this TriggerApplication!"));
402 std::string ti_uid(handler_name +
"-" + std::to_string(source_id));
404 ti_obj.
set_by_val<uint32_t>(
"source_id", source_id);
405 ti_obj.
set_by_val<uint32_t>(
"detector_id", 1);
406 ti_obj.
set_obj(
"module_configuration", &tch_conf_obj);
407 ti_obj.
set_objs(
"enabled_source_ids", sourceIds);
408 ti_obj.
set_objs(
"mandatory_source_ids", mandatory_sids);
409 ti_obj.
set_objs(
"inputs", { &input_queue_obj, &dr_net_obj });
410 ti_obj.
set_objs(
"outputs", ti_output_objs);
421 mlt_obj.
set_obj(
"configuration", &(mlt_conf->config_object()));
422 mlt_obj.
set_objs(
"inputs", { &output_queue_obj, &ti_net_obj });
423 mlt_obj.
set_objs(
"outputs", { &td_net_obj });