Skip to content
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(trigger VERSION 2.5.2)
project(trigger VERSION 2.5.3)

find_package(daq-cmake REQUIRED)

Expand Down
21 changes: 11 additions & 10 deletions plugins/RandomTCMakerModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TCType>(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<TCType>(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) {
Expand All @@ -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();

Expand Down Expand Up @@ -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;

Expand Down
11 changes: 7 additions & 4 deletions plugins/RandomTCMakerModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading