Commit 0b0399ab authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'master' into documentation

parents 320471c9 a9270b43
Pipeline #453840 passed with stages
in 14 minutes and 8 seconds
......@@ -417,8 +417,10 @@ void Analysis::run() {
events_prev = m_events;
LOG_PROGRESS(STATUS, "event_loop")
<< "Ev: +" << m_events << " \\" << skipped << " Tr: " << m_tracks << " (" << std::setprecision(3)
<< ((double)m_tracks / m_events)
<< "/ev) t = " << Units::display(m_clipboard->get_persistent("eventStart"), {"ns", "us", "ms", "s"});
<< ((double)m_tracks / m_events) << "/ev)"
<< (m_clipboard->has_persistent("eventStart")
? " t = " + Units::display(m_clipboard->get_persistent("eventStart"), {"ns", "us", "ms", "s"})
: "");
}
// Clear objects from this iteration from the clipboard
......
......@@ -28,7 +28,7 @@ double Clipboard::get_persistent(std::string name) {
try {
return m_persistent_data.at(name);
} catch(std::out_of_range&) {
throw MissingDataError("Key " + name + " not available on clipboard");
throw MissingDataError(name);
}
}
......
......@@ -11,8 +11,8 @@
#define CORRYVRECKAN_CLIPBOARD_H
#include <iostream>
#include <map>
#include <string>
#include <unordered_map>
#include "core/utils/log.h"
#include "objects/Object.hpp"
......@@ -105,7 +105,7 @@ namespace corryvreckan {
std::vector<std::string> m_dataID;
// Persistent clipboard storage
std::map<std::string, double> m_persistent_data;
std::unordered_map<std::string, double> m_persistent_data;
};
} // namespace corryvreckan
......
......@@ -200,19 +200,16 @@ StatusCode CLICpix2Analysis::run(Clipboard* clipboard) {
}
// Discard tracks which are very close to the frame edges
if(fabs(track->timestamp() - clipboard->get_persistent("currentTime")) < m_timeCutFrameEdge) {
// Late edge - the currentTime has been updated by Timexpi3EventLoader to point to the end of the frame`
if(fabs(track->timestamp() - clipboard->get_persistent("eventEnd")) < m_timeCutFrameEdge) {
// Late edge - eventEnd points to the end of the frame`
LOG(DEBUG) << " - track close to end of readout frame: "
<< Units::display(fabs(track->timestamp() - clipboard->get_persistent("currentTime")), {"us", "ns"})
<< Units::display(fabs(track->timestamp() - clipboard->get_persistent("eventEnd")), {"us", "ns"})
<< " at " << Units::display(track->timestamp(), {"us"});
continue;
} else if(fabs(track->timestamp() - clipboard->get_persistent("currentTime") +
clipboard->get_persistent("eventLength")) < m_timeCutFrameEdge) {
// Early edge - subtract the eventLength from the current time to see the beginning of the frame
} else if(fabs(track->timestamp() - clipboard->get_persistent("eventStart")) < m_timeCutFrameEdge) {
// Early edge - eventStart points to the beginning of the frame
LOG(DEBUG) << " - track close to start of readout frame: "
<< Units::display(fabs(track->timestamp() - clipboard->get_persistent("currentTime") +
clipboard->get_persistent("eventLength")),
{"us", "ns"})
<< Units::display(fabs(track->timestamp() - clipboard->get_persistent("eventStart")), {"us", "ns"})
<< " at " << Units::display(track->timestamp(), {"us"});
continue;
}
......
......@@ -70,7 +70,7 @@ StatusCode DUTAnalysis::run(Clipboard* clipboard) {
LOG(TRACE) << "Power on time: " << Units::display(m_powerOnTime, {"ns", "us", "s"});
LOG(TRACE) << "Power off time: " << Units::display(m_powerOffTime, {"ns", "us", "s"});
// if(clipboard->get_persistent("currentTime") < 13.5)
// if(clipboard->get_persistent("eventStart") < 13.5)
// return Success;
// Track chi2/ndof cut
......@@ -179,7 +179,7 @@ StatusCode DUTAnalysis::run(Clipboard* clipboard) {
tracksVersusPowerOnTime->Fill(timeSincePowerOn);
if(timeSincePowerOn < 200000) {
LOG(TRACE) << "Track at time " << Units::display(clipboard->get_persistent("currentTime"), {"ns", "us", "s"})
LOG(TRACE) << "Track at time " << Units::display(clipboard->get_persistent("eventStart"), {"ns", "us", "s"})
<< " has time shutter open of " << Units::display(timeSincePowerOn, {"ns", "us", "s"});
LOG(TRACE) << "Shutter open time is " << Units::display(m_shutterOpenTime, {"ns", "us", "s"})
<< ", shutter close time is " << Units::display(m_shutterCloseTime, {"ns", "us", "s"});
......
......@@ -618,7 +618,7 @@ bool Timepix3EventLoader::loadData(Clipboard* clipboard, Detector* detector, Pix
// If events are loaded based on time intervals, take all hits where the
// time is within this window
// Ignore pixel data if it is before the "currentTime" read from the clipboard storage:
// Ignore pixel data if it is before the "eventStart" read from the clipboard storage:
if(temporalSplit && (timestamp < clipboard->get_persistent("eventStart"))) {
LOG(TRACE) << "Skipping pixel, is before event window (" << Units::display(timestamp, {"s", "us", "ns"})
<< " < " << Units::display(clipboard->get_persistent("eventStart"), {"s", "us", "ns"}) << ")";
......
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