Skip to content

Commit

Permalink
Merge pull request #356 from DUNE-DAQ/asztuc/rtcm_bugfix
Browse files Browse the repository at this point in the history
Bugfixing RTCM for v5.2
  • Loading branch information
ArturSztuc authored Nov 6, 2024
2 parents f8835d4 + 7871655 commit fff7479
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions plugins/RandomTCMakerModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double> d(1.0 / interval);
return static_cast<int>(0.5 + d(gen));
return static_cast<uint64_t>(0.5 + d(gen));
}
else{
TLOG_DEBUG(1) << get_name() << " unknown distribution! Using kUniform.";
Expand Down
2 changes: 1 addition & 1 deletion plugins/RandomTCMakerModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class RandomTCMakerModule : public dunedaq::appfwk::DAQModule
/// @brief Output trigger rate in hz
std::atomic<float> 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;

Expand Down

0 comments on commit fff7479

Please sign in to comment.