56 std::vector<const confmodel::DaqModule*> modules;
64 auto tch_class = tch_conf->get_template_for();
67 auto mlt_class = mlt_conf->get_template_for();
68 std::string handler_name(tch_conf->UID());
71 throw(BadConf(
ERS_HERE,
"No MLT configuration in MLTApplication given"));
80 auto destination_class = rule->get_destination_class();
81 auto data_type = rule->get_descriptor()->get_data_type();
82 if (destination_class == tch_class) {
83 tc_inputq_desc = rule->get_descriptor();
84 }
else if (destination_class == mlt_class) {
85 td_outputq_desc = rule->get_descriptor();
89 if (tc_inputq_desc ==
nullptr) {
90 throw(BadConf(
ERS_HERE,
"No TC input queue descriptor given"));
92 if (td_outputq_desc ==
nullptr) {
93 throw(BadConf(
ERS_HERE,
"No TD output-input queue descriptor given"));
108 std::string data_type = rule->get_descriptor()->get_data_type();
111 if (data_type ==
"TriggerInhibit") {
112 ti_net_desc = rule->get_descriptor();
114 if (data_type ==
"TriggerDecision") {
115 td_net_desc = rule->get_descriptor();
117 if (data_type ==
"TriggerCandidate") {
118 tc_net_desc = rule->get_descriptor();
120 if (data_type ==
"TimeSync") {
121 timesync_net_desc = rule->get_descriptor();
123 if (data_type ==
"DataRequest") {
124 req_net_desc = rule->get_descriptor();
127 TLOG_DEBUG(3) <<
"Endpoint class (currently not used in for networkconnections): data_type: " << data_type;
131 throw(BadConf(
ERS_HERE,
"No MLT network connection for the output TriggerDecision given"));
134 throw(BadConf(
ERS_HERE,
"No MLT network connection for the output TriggerInhibit given"));
137 throw(BadConf(
ERS_HERE,
"No MLT network connection for the Input of TriggerCandidates given"));
140 throw(BadConf(
ERS_HERE,
"No MLT network connection for the Input of DataRequests given"));
159 if (timesync_net_desc !=
nullptr) {
169 std::vector<conffwk::ConfigObject> generated_tc_conns;
170 generated_tc_conns.reserve(standalone_TC_maker_confs.size());
171 for (
auto gen_conf : standalone_TC_maker_confs) {
174 gen_obj.
set_obj(
"configuration", &(gen_conf->config_object()));
175 if (gen_conf->get_timestamp_method() ==
"kTimeSync" && !timesync_net_obj.
is_null()) {
176 gen_obj.
set_objs(
"inputs", { ×ync_net_obj });
180 generated_tc_conns.push_back(tc_net_gen);
182 gen_obj.
set_objs(
"outputs", { &generated_tc_conns.back() });
190 if (rdr_conf ==
nullptr) {
191 throw(BadConf(
ERS_HERE,
"No DataReaderModule configuration given"));
194 std::string reader_uid(
"data-reader-" +
UID());
195 std::string reader_class = rdr_conf->get_template_for();
196 TLOG_DEBUG(7) <<
"creating OKS configuration object for Data subscriber class " << reader_class;
198 reader_obj.
set_objs(
"inputs", { &tc_net_obj });
199 reader_obj.
set_objs(
"outputs", { &input_queue_obj });
200 reader_obj.
set_obj(
"configuration", &rdr_conf->config_object());
208 std::vector<const conffwk::ConfigObject*> sourceIds;
209 for (
auto [uid, source_ids]: helper->get_stream_source_ids()) {
210 for (
auto src_id: source_ids) {
212 std::string sourceIdConfUID =
"dro-mlt-stream-config-" +
213 std::to_string(src_id);
215 obj_fac.
create(
"SourceIDConf", sourceIdConfUID));
216 sourceIdConf->
set_by_val<uint32_t>(
"sid", src_id);
218 sourceIdConf->
set_by_val<std::string>(
"subsystem",
"Detector_Readout");
219 sourceIds.push_back(sourceIdConf);
222 for (
auto [uid, source_ids]: helper->get_tp_source_ids()) {
223 for (
auto src_id: source_ids) {
224 sourceIds.push_back(&(src_id->config_object()));
229 for (
const auto & [uid, sources]: helper->get_all_app_source_ids(
"CTBApplication")) {
230 for (
const auto & [source_name, source_conf] : sources ) {
231 auto final_name = uid;
232 final_name += source_name.find(
"LLT")!=std::string::npos ?
"_LLT" :
"_HLT";
234 obj_fac.
create(
"SourceIDConf", final_name));
235 tcSourceIdConf->set_by_val<uint32_t>(
"sid", source_conf->get_sid());
236 tcSourceIdConf->set_by_val<std::string>(
"subsystem", source_conf->get_subsystem());
237 sourceIds.push_back(tcSourceIdConf);
241 for (
auto app_class: {
"TriggerApplication",
"FakeHSIApplication",
242 "DTSHSIApplication",
"CIBApplication"}) {
243 for (
auto [uid, src_id]: helper->get_app_source_ids(app_class)) {
245 obj_fac.
create(
"SourceIDConf",
246 uid +
"-" + std::to_string(src_id->get_sid())
248 tcSourceIdConf->set_by_val<uint32_t>(
"sid", src_id->get_sid());
249 tcSourceIdConf->set_by_val<std::string>(
"subsystem", src_id->get_subsystem());
250 sourceIds.push_back(tcSourceIdConf);
256 std::vector<const conffwk::ConfigObject*> mandatory_sids;
258 if (tc_dp !=
nullptr) {
260 mandatory_sids.push_back(&m->config_object());
297 std::vector<conffwk::ConfigObject> fragOutObjs;
298 for (
auto [uid, descriptor]:
299 helper->get_netdescriptors(
"Fragment",
"DFApplication")) {
300 fragOutObjs.emplace_back(obj_fac.
create_net_obj(descriptor, uid));
304 std::vector<const conffwk::ConfigObject*> ti_output_objs;
305 for (
auto& fNet : fragOutObjs) {
306 ti_output_objs.push_back(&fNet);
308 ti_output_objs.push_back(&output_queue_obj);
312 throw(BadConf(
ERS_HERE,
"No source_id associated with this TriggerApplication!"));
315 std::string ti_uid(handler_name +
"-" + std::to_string(source_id));
317 ti_obj.
set_by_val<uint32_t>(
"source_id", source_id);
318 ti_obj.
set_by_val<uint32_t>(
"detector_id", 1);
319 ti_obj.
set_obj(
"module_configuration", &tch_conf_obj);
320 ti_obj.
set_objs(
"enabled_source_ids", sourceIds);
321 ti_obj.
set_objs(
"mandatory_source_ids", mandatory_sids);
322 ti_obj.
set_objs(
"inputs", { &input_queue_obj, &dr_net_obj });
323 ti_obj.
set_objs(
"outputs", ti_output_objs);
334 mlt_obj.
set_obj(
"configuration", &(mlt_conf->config_object()));
335 mlt_obj.
set_objs(
"inputs", { &output_queue_obj, &ti_net_obj });
336 mlt_obj.
set_objs(
"outputs", { &td_net_obj });