Belle II Software  release-08-01-10
MCParticle Class Reference

A Class to store the Monte Carlo particle information. More...

#include <MCParticle.h>

Inheritance diagram for MCParticle:
Collaboration diagram for MCParticle:

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

 MCParticle ()
 Default constructor for ROOT.
 
 MCParticle (TClonesArray *plist, const MCParticle &p)
 Construct MCParticle from a another MCParticle and the TClonesArray it is stored in. 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

 ClassDef (RelationsInterface, 0)
 defines interface for accessing relations of objects in StoreArray.
 

Private Attributes

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 FixMergedObjectsModule
 

Detailed Description

A Class to store the Monte Carlo particle information.

Definition at line 32 of file MCParticle.h.

Member Enumeration Documentation

◆ StatusBit

enum StatusBit

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

◆ MCParticle()

MCParticle ( TClonesArray *  plist,
const MCParticle p 
)
inline

Construct MCParticle from a another MCParticle and the TClonesArray it is stored in.

Used by MCParticleGraph to build a valid tree of MCParticles from particle and decay information

See also
class MCParticleGraph

Definition at line 94 of file MCParticle.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)
inline

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)
inline

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.

◆ 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.

◆ fixParticleList()

void fixParticleList ( ) const

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.

83 {
84  if (m_plist != 0) return;
85 
86  TClonesArray* plist(0);
87 
88  //Search default location
89  //TODO: this could be replaced with RelationsObject::getArrayIndex()/getArrayName()
90  StoreArray<MCParticle> MCParticles;
91  if (MCParticles && MCParticles.getPtr()->IndexOf(this) >= 0) {
92  plist = MCParticles.getPtr();
93  } else {
94  //Search all StoreArrays which happen to store MCParticles
96  for (DataStore::StoreEntryConstIter iter = map.begin(); iter != map.end(); ++iter) {
97  TClonesArray* value = dynamic_cast<TClonesArray*>(iter->second.ptr);
98  if (value && value->GetClass() == Class() && value->IndexOf(this) >= 0) {
99  plist = value;
100  break;
101  }
102  }
103  }
104  //Could not find any collection, raise exception
105  if (!plist) {
106  B2ERROR("Could not determine StoreArray the MCParticle belongs to !");
107  throw NoParticleListSetError();
108  }
109 
110  //Set plist pointer and index for whole array
111  for (int i = 0; i < plist->GetEntriesFast(); i++) {
112  MCParticle& mc = *(static_cast<MCParticle*>(plist->At(i)));
113  mc.m_plist = plist;
114  mc.m_index = i + 1;
115  }
116 }
StoreEntryMap::const_iterator StoreEntryConstIter
const_iterator for a StoreEntry map.
Definition: DataStore.h:89
StoreEntryMap & getStoreEntryMap(EDurability durability)
Get a reference to the object/array map.
Definition: DataStore.h:325
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
Definition: DataStore.h:59
static DataStore & Instance()
Instance of singleton Store.
Definition: DataStore.cc:54
std::map< std::string, StoreEntry > StoreEntryMap
Map for StoreEntries.
Definition: DataStore.h:87
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
TClonesArray * m_plist
Internal pointer to DataStore Array containing particles belonging to this collection.
Definition: MCParticle.h:532
TClonesArray * getPtr() const
Raw access to the underlying TClonesArray.
Definition: StoreArray.h:311

◆ get4Vector()

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

Return 4Vector of particle.

Returns
The 4-vector of the MonteCarlo particle.

Definition at line 207 of file MCParticle.h.

◆ getArrayIndex()

int getArrayIndex ( ) const
inline

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

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

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
inline

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
inline

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
inline

Return particle energy in GeV.

Returns
Returns the particle energy in GeV.

Definition at line 147 of file MCParticle.h.

◆ getFirstDaughter()

int getFirstDaughter ( ) const
inline

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.

◆ getIndex()

int getIndex ( ) const
inline

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
inline

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
inline

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
inline

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
inline

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

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
inline

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
inline

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
inline

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
inline

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
inline

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
inline

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.

◆ getVertex()

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

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
inline

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
inline

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
inline

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.

◆ removeSeenInDetector()

void removeSeenInDetector ( Const::DetectorSet  set)
inline

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)
inline

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)
inline

Sets the 4Vector of particle.

Parameters
p44Vector

Definition at line 438 of file MCParticle.h.

◆ setDecayTime()

void setDecayTime ( float  time)
inline

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)
inline

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 
)
inline

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)
inline

Set energy.

Parameters
energyThe energy of the MonteCarlo particle.

Definition at line 372 of file MCParticle.h.

◆ setInitial()

void setInitial ( )
inline

Set particle to initial.

(A bit more convinient)

Definition at line 505 of file MCParticle.h.

◆ setMass()

void setMass ( float  mass)
inline

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)
inline

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 
)
inline

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)
inline

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)
inline

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)
inline

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 
)
inline

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)
inline

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)
inline

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)
inline

Set Status code for the particle.

Parameters
statusThe status code of the MonteCarlo particle.

Definition at line 346 of file MCParticle.h.

◆ setValidVertex()

void setValidVertex ( bool  valid)
inline

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 ( )
inline

Set particle to virtual.

(A bit more convinient)

Definition at line 500 of file MCParticle.h.

Member Data Documentation

◆ m_index

int m_index
protected

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
protected

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
protected

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 files: