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) 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;