Commit a9fc0354 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Analysis: add central logging for event number and track numbers

parent 805c18eb
Pipeline #217533 passed with stage
in 1 minute and 36 seconds
......@@ -302,6 +302,9 @@ void Analysis::run() {
// Loop over all events, running each algorithm on each "event"
LOG(STATUS) << "========================| Event loop |========================";
m_events = 1;
m_tracks = 0;
int skipped = 0;
while(1) {
bool run = true;
bool noData = false;
......@@ -330,12 +333,22 @@ void Analysis::run() {
set_algorithm_after(old_settings);
if(check == NoData) {
noData = true;
skipped++;
break;
} // Nothing to be done in this event
if(check == Failure)
run = false;
}
// Print statistics:
Tracks* tracks = (Tracks*)m_clipboard->get("tracks");
m_tracks += (tracks == NULL ? 0 : tracks->size());
if(m_events % 100 == 0 || skipped % 1000 == 0) {
LOG_PROGRESS(STATUS, "event_loop")
<< "Events processed: " << m_events << ", skipped: " << skipped << " Tracks found: " << m_tracks << " ("
<< ((double)m_tracks / m_events) << " tr/ev)";
}
// Clear objects from this iteration from the clipboard
m_clipboard->clear();
// Check if any of the algorithms return a value saying it should stop
......
......@@ -63,6 +63,7 @@ namespace corryvreckan {
TFile* m_histogramFile;
TDirectory* m_directory;
int m_events;
int m_tracks;
std::vector<Algorithm*> m_algorithms;
std::map<std::string, void*> loaded_libraries_;
......
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