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

Merge branch 'truncated_events' into 'master'

Catch error on truncated events

See merge request faser/calypso!157
parents 2b0fc8b1 a7be441a
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
//#include "ByteStreamData/ByteStreamMetadataContainer.h" //#include "ByteStreamData/ByteStreamMetadataContainer.h"
#include "FaserByteStreamCnvSvcBase/FaserByteStreamAddress.h" #include "FaserByteStreamCnvSvcBase/FaserByteStreamAddress.h"
#include "FaserEventStorage/pickFaserDataReader.h" #include "FaserEventStorage/pickFaserDataReader.h"
#include "FaserEventStorage/EventStorageIssues.h"
#include "Gaudi/Property.h" #include "Gaudi/Property.h"
#include "PersistentDataModel/DataHeader.h" #include "PersistentDataModel/DataHeader.h"
...@@ -116,10 +116,22 @@ const EventFull* FaserByteStreamInputSvc::nextEvent() { ...@@ -116,10 +116,22 @@ const EventFull* FaserByteStreamInputSvc::nextEvent() {
if (m_evtInFile+1 > m_evtOffsets.size()) { if (m_evtInFile+1 > m_evtOffsets.size()) {
// get current event position (cast to long long until native tdaq implementation) // 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"); ATH_MSG_DEBUG("nextEvent _above_ high water mark");
m_evtFileOffset = (long long)m_reader->getPosition(); m_evtFileOffset = (long long)m_reader->getPosition();
m_evtOffsets.push_back(m_evtFileOffset); 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 { 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