Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

IMPL::LCCollectionVec Class Reference

#include <LCCollectionVec.h>

Inheritance diagram for IMPL::LCCollectionVec:

EVENT::LCCollection IMPL::AccessChecked IOIMPL::LCCollectionIOVec List of all members.

Public Member Functions

 LCCollectionVec (const std::string &type)
virtual ~LCCollectionVec ()
virtual int getNumberOfElements () const
virtual const std::string & getTypeName () const
virtual EVENT::LCObjectgetElementAt (int index) const
virtual int getFlag () const
virtual bool isTransient () const
void setTransient (bool val=true)
virtual bool isDefault () const
void setDefault (bool val=true)
virtual bool isSubset () const
void setSubset (bool val=true)
void setFlag (int flag)
virtual void addElement (EVENT::LCObject *obj) throw (EVENT::ReadOnlyException)
virtual void removeElementAt (int i) throw (EVENT::ReadOnlyException)
virtual const EVENT::LCParametersgetParameters () const
virtual EVENT::LCParametersparameters ()
virtual void addElement (LCObject *obj)=0 throw (ReadOnlyException, std::exception )
virtual int simpleUID () const

Static Public Attributes

const int BITTransient = 16
const int BITDefault = 17
const int BITSubset = 18

Protected Member Functions

 LCCollectionVec ()
void setReadOnly (bool readOnly)
void checkAccess () throw ( EVENT::ReadOnlyException )
void checkAccess (const char *what) throw ( EVENT::ReadOnlyException )

Protected Attributes

std::string _typeName
int _flag
LCParametersImpl _params
bool _readOnly
int _id

Detailed Description

Implementation of the LCCollection using (inheriting from) an STL vector of LCObjects.

Author:
gaede
Version:
Id
LCCollectionVec.h,v 1.11 2005/04/15 08:37:37 gaede Exp
See also:
LCObject

LCCollection

Definition at line 26 of file LCCollectionVec.h.


Constructor & Destructor Documentation

IMPL::LCCollectionVec::LCCollectionVec  )  [inline, protected]
 

Default Constructor is protected - every LCCollection needs to know the type of its elements.

Definition at line 33 of file LCCollectionVec.h.

IMPL::LCCollectionVec::LCCollectionVec const std::string &  type  ) 
 

The public default constructur that takes the name of the type of the elements.

Definition at line 16 of file LCCollectionVec.cc.

IMPL::LCCollectionVec::~LCCollectionVec  )  [virtual]
 

Destructor.

Definition at line 54 of file LCCollectionVec.cc.

References isSubset().


Member Function Documentation

virtual void EVENT::LCCollection::addElement LCObject obj  )  throw (ReadOnlyException, std::exception ) [pure virtual, inherited]
 

Adds the given element to (end of) the collection. Throws an exception if the collection (event) is 'read only'.

Exceptions:
ReadOnlyException 

void IMPL::LCCollectionVec::addElement EVENT::LCObject obj  )  throw (EVENT::ReadOnlyException) [virtual]
 

Adds the given element to (end of) the collection. Throws an exception if the collection (event) is 'read only'.

Exceptions:
ReadOnlyException 

Definition at line 124 of file LCCollectionVec.cc.

Referenced by UTIL::LCRelationNavigator::createLCCollection(), and marlin::SimpleFastMCProcessor::processEvent().

void IMPL::AccessChecked::checkAccess const char *  what  )  throw ( EVENT::ReadOnlyException ) [protected, inherited]
 

Definition at line 20 of file AccessChecked.cc.

void IMPL::AccessChecked::checkAccess  )  throw ( EVENT::ReadOnlyException ) [protected, inherited]
 

Definition at line 16 of file AccessChecked.cc.

Referenced by IMPL::TrackerRawDataImpl::adcValues(), IMPL::ReconstructedParticleImpl::addCluster(), IMPL::ClusterImpl::addCluster(), IMPL::MCParticleImpl::addDaughter(), IMPL::SimCalorimeterHitImpl::addMCParticleContribution(), IMPL::VertexImpl::addParameter(), IMPL::ParticleIDImpl::addParameter(), IMPL::MCParticleImpl::addParent(), IMPL::ReconstructedParticleImpl::addParticle(), IMPL::ReconstructedParticleImpl::addParticleID(), IMPL::ClusterImpl::addParticleID(), IMPL::TrackImpl::addTrack(), IMPL::ReconstructedParticleImpl::addTrack(), IMPL::TrackerDataImpl::chargeValues(), IMPL::TrackerHitImpl::rawHits(), IMPL::TrackerRawDataImpl::setADCValues(), IMPL::VertexImpl::setAlgorithmType(), IMPL::ParticleIDImpl::setAlgorithmType(), IMPL::RawCalorimeterHitImpl::setAmplitude(), IMPL::VertexImpl::setAssociatedParticle(), IMPL::TPCHitImpl::setCellID(), IMPL::SimTrackerHitImpl::setCellID(), IMPL::TrackerRawDataImpl::setCellID0(), IMPL::TrackerPulseImpl::setCellID0(), IMPL::TrackerDataImpl::setCellID0(), IMPL::SimCalorimeterHitImpl::setCellID0(), IMPL::RawCalorimeterHitImpl::setCellID0(), IMPL::CalorimeterHitImpl::setCellID0(), IMPL::TrackerRawDataImpl::setCellID1(), IMPL::TrackerPulseImpl::setCellID1(), IMPL::TrackerDataImpl::setCellID1(), IMPL::SimCalorimeterHitImpl::setCellID1(), IMPL::RawCalorimeterHitImpl::setCellID1(), IMPL::CalorimeterHitImpl::setCellID1(), IMPL::TrackerPulseImpl::setCharge(), IMPL::TPCHitImpl::setCharge(), IMPL::ReconstructedParticleImpl::setCharge(), IMPL::MCParticleImpl::setCharge(), IMPL::TrackerDataImpl::setChargeValues(), IMPL::VertexImpl::setChi2(), IMPL::TrackImpl::setChi2(), IMPL::VertexImpl::setCovMatrix(), IMPL::TrackImpl::setCovMatrix(), IMPL::TrackerHitImpl::setCovMatrix(), IMPL::ReconstructedParticleImpl::setCovMatrix(), IMPL::TrackImpl::setD0(), IMPL::TrackImpl::setdEdx(), IMPL::TrackerHitImpl::setdEdx(), IMPL::SimTrackerHitImpl::setdEdx(), IMPL::TrackImpl::setdEdxError(), IMPL::LCRunHeaderImpl::setDescription(), IMPL::LCRunHeaderImpl::setDetectorName(), IMPL::LCEventImpl::setDetectorName(), IMPL::ClusterImpl::setDirectionError(), IMPL::MCParticleImpl::setEndpoint(), IMPL::SimCalorimeterHitImpl::setEnergy(), IMPL::ReconstructedParticleImpl::setEnergy(), IMPL::ClusterImpl::setEnergy(), IMPL::CalorimeterHitImpl::setEnergy(), IMPL::LCEventImpl::setEventNumber(), IMPL::MCParticleImpl::setGeneratorStatus(), IMPL::ReconstructedParticleImpl::setGoodnessOfPID(), IMPL::ClusterImpl::setIPhi(), IMPL::TrackImpl::setIsReferencePointPCA(), IMPL::ClusterImpl::setITheta(), IMPL::ParticleIDImpl::setLikelihood(), IMPL::ReconstructedParticleImpl::setMass(), IMPL::MCParticleImpl::setMass(), IMPL::SimTrackerHitImpl::setMCParticle(), IMPL::SimTrackerHitImpl::setMomentum(), IMPL::ReconstructedParticleImpl::setMomentum(), IMPL::MCParticleImpl::setMomentum(), IMPL::TrackImpl::setNdf(), IMPL::TrackImpl::setOmega(), IMPL::ReconstructedParticleImpl::setParticleIDUsed(), IMPL::SimTrackerHitImpl::setPathLength(), IMPL::ParticleIDImpl::setPDG(), IMPL::MCParticleImpl::setPDG(), IMPL::TrackImpl::setPhi(), IMPL::VertexImpl::setPosition(), IMPL::TrackerHitImpl::setPosition(), IMPL::SimTrackerHitImpl::setPosition(), IMPL::SimCalorimeterHitImpl::setPosition(), IMPL::ClusterImpl::setPosition(), IMPL::CalorimeterHitImpl::setPosition(), IMPL::ClusterImpl::setPositionError(), IMPL::VertexImpl::setPrimary(), IMPL::VertexImpl::setProbability(), IMPL::TrackerPulseImpl::setQuality(), IMPL::TPCHitImpl::setQuality(), IMPL::TrackerPulseImpl::setQualityBit(), IMPL::TrackImpl::setRadiusOfInnermostHit(), IMPL::TPCHitImpl::setRawData(), IMPL::CalorimeterHitImpl::setRawHit(), IMPL::TrackImpl::setReferencePoint(), IMPL::ReconstructedParticleImpl::setReferencePoint(), IMPL::LCRunHeaderImpl::setRunNumber(), IMPL::LCEventImpl::setRunNumber(), IMPL::ClusterImpl::setShape(), IMPL::MCParticleImpl::setSimulatorStatus(), IMPL::ReconstructedParticleImpl::setStartVertex(), IMPL::TrackImpl::setTanLambda(), IMPL::TrackerRawDataImpl::setTime(), IMPL::TrackerPulseImpl::setTime(), IMPL::TrackerHitImpl::setTime(), IMPL::TrackerDataImpl::setTime(), IMPL::TPCHitImpl::setTime(), IMPL::SimTrackerHitImpl::setTime(), IMPL::MCParticleImpl::setTime(), IMPL::CalorimeterHitImpl::setTime(), IMPL::RawCalorimeterHitImpl::setTimeStamp(), IMPL::LCEventImpl::setTimeStamp(), IMPL::TrackerPulseImpl::setTrackerData(), IMPL::TrackImpl::setType(), IMPL::TrackerHitImpl::setType(), IMPL::ReconstructedParticleImpl::setType(), IMPL::ParticleIDImpl::setType(), IMPL::ClusterImpl::setType(), IMPL::CalorimeterHitImpl::setType(), IMPL::TrackImpl::setTypeBit(), IMPL::ClusterImpl::setTypeBit(), IMPL::LCParametersImpl::setValue(), IMPL::LCParametersImpl::setValues(), IMPL::MCParticleImpl::setVertex(), IMPL::TrackImpl::setZ0(), IMPL::ClusterImpl::subdetectorEnergies(), and IMPL::TrackImpl::subdetectorHitNumbers().

EVENT::LCObject * IMPL::LCCollectionVec::getElementAt int  index  )  const [virtual]
 

Returns pointer to element at index - no range check !.

Implements EVENT::LCCollection.

Definition at line 81 of file LCCollectionVec.cc.

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

int IMPL::LCCollectionVec::getFlag  )  const [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()

Implements EVENT::LCCollection.

Definition at line 114 of file LCCollectionVec.cc.

Referenced by marlin::LCIOOutputProcessor::dropCollections().

int IMPL::LCCollectionVec::getNumberOfElements  )  const [virtual]
 

Returns the number of entries in the collection.

Implements EVENT::LCCollection.

Definition at line 70 of file LCCollectionVec.cc.

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

Parameters defined for this run.

Implements EVENT::LCCollection.

Definition at line 138 of file LCCollectionVec.h.

const std::string & IMPL::LCCollectionVec::getTypeName  )  const [virtual]
 

Returns the type name of the collection - valid names are defined in LCIO.

Implements EVENT::LCCollection.

Definition at line 75 of file LCCollectionVec.cc.

Referenced by marlin::LCIOOutputProcessor::dropCollections().

bool IMPL::LCCollectionVec::isDefault  )  const [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.

Implements EVENT::LCCollection.

Definition at line 95 of file LCCollectionVec.cc.

References _flag.

bool IMPL::LCCollectionVec::isSubset  )  const [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.

Implements EVENT::LCCollection.

Definition at line 104 of file LCCollectionVec.cc.

References _flag.

Referenced by ~LCCollectionVec().

bool IMPL::LCCollectionVec::isTransient  )  const [virtual]
 

True if collection is transient, i.e. will not be written to any LCIO file. Convenient method that checks bit 16 of the flag word.

Implements EVENT::LCCollection.

Definition at line 85 of file LCCollectionVec.cc.

References _flag.

virtual EVENT::LCParameters& IMPL::LCCollectionVec::parameters  )  [inline, virtual]
 

Parameters defined for this run.

Implements EVENT::LCCollection.

Definition at line 142 of file LCCollectionVec.h.

Referenced by UTIL::LCRelationNavigator::createLCCollection().

void IMPL::LCCollectionVec::removeElementAt int  i  )  throw (EVENT::ReadOnlyException) [virtual]
 

Removes the i-th element from the collection. Throws an exception if the collection (event) is 'read only'.

Exceptions:
ReadOnlyException 

Implements EVENT::LCCollection.

Definition at line 132 of file LCCollectionVec.cc.

void IMPL::LCCollectionVec::setDefault bool  val = true  ) 
 

Sets the default flag for this collection. User need to make sure this flag is unique for a type.

Definition at line 99 of file LCCollectionVec.cc.

References _flag.

Referenced by marlin::SimpleFastMCProcessor::processEvent().

void IMPL::LCCollectionVec::setFlag int  flag  )  [virtual]
 

Sets the flag word for this collection.

Implements EVENT::LCCollection.

Definition at line 119 of file LCCollectionVec.cc.

References _flag.

Referenced by UTIL::LCRelationNavigator::createLCCollection(), and marlin::LCIOOutputProcessor::dropCollections().

void IMPL::LCCollectionVec::setReadOnly bool  readOnly  )  [protected, virtual]
 

Reimplemented from IMPL::AccessChecked.

Definition at line 41 of file LCCollectionVec.cc.

References IMPL::AccessChecked::setReadOnly().

void IMPL::LCCollectionVec::setSubset bool  val = true  ) 
 

Sets the subset flag for this collection. Collections of subsets are only written as pointers to LCIO files, i.e. the objects have to exist in another non-transient collections.
NB: Do not add any 'real' objects to a collection flagged as subset, as this will lead to memory leaks !

Definition at line 108 of file LCCollectionVec.cc.

References _flag.

void IMPL::LCCollectionVec::setTransient bool  val = true  ) 
 

Sets the transient flag for this collection. Transient collections are not written to LCIO files.

Definition at line 89 of file LCCollectionVec.cc.

References _flag.

Referenced by marlin::LCIOOutputProcessor::dropCollections(), and IMPL::LCEventImpl::takeCollection().

virtual int IMPL::AccessChecked::simpleUID  )  const [inline, virtual, inherited]
 

Definition at line 24 of file AccessChecked.h.


Member Data Documentation

int IMPL::LCCollectionVec::_flag [protected]
 

Definition at line 149 of file LCCollectionVec.h.

Referenced by isDefault(), isSubset(), isTransient(), setDefault(), setFlag(), setSubset(), and setTransient().

int IMPL::AccessChecked::_id [protected, inherited]
 

Definition at line 34 of file AccessChecked.h.

Referenced by IMPL::AccessChecked::AccessChecked().

LCParametersImpl IMPL::LCCollectionVec::_params [protected]
 

Definition at line 150 of file LCCollectionVec.h.

bool IMPL::AccessChecked::_readOnly [protected, inherited]
 

Definition at line 33 of file AccessChecked.h.

Referenced by IMPL::AccessChecked::setReadOnly().

std::string IMPL::LCCollectionVec::_typeName [protected]
 

Definition at line 148 of file LCCollectionVec.h.

const int EVENT::LCCollection::BITDefault = 17 [static, inherited]
 

Definition at line 69 of file LCCollection.h.

const int EVENT::LCCollection::BITSubset = 18 [static, inherited]
 

Definition at line 70 of file LCCollection.h.

const int EVENT::LCCollection::BITTransient = 16 [static, inherited]
 

Transient bit in flag word.

Definition at line 68 of file LCCollection.h.


The documentation for this class was generated from the following files:
Generated on Sun Jun 3 06:32:25 2007 for A TPC Tracking Environment by  doxygen 1.3.9.1