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

Check for presence of time informatrion before processing

parent 4b4be89d
Pipeline #435003 failed with stages
in 2 minutes and 20 seconds
......@@ -100,6 +100,11 @@ void ATLASpixEventLoader::initialise() {
StatusCode ATLASpixEventLoader::run(Clipboard* clipboard) {
// Check if event frame is defined:
if(!clipboard->has_persistent("eventStart") || !clipboard->has_persistent("eventEnd")) {
throw ModuleError("Event not defined. Add Metronome module or Event reader defining the event.");
}
// If have reached the end of file, close it and exit program running
if(m_file.eof()) {
m_file.close();
......@@ -181,7 +186,7 @@ Pixels* ATLASpixEventLoader::read_caribou_data(double start_time, double end_tim
<< Units::display(timestamp, {"s", "us", "ns"}) << " > "
<< Units::display(end_time, {"s", "us", "ns"}) << ")";
// Rewind to previous position:
LOG(TRACE) << "Rewinding to file pointer : " << oldpos;
LOG(TRACE) << "Rewinding to file pointer : " << oldpos;
m_file.seekg(oldpos);
break;
}
......@@ -206,7 +211,7 @@ Pixels* ATLASpixEventLoader::read_caribou_data(double start_time, double end_tim
}
// Store this position in the file in case we need to rewind:
LOG(TRACE) << "Storing file pointer position: " << m_file.tellg();
LOG(TRACE) << "Storing file pointer position: " << m_file.tellg();
oldpos = m_file.tellg();
}
......
......@@ -247,6 +247,11 @@ StatusCode Timepix3EventLoader::run(Clipboard* clipboard) {
// be done in one of two ways: by taking all data in the time interval (t,t+delta), or by
// loading a fixed number of pixels (ie. 2000 at a time)
// Check if event frame is defined:
if(!clipboard->has_persistent("eventStart") || !clipboard->has_persistent("eventEnd")) {
throw ModuleError("Event not defined. Add Metronome module or Event reader defining the event.");
}
LOG(TRACE) << "== New event";
int loadedData = 0;
......
Supports Markdown
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