Belle II Software  release-08-01-10
MCParticleGraph::GraphParticle Class Reference

Class to represent Particle data in graph. More...

#include <MCParticleGraph.h>

Inheritance diagram for MCParticleGraph::GraphParticle:
Collaboration diagram for MCParticleGraph::GraphParticle:

Public Types

enum  StatusBit {
  c_PrimaryParticle = 1 << 0 ,
  c_StableInGenerator = 1 << 1 ,
  c_LeftDetector = 1 << 2 ,
  c_StoppedInDetector = 1 << 3 ,
  c_IsVirtual = 1 << 4 ,
  c_Initial = 1 << 5 ,
  c_IsISRPhoton = 1 << 6 ,
  c_IsFSRPhoton = 1 << 7 ,
  c_IsPHOTOSPhoton = 1 << 8 ,
  c_IsRadiativePhoton = c_IsISRPhoton | c_IsFSRPhoton | c_IsPHOTOSPhoton
}
 Exception is thrown if the requested index for the last child is out of range. More...
 

Public Member Functions

GraphParticleoperator= (const MCParticle &particle)
 Assign the values of an existing MCParticle to this GraphParticle. More...
 
void decaysInto (GraphParticle &daughter)
 Tells the graph that this particle decays into daughter. More...
 
void comesFrom (GraphParticle &mother)
 Tells the graph that this particle is a decay product of mother. More...
 
void setFirstDaughter (int daughter)
 Set the 1-based index of the first daughter, 0 means no daughters. More...
 
void setLastDaughter (int daughter)
 Set the 1-based index of the last daughter, 0 means no daughters. More...
 
void setIgnore (bool ignore=true)
 Set or remove the ignore flag. More...
 
bool getIgnore () const
 Get the ignore flag. More...
 
void setTrackID (int trackID)
 Set the track ID for the particle. More...
 
int getTrackID () const
 Returns the track ID assigned to this MCParticle. More...
 
int getPDG () const
 Return PDG code of particle. More...
 
unsigned int getStatus (unsigned short int bitmask=USHRT_MAX) const
 Return status code of particle. More...
 
bool hasStatus (unsigned short int bitmask) const
 Return if specific status bit is set. More...
 
float getMass () const
 Return the particle mass in GeV. More...
 
float getCharge () const
 Return the particle charge defined in TDatabasePDG. More...
 
float getEnergy () const
 Return particle energy in GeV. More...
 
bool hasValidVertex () const
 Indication whether vertex and time information is useful or just default. More...
 
float getProductionTime () const
 Return production time in ns. More...
 
float getDecayTime () const
 Return the decay time in ns. More...
 
float getLifetime () const
 Return the lifetime in ns. More...
 
ROOT::Math::XYZVector getVertex () const
 Return production vertex position, shorthand for getProductionVertex(). More...
 
ROOT::Math::XYZVector getProductionVertex () const
 Return production vertex position. More...
 
ROOT::Math::XYZVector getMomentum () const
 Return momentum. More...
 
ROOT::Math::PxPyPzEVector get4Vector () const
 Return 4Vector of particle. More...
 
ROOT::Math::XYZVector getDecayVertex () const
 Return decay vertex. More...
 
int getIndex () const
 Get 1-based index of the particle in the corresponding MCParticle list. More...
 
int getArrayIndex () const
 Get 0-based index of the particle in the corresponding MCParticle list. More...
 
int getFirstDaughter () const
 Get 1-based index of first daughter, 0 if no daughters. More...
 
int getLastDaughter () const
 Get 1-based index of last daughter, 0 if no daughters. More...
 
std::vector< Belle2::MCParticle * > getDaughters () const
 Get vector of all daughter particles, empty vector if none. More...
 
const MCParticlegetDaughter (int i) const
 Return i-th daughter.
 
int getNDaughters () const
 Return number of daughter MCParticles.
 
MCParticlegetMother () const
 Returns a pointer to the mother particle. More...
 
int getSecondaryPhysicsProcess () const
 Returns the physics process type of a secondary particle. More...
 
Const::DetectorSet getSeenInDetector () const
 Return the seen-in flags of the entire Belle II subdetectors for an MC particle. More...
 
bool hasSeenInDetector (Const::DetectorSet set) const
 Return if the seen-in flag for a specific subdetector is set or not. More...
 
bool isVirtual () const
 Check if particle is virtual.
 
bool isInitial () const
 Check if particle is an initial particle such as ISR.
 
bool isPrimaryParticle () const
 Check if particle is a primary particle which was created by the generator (and not, for example material interaction)
 
void setPDG (int pdg)
 Set PDG code of the particle. More...
 
void setMassFromPDG ()
 Sets the mass for the particle from the particle's PDG code.
 
void setStatus (unsigned short int status)
 Set Status code for the particle. More...
 
void addStatus (unsigned short int bitmask)
 Add bitmask to current status. More...
 
void removeStatus (unsigned short int bitmask)
 Remove bitmask from current status. More...
 
void setMass (float mass)
 Set particle mass. More...
 
void setEnergy (float energy)
 Set energy. More...
 
void setValidVertex (bool valid)
 Set indication wether vertex and time information is valid or just default. More...
 
void setProductionTime (float time)
 Set production time. More...
 
void setDecayTime (float time)
 Set decay time. More...
 
void setProductionVertex (const ROOT::Math::XYZVector &vertex)
 Set production vertex position. More...
 
void setProductionVertex (float x, float y, float z)
 Set production vertex position. More...
 
void setMomentum (const ROOT::Math::XYZVector &momentum)
 Set particle momentum. More...
 
void setMomentum (float px, float py, float pz)
 Set particle momentum. More...
 
void set4Vector (const ROOT::Math::PxPyPzEVector &p4)
 Sets the 4Vector of particle. More...
 
void setDecayVertex (const ROOT::Math::XYZVector &vertex)
 Set decay vertex. More...
 
void setDecayVertex (float x, float y, float z)
 Set decay vertex. More...
 
void setSecondaryPhysicsProcess (int physicsProcess)
 Sets the physics process type of a secondary particle. More...
 
void setSeenInDetector (Const::DetectorSet set)
 Set the seen-in flags for the entire Belle II subdetectors for an Monte Carlo particle. More...
 
void addSeenInDetector (Const::DetectorSet set)
 Flag/Add a bit if the MC particle is seen in a specific subdetector. More...
 
void removeSeenInDetector (Const::DetectorSet set)
 Unflag/Remove the bit if the MC particle is not seen in a specific subdetector. More...
 
void fixParticleList () const
 Search the DataStore for the corresponding MCParticle array. More...
 
void setVirtual ()
 Set particle to virtual. More...
 
void setInitial ()
 Set particle to initial. More...
 
virtual std::string getName () const override
 Return name of this particle.
 
virtual std::string getInfoHTML () const override
 Return a short summary of this object's contents in HTML format.
 
const MCParticlegetParticleFromGeneralizedIndexString (const std::string &generalizedIndex) const
 Explores the decay tree of the MC particle and returns the (grand^n)daughter identified by a generalized index. More...
 
void addRelationTo (const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
 Add a relation from this object to another object (with caching). More...
 
void addRelationTo (const TObject *object, float weight=1.0, const std::string &namedRelation="") const
 Add a relation from this object to another object (no caching, can be quite slow). More...
 
void copyRelations (const RelationsInterface< BASE > *sourceObj)
 Copies all relations of sourceObj (pointing from or to sourceObj) to this object (including weights). More...
 
template<class TO >
RelationVector< TO > getRelationsTo (const std::string &name="", const std::string &namedRelation="") const
 Get the relations that point from this object to another store array. More...
 
template<class FROM >
RelationVector< FROM > getRelationsFrom (const std::string &name="", const std::string &namedRelation="") const
 Get the relations that point from another store array to this object. More...
 
template<class T >
RelationVector< T > getRelationsWith (const std::string &name="", const std::string &namedRelation="") const
 Get the relations between this object and another store array. More...
 
template<class TO >
TO * getRelatedTo (const std::string &name="", const std::string &namedRelation="") const
 Get the object to which this object has a relation. More...
 
template<class FROM >
FROM * getRelatedFrom (const std::string &name="", const std::string &namedRelation="") const
 Get the object from which this object has a relation. More...
 
template<class T >
T * getRelated (const std::string &name="", const std::string &namedRelation="") const
 Get the object to or from which this object has a relation. More...
 
template<class TO >
std::pair< TO *, float > getRelatedToWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing to an array. More...
 
template<class FROM >
std::pair< FROM *, float > getRelatedFromWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing from an array. More...
 
template<class T >
std::pair< T *, float > getRelatedWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing from/to an array. More...
 
std::string getInfo () const
 Return a short summary of this object's contents in raw text format. More...
 
std::string getArrayName () const
 Get name of array this object is stored in, or "" if not found.
 

Protected Member Functions

 ClassDefOverride (MCParticle, 5)
 A Class to store the Monte Carlo particle information.
 
TClonesArray * getArrayPointer () const
 Returns the pointer to the raw DataStore array holding this object (protected since these arrays are easy to misuse).
 

Protected Attributes

TClonesArray * m_plist
 Internal pointer to DataStore Array containing particles belonging to this collection. More...
 
int m_index
 transient pointer to particle list More...
 
unsigned short int m_status
 transient 1-based index of particle More...
 
int m_pdg
 PDG-Code of the particle.
 
float m_mass
 mass of the particle
 
float m_energy
 energy of the particle
 
float m_momentum_x
 momentum of particle, x component
 
float m_momentum_y
 momentum of particle, y component
 
float m_momentum_z
 momentum of particle, z component
 
bool m_validVertex
 indication wether vertex and time information is useful or just default
 
float m_productionTime
 production time
 
float m_productionVertex_x
 production vertex of particle, x component
 
float m_productionVertex_y
 production vertex of particle, y component
 
float m_productionVertex_z
 production vertex of particle, z component
 
float m_decayTime
 decay time
 
float m_decayVertex_x
 decay vertex of particle, x component
 
float m_decayVertex_y
 decay vertex of particle, y component
 
float m_decayVertex_z
 decay vertex of particle, z component
 
int m_mother
 1-based index of the mother particle
 
int m_firstDaughter
 1-based index of first daughter particle in collection, 0 if no daughters
 
int m_lastDaughter
 1-based index of last daughter particle in collection, 0 if no daughters
 
int m_secondaryPhysicsProcess
 physics process type of a secondary particle
 
Const::DetectorSet m_seenIn
 Each bit is a seen-in flag for the corresoponding subdetector of Belle II.
 

Static Protected Attributes

static const double c_epsilon = 10e-7
 limit of precision for two doubles to be the same.
 

Private Member Functions

 GraphParticle ()=delete
 No default constructor. More...
 
 GraphParticle (const GraphParticle &)=delete
 No copy constructor.
 
 GraphParticle (TClonesArray *, const MCParticle &)
 Hide MCParticle "almost copy" constructor.
 
 GraphParticle (MCParticleGraph *graph, unsigned int vertexId)
 Internally used constructor. More...
 
void setIndex (int index)
 Set the 1-based index of the particle. More...
 
 ClassDef (RelationsInterface, 0)
 defines interface for accessing relations of objects in StoreArray.
 

Private Attributes

MCParticleGraphm_graph {0}
 internal pointer to the graph this particle belongs to
 
unsigned int m_vertexId {0}
 vertex id in the graph
 
bool m_ignore {false}
 ignore particle when writing MCParticle list ?
 
bool m_primary {true}
 Is this a primary particle ?
 
int m_trackID {0}
 The track ID from geant4 that created this particle.
 
DataStore::StoreEntrym_cacheDataStoreEntry
 Cache of the data store entry to which this object belongs.
 
int m_cacheArrayIndex
 Cache of the index in the TClonesArray to which this object belongs.
 

Friends

class MCParticleGraph
 
class ParticleSorter
 

Detailed Description

Class to represent Particle data in graph.

This is an extended version of the MCParticle class, allowing to set index and daughter indices as well as adding decay information. Use MCParticleGraph::addParticle() to add a new particle to the graph.

Definition at line 75 of file MCParticleGraph.h.

Member Enumeration Documentation

◆ StatusBit

enum StatusBit
inherited

Exception is thrown if the requested index for the last child is out of range.

Exception is thrown if no pointer to the particle list was set. Exception is thrown if the pdg value of the MCParticle is not known to the internal database (TDatabasePDG). The status information for the MCParticle.

Enumerator
c_PrimaryParticle 

bit 0: Particle is primary particle.

For example, All the particles from the generator.

c_StableInGenerator 

bit 1: Particle is stable, i.e., not decaying in the generator.


c_LeftDetector 

bit 2: Particle left the detector (the simulation volume).

c_StoppedInDetector 

bit 3: Particle was stopped in the detector (the simulation volume).

c_IsVirtual 

bit 4: Particle is virtual and not going to Geant4.

Exchange boson, off-shell, unknown to Geant4, etc.

c_Initial 

bit 5: Particle is initial such as e+ or e- and not going to Geant4

c_IsISRPhoton 

bit 6: Particle is from initial state radiation

c_IsFSRPhoton 

bit 7: Particle is from finial state radiation

c_IsPHOTOSPhoton 

bit 8: Particle is an radiative photon from PHOTOS

c_IsRadiativePhoton 

combined flag to test whether the particle is radiative

Definition at line 45 of file MCParticle.h.

Constructor & Destructor Documentation

◆ GraphParticle() [1/2]

GraphParticle ( )
privatedelete

No default constructor.

This class gets instantiated by MCParticleGraph::addParticle()

◆ GraphParticle() [2/2]

GraphParticle ( MCParticleGraph graph,
unsigned int  vertexId 
)
inlineprivate

Internally used constructor.

Create a new Particle with given index and a pointer to the containing graph.

Parameters
graphPointer to the graph the particle is part of.
vertexIdThe vertex id of the particle in the graph.

Definition at line 180 of file MCParticleGraph.h.

Member Function Documentation

◆ addRelationTo() [1/2]

void addRelationTo ( const RelationsInterface< BASE > *  object,
float  weight = 1.0,
const std::string &  namedRelation = "" 
) const
inlineinherited

Add a relation from this object to another object (with caching).

Parameters
objectThe object to which the relation should point.
weightThe weight of the relation.
namedRelationAdditional name for the relation, or "" for the default naming

Definition at line 142 of file RelationsObject.h.

◆ addRelationTo() [2/2]

void addRelationTo ( const TObject *  object,
float  weight = 1.0,
const std::string &  namedRelation = "" 
) const
inlineinherited

Add a relation from this object to another object (no caching, can be quite slow).

Parameters
objectThe object to which the relation should point.
weightThe weight of the relation.
namedRelationAdditional name for the relation, or "" for the default naming

Definition at line 155 of file RelationsObject.h.

◆ addSeenInDetector()

void addSeenInDetector ( Const::DetectorSet  set)
inlineinherited

Flag/Add a bit if the MC particle is seen in a specific subdetector.

Parameters
setThe ID for Belle II subdetector(s), in either Const::DetectorSet or Const::EDetector format

Definition at line 480 of file MCParticle.h.

◆ addStatus()

void addStatus ( unsigned short int  bitmask)
inlineinherited

Add bitmask to current status.

Parameters
bitmaskThe status code which should be added to the existing MonteCarlo particle status code.

Definition at line 353 of file MCParticle.h.

◆ comesFrom()

void comesFrom ( GraphParticle mother)
inline

Tells the graph that this particle is a decay product of mother.

Parameters
motherThe mother particle of this particle.

Definition at line 105 of file MCParticleGraph.h.

◆ copyRelations()

void copyRelations ( const RelationsInterface< BASE > *  sourceObj)
inlineinherited

Copies all relations of sourceObj (pointing from or to sourceObj) to this object (including weights).

Useful if you want to make a complete copy of a StoreArray object to make modifications to it, but retain all information on linked objects.

Note: this only works if sourceObj inherits from the same base (e.g. RelationsObject), and only for related objects that also inherit from the same base.

Definition at line 170 of file RelationsObject.h.

◆ decaysInto()

void decaysInto ( GraphParticle daughter)
inline

Tells the graph that this particle decays into daughter.

Parameters
daughterThe daughter particle in which this particle decays.

Definition at line 99 of file MCParticleGraph.h.

◆ fixParticleList()

void fixParticleList ( ) const
inherited

Search the DataStore for the corresponding MCParticle array.

This function should not be needed by normal users and is called automatically if the pointer to the particle list is not set when needed, e.g. after deserialization.

Definition at line 82 of file MCParticle.cc.

◆ get4Vector()

ROOT::Math::PxPyPzEVector get4Vector ( ) const
inlineinherited

Return 4Vector of particle.

Returns
The 4-vector of the MonteCarlo particle.

Definition at line 207 of file MCParticle.h.

◆ getArrayIndex()

int getArrayIndex ( ) const
inlineinherited

Get 0-based index of the particle in the corresponding MCParticle list.

This is the function for users who want to use the indices of the TClonesArray. To get the corresponding mother and daughter indices use ->getMother()->getArrayIndex().

Returns
The index of the MonteCarlo particle in the corresponding MCParticle array Careful: These indices do not follow the standard from (Fortran) generators, where the first particle has index 1. In the array the first particle has index 0.

Definition at line 244 of file MCParticle.h.

◆ getCharge()

float getCharge ( void  ) const
inherited

Return the particle charge defined in TDatabasePDG.

Returns
The charge of the particle in units of q(positron).

Definition at line 36 of file MCParticle.cc.

◆ getDaughters()

vector< MCParticle * > getDaughters ( ) const
inherited

Get vector of all daughter particles, empty vector if none.

Throws an exception of type LastChildIndexOutOfRangError if the last daughter is out of the index range.

Returns
A list of all daughter particles. The list is empty if the MonteCarlo particle doesn't have any daughters.

Definition at line 52 of file MCParticle.cc.

◆ getDecayTime()

float getDecayTime ( ) const
inlineinherited

Return the decay time in ns.

Returns
The timestamp of the decay of the MonteCarlo particle in ns. If the particle is stable the time is set to infinity. If the particle crosses the simulation volume boundary, it is set to the crossing time.

Definition at line 168 of file MCParticle.h.

◆ getDecayVertex()

ROOT::Math::XYZVector getDecayVertex ( ) const
inlineinherited

Return decay vertex.

Returns
The decay vertex of the MonteCarlo particle in cm. If the particle crosses the simulation volume boundary, it is set to the crossing position.

Definition at line 219 of file MCParticle.h.

◆ getEnergy()

float getEnergy ( ) const
inlineinherited

Return particle energy in GeV.

Returns
Returns the particle energy in GeV.

Definition at line 147 of file MCParticle.h.

◆ getFirstDaughter()

int getFirstDaughter ( ) const
inlineinherited

Get 1-based index of first daughter, 0 if no daughters.

Returns
The index of the first daughter of the MonteCarlo particle. The index is 0 if the MonteCarlo particle doesn't have any daughters.

Definition at line 251 of file MCParticle.h.

◆ getIgnore()

bool getIgnore ( ) const
inline

Get the ignore flag.

Returns
whether the ignore flag is set

Definition at line 139 of file MCParticleGraph.h.

◆ getIndex()

int getIndex ( ) const
inlineinherited

Get 1-based index of the particle in the corresponding MCParticle list.

This is used by the MCParticle Graph.

Returns
The index of the MonteCarlo particle in the corresponding MCParticle list (starts with 1)

Definition at line 230 of file MCParticle.h.

◆ getInfo()

std::string getInfo ( ) const
inlineinherited

Return a short summary of this object's contents in raw text format.

Returns the contents of getInfoHTML() while translating line-breaks etc.

Note
: You don't need to implement this function (it's not virtual), getInfoHTML() is enough.

Definition at line 370 of file RelationsObject.h.

◆ getLastDaughter()

int getLastDaughter ( ) const
inlineinherited

Get 1-based index of last daughter, 0 if no daughters.

Returns
The index of the last daughter of the MonteCarlo particle. The index is 0 if the MonteCarlo particle doesn't have any daughters.

Definition at line 259 of file MCParticle.h.

◆ getLifetime()

float getLifetime ( ) const
inlineinherited

Return the lifetime in ns.

A convenient method to get the lifetime of the MonteCarlo particle.

Returns
The lifetime of the MonteCarlo particle in ns. If the particle crosses the simulation volume boundary, it is set to the time spent inside the volume.

Definition at line 177 of file MCParticle.h.

◆ getMass()

float getMass ( void  ) const
inlineinherited

Return the particle mass in GeV.

Returns
The mass of the particle in GeV.

Definition at line 135 of file MCParticle.h.

◆ getMomentum()

ROOT::Math::XYZVector getMomentum ( ) const
inlineinherited

Return momentum.

Returns
The momentum of the MonteCarlo particle in GeV.

Definition at line 198 of file MCParticle.h.

◆ getParticleFromGeneralizedIndexString()

const MCParticle * getParticleFromGeneralizedIndexString ( const std::string &  generalizedIndex) const
inherited

Explores the decay tree of the MC particle and returns the (grand^n)daughter identified by a generalized index.

The generalized index consists of a colon-separated list of daughter indexes, starting from the root particle: 0:1:3 identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. This method mirrors the method used in the Particle class.

Parameters
generalizedIndexthe generalized index of the particle to be returned
Returns
a particle in the decay tree of the root particle.

Definition at line 152 of file MCParticle.cc.

◆ getPDG()

int getPDG ( ) const
inlineinherited

Return PDG code of particle.

Returns
The PDG code of the MonteCarlo particle.

Definition at line 112 of file MCParticle.h.

◆ getProductionTime()

float getProductionTime ( ) const
inlineinherited

Return production time in ns.

Returns
The timestamp of the MonteCarlo particle production in ns.

Definition at line 159 of file MCParticle.h.

◆ getProductionVertex()

ROOT::Math::XYZVector getProductionVertex ( ) const
inlineinherited

Return production vertex position.

Returns
The production vertex of the MonteCarlo particle in cm.

Definition at line 189 of file MCParticle.h.

◆ getRelated()

T* getRelated ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object to or from which this object has a relation.

Template Parameters
TThe class of objects to or from which the relation points.
Parameters
nameThe name of the store array to or from which the relation points. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 278 of file RelationsObject.h.

◆ getRelatedFrom()

FROM* getRelatedFrom ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object from which this object has a relation.

Template Parameters
FROMThe class of objects from which the relation points.
Parameters
nameThe name of the store array from which the relation points. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 263 of file RelationsObject.h.

◆ getRelatedFromWithWeight()

std::pair<FROM*, float> getRelatedFromWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing from an array.

Template Parameters
FROMThe class of objects from which the relation points.
Parameters
nameThe name of the store array from which the relation points. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 314 of file RelationsObject.h.

◆ getRelatedTo()

TO* getRelatedTo ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object to which this object has a relation.

Template Parameters
TOThe class of objects to which the relation points.
Parameters
nameThe name of the store array to which the relation points. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 248 of file RelationsObject.h.

◆ getRelatedToWithWeight()

std::pair<TO*, float> getRelatedToWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing to an array.

Template Parameters
TOThe class of objects to which the relation points.
Parameters
nameThe name of the store array to which the relation points. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 297 of file RelationsObject.h.

◆ getRelatedWithWeight()

std::pair<T*, float> getRelatedWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing from/to an array.

Template Parameters
TThe class of objects to or from which the relation points.
Parameters
nameThe name of the store array to or from which the relation points. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 331 of file RelationsObject.h.

◆ getRelationsFrom()

RelationVector<FROM> getRelationsFrom ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations that point from another store array to this object.

Template Parameters
FROMThe class of objects from which the relations point.
Parameters
nameThe name of the store array from which the relations point. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 212 of file RelationsObject.h.

◆ getRelationsTo()

RelationVector<TO> getRelationsTo ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations that point from this object to another store array.

Template Parameters
TOThe class of objects to which the relations point.
Parameters
nameThe name of the store array to which the relations point. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 197 of file RelationsObject.h.

◆ getRelationsWith()

RelationVector<T> getRelationsWith ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations between this object and another store array.

Relations in both directions are returned.

Template Parameters
TThe class of objects to or from which the relations point.
Parameters
nameThe name of the store array to or from which the relations point. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 230 of file RelationsObject.h.

◆ getSecondaryPhysicsProcess()

int getSecondaryPhysicsProcess ( ) const
inlineinherited

Returns the physics process type of a secondary particle.

Returns
Returns an integer indicating the physics process type of a secondary particle. 0 if the particle is primary. -1 if no information is found. For the details, see the Geant4 package: (*G4Track)->GetCreatorProcess()->GetProcessSubType() processes/electromagnetic/utils/include/G4EmProcessSubType.hh processes/hadronic/management/include/G4HadronicProcessType.hh processes/decay/include/G4DecayProcessType.hh

Definition at line 297 of file MCParticle.h.

◆ getSeenInDetector()

Const::DetectorSet getSeenInDetector ( ) const
inlineinherited

Return the seen-in flags of the entire Belle II subdetectors for an MC particle.

Returns
Returns the entire seen-in flags

Definition at line 303 of file MCParticle.h.

◆ getStatus()

unsigned int getStatus ( unsigned short int  bitmask = USHRT_MAX) const
inlineinherited

Return status code of particle.

Parameters
bitmaskTakes an optional bitmask that is compared to the status of the particle.
Returns
Returns the status code of the particle. If a bitmask is given and it matches the the status it returns the value of the bitmask and 0 if not.

Definition at line 122 of file MCParticle.h.

◆ getTrackID()

int getTrackID ( ) const
inline

Returns the track ID assigned to this MCParticle.

Returns
The ID of the Geant4 track which created this particle.

Definition at line 154 of file MCParticleGraph.h.

◆ getVertex()

ROOT::Math::XYZVector getVertex ( void  ) const
inlineinherited

Return production vertex position, shorthand for getProductionVertex().

Returns
The production vertex of the MonteCarlo particle in cm.

Definition at line 183 of file MCParticle.h.

◆ hasSeenInDetector()

bool hasSeenInDetector ( Const::DetectorSet  set) const
inlineinherited

Return if the seen-in flag for a specific subdetector is set or not.

Parameters
setThe ID for Belle II subdetector(s), in either Const::DetectorSet or Const::EDetector format.
Returns
Returns true if the corresponding bit is set.

Definition at line 310 of file MCParticle.h.

◆ hasStatus()

bool hasStatus ( unsigned short int  bitmask) const
inlineinherited

Return if specific status bit is set.

Parameters
bitmaskThe bitmask which is compared to the status of the particle.
Returns
Returns true if the bitmask matches the status code of the particle.

Definition at line 129 of file MCParticle.h.

◆ hasValidVertex()

bool hasValidVertex ( ) const
inlineinherited

Indication whether vertex and time information is useful or just default.

Returns
Returns True if the vertex and time information is useful.

Definition at line 153 of file MCParticle.h.

◆ operator=()

GraphParticle& operator= ( const MCParticle particle)
inline

Assign the values of an existing MCParticle to this GraphParticle.

This assignment will leave all bookkeeping members of the GraphParticle untouched (decays, ignore status, track id) but will assign all values/flags from the MCParticle.

Parameters
particleParticle which values (momentum, energy, mass, vertex, etc.) shall be assigned

Definition at line 85 of file MCParticleGraph.h.

◆ removeSeenInDetector()

void removeSeenInDetector ( Const::DetectorSet  set)
inlineinherited

Unflag/Remove the bit if the MC particle is not seen in a specific subdetector.

Parameters
setThe ID for Belle II subdetector(s), in either Const::DetectorSet or Const::EDetector format

Definition at line 486 of file MCParticle.h.

◆ removeStatus()

void removeStatus ( unsigned short int  bitmask)
inlineinherited

Remove bitmask from current status.

Parameters
bitmaskThe status code which should be removed from the existing MonteCarlo particle status code.

Definition at line 360 of file MCParticle.h.

◆ set4Vector()

void set4Vector ( const ROOT::Math::PxPyPzEVector &  p4)
inlineinherited

Sets the 4Vector of particle.

Parameters
p44Vector

Definition at line 438 of file MCParticle.h.

◆ setDecayTime()

void setDecayTime ( float  time)
inlineinherited

Set decay time.

Parameters
timeThe timestamp of the decay of the MonteCarlo time.

Definition at line 390 of file MCParticle.h.

◆ setDecayVertex() [1/2]

void setDecayVertex ( const ROOT::Math::XYZVector &  vertex)
inlineinherited

Set decay vertex.

Parameters
vertexThe position of the decay vertex given as XYZVector.

Definition at line 447 of file MCParticle.h.

◆ setDecayVertex() [2/2]

void setDecayVertex ( float  x,
float  y,
float  z 
)
inlineinherited

Set decay vertex.

The position of the decay vertex is given as three float parameters.

Parameters
xThe x position of the decay vertex.
yThe y position of the decay vertex.
zThe z position of the decay vertex.

Definition at line 459 of file MCParticle.h.

◆ setEnergy()

void setEnergy ( float  energy)
inlineinherited

Set energy.

Parameters
energyThe energy of the MonteCarlo particle.

Definition at line 372 of file MCParticle.h.

◆ setFirstDaughter()

void setFirstDaughter ( int  daughter)
inline

Set the 1-based index of the first daughter, 0 means no daughters.

Will be reset when sorting the particle graph and will be set according to the information given with decaysInto() and comesFrom().

Parameters
daughterThe index of the first daughter particle. Set to 0 for no daughters.

Definition at line 114 of file MCParticleGraph.h.

◆ setIgnore()

void setIgnore ( bool  ignore = true)
inline

Set or remove the ignore flag.

If ignore is set, this particle will not be written to the MCParticle list and all its daughters without ignore flag will be attributed to all parents of this particle.

Parameters
ignoreSet to true to ignore this particle when creating the MCParticle list.

Definition at line 132 of file MCParticleGraph.h.

◆ setIndex()

void setIndex ( int  index)
inlineprivate

Set the 1-based index of the particle.

Parameters
indexThe index of the particle.

Definition at line 193 of file MCParticleGraph.h.

◆ setInitial()

void setInitial ( )
inlineinherited

Set particle to initial.

(A bit more convinient)

Definition at line 505 of file MCParticle.h.

◆ setLastDaughter()

void setLastDaughter ( int  daughter)
inline

Set the 1-based index of the last daughter, 0 means no daughters.

See also
setFirstDaughter()
Parameters
daughterThe index of the last daughter particle. Set to 0 for no daughters.

Definition at line 122 of file MCParticleGraph.h.

◆ setMass()

void setMass ( float  mass)
inlineinherited

Set particle mass.

Parameters
massThe MonteCarlo particle mass.

Definition at line 366 of file MCParticle.h.

◆ setMomentum() [1/2]

void setMomentum ( const ROOT::Math::XYZVector &  momentum)
inlineinherited

Set particle momentum.

Parameters
momentumThe momentum of the MonteCarlo particle given as XYZVector.

Definition at line 417 of file MCParticle.h.

◆ setMomentum() [2/2]

void setMomentum ( float  px,
float  py,
float  pz 
)
inlineinherited

Set particle momentum.

The momentum of the MonteCarlo particle is given as three float parameters.

Parameters
pxThe x component of the momentum vector.
pyThe y component of the momentum vector.
pzThe z component of the momentum vector.

Definition at line 429 of file MCParticle.h.

◆ setPDG()

void setPDG ( int  pdg)
inlineinherited

Set PDG code of the particle.

Parameters
pdgThe PDG code of the MonteCarlo particle.

Definition at line 335 of file MCParticle.h.

◆ setProductionTime()

void setProductionTime ( float  time)
inlineinherited

Set production time.

Parameters
timeThe timestamp of the production of the MonteCarlo particle.

Definition at line 384 of file MCParticle.h.

◆ setProductionVertex() [1/2]

void setProductionVertex ( const ROOT::Math::XYZVector &  vertex)
inlineinherited

Set production vertex position.

Parameters
vertexThe position of the production vertex given as XYZVector.

Definition at line 396 of file MCParticle.h.

◆ setProductionVertex() [2/2]

void setProductionVertex ( float  x,
float  y,
float  z 
)
inlineinherited

Set production vertex position.

The position of the production vertex is given as three float parameters.

Parameters
xThe x position of the production vertex.
yThe y position of the production vertex.
zThe z position of the production vertex.

Definition at line 408 of file MCParticle.h.

◆ setSecondaryPhysicsProcess()

void setSecondaryPhysicsProcess ( int  physicsProcess)
inlineinherited

Sets the physics process type of a secondary particle.

Parameters
physicsProcessphysics process type as an integer number for a secondary particle.

Definition at line 468 of file MCParticle.h.

◆ setSeenInDetector()

void setSeenInDetector ( Const::DetectorSet  set)
inlineinherited

Set the seen-in flags for the entire Belle II subdetectors for an Monte Carlo particle.

Parameters
setThe ID for Belle II subdetector(s), in either Const::DetectorSet or Const::EDetector format

Definition at line 474 of file MCParticle.h.

◆ setStatus()

void setStatus ( unsigned short int  status)
inlineinherited

Set Status code for the particle.

Parameters
statusThe status code of the MonteCarlo particle.

Definition at line 346 of file MCParticle.h.

◆ setTrackID()

void setTrackID ( int  trackID)
inline

Set the track ID for the particle.

The track ID is used to build the relationship between MCParticles and created Hits.

Parameters
trackIDThe ID of the Geant4 track which created this MCParticle.

Definition at line 147 of file MCParticleGraph.h.

◆ setValidVertex()

void setValidVertex ( bool  valid)
inlineinherited

Set indication wether vertex and time information is valid or just default.

Parameters
validSet to true if the vertex is valid.

Definition at line 378 of file MCParticle.h.

◆ setVirtual()

void setVirtual ( )
inlineinherited

Set particle to virtual.

(A bit more convinient)

Definition at line 500 of file MCParticle.h.

Member Data Documentation

◆ m_index

int m_index
protectedinherited

transient pointer to particle list

1-based index of the particle, will be set automatically after deserialisation if needed.

Definition at line 538 of file MCParticle.h.

◆ m_plist

TClonesArray* m_plist
protectedinherited

Internal pointer to DataStore Array containing particles belonging to this collection.

This is a transient member and will not be written to file. The pointer will be set correctly on first access after deserialisation

Definition at line 532 of file MCParticle.h.

◆ m_status

unsigned short int m_status
protectedinherited

transient 1-based index of particle

status code

Definition at line 540 of file MCParticle.h.


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