LCIO
02.17
|
Implementation of the main event class. More...
#include <LCEventImpl.h>
Public Member Functions | |
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 EVENT::LCCollection * | getCollection (const std::string &name) const |
Returns the collection for the given name. More... | |
virtual 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... | |
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 void | removeCollection (const std::string &name) |
Removes (and deletes) the collection with name (if it exists in the event). 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 |
Protected Member Functions | |
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) |
Protected Attributes | |
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} |
Additional Inherited Members | |
![]() | |
static std::atomic_int | _lCObjectId |
Implementation of the main event class.
This is used by LCIO for reading events from file.
Definition at line 31 of file LCEventImpl.h.
IMPL::LCEventImpl::LCEventImpl | ( | ) |
Definition at line 17 of file LCEventImpl.cc.
|
virtual |
Copy contructor, creates a deep copy of the event.
Not yet - needs pointer chasing ...Destructor.
Definition at line 25 of file LCEventImpl.cc.
References _colMap, _notOwned, std::map< K, T >::begin(), std::set< K >::end(), std::map< K, T >::end(), and std::set< K >::find().
|
virtual |
Adds a collection with the given name (has to be a valid C/C++ variable name).
Throws an exception if the name already
exists in the event. NB: Adding collections is allowed even when the event is 'read only'.
EventException |
Implements EVENT::LCEvent.
Definition at line 107 of file LCEventImpl.cc.
References _colMap, std::string::c_str(), std::map< K, T >::end(), std::map< K, T >::find(), and validateCollectionName().
Referenced by UTIL::LCStdHepRdr::updateNextEvent(), and UTIL::LCStdHepRdrNew::updateNextEvent().
|
virtual |
Returns the collection for the given name.
DataNotAvailableException |
Implements EVENT::LCEvent.
Reimplemented in IOIMPL::LCEventLazyImpl.
Definition at line 71 of file LCEventImpl.cc.
References _colMap, std::map< K, T >::end(), std::map< K, T >::find(), and std::stringstream::str().
Referenced by takeCollection().
|
virtual |
Returns the names of the collections in the event.
Implements EVENT::LCEvent.
Definition at line 60 of file LCEventImpl.cc.
References _colMap, _colNames, std::map< K, T >::begin(), std::vector< T >::clear(), std::map< K, T >::end(), and std::vector< T >::push_back().
Referenced by IOIMPL::LCEventLazyImpl::postProcessEvent().
|
virtual |
Returns the name of the detector setup used in the simulation.
Implements EVENT::LCEvent.
Definition at line 45 of file LCEventImpl.cc.
References _detectorName.
|
virtual |
Returns this event's number .
Implements EVENT::LCEvent.
Definition at line 40 of file LCEventImpl.cc.
References _eventNumber.
|
inlinevirtual |
Returns the names of the relations in the event.
Returns the relation for the given name.
DataNotAvailableException | Adds a relation with the given name. Throws an exception if the name already exists in the event. NB: Adding relations is allowed even when the event is 'read only'. |
EventException | Removes (and deletes) the relation 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. |
ReadOnlyExceptionParameters | defined for this event. |
Implements EVENT::LCEvent.
Definition at line 131 of file LCEventImpl.h.
References _params.
|
virtual |
Return the run number off this event.
Implements EVENT::LCEvent.
Definition at line 35 of file LCEventImpl.cc.
References _runNumber.
|
virtual |
Returns the time stamp of the event.
Implements EVENT::LCEvent.
Definition at line 50 of file LCEventImpl.cc.
References _timeStamp.
|
virtual |
Returns the event weight.
Implements EVENT::LCEvent.
Definition at line 54 of file LCEventImpl.cc.
References _params, EVT_WGT, and IMPL::LCParametersImpl::getFloatVal().
|
inlinevirtual |
Parameters defined for this run.
Implements EVENT::LCEvent.
Definition at line 135 of file LCEventImpl.h.
References _params.
Referenced by UTIL::LCStdHepRdr::updateNextEvent(), and UTIL::LCStdHepRdrNew::updateNextEvent().
|
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 |
Implements EVENT::LCEvent.
Reimplemented in IOIMPL::LCEventLazyImpl.
Definition at line 134 of file LCEventImpl.cc.
References _colMap, IMPL::AccessChecked::checkAccess(), and std::map< K, T >::erase().
|
inlinevirtual |
Get the runtime extensions for this event.
Implements EVENT::LCEvent.
Definition at line 139 of file LCEventImpl.h.
References _runtime.
|
protected |
Definition at line 174 of file LCEventImpl.cc.
References _colMap, std::map< K, T >::begin(), std::map< K, T >::end(), and IMPL::AccessChecked::setReadOnly().
void IMPL::LCEventImpl::setDetectorName | ( | const std::string & | dn | ) |
Sets the detector name.
Definition at line 156 of file LCEventImpl.cc.
References _detectorName, and IMPL::AccessChecked::checkAccess().
void IMPL::LCEventImpl::setEventNumber | ( | int | en | ) |
Sets the event number.
Definition at line 150 of file LCEventImpl.cc.
References _eventNumber, and IMPL::AccessChecked::checkAccess().
Referenced by UTIL::LCStdHepRdrNew::updateNextEvent().
void IMPL::LCEventImpl::setRunNumber | ( | int | rn | ) |
Sets the run number.
Definition at line 144 of file LCEventImpl.cc.
References _runNumber, and IMPL::AccessChecked::checkAccess().
void IMPL::LCEventImpl::setTimeStamp | ( | EVENT::long64 | ts | ) |
Sets the event time stamp.
Definition at line 162 of file LCEventImpl.cc.
References _timeStamp, and IMPL::AccessChecked::checkAccess().
void IMPL::LCEventImpl::setWeight | ( | double | w | ) |
Set the event weight.
Definition at line 168 of file LCEventImpl.cc.
References _params, IMPL::AccessChecked::checkAccess(), EVT_WGT, and IMPL::LCParametersImpl::setValue().
Referenced by UTIL::LCStdHepRdr::updateNextEvent(), and UTIL::LCStdHepRdrNew::updateNextEvent().
|
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!
DataNotAvailableException |
Implements EVENT::LCEvent.
Reimplemented in IOIMPL::LCEventLazyImpl.
Definition at line 92 of file LCEventImpl.cc.
References _notOwned, getCollection(), std::set< K >::insert(), and IMPL::LCCollectionVec::setTransient().
|
protected |
Tests the validity of a collection name.
LCIO only accepts collection names starting with (regular expression) [A-Za-z_] and continuing with A-Za-z0-9_.
SIO only accepts names starting with (regular expression) [A-Za-z_] and continuing with A-Za-z0-9_.
Definition at line 195 of file LCEventImpl.cc.
Referenced by addCollection().
|
mutableprotected |
Definition at line 180 of file LCEventImpl.h.
Referenced by addCollection(), getCollection(), getCollectionNames(), removeCollection(), setAccessMode(), IOIMPL::LCEventLazyImpl::setupBlocks(), and ~LCEventImpl().
|
mutableprotected |
Definition at line 181 of file LCEventImpl.h.
Referenced by getCollectionNames().
|
protected |
Definition at line 177 of file LCEventImpl.h.
Referenced by getDetectorName(), and setDetectorName().
|
protected |
Definition at line 175 of file LCEventImpl.h.
Referenced by getEventNumber(), and setEventNumber().
|
mutableprotected |
Definition at line 186 of file LCEventImpl.h.
Referenced by takeCollection(), and ~LCEventImpl().
|
protected |
Definition at line 183 of file LCEventImpl.h.
Referenced by getParameters(), getWeight(), parameters(), and setWeight().
|
protected |
Definition at line 174 of file LCEventImpl.h.
Referenced by getRunNumber(), and setRunNumber().
|
protected |
Definition at line 188 of file LCEventImpl.h.
Referenced by runtime().
|
protected |
Definition at line 176 of file LCEventImpl.h.
Referenced by getTimeStamp(), and setTimeStamp().