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

Class to store reconstructed particles. More...

#include <Particle.h>

Inheritance diagram for Particle:
Collaboration diagram for Particle:

Public Types

enum  EParticleSourceObject {
  c_Undefined = 0 ,
  c_Track = 1 ,
  c_ECLCluster = 2 ,
  c_KLMCluster = 3 ,
  c_V0 = 4 ,
  c_MCParticle = 5 ,
  c_Composite = 6 ,
  c_NoMDSTSource = 7
}
 particle source enumerators
 
enum  EFlavorType {
  c_Unflavored = 0 ,
  c_Flavored = 1
}
 describes flavor type, see getFlavorType(). More...
 
enum  {
  c_DimPosition = 3 ,
  c_DimMomentum = 4 ,
  c_DimMatrix = 7 ,
  c_SizeMatrix = c_DimMatrix * (c_DimMatrix + 1) / 2
}
 error matrix dimensions and size of 1D representation
 
enum  {
  c_Px ,
  c_Py ,
  c_Pz ,
  c_E ,
  c_X ,
  c_Y ,
  c_Z
}
 enumerator used for error matrix handling, shows also in which order the rows (columns) are defined
 
enum  PropertyFlags {
  c_Ordinary = 0 ,
  c_IsUnspecified = 1 ,
  c_IsIgnoreRadiatedPhotons = 2 ,
  c_IsIgnoreIntermediate = 4 ,
  c_IsIgnoreMassive = 8 ,
  c_IsIgnoreNeutrino = 16 ,
  c_IsIgnoreGamma = 32 ,
  c_IsIgnoreBrems = 64 ,
  c_IsIgnoreMisID = 128 ,
  c_IsIgnoreDecayInFlight = 256
}
 Flags that describe the particle property, which are used in the MC matching. More...
 

Public Member Functions

 Particle ()
 Default constructor. More...
 
 Particle (const ROOT::Math::PxPyPzEVector &momentum, const int pdgCode)
 Constructor from a Lorentz vector and PDG code. More...
 
 Particle (const ROOT::Math::PxPyPzEVector &momentum, const int pdgCode, EFlavorType flavorType, const EParticleSourceObject particleType, const unsigned mdstIndex)
 Constructor for final state particles. More...
 
 Particle (const ROOT::Math::PxPyPzEVector &momentum, const int pdgCode, EFlavorType flavorType, const std::vector< int > &daughterIndices, TClonesArray *arrayPointer=nullptr)
 Constructor for composite particles. More...
 
 Particle (const ROOT::Math::PxPyPzEVector &momentum, const int pdgCode, EFlavorType flavorType, const std::vector< int > &daughterIndices, int properties, TClonesArray *arrayPointer=nullptr)
 Constructor for composite particles. More...
 
 Particle (const ROOT::Math::PxPyPzEVector &momentum, const int pdgCode, EFlavorType flavorType, const std::vector< int > &daughterIndices, int properties, const std::vector< int > &daughterProperties, TClonesArray *arrayPointer=nullptr)
 Constructor for composite particles. More...
 
 Particle (const Track *track, const Const::ChargedStable &chargedStable)
 Constructor from a reconstructed track (mdst object Track);. More...
 
 Particle (int trackArrayIndex, const TrackFitResult *trackFit, const Const::ChargedStable &chargedStable)
 Constructor from a reconstructed Track given as TrackFitResult. More...
 
 Particle (const ECLCluster *eclCluster, const Const::ParticleType &type=Const::photon)
 Constructor of a photon from a reconstructed ECL cluster that is not matched to any charged track. More...
 
 Particle (const KLMCluster *klmCluster, const int pdgCode=Const::Klong.getPDGCode())
 Constructor from a reconstructed KLM cluster. More...
 
 Particle (const MCParticle *MCparticle)
 Constructor from MC particle (mdst object MCParticle) More...
 
 ~Particle ()
 Destructor.
 
void setPDGCode (const int pdg)
 Sets PDG code. More...
 
void set4Vector (const ROOT::Math::PxPyPzEVector &p4)
 Sets Lorentz vector. More...
 
void set4VectorDividingByMomentumScaling (const ROOT::Math::PxPyPzEVector &p4)
 Sets Lorentz vector dividing by the momentum scaling factor. More...
 
void setVertex (const ROOT::Math::XYZVector &vertex)
 Sets position (decay vertex) More...
 
void setMomentumScalingFactor (double momentumScalingFactor)
 Sets momentum scaling. More...
 
void setMomentumSmearingFactor (double momentumSmearingFactor)
 Sets momentum smearing. More...
 
void setJacobiMatrix (const TMatrixF &jacobiMatrix)
 Sets 4x6 jacobi matrix. More...
 
void setMomentumVertexErrorMatrix (const TMatrixFSym &errMatrix)
 Sets 7x7 error matrix. More...
 
void setPValue (double pValue)
 Sets chi^2 probability of fit. More...
 
void setProperty (const int properties)
 sets m_properties
 
void updateMomentum (const ROOT::Math::PxPyPzEVector &p4, const ROOT::Math::XYZVector &vertex, const TMatrixFSym &errMatrix, double pValue)
 Sets Lorentz vector, position, 7x7 error matrix and p-value. More...
 
void updateMass (const int pdgCode)
 Updates particle mass with the mass of the particle corresponding to the given PDG. More...
 
void appendDaughter (const Particle *daughter, const bool updateType=true, const int daughterProperty=c_Ordinary)
 Appends index of daughter to daughters index array. More...
 
void appendDaughter (int particleIndex, const bool updateType=true)
 Appends index of daughter to daughters index array. More...
 
void removeDaughter (const Particle *daughter, const bool updateType=true)
 Removes index of daughter from daughters index array. More...
 
bool replaceDaughter (const Particle *oldDaughter, Particle *newDaughter)
 Replace index of given daughter with new daughter, return true if a replacement is made. More...
 
bool replaceDaughterRecursively (const Particle *oldDaughter, Particle *newDaughter)
 Apply replaceDaughter to all Particles in the decay tree by looping recursively through it, return true if a replacement is made. More...
 
int getPDGCode (void) const
 Returns PDG code. More...
 
double getCharge (void) const
 Returns particle charge. More...
 
EFlavorType getFlavorType () const
 Returns flavor type of the decay (for FS particles: flavor type of particle) More...
 
EParticleSourceObject getParticleSource () const
 Returns particle source as defined with enum EParticleSourceObject. More...
 
unsigned getMdstArrayIndex (void) const
 Returns 0-based index of MDST store array object (0 for composite particles) More...
 
int getProperty () const
 Returns particle property as a bit pattern The values are defined in the PropertyFlags enum and described in detail there. More...
 
double getMass () const
 Returns invariant mass (= nominal for FS particles) More...
 
double getPDGMass (void) const
 Returns uncertainty on the invariant mass (requires valid momentum error matrix) More...
 
double getPDGLifetime () const
 Returns particle nominal lifetime. More...
 
double getEnergy () const
 Returns total energy. More...
 
ROOT::Math::PxPyPzEVector get4Vector () const
 Returns Lorentz vector. More...
 
ROOT::Math::XYZVector getMomentum () const
 Returns momentum vector. More...
 
double getMomentumMagnitude () const
 Returns momentum magnitude. More...
 
double getP () const
 Returns momentum magnitude (same as getMomentumMagnitude but with shorter name) More...
 
double getPx () const
 Returns x component of momentum. More...
 
double getPy () const
 Returns y component of momentum. More...
 
double getPz () const
 Returns z component of momentum. More...
 
double getEffectiveMomentumScale () const
 Returns effective momentum scale which is the product of the momentum scaling and smearing factors. More...
 
ROOT::Math::XYZVector getVertex () const
 Returns vertex position (POCA for charged, IP for neutral FS particles) More...
 
double getX () const
 Returns x component of vertex position. More...
 
double getY () const
 Returns y component of vertex position. More...
 
double getZ () const
 Returns z component of vertex position. More...
 
double getPValue () const
 Returns chi^2 probability of fit if done or -1. More...
 
TMatrixFSym getMomentumVertexErrorMatrix () const
 Returns 7x7 error matrix. More...
 
TMatrixFSym getMomentumErrorMatrix () const
 Returns the 4x4 momentum error matrix. More...
 
TMatrixFSym getVertexErrorMatrix () const
 Returns the 3x3 position error sub-matrix. More...
 
double getCosHelicity (const Particle *mother=nullptr) const
 Returns cosine of the helicity angle The helicity angle is defined in the rest frame of the particle as the angle between the negative momentum of the mother and. More...
 
double getCosHelicityDaughter (unsigned iDaughter, unsigned iGrandDaughter=0) const
 Returns cosine of the helicity angle of the given daughter defined by given grand daughter. More...
 
double getAcoplanarity () const
 Returns acoplanarity angle defined as the angle between the decay planes of the grand daughters in the particle's rest frame This assumes that the particle and its daughters have two daughters each. More...
 
int getMdstSource () const
 Returns unique identifier of final state particle (needed in particle combiner) More...
 
unsigned getNDaughters (void) const
 Returns number of daughter particles. More...
 
const std::vector< int > & getDaughterIndices () const
 Returns a vector of store array indices of daughter particles. More...
 
const std::vector< int > & getDaughterProperties () const
 Returns a vector of properties of daughter particles. More...
 
const ParticlegetDaughter (unsigned i) const
 Returns a pointer to the i-th daughter particle. More...
 
bool forEachDaughter (const std::function< bool(const Particle *)> &function, bool recursive=true, bool includeSelf=true) const
 Apply a function to all daughters of this particle. More...
 
std::vector< Belle2::Particle * > getDaughters () const
 Returns a vector of pointers to daughter particles. More...
 
std::vector< const Belle2::Particle * > getFinalStateDaughters () const
 Returns a vector of pointers to Final State daughter particles. More...
 
std::vector< const Belle2::Particle * > getAllDaughters () const
 Returns a vector of pointers to all generations' daughter particles. More...
 
std::vector< int > getMdstArrayIndices (EParticleSourceObject type) const
 Returns a vector of StoreArray indices of given MDST dataobjects. More...
 
bool overlapsWith (const Particle *oParticle) const
 Returns true if final state ancestors of oParticle overlap. More...
 
bool isCopyOf (const Particle *oParticle, bool doDetailedComparison=false) const
 Returns true if this Particle and oParticle are copies of each other. More...
 
const TrackgetTrack () const
 Returns the pointer to the Track object that was used to create this Particle (ParticleType == c_Track). More...
 
const TrackFitResultgetTrackFitResult () const
 Returns the pointer to the TrackFitResult that was used to create this Particle (ParticleType == c_Track). More...
 
const V0getV0 () const
 Returns the pointer to the V0 object that was used to create this Particle (if ParticleType == c_V0). More...
 
const PIDLikelihoodgetPIDLikelihood () const
 Returns the pointer to the PIDLikelihood object that is related to the Track, which was used to create this Particle (ParticleType == c_Track). More...
 
const ECLClustergetECLCluster () const
 Returns the pointer to the ECLCluster object that was used to create this Particle (if ParticleType == c_ECLCluster). More...
 
double getECLClusterEnergy () const
 Returns the energy of the ECLCluster for the particle. More...
 
const KLMClustergetKLMCluster () const
 Returns the pointer to the KLMCluster object that was used to create this Particle (ParticleType == c_KLMCluster). More...
 
const MCParticlegetMCParticle () const
 Returns the pointer to the MCParticle object that was used to create this Particle (ParticleType == c_MCParticle). More...
 
std::string getName () const override
 Return name of this particle.
 
std::string getInfoHTML () const override
 Return a short summary of this object's contents in HTML format.
 
void print () const
 Prints the contents of a Particle object to standard output.
 
std::vector< std::string > getExtraInfoNames () const
 get a list of the extra info names
 
void removeExtraInfo ()
 Remove all stored extra info fields.
 
double getExtraInfo (const std::string &name) const
 Return given value if set. More...
 
bool hasExtraInfo (const std::string &name) const
 Return whether the extra info with the given name is set.
 
int getExtraInfoMap () const
 Return the id of the associated ParticleExtraInfoMap or -1 if no map is set.
 
unsigned int getExtraInfoSize () const
 Return the size of the extra info array.
 
void writeExtraInfo (const std::string &name, const double value)
 Sets the user defined extraInfo. More...
 
void setExtraInfo (const std::string &name, double value)
 Sets the user-defined data of given name to the given value. More...
 
void addExtraInfo (const std::string &name, double value)
 Sets the user-defined data of given name to the given value. More...
 
TClonesArray * getArrayPointer () const
 Returns the pointer to the store array which holds the daughter particles. More...
 
int getPDGCodeUsedForFit () const
 Return the always positive PDG code which was used for the track fit (if there was a track fit) of this particle. More...
 
bool wasExactFitHypothesisUsed () const
 Returns true if the type represented by this Particle object was used use as a mass hypothesis during the track of this Particle's parameters.
 
bool isMostLikely () const
 Returns true if the (track-based) particle is created with its most likely mass hypothesis based on PID likelihood.
 
std::pair< Const::ChargedStable, const TrackFitResult * > getMostLikelyTrackFitResult () const
 For a (track-based) particle, returns the charged stable mass hypothesis associated to the most probable TrackFitResult, and the TrackFitResult itself.
 
bool isMostLikelyTrackFitResult () const
 Returns true if the (track-based) particle is created with its most likely mass hypothesis based on TrackFitResult.
 
ECLCluster::EHypothesisBit getECLClusterEHypothesisBit () const
 Returns the ECLCluster EHypothesisBit for this Particle.
 
const ParticlegetParticleFromGeneralizedIndexString (const std::string &generalizedIndex) const
 Explores the decay tree of the particle and returns the (grand^n)daughter identified by a generalized index. More...
 
void updateJacobiMatrix ()
 Propagate the photon energy scaling to jacobian elements that were calculated using energy.
 
void fillFSPDaughters (std::vector< const Belle2::Particle * > &fspDaughters) const
 Fill final state particle daughters into a vector. More...
 
void fillAllDaughters (std::vector< const Belle2::Particle * > &allDaughters) const
 Fill all generations' daughters into a vector. 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.
 
int getArrayIndex () const
 Returns this object's array index (in StoreArray), or -1 if not found.
 

Private Member Functions

void setMomentumPositionErrorMatrix (const TrackFitResult *trackFit)
 Sets the momentum, position and error matrix for this particle (created from charged Track)
 
void resetErrorMatrix ()
 Resets 7x7 error matrix All elements are set to 0.0.
 
void resetJacobiMatrix ()
 Resets 4x6 error matrix All elements are set to 0.0.
 
void storeErrorMatrix (const TMatrixFSym &errMatrix)
 Stores 7x7 error matrix into private member m_errMatrix. More...
 
void storeJacobiMatrix (const TMatrixF &jacobiMatrix)
 Stores 4x6 Jacobi matrix into private member m_jacobiMatrix. More...
 
void fillDecayChain (std::vector< int > &decayChain) const
 Fill vector with (PDGCode, MdstSource) pairs for the entire decay chain. More...
 
void setFlavorType ()
 sets m_flavorType using m_pdgCode
 
void setMdstArrayIndex (const int arrayIndex)
 set mdst array index
 
int generatePDGCodeFromCharge (const int chargedSign, const Const::ChargedStable &chargedStable)
 Generate the PDG code with correct sign, using the charge. More...
 
 ClassDefOverride (Particle, 16)
 Class to store reconstructed particles.
 
 ClassDef (RelationsInterface, 0)
 defines interface for accessing relations of objects in StoreArray.
 

Private Attributes

int m_pdgCode
 PDG code.
 
int m_pdgCodeUsedForFit = 0
 PDG code used for the track fit.
 
double m_mass
 particle (invariant) mass
 
double m_px
 momentum component x
 
double m_py
 momentum component y
 
double m_pz
 momentum component z
 
double m_momentumScale = 1.0
 effective momentum scale factor
 
double m_momentumScalingFactor = 1.0
 momentum scaling factor
 
double m_momentumSmearingFactor = 1.0
 momentum smearing factor
 
double m_x
 position component x
 
double m_y
 position component y
 
double m_z
 position component z
 
double m_errMatrix [c_SizeMatrix] = {}
 error matrix (1D representation)
 
double m_jacobiMatrix [c_SizeMatrix] = {}
 error matrix (1D representation)
 
double m_pValue
 chi^2 probability of the fit. More...
 
std::vector< int > m_daughterIndices
 daughter particle indices
 
EFlavorType m_flavorType
 flavor type.
 
EParticleSourceObject m_particleSource
 (mdst) source of particle
 
unsigned m_mdstIndex
 0-based index of MDST store array object
 
int m_properties
 particle property
 
std::vector< int > m_daughterProperties
 daughter particle properties
 
int m_identifier = -1
 Identifier that can be used to identify whether the particle is unique or is a copy or representation of another. More...
 
std::vector< double > m_extraInfo
 Stores associated user defined values. More...
 
TClonesArray * m_arrayPointer
 Internal pointer to DataStore array containing the daughters of this particle. More...
 
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 ParticleSubset
 

Detailed Description

Class to store reconstructed particles.

This class is a common representation of all particle types, e.g.:

  • final state particles (FS particles):
    • charged kaons/pions/electrons/muons/protons reconstructed as Track
    • photons reconstructed as ECLCluster (without associated Track)
    • long lived neutral kaons reconstructed in KLM (as KLMCluster without associated Track)
  • composite particles:
    • pre-reconstructed V0 particles: Kshort, Lambda baryon, converted photon, ...
    • reconstructed in decays (via combinations)

Private members are limited to those which completely define the particle and that are common to all particle types. These are:

  • particle mass
    • nominal for FS particles
    • invariant for composite particles
  • momentum vector (px, py, pz)
  • position (x, y, z)
    • POCA for charged FS particles
    • IP for photons, Klong and pi0
    • decay vertex for composite particles
  • 7x7 error matrix (order is: px, py, pz, E, x, y, z)
  • chi^2 probability of the fit (track fit, pi0 mass-constr. fit or vertex fit)
  • PDG code
  • vector of StoreArray<Particle> indices of daughter particles

Additional private members are needed in order to make composite particles (via combinations):

  • mdst index of an object from which the FS particle is created
  • source of the object from which the particle is created (see EParticleSourceObject)
  • flavor type (unflavored/flavored) of a decay or flavor type of FS particle

Finally, it is possible to store user-defined floating-point values using addExtraInfo() and getExtraInfo(), identified by a string key. These are general purpose functions for collecting additional information about reconstructed particles that can not be included into any existing data object. Different Particle objects can store different sets of values, and there are no hard-coded limitations on the number of values stored.

Definition at line 75 of file Particle.h.

Member Enumeration Documentation

◆ EFlavorType

describes flavor type, see getFlavorType().

Enumerator
c_Unflavored 

Is its own antiparticle or we don't know whether it is a particle/antiparticle.

c_Flavored 

Is either particle or antiparticle.

Definition at line 94 of file Particle.h.

94  {
95  c_Unflavored = 0,
96  c_Flavored = 1,
97  };
@ c_Unflavored
Is its own antiparticle or we don't know whether it is a particle/antiparticle.
Definition: Particle.h:95
@ c_Flavored
Is either particle or antiparticle.
Definition: Particle.h:96

◆ PropertyFlags

Flags that describe the particle property, which are used in the MC matching.

Enumerator
c_IsUnspecified 

Ordinary particles.

Is the particle unspecified by marking @ ?

c_IsIgnoreRadiatedPhotons 

Is the particle MC matched with the ignore radiated photon flag set?

c_IsIgnoreIntermediate 

Is the particle MC matched with the ignore intermediate resonances flag set?

c_IsIgnoreMassive 

Is the particle MC matched with the ignore missing massive particle flag set?

c_IsIgnoreNeutrino 

Is the particle MC matched with the ignore missing neutrino flag set?

c_IsIgnoreGamma 

Is the particle MC matched with the ignore missing gamma flag set?

c_IsIgnoreBrems 

Is the particle MC matched with the ignore added Brems gamma flag set?

c_IsIgnoreMisID 

Is the particle MC matched with the ignore MisID flag set?

c_IsIgnoreDecayInFlight 

Is the particle MC matched with the ignore DecayInFlight flag set?

Definition at line 116 of file Particle.h.

Constructor & Destructor Documentation

◆ Particle() [1/11]

Particle ( )

Default constructor.

All private members are set to 0. Particle type is set to c_Undefined.

Definition at line 45 of file Particle.cc.

45  :
46  m_pdgCode(0), m_mass(0), m_px(0), m_py(0), m_pz(0), m_x(0), m_y(0), m_z(0),
48  m_arrayPointer(nullptr)
49 {
51 }
double m_pValue
chi^2 probability of the fit.
Definition: Particle.h:1026
double m_pz
momentum component z
Definition: Particle.h:1017
unsigned m_mdstIndex
0-based index of MDST store array object
Definition: Particle.h:1030
double m_py
momentum component y
Definition: Particle.h:1016
double m_x
position component x
Definition: Particle.h:1021
double m_px
momentum component x
Definition: Particle.h:1015
TClonesArray * m_arrayPointer
Internal pointer to DataStore array containing the daughters of this particle.
Definition: Particle.h:1057
EParticleSourceObject m_particleSource
(mdst) source of particle
Definition: Particle.h:1029
void resetErrorMatrix()
Resets 7x7 error matrix All elements are set to 0.0.
Definition: Particle.cc:1083
EFlavorType m_flavorType
flavor type.
Definition: Particle.h:1028
double m_mass
particle (invariant) mass
Definition: Particle.h:1014
double m_z
position component z
Definition: Particle.h:1023
int m_pdgCode
PDG code.
Definition: Particle.h:1012
double m_y
position component y
Definition: Particle.h:1022
int m_properties
particle property
Definition: Particle.h:1031

◆ Particle() [2/11]

Particle ( const ROOT::Math::PxPyPzEVector &  momentum,
const int  pdgCode 
)

Constructor from a Lorentz vector and PDG code.

All other private members are set to their default values (0).

Parameters
momentumLorentz vector
pdgCodePDG code

◆ Particle() [3/11]

Particle ( const ROOT::Math::PxPyPzEVector &  momentum,
const int  pdgCode,
EFlavorType  flavorType,
const EParticleSourceObject  particleType,
const unsigned  mdstIndex 
)

Constructor for final state particles.

All other private members are set to their default values (0).

Parameters
momentumLorentz vector
pdgCodePDG code
flavorTypeflavor type
particleTypeparticle source
mdstIndexmdst index

◆ Particle() [4/11]

Particle ( const ROOT::Math::PxPyPzEVector &  momentum,
const int  pdgCode,
EFlavorType  flavorType,
const std::vector< int > &  daughterIndices,
TClonesArray *  arrayPointer = nullptr 
)

Constructor for composite particles.

All other private members are set to their default values (0).

Parameters
momentumLorentz vector
pdgCodePDG code
flavorTypedecay flavor type
daughterIndicesindices of daughters in StoreArray<Particle>
arrayPointerpointer to store array which stores the daughters, if the particle itself is stored in the same array the pointer can be automatically determined

◆ Particle() [5/11]

Particle ( const ROOT::Math::PxPyPzEVector &  momentum,
const int  pdgCode,
EFlavorType  flavorType,
const std::vector< int > &  daughterIndices,
int  properties,
TClonesArray *  arrayPointer = nullptr 
)

Constructor for composite particles.

All other private members are set to their default values (0).

Parameters
momentumLorentz vector
pdgCodePDG code
flavorTypedecay flavor type
daughterIndicesindices of daughters in StoreArray<Particle>
propertiesparticle property
arrayPointerpointer to store array which stores the daughters, if the particle itself is stored in the same array the pointer can be automatically determined

◆ Particle() [6/11]

Particle ( const ROOT::Math::PxPyPzEVector &  momentum,
const int  pdgCode,
EFlavorType  flavorType,
const std::vector< int > &  daughterIndices,
int  properties,
const std::vector< int > &  daughterProperties,
TClonesArray *  arrayPointer = nullptr 
)

Constructor for composite particles.

All other private members are set to their default values (0).

Parameters
momentumLorentz vector
pdgCodePDG code
flavorTypedecay flavor type
daughterIndicesindices of daughters in StoreArray<Particle>
propertiesparticle property
daughterPropertiesdaughter particle properties
arrayPointerpointer to store array which stores the daughters, if the particle itself is stored in the same array the pointer can be automatically determined

◆ Particle() [7/11]

Particle ( const Track track,
const Const::ChargedStable chargedStable 
)

Constructor from a reconstructed track (mdst object Track);.

Parameters
trackpointer to Track object
chargedStableType of charged particle

Definition at line 193 of file Particle.cc.

◆ Particle() [8/11]

Particle ( int  trackArrayIndex,
const TrackFitResult trackFit,
const Const::ChargedStable chargedStable 
)

Constructor from a reconstructed Track given as TrackFitResult.

To be used to create Particle objects from tracks with full control over the hypothesis (e.g. V0 daughters).

Parameters
trackArrayIndextrack StoreArray index
trackFitpointer to TrackFitResult object
chargedStableType of charged particle

Definition at line 200 of file Particle.cc.

◆ Particle() [9/11]

Particle ( const ECLCluster eclCluster,
const Const::ParticleType type = Const::photon 
)
explicit

Constructor of a photon from a reconstructed ECL cluster that is not matched to any charged track.

Parameters
eclClusterpointer to ECLCluster object
typethe kind of ParticleType we want (photon by default)

Definition at line 225 of file Particle.cc.

◆ Particle() [10/11]

Particle ( const KLMCluster klmCluster,
const int  pdgCode = Const::Klong.getPDGCode() 
)
explicit

Constructor from a reconstructed KLM cluster.

Parameters
klmClusterpointer to KLMCluster object
pdgCodePDG code (Klong by default)

Definition at line 295 of file Particle.cc.

◆ Particle() [11/11]

Particle ( const MCParticle MCparticle)
explicit

Constructor from MC particle (mdst object MCParticle)

Parameters
MCparticlepointer to MCParticle object

Definition at line 321 of file Particle.cc.

Member Function Documentation

◆ addExtraInfo()

void addExtraInfo ( const std::string &  name,
double  value 
)

Sets the user-defined data of given name to the given value.

throws std::runtime_error if variable is already set.

Definition at line 1337 of file Particle.cc.

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

◆ appendDaughter() [1/2]

void appendDaughter ( const Particle daughter,
const bool  updateType = true,
const int  daughterProperty = c_Ordinary 
)

Appends index of daughter to daughters index array.

Parameters
daughterpointer to the daughter particle
updateTypebool to set whether particle type should be updated
daughterPropertyproperty of the daughter particle

Definition at line 680 of file Particle.cc.

◆ appendDaughter() [2/2]

void appendDaughter ( int  particleIndex,
const bool  updateType = true 
)
inline

Appends index of daughter to daughters index array.

Parameters
particleIndexindex of daughter in StoreArray<Particle>
updateTypebool to set whether particle type should be updated

Definition at line 388 of file Particle.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.

◆ fillAllDaughters()

void fillAllDaughters ( std::vector< const Belle2::Particle * > &  allDaughters) const

Fill all generations' daughters into a vector.

Function is called recursively

Parameters
allDaughtersvector of daughter particles

Definition at line 1131 of file Particle.cc.

◆ fillDecayChain()

void fillDecayChain ( std::vector< int > &  decayChain) const
private

Fill vector with (PDGCode, MdstSource) pairs for the entire decay chain.

Used to determine if two Particles are copies or not.

Function is called recursively

Parameters
decayChainvector of (PDGCode, MdstSource) pairs for each particle in the decay chain of this particle

Definition at line 1144 of file Particle.cc.

◆ fillFSPDaughters()

void fillFSPDaughters ( std::vector< const Belle2::Particle * > &  fspDaughters) const

Fill final state particle daughters into a vector.

Function is called recursively

Parameters
fspDaughtersvector of daughter particles

Definition at line 1118 of file Particle.cc.

◆ forEachDaughter()

bool forEachDaughter ( const std::function< bool(const Particle *)> &  function,
bool  recursive = true,
bool  includeSelf = true 
) const

Apply a function to all daughters of this particle.

Parameters
functionfunction object to run on each daughter. If this function returns true the processing will be stopped immediately.
recursiveif true go through all daughters of daughters as well
includeSelfif true also apply the function to this particle
Returns
true if the function returned true for any of the particles it was applied to

Definition at line 1359 of file Particle.cc.

◆ generatePDGCodeFromCharge()

int generatePDGCodeFromCharge ( const int  chargedSign,
const Const::ChargedStable chargedStable 
)
private

Generate the PDG code with correct sign, using the charge.

Parameters
chargedSigncharge of the particle
chargedStableType of charged particle

Definition at line 1383 of file Particle.cc.

◆ get4Vector()

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

Returns Lorentz vector.

Returns
Lorentz vector

Definition at line 517 of file Particle.h.

◆ getAcoplanarity()

double getAcoplanarity ( ) const

Returns acoplanarity angle defined as the angle between the decay planes of the grand daughters in the particle's rest frame This assumes that the particle and its daughters have two daughters each.

Returns
acoplanarity angle

Definition at line 537 of file Particle.cc.

◆ getAllDaughters()

std::vector< const Belle2::Particle * > getAllDaughters ( ) const

Returns a vector of pointers to all generations' daughter particles.

Returns
vector of pointers to all generations' daughter particles

Definition at line 661 of file Particle.cc.

◆ getArrayPointer()

TClonesArray* getArrayPointer ( ) const
inline

Returns the pointer to the store array which holds the daughter particles.

Warning
TClonesArray is dangerously easy to misuse, please avoid.

Definition at line 911 of file Particle.h.

◆ getCharge()

double getCharge ( void  ) const

Returns particle charge.

Returns
particle charge in units of elementary charge

Definition at line 626 of file Particle.cc.

◆ getCosHelicity()

double getCosHelicity ( const Particle mother = nullptr) const

Returns cosine of the helicity angle The helicity angle is defined in the rest frame of the particle as the angle between the negative momentum of the mother and.

  • the momentum of the first daughter for two body decays
  • the momentum of the photon for pi0 Dalitz decays
  • the direction perpendicular to the daughter momenta for three body decays
    Parameters
    mothermother particle, if not given the center of mass system is taken as mother frame
    Returns
    cosine of the helicity angle

Definition at line 463 of file Particle.cc.

◆ getCosHelicityDaughter()

double getCosHelicityDaughter ( unsigned  iDaughter,
unsigned  iGrandDaughter = 0 
) const

Returns cosine of the helicity angle of the given daughter defined by given grand daughter.

Parameters
iDaughter0-based index of daughter particle
iGrandDaughter0-based index of grand daughter particle
Returns
cosine of the helicity angle

Definition at line 506 of file Particle.cc.

◆ getDaughter()

const Particle * getDaughter ( unsigned  i) const

Returns a pointer to the i-th daughter particle.

Parameters
i0-based index of daughter particle
Returns
Pointer to i-th daughter particles

Definition at line 635 of file Particle.cc.

◆ getDaughterIndices()

const std::vector<int>& getDaughterIndices ( ) const
inline

Returns a vector of store array indices of daughter particles.

Returns
vector of store array indices of daughter particle

Definition at line 694 of file Particle.h.

◆ getDaughterProperties()

const std::vector<int>& getDaughterProperties ( ) const
inline

Returns a vector of properties of daughter particles.

Returns
vector of daughter properties

Definition at line 703 of file Particle.h.

◆ getDaughters()

std::vector< Belle2::Particle * > getDaughters ( ) const

Returns a vector of pointers to daughter particles.

Returns
vector of pointers to daughter particles

Definition at line 641 of file Particle.cc.

◆ getECLCluster()

const ECLCluster * getECLCluster ( ) const

Returns the pointer to the ECLCluster object that was used to create this Particle (if ParticleType == c_ECLCluster).

Returns the pointer to the most energetic ECLCluster matched to the track (if ParticleType == c_Track). NULL pointer is returned, if the Particle has no relation to an ECLCluster (either the particle is a different type or there was no track match).

Returns
const pointer to the ECLCluster

Definition at line 895 of file Particle.cc.

◆ getECLClusterEnergy()

double getECLClusterEnergy ( ) const

Returns the energy of the ECLCluster for the particle.

The return value depends on the ECLCluster hypothesis.

Returns
energy of the ECLCluster

Definition at line 923 of file Particle.cc.

◆ getEffectiveMomentumScale()

double getEffectiveMomentumScale ( ) const
inline

Returns effective momentum scale which is the product of the momentum scaling and smearing factors.

Returns
momentum scaling factor

Definition at line 580 of file Particle.h.

◆ getEnergy()

double getEnergy ( ) const
inline

Returns total energy.

Returns
total energy

Definition at line 507 of file Particle.h.

◆ getExtraInfo()

double getExtraInfo ( const std::string &  name) const

Return given value if set.

throws std::runtime_error if variable is not set.

Definition at line 1290 of file Particle.cc.

◆ getFinalStateDaughters()

std::vector< const Belle2::Particle * > getFinalStateDaughters ( ) const

Returns a vector of pointers to Final State daughter particles.

Returns
vector of pointers to final state daughter particles

Definition at line 653 of file Particle.cc.

◆ getFlavorType()

EFlavorType getFlavorType ( ) const
inline

Returns flavor type of the decay (for FS particles: flavor type of particle)

Returns
flavor type (0=unflavored, 1=flavored)

Definition at line 441 of file Particle.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.

◆ getKLMCluster()

const KLMCluster * getKLMCluster ( ) const

Returns the pointer to the KLMCluster object that was used to create this Particle (ParticleType == c_KLMCluster).

Returns the pointer to the KLMCluster object associated to this Particle if ParticleType == c_Track. NULL pointer is returned, if the Particle has no relation to the KLMCluster.

Returns
const pointer to the KLMCluster

Definition at line 930 of file Particle.cc.

◆ getMass()

double getMass ( ) const
inline

Returns invariant mass (= nominal for FS particles)

Returns
invariant mass

Definition at line 479 of file Particle.h.

◆ getMCParticle()

const MCParticle * getMCParticle ( ) const

Returns the pointer to the MCParticle object that was used to create this Particle (ParticleType == c_MCParticle).

Returns the best MC match for this particle (if ParticleType == c_Track or c_ECLCluster or c_KLMCluster) NULL pointer is returned, if the Particle was not made from MCParticle or not matched.

Returns
const pointer to the MCParticle

Definition at line 946 of file Particle.cc.

◆ getMdstArrayIndex()

unsigned getMdstArrayIndex ( void  ) const
inline

Returns 0-based index of MDST store array object (0 for composite particles)

Returns
index of MDST store array object

Definition at line 459 of file Particle.h.

◆ getMdstArrayIndices()

std::vector< int > getMdstArrayIndices ( EParticleSourceObject  type) const

Returns a vector of StoreArray indices of given MDST dataobjects.

Parameters
typeEParticleSourceObject corresponding to a given MDST dataobject
Returns
vector of StoreArray indices of a given MDST dataobjects

Definition at line 669 of file Particle.cc.

◆ getMdstSource()

int getMdstSource ( ) const

Returns unique identifier of final state particle (needed in particle combiner)

Returns
unique identifier of final state particle

Definition at line 371 of file Particle.cc.

◆ getMomentum()

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

Returns momentum vector.

Returns
momentum vector

Definition at line 526 of file Particle.h.

◆ getMomentumErrorMatrix()

TMatrixFSym getMomentumErrorMatrix ( ) const

Returns the 4x4 momentum error matrix.

Returns
The 4x4 momentum error matrix (order: px,py,pz,E)

Definition at line 439 of file Particle.cc.

◆ getMomentumMagnitude()

double getMomentumMagnitude ( ) const
inline

Returns momentum magnitude.

Returns
momentum magnitude

Definition at line 535 of file Particle.h.

◆ getMomentumVertexErrorMatrix()

TMatrixFSym getMomentumVertexErrorMatrix ( ) const

Returns 7x7 error matrix.

Returns
7x7 error matrix (order: px,py,pz,E,x,y,z)

Definition at line 424 of file Particle.cc.

◆ getNDaughters()

unsigned getNDaughters ( void  ) const
inline

Returns number of daughter particles.

Returns
number of daughter particles

Definition at line 685 of file Particle.h.

◆ getP()

double getP ( ) const
inline

Returns momentum magnitude (same as getMomentumMagnitude but with shorter name)

Returns
momentum magnitude

Definition at line 544 of file Particle.h.

◆ getParticleFromGeneralizedIndexString()

const Particle * getParticleFromGeneralizedIndexString ( const std::string &  generalizedIndex) const

Explores the decay tree of the 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.

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

Definition at line 960 of file Particle.cc.

◆ getParticleSource()

EParticleSourceObject getParticleSource ( ) const
inline

Returns particle source as defined with enum EParticleSourceObject.

Returns
particle type

Definition at line 450 of file Particle.h.

◆ getPDGCode()

int getPDGCode ( void  ) const
inline

Returns PDG code.

Returns
PDG code

Definition at line 426 of file Particle.h.

◆ getPDGCodeUsedForFit()

int getPDGCodeUsedForFit ( ) const
inline

Return the always positive PDG code which was used for the track fit (if there was a track fit) of this particle.

This can be different than the Particle's PDG id as not all mass hypothesis are fitted during the reconstruction.

Definition at line 923 of file Particle.h.

◆ getPDGLifetime()

double getPDGLifetime ( ) const

Returns particle nominal lifetime.

Returns
nominal lifetime [sec]

Definition at line 617 of file Particle.cc.

◆ getPDGMass()

double getPDGMass ( void  ) const

Returns uncertainty on the invariant mass (requires valid momentum error matrix)

Returns
mass error Returns particle nominal mass
nominal mass

Definition at line 608 of file Particle.cc.

◆ getPIDLikelihood()

const PIDLikelihood * getPIDLikelihood ( ) const

Returns the pointer to the PIDLikelihood object that is related to the Track, which was used to create this Particle (ParticleType == c_Track).

NULL pointer is returned, if the Particle was not made from Track or if the Track has no relation to the PIDLikelihood

Returns
const pointer to the Track

Definition at line 875 of file Particle.cc.

◆ getProperty()

int getProperty ( ) const
inline

Returns particle property as a bit pattern The values are defined in the PropertyFlags enum and described in detail there.

Returns
Combination of Properties describing the particle property

Definition at line 470 of file Particle.h.

◆ getPValue()

double getPValue ( ) const
inline

Returns chi^2 probability of fit if done or -1.

Returns
p-value of fit (nan means no fit done)

Definition at line 625 of file Particle.h.

◆ getPx()

double getPx ( ) const
inline

Returns x component of momentum.

Returns
x component of momentum

Definition at line 553 of file Particle.h.

◆ getPy()

double getPy ( ) const
inline

Returns y component of momentum.

Returns
y component of momentum

Definition at line 562 of file Particle.h.

◆ getPz()

double getPz ( ) const
inline

Returns z component of momentum.

Returns
z component of momentum

Definition at line 571 of file Particle.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.

◆ getTrack()

const Track * getTrack ( ) const

Returns the pointer to the Track object that was used to create this Particle (ParticleType == c_Track).

NULL pointer is returned, if the Particle was not made from Track.

Returns
const pointer to the Track

Definition at line 849 of file Particle.cc.

◆ getTrackFitResult()

const TrackFitResult * getTrackFitResult ( ) const

Returns the pointer to the TrackFitResult that was used to create this Particle (ParticleType == c_Track).

NULL pointer is returned, if the Particle was not made from Track.

Returns
const pointer to the TrackFitResult

Definition at line 858 of file Particle.cc.

◆ getV0()

const V0 * getV0 ( ) const

Returns the pointer to the V0 object that was used to create this Particle (if ParticleType == c_V0).

NULL pointer is returned if the Particle was not made from a V0.

Returns
const pointer to the V0

Definition at line 884 of file Particle.cc.

◆ getVertex()

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

Returns vertex position (POCA for charged, IP for neutral FS particles)

Returns
vertex position

Definition at line 589 of file Particle.h.

◆ getVertexErrorMatrix()

TMatrixFSym getVertexErrorMatrix ( ) const

Returns the 3x3 position error sub-matrix.

Returns
The 3x3 position error matrix (order: x,y,z)

Definition at line 451 of file Particle.cc.

◆ getX()

double getX ( ) const
inline

Returns x component of vertex position.

Returns
x component of vertex position

Definition at line 598 of file Particle.h.

◆ getY()

double getY ( ) const
inline

Returns y component of vertex position.

Returns
y component of vertex position

Definition at line 607 of file Particle.h.

◆ getZ()

double getZ ( ) const
inline

Returns z component of vertex position.

Returns
z component of vertex position

Definition at line 616 of file Particle.h.

◆ isCopyOf()

bool isCopyOf ( const Particle oParticle,
bool  doDetailedComparison = false 
) const

Returns true if this Particle and oParticle are copies of each other.

Copies are defined as: o) The decay chain of both Particles is exactly the same o) Both Particles are constructed from exactly the same final state particles

  • Examples: M1 -> (C1 -> F1 F2) (C2 -> F3 F4) M2 -> (C1 -> F1 F2) (C2 -> F3 F5) M3 -> (C1 -> F1 F2) F3 F4 M4 -> (C1 -> F1 F2) (C2 -> F3 F4) and M4 is kinematically fitted (its momentum updated)

M1 and M2 are not copies since condition 2 is not fulfilled. M1 and M3 are not copies since condition 1 is not fulfilled. M1 and M4 are copies since both conditions are fulfilled.

Parameters
oParticlepointer to other particle
doDetailedComparisonif true, this means that particles of different PDG codes, but created from the same track or cluster will be indicated as copies. Returns B2FATAL in case of comparison of c_MCParticle type to a non c_MCParticle.
Returns
true if particles are copies of each-other, otherwise false

Definition at line 756 of file Particle.cc.

◆ overlapsWith()

bool overlapsWith ( const Particle oParticle) const

Returns true if final state ancestors of oParticle overlap.

Parameters
oParticlepointer to particle
Returns
true if overlap, otherwise false

Definition at line 741 of file Particle.cc.

◆ removeDaughter()

void removeDaughter ( const Particle daughter,
const bool  updateType = true 
)

Removes index of daughter from daughters index array.

Parameters
daughterpointer to the daughter particle
updateTypebool whether particle type should be updated if last daughter was removed

Definition at line 692 of file Particle.cc.

◆ replaceDaughter()

bool replaceDaughter ( const Particle oldDaughter,
Particle newDaughter 
)

Replace index of given daughter with new daughter, return true if a replacement is made.

Parameters
oldDaughterpointer to the daughter that will be removed
newDaughterpointer to the particle that will be added as a daughter

Definition at line 709 of file Particle.cc.

◆ replaceDaughterRecursively()

bool replaceDaughterRecursively ( const Particle oldDaughter,
Particle newDaughter 
)

Apply replaceDaughter to all Particles in the decay tree by looping recursively through it, return true if a replacement is made.

Parameters
oldDaughterpointer to the daughter that will be removed
newDaughterpointer to the particle that will be added as a daughter

Definition at line 727 of file Particle.cc.

◆ set4Vector()

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

Sets Lorentz vector.

Parameters
p4Lorentz vector

Definition at line 271 of file Particle.h.

◆ set4VectorDividingByMomentumScaling()

void set4VectorDividingByMomentumScaling ( const ROOT::Math::PxPyPzEVector &  p4)
inline

Sets Lorentz vector dividing by the momentum scaling factor.

Parameters
p4Lorentz vector

Definition at line 283 of file Particle.h.

◆ setExtraInfo()

void setExtraInfo ( const std::string &  name,
double  value 
)

Sets the user-defined data of given name to the given value.

throws std::runtime_error if variable isn't set.

Definition at line 1318 of file Particle.cc.

◆ setJacobiMatrix()

void setJacobiMatrix ( const TMatrixF &  jacobiMatrix)

Sets 4x6 jacobi matrix.

Parameters
jacobiMatrix4x6 momentum and vertex error matrix (order: px,py,pz,E,x,y,z)

Definition at line 411 of file Particle.cc.

◆ setMomentumScalingFactor()

void setMomentumScalingFactor ( double  momentumScalingFactor)
inline

Sets momentum scaling.

Parameters
momentumScalingFactorscaling factor

Definition at line 306 of file Particle.h.

◆ setMomentumSmearingFactor()

void setMomentumSmearingFactor ( double  momentumSmearingFactor)
inline

Sets momentum smearing.

Parameters
momentumSmearingFactorscaling factor

Definition at line 316 of file Particle.h.

◆ setMomentumVertexErrorMatrix()

void setMomentumVertexErrorMatrix ( const TMatrixFSym &  errMatrix)

Sets 7x7 error matrix.

Parameters
errMatrix7x7 momentum and vertex error matrix (order: px,py,pz,E,x,y,z)

Definition at line 397 of file Particle.cc.

◆ setPDGCode()

void setPDGCode ( const int  pdg)
inline

Sets PDG code.

Parameters
pdgPDG code

Definition at line 262 of file Particle.h.

◆ setPValue()

void setPValue ( double  pValue)
inline

Sets chi^2 probability of fit.

Parameters
pValuep-value of fit

Definition at line 338 of file Particle.h.

◆ setVertex()

void setVertex ( const ROOT::Math::XYZVector &  vertex)
inline

Sets position (decay vertex)

Parameters
vertexposition

Definition at line 295 of file Particle.h.

◆ storeErrorMatrix()

void storeErrorMatrix ( const TMatrixFSym &  errMatrix)
private

Stores 7x7 error matrix into private member m_errMatrix.

Parameters
errMatrix7x7 error matrix

Definition at line 1095 of file Particle.cc.

◆ storeJacobiMatrix()

void storeJacobiMatrix ( const TMatrixF &  jacobiMatrix)
private

Stores 4x6 Jacobi matrix into private member m_jacobiMatrix.

Parameters
jacobiMatrix4x6 error matrix

Definition at line 1106 of file Particle.cc.

◆ updateMass()

void updateMass ( const int  pdgCode)

Updates particle mass with the mass of the particle corresponding to the given PDG.

Parameters
pdgCodePDG code of the particle with the desired mass

Definition at line 601 of file Particle.cc.

◆ updateMomentum()

void updateMomentum ( const ROOT::Math::PxPyPzEVector &  p4,
const ROOT::Math::XYZVector &  vertex,
const TMatrixFSym &  errMatrix,
double  pValue 
)
inline

Sets Lorentz vector, position, 7x7 error matrix and p-value.

Parameters
p4Lorentz vector
vertexpoint (position or vertex)
errMatrix7x7 momentum and vertex error matrix (order: px,py,pz,E,x,y,z)
pValuechi^2 probability of the fit

Definition at line 358 of file Particle.h.

◆ writeExtraInfo()

void writeExtraInfo ( const std::string &  name,
const double  value 
)

Sets the user defined extraInfo.

Adds it if necessary, overwrites existing ones if they share the same name.

Definition at line 1309 of file Particle.cc.

Member Data Documentation

◆ m_arrayPointer

TClonesArray* m_arrayPointer
mutableprivate

Internal pointer to DataStore array containing the daughters of this particle.

This is a transient member and will not be written to file. The pointer is set by getArrayPointer() when first called.

Definition at line 1057 of file Particle.h.

◆ m_extraInfo

std::vector<double> m_extraInfo
private

Stores associated user defined values.

Order is given by string -> index mapping in ParticleExtraInfoMap. entry 0 is reserved specifies which map to use.

Definition at line 1048 of file Particle.h.

◆ m_identifier

int m_identifier = -1
private

Identifier that can be used to identify whether the particle is unique or is a copy or representation of another.

For example a kaon and pion particles constructed from the same Track are representations of the same physical object in the detector and cannot be used in the reconstruction of the same decay chain

Definition at line 1041 of file Particle.h.

◆ m_pValue

double m_pValue
private

chi^2 probability of the fit.

Default is nan

Definition at line 1026 of file Particle.h.


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