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

List of all members.

Public Member Functions

virtual ~LCEventImpl ()
 Copy contructor, creates a deep copy of the event.
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
 Returns the collection for the given name.
virtual EVENT::LCCollectiontakeCollection (const std::string &name) const
 Returns the collection for the given name and transfers the ownership of the collection to the caller.
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).
virtual void removeCollection (const std::string &name)
 Removes (and deletes) the collection with name (if it exists in the event).
virtual const EVENT::LCParametersgetParameters () const
 Returns the names of the relations in the event.
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.

Protected Member Functions

void setAccessMode (int accessMode)
bool validateCollectionName (const char *name)
 Tests the validity of a collection name.

Protected Attributes

int _runNumber
int _eventNumber
EVENT::long64 _timeStamp
std::string _detectorName

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 
) [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.

References validateCollectionName().

Referenced by UTIL::LCStdHepRdr::updateNextEvent().

LCCollection * IMPL::LCEventImpl::getCollection ( const std::string &  name  )  const [virtual]

Returns the collection for the given name.

Exceptions:
DataNotAvailableException 

Implements EVENT::LCEvent.

Referenced by takeCollection().

virtual const EVENT::LCParameters& IMPL::LCEventImpl::getParameters (  )  const [inline, virtual]

Returns the names of the relations in the event.

Returns the relation for the given name.

Exceptions:
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.
ReadOnlyException Parameters defined for this event.

Implements EVENT::LCEvent.

void IMPL::LCEventImpl::removeCollection ( const std::string &  name  )  [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 [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 getCollection(), and 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_] (C/C++ variable name).

SIO only accepts names starting with (regular expression) [A-Za-z_] and continuing with [A-Za-z0-9_] (C/C++ variable name).

Referenced by addCollection().


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Friends

Generated on 6 Mar 2020 for LCIO by  doxygen 1.6.1