LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IMPL::LCEventImpl Class Reference

Implementation of the main event class. More...

#include <IMPL/LCEventImpl.h>

Inheritance diagram for IMPL::LCEventImpl:
EVENT::LCEvent IMPL::AccessChecked IOIMPL::LCEventIOImpl

Public Member Functions

virtual ~LCEventImpl ()
 Copy contructor, creates a deep copy of the event. More...
 
virtual int getRunNumber () const
 Return the run number off this event.
 
virtual int getEventNumber () const
 Returns this event's number .
 
virtual const std::string & getDetectorName () const
 Returns the name of the detector setup used in the simulation.
 
virtual EVENT::long64 getTimeStamp () const
 Returns the time stamp of the event.
 
virtual double getWeight () const
 Returns the event weight.
 
virtual const std::vector
< std::string > * 
getCollectionNames () const
 Returns the names of the collections in the event.
 
virtual EVENT::LCCollectiongetCollection (const std::string &name) const throw (EVENT::DataNotAvailableException, std::exception)
 Returns the collection for the given name. More...
 
virtual EVENT::LCCollectiontakeCollection (const std::string &name) const throw (EVENT::DataNotAvailableException, std::exception )
 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) throw (EVENT::EventException, std::exception)
 Adds a collection with the given name (has to be a valid C/C++ variable name). More...
 
virtual void removeCollection (const std::string &name) throw (EVENT::ReadOnlyException, std::exception)
 Removes (and deletes) the collection with name (if it exists in the event). More...
 
virtual const EVENT::LCParametersgetParameters () const
 Returns the names of the relations in the event. More...
 
virtual EVENT::LCParametersparameters ()
 Parameters defined for this run.
 
void setRunNumber (int rn)
 Sets the run number.
 
void setEventNumber (int en)
 Sets the event number.
 
void setDetectorName (const std::string &dn)
 Sets the detector name.
 
void setTimeStamp (EVENT::long64 ts)
 Sets the event time stamp.
 
void setWeight (double w)
 Set the event weight.
 
- Public Member Functions inherited from EVENT::LCEvent
virtual ~LCEvent ()
 Destructor.
 
- Public Member Functions inherited from IMPL::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...
 
- Protected Member Functions inherited from IMPL::AccessChecked
virtual void setReadOnly (bool readOnly)
 
void checkAccess () throw ( EVENT::ReadOnlyException )
 
void checkAccess (const char *what) throw ( EVENT::ReadOnlyException )
 

Protected Attributes

int _runNumber
 
int _eventNumber
 
EVENT::long64 _timeStamp
 
std::string _detectorName
 
LCCollectionMap _colMap
 
std::vector< std::string > _colNames
 
LCParametersImpl _params
 
LCCollectionSet _notOwned
 
- Protected Attributes inherited from IMPL::AccessChecked
bool _readOnly
 
int _id
 

Detailed Description

Implementation of the main event class.

This is used by LCIO for reading events from file.

Author
gaede
Version
Mar 5, 2003
See Also
LCEvent
LCCollection

Constructor & Destructor Documentation

IMPL::LCEventImpl::~LCEventImpl ( )
virtual

Copy contructor, creates a deep copy of the event.

Not yet - needs pointer chasing ...Destructor.

Member Function Documentation

void IMPL::LCEventImpl::addCollection ( EVENT::LCCollection col,
const std::string &  name 
)
throw (EVENT::EventException,
std::exception
)
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'.

See Also
validateCollectionName
Exceptions
EventException

Implements EVENT::LCEvent.

Referenced by UTIL::LCStdHepRdr::updateNextEvent(), and UTIL::LCStdHepRdrNew::updateNextEvent().

LCCollection * IMPL::LCEventImpl::getCollection ( const std::string &  name) const
throw (EVENT::DataNotAvailableException,
std::exception
)
virtual

Returns the collection for the given name.

Exceptions
DataNotAvailableException

Implements EVENT::LCEvent.

Referenced by HEPEVTIMPL::HEPEVT::fromHepEvt().

virtual const EVENT::LCParameters& IMPL::LCEventImpl::getParameters ( ) const
inlinevirtual

Returns the names of the relations in the event.

Returns the relation for the given name.

Exceptions
DataNotAvailableExceptionAdds 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'.
EventExceptionRemoves (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.
ReadOnlyExceptionParametersdefined for this event.

Implements EVENT::LCEvent.

void IMPL::LCEventImpl::removeCollection ( const std::string &  name)
throw (EVENT::ReadOnlyException,
std::exception
)
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.

Exceptions
ReadOnlyException

Implements EVENT::LCEvent.

LCCollection * IMPL::LCEventImpl::takeCollection ( const std::string &  name) const
throw (EVENT::DataNotAvailableException,
std::exception
)
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!

Exceptions
DataNotAvailableException

Implements EVENT::LCEvent.

References IMPL::LCCollectionVec::setTransient().

bool IMPL::LCEventImpl::validateCollectionName ( const char *  name)
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_.


The documentation for this class was generated from the following files: