From 7871655c46b2666d19abec0c0fa9f58889a79a9f Mon Sep 17 00:00:00 2001 From: Artur Sztuc Date: Tue, 5 Nov 2024 17:29:52 +0100 Subject: [PATCH] Bugfixing RTCM: int -> uint64_t --- plugins/RandomTCMakerModule.cpp | 6 +++--- plugins/RandomTCMakerModule.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/RandomTCMakerModule.cpp b/plugins/RandomTCMakerModule.cpp index 6acadaf..439dc71 100644 --- a/plugins/RandomTCMakerModule.cpp +++ b/plugins/RandomTCMakerModule.cpp @@ -198,19 +198,19 @@ RandomTCMakerModule::create_candidate(dfmessages::timestamp_t timestamp) return candidate; } -int +uint64_t RandomTCMakerModule::get_interval(std::mt19937& gen) { std::string time_distribution = m_conf->get_time_distribution(); - int interval = m_clock_speed_hz / m_trigger_rate_hz.load(); + uint64_t interval = m_clock_speed_hz / m_trigger_rate_hz.load(); if( time_distribution == "kUniform"){ return interval; } else if(time_distribution == "kPoisson"){ std::exponential_distribution d(1.0 / interval); - return static_cast(0.5 + d(gen)); + return static_cast(0.5 + d(gen)); } else{ TLOG_DEBUG(1) << get_name() << " unknown distribution! Using kUniform."; diff --git a/plugins/RandomTCMakerModule.hpp b/plugins/RandomTCMakerModule.hpp index c51d1eb..4bc72fc 100644 --- a/plugins/RandomTCMakerModule.hpp +++ b/plugins/RandomTCMakerModule.hpp @@ -116,7 +116,7 @@ class RandomTCMakerModule : public dunedaq::appfwk::DAQModule /// @brief Output trigger rate in hz std::atomic m_trigger_rate_hz{ 0 }; - int get_interval(std::mt19937& gen); + uint64_t get_interval(std::mt19937& gen); dfmessages::run_number_t m_run_number;