LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | List of all members
EVENT::LCCollection Class Referenceabstract

The generic collection used in LCIO. More...

#include <LCCollection.h>

+ Inheritance diagram for EVENT::LCCollection:

Public Member Functions

virtual ~LCCollection ()
 Destructor. More...
 
virtual int getNumberOfElements () const =0
 Returns the number of elements in the collection. More...
 
virtual const std::stringgetTypeName () const =0
 Returns the type name of the collection - valid names are defined in LCIO. More...
 
virtual LCObjectgetElementAt (int index) const =0
 Returns pointer to element at index - no range check, use getNumberOfEntries(). More...
 
virtual int getFlag () const =0
 Returns flag word for collection. More...
 
virtual bool isTransient () const =0
 True if collection is transient, i.e. More...
 
virtual bool isDefault () const =0
 True if collection is the default collection for the given type. More...
 
virtual bool isSubset () const =0
 True if the collection holds a subset of objects from other collections. More...
 
virtual void addElement (LCObject *obj)=0
 Adds the given element to (end of) the collection. More...
 
virtual void removeElementAt (int i)=0
 Removes the i-th element from the collection. More...
 
virtual void setFlag (int flag)=0
 Set the flag word. More...
 
virtual const LCParametersgetParameters () const =0
 Parameters defined for this collection. More...
 
virtual LCParametersparameters ()=0
 Parameters defined for this collection. More...
 

Static Public Attributes

static const int BITTransient = 16
 Transient bit in flag word. More...
 
static const int BITDefault = 17
 
static const int BITSubset = 18
 

Detailed Description

The generic collection used in LCIO.

Holds arbitrary objects of type LCObject.

Author
gaede
Version
Id:
LCCollection.aid,v 1.11 2005-03-02 16:22:58 gaede Exp
See Also
LCObject
LCIO

Definition at line 29 of file LCCollection.h.

Constructor & Destructor Documentation

virtual EVENT::LCCollection::~LCCollection ( )
inlinevirtual

Destructor.

Definition at line 33 of file LCCollection.h.

Member Function Documentation

virtual void EVENT::LCCollection::addElement ( LCObject obj)
pure virtual

Adds the given element to (end of) the collection.

Throws an exception if the collection (event) is 'read only'.

Exceptions
ReadOnlyException

Implemented in IMPL::LCCollectionVec.

virtual LCObject* EVENT::LCCollection::getElementAt ( int  index) const
pure virtual
virtual int EVENT::LCCollection::getFlag ( ) const
pure virtual

Returns flag word for collection.

Bits 16-31 are reserved for LCIO Depending on the object type stored they have a special meaning, e.g. for SimCalorimeterHits:
CHBIT_LONG = 31 - store position
CHBIT_BARREL = 30 - endcap or barrel
CHBIT_ID1 = 29 - cellid1 is sored
CHBIT_PDG = 28 - store pdg of secondaries
 
Bit 16 is used to flag collection as transient
Bit 17 is used to flag collection as default
Bit 18 is used to flag collection as subset
Bits 0-15 are subdetector/user specific.

See Also
isTransient()

Implemented in IMPL::LCCollectionVec.

Referenced by UTIL::header(), SIO::SIOLCGenericObjectHandler::initWriting(), SIO::SIOObjectHandler::initWriting(), UTIL::operator<<(), UTIL::LCTOOLS::printCalorimeterHits(), UTIL::LCTOOLS::printClusters(), UTIL::LCTOOLS::printLCFloatVecs(), UTIL::LCTOOLS::printLCGenericObjects(), UTIL::LCTOOLS::printLCIntVecs(), UTIL::LCTOOLS::printLCStrVecs(), UTIL::LCTOOLS::printMCParticles(), UTIL::LCTOOLS::printRawCalorimeterHits(), UTIL::LCTOOLS::printReconstructedParticles(), UTIL::LCTOOLS::printRelation(), UTIL::LCTOOLS::printSimCalorimeterHits(), UTIL::LCTOOLS::printSimTrackerHits(), UTIL::LCTOOLS::printTPCHits(), UTIL::LCTOOLS::printTrackerData(), UTIL::LCTOOLS::printTrackerHitPlane(), UTIL::LCTOOLS::printTrackerHits(), UTIL::LCTOOLS::printTrackerHitZCylinder(), UTIL::LCTOOLS::printTrackerPulse(), UTIL::LCTOOLS::printTrackerRawData(), UTIL::LCTOOLS::printTracks(), SIO::SIOParticleHandler::restoreParentDaughterRelations(), and UTIL::CellIDEncoder< T >::setCellIDFlag().

virtual int EVENT::LCCollection::getNumberOfElements ( ) const
pure virtual
virtual const LCParameters& EVENT::LCCollection::getParameters ( ) const
pure virtual
virtual const std::string& EVENT::LCCollection::getTypeName ( ) const
pure virtual
virtual bool EVENT::LCCollection::isDefault ( ) const
pure virtual

True if collection is the default collection for the given type.

This implies that the collection is complete and unambigous. Convenient method that checks bit BITDefault of the flag word.

Implemented in IMPL::LCCollectionVec.

Referenced by UTIL::operator<<().

virtual bool EVENT::LCCollection::isSubset ( ) const
pure virtual

True if the collection holds a subset of objects from other collections.

If the collection is not transient only the pointers/references to the original objects will be stored. Convenient method that checks bit BITSubset of the flag word.

Implemented in IMPL::LCCollectionVec.

Referenced by UTIL::operator<<(), IOIMPL::LCEventLazyImpl::postProcessEvent(), and MT::LCReader::postProcessEvent().

virtual bool EVENT::LCCollection::isTransient ( ) const
pure virtual

True if collection is transient, i.e.

will not be written to any LCIO file. Convenient method that checks bit BITTransient of the flag word.

Implemented in IMPL::LCCollectionVec.

Referenced by UTIL::operator<<(), and SIO::SIOEventHandler::write().

virtual LCParameters& EVENT::LCCollection::parameters ( )
pure virtual
virtual void EVENT::LCCollection::removeElementAt ( int  i)
pure virtual

Removes the i-th element from the collection.

Throws an exception if the collection (event) is 'read only'.

Exceptions
ReadOnlyException

Implemented in IMPL::LCCollectionVec.

virtual void EVENT::LCCollection::setFlag ( int  flag)
pure virtual

Set the flag word.

This is allowed in 'read only' mode.

Implemented in IMPL::LCCollectionVec.

Referenced by SIO::SIOObjectHandler::initReading(), SIO::SIOLCGenericObjectHandler::initWriting(), and UTIL::CellIDEncoder< T >::setCellIDFlag().

Member Data Documentation

const int EVENT::LCCollection::BITDefault = 17
static
const int EVENT::LCCollection::BITSubset = 18
static
const int EVENT::LCCollection::BITTransient = 16
static

Transient bit in flag word.

Definition at line 68 of file LCCollection.h.

Referenced by IMPL::LCCollectionVec::isTransient(), and IMPL::LCCollectionVec::setTransient().


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