Skip to content

Commit

Permalink
Merge pull request #326 from DUNE-DAQ/glm/debug_random_tc_maker
Browse files Browse the repository at this point in the history
Glm/debug random tc maker
  • Loading branch information
glehmannmiotto authored Jul 11, 2024
2 parents 4909392 + 3417a58 commit 15150a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
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.0.2)
project(trigger VERSION 2.0.3)

find_package(daq-cmake REQUIRED)

Expand Down
11 changes: 4 additions & 7 deletions plugins/RandomTCMakerModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RandomTCMakerModule::RandomTCMakerModule(const std::string& name)
{
register_command("conf", &RandomTCMakerModule::do_configure);
register_command("start", &RandomTCMakerModule::do_start);
register_command("stop", &RandomTCMakerModule::do_stop);
register_command("stop_trigger_sources", &RandomTCMakerModule::do_stop);
register_command("scrap", &RandomTCMakerModule::do_scrap);
}

Expand Down Expand Up @@ -196,18 +196,15 @@ RandomTCMakerModule::send_trigger_candidates()
}

dfmessages::timestamp_t initial_timestamp = m_timestamp_estimator->get_timestamp_estimate();
dfmessages::timestamp_t first_interval = get_interval(gen);
// Round up to the next multiple of trigger_interval_ticks
dfmessages::timestamp_t next_trigger_timestamp = (initial_timestamp / first_interval + 1) * first_interval;
TLOG_DEBUG(1) << get_name() << " initial timestamp estimate is " << initial_timestamp
<< ", next_trigger_timestamp is " << next_trigger_timestamp;
dfmessages::timestamp_t next_trigger_timestamp = initial_timestamp;
TLOG_DEBUG(1) << get_name() << " initial timestamp estimate is " << initial_timestamp;

while (m_running_flag.load()) {
if (m_timestamp_estimator->wait_for_timestamp(next_trigger_timestamp, m_running_flag) ==
utilities::TimestampEstimatorBase::kInterrupted) {
break;
}

next_trigger_timestamp = m_timestamp_estimator->get_timestamp_estimate();
triggeralgs::TriggerCandidate candidate = create_candidate(next_trigger_timestamp);

TLOG_DEBUG(1) << get_name() << " at timestamp " << m_timestamp_estimator->get_timestamp_estimate()
Expand Down

0 comments on commit 15150a8

Please sign in to comment.