54 std::vector<const confmodel::DaqModule*> modules;
62 auto tch_class = tch_conf->get_template_for();
65 auto mlt_class = mlt_conf->get_template_for();
66 std::string handler_name(tch_conf->UID());
69 throw(BadConf(
ERS_HERE,
"No MLT configuration in MLTApplication given"));
78 auto destination_class = rule->get_destination_class();
79 auto data_type = rule->get_descriptor()->get_data_type();
80 if (destination_class == tch_class) {
81 tc_inputq_desc = rule->get_descriptor();
82 }
else if (destination_class == mlt_class) {
83 td_outputq_desc = rule->get_descriptor();
87 if (tc_inputq_desc ==
nullptr) {
88 throw(BadConf(
ERS_HERE,
"No TC input queue descriptor given"));
90 if (td_outputq_desc ==
nullptr) {
91 throw(BadConf(
ERS_HERE,
"No TD output-input queue descriptor given"));
106 std::string data_type = rule->get_descriptor()->get_data_type();
109 if (data_type ==
"TriggerInhibit") {
110 ti_net_desc = rule->get_descriptor();
112 if (data_type ==
"TriggerDecision") {
113 td_net_desc = rule->get_descriptor();
115 if (data_type ==
"TriggerCandidate") {
116 tc_net_desc = rule->get_descriptor();
118 if (data_type ==
"TimeSync") {
119 timesync_net_desc = rule->get_descriptor();
121 if (data_type ==
"DataRequest") {
122 req_net_desc = rule->get_descriptor();
125 TLOG_DEBUG(3) <<
"Endpoint class (currently not used in for networkconnections): data_type: " << data_type;
129 throw(BadConf(
ERS_HERE,
"No MLT network connection for the output TriggerDecision given"));
132 throw(BadConf(
ERS_HERE,
"No MLT network connection for the output TriggerInhibit given"));
135 throw(BadConf(
ERS_HERE,
"No MLT network connection for the Input of TriggerCandidates given"));
138 throw(BadConf(
ERS_HERE,
"No MLT network connection for the Input of DataRequests given"));
153 if (timesync_net_desc !=
nullptr) {
154 timesync_net_obj = obj_fac.
create_net_obj(timesync_net_desc,
".*");
162 std::vector<conffwk::ConfigObject> generated_tc_conns;
163 generated_tc_conns.reserve(standalone_TC_maker_confs.size());
164 for (
auto gen_conf : standalone_TC_maker_confs) {
166 gen_obj.
set_obj(
"configuration", &(gen_conf->config_object()));
167 if (gen_conf->get_timestamp_method() ==
"kTimeSync" && !timesync_net_obj.
is_null()) {
168 gen_obj.
set_objs(
"inputs", { ×ync_net_obj });
172 generated_tc_conns.push_back(tc_net_gen);
174 gen_obj.
set_objs(
"outputs", { &generated_tc_conns.back() });
182 if (rdr_conf ==
nullptr) {
183 throw(BadConf(
ERS_HERE,
"No DataReaderModule configuration given"));
186 std::string reader_uid(
"data-reader-" +
UID());
187 std::string reader_class = rdr_conf->get_template_for();
188 TLOG_DEBUG(7) <<
"creating OKS configuration object for Data subscriber class " << reader_class;
190 reader_obj.
set_objs(
"inputs", { &tc_net_obj });
191 reader_obj.
set_objs(
"outputs", { &input_queue_obj });
192 reader_obj.
set_obj(
"configuration", &rdr_conf->config_object());
200 std::vector<const conffwk::ConfigObject*> sourceIds;
201 for (
auto [uid, source_ids] : helper->get_stream_source_ids()) {
202 for (
auto src_id : source_ids) {
204 std::string sourceIdConfUID =
"dro-mlt-stream-config-" + std::to_string(src_id);
206 sourceIdConf->
set_by_val<uint32_t>(
"sid", src_id);
208 sourceIdConf->
set_by_val<std::string>(
"subsystem",
"Detector_Readout");
209 sourceIds.push_back(sourceIdConf);
212 for (
auto [uid, source_ids] : helper->get_tp_source_ids()) {
213 for (
auto src_id : source_ids) {
214 sourceIds.push_back(&(src_id->config_object()));
219 for (
const auto& [uid, sources] : helper->get_all_app_source_ids(
"CTBApplication")) {
220 for (
const auto& [source_name, source_conf] : sources) {
221 auto final_name = uid;
222 final_name += source_name.find(
"LLT") != std::string::npos ?
"_LLT" :
"_HLT";
224 tcSourceIdConf->set_by_val<uint32_t>(
"sid", source_conf->get_sid());
225 tcSourceIdConf->set_by_val<std::string>(
"subsystem", source_conf->get_subsystem());
226 sourceIds.push_back(tcSourceIdConf);
230 for (
auto app_class : {
"TriggerApplication",
"FakeHSIApplication",
"DTSHSIApplication",
"CIBApplication" }) {
231 for (
auto [uid, src_id] : helper->get_app_source_ids(app_class)) {
232 auto tcSourceIdConf =
234 tcSourceIdConf->set_by_val<uint32_t>(
"sid", src_id->get_sid());
235 tcSourceIdConf->set_by_val<std::string>(
"subsystem", src_id->get_subsystem());
236 sourceIds.push_back(tcSourceIdConf);
241 std::vector<const conffwk::ConfigObject*> mandatory_sids;
243 if (tc_dp !=
nullptr) {
245 mandatory_sids.push_back(&m->config_object());
282 std::vector<conffwk::ConfigObject> fragOutObjs;
283 for (
auto [uid,
descriptor] : helper->get_netdescriptors(
"Fragment",
"DFApplication")) {
288 std::vector<const conffwk::ConfigObject*> ti_output_objs;
289 for (
auto& fNet : fragOutObjs) {
290 ti_output_objs.push_back(&fNet);
292 ti_output_objs.push_back(&output_queue_obj);
296 throw(BadConf(
ERS_HERE,
"No source_id associated with this TriggerApplication!"));
299 std::string ti_uid(handler_name +
"-" + std::to_string(source_id));
301 ti_obj.
set_by_val<uint32_t>(
"source_id", source_id);
302 ti_obj.
set_by_val<uint32_t>(
"detector_id", 1);
303 ti_obj.
set_obj(
"module_configuration", &tch_conf_obj);
304 ti_obj.
set_objs(
"enabled_source_ids", sourceIds);
305 ti_obj.
set_objs(
"mandatory_source_ids", mandatory_sids);
306 ti_obj.
set_objs(
"inputs", { &input_queue_obj, &dr_net_obj });
307 ti_obj.
set_objs(
"outputs", ti_output_objs);
317 mlt_obj.
set_obj(
"configuration", &(mlt_conf->config_object()));
318 mlt_obj.
set_objs(
"inputs", { &output_queue_obj, &ti_net_obj });
319 mlt_obj.
set_objs(
"outputs", { &td_net_obj });