From b4b9d6d0240281c851a5995e185502a4a11f105d Mon Sep 17 00:00:00 2001 From: Alessandro Thea Date: Tue, 21 Oct 2025 10:23:57 +0200 Subject: [PATCH 1/8] New RCTCM configuration --- plugins/RandomTCMakerModule.cpp | 23 +++++++++++++---------- plugins/RandomTCMakerModule.hpp | 11 +++++++---- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/plugins/RandomTCMakerModule.cpp b/plugins/RandomTCMakerModule.cpp index a21eded4..c941ab17 100644 --- a/plugins/RandomTCMakerModule.cpp +++ b/plugins/RandomTCMakerModule.cpp @@ -101,11 +101,14 @@ RandomTCMakerModule::do_configure(const CommandData_t& /*obj*/) m_conf = m_mtrg->get_configuration(); // Get the TC out configuration - const appmodel::TCReadoutMap* tc_readout = m_conf->get_tc_readout(); - m_tcout_time_before = tc_readout->get_time_before(); - m_tcout_time_after = tc_readout->get_time_after(); - m_tcout_type = - static_cast(dunedaq::trgdataformats::string_to_trigger_candidate_type(tc_readout->get_tc_type_name())); + // const appmodel::TCReadoutMap* tc_readout = m_conf->get_tc_readout(); + // m_tcout_time_before = tc_readout->get_time_before(); + // m_tcout_time_after_ts = tc_readout->get_time_after(); + m_tcout_time_offset_ts = m_conf->get_candidate_offset_ts(); + m_tcout_time_before_ts = m_conf->get_candidate_window_before_ts(); + m_tcout_time_after_ts = m_conf->get_candidate_window_after_ts(); + + m_tcout_type = static_cast(dunedaq::trgdataformats::string_to_trigger_candidate_type(m_conf->get_candidate_type_name())); // Throw error if unknown TC type if (m_tcout_type == TCType::kUnknown) { @@ -115,8 +118,8 @@ RandomTCMakerModule::do_configure(const CommandData_t& /*obj*/) m_latency_monitoring.store(m_conf->get_latency_monitoring()); m_trigger_rate_hz.store(m_conf->get_trigger_rate_hz()); - TLOG() << "RandomTCMaker will output TC of type: " << tc_readout->get_tc_type_name(); - TLOG() << "TC window time before: " << m_tcout_time_before << " time after: " << m_tcout_time_after; + TLOG() << "RandomTCMaker will output TC of type: " << m_conf->get_candidate_type_name(); + TLOG() << "TC window time before: " << m_tcout_time_before_ts << " time after: " << m_tcout_time_after_ts; TLOG() << "Clock speed is: " << m_clock_speed_hz; TLOG() << "Output trigger rate is: " << m_trigger_rate_hz.load(); @@ -206,9 +209,9 @@ triggeralgs::TriggerCandidate RandomTCMakerModule::create_candidate(dfmessages::timestamp_t timestamp) { triggeralgs::TriggerCandidate candidate; - candidate.time_start = (timestamp - m_tcout_time_before); - candidate.time_end = (timestamp + m_tcout_time_after); - candidate.time_candidate = timestamp; + candidate.time_candidate = timestamp + m_tcout_time_offset_ts; //timestamp; + candidate.time_start = candidate.time_candidate-m_tcout_time_before_ts; //(timestamp - m_tcout_time_before_ts); + candidate.time_end = candidate.time_candidate+m_tcout_time_after_ts; //(timestamp + m_tcout_time_after_ts); candidate.detid = { 0 }; candidate.type = m_tcout_type; diff --git a/plugins/RandomTCMakerModule.hpp b/plugins/RandomTCMakerModule.hpp index e1ccfd18..05ade78e 100644 --- a/plugins/RandomTCMakerModule.hpp +++ b/plugins/RandomTCMakerModule.hpp @@ -100,10 +100,13 @@ class RandomTCMakerModule : public dunedaq::appfwk::DAQModule /// @brief Output TC type TCType m_tcout_type; - /// @brief Output window start time, based off trigger timestamp - dfmessages::timestamp_t m_tcout_time_before; - /// @brief Output window end time, based off trigger timestamp - dfmessages::timestamp_t m_tcout_time_after; + + /// @brief Output candidate central time, based off trigger timestamp + dfmessages::timestamp_t m_tcout_time_offset_ts; + /// @brief Output candidate start time, based off trigger timestamp + dfmessages::timestamp_t m_tcout_time_before_ts; + /// @brief Output candidate end time, based off trigger timestamp + dfmessages::timestamp_t m_tcout_time_after_ts; /// @brief Clock speed in hz, taken from detector configuration uint64_t m_clock_speed_hz; From 0b919a7f6622ae31769ccbc0b14980d56db3a0ce Mon Sep 17 00:00:00 2001 From: Alessandro Thea Date: Thu, 13 Nov 2025 22:34:46 +0100 Subject: [PATCH 2/8] Comment fixed and TLOG added --- plugins/RandomTCMakerModule.cpp | 4 +--- plugins/RandomTCMakerModule.hpp | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/RandomTCMakerModule.cpp b/plugins/RandomTCMakerModule.cpp index c941ab17..7f53d1a8 100644 --- a/plugins/RandomTCMakerModule.cpp +++ b/plugins/RandomTCMakerModule.cpp @@ -101,9 +101,6 @@ RandomTCMakerModule::do_configure(const CommandData_t& /*obj*/) m_conf = m_mtrg->get_configuration(); // Get the TC out configuration - // const appmodel::TCReadoutMap* tc_readout = m_conf->get_tc_readout(); - // m_tcout_time_before = tc_readout->get_time_before(); - // m_tcout_time_after_ts = tc_readout->get_time_after(); m_tcout_time_offset_ts = m_conf->get_candidate_offset_ts(); m_tcout_time_before_ts = m_conf->get_candidate_window_before_ts(); m_tcout_time_after_ts = m_conf->get_candidate_window_after_ts(); @@ -119,6 +116,7 @@ RandomTCMakerModule::do_configure(const CommandData_t& /*obj*/) m_trigger_rate_hz.store(m_conf->get_trigger_rate_hz()); TLOG() << "RandomTCMaker will output TC of type: " << m_conf->get_candidate_type_name(); + TLOG() << "TC window center offset: " << m_tcout_time_offset_ts; TLOG() << "TC window time before: " << m_tcout_time_before_ts << " time after: " << m_tcout_time_after_ts; TLOG() << "Clock speed is: " << m_clock_speed_hz; TLOG() << "Output trigger rate is: " << m_trigger_rate_hz.load(); diff --git a/plugins/RandomTCMakerModule.hpp b/plugins/RandomTCMakerModule.hpp index 05ade78e..74cfe9e0 100644 --- a/plugins/RandomTCMakerModule.hpp +++ b/plugins/RandomTCMakerModule.hpp @@ -101,11 +101,11 @@ class RandomTCMakerModule : public dunedaq::appfwk::DAQModule /// @brief Output TC type TCType m_tcout_type; - /// @brief Output candidate central time, based off trigger timestamp + /// @brief Offset applied to timestamp estimator time to generate random trigger candidates dfmessages::timestamp_t m_tcout_time_offset_ts; - /// @brief Output candidate start time, based off trigger timestamp + /// @brief Output candidate start time, relative to peak time dfmessages::timestamp_t m_tcout_time_before_ts; - /// @brief Output candidate end time, based off trigger timestamp + /// @brief Output candidate end time, relative to peak time dfmessages::timestamp_t m_tcout_time_after_ts; /// @brief Clock speed in hz, taken from detector configuration From 7d06f843b918e0676c33a21aa8a38568403302eb Mon Sep 17 00:00:00 2001 From: Alessandro Thea Date: Sat, 15 Nov 2025 08:35:46 +0100 Subject: [PATCH 3/8] Replaced rtcm offset with backshift to highight the value is subtracked from 'now' --- plugins/RandomTCMakerModule.cpp | 7 +++++-- plugins/RandomTCMakerModule.hpp | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/RandomTCMakerModule.cpp b/plugins/RandomTCMakerModule.cpp index 7f53d1a8..c4f58889 100644 --- a/plugins/RandomTCMakerModule.cpp +++ b/plugins/RandomTCMakerModule.cpp @@ -101,7 +101,10 @@ RandomTCMakerModule::do_configure(const CommandData_t& /*obj*/) m_conf = m_mtrg->get_configuration(); // Get the TC out configuration - m_tcout_time_offset_ts = m_conf->get_candidate_offset_ts(); + // const appmodel::TCReadoutMap* tc_readout = m_conf->get_tc_readout(); + // m_tcout_time_before = tc_readout->get_time_before(); + // m_tcout_time_after_ts = tc_readout->get_time_after(); + m_tcout_time_backshift_ts = m_conf->get_candidate_backshift_ts(); m_tcout_time_before_ts = m_conf->get_candidate_window_before_ts(); m_tcout_time_after_ts = m_conf->get_candidate_window_after_ts(); @@ -207,7 +210,7 @@ triggeralgs::TriggerCandidate RandomTCMakerModule::create_candidate(dfmessages::timestamp_t timestamp) { triggeralgs::TriggerCandidate candidate; - candidate.time_candidate = timestamp + m_tcout_time_offset_ts; //timestamp; + candidate.time_candidate = timestamp - m_tcout_time_backshift_ts; //timestamp; candidate.time_start = candidate.time_candidate-m_tcout_time_before_ts; //(timestamp - m_tcout_time_before_ts); candidate.time_end = candidate.time_candidate+m_tcout_time_after_ts; //(timestamp + m_tcout_time_after_ts); candidate.detid = { 0 }; diff --git a/plugins/RandomTCMakerModule.hpp b/plugins/RandomTCMakerModule.hpp index 74cfe9e0..63ebaa39 100644 --- a/plugins/RandomTCMakerModule.hpp +++ b/plugins/RandomTCMakerModule.hpp @@ -101,9 +101,9 @@ class RandomTCMakerModule : public dunedaq::appfwk::DAQModule /// @brief Output TC type TCType m_tcout_type; - /// @brief Offset applied to timestamp estimator time to generate random trigger candidates - dfmessages::timestamp_t m_tcout_time_offset_ts; - /// @brief Output candidate start time, relative to peak time + /// @brief Output candidate central time, based off trigger timestamp + dfmessages::timestamp_t m_tcout_time_backshift_ts; + /// @brief Output candidate start time, based off trigger timestamp dfmessages::timestamp_t m_tcout_time_before_ts; /// @brief Output candidate end time, relative to peak time dfmessages::timestamp_t m_tcout_time_after_ts; From c20d52b2f186f0f76329a30f0c0d44c1c5e2f102 Mon Sep 17 00:00:00 2001 From: Alessandro Thea Date: Sat, 15 Nov 2025 19:15:28 +0100 Subject: [PATCH 4/8] Bugfix --- plugins/RandomTCMakerModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/RandomTCMakerModule.cpp b/plugins/RandomTCMakerModule.cpp index c4f58889..b3ab8c66 100644 --- a/plugins/RandomTCMakerModule.cpp +++ b/plugins/RandomTCMakerModule.cpp @@ -119,7 +119,7 @@ RandomTCMakerModule::do_configure(const CommandData_t& /*obj*/) m_trigger_rate_hz.store(m_conf->get_trigger_rate_hz()); TLOG() << "RandomTCMaker will output TC of type: " << m_conf->get_candidate_type_name(); - TLOG() << "TC window center offset: " << m_tcout_time_offset_ts; + TLOG() << "TC window center offset: " << m_tcout_time_backshift_ts; TLOG() << "TC window time before: " << m_tcout_time_before_ts << " time after: " << m_tcout_time_after_ts; TLOG() << "Clock speed is: " << m_clock_speed_hz; TLOG() << "Output trigger rate is: " << m_trigger_rate_hz.load(); From 99df77d08edbcf5dd343818b9a8323356cfd8dd4 Mon Sep 17 00:00:00 2001 From: MRiganSUSX Date: Fri, 21 Nov 2025 17:01:46 +0100 Subject: [PATCH 5/8] removed old commented code --- plugins/RandomTCMakerModule.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/RandomTCMakerModule.cpp b/plugins/RandomTCMakerModule.cpp index b3ab8c66..9724d383 100644 --- a/plugins/RandomTCMakerModule.cpp +++ b/plugins/RandomTCMakerModule.cpp @@ -101,9 +101,6 @@ RandomTCMakerModule::do_configure(const CommandData_t& /*obj*/) m_conf = m_mtrg->get_configuration(); // Get the TC out configuration - // const appmodel::TCReadoutMap* tc_readout = m_conf->get_tc_readout(); - // m_tcout_time_before = tc_readout->get_time_before(); - // m_tcout_time_after_ts = tc_readout->get_time_after(); m_tcout_time_backshift_ts = m_conf->get_candidate_backshift_ts(); m_tcout_time_before_ts = m_conf->get_candidate_window_before_ts(); m_tcout_time_after_ts = m_conf->get_candidate_window_after_ts(); @@ -210,9 +207,9 @@ triggeralgs::TriggerCandidate RandomTCMakerModule::create_candidate(dfmessages::timestamp_t timestamp) { triggeralgs::TriggerCandidate candidate; - candidate.time_candidate = timestamp - m_tcout_time_backshift_ts; //timestamp; - candidate.time_start = candidate.time_candidate-m_tcout_time_before_ts; //(timestamp - m_tcout_time_before_ts); - candidate.time_end = candidate.time_candidate+m_tcout_time_after_ts; //(timestamp + m_tcout_time_after_ts); + candidate.time_candidate = timestamp - m_tcout_time_backshift_ts; + candidate.time_start = candidate.time_candidate-m_tcout_time_before_ts; + candidate.time_end = candidate.time_candidate+m_tcout_time_after_ts; candidate.detid = { 0 }; candidate.type = m_tcout_type; From 2274b1ab89f21462e6d035670bd210e3716cf841 Mon Sep 17 00:00:00 2001 From: Alessandro Thea Date: Tue, 25 Nov 2025 16:01:49 +0100 Subject: [PATCH 6/8] Bumping version to v2.5.3 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index afff5287..8d44dcec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.12) -project(trigger VERSION 2.5.2) +project(trigger VERSION 2.5.3) find_package(daq-cmake REQUIRED) From dcf31a70b4e35b82ae968103ae2ee51ff0176a0b Mon Sep 17 00:00:00 2001 From: Wesley Ketchum Date: Tue, 25 Nov 2025 12:33:26 -0600 Subject: [PATCH 7/8] Revert "New RTCM configuration" --- plugins/RandomTCMakerModule.cpp | 21 ++++++++++----------- plugins/RandomTCMakerModule.hpp | 11 ++++------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/plugins/RandomTCMakerModule.cpp b/plugins/RandomTCMakerModule.cpp index 9724d383..a21eded4 100644 --- a/plugins/RandomTCMakerModule.cpp +++ b/plugins/RandomTCMakerModule.cpp @@ -101,11 +101,11 @@ RandomTCMakerModule::do_configure(const CommandData_t& /*obj*/) m_conf = m_mtrg->get_configuration(); // Get the TC out configuration - m_tcout_time_backshift_ts = m_conf->get_candidate_backshift_ts(); - m_tcout_time_before_ts = m_conf->get_candidate_window_before_ts(); - m_tcout_time_after_ts = m_conf->get_candidate_window_after_ts(); - - m_tcout_type = static_cast(dunedaq::trgdataformats::string_to_trigger_candidate_type(m_conf->get_candidate_type_name())); + const appmodel::TCReadoutMap* tc_readout = m_conf->get_tc_readout(); + m_tcout_time_before = tc_readout->get_time_before(); + m_tcout_time_after = tc_readout->get_time_after(); + m_tcout_type = + static_cast(dunedaq::trgdataformats::string_to_trigger_candidate_type(tc_readout->get_tc_type_name())); // Throw error if unknown TC type if (m_tcout_type == TCType::kUnknown) { @@ -115,9 +115,8 @@ RandomTCMakerModule::do_configure(const CommandData_t& /*obj*/) m_latency_monitoring.store(m_conf->get_latency_monitoring()); m_trigger_rate_hz.store(m_conf->get_trigger_rate_hz()); - TLOG() << "RandomTCMaker will output TC of type: " << m_conf->get_candidate_type_name(); - TLOG() << "TC window center offset: " << m_tcout_time_backshift_ts; - TLOG() << "TC window time before: " << m_tcout_time_before_ts << " time after: " << m_tcout_time_after_ts; + TLOG() << "RandomTCMaker will output TC of type: " << tc_readout->get_tc_type_name(); + TLOG() << "TC window time before: " << m_tcout_time_before << " time after: " << m_tcout_time_after; TLOG() << "Clock speed is: " << m_clock_speed_hz; TLOG() << "Output trigger rate is: " << m_trigger_rate_hz.load(); @@ -207,9 +206,9 @@ triggeralgs::TriggerCandidate RandomTCMakerModule::create_candidate(dfmessages::timestamp_t timestamp) { triggeralgs::TriggerCandidate candidate; - candidate.time_candidate = timestamp - m_tcout_time_backshift_ts; - candidate.time_start = candidate.time_candidate-m_tcout_time_before_ts; - candidate.time_end = candidate.time_candidate+m_tcout_time_after_ts; + candidate.time_start = (timestamp - m_tcout_time_before); + candidate.time_end = (timestamp + m_tcout_time_after); + candidate.time_candidate = timestamp; candidate.detid = { 0 }; candidate.type = m_tcout_type; diff --git a/plugins/RandomTCMakerModule.hpp b/plugins/RandomTCMakerModule.hpp index 63ebaa39..e1ccfd18 100644 --- a/plugins/RandomTCMakerModule.hpp +++ b/plugins/RandomTCMakerModule.hpp @@ -100,13 +100,10 @@ class RandomTCMakerModule : public dunedaq::appfwk::DAQModule /// @brief Output TC type TCType m_tcout_type; - - /// @brief Output candidate central time, based off trigger timestamp - dfmessages::timestamp_t m_tcout_time_backshift_ts; - /// @brief Output candidate start time, based off trigger timestamp - dfmessages::timestamp_t m_tcout_time_before_ts; - /// @brief Output candidate end time, relative to peak time - dfmessages::timestamp_t m_tcout_time_after_ts; + /// @brief Output window start time, based off trigger timestamp + dfmessages::timestamp_t m_tcout_time_before; + /// @brief Output window end time, based off trigger timestamp + dfmessages::timestamp_t m_tcout_time_after; /// @brief Clock speed in hz, taken from detector configuration uint64_t m_clock_speed_hz; From f7c023af83630d493b0fabdeccb3ccb120065741 Mon Sep 17 00:00:00 2001 From: Wesley Ketchum Date: Wed, 26 Nov 2025 10:30:41 -0600 Subject: [PATCH 8/8] Reapply "New RTCM configuration" This reverts commit dcf31a70b4e35b82ae968103ae2ee51ff0176a0b. --- plugins/RandomTCMakerModule.cpp | 21 +++++++++++---------- plugins/RandomTCMakerModule.hpp | 11 +++++++---- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/plugins/RandomTCMakerModule.cpp b/plugins/RandomTCMakerModule.cpp index a21eded4..9724d383 100644 --- a/plugins/RandomTCMakerModule.cpp +++ b/plugins/RandomTCMakerModule.cpp @@ -101,11 +101,11 @@ RandomTCMakerModule::do_configure(const CommandData_t& /*obj*/) m_conf = m_mtrg->get_configuration(); // Get the TC out configuration - const appmodel::TCReadoutMap* tc_readout = m_conf->get_tc_readout(); - m_tcout_time_before = tc_readout->get_time_before(); - m_tcout_time_after = tc_readout->get_time_after(); - m_tcout_type = - static_cast(dunedaq::trgdataformats::string_to_trigger_candidate_type(tc_readout->get_tc_type_name())); + m_tcout_time_backshift_ts = m_conf->get_candidate_backshift_ts(); + m_tcout_time_before_ts = m_conf->get_candidate_window_before_ts(); + m_tcout_time_after_ts = m_conf->get_candidate_window_after_ts(); + + m_tcout_type = static_cast(dunedaq::trgdataformats::string_to_trigger_candidate_type(m_conf->get_candidate_type_name())); // Throw error if unknown TC type if (m_tcout_type == TCType::kUnknown) { @@ -115,8 +115,9 @@ RandomTCMakerModule::do_configure(const CommandData_t& /*obj*/) m_latency_monitoring.store(m_conf->get_latency_monitoring()); m_trigger_rate_hz.store(m_conf->get_trigger_rate_hz()); - TLOG() << "RandomTCMaker will output TC of type: " << tc_readout->get_tc_type_name(); - TLOG() << "TC window time before: " << m_tcout_time_before << " time after: " << m_tcout_time_after; + TLOG() << "RandomTCMaker will output TC of type: " << m_conf->get_candidate_type_name(); + TLOG() << "TC window center offset: " << m_tcout_time_backshift_ts; + TLOG() << "TC window time before: " << m_tcout_time_before_ts << " time after: " << m_tcout_time_after_ts; TLOG() << "Clock speed is: " << m_clock_speed_hz; TLOG() << "Output trigger rate is: " << m_trigger_rate_hz.load(); @@ -206,9 +207,9 @@ triggeralgs::TriggerCandidate RandomTCMakerModule::create_candidate(dfmessages::timestamp_t timestamp) { triggeralgs::TriggerCandidate candidate; - candidate.time_start = (timestamp - m_tcout_time_before); - candidate.time_end = (timestamp + m_tcout_time_after); - candidate.time_candidate = timestamp; + candidate.time_candidate = timestamp - m_tcout_time_backshift_ts; + candidate.time_start = candidate.time_candidate-m_tcout_time_before_ts; + candidate.time_end = candidate.time_candidate+m_tcout_time_after_ts; candidate.detid = { 0 }; candidate.type = m_tcout_type; diff --git a/plugins/RandomTCMakerModule.hpp b/plugins/RandomTCMakerModule.hpp index e1ccfd18..63ebaa39 100644 --- a/plugins/RandomTCMakerModule.hpp +++ b/plugins/RandomTCMakerModule.hpp @@ -100,10 +100,13 @@ class RandomTCMakerModule : public dunedaq::appfwk::DAQModule /// @brief Output TC type TCType m_tcout_type; - /// @brief Output window start time, based off trigger timestamp - dfmessages::timestamp_t m_tcout_time_before; - /// @brief Output window end time, based off trigger timestamp - dfmessages::timestamp_t m_tcout_time_after; + + /// @brief Output candidate central time, based off trigger timestamp + dfmessages::timestamp_t m_tcout_time_backshift_ts; + /// @brief Output candidate start time, based off trigger timestamp + dfmessages::timestamp_t m_tcout_time_before_ts; + /// @brief Output candidate end time, relative to peak time + dfmessages::timestamp_t m_tcout_time_after_ts; /// @brief Clock speed in hz, taken from detector configuration uint64_t m_clock_speed_hz;