LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IMPL::MCParticleImpl Class Reference

Implementation of MCParticle. More...

#include <MCParticleImpl.h>

+ Inheritance diagram for IMPL::MCParticleImpl:

Public Member Functions

 MCParticleImpl ()
 
virtual ~MCParticleImpl ()
 Copy c'tor. More...
 
virtual int id () const
 Returns an object id for internal (debugging) use in LCIO. More...
 
virtual const
EVENT::MCParticleVec
getParents () const
 Returns the parents of this particle. More...
 
virtual const
EVENT::MCParticleVec
getDaughters () const
 Returns the daughters of this particle. More...
 
virtual const double * getEndpoint () const
 Returns the i-th daughter of this particle. More...
 
virtual int getPDG () const
 Returns the number of daughters of this particle. More...
 
virtual int getGeneratorStatus () const
 Returns the status for particles from the generator
0 empty line
1 undecayed particle, stable in the generator
2 particle decayed in the generator
3 documentation line. More...
 
virtual int getSimulatorStatus () const
 Returns the status for particles from the simulation, e.g. More...
 
virtual bool isCreatedInSimulation () const
 True if the particle has been created by the simulation program (rather than the generator). More...
 
virtual bool isBackscatter () const
 True if the particle is the result of a backscatter from a calorimeter shower. More...
 
virtual bool vertexIsNotEndpointOfParent () const
 True if the particle's vertex is not the endpoint of the parent particle. More...
 
virtual bool isDecayedInTracker () const
 True if the particle has interacted in a tracking region. More...
 
virtual bool isDecayedInCalorimeter () const
 True if the particle has interacted in a calorimeter region. More...
 
virtual bool hasLeftDetector () const
 True if the particle has left the world volume undecayed. More...
 
virtual bool isStopped () const
 True if the particle has been stopped by the simulation program. More...
 
virtual bool isOverlay () const
 True if the particle has been overlayed by the simulation (or digitization) program. More...
 
virtual const double * getVertex () const
 Returns the production vertex of the particle. More...
 
virtual float getTime () const
 The creation time of the particle in [ns] wrt. More...
 
virtual const double * getMomentum () const
 Returns the particle momentum at the production vertex. More...
 
virtual const double * getMomentumAtEndpoint () const
 Returns the particle momentum at the endpoint. More...
 
virtual double getMass () const
 Returns the mass of the particle in [GeV]. More...
 
virtual float getCharge () const
 Returns the particle's charge. More...
 
virtual double getEnergy () const
 Returns the energy of the particle (at the vertex) in [GeV] computed from the particle's momentum and mass. More...
 
virtual const float * getSpin () const
 Returns the spin. More...
 
virtual const int * getColorFlow () const
 Returns the color flow. More...
 
void addParent (EVENT::MCParticle *mom)
 Adds a parent particle. More...
 
void setPDG (int pdg)
 Sets the parent. More...
 
void setGeneratorStatus (int status)
 Sets the Generator status. More...
 
void setSimulatorStatus (int status)
 Sets the Simulator status. More...
 
void setVertex (const double vtx[3])
 Sets the production vertex. More...
 
void setTime (float time)
 Sets the createion time. More...
 
void setEndpoint (const double pnt[3])
 Sets the particle endpoint. More...
 
void setMomentum (const float p[3])
 Sets the momentum. More...
 
void setMomentum (const double p[3])
 Sets the momentum. More...
 
void setMomentumAtEndpoint (const float p[3])
 Sets the momentum at the endpoint. More...
 
void setMomentumAtEndpoint (const double p[3])
 Sets the momentum at the endpoint. More...
 
void setMass (float m)
 Sets the mass. More...
 
void setCharge (float c)
 Sets the charge. More...
 
void setSpin (const float spin[3])
 Sets the spin. More...
 
void setColorFlow (const int cflow[2])
 Sets the color flow. More...
 
virtual void setCreatedInSimulation (bool val)
 
virtual void setBackscatter (bool val)
 
virtual void setVertexIsNotEndpointOfParent (bool val)
 
virtual void setDecayedInTracker (bool val)
 
virtual void setDecayedInCalorimeter (bool val)
 
virtual void setHasLeftDetector (bool val)
 
virtual void setStopped (bool val)
 
virtual void setOverlay (bool val)
 
- Public Member Functions inherited from EVENT::MCParticle
virtual ~MCParticle ()
 Destructor. More...
 
- Public Member Functions inherited from EVENT::LCObject
virtual ~LCObject ()
 Destructor. More...
 
virtual LCObjectclone () const
 Returns an object id for internal (debugging) use in LCIO. More...
 
- Public Member Functions inherited from lcrtrel::LCRTRelations
template<class V >
V::ext_type ext ()
 Provides access to an extension object - the type and ownership is defined by the class V which should be a subtype of LCExtension, LCOwnedExtension, LCExtensionVector, LCExtensionList,... More...
 
template<class V >
const V::ext_type ext () const
 Provides access to an extension object - the type and ownership is defined by the class V which should be a subtype of LCExtension, LCOwnedExtension, LCExtensionVector, LCExtensionList,... More...
 
template<class V >
V::rel_type rel ()
 Provides read access to relations - the object types and their connectivity are defined by the class V which has to be a subtype of either LC1To1Relation, LC1ToNRelation or LCNToNRelation. More...
 
- Public Member Functions inherited from IMPL::AccessChecked
 AccessChecked ()
 
virtual ~AccessChecked ()
 
virtual int simpleUID () const
 

Protected Member Functions

void addDaughter (EVENT::MCParticle *daughter)
 Adds a daughter particle - only called from addParent(). More...
 
- Protected Member Functions inherited from IMPL::AccessChecked
virtual void setReadOnly (bool readOnly)
 
void checkAccess ()
 
void checkAccess (const char *what)
 

Protected Attributes

int _pdg
 
int _genstatus
 
std::bitset< 32 > _simstatus
 
double _vertex [3]
 
double _endpoint [3]
 
double _pEndpoint [3]
 
double _p [3]
 
double _mass
 
float _charge
 
float _time
 
EVENT::MCParticleVec _parents
 
EVENT::MCParticleVec _daughters
 
bool _endpointSet
 
float _spin [3]
 
int _colorFlow [2]
 
- Protected Attributes inherited from IMPL::AccessChecked
bool _readOnly {false}
 
int _id {-1}
 

Additional Inherited Members

- Public Types inherited from EVENT::MCParticle
typedef MCParticle lcobject_type
 Useful typedef for template programming with LCIO. More...
 
- Public Types inherited from lcrtrel::LCRTRelations
typedef std::type_index ext_index
 
typedef std::shared_ptr< void > ext_type
 
typedef std::map< ext_index,
ext_type
ext_map
 
- Static Public Attributes inherited from EVENT::MCParticle
static const int BITEndpoint = 31
 
static const int BITCreatedInSimulation = 30
 
static const int BITBackscatter = 29
 
static const int BITVertexIsNotEndpointOfParent = 28
 
static const int BITDecayedInTracker = 27
 
static const int BITDecayedInCalorimeter = 26
 
static const int BITLeftDetector = 25
 
static const int BITStopped = 24
 
static const int BITOverlay = 23
 
- Static Protected Attributes inherited from IMPL::AccessChecked
static std::atomic_int _lCObjectId
 

Detailed Description

Implementation of MCParticle.

Author
gaede
Version
Id:
MCParticleImpl.h,v 1.24 2010-01-21 16:28:25 gaede Exp

Definition at line 24 of file MCParticleImpl.h.

Constructor & Destructor Documentation

IMPL::MCParticleImpl::MCParticleImpl ( )

Definition at line 32 of file MCParticleImpl.cc.

References _colorFlow, _endpoint, _p, _pEndpoint, _spin, and _vertex.

IMPL::MCParticleImpl::~MCParticleImpl ( )
virtual

Copy c'tor.

Destructor.

Definition at line 64 of file MCParticleImpl.cc.

Member Function Documentation

void IMPL::MCParticleImpl::addDaughter ( EVENT::MCParticle daughter)
protected

Adds a daughter particle - only called from addParent().

Definition at line 209 of file MCParticleImpl.cc.

References _daughters, IMPL::AccessChecked::checkAccess(), and std::vector< T >::push_back().

Referenced by addParent().

void IMPL::MCParticleImpl::addParent ( EVENT::MCParticle mom)
float IMPL::MCParticleImpl::getCharge ( ) const
virtual

Returns the particle's charge.

Implements EVENT::MCParticle.

Definition at line 198 of file MCParticleImpl.cc.

References _charge.

const int * IMPL::MCParticleImpl::getColorFlow ( ) const
virtual

Returns the color flow.

Implements EVENT::MCParticle.

Definition at line 167 of file MCParticleImpl.cc.

References _colorFlow.

const MCParticleVec & IMPL::MCParticleImpl::getDaughters ( ) const
virtual

Returns the daughters of this particle.

Implements EVENT::MCParticle.

Definition at line 71 of file MCParticleImpl.cc.

References _daughters.

Referenced by UTIL::LCStdHepRdr::readEvent(), UTIL::LCStdHepRdrNew::readEvent(), and SIO::SIOParticleHandler::restoreParentDaughterRelations().

const double * IMPL::MCParticleImpl::getEndpoint ( ) const
virtual

Returns the i-th daughter of this particle.

Same as getDaughter() except for return type.

See Also
getNumberOfDaughtersReturns the number of parents of this particle - 0 if mother.Returns the i-th parent of this particle.Returns the endpoint of the particle in [mm] - returns NULL if undefined (not set). Definition of the enpoint depends on the application that created the particle, e.g. the start point of the shower in a calorimeter.

Implements EVENT::MCParticle.

Definition at line 139 of file MCParticleImpl.cc.

References _daughters, _endpoint, _simstatus, EVENT::MCParticle::BITEndpoint, getVertex(), std::vector< T >::size(), std::bitset< Bits >::test(), and vertexIsNotEndpointOfParent().

double IMPL::MCParticleImpl::getEnergy ( ) const
virtual

Returns the energy of the particle (at the vertex) in [GeV] computed from the particle's momentum and mass.

Implements EVENT::MCParticle.

Definition at line 159 of file MCParticleImpl.cc.

References _mass, and _p.

int IMPL::MCParticleImpl::getGeneratorStatus ( ) const
virtual

Returns the status for particles from the generator
0 empty line
1 undecayed particle, stable in the generator
2 particle decayed in the generator
3 documentation line.

Implements EVENT::MCParticle.

Definition at line 173 of file MCParticleImpl.cc.

References _genstatus.

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

double IMPL::MCParticleImpl::getMass ( ) const
virtual

Returns the mass of the particle in [GeV].

Implements EVENT::MCParticle.

Definition at line 197 of file MCParticleImpl.cc.

References _mass.

const double * IMPL::MCParticleImpl::getMomentum ( ) const
virtual

Returns the particle momentum at the production vertex.

Implements EVENT::MCParticle.

Definition at line 195 of file MCParticleImpl.cc.

References _p.

const double * IMPL::MCParticleImpl::getMomentumAtEndpoint ( ) const
virtual

Returns the particle momentum at the endpoint.

Implements EVENT::MCParticle.

Definition at line 196 of file MCParticleImpl.cc.

References _pEndpoint.

const MCParticleVec & IMPL::MCParticleImpl::getParents ( ) const
virtual

Returns the parents of this particle.

Implements EVENT::MCParticle.

Definition at line 67 of file MCParticleImpl.cc.

References _parents.

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

int IMPL::MCParticleImpl::getPDG ( ) const
virtual

Returns the number of daughters of this particle.

Returns the PDG code of the particle.

Implements EVENT::MCParticle.

Definition at line 172 of file MCParticleImpl.cc.

References _pdg.

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

int IMPL::MCParticleImpl::getSimulatorStatus ( ) const
virtual

Returns the status for particles from the simulation, e.g.

decayed in flight. Bits 31-16 are used to decode the information. Use the followng boolean functions to determine the proper simulator status:

See Also
isCreatedInSimulation()
isBackscatter()
vertexIsNotEndpointOfParent()
isDecayedInTracker()
isDecayedInCalorimeter()
hasLeftDetector()
isStopped()
isOverlay()

Implements EVENT::MCParticle.

Definition at line 175 of file MCParticleImpl.cc.

References _simstatus, and std::bitset< Bits >::to_ulong().

const float * IMPL::MCParticleImpl::getSpin ( ) const
virtual

Returns the spin.

Implements EVENT::MCParticle.

Definition at line 163 of file MCParticleImpl.cc.

References _spin.

float IMPL::MCParticleImpl::getTime ( ) const
virtual

The creation time of the particle in [ns] wrt.

the event, e.g. for preassigned decays or decays in flight from the simulator.

Implements EVENT::MCParticle.

Definition at line 194 of file MCParticleImpl.cc.

References _time.

const double * IMPL::MCParticleImpl::getVertex ( ) const
virtual

Returns the production vertex of the particle.

Implements EVENT::MCParticle.

Definition at line 193 of file MCParticleImpl.cc.

References _vertex.

Referenced by getEndpoint().

bool IMPL::MCParticleImpl::hasLeftDetector ( ) const
virtual

True if the particle has left the world volume undecayed.

Implements EVENT::MCParticle.

Definition at line 187 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITLeftDetector.

virtual int IMPL::MCParticleImpl::id ( ) const
inlinevirtual

Returns an object id for internal (debugging) use in LCIO.

Implements EVENT::LCObject.

Definition at line 36 of file MCParticleImpl.h.

References IMPL::AccessChecked::simpleUID().

bool IMPL::MCParticleImpl::isBackscatter ( ) const
virtual

True if the particle is the result of a backscatter from a calorimeter shower.

Implements EVENT::MCParticle.

Definition at line 183 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITBackscatter.

bool IMPL::MCParticleImpl::isCreatedInSimulation ( ) const
virtual

True if the particle has been created by the simulation program (rather than the generator).

Implements EVENT::MCParticle.

Definition at line 182 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITCreatedInSimulation.

bool IMPL::MCParticleImpl::isDecayedInCalorimeter ( ) const
virtual

True if the particle has interacted in a calorimeter region.

Implements EVENT::MCParticle.

Definition at line 186 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITDecayedInCalorimeter.

bool IMPL::MCParticleImpl::isDecayedInTracker ( ) const
virtual

True if the particle has interacted in a tracking region.

Implements EVENT::MCParticle.

Definition at line 185 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITDecayedInTracker.

bool IMPL::MCParticleImpl::isOverlay ( ) const
virtual

True if the particle has been overlayed by the simulation (or digitization) program.

Implements EVENT::MCParticle.

Definition at line 189 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITOverlay.

bool IMPL::MCParticleImpl::isStopped ( ) const
virtual

True if the particle has been stopped by the simulation program.

Implements EVENT::MCParticle.

Definition at line 188 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITStopped.

void IMPL::MCParticleImpl::setBackscatter ( bool  val)
virtual

Definition at line 320 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITBackscatter.

void IMPL::MCParticleImpl::setCharge ( float  c)

Sets the charge.

Definition at line 291 of file MCParticleImpl.cc.

References _charge, and IMPL::AccessChecked::checkAccess().

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

void IMPL::MCParticleImpl::setColorFlow ( const int  cflow[2])

Sets the color flow.

Definition at line 313 of file MCParticleImpl.cc.

References _colorFlow, and IMPL::AccessChecked::checkAccess().

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

void IMPL::MCParticleImpl::setCreatedInSimulation ( bool  val)
virtual

Definition at line 319 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITCreatedInSimulation.

void IMPL::MCParticleImpl::setDecayedInCalorimeter ( bool  val)
virtual

Definition at line 323 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITDecayedInCalorimeter.

void IMPL::MCParticleImpl::setDecayedInTracker ( bool  val)
virtual

Definition at line 322 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITDecayedInTracker.

void IMPL::MCParticleImpl::setEndpoint ( const double  pnt[3])
void IMPL::MCParticleImpl::setGeneratorStatus ( int  status)

Sets the Generator status.

Definition at line 238 of file MCParticleImpl.cc.

References _genstatus, and IMPL::AccessChecked::checkAccess().

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

void IMPL::MCParticleImpl::setHasLeftDetector ( bool  val)
virtual

Definition at line 324 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITLeftDetector.

void IMPL::MCParticleImpl::setMass ( float  m)

Sets the mass.

Definition at line 287 of file MCParticleImpl.cc.

References _mass, and IMPL::AccessChecked::checkAccess().

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

void IMPL::MCParticleImpl::setMomentum ( const float  p[3])

Sets the momentum.

Definition at line 261 of file MCParticleImpl.cc.

References _p, and IMPL::AccessChecked::checkAccess().

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

void IMPL::MCParticleImpl::setMomentum ( const double  p[3])

Sets the momentum.

Definition at line 267 of file MCParticleImpl.cc.

References _p, and IMPL::AccessChecked::checkAccess().

void IMPL::MCParticleImpl::setMomentumAtEndpoint ( const float  p[3])

Sets the momentum at the endpoint.

Definition at line 274 of file MCParticleImpl.cc.

References _pEndpoint, and IMPL::AccessChecked::checkAccess().

void IMPL::MCParticleImpl::setMomentumAtEndpoint ( const double  p[3])

Sets the momentum at the endpoint.

Definition at line 280 of file MCParticleImpl.cc.

References _pEndpoint, and IMPL::AccessChecked::checkAccess().

void IMPL::MCParticleImpl::setOverlay ( bool  val)
virtual

Definition at line 326 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITOverlay.

void IMPL::MCParticleImpl::setPDG ( int  pdg)

Sets the parent.

Sets a second parent.Sets the PDG code.

Definition at line 234 of file MCParticleImpl.cc.

References _pdg, and IMPL::AccessChecked::checkAccess().

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

void IMPL::MCParticleImpl::setSimulatorStatus ( int  status)

Sets the Simulator status.

Definition at line 243 of file MCParticleImpl.cc.

References _simstatus, and IMPL::AccessChecked::checkAccess().

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

void IMPL::MCParticleImpl::setSpin ( const float  spin[3])

Sets the spin.

Definition at line 306 of file MCParticleImpl.cc.

References _spin, and IMPL::AccessChecked::checkAccess().

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

void IMPL::MCParticleImpl::setStopped ( bool  val)
virtual

Definition at line 325 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITStopped.

void IMPL::MCParticleImpl::setTime ( float  time)

Sets the createion time.

Definition at line 256 of file MCParticleImpl.cc.

References _time, and IMPL::AccessChecked::checkAccess().

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

void IMPL::MCParticleImpl::setVertex ( const double  vtx[3])

Sets the production vertex.

Definition at line 250 of file MCParticleImpl.cc.

References _vertex, and IMPL::AccessChecked::checkAccess().

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

void IMPL::MCParticleImpl::setVertexIsNotEndpointOfParent ( bool  val)
virtual
bool IMPL::MCParticleImpl::vertexIsNotEndpointOfParent ( ) const
virtual

True if the particle's vertex is not the endpoint of the parent particle.

Implements EVENT::MCParticle.

Definition at line 184 of file MCParticleImpl.cc.

References _simstatus, and EVENT::MCParticle::BITVertexIsNotEndpointOfParent.

Referenced by getEndpoint().

Member Data Documentation

float IMPL::MCParticleImpl::_charge
protected

Definition at line 287 of file MCParticleImpl.h.

Referenced by getCharge(), and setCharge().

int IMPL::MCParticleImpl::_colorFlow[2]
protected

Definition at line 293 of file MCParticleImpl.h.

Referenced by getColorFlow(), MCParticleImpl(), and setColorFlow().

EVENT::MCParticleVec IMPL::MCParticleImpl::_daughters
protected
double IMPL::MCParticleImpl::_endpoint[3]
protected

Definition at line 283 of file MCParticleImpl.h.

Referenced by getEndpoint(), MCParticleImpl(), and setEndpoint().

bool IMPL::MCParticleImpl::_endpointSet
protected

Definition at line 291 of file MCParticleImpl.h.

int IMPL::MCParticleImpl::_genstatus
protected

Definition at line 279 of file MCParticleImpl.h.

Referenced by getGeneratorStatus(), and setGeneratorStatus().

double IMPL::MCParticleImpl::_mass
protected

Definition at line 286 of file MCParticleImpl.h.

Referenced by getEnergy(), getMass(), and setMass().

double IMPL::MCParticleImpl::_p[3]
protected

Definition at line 285 of file MCParticleImpl.h.

Referenced by getEnergy(), getMomentum(), MCParticleImpl(), and setMomentum().

EVENT::MCParticleVec IMPL::MCParticleImpl::_parents
protected
int IMPL::MCParticleImpl::_pdg
protected

Definition at line 278 of file MCParticleImpl.h.

Referenced by getPDG(), and setPDG().

double IMPL::MCParticleImpl::_pEndpoint[3]
protected

Definition at line 284 of file MCParticleImpl.h.

Referenced by getMomentumAtEndpoint(), MCParticleImpl(), and setMomentumAtEndpoint().

std::bitset<32> IMPL::MCParticleImpl::_simstatus
protected
float IMPL::MCParticleImpl::_spin[3]
protected

Definition at line 292 of file MCParticleImpl.h.

Referenced by getSpin(), MCParticleImpl(), and setSpin().

float IMPL::MCParticleImpl::_time
protected

Definition at line 288 of file MCParticleImpl.h.

Referenced by getTime(), and setTime().

double IMPL::MCParticleImpl::_vertex[3]
protected

Definition at line 282 of file MCParticleImpl.h.

Referenced by getVertex(), MCParticleImpl(), and setVertex().


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