12 #include <sio/block.h>
13 #include <sio/compression/zlib.h>
19 return LCEventImpl::getCollection( name ) ;
26 return LCEventImpl::takeCollection( name ) ;
33 LCEventImpl::removeCollection( name ) ;
40 throw IO::IOException(
"LCEventLazyImpl::setBuffer: tried to setup a SIO buffer but already set !" ) ;
57 throw IO::IOException(
"LCEventLazyImpl::unpackEvent: SIO buffer not set !" ) ;
59 const bool compressed = sio::api::is_compressed(
_recordInfo._options ) ;
63 sio::buffer compBuffer(
_recordInfo._uncompressed_length ) ;
64 sio::zlib_compression compressor ;
67 sio::api::read_blocks( compBuffer.span(),
_blocks ) ;
84 char* rColChar = getenv (
"LCIO_IGNORE_NULL_IN_SUBSET_COLLECTIONS") ;
85 if(
nullptr != rColChar ) {
89 for(
auto name = strVec->
begin() ; name != strVec->
end() ; name++) {
95 sts <<
" LCEventLazyImpl::postProcessEvent: null pointer in subset collection "
96 << *name <<
" at position: " << i <<
std::endl ;
110 auto block = std::make_shared<SIO::SIOCollectionHandler>( i->first, handler ) ;
111 block->setCollection( i->second );
Base exception class for LCIO - all other exceptions extend this.
void setBuffer(const sio::record_info &recinfo, sio::buffer &&recordBuffer)
Set the event record buffer.
static void restoreParentDaughterRelations(EVENT::LCEvent *evt)
Restore the MCParticle parent <-> daughter relations.
EVENT::LCCollection * takeCollection(const std::string &name) const
Returns the collection for the given name and transfers the ownership of the collection to the caller...
void unpackEvent()
Unpack the event record.
virtual const std::vector< std::string > * getCollectionNames() const
Returns the names of the collections in the event.
virtual LCObject * getElementAt(int index) const =0
Returns pointer to element at index - no range check, use getNumberOfEntries().
EVENT::LCCollection * getCollection(const std::string &name) const
Returns the collection for the given name.
void postProcessEvent()
Post process the event after unpacking.
virtual bool isSubset() const =0
True if the collection holds a subset of objects from other collections.
IOException used for reading/writing errors.
std::unique_ptr< sio::buffer > _recordBuffer
virtual int getNumberOfElements() const =0
Returns the number of elements in the collection.
SIO::SIOHandlerMgr _eventHandlerMgr
void setupBlocks()
Setup the collection blocks before unpacking.
Implementation of the event class with a lazy record unpacking.
The generic collection used in LCIO.
std::shared_ptr< SIOObjectHandler > getHandler(const std::string &type) const
Returns the instance of the handler for the given type - null if it doesn't exist.
void removeCollection(const std::string &name)
Removes (and deletes) the collection with name (if it exists in the event).
sio::record_info _recordInfo