Belle II Software development
Particle.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <framework/datastore/RelationsObject.h>
12#include <framework/gearbox/Const.h>
13#include <mdst/dataobjects/ECLCluster.h>
14
15#include <Math/Vector3D.h>
16#include <Math/Vector4D.h>
17#include <TMatrixFfwd.h>
18#include <TMatrixFSymfwd.h>
19
20#include <vector>
21
22class TClonesArray;
23
24namespace Belle2 {
30 // forward declarations
31 class KLMCluster;
32 class Track;
33 class TrackFitResult;
34 class MCParticle;
35 class PIDLikelihood;
36 class V0;
37 class Kink;
38
76 class Particle : public RelationsObject {
77
78 public:
79
84 c_Undefined = 0,
85 c_Track = 1,
86 c_ECLCluster = 2,
87 c_KLMCluster = 3,
88 c_V0 = 4,
89 c_MCParticle = 5,
90 c_Composite = 6,
91 c_NoMDSTSource = 7,
92 c_Kink = 8
93 };
94
99 };
100
104 enum {c_DimPosition = 3, c_DimMomentum = 4, c_DimMatrix = 7,
105 c_SizeMatrix = c_DimMatrix * (c_DimMatrix + 1) / 2
106 };
107
112 enum {c_Px, c_Py, c_Pz, c_E, c_X, c_Y, c_Z};
113
119 c_Ordinary = 0,
129 };
130
135 Particle();
136
143 Particle(const ROOT::Math::PxPyPzEVector& momentum, const int pdgCode);
144
154 Particle(const ROOT::Math::PxPyPzEVector& momentum,
155 const int pdgCode,
156 EFlavorType flavorType,
157 const EParticleSourceObject particleType,
158 const unsigned mdstIndex);
159
169 Particle(const ROOT::Math::PxPyPzEVector& momentum,
170 const int pdgCode,
171 EFlavorType flavorType,
172 const std::vector<int>& daughterIndices,
173 TClonesArray* arrayPointer = nullptr);
174
185 Particle(const ROOT::Math::PxPyPzEVector& momentum,
186 const int pdgCode,
187 EFlavorType flavorType,
188 const std::vector<int>& daughterIndices,
189 int properties,
190 TClonesArray* arrayPointer = nullptr);
191
203 Particle(const ROOT::Math::PxPyPzEVector& momentum,
204 const int pdgCode,
205 EFlavorType flavorType,
206 const std::vector<int>& daughterIndices,
207 int properties,
208 const std::vector<int>& daughterProperties,
209 TClonesArray* arrayPointer = nullptr);
210
216 Particle(const Track* track,
217 const Const::ChargedStable& chargedStable);
218
227 Particle(int trackArrayIndex, const TrackFitResult* trackFit,
228 const Const::ChargedStable& chargedStable);
229
236 Particle(const Kink* kink, const Const::ChargedStable& chargedStable,
237 const unsigned trackFitResultIndex);
238
244 explicit Particle(const ECLCluster* eclCluster,
245 const Const::ParticleType& type = Const::photon);
246
252 explicit Particle(const KLMCluster* klmCluster, const int pdgCode = Const::Klong.getPDGCode());
253
258 explicit Particle(const MCParticle* MCparticle);
259
264
265 public:
266
267 // setters
268
273 void setPDGCode(const int pdg)
274 {
275 m_pdgCode = pdg;
276 }
277
282 void set4Vector(const ROOT::Math::PxPyPzEVector& p4)
283 {
284 m_px = p4.Px();
285 m_py = p4.Py();
286 m_pz = p4.Pz();
287 m_mass = p4.M();
288 }
289
294 void set4VectorDividingByMomentumScaling(const ROOT::Math::PxPyPzEVector& p4)
295 {
296 m_px = p4.Px() / m_momentumScale;
297 m_py = p4.Py() / m_momentumScale;
298 m_pz = p4.Pz() / m_momentumScale;
299 m_mass = p4.M();
300 }
301
306 void setVertex(const ROOT::Math::XYZVector& vertex)
307 {
308 m_x = vertex.X();
309 m_y = vertex.Y();
310 m_z = vertex.Z();
311 };
312
317 void setEnergyLossCorrection(double energyLossCorrection)
318 {
319 m_energyLossCorrection = energyLossCorrection;
320 }
321
327 {
328 if (m_energyLossCorrection == 0.0) {
329 return 1.0;
330 }
331 double origP = m_momentumScale * sqrt(m_px * m_px + m_py * m_py + m_pz * m_pz);
332 if (origP == 0.0) {
333 return 1.0;
334 }
335 double origE = sqrt(origP * origP + m_mass * m_mass);
336
337 double newP = sqrt((origE - m_energyLossCorrection) * (origE - m_energyLossCorrection) - m_mass * m_mass);
338 return newP / origP;
339 }
340
345 void setMomentumScalingFactor(double momentumScalingFactor)
346 {
347 m_momentumScalingFactor = momentumScalingFactor;
349 }
350
355 void setMomentumSmearingFactor(double momentumSmearingFactor)
356 {
357 m_momentumSmearingFactor = momentumSmearingFactor;
359 }
360
365 void setJacobiMatrix(const TMatrixF& jacobiMatrix);
366
371 void setMomentumVertexErrorMatrix(const TMatrixFSym& errMatrix);
372
377 void setPValue(double pValue)
378 {
379 m_pValue = pValue;
380 }
381
385 void setProperty(const int properties)
386 {
387 m_properties = properties;
388 }
389
397 void updateMomentum(const ROOT::Math::PxPyPzEVector& p4,
398 const ROOT::Math::XYZVector& vertex,
399 const TMatrixFSym& errMatrix,
400 double pValue)
401 {
402 set4Vector(p4);
403 setVertex(vertex);
405 m_pValue = pValue;
406 }
407
412 void updateMass(const int pdgCode);
413
420 void appendDaughter(const Particle* daughter, const bool updateType = true, const int daughterProperty = c_Ordinary);
421
427 void appendDaughter(int particleIndex, const bool updateType = true)
428 {
429 if (updateType) {
430 // is it a composite particle or fsr corrected?
431 m_particleSource = c_Composite;
432 }
433 m_daughterIndices.push_back(particleIndex);
434 m_daughterProperties.push_back(c_Ordinary);
435 }
436
442 void removeDaughter(const Particle* daughter, const bool updateType = true);
443
449 bool replaceDaughter(const Particle* oldDaughter, Particle* newDaughter);
450
457 bool replaceDaughterRecursively(const Particle* oldDaughter, Particle* newDaughter);
458
459 // getters
460
465 int getPDGCode(void) const
466 {
467 return m_pdgCode;
468 }
469
474 double getCharge(void) const;
475
481 {
482 return m_flavorType;
483 }
484
490 {
491 return m_particleSource;
492 }
493
498 unsigned getMdstArrayIndex(void) const
499 {
500 return m_mdstIndex;
501 }
502
507 unsigned getTrackFitResultIndex(void) const
508 {
510 }
511
518 int getProperty() const
519 {
520 return m_properties;
521 }
522
527 double getMass() const
528 {
529 return m_mass;
530 }
531
537 //double getMassError() const;
538
543 double getPDGMass(void) const;
544
549 double getPDGLifetime() const;
550
555 double getEnergy() const
556 {
561 }
562
567 ROOT::Math::PxPyPzEVector get4Vector() const
568 {
569 double correction = getMomentumLossCorrectionFactor();
570 return ROOT::Math::PxPyPzEVector(m_momentumScale * correction * m_px,
571 m_momentumScale * correction * m_py,
572 m_momentumScale * correction * m_pz,
573 getEnergy());
574 }
575
580 ROOT::Math::XYZVector getMomentum() const
581 {
582 return m_momentumScale * getMomentumLossCorrectionFactor() * ROOT::Math::XYZVector(m_px, m_py, m_pz);
583 };
584
589 double getMomentumMagnitude() const
590 {
591 return getP();
592 };
593
598 double getP() const
599 {
601 };
602
607 double getPx() const
608 {
610 }
611
616 double getPy() const
617 {
619 }
620
625 double getPz() const
626 {
628 }
629
635 {
636 return m_momentumScale;
637 }
638
644 {
646 }
651 ROOT::Math::XYZVector getVertex() const
652 {
653 return ROOT::Math::XYZVector(m_x, m_y, m_z);
654 };
655
660 double getX() const
661 {
662 return m_x;
663 }
664
669 double getY() const
670 {
671 return m_y;
672 }
673
678 double getZ() const
679 {
680 return m_z;
681 }
682
687 double getPValue() const
688 {
689 return m_pValue;
690 }
691
696 TMatrixFSym getMomentumVertexErrorMatrix() const;
697
702 TMatrixFSym getMomentumErrorMatrix() const;
703
708 TMatrixFSym getVertexErrorMatrix() const;
709
719 double getCosHelicity(const Particle* mother = nullptr) const;
720
727 double getCosHelicityDaughter(unsigned iDaughter, unsigned iGrandDaughter = 0) const;
728
734 double getAcoplanarity() const;
735
736
741 int getMdstSource() const;
742
747 unsigned getNDaughters(void) const
748 {
749 return m_daughterIndices.size();
750 }
751
756 const std::vector<int>& getDaughterIndices() const
757 {
758 return m_daughterIndices;
759 }
760
765 const std::vector<int>& getDaughterProperties() const
766 {
768 }
769
775 const Particle* getDaughter(unsigned i) const;
776
786 bool forEachDaughter(const std::function<bool(const Particle*)>& function,
787 bool recursive = true, bool includeSelf = true) const;
788
793 std::vector<Belle2::Particle*> getDaughters() const;
794 //Need namespace qualifier because ROOT CINT has troubles otherwise
795
800 std::vector<const Belle2::Particle*> getFinalStateDaughters() const;
801 //Need namespace qualifier because ROOT CINT has troubles otherwise
802
807 std::vector<const Belle2::Particle*> getAllDaughters() const;
808 //Need namespace qualifier because ROOT CINT has troubles otherwise
809
816 std::vector<int> getMdstArrayIndices(EParticleSourceObject type) const;
817
823 bool overlapsWith(const Particle* oParticle) const;
824
846 bool isCopyOf(const Particle* oParticle, bool doDetailedComparison = false) const;
847
853 const Track* getTrack() const;
854
860 const TrackFitResult* getTrackFitResult() const;
861
868 const V0* getV0() const;
869
876 const Kink* getKink() const;
877
886 const PIDLikelihood* getPIDLikelihood() const;
887
894 const ECLCluster* getECLCluster() const;
895
901 double getECLClusterEnergy() const;
902
909 const KLMCluster* getKLMCluster() const;
910
918 const MCParticle* getMCParticle() const;
919
921 std::string getName() const override;
922
924 std::string getInfoHTML() const override;
925
929 void print() const;
930
932 std::vector<std::string> getExtraInfoNames() const;
933
937 void removeExtraInfo();
938
943 double getExtraInfo(const std::string& name) const;
944
946 bool hasExtraInfo(const std::string& name) const;
947
949 int getExtraInfoMap() const
950 {
951 return !m_extraInfo.empty() ? m_extraInfo[0] : -1;
952 }
953
955 unsigned int getExtraInfoSize() const
956 {
957 return m_extraInfo.size();
958 }
959
963 void writeExtraInfo(const std::string& name, const double value);
964
969 void setExtraInfo(const std::string& name, double value);
970
975 void addExtraInfo(const std::string& name, double value);
976
981 TClonesArray* getArrayPointer() const
982 {
983 if (!m_arrayPointer)
985 return m_arrayPointer;
986 }
987
994 {
995 return std::abs(m_pdgCodeUsedForFit);
996 }
997
1004 {
1005 return std::abs(m_pdgCodeUsedForFit) == std::abs(m_pdgCode);
1006 }
1007
1012 bool isMostLikely() const;
1013
1018 std::pair<Const::ChargedStable, const TrackFitResult*> getMostLikelyTrackFitResult() const;
1019
1024 bool isMostLikelyTrackFitResult() const;
1025
1030 {
1031 const int pdg = abs(getPDGCode());
1032 if ((pdg == Const::photon.getPDGCode())
1033 or (pdg == Const::electron.getPDGCode())
1034 or (pdg == Const::muon.getPDGCode())
1035 or (pdg == Const::pion.getPDGCode())
1036 or (pdg == Const::kaon.getPDGCode())
1037 or (pdg == Const::proton.getPDGCode())
1038 or (pdg == Const::deuteron.getPDGCode())) {
1040 } else if ((pdg == Const::Klong.getPDGCode())
1041 or (pdg == Const::neutron.getPDGCode())) {
1043 } else {
1045 }
1046 }
1047
1055 const Particle* getParticleFromGeneralizedIndexString(const std::string& generalizedIndex) const;
1056
1060 void updateJacobiMatrix();
1061
1068 void fillFSPDaughters(std::vector<const Belle2::Particle*>& fspDaughters) const;
1069
1076 void fillAllDaughters(std::vector<const Belle2::Particle*>& allDaughters) const;
1077
1078
1079 private:
1080
1081 // persistent data members
1084 double m_mass;
1085 double m_px;
1086 double m_py;
1087 double m_pz;
1088 double m_momentumScale = 1.0;
1092 double m_x;
1093 double m_y;
1094 double m_z;
1095 double m_errMatrix[c_SizeMatrix] = {};
1096 double m_jacobiMatrix[c_SizeMatrix] = {};
1097 double m_pValue;
1098 std::vector<int> m_daughterIndices;
1101 unsigned m_mdstIndex;
1104 std::vector<int> m_daughterProperties;
1114
1120 std::vector<double> m_extraInfo;
1121
1122 // transient data members
1129 mutable TClonesArray* m_arrayPointer;
1130
1131 // private methods
1135 void setMomentumPositionErrorMatrix(const TrackFitResult* trackFit);
1136
1141 void resetErrorMatrix();
1142
1147 void resetJacobiMatrix();
1148
1153 void storeErrorMatrix(const TMatrixFSym& errMatrix);
1154
1159 void storeJacobiMatrix(const TMatrixF& jacobiMatrix);
1160
1168 // TODO: this can be optimized for speed
1169 void fillDecayChain(std::vector<int>& decayChain) const;
1170
1174 void setFlavorType();
1175
1179 void setMdstArrayIndex(const int arrayIndex);
1180
1186 int generatePDGCodeFromCharge(const int chargedSign, const Const::ChargedStable& chargedStable);
1187
1189 // v8: added identifier, changed getMdstSource
1190 // v9: added m_pdgCodeUsedForFit
1191 // v10: added m_properties
1192 // v11: added m_daughterProperties
1193 // v12: renamed EParticleType m_particleType to EParticleSourceObject m_particleSource
1194 // v13: added m_momentumScale
1195 // v14: added m_jacobiMatrix
1196 // v15: added m_momentumScalingFactor and m_momentumSmearingFactor
1197 // v16: use double precision for private members
1198 // v17: added m_energyLossCorrection
1199 // v18: added m_trackFitResultIndex
1200 friend class ParticleSubset;
1201 };
1202
1204} // end namespace Belle2
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:589
The ParticleType class for identifying different particle types.
Definition: Const.h:408
static const ParticleType neutron
neutron particle
Definition: Const.h:675
static const ChargedStable muon
muon particle
Definition: Const.h:660
static const ChargedStable pion
charged pion particle
Definition: Const.h:661
static const ParticleType Klong
K^0_L particle.
Definition: Const.h:678
static const ChargedStable proton
proton particle
Definition: Const.h:663
static const ChargedStable kaon
charged kaon particle
Definition: Const.h:662
static const ParticleType photon
photon particle
Definition: Const.h:673
static const ChargedStable electron
electron particle
Definition: Const.h:659
static const ChargedStable deuteron
deuteron particle
Definition: Const.h:664
ECL cluster data.
Definition: ECLCluster.h:27
EHypothesisBit
The hypothesis bits for this ECLCluster (Connected region (CR) is split using this hypothesis.
Definition: ECLCluster.h:31
@ c_nPhotons
CR is split into n photons (N1)
@ c_neutralHadron
CR is reconstructed as a neutral hadron (N2)
@ c_none
None as initializer.
KLM cluster data.
Definition: KLMCluster.h:28
Object holding information for Kinks.
Definition: Kink.h:32
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
Definition: PIDLikelihood.h:29
Specialised SelectSubset<Particle> that also fixes daughter indices and all ParticleLists.
Class to store reconstructed particles.
Definition: Particle.h:76
void setProperty(const int properties)
sets m_properties
Definition: Particle.h:385
void removeExtraInfo()
Remove all stored extra info fields.
Definition: Particle.cc:1369
double getPx() const
Returns x component of momentum.
Definition: Particle.h:607
void updateJacobiMatrix()
Propagate the photon energy scaling to jacobian elements that were calculated using energy.
Definition: Particle.cc:288
TMatrixFSym getVertexErrorMatrix() const
Returns the 3x3 position error sub-matrix.
Definition: Particle.cc:478
bool isMostLikely() const
Returns true if the (track-based) particle is created with its most likely mass hypothesis based on P...
Definition: Particle.cc:1476
const KLMCluster * getKLMCluster() const
Returns the pointer to the KLMCluster object that was used to create this Particle (ParticleType == c...
Definition: Particle.cc:1011
double m_momentumSmearingFactor
momentum smearing factor
Definition: Particle.h:1090
bool replaceDaughter(const Particle *oldDaughter, Particle *newDaughter)
Replace index of given daughter with new daughter, return true if a replacement is made.
Definition: Particle.cc:736
const Track * getTrack() const
Returns the pointer to the Track object that was used to create this Particle (ParticleType == c_Trac...
Definition: Particle.cc:916
void setMomentumPositionErrorMatrix(const TrackFitResult *trackFit)
Sets the momentum, position and error matrix for this particle (created from charged Track)
Definition: Particle.cc:1086
const std::vector< int > & getDaughterIndices() const
Returns a vector of store array indices of daughter particles.
Definition: Particle.h:756
void storeErrorMatrix(const TMatrixFSym &errMatrix)
Stores 7x7 error matrix into private member m_errMatrix.
Definition: Particle.cc:1176
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.
Definition: Particle.cc:1443
std::vector< const Belle2::Particle * > getFinalStateDaughters() const
Returns a vector of pointers to Final State daughter particles.
Definition: Particle.cc:680
const MCParticle * getMCParticle() const
Returns the pointer to the MCParticle object that was used to create this Particle (ParticleType == c...
Definition: Particle.cc:1027
void appendDaughter(const Particle *daughter, const bool updateType=true, const int daughterProperty=c_Ordinary)
Appends index of daughter to daughters index array.
Definition: Particle.cc:707
const ECLCluster * getECLCluster() const
Returns the pointer to the ECLCluster object that was used to create this Particle (if ParticleType =...
Definition: Particle.cc:976
void setExtraInfo(const std::string &name, double value)
Sets the user-defined data of given name to the given value.
Definition: Particle.cc:1402
EParticleSourceObject
particle source enumerators
Definition: Particle.h:83
double m_pValue
chi^2 probability of the fit.
Definition: Particle.h:1097
double m_pz
momentum component z
Definition: Particle.h:1087
int m_pdgCodeUsedForFit
PDG code used for the track fit.
Definition: Particle.h:1083
double m_momentumScale
effective momentum scale factor
Definition: Particle.h:1088
std::string getName() const override
Return name of this particle.
Definition: Particle.cc:1250
bool overlapsWith(const Particle *oParticle) const
Returns true if final state ancestors of oParticle overlap.
Definition: Particle.cc:768
double getCosHelicityDaughter(unsigned iDaughter, unsigned iGrandDaughter=0) const
Returns cosine of the helicity angle of the given daughter defined by given grand daughter.
Definition: Particle.cc:533
double getPz() const
Returns z component of momentum.
Definition: Particle.h:625
std::vector< std::string > getExtraInfoNames() const
get a list of the extra info names
Definition: Particle.cc:1260
double getX() const
Returns x component of vertex position.
Definition: Particle.h:660
bool isCopyOf(const Particle *oParticle, bool doDetailedComparison=false) const
Returns true if this Particle and oParticle are copies of each other.
Definition: Particle.cc:783
const std::vector< int > & getDaughterProperties() const
Returns a vector of properties of daughter particles.
Definition: Particle.h:765
void writeExtraInfo(const std::string &name, const double value)
Sets the user defined extraInfo.
Definition: Particle.cc:1393
void setVertex(const ROOT::Math::XYZVector &vertex)
Sets position (decay vertex)
Definition: Particle.h:306
std::vector< int > getMdstArrayIndices(EParticleSourceObject type) const
Returns a vector of StoreArray indices of given MDST dataobjects.
Definition: Particle.cc:696
double m_jacobiMatrix[c_SizeMatrix]
error matrix (1D representation)
Definition: Particle.h:1096
void resetJacobiMatrix()
Resets 4x6 error matrix All elements are set to 0.0.
Definition: Particle.cc:1170
void set4VectorDividingByMomentumScaling(const ROOT::Math::PxPyPzEVector &p4)
Sets Lorentz vector dividing by the momentum scaling factor.
Definition: Particle.h:294
void storeJacobiMatrix(const TMatrixF &jacobiMatrix)
Stores 4x6 Jacobi matrix into private member m_jacobiMatrix.
Definition: Particle.cc:1187
bool isMostLikelyTrackFitResult() const
Returns true if the (track-based) particle is created with its most likely mass hypothesis based on T...
Definition: Particle.cc:1501
std::vector< double > m_extraInfo
Stores associated user defined values.
Definition: Particle.h:1120
double getEffectiveMomentumScale() const
Returns effective momentum scale which is the product of the momentum scaling and smearing factors.
Definition: Particle.h:634
unsigned m_mdstIndex
0-based index of MDST store array object
Definition: Particle.h:1101
double getPValue() const
Returns chi^2 probability of fit if done or -1.
Definition: Particle.h:687
void setFlavorType()
sets m_flavorType using m_pdgCode
Definition: Particle.cc:1235
double getEnergy() const
Returns total energy.
Definition: Particle.h:555
void setMomentumScalingFactor(double momentumScalingFactor)
Sets momentum scaling.
Definition: Particle.h:345
int getMdstSource() const
Returns unique identifier of final state particle (needed in particle combiner)
Definition: Particle.cc:400
ROOT::Math::XYZVector getVertex() const
Returns vertex position (POCA for charged, IP for neutral FS particles)
Definition: Particle.h:651
void fillAllDaughters(std::vector< const Belle2::Particle * > &allDaughters) const
Fill all generations' daughters into a vector.
Definition: Particle.cc:1212
bool hasExtraInfo(const std::string &name) const
Return whether the extra info with the given name is set.
Definition: Particle.cc:1351
std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
Definition: Particle.cc:1273
void setMdstArrayIndex(const int arrayIndex)
set mdst array index
Definition: Particle.cc:381
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...
Definition: Particle.cc:1041
unsigned getMdstArrayIndex(void) const
Returns 0-based index of MDST store array object (0 for composite particles)
Definition: Particle.h:498
double m_py
momentum component y
Definition: Particle.h:1086
int getPDGCodeUsedForFit() const
Return the always positive PDG code which was used for the track fit (if there was a track fit) of th...
Definition: Particle.h:993
double m_x
position component x
Definition: Particle.h:1092
double m_px
momentum component x
Definition: Particle.h:1085
double getMomentumLossCorrectionFactor() const
Returns effect of energy correction on the particle momentum.
Definition: Particle.h:326
std::pair< Const::ChargedStable, const TrackFitResult * > getMostLikelyTrackFitResult() const
For a (track-based) particle, returns the charged stable mass hypothesis associated to the most proba...
Definition: Particle.cc:1483
EFlavorType getFlavorType() const
Returns flavor type of the decay (for FS particles: flavor type of particle)
Definition: Particle.h:480
~Particle()
Destructor.
void fillFSPDaughters(std::vector< const Belle2::Particle * > &fspDaughters) const
Fill final state particle daughters into a vector.
Definition: Particle.cc:1199
const PIDLikelihood * getPIDLikelihood() const
Returns the pointer to the PIDLikelihood object that is related to the Track, which was used to creat...
Definition: Particle.cc:947
const V0 * getV0() const
Returns the pointer to the V0 object that was used to create this Particle (if ParticleType == c_V0).
Definition: Particle.cc:956
TClonesArray * m_arrayPointer
Internal pointer to DataStore array containing the daughters of this particle.
Definition: Particle.h:1129
const Kink * getKink() const
Returns the pointer to the Kink object that was used to create this Particle (if ParticleType == c_Ki...
Definition: Particle.cc:966
EParticleSourceObject m_particleSource
(mdst) source of particle
Definition: Particle.h:1100
void fillDecayChain(std::vector< int > &decayChain) const
Fill vector with (PDGCode, MdstSource) pairs for the entire decay chain.
Definition: Particle.cc:1225
int getPDGCode(void) const
Returns PDG code.
Definition: Particle.h:465
double getPy() const
Returns y component of momentum.
Definition: Particle.h:616
bool wasExactFitHypothesisUsed() const
Returns true if the type represented by this Particle object was used use as a mass hypothesis during...
Definition: Particle.h:1003
int getProperty() const
Returns particle property as a bit pattern The values are defined in the PropertyFlags enum and descr...
Definition: Particle.h:518
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 ...
Definition: Particle.cc:490
double m_momentumScalingFactor
momentum scaling factor
Definition: Particle.h:1089
unsigned getNDaughters(void) const
Returns number of daughter particles.
Definition: Particle.h:747
std::vector< Belle2::Particle * > getDaughters() const
Returns a vector of pointers to daughter particles.
Definition: Particle.cc:668
TClonesArray * getArrayPointer() const
Returns the pointer to the store array which holds the daughter particles.
Definition: Particle.h:981
double getZ() const
Returns z component of vertex position.
Definition: Particle.h:678
void resetErrorMatrix()
Resets 7x7 error matrix All elements are set to 0.0.
Definition: Particle.cc:1164
ClassDefOverride(Particle, 18)
Class to store reconstructed particles.
double getPDGMass(void) const
Returns uncertainty on the invariant mass (requires valid momentum error matrix)
Definition: Particle.cc:635
void setMomentumSmearingFactor(double momentumSmearingFactor)
Sets momentum smearing.
Definition: Particle.h:355
EFlavorType m_flavorType
flavor type.
Definition: Particle.h:1099
double m_energyLossCorrection
energy loss correction.
Definition: Particle.h:1091
int generatePDGCodeFromCharge(const int chargedSign, const Const::ChargedStable &chargedStable)
Generate the PDG code with correct sign, using the charge.
Definition: Particle.cc:1467
double getCharge(void) const
Returns particle charge.
Definition: Particle.cc:653
ROOT::Math::PxPyPzEVector get4Vector() const
Returns Lorentz vector.
Definition: Particle.h:567
void appendDaughter(int particleIndex, const bool updateType=true)
Appends index of daughter to daughters index array.
Definition: Particle.h:427
Particle()
Default constructor.
Definition: Particle.cc:46
TMatrixFSym getMomentumErrorMatrix() const
Returns the 4x4 momentum error matrix.
Definition: Particle.cc:466
double m_mass
particle (invariant) mass
Definition: Particle.h:1084
std::vector< const Belle2::Particle * > getAllDaughters() const
Returns a vector of pointers to all generations' daughter particles.
Definition: Particle.cc:688
double getAcoplanarity() const
Returns acoplanarity angle defined as the angle between the decay planes of the grand daughters in th...
Definition: Particle.cc:564
std::vector< int > m_daughterProperties
daughter particle properties
Definition: Particle.h:1104
double m_errMatrix[c_SizeMatrix]
error matrix (1D representation)
Definition: Particle.h:1095
std::vector< int > m_daughterIndices
daughter particle indices
Definition: Particle.h:1098
double getY() const
Returns y component of vertex position.
Definition: Particle.h:669
unsigned m_trackFitResultIndex
0-based index of related TrackFitResult, relevant for kinks
Definition: Particle.h:1102
void addExtraInfo(const std::string &name, double value)
Sets the user-defined data of given name to the given value.
Definition: Particle.cc:1421
void set4Vector(const ROOT::Math::PxPyPzEVector &p4)
Sets Lorentz vector.
Definition: Particle.h:282
void setEnergyLossCorrection(double energyLossCorrection)
Sets Energy loss correction.
Definition: Particle.h:317
void setJacobiMatrix(const TMatrixF &jacobiMatrix)
Sets 4x6 jacobi matrix.
Definition: Particle.cc:438
int getExtraInfoMap() const
Return the id of the associated ParticleExtraInfoMap or -1 if no map is set.
Definition: Particle.h:949
double getPDGLifetime() const
Returns particle nominal lifetime.
Definition: Particle.cc:644
void setMomentumVertexErrorMatrix(const TMatrixFSym &errMatrix)
Sets 7x7 error matrix.
Definition: Particle.cc:424
ROOT::Math::XYZVector getMomentum() const
Returns momentum vector.
Definition: Particle.h:580
void setPValue(double pValue)
Sets chi^2 probability of fit.
Definition: Particle.h:377
EParticleSourceObject getParticleSource() const
Returns particle source as defined with enum EParticleSourceObject.
Definition: Particle.h:489
void updateMass(const int pdgCode)
Updates particle mass with the mass of the particle corresponding to the given PDG.
Definition: Particle.cc:628
double m_z
position component z
Definition: Particle.h:1094
void print() const
Prints the contents of a Particle object to standard output.
Definition: Particle.cc:1255
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.
Definition: Particle.h:397
EFlavorType
describes flavor type, see getFlavorType().
Definition: Particle.h:96
@ c_Unflavored
Is its own antiparticle or we don't know whether it is a particle/antiparticle.
Definition: Particle.h:97
@ c_Flavored
Is either particle or antiparticle.
Definition: Particle.h:98
int m_pdgCode
PDG code.
Definition: Particle.h:1082
TMatrixFSym getMomentumVertexErrorMatrix() const
Returns 7x7 error matrix.
Definition: Particle.cc:451
PropertyFlags
Flags that describe the particle property, which are used in the MC matching.
Definition: Particle.h:118
@ c_IsIgnoreNeutrino
Is the particle MC matched with the ignore missing neutrino flag set?
Definition: Particle.h:124
@ c_IsIgnoreRadiatedPhotons
Is the particle MC matched with the ignore radiated photon flag set?
Definition: Particle.h:121
@ c_IsIgnoreGamma
Is the particle MC matched with the ignore missing gamma flag set?
Definition: Particle.h:125
@ c_IsUnspecified
Ordinary particles.
Definition: Particle.h:120
@ c_IsIgnoreBrems
Is the particle MC matched with the ignore added Brems gamma flag set?
Definition: Particle.h:126
@ c_IsIgnoreDecayInFlight
Is the particle MC matched with the ignore DecayInFlight flag set?
Definition: Particle.h:128
@ c_IsIgnoreMisID
Is the particle MC matched with the ignore MisID flag set?
Definition: Particle.h:127
@ c_IsIgnoreIntermediate
Is the particle MC matched with the ignore intermediate resonances flag set?
Definition: Particle.h:122
@ c_IsIgnoreMassive
Is the particle MC matched with the ignore missing massive particle flag set?
Definition: Particle.h:123
double getEnergyLossCorrection() const
Returns Energy Loss Correction.
Definition: Particle.h:643
double getECLClusterEnergy() const
Returns the energy of the ECLCluster for the particle.
Definition: Particle.cc:1004
const TrackFitResult * getTrackFitResult() const
Returns the pointer to the TrackFitResult that was used to create this Particle (ParticleType == c_Tr...
Definition: Particle.cc:925
double getMomentumMagnitude() const
Returns momentum magnitude.
Definition: Particle.h:589
void removeDaughter(const Particle *daughter, const bool updateType=true)
Removes index of daughter from daughters index array.
Definition: Particle.cc:719
double getP() const
Returns momentum magnitude (same as getMomentumMagnitude but with shorter name)
Definition: Particle.h:598
double m_y
position component y
Definition: Particle.h:1093
void setPDGCode(const int pdg)
Sets PDG code.
Definition: Particle.h:273
unsigned int getExtraInfoSize() const
Return the size of the extra info array.
Definition: Particle.h:955
int m_identifier
Identifier that can be used to identify whether the particle is unique or is a copy or representation...
Definition: Particle.h:1113
int m_properties
particle property
Definition: Particle.h:1103
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
Definition: Particle.cc:662
double getExtraInfo(const std::string &name) const
Return given value if set.
Definition: Particle.cc:1374
ECLCluster::EHypothesisBit getECLClusterEHypothesisBit() const
Returns the ECLCluster EHypothesisBit for this Particle.
Definition: Particle.h:1029
bool replaceDaughterRecursively(const Particle *oldDaughter, Particle *newDaughter)
Apply replaceDaughter to all Particles in the decay tree by looping recursively through it,...
Definition: Particle.cc:754
double getMass() const
Returns invariant mass (= nominal for FS particles)
Definition: Particle.h:527
unsigned getTrackFitResultIndex(void) const
Returns 0-based index of the TrackFitResult that should be associated with the Particle.
Definition: Particle.h:507
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.
Definition: Track.h:25
Object holding information for V0s.
Definition: V0.h:34
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
Abstract base class for different kinds of events.