LCIO
02.17
|
Implementation of MCParticle. More...
#include <MCParticleImpl.h>
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) |
![]() | |
virtual | ~MCParticle () |
Destructor. More... | |
![]() | |
virtual | ~LCObject () |
Destructor. More... | |
virtual LCObject * | clone () const |
Returns an object id for internal (debugging) use in LCIO. More... | |
![]() | |
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... | |
![]() | |
AccessChecked () | |
virtual | ~AccessChecked () |
virtual int | simpleUID () const |
Protected Member Functions | |
void | addDaughter (EVENT::MCParticle *daughter) |
Adds a daughter particle - only called from addParent(). More... | |
![]() | |
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] |
![]() | |
bool | _readOnly {false} |
int | _id {-1} |
Additional Inherited Members | |
![]() | |
typedef MCParticle | lcobject_type |
Useful typedef for template programming with LCIO. More... | |
![]() | |
typedef std::type_index | ext_index |
typedef std::shared_ptr< void > | ext_type |
typedef std::map< ext_index, ext_type > | ext_map |
![]() | |
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 std::atomic_int | _lCObjectId |
Implementation of MCParticle.
Definition at line 24 of file MCParticleImpl.h.
IMPL::MCParticleImpl::MCParticleImpl | ( | ) |
Definition at line 32 of file MCParticleImpl.cc.
References _colorFlow, _endpoint, _p, _pEndpoint, _spin, and _vertex.
|
virtual |
|
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 | ) |
Adds a parent particle.
Definition at line 218 of file MCParticleImpl.cc.
References _parents, addDaughter(), std::vector< T >::begin(), IMPL::AccessChecked::checkAccess(), std::vector< T >::end(), std::find(), and std::vector< T >::push_back().
Referenced by UTIL::LCStdHepRdr::readEvent(), and UTIL::LCStdHepRdrNew::readEvent().
|
virtual |
Returns the particle's charge.
Implements EVENT::MCParticle.
Definition at line 198 of file MCParticleImpl.cc.
References _charge.
|
virtual |
Returns the color flow.
Implements EVENT::MCParticle.
Definition at line 167 of file MCParticleImpl.cc.
References _colorFlow.
|
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().
|
virtual |
Returns the i-th daughter of this particle.
Same as getDaughter() except for return type.
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().
|
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.
|
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().
|
virtual |
Returns the mass of the particle in [GeV].
Implements EVENT::MCParticle.
Definition at line 197 of file MCParticleImpl.cc.
References _mass.
|
virtual |
Returns the particle momentum at the production vertex.
Implements EVENT::MCParticle.
Definition at line 195 of file MCParticleImpl.cc.
References _p.
|
virtual |
Returns the particle momentum at the endpoint.
Implements EVENT::MCParticle.
Definition at line 196 of file MCParticleImpl.cc.
References _pEndpoint.
|
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().
|
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().
|
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:
Implements EVENT::MCParticle.
Definition at line 175 of file MCParticleImpl.cc.
References _simstatus, and std::bitset< Bits >::to_ulong().
|
virtual |
Returns the spin.
Implements EVENT::MCParticle.
Definition at line 163 of file MCParticleImpl.cc.
References _spin.
|
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.
|
virtual |
Returns the production vertex of the particle.
Implements EVENT::MCParticle.
Definition at line 193 of file MCParticleImpl.cc.
References _vertex.
Referenced by getEndpoint().
|
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.
|
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().
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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().
|
virtual |
Definition at line 319 of file MCParticleImpl.cc.
References _simstatus, and EVENT::MCParticle::BITCreatedInSimulation.
|
virtual |
Definition at line 323 of file MCParticleImpl.cc.
References _simstatus, and EVENT::MCParticle::BITDecayedInCalorimeter.
|
virtual |
Definition at line 322 of file MCParticleImpl.cc.
References _simstatus, and EVENT::MCParticle::BITDecayedInTracker.
void IMPL::MCParticleImpl::setEndpoint | ( | const double | pnt[3] | ) |
Sets the particle endpoint.
Definition at line 296 of file MCParticleImpl.cc.
References _endpoint, _simstatus, EVENT::MCParticle::BITEndpoint, IMPL::AccessChecked::checkAccess(), and std::bitset< Bits >::set().
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().
|
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().
|
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().
|
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().
|
virtual |
Definition at line 321 of file MCParticleImpl.cc.
References _simstatus, and EVENT::MCParticle::BITVertexIsNotEndpointOfParent.
|
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().
|
protected |
Definition at line 287 of file MCParticleImpl.h.
Referenced by getCharge(), and setCharge().
|
protected |
Definition at line 293 of file MCParticleImpl.h.
Referenced by getColorFlow(), MCParticleImpl(), and setColorFlow().
|
protected |
Definition at line 290 of file MCParticleImpl.h.
Referenced by addDaughter(), getDaughters(), getEndpoint(), and SIO::SIOParticleHandler::restoreParentDaughterRelations().
|
protected |
Definition at line 283 of file MCParticleImpl.h.
Referenced by getEndpoint(), MCParticleImpl(), and setEndpoint().
|
protected |
Definition at line 291 of file MCParticleImpl.h.
|
protected |
Definition at line 279 of file MCParticleImpl.h.
Referenced by getGeneratorStatus(), and setGeneratorStatus().
|
protected |
Definition at line 286 of file MCParticleImpl.h.
Referenced by getEnergy(), getMass(), and setMass().
|
protected |
Definition at line 285 of file MCParticleImpl.h.
Referenced by getEnergy(), getMomentum(), MCParticleImpl(), and setMomentum().
|
protected |
Definition at line 289 of file MCParticleImpl.h.
Referenced by addParent(), getParents(), and SIO::SIOParticleHandler::restoreParentDaughterRelations().
|
protected |
Definition at line 278 of file MCParticleImpl.h.
|
protected |
Definition at line 284 of file MCParticleImpl.h.
Referenced by getMomentumAtEndpoint(), MCParticleImpl(), and setMomentumAtEndpoint().
|
protected |
Definition at line 281 of file MCParticleImpl.h.
Referenced by getEndpoint(), getSimulatorStatus(), hasLeftDetector(), isBackscatter(), isCreatedInSimulation(), isDecayedInCalorimeter(), isDecayedInTracker(), isOverlay(), isStopped(), setBackscatter(), setCreatedInSimulation(), setDecayedInCalorimeter(), setDecayedInTracker(), setEndpoint(), setHasLeftDetector(), setOverlay(), setSimulatorStatus(), setStopped(), setVertexIsNotEndpointOfParent(), and vertexIsNotEndpointOfParent().
|
protected |
Definition at line 292 of file MCParticleImpl.h.
Referenced by getSpin(), MCParticleImpl(), and setSpin().
|
protected |
Definition at line 288 of file MCParticleImpl.h.
|
protected |
Definition at line 282 of file MCParticleImpl.h.
Referenced by getVertex(), MCParticleImpl(), and setVertex().