57 std::vector<const confmodel::DaqModule*> modules;
59 std::map<std::string, std::vector<const appmodel::HermesDataSender*>> ctrlhost_sender_map;
66 if (helper->is_disabled(d2d_conn)) {
67 TLOG_DEBUG(7) <<
"Ignoring disabled DetectorToDaqConnection " << d2d_conn->UID();
71 TLOG_DEBUG(6) <<
"Processing DetectorToDaqConnection " << d2d_conn->UID();
74 if (d2d_conn->contained_resources().empty()) {
75 throw(BadConf(
ERS_HERE,
"DetectorToDaqConnection does not contain senders or receivers"));
78 auto det_senders = d2d_conn->senders();
79 auto det_receiver = d2d_conn->receiver();
85 throw(BadConf(
ERS_HERE, fmt::format(
"WEICApplication requires NWDetDataReceiver, found {} of class {}", det_receiver->UID(), det_receiver->class_name())));
89 for (
const auto* sender : det_senders) {
91 if (helper->is_disabled(sender)) {
92 TLOG() <<
"Skipping disabled sender: " << sender->UID();
99 throw(BadConf(
ERS_HERE, fmt::format(
"DataSender {} is not a appmodel::HermesDataSender", sender->UID())));
102 ctrlhost_sender_map[hrms_sender->get_control_host()].push_back(hrms_sender);
106 for(
const auto& [ctrlhost, senders] : ctrlhost_sender_map ) {
111 bool enable_fembs[4] = {
false,
false,
false,
false};
113 for (
const auto* sender : senders ){
114 for (
const auto* det_stream : sender->get_streams() ) {
117 uint32_t stream_id = det_stream->get_geo_id()->get_stream_id();
118 uint32_t femb_id = (stream_id & 0xf) / 2 + 2*((stream_id >> 6) & 0xf);
124 enable_fembs[femb_id] |= helper->is_enabled(det_stream);
127 std::string wib_uid = fmt::format(
"wib-ctrl-{}-{}", this->
UID(), ctrlhost);
130 wib_obj.
set_by_val<
bool>(
"enabled_femb0", enable_fembs[0]);
131 wib_obj.
set_by_val<
bool>(
"enabled_femb1", enable_fembs[1]);
132 wib_obj.
set_by_val<
bool>(
"enabled_femb2", enable_fembs[2]);
133 wib_obj.
set_by_val<
bool>(
"enabled_femb3", enable_fembs[3]);
140 std::string hermes_uid = fmt::format(
"hermes-ctrl-{}-{}", this->
UID(), ctrlhost);
145 hermes_obj.
set_obj(
"destination", &nw_receiver->get_uses()->config_object());
147 std::vector< const conffwk::ConfigObject * > links_obj;
148 for (
const auto* sndr : senders ){
149 links_obj.push_back(&sndr->config_object());
151 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).