Skip to content

Commit

Permalink
Merge pull request #159 from DUNE-DAQ/asztuc/triggerapp_disable_postp…
Browse files Browse the repository at this point in the history
…rocessing

Disable postprocessing option in TriggerAplication
  • Loading branch information
ArturSztuc authored Dec 4, 2024
2 parents 4c38cf7 + cb53d27 commit b6739be
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
1 change: 1 addition & 0 deletions schema/appmodel/trigger.schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@
<superclass name="ResourceSetAND"/>
<superclass name="SmartDaqApplication"/>
<attribute name="application_name" type="string" init-value="daq_application" is-not-null="yes"/>
<attribute name="tx_generation_disabled" description="Disable TA/TC generation as a post-processing task -- only to be done by the experts for e.g. TP performance studies" type="bool" init-value="false"/>
<relationship name="data_subscriber" class-type="DataReaderConf" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
<relationship name="trigger_inputs_handler" class-type="DataHandlerConf" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
<method name="generate_modules" description="Generate daq module dal objects for streams of thie TriggerApplication on the fly">
Expand Down
42 changes: 13 additions & 29 deletions src/TriggerApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ TriggerApplication::generate_modules(conffwk::Configuration* confdb,
rule->get_descriptor()->get_data_type() == "TriggerCandidate") {
// For TA->TC
tout_net_desc = rule->get_descriptor();
handler_name = "tahandler";
handler_name = "tahandler";
}
else if (tin_net_desc->get_data_type() == "TriggerCandidate" &&
rule->get_descriptor()->get_data_type() == "TriggerActivity") {
// For TA->TC if we saved TC network connection as input first...
tout_net_desc = tin_net_desc;
tin_net_desc = rule->get_descriptor();
handler_name = "tahandler";
handler_name = "tahandler";
}
else {
throw (BadConf(ERS_HERE, "Unexpected input & output network connection descriptors provided"));
Expand All @@ -156,7 +156,6 @@ TriggerApplication::generate_modules(conffwk::Configuration* confdb,
conffwk::ConfigObject tin_net_obj;
conffwk::ConfigObject tout_net_obj;
conffwk::ConfigObject tset_out_net_obj;
//auto handlerConf = get_trigger_inputs_handler();

if ( req_net_desc== nullptr) {
throw (BadConf(ERS_HERE, "No network descriptor given to receive request and send data was set"));
Expand All @@ -177,36 +176,19 @@ TriggerApplication::generate_modules(conffwk::Configuration* confdb,
input_queue_obj.set_by_val<std::string>("queue_type", ti_inputq_desc->get_queue_type());
input_queue_obj.set_by_val<uint32_t>("capacity", ti_inputq_desc->get_capacity());

auto req_service_obj = req_net_desc->get_associated_service()->config_object();
std::string req_net_uid(req_net_desc->get_uid_base()+UID());;
confdb->create(dbfile, "NetworkConnection", req_net_uid, req_net_obj);
req_net_obj.set_by_val<std::string>("connection_type", req_net_desc->get_connection_type());
req_net_obj.set_by_val<std::string>("data_type", req_net_desc->get_data_type());
req_net_obj.set_obj("associated_service", &req_service_obj);

auto tin_service_obj = tin_net_desc->get_associated_service()->config_object();
std::string t_in_stream_uid(tin_net_desc->get_uid_base()+".*");
confdb->create(dbfile, "NetworkConnection", t_in_stream_uid, tin_net_obj);
tin_net_obj.set_by_val<std::string>("data_type", tin_net_desc->get_data_type());
tin_net_obj.set_by_val<std::string>("connection_type", tin_net_desc->get_connection_type());
tin_net_obj.set_obj("associated_service", &tin_service_obj);

auto tout_service_obj = tout_net_desc->get_associated_service()->config_object();
std::string t_stream_uid(tout_net_desc->get_uid_base()+UID());
confdb->create(dbfile, "NetworkConnection", t_stream_uid, tout_net_obj);
tout_net_obj.set_by_val<std::string>("data_type", tout_net_desc->get_data_type());
tout_net_obj.set_by_val<std::string>("connection_type", tout_net_desc->get_connection_type());
tout_net_obj.set_obj("associated_service", &tout_service_obj);

req_net_obj = create_network_connection(req_net_desc->get_uid_base()+UID(),
req_net_desc, confdb, dbfile);

tin_net_obj = create_network_connection(tin_net_desc->get_uid_base()+".*",
tin_net_desc, confdb, dbfile);

tout_net_obj = create_network_connection(tout_net_desc->get_uid_base()+UID(),
tout_net_desc, confdb, dbfile);

if (tset_out_net_desc) {
auto tset_out_service_obj = tset_out_net_desc->get_associated_service()->config_object();
std::string tset_stream_uid(tset_out_net_desc->get_uid_base()+UID());
confdb->create(dbfile, "NetworkConnection", tset_stream_uid, tset_out_net_obj);
tset_out_net_obj.set_by_val<std::string>("data_type", tset_out_net_desc->get_data_type());
tset_out_net_obj.set_by_val<std::string>("connection_type", tset_out_net_desc->get_connection_type());
tset_out_net_obj.set_obj("associated_service", &tset_out_service_obj);
tset_out_net_obj = create_network_connection(tset_out_net_desc->get_uid_base()+UID(),
tset_out_net_desc, confdb, dbfile);
}

auto ti_conf_obj = ti_conf->config_object();
Expand All @@ -219,6 +201,8 @@ TriggerApplication::generate_modules(conffwk::Configuration* confdb,
confdb->create(dbfile, ti_class, ti_uid, ti_obj);
ti_obj.set_by_val<uint32_t>("source_id", source_id);
ti_obj.set_by_val<uint32_t>("detector_id", 1); // 1 == kDAQ
ti_obj.set_by_val<bool>("post_processing_enabled", !get_tx_generation_disabled());

ti_obj.set_obj("module_configuration", &ti_conf_obj);
ti_obj.set_objs("inputs", {&input_queue_obj, &req_net_obj});
if (tset_out_net_desc!= nullptr) {
Expand Down

0 comments on commit b6739be

Please sign in to comment.