Commit 63bbbb1c authored by Simon Spannagel's avatar Simon Spannagel
Browse files

ModuleManager: implement logic for StatusCodes DeadTime and EndRun

parent 34e62ba3
...@@ -596,7 +596,15 @@ void ModuleManager::run() { ...@@ -596,7 +596,15 @@ void ModuleManager::run() {
auto end = std::chrono::steady_clock::now(); auto end = std::chrono::steady_clock::now();
module_execution_time_[module.get()] += static_cast<std::chrono::duration<long double>>(end - start).count(); module_execution_time_[module.get()] += static_cast<std::chrono::duration<long double>>(end - start).count();
if(check == StatusCode::Failure) { if(check == StatusCode::DeadTime) {
// If status code indicates dead time, just silently continue with next event:
continue;
} else if(check == StatusCode::Failure) {
// If the status code indicates failure, break immediately and finish:
run = false;
break;
} else if(check == StatusCode::EndRun) {
// If the returned status code asks for end-of-run, finish module list and finish:
run = false; run = false;
} }
} }
......
...@@ -127,7 +127,7 @@ StatusCode AlignmentDUTResidual::run(std::shared_ptr<Clipboard> clipboard) { ...@@ -127,7 +127,7 @@ StatusCode AlignmentDUTResidual::run(std::shared_ptr<Clipboard> clipboard) {
if(m_discardedtracks > 0) { if(m_discardedtracks > 0) {
LOG(STATUS) << "Discarded " << m_discardedtracks << " input tracks."; LOG(STATUS) << "Discarded " << m_discardedtracks << " input tracks.";
} }
return StatusCode::Failure; return StatusCode::EndRun;
} }
// Otherwise keep going // Otherwise keep going
......
...@@ -83,7 +83,7 @@ StatusCode AlignmentMillepede::run(std::shared_ptr<Clipboard> clipboard) { ...@@ -83,7 +83,7 @@ StatusCode AlignmentMillepede::run(std::shared_ptr<Clipboard> clipboard) {
// If we have enough tracks for the alignment, tell the event loop to finish // If we have enough tracks for the alignment, tell the event loop to finish
if(m_alignmenttracks.size() >= m_numberOfTracksForAlignment) { if(m_alignmenttracks.size() >= m_numberOfTracksForAlignment) {
LOG(STATUS) << "Accumulated " << m_alignmenttracks.size() << " tracks, interrupting processing."; LOG(STATUS) << "Accumulated " << m_alignmenttracks.size() << " tracks, interrupting processing.";
return StatusCode::Failure; return StatusCode::EndRun;
} }
// Otherwise keep going // Otherwise keep going
......
...@@ -69,7 +69,7 @@ StatusCode AlignmentTrackChi2::run(std::shared_ptr<Clipboard> clipboard) { ...@@ -69,7 +69,7 @@ StatusCode AlignmentTrackChi2::run(std::shared_ptr<Clipboard> clipboard) {
if(m_discardedtracks > 0) { if(m_discardedtracks > 0) {
LOG(INFO) << "Discarded " << m_discardedtracks << " input tracks."; LOG(INFO) << "Discarded " << m_discardedtracks << " input tracks.";
} }
return StatusCode::Failure; return StatusCode::EndRun;
} }
// Otherwise keep going // Otherwise keep going
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment