55 std::vector<const confmodel::DaqModule*> modules;
57 std::map<std::string, std::vector<const appmodel::HermesDataSender*>> ctrlhost_sender_map;
63 if (helper->is_excluded(d2d_conn)) {
64 TLOG_DEBUG(7) <<
"Ignoring excluded DetectorToDaqConnection " << d2d_conn->UID();
68 TLOG_DEBUG(6) <<
"Processing DetectorToDaqConnection " << d2d_conn->UID();
71 if (d2d_conn->contained_excludable_entities().empty()) {
72 throw(BadConf(
ERS_HERE,
"DetectorToDaqConnection does not contain senders or receivers"));
75 auto det_senders = d2d_conn->senders();
76 auto det_receiver = d2d_conn->receiver();
83 fmt::format(
"WEICApplication requires NWDetDataReceiver, found {} of class {}",
85 det_receiver->class_name())));
97 for (
const auto* sender : det_senders) {
102 throw(BadConf(
ERS_HERE, fmt::format(
"DataSender {} is not a appmodel::HermesDataSender", sender->UID())));
105 ctrlhost_sender_map[hrms_sender->get_control_host()].push_back(hrms_sender);
108 for (
const auto& [ctrlhost, senders] : ctrlhost_sender_map) {
112 bool any_included =
false;
113 for (
const auto* sender : senders) {
114 if (helper->is_included(sender)) {
120 TLOG_DEBUG(6) <<
"Skipping control host " << ctrlhost <<
" whose senders are all excluded.";
127 bool enable_fembs[4] = {
false,
false,
false,
false };
129 for (
const auto* sender : senders) {
130 for (
const auto* det_stream : sender->get_streams()) {
133 uint32_t stream_id = det_stream->get_geo_id()->get_stream_id();
134 uint32_t femb_id = (stream_id & 0xf) / 2 + 2 * ((stream_id >> 6) & 0xf);
139 enable_fembs[femb_id] |= helper->is_included(det_stream);
143 std::string wib_uid = fmt::format(
"wib-ctrl-{}-{}", this->
UID(), ctrlhost);
146 fmt::format(
"{}://{}:{}",
150 for (
int i = 0; i < 4; ++i) {
151 wib_obj.
set_by_val<
bool>(fmt::format(
"enabled_femb{}", i), enable_fembs[i]);
159 std::string hermes_uid = fmt::format(
"hermes-ctrl-{}-{}", this->
UID(), ctrlhost);
163 fmt::format(
"{}://{}:{}",
168 hermes_obj.
set_obj(
"destination", &nw_receiver->get_uses()->config_object());
170 std::vector<const conffwk::ConfigObject*> links_obj;
171 for (
const auto* sndr : senders) {
174 links_obj.push_back(&sndr->config_object());
176 hermes_obj.
set_objs(
"links", links_obj);