Belle II Software
release-08-01-10
|
Class to store reconstructed particles. More...
#include <Particle.h>
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 Particle * | getDaughter (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 Track * | getTrack () const |
Returns the pointer to the Track object that was used to create this Particle (ParticleType == c_Track). More... | |
const TrackFitResult * | getTrackFitResult () const |
Returns the pointer to the TrackFitResult that was used to create this Particle (ParticleType == c_Track). More... | |
const V0 * | getV0 () const |
Returns the pointer to the V0 object that was used to create this Particle (if ParticleType == c_V0). More... | |
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). More... | |
const ECLCluster * | getECLCluster () 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 KLMCluster * | getKLMCluster () const |
Returns the pointer to the KLMCluster object that was used to create this Particle (ParticleType == c_KLMCluster). More... | |
const MCParticle * | getMCParticle () 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 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. 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::StoreEntry * | m_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 |
Class to store reconstructed particles.
This class is a common representation of all particle types, e.g.:
Private members are limited to those which completely define the particle and that are common to all particle types. These are:
Additional private members are needed in order to make composite particles (via combinations):
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.
enum 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.
enum PropertyFlags |
Flags that describe the particle property, which are used in the MC matching.
Definition at line 116 of file Particle.h.
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.
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).
momentum | Lorentz vector |
pdgCode | PDG code |
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).
momentum | Lorentz vector |
pdgCode | PDG code |
flavorType | flavor type |
particleType | particle source |
mdstIndex | mdst index |
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).
momentum | Lorentz vector |
pdgCode | PDG code |
flavorType | decay flavor type |
daughterIndices | indices of daughters in StoreArray<Particle> |
arrayPointer | pointer to store array which stores the daughters, if the particle itself is stored in the same array the pointer can be automatically determined |
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).
momentum | Lorentz vector |
pdgCode | PDG code |
flavorType | decay flavor type |
daughterIndices | indices of daughters in StoreArray<Particle> |
properties | particle property |
arrayPointer | pointer to store array which stores the daughters, if the particle itself is stored in the same array the pointer can be automatically determined |
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).
momentum | Lorentz vector |
pdgCode | PDG code |
flavorType | decay flavor type |
daughterIndices | indices of daughters in StoreArray<Particle> |
properties | particle property |
daughterProperties | daughter particle properties |
arrayPointer | pointer to store array which stores the daughters, if the particle itself is stored in the same array the pointer can be automatically determined |
Particle | ( | const Track * | track, |
const Const::ChargedStable & | chargedStable | ||
) |
Constructor from a reconstructed track (mdst object Track);.
track | pointer to Track object |
chargedStable | Type of charged particle |
Definition at line 193 of file Particle.cc.
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).
trackArrayIndex | track StoreArray index |
trackFit | pointer to TrackFitResult object |
chargedStable | Type of charged particle |
Definition at line 200 of file Particle.cc.
|
explicit |
Constructor of a photon from a reconstructed ECL cluster that is not matched to any charged track.
eclCluster | pointer to ECLCluster object |
type | the kind of ParticleType we want (photon by default) |
Definition at line 225 of file Particle.cc.
|
explicit |
Constructor from a reconstructed KLM cluster.
klmCluster | pointer to KLMCluster object |
pdgCode | PDG code (Klong by default) |
Definition at line 295 of file Particle.cc.
|
explicit |
Constructor from MC particle (mdst object MCParticle)
MCparticle | pointer to MCParticle object |
Definition at line 321 of file Particle.cc.
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.
|
inlineinherited |
Add a relation from this object to another object (with caching).
object | The object to which the relation should point. |
weight | The weight of the relation. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 142 of file RelationsObject.h.
|
inlineinherited |
Add a relation from this object to another object (no caching, can be quite slow).
object | The object to which the relation should point. |
weight | The weight of the relation. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 155 of file RelationsObject.h.
void appendDaughter | ( | const Particle * | daughter, |
const bool | updateType = true , |
||
const int | daughterProperty = c_Ordinary |
||
) |
Appends index of daughter to daughters index array.
daughter | pointer to the daughter particle |
updateType | bool to set whether particle type should be updated |
daughterProperty | property of the daughter particle |
Definition at line 680 of file Particle.cc.
|
inline |
Appends index of daughter to daughters index array.
particleIndex | index of daughter in StoreArray<Particle> |
updateType | bool to set whether particle type should be updated |
Definition at line 388 of file Particle.h.
|
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.
void fillAllDaughters | ( | std::vector< const Belle2::Particle * > & | allDaughters | ) | const |
Fill all generations' daughters into a vector.
Function is called recursively
allDaughters | vector of daughter particles |
Definition at line 1131 of file Particle.cc.
|
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
decayChain | vector of (PDGCode, MdstSource) pairs for each particle in the decay chain of this particle |
Definition at line 1144 of file Particle.cc.
void fillFSPDaughters | ( | std::vector< const Belle2::Particle * > & | fspDaughters | ) | const |
Fill final state particle daughters into a vector.
Function is called recursively
fspDaughters | vector of daughter particles |
Definition at line 1118 of file Particle.cc.
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.
function | function object to run on each daughter. If this function returns true the processing will be stopped immediately. |
recursive | if true go through all daughters of daughters as well |
includeSelf | if true also apply the function to this particle |
Definition at line 1359 of file Particle.cc.
|
private |
Generate the PDG code with correct sign, using the charge.
chargedSign | charge of the particle |
chargedStable | Type of charged particle |
Definition at line 1383 of file Particle.cc.
|
inline |
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.
Definition at line 537 of file Particle.cc.
std::vector< const Belle2::Particle * > getAllDaughters | ( | ) | const |
Returns a vector of pointers to all generations' daughter particles.
Definition at line 661 of file Particle.cc.
|
inline |
Returns the pointer to the store array which holds the daughter particles.
Definition at line 911 of file Particle.h.
double getCharge | ( | void | ) | const |
Returns particle charge.
Definition at line 626 of file Particle.cc.
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.
mother | mother particle, if not given the center of mass system is taken as mother frame |
Definition at line 463 of file Particle.cc.
double getCosHelicityDaughter | ( | unsigned | iDaughter, |
unsigned | iGrandDaughter = 0 |
||
) | const |
Returns cosine of the helicity angle of the given daughter defined by given grand daughter.
iDaughter | 0-based index of daughter particle |
iGrandDaughter | 0-based index of grand daughter particle |
Definition at line 506 of file Particle.cc.
const Particle * getDaughter | ( | unsigned | i | ) | const |
Returns a pointer to the i-th daughter particle.
i | 0-based index of daughter particle |
Definition at line 635 of file Particle.cc.
|
inline |
Returns a vector of store array indices of daughter particles.
Definition at line 694 of file Particle.h.
|
inline |
Returns a vector of properties of daughter particles.
Definition at line 703 of file Particle.h.
std::vector< Belle2::Particle * > getDaughters | ( | ) | const |
Returns a vector of pointers to daughter particles.
Definition at line 641 of file Particle.cc.
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).
Definition at line 895 of file Particle.cc.
double getECLClusterEnergy | ( | ) | const |
Returns the energy of the ECLCluster for the particle.
The return value depends on the ECLCluster hypothesis.
Definition at line 923 of file Particle.cc.
|
inline |
Returns effective momentum scale which is the product of the momentum scaling and smearing factors.
Definition at line 580 of file Particle.h.
|
inline |
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.
std::vector< const Belle2::Particle * > getFinalStateDaughters | ( | ) | const |
Returns a vector of pointers to Final State daughter particles.
Definition at line 653 of file Particle.cc.
|
inline |
Returns flavor type of the decay (for FS particles: flavor type of particle)
Definition at line 441 of file Particle.h.
|
inlineinherited |
Return a short summary of this object's contents in raw text format.
Returns the contents of getInfoHTML() while translating line-breaks etc.
Definition at line 370 of file RelationsObject.h.
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.
Definition at line 930 of file Particle.cc.
|
inline |
Returns invariant mass (= nominal for FS particles)
Definition at line 479 of file Particle.h.
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.
Definition at line 946 of file Particle.cc.
|
inline |
Returns 0-based index of MDST store array object (0 for composite particles)
Definition at line 459 of file Particle.h.
std::vector< int > getMdstArrayIndices | ( | EParticleSourceObject | type | ) | const |
Returns a vector of StoreArray indices of given MDST dataobjects.
type | EParticleSourceObject corresponding to a given MDST dataobject |
Definition at line 669 of file Particle.cc.
int getMdstSource | ( | ) | const |
Returns unique identifier of final state particle (needed in particle combiner)
Definition at line 371 of file Particle.cc.
|
inline |
TMatrixFSym getMomentumErrorMatrix | ( | ) | const |
Returns the 4x4 momentum error matrix.
Definition at line 439 of file Particle.cc.
|
inline |
TMatrixFSym getMomentumVertexErrorMatrix | ( | ) | const |
Returns 7x7 error matrix.
Definition at line 424 of file Particle.cc.
|
inline |
Returns number of daughter particles.
Definition at line 685 of file Particle.h.
|
inline |
Returns momentum magnitude (same as getMomentumMagnitude but with shorter name)
Definition at line 544 of file Particle.h.
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.
generalizedIndex | the generalized index of the particle to be returned |
Definition at line 960 of file Particle.cc.
|
inline |
Returns particle source as defined with enum EParticleSourceObject.
Definition at line 450 of file Particle.h.
|
inline |
|
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.
double getPDGLifetime | ( | ) | const |
Returns particle nominal lifetime.
Definition at line 617 of file Particle.cc.
double getPDGMass | ( | void | ) | const |
Returns uncertainty on the invariant mass (requires valid momentum error matrix)
Definition at line 608 of file Particle.cc.
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
Definition at line 875 of file Particle.cc.
|
inline |
Returns particle property as a bit pattern The values are defined in the PropertyFlags enum and described in detail there.
Definition at line 470 of file Particle.h.
|
inline |
Returns chi^2 probability of fit if done or -1.
Definition at line 625 of file Particle.h.
|
inline |
Returns x component of momentum.
Definition at line 553 of file Particle.h.
|
inline |
Returns y component of momentum.
Definition at line 562 of file Particle.h.
|
inline |
Returns z component of momentum.
Definition at line 571 of file Particle.h.
|
inlineinherited |
Get the object to or from which this object has a relation.
T | The class of objects to or from which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 278 of file RelationsObject.h.
|
inlineinherited |
Get the object from which this object has a relation.
FROM | The class of objects from which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 263 of file RelationsObject.h.
|
inlineinherited |
Get first related object & weight of relation pointing from an array.
FROM | The class of objects from which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 314 of file RelationsObject.h.
|
inlineinherited |
Get the object to which this object has a relation.
TO | The class of objects to which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 248 of file RelationsObject.h.
|
inlineinherited |
Get first related object & weight of relation pointing to an array.
TO | The class of objects to which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 297 of file RelationsObject.h.
|
inlineinherited |
Get first related object & weight of relation pointing from/to an array.
T | The class of objects to or from which the relation points. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 331 of file RelationsObject.h.
|
inlineinherited |
Get the relations that point from another store array to this object.
FROM | The class of objects from which the relations point. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 212 of file RelationsObject.h.
|
inlineinherited |
Get the relations that point from this object to another store array.
TO | The class of objects to which the relations point. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 197 of file RelationsObject.h.
|
inlineinherited |
Get the relations between this object and another store array.
Relations in both directions are returned.
T | The class of objects to or from which the relations point. |
name | The 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. |
namedRelation | Additional name for the relation, or "" for the default naming |
Definition at line 230 of file RelationsObject.h.
const Track * getTrack | ( | ) | const |
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.
Definition at line 858 of file Particle.cc.
const V0 * getV0 | ( | ) | const |
|
inline |
Returns vertex position (POCA for charged, IP for neutral FS particles)
Definition at line 589 of file Particle.h.
TMatrixFSym getVertexErrorMatrix | ( | ) | const |
Returns the 3x3 position error sub-matrix.
Definition at line 451 of file Particle.cc.
|
inline |
Returns x component of vertex position.
Definition at line 598 of file Particle.h.
|
inline |
Returns y component of vertex position.
Definition at line 607 of file Particle.h.
|
inline |
Returns z component of vertex position.
Definition at line 616 of file Particle.h.
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
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.
oParticle | pointer to other particle |
doDetailedComparison | if 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. |
Definition at line 756 of file Particle.cc.
bool overlapsWith | ( | const Particle * | oParticle | ) | const |
Returns true if final state ancestors of oParticle overlap.
oParticle | pointer to particle |
Definition at line 741 of file Particle.cc.
void removeDaughter | ( | const Particle * | daughter, |
const bool | updateType = true |
||
) |
Removes index of daughter from daughters index array.
daughter | pointer to the daughter particle |
updateType | bool whether particle type should be updated if last daughter was removed |
Definition at line 692 of file Particle.cc.
Replace index of given daughter with new daughter, return true if a replacement is made.
oldDaughter | pointer to the daughter that will be removed |
newDaughter | pointer to the particle that will be added as a daughter |
Definition at line 709 of file Particle.cc.
Apply replaceDaughter to all Particles in the decay tree by looping recursively through it, return true if a replacement is made.
oldDaughter | pointer to the daughter that will be removed |
newDaughter | pointer to the particle that will be added as a daughter |
Definition at line 727 of file Particle.cc.
|
inline |
|
inline |
Sets Lorentz vector dividing by the momentum scaling factor.
p4 | Lorentz vector |
Definition at line 283 of file Particle.h.
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.
void setJacobiMatrix | ( | const TMatrixF & | jacobiMatrix | ) |
Sets 4x6 jacobi matrix.
jacobiMatrix | 4x6 momentum and vertex error matrix (order: px,py,pz,E,x,y,z) |
Definition at line 411 of file Particle.cc.
|
inline |
Sets momentum scaling.
momentumScalingFactor | scaling factor |
Definition at line 306 of file Particle.h.
|
inline |
Sets momentum smearing.
momentumSmearingFactor | scaling factor |
Definition at line 316 of file Particle.h.
void setMomentumVertexErrorMatrix | ( | const TMatrixFSym & | errMatrix | ) |
Sets 7x7 error matrix.
errMatrix | 7x7 momentum and vertex error matrix (order: px,py,pz,E,x,y,z) |
Definition at line 397 of file Particle.cc.
|
inline |
|
inline |
Sets chi^2 probability of fit.
pValue | p-value of fit |
Definition at line 338 of file Particle.h.
|
inline |
|
private |
Stores 7x7 error matrix into private member m_errMatrix.
errMatrix | 7x7 error matrix |
Definition at line 1095 of file Particle.cc.
|
private |
Stores 4x6 Jacobi matrix into private member m_jacobiMatrix.
jacobiMatrix | 4x6 error matrix |
Definition at line 1106 of file Particle.cc.
void updateMass | ( | const int | pdgCode | ) |
Updates particle mass with the mass of the particle corresponding to the given PDG.
pdgCode | PDG code of the particle with the desired mass |
Definition at line 601 of file Particle.cc.
|
inline |
Sets Lorentz vector, position, 7x7 error matrix and p-value.
p4 | Lorentz vector |
vertex | point (position or vertex) |
errMatrix | 7x7 momentum and vertex error matrix (order: px,py,pz,E,x,y,z) |
pValue | chi^2 probability of the fit |
Definition at line 358 of file Particle.h.
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.
|
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.
|
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.
|
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.
|
private |