Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.12)
project(appmodel VERSION 3.5.0)
project(appmodel VERSION 3.6.0)

find_package(daq-cmake REQUIRED)

Expand Down
13 changes: 11 additions & 2 deletions schema/appmodel/trigger.schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@
<relationship name="configuration" class-type="MLTConf" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
</class>

<class name="PDSRawDataProcessor" description="A class which contains info about PDS. For example here you can add threshold for specific channels.">
<superclass name="RawDataProcessor"/>
<attribute name="default_adc_intg_thresh" type="u32" init-value="0" is-not-null="yes"/>
</class>

<class name="ProcessingStep" description="Base class for TPG processors.">
<superclass name="Jsonable"/>
</class>
Expand All @@ -194,6 +199,12 @@
<relationship name="tc_readout" description="Configuration for the TC output type and the TC window size" class-type="TCReadoutMap" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
</class>

<class name="TPCRawDataProcessor">
<superclass name="RawDataProcessor"/>
<relationship name="processing_steps" class-type="ProcessingStep" low-cc="one" high-cc="many" is-composite="no" is-exclusive="no" is-dependent="no"/>
<relationship name="sot_minima" description="TP samples over threshold minimum requirement by plane." class-type="SamplesOverThresholdMinima" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
</class>

<class name="RandomTCMakerModule">
<superclass name="StandaloneTCMakerModule"/>
<relationship name="configuration" class-type="RandomTCMakerConf" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
Expand All @@ -203,8 +214,6 @@
<superclass name="DataProcessor"/>
<attribute name="channel_mask" description="List of channels to be masked from TP generation" type="u32" is-multi-value="yes"/>
<attribute name="channel_map" type="string"/>
<relationship name="processing_steps" class-type="ProcessingStep" low-cc="one" high-cc="many" is-composite="no" is-exclusive="no" is-dependent="no"/>
<relationship name="sot_minima" description="TP samples over threshold minimum requirement by plane." class-type="SamplesOverThresholdMinima" low-cc="one" high-cc="one" is-composite="no" is-exclusive="no" is-dependent="no"/>
</class>

<class name="StandaloneTCMakerConf" is-abstract="yes">
Expand Down
25 changes: 16 additions & 9 deletions src/NP02ReadoutApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ NP02ReadoutApplication::generate_modules(const confmodel::Session* session) cons
// keep a map for convenience

// Create data queues
for (auto& [numa, ds] : all_enabled_det_streams) {
for (auto& [numa, ds] : all_enabled_det_streams) {
conffwk::ConfigObject queue_obj = obj_fac.create_queue_sid_obj(dlh_input_qdesc, ds);
const auto* data_queue = obj_fac.get_dal<confmodel::Connection>(queue_obj.UID());
data_queue_objs.push_back(&data_queue->config_object());
Expand All @@ -288,13 +288,18 @@ NP02ReadoutApplication::generate_modules(const confmodel::Session* session) cons
//
// Prepare the tp handlers and related queues
//
std::vector<const confmodel::Connection*> tp_queues;
std::vector<std::pair<uint32_t, const confmodel::Connection*>> tp_queues;

if (get_tp_generation_enabled()) {

// Create TP handler object
auto tph_conf_obj = tph_conf->config_object();
auto tpsrc_ids = get_tp_source_ids();

if ((tpsrc_ids.size() % 3) > 0) {
throw(BadConf(ERS_HERE, fmt::format("number of TP source IDs must be a multiple of 3, current amount: {}", tpsrc_ids.size())));
}

for (auto sid : tpsrc_ids) {
conffwk::ConfigObject tp_queue_obj;
conffwk::ConfigObject tpreq_queue_obj;
Expand All @@ -310,7 +315,7 @@ NP02ReadoutApplication::generate_modules(const confmodel::Session* session) cons
tp_queue_obj.set_by_val<uint32_t>("recv_timeout_ms", 50);
tp_queue_obj.set_by_val<uint32_t>("send_timeout_ms", 1);

tp_queues.push_back(obj_fac.get_dal<confmodel::Connection>(tp_queue_obj.UID()));
tp_queues.push_back(std::make_pair(sid->get_sid(), obj_fac.get_dal<confmodel::Connection>(tp_queue_obj.UID())));
// Create tp data requests queue from Fragment Aggregator
tpreq_queue_obj = obj_fac.create_queue_sid_obj(dlh_reqinput_qdesc, sid->get_sid());
req_queues.push_back(obj_fac.get_dal<confmodel::Connection>(tpreq_queue_obj.UID()));
Expand All @@ -321,17 +326,17 @@ NP02ReadoutApplication::generate_modules(const confmodel::Session* session) cons
// Create the ta(set) publishing service
conffwk::ConfigObject ta_net_obj = obj_fac.create_net_obj(ta_net_desc, tp_uid);

// Register queues with tp hankder
// Register queues with tp handler
tph_obj.set_objs("inputs", { &tp_queue_obj, &tpreq_queue_obj });
tph_obj.set_objs("outputs", { &tp_net_obj, &ta_net_obj, &frag_queue_obj });
modules.push_back(obj_fac.get_dal<confmodel::DaqModule>(tph_obj.UID()));
}
}

// Add output queueus of tps
std::vector<const conffwk::ConfigObject*> tp_queue_objs;
// Add output queueus of tps
std::vector<std::pair<uint32_t, const conffwk::ConfigObject*>> tp_queue_objs;
for (auto q : tp_queues) {
tp_queue_objs.push_back(&q->config_object());
tp_queue_objs.push_back(std::make_pair(q.first, &q.second->config_object()));
}

//-----------------------------------------------------------------
Expand Down Expand Up @@ -369,7 +374,6 @@ NP02ReadoutApplication::generate_modules(const confmodel::Session* session) cons

auto emulation_mode = reader_conf->get_emulation_mode();
for (auto& [numa, ds] : all_enabled_det_streams) {

uint32_t sid = ds->get_source_id();
TLOG_DEBUG(6) << fmt::format("Processing stream {}, id {}, det id {}", ds->UID(), ds->get_source_id(), ds->get_geo_id()->get_detector_id());
std::string uid(fmt::format("DLH-{}", sid));
Expand Down Expand Up @@ -403,8 +407,11 @@ NP02ReadoutApplication::generate_modules(const confmodel::Session* session) cons
dlh_outs.push_back(&ts_net_obj);
}

// here, we want to select which tp queues to add to the output, to separate mutiple detector elements
for (auto tpq : tp_queue_objs) {
dlh_outs.push_back(tpq);
if ((sid / 100) == (tpq.first / 10)) {
dlh_outs.push_back(tpq.second);
}
}
dlh_obj.set_objs("inputs", dlh_ins);
dlh_obj.set_objs("outputs", dlh_outs);
Expand Down