58 std::vector<const confmodel::DaqModule*> modules;
60 std::map<std::string, std::vector<const appmodel::HermesDataSender*>> ctrlhost_sender_map;
67 if (d2d_conn->is_disabled(*
session)) {
68 TLOG_DEBUG(7) <<
"Ignoring disabled DetectorToDaqConnection " << d2d_conn->UID();
72 TLOG_DEBUG(6) <<
"Processing DetectorToDaqConnection " << d2d_conn->UID();
75 if (d2d_conn->contained_resources().empty()) {
76 throw(BadConf(
ERS_HERE,
"DetectorToDaqConnection does not contain senders or receivers"));
79 auto det_senders = d2d_conn->senders();
80 auto det_receiver = d2d_conn->receiver();
86 throw(BadConf(
ERS_HERE, fmt::format(
"WEICApplication requires NWDetDataReceiver, found {} of class {}", det_receiver->UID(), det_receiver->class_name())));
90 for (
const auto* sender : det_senders) {
92 if ( sender->is_disabled(*
session) ) {
93 TLOG() <<
"Skipping disabled sender: " << sender->UID();
100 throw(BadConf(
ERS_HERE, fmt::format(
"DataSender {} is not a appmodel::HermesDataSender", sender->UID())));
103 ctrlhost_sender_map[hrms_sender->get_control_host()].push_back(hrms_sender);
107 for(
const auto& [ctrlhost, senders] : ctrlhost_sender_map ) {
112 bool enable_fembs[4] = {
false,
false,
false,
false};
114 for (
const auto* sender : senders ){
115 for (
const auto* det_stream : sender->get_streams() ) {
118 uint32_t stream_id = det_stream->get_geo_id()->get_stream_id();
119 uint32_t femb_id = (stream_id & 0xf) / 2 + 2*((stream_id >> 6) & 0xf);
125 enable_fembs[femb_id] |= !det_stream->is_disabled(*
session);
128 std::string wib_uid = fmt::format(
"wib-ctrl-{}-{}", this->
UID(), ctrlhost);
131 wib_obj.
set_by_val<
bool>(
"enabled_femb0", enable_fembs[0]);
132 wib_obj.
set_by_val<
bool>(
"enabled_femb1", enable_fembs[1]);
133 wib_obj.
set_by_val<
bool>(
"enabled_femb2", enable_fembs[2]);
134 wib_obj.
set_by_val<
bool>(
"enabled_femb3", enable_fembs[3]);
141 std::string hermes_uid = fmt::format(
"hermes-ctrl-{}-{}", this->
UID(), ctrlhost);
146 hermes_obj.
set_obj(
"destination", &nw_receiver->get_uses()->config_object());
148 std::vector< const conffwk::ConfigObject * > links_obj;
149 for (
const auto* sndr : senders ){
150 links_obj.push_back(&sndr->config_object());
152 hermes_obj.
set_objs(
"links", links_obj);
void get(const std::string &class_name, const std::string &id, ConfigObject &object, unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
Get object by class name and object id (multi-thread safe).