LCIO
02.17
|
Implementation of the event class with a lazy record unpacking. More...
#include <LCEventLazyImpl.h>
Public Member Functions | |
LCEventLazyImpl ()=default | |
Constructor. More... | |
~LCEventLazyImpl ()=default | |
Destructor. More... | |
EVENT::LCCollection * | getCollection (const std::string &name) const |
Returns the collection for the given name. More... | |
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. More... | |
void | removeCollection (const std::string &name) |
Removes (and deletes) the collection with name (if it exists in the event). More... | |
void | setBuffer (const sio::record_info &recinfo, sio::buffer &&recordBuffer) |
Set the event record buffer. More... | |
![]() | |
LCEventImpl () | |
virtual | ~LCEventImpl () |
Copy contructor, creates a deep copy of the event. More... | |
virtual int | getRunNumber () const |
Return the run number off this event. More... | |
virtual int | getEventNumber () const |
Returns this event's number . More... | |
virtual const std::string & | getDetectorName () const |
Returns the name of the detector setup used in the simulation. More... | |
virtual EVENT::long64 | getTimeStamp () const |
Returns the time stamp of the event. More... | |
virtual double | getWeight () const |
Returns the event weight. More... | |
virtual const std::vector < std::string > * | getCollectionNames () const |
Returns the names of the collections in the event. More... | |
virtual void | addCollection (EVENT::LCCollection *col, const std::string &name) |
Adds a collection with the given name (has to be a valid C/C++ variable name). More... | |
virtual const EVENT::LCParameters & | getParameters () const |
Returns the names of the relations in the event. More... | |
virtual EVENT::LCParameters & | parameters () |
Parameters defined for this run. More... | |
virtual lcrtrel::LCRTRelations & | runtime () |
Get the runtime extensions for this event. More... | |
void | setRunNumber (int rn) |
Sets the run number. More... | |
void | setEventNumber (int en) |
Sets the event number. More... | |
void | setDetectorName (const std::string &dn) |
Sets the detector name. More... | |
void | setTimeStamp (EVENT::long64 ts) |
Sets the event time stamp. More... | |
void | setWeight (double w) |
Set the event weight. More... | |
![]() | |
virtual | ~LCEvent () |
Destructor. More... | |
![]() | |
AccessChecked () | |
virtual | ~AccessChecked () |
virtual int | simpleUID () const |
Private Member Functions | |
void | unpackEvent () |
Unpack the event record. More... | |
void | postProcessEvent () |
Post process the event after unpacking. More... | |
void | setupBlocks () |
Setup the collection blocks before unpacking. More... | |
Private Attributes | |
std::unique_ptr< sio::buffer > | _recordBuffer {nullptr} |
sio::record_info | _recordInfo {} |
sio::block_list | _blocks {} |
bool | _unpacked {false} |
SIO::SIOHandlerMgr | _eventHandlerMgr {} |
Additional Inherited Members | |
![]() | |
void | setAccessMode (int accessMode) |
bool | validateCollectionName (const char *name) |
Tests the validity of a collection name. More... | |
![]() | |
virtual void | setReadOnly (bool readOnly) |
void | checkAccess () |
void | checkAccess (const char *what) |
![]() | |
int | _runNumber |
int | _eventNumber |
EVENT::long64 | _timeStamp |
std::string | _detectorName |
LCCollectionMap | _colMap {} |
std::vector< std::string > | _colNames {} |
LCParametersImpl | _params {} |
LCCollectionSet | _notOwned {} |
lcrtrel::LCRTRelations | _runtime {} |
![]() | |
bool | _readOnly {false} |
int | _id {-1} |
![]() | |
static std::atomic_int | _lCObjectId |
Implementation of the event class with a lazy record unpacking.
This is used by the MT::LCReader LCIO file reader implementation. SIO internal buffer are kept
Definition at line 27 of file LCEventLazyImpl.h.
|
default |
Constructor.
|
default |
Destructor.
|
virtual |
Returns the collection for the given name.
Triggers the event unpacking
DataNotAvailableException |
Reimplemented from IMPL::LCEventImpl.
Definition at line 17 of file LCEventLazyImpl.cc.
References unpackEvent().
Referenced by postProcessEvent().
|
private |
Post process the event after unpacking.
Definition at line 80 of file LCEventLazyImpl.cc.
References std::vector< T >::begin(), std::vector< T >::end(), std::endl(), getCollection(), IMPL::LCEventImpl::getCollectionNames(), EVENT::LCCollection::getElementAt(), EVENT::LCCollection::getNumberOfElements(), EVENT::LCCollection::isSubset(), SIO::SIOParticleHandler::restoreParentDaughterRelations(), and std::stringstream::str().
Referenced by unpackEvent().
|
virtual |
Removes (and deletes) the collection with name (if it exists in the event).
Throws an exception if the event is 'read only' as defined by the read mode in LCReader.
ReadOnlyException |
Reimplemented from IMPL::LCEventImpl.
Definition at line 31 of file LCEventLazyImpl.cc.
References _blocks, and std::remove_if().
void IOIMPL::LCEventLazyImpl::setBuffer | ( | const sio::record_info & | recinfo, |
sio::buffer && | recordBuffer | ||
) |
Set the event record buffer.
Definition at line 38 of file LCEventLazyImpl.cc.
References _recordBuffer, _recordInfo, std::unique_ptr< T >::reset(), and setupBlocks().
Referenced by MT::LCReader::readEvent(), and MT::LCReader::readNextEvent().
|
private |
Setup the collection blocks before unpacking.
Definition at line 106 of file LCEventLazyImpl.cc.
References _blocks, IMPL::LCEventImpl::_colMap, _eventHandlerMgr, std::map< K, T >::begin(), std::map< K, T >::end(), and SIO::SIOHandlerMgr::getHandler().
Referenced by setBuffer().
|
virtual |
Returns the collection for the given name and transfers the ownership of the collection to the caller.
The caller is responsible for deleting the collection after the Event is deleted. The collection is still in the event but flagged as transient after the call returns.
This is usefull when you want to keep the collection for the next events.
Use with care! Triggers the event unpacking
DataNotAvailableException |
Reimplemented from IMPL::LCEventImpl.
Definition at line 24 of file LCEventLazyImpl.cc.
References unpackEvent().
|
private |
Unpack the event record.
Definition at line 52 of file LCEventLazyImpl.cc.
References _blocks, _recordBuffer, _recordInfo, _unpacked, and postProcessEvent().
Referenced by getCollection(), and takeCollection().
|
private |
Definition at line 83 of file LCEventLazyImpl.h.
Referenced by removeCollection(), setupBlocks(), and unpackEvent().
|
private |
Definition at line 85 of file LCEventLazyImpl.h.
Referenced by setupBlocks().
|
private |
Definition at line 81 of file LCEventLazyImpl.h.
Referenced by setBuffer(), and unpackEvent().
|
private |
Definition at line 82 of file LCEventLazyImpl.h.
Referenced by setBuffer(), and unpackEvent().
|
private |
Definition at line 84 of file LCEventLazyImpl.h.
Referenced by unpackEvent().