11 #include <framework/datastore/RelationsObject.h>
12 #include <framework/gearbox/Const.h>
13 #include <mdst/dataobjects/ECLCluster.h>
16 #include <TLorentzVector.h>
17 #include <TMatrixFSymfwd.h>
100 enum {c_DimPosition = 3, c_DimMomentum = 4, c_DimMatrix = 7,
101 c_SizeMatrix = c_DimMatrix * (c_DimMatrix + 1) / 2
108 enum {c_Px, c_Py, c_Pz, c_E, c_X, c_Y, c_Z};
139 Particle(
const TLorentzVector& momentum,
const int pdgCode);
150 Particle(
const TLorentzVector& momentum,
154 const unsigned mdstIndex);
165 Particle(
const TLorentzVector& momentum,
168 const std::vector<int>& daughterIndices,
169 TClonesArray* arrayPointer =
nullptr);
181 Particle(
const TLorentzVector& momentum,
184 const std::vector<int>& daughterIndices,
186 TClonesArray* arrayPointer =
nullptr);
199 Particle(
const TLorentzVector& momentum,
202 const std::vector<int>& daughterIndices,
204 const std::vector<int>& daughterProperties,
205 TClonesArray* arrayPointer =
nullptr);
225 [[deprecated(
"Please use the constructor without the chargedStableUsedForFit")]]
341 const TVector3& vertex,
342 const TMatrixFSym& errMatrix,
687 bool recursive =
true,
bool includeSelf =
true)
const;
739 bool isCopyOf(
const Particle* oParticle,
bool doDetailedComparison =
false)
const;
806 std::string
getName()
const override;
854 void setExtraInfo(
const std::string& name,
float value);
860 void addExtraInfo(
const std::string& name,
float value);
1017 void fillFSPDaughters(std::vector<const Belle2::Particle*>& fspDaughters)
const;
Provides a type-safe way to pass members of the chargedStableSet set.
The ParticleType class for identifying different particle types.
static const ParticleType neutron
neutron particle
static const ChargedStable muon
muon particle
static const ChargedStable pion
charged pion particle
static const ParticleType Klong
K^0_L particle.
static const ChargedStable proton
proton particle
static const ChargedStable kaon
charged kaon particle
static const ParticleType photon
photon particle
static const ChargedStable electron
electron particle
static const ChargedStable deuteron
deuteron particle
EHypothesisBit
The hypothesis bits for this ECLCluster (Connected region (CR) is split using this hypothesis.
@ c_nPhotons
CR is split into n photons (N1)
@ c_neutralHadron
CR is reconstructed as a neutral hadron (N2)
@ c_none
None as initializer.
A Class to store the Monte Carlo particle information.
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
Specialised SelectSubset<Particle> that also fixes daughter indices and all ParticleLists.
Class to store reconstructed particles.
void setProperty(const int properties)
sets m_properties
void removeExtraInfo()
Remove all stored extra info fields.
void updateJacobiMatrix()
Propagate the photon energy scaling to jacobian elements that were calculated using energy.
TMatrixFSym getVertexErrorMatrix() const
Returns the 3x3 position error sub-matrix.
float getEnergy() const
Returns total energy.
bool isMostLikely() const
Returns true if the (track-based) particle is created with its most likely mass hypothesis.
const KLMCluster * getKLMCluster() const
Returns the pointer to the KLMCluster object that was used to create this Particle (ParticleType == c...
float getY() const
Returns y component of vertex position.
const Track * getTrack() const
Returns the pointer to the Track object that was used to create this Particle (ParticleType == c_Trac...
void setMomentumPositionErrorMatrix(const TrackFitResult *trackFit)
Sets the momentum, position and error matrix for this particle (created from charged Track)
void set4Vector(const TLorentzVector &p4)
Sets Lorentz vector.
void storeErrorMatrix(const TMatrixFSym &errMatrix)
Stores 7x7 error matrix into private member m_errMatrix.
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.
std::vector< const Belle2::Particle * > getFinalStateDaughters() const
Returns a vector of pointers to Final State daughter particles.
const MCParticle * getMCParticle() const
Returns the pointer to the MCParticle object that was used to create this Particle (ParticleType == c...
const ECLCluster * getECLCluster() const
Returns the pointer to the ECLCluster object that was used to create this Particle (if ParticleType =...
void setPValue(float pValue)
Sets chi^2 probability of fit.
EParticleSourceObject
particle source enumerators
float m_mass
particle (invariant) mass
float getX() const
Returns x component of vertex position.
float getMomentumScalingFactor() const
Returns momentum scaling factor.
int m_pdgCodeUsedForFit
PDG code used for the track fit.
std::string getName() const override
Return name of this particle.
float getZ() const
Returns z component of vertex position.
bool overlapsWith(const Particle *oParticle) const
Returns true if final state ancestors of oParticle overlap.
void writeExtraInfo(const std::string &name, const float value)
Sets the user defined extraInfo.
float getPy() const
Returns y component of momentum.
TClonesArray * getArrayPointer() const
Returns the pointer to the store array which holds the daughter particles.
float getAcoplanarity() const
Returns acoplanarity angle defined as the angle between the decay planes of the grand daughters in th...
std::vector< std::string > getExtraInfoNames() const
get a list of the extra info names
bool isCopyOf(const Particle *oParticle, bool doDetailedComparison=false) const
Returns true if this Particle and oParticle are copies of each other.
std::vector< int > getMdstArrayIndices(EParticleSourceObject type) const
Returns a vector of StoreArray indices of given MDST dataobjects.
void setVertex(const TVector3 &vertex)
Sets position (decay vertex)
float getExtraInfo(const std::string &name) const
Return given value if set.
void resetJacobiMatrix()
Resets 4x6 error matrix All elements are set to 0.0.
float getPz() const
Returns z component of momentum.
float getPDGMass(void) const
Returns uncertainty on the invariant mass (requires valid momentum error matrix)
void storeJacobiMatrix(const TMatrixF &jacobiMatrix)
Stores 4x6 Jacobi matrix into private member m_jacobiMatrix.
void updateMomentum(const TLorentzVector &p4, const TVector3 &vertex, const TMatrixFSym &errMatrix, float pValue)
Sets Lorentz vector, position, 7x7 error matrix and p-value.
unsigned m_mdstIndex
0-based index of MDST store array object
float getMass() const
Returns invariant mass (= nominal for FS particles)
void setFlavorType()
sets m_flavorType using m_pdgCode
int getMdstSource() const
Returns unique identifier of final state particle (needed in particle combiner)
float m_errMatrix[c_SizeMatrix]
error matrix (1D representation)
float m_pValue
chi^2 probability of the fit.
bool hasExtraInfo(const std::string &name) const
Return whether the extra info with the given name is set.
std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
float getCosHelicity(const Particle *mother=nullptr) const
Returns cosine of the helicity angle The helicity angle is defined in the rest frame of the particle ...
TVector3 getVertex() const
Returns vertex position (POCA for charged, IP for neutral FS particles)
float getPValue() const
Returns chi^2 probability of fit if done or -1.
void setMdstArrayIndex(const int arrayIndex)
set mdst array index
TVector3 getMomentum() const
Returns momentum vector.
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...
unsigned getMdstArrayIndex(void) const
Returns 0-based index of MDST store array object (0 for composite particles)
float m_jacobiMatrix[c_SizeMatrix]
error matrix (1D representation)
float m_py
momentum component y
EFlavorType getFlavorType() const
Returns flavor type of the decay (for FS particles: flavor type of particle)
void fillFSPDaughters(std::vector< const Belle2::Particle * > &fspDaughters) const
Fill final state particle daughters into a vector.
const PIDLikelihood * getPIDLikelihood() const
Returns the pointer to the PIDLikelihood object that is related to the Track, which was used to creat...
const V0 * getV0() const
Returns the pointer to the V0 object that was used to create this Particle (if ParticleType == c_V0).
TClonesArray * m_arrayPointer
Internal pointer to DataStore array containing the daughters of this particle.
EParticleSourceObject m_particleSource
(mdst) source of particle
void fillDecayChain(std::vector< int > &decayChain) const
Fill vector with (PDGCode, MdstSource) pairs for the entire decay chain.
int getPDGCode(void) const
Returns PDG code.
void addExtraInfo(const std::string &name, float value)
Sets the user-defined data of given name to the given value.
bool wasExactFitHypothesisUsed() const
Returns true if the type represented by this Particle object was used use as a mass hypothesis during...
int getProperty() const
Returns particle property as a bit pattern The values are defined in the PropertyFlags enum and descr...
void setMomentumScalingFactor(float momentumScalingFactor)
Sets momentum scaling.
float getCharge(void) const
Returns particle charge.
float getP() const
Returns momentum magnitude (same as getMomentumMagnitude but with shorter name)
unsigned getNDaughters(void) const
Returns number of daughter particles.
int getPDGCodeUsedForFit()
Return the always positive PDG code which was used for the track fit (if there was a track fit) of th...
std::vector< Belle2::Particle * > getDaughters() const
Returns a vector of pointers to daughter particles.
const std::vector< int > & getDaughterIndices() const
Returns a vector of store array indices of daughter particles.
void resetErrorMatrix()
Resets 7x7 error matrix All elements are set to 0.0.
EFlavorType m_flavorType
flavor type.
float m_pz
momentum component z
int generatePDGCodeFromCharge(const int chargedSign, const Const::ChargedStable &chargedStable)
Generate the PDG code with correct sign, using the charge.
void appendDaughter(int particleIndex, const bool updateType=true)
Appends index of daughter to daughters index array.
Particle()
Default constructor.
TMatrixFSym getMomentumErrorMatrix() const
Returns the 4x4 momentum error matrix.
std::vector< int > m_daughterProperties
daughter particle properties
float m_px
momentum component x
std::vector< int > m_daughterIndices
daughter particle indices
TLorentzVector get4Vector() const
Returns Lorentz vector.
void setJacobiMatrix(const TMatrixF &jacobiMatrix)
Sets 4x6 jacobi matrix.
int getExtraInfoMap() const
Return the id of the associated ParticleExtraInfoMap or -1 if no map is set.
float m_y
position component y
void setMomentumVertexErrorMatrix(const TMatrixFSym &errMatrix)
Sets 7x7 error matrix.
EParticleSourceObject getParticleSource() const
Returns particle source as defined with enum EParticleSourceObject.
void updateMass(const int pdgCode)
Updates particle mass with the mass of the particle corresponding to the given PDG.
float getMomentumMagnitude() const
Returns momentum magnitude.
void print() const
Prints the contents of a Particle object to standard output.
EFlavorType
describes flavor type, see getFlavorType().
@ c_Unflavored
Is its own antiparticle or we don't know whether it is a particle/antiparticle.
@ c_Flavored
Is either particle or antiparticle.
TMatrixFSym getMomentumVertexErrorMatrix() const
Returns 7x7 error matrix.
PropertyFlags
Flags that describe the particle property, which are used in the MC matching.
@ c_IsIgnoreNeutrino
Is the particle MC matched with the ignore missing neutrino flag set?
@ c_IsIgnoreRadiatedPhotons
Is the particle MC matched with the ignore radiated photon flag set?
@ c_IsIgnoreGamma
Is the particle MC matched with the ignore missing gamma flag set?
@ c_IsUnspecified
Ordinary particles.
@ c_IsIgnoreBrems
Is the particle MC matched with the ignore added Brems gamma flag set?
@ c_IsIgnoreDecayInFlight
Is the particle MC matched with the ignore DecayInFlight flag set?
@ c_IsIgnoreMisID
Is the particle MC matched with the ignore MisID 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?
double getECLClusterEnergy() const
Returns the energy of the ECLCluster for the particle.
const TrackFitResult * getTrackFitResult() const
Returns the pointer to the TrackFitResult that was used to create this Particle (ParticleType == c_Tr...
void removeDaughter(const Particle *daughter, const bool updateType=true)
Removes index of daughter from daughters index array.
float getCosHelicityDaughter(unsigned iDaughter, unsigned iGrandDaughter=0) const
Returns cosine of the helicity angle of the given daughter defined by given grand daughter.
unsigned int getExtraInfoSize() const
Return the size of the extra info array.
int m_identifier
Identifier that can be used to identify whether the particle is unique or is a copy or representation...
float m_momentumScale
momentum scaling factor
void appendDaughter(const Particle *daughter, const bool updateType=true)
Appends index of daughter to daughters index array.
const std::vector< int > & getDaughterProperties() const
Returns a vector of properties of daughter particles.
int m_properties
particle property
std::vector< float > m_extraInfo
Stores associated user defined values.
float m_z
position component z
ClassDefOverride(Particle, 14)
Class to store reconstructed particles.
float m_x
position component x
float getPx() const
Returns x component of momentum.
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
ECLCluster::EHypothesisBit getECLClusterEHypothesisBit() const
Returns the ECLCluster EHypothesisBit for this Particle.
void setExtraInfo(const std::string &name, float value)
Sets the user-defined data of given name to the given value.
Defines interface for accessing relations of objects in StoreArray.
TClonesArray * getArrayPointer() const
Returns the pointer to the raw DataStore array holding this object (protected since these arrays are ...
Values of the result of a track fit with a given particle hypothesis.
Class that bundles various TrackFitResults.
Object holding information for V0s.
Abstract base class for different kinds of events.