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