Commit db3a1881 authored by Jens Kroeger's avatar Jens Kroeger
Browse files

ImproveReferenceTimestamp: cleanup after merging \!406, now remove track if no...

ImproveReferenceTimestamp: cleanup after merging \!406, now remove track if no trigger can be found + improved debug output
parent f878e7a5
Pipeline #2558729 passed with stages
in 13 minutes and 32 seconds
......@@ -30,7 +30,8 @@ void ImproveReferenceTimestamp::initialize() {
// Initialise member variables
m_eventNumber = 0;
m_improvedTriggers = 0;
m_noTriggerFound = 0;
m_noTriggerOnClipboard = 0;
m_noTriggerInWindow = 0;
hTriggersPerEvent = new TH1D("hTriggersPerEvent", "hTriggersPerEvent;triggers per event;# entries", 20, -0.5, 19.5);
hTracksPerEvent = new TH1D("hTracksPerEvent", "hTracksPerEvent;tracks per event;# entries", 20, -0.5, 19.5);
......@@ -70,9 +71,9 @@ StatusCode ImproveReferenceTimestamp::run(const std::shared_ptr<Clipboard>& clip
// Find trigger timestamp closest in time
double diff = std::numeric_limits<double>::max();
if(!trigger_times.size()) {
// set to non-sense timestamp because we cannot delete from clipboard
track->setTimestamp(-1);
m_noTriggerFound++;
LOG(DEBUG) << "No triggers, removing track.";
clipboard->removeData(track);
m_noTriggerOnClipboard++;
} else {
for(auto& trigger_time : trigger_times) {
......@@ -87,11 +88,13 @@ StatusCode ImproveReferenceTimestamp::run(const std::shared_ptr<Clipboard>& clip
}
}
if(diff < m_searchWindow) {
LOG(DEBUG) << "Found trigger within search window, improving track timestamp.";
track->setTimestamp(improved_time);
m_improvedTriggers++;
} else {
track->setTimestamp(-1);
m_noTriggerFound++;
LOG(DEBUG) << "No trigger within search window, removing track.";
clipboard->removeData(track);
m_noTriggerInWindow++;
}
}
}
......@@ -107,5 +110,6 @@ StatusCode ImproveReferenceTimestamp::run(const std::shared_ptr<Clipboard>& clip
void ImproveReferenceTimestamp::finalize(const std::shared_ptr<ReadonlyClipboard>&) {
LOG(STATUS) << "Analysed " << m_eventNumber << " events, improved track timestamps: " << m_improvedTriggers
<< ", no trigger found: " << m_noTriggerFound;
<< ", no trigger on clipboard: " << m_noTriggerOnClipboard
<< ", no trigger in search window: " << m_noTriggerInWindow;
}
......@@ -42,7 +42,8 @@ namespace corryvreckan {
// Member variables
int m_eventNumber;
int m_noTriggerFound;
int m_noTriggerOnClipboard;
int m_noTriggerInWindow;
int m_improvedTriggers;
std::string m_source;
double m_triggerLatency;
......
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