Skip to content
Snippets Groups Projects
Commit a7be441a authored by Eric Torrence's avatar Eric Torrence
Browse files

Catch error on truncated events

parent 2b0fc8b1
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@
//#include "ByteStreamData/ByteStreamMetadataContainer.h"
#include "FaserByteStreamCnvSvcBase/FaserByteStreamAddress.h"
#include "FaserEventStorage/pickFaserDataReader.h"
#include "FaserEventStorage/EventStorageIssues.h"
#include "Gaudi/Property.h"
#include "PersistentDataModel/DataHeader.h"
......@@ -116,10 +116,22 @@ const EventFull* FaserByteStreamInputSvc::nextEvent() {
if (m_evtInFile+1 > m_evtOffsets.size()) {
// get current event position (cast to long long until native tdaq implementation)
// This is the usual situation, reading past previous point in file
ATH_MSG_DEBUG("nextEvent _above_ high water mark");
m_evtFileOffset = (long long)m_reader->getPosition();
m_evtOffsets.push_back(m_evtFileOffset);
m_reader->getData(theEvent);
// Catch truncated events
try {
m_reader->getData(theEvent);
} catch (const FaserEventStorage::ES_OutOfFileBoundary& e) {
// Attempt to read beyond end of file, likely truncated event
ATH_MSG_WARNING("DataReader reports FaserEventStorage::ES_OutOfFileBoundary, stop reading file!");
return NULL;
} catch (...) {
// rethrow any other exceptions
throw;
}
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment