Belle II Software  light-2303-iriomote
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 <TMatrixFSymfwd.h>
18 
19 #include <vector>
20 
21 class TClonesArray;
22 
23 namespace Belle2 {
29  // forward declarations
30  class KLMCluster;
31  class Track;
32  class TrackFitResult;
33  class MCParticle;
34  class PIDLikelihood;
35  class V0;
36 
74  class Particle : public RelationsObject {
75 
76  public:
77 
82  c_Undefined = 0,
83  c_Track = 1,
84  c_ECLCluster = 2,
85  c_KLMCluster = 3,
86  c_V0 = 4,
87  c_MCParticle = 5,
88  c_Composite = 6,
89  c_NoMDSTSource = 7
90  };
91 
93  enum EFlavorType {
95  c_Flavored = 1,
96  };
97 
101  enum {c_DimPosition = 3, c_DimMomentum = 4, c_DimMatrix = 7,
102  c_SizeMatrix = c_DimMatrix * (c_DimMatrix + 1) / 2
103  };
104 
109  enum {c_Px, c_Py, c_Pz, c_E, c_X, c_Y, c_Z};
110 
116  c_Ordinary = 0,
126  };
127 
132  Particle();
133 
140  Particle(const ROOT::Math::PxPyPzEVector& momentum, const int pdgCode);
141 
151  Particle(const ROOT::Math::PxPyPzEVector& momentum,
152  const int pdgCode,
153  EFlavorType flavorType,
154  const EParticleSourceObject particleType,
155  const unsigned mdstIndex);
156 
166  Particle(const ROOT::Math::PxPyPzEVector& momentum,
167  const int pdgCode,
168  EFlavorType flavorType,
169  const std::vector<int>& daughterIndices,
170  TClonesArray* arrayPointer = nullptr);
171 
182  Particle(const ROOT::Math::PxPyPzEVector& momentum,
183  const int pdgCode,
184  EFlavorType flavorType,
185  const std::vector<int>& daughterIndices,
186  int properties,
187  TClonesArray* arrayPointer = nullptr);
188 
200  Particle(const ROOT::Math::PxPyPzEVector& momentum,
201  const int pdgCode,
202  EFlavorType flavorType,
203  const std::vector<int>& daughterIndices,
204  int properties,
205  const std::vector<int>& daughterProperties,
206  TClonesArray* arrayPointer = nullptr);
207 
213  Particle(const Track* track,
214  const Const::ChargedStable& chargedStable);
215 
224  Particle(int trackArrayIndex, const TrackFitResult* trackFit,
225  const Const::ChargedStable& chargedStable);
226 
232  explicit Particle(const ECLCluster* eclCluster,
233  const Const::ParticleType& type = Const::photon);
234 
240  explicit Particle(const KLMCluster* klmCluster, const int pdgCode = Const::Klong.getPDGCode());
241 
246  explicit Particle(const MCParticle* MCparticle);
247 
252 
253  public:
254 
255  // setters
256 
261  void setPDGCode(const int pdg)
262  {
263  m_pdgCode = pdg;
264  }
265 
270  void set4Vector(const ROOT::Math::PxPyPzEVector& p4)
271  {
272  m_px = p4.Px();
273  m_py = p4.Py();
274  m_pz = p4.Pz();
275  m_mass = p4.M();
276  }
277 
282  void set4VectorDividingByMomentumScaling(const ROOT::Math::PxPyPzEVector& p4)
283  {
284  m_px = p4.Px() / m_momentumScale;
285  m_py = p4.Py() / m_momentumScale;
286  m_pz = p4.Pz() / m_momentumScale;
287  m_mass = p4.M();
288  }
289 
294  void setVertex(const ROOT::Math::XYZVector& vertex)
295  {
296  m_x = vertex.X();
297  m_y = vertex.Y();
298  m_z = vertex.Z();
299  };
300 
305  void setMomentumScalingFactor(double momentumScalingFactor)
306  {
307  m_momentumScalingFactor = momentumScalingFactor;
309  }
310 
315  void setMomentumSmearingFactor(double momentumSmearingFactor)
316  {
317  m_momentumSmearingFactor = momentumSmearingFactor;
319  }
320 
325  void setJacobiMatrix(const TMatrixF& jacobiMatrix);
326 
331  void setMomentumVertexErrorMatrix(const TMatrixFSym& errMatrix);
332 
337  void setPValue(double pValue)
338  {
339  m_pValue = pValue;
340  }
341 
345  void setProperty(const int properties)
346  {
347  m_properties = properties;
348  }
349 
357  void updateMomentum(const ROOT::Math::PxPyPzEVector& p4,
358  const ROOT::Math::XYZVector& vertex,
359  const TMatrixFSym& errMatrix,
360  double pValue)
361  {
362  set4Vector(p4);
363  setVertex(vertex);
364  setMomentumVertexErrorMatrix(errMatrix);
365  m_pValue = pValue;
366  }
367 
372  void updateMass(const int pdgCode);
373 
380  void appendDaughter(const Particle* daughter, const bool updateType = true, const int daughterProperty = c_Ordinary);
381 
387  void appendDaughter(int particleIndex, const bool updateType = true)
388  {
389  if (updateType) {
390  // is it a composite particle or fsr corrected?
391  m_particleSource = c_Composite;
392  }
393  m_daughterIndices.push_back(particleIndex);
394  m_daughterProperties.push_back(c_Ordinary);
395  }
396 
402  void removeDaughter(const Particle* daughter, const bool updateType = true);
403 
409  bool replaceDaughter(const Particle* oldDaughter, Particle* newDaughter);
410 
417  bool replaceDaughterRecursively(const Particle* oldDaughter, Particle* newDaughter);
418 
419  // getters
420 
425  int getPDGCode(void) const
426  {
427  return m_pdgCode;
428  }
429 
434  double getCharge(void) const;
435 
441  {
442  return m_flavorType;
443  }
444 
450  {
451  return m_particleSource;
452  }
453 
458  unsigned getMdstArrayIndex(void) const
459  {
460  return m_mdstIndex;
461  }
462 
469  int getProperty() const
470  {
471  return m_properties;
472  }
473 
478  double getMass() const
479  {
480  return m_mass;
481  }
482 
488  //double getMassError() const;
489 
494  double getPDGMass(void) const;
495 
500  double getPDGLifetime() const;
501 
506  double getEnergy() const
507  {
510  }
511 
516  ROOT::Math::PxPyPzEVector get4Vector() const
517  {
518  return ROOT::Math::PxPyPzEVector(m_momentumScale * m_px, m_momentumScale * m_py, m_momentumScale * m_pz, getEnergy());
519  }
520 
525  ROOT::Math::XYZVector getMomentum() const
526  {
527  return m_momentumScale * ROOT::Math::XYZVector(m_px, m_py, m_pz);
528  };
529 
534  double getMomentumMagnitude() const
535  {
536  return m_momentumScale * sqrt(m_px * m_px + m_py * m_py + m_pz * m_pz);
537  };
538 
543  double getP() const
544  {
545  return m_momentumScale * sqrt(m_px * m_px + m_py * m_py + m_pz * m_pz);
546  };
547 
552  double getPx() const
553  {
554  return m_momentumScale * m_px;
555  }
556 
561  double getPy() const
562  {
563  return m_momentumScale * m_py;
564  }
565 
570  double getPz() const
571  {
572  return m_momentumScale * m_pz;
573  }
574 
580  {
581  return m_momentumScale;
582  }
583 
588  ROOT::Math::XYZVector getVertex() const
589  {
590  return ROOT::Math::XYZVector(m_x, m_y, m_z);
591  };
592 
597  double getX() const
598  {
599  return m_x;
600  }
601 
606  double getY() const
607  {
608  return m_y;
609  }
610 
615  double getZ() const
616  {
617  return m_z;
618  }
619 
624  double getPValue() const
625  {
626  return m_pValue;
627  }
628 
633  TMatrixFSym getMomentumVertexErrorMatrix() const;
634 
639  TMatrixFSym getMomentumErrorMatrix() const;
640 
645  TMatrixFSym getVertexErrorMatrix() const;
646 
656  double getCosHelicity(const Particle* mother = nullptr) const;
657 
664  double getCosHelicityDaughter(unsigned iDaughter, unsigned iGrandDaughter = 0) const;
665 
671  double getAcoplanarity() const;
672 
673 
678  int getMdstSource() const;
679 
684  unsigned getNDaughters(void) const
685  {
686  return m_daughterIndices.size();
687  }
688 
693  const std::vector<int>& getDaughterIndices() const
694  {
695  return m_daughterIndices;
696  }
697 
702  const std::vector<int>& getDaughterProperties() const
703  {
704  return m_daughterProperties;
705  }
706 
712  const Particle* getDaughter(unsigned i) const;
713 
723  bool forEachDaughter(const std::function<bool(const Particle*)>& function,
724  bool recursive = true, bool includeSelf = true) const;
725 
730  std::vector<Belle2::Particle*> getDaughters() const;
731  //Need namespace qualifier because ROOT CINT has troubles otherwise
732 
737  std::vector<const Belle2::Particle*> getFinalStateDaughters() const;
738  //Need namespace qualifier because ROOT CINT has troubles otherwise
739 
744  std::vector<const Belle2::Particle*> getAllDaughters() const;
745  //Need namespace qualifier because ROOT CINT has troubles otherwise
746 
753  std::vector<int> getMdstArrayIndices(EParticleSourceObject type) const;
754 
760  bool overlapsWith(const Particle* oParticle) const;
761 
783  bool isCopyOf(const Particle* oParticle, bool doDetailedComparison = false) const;
784 
790  const Track* getTrack() const;
791 
797  const TrackFitResult* getTrackFitResult() const;
798 
805  const V0* getV0() const;
806 
815  const PIDLikelihood* getPIDLikelihood() const;
816 
823  const ECLCluster* getECLCluster() const;
824 
830  double getECLClusterEnergy() const;
831 
838  const KLMCluster* getKLMCluster() const;
839 
847  const MCParticle* getMCParticle() const;
848 
850  std::string getName() const override;
851 
853  std::string getInfoHTML() const override;
854 
858  void print() const;
859 
861  std::vector<std::string> getExtraInfoNames() const;
862 
866  void removeExtraInfo();
867 
872  double getExtraInfo(const std::string& name) const;
873 
875  bool hasExtraInfo(const std::string& name) const;
876 
878  int getExtraInfoMap() const
879  {
880  return !m_extraInfo.empty() ? m_extraInfo[0] : -1;
881  }
882 
884  unsigned int getExtraInfoSize() const
885  {
886  return m_extraInfo.size();
887  }
888 
892  void writeExtraInfo(const std::string& name, const double value);
893 
898  void setExtraInfo(const std::string& name, double value);
899 
904  void addExtraInfo(const std::string& name, double value);
905 
910  TClonesArray* getArrayPointer() const
911  {
912  if (!m_arrayPointer)
914  return m_arrayPointer;
915  }
916 
923  {
924  return std::abs(m_pdgCodeUsedForFit);
925  }
926 
933  {
934  return std::abs(m_pdgCodeUsedForFit) == std::abs(m_pdgCode);
935  }
936 
941  bool isMostLikely() const;
942 
947  std::pair<Const::ChargedStable, const TrackFitResult*> getMostLikelyTrackFitResult() const;
948 
953  bool isMostLikelyTrackFitResult() const;
954 
959  {
960  const int pdg = abs(getPDGCode());
961  if ((pdg == Const::photon.getPDGCode())
962  or (pdg == Const::electron.getPDGCode())
963  or (pdg == Const::muon.getPDGCode())
964  or (pdg == Const::pion.getPDGCode())
965  or (pdg == Const::kaon.getPDGCode())
966  or (pdg == Const::proton.getPDGCode())
967  or (pdg == Const::deuteron.getPDGCode())) {
969  } else if ((pdg == Const::Klong.getPDGCode())
970  or (pdg == Const::neutron.getPDGCode())) {
972  } else {
974  }
975  }
976 
984  const Particle* getParticleFromGeneralizedIndexString(const std::string& generalizedIndex) const;
985 
989  void updateJacobiMatrix();
990 
997  void fillFSPDaughters(std::vector<const Belle2::Particle*>& fspDaughters) const;
998 
1005  void fillAllDaughters(std::vector<const Belle2::Particle*>& allDaughters) const;
1006 
1007 
1008  private:
1009 
1010  // persistent data members
1013  double m_mass;
1014  double m_px;
1015  double m_py;
1016  double m_pz;
1017  double m_momentumScale = 1.0;
1020  double m_x;
1021  double m_y;
1022  double m_z;
1023  double m_errMatrix[c_SizeMatrix] = {};
1024  double m_jacobiMatrix[c_SizeMatrix] = {};
1025  double m_pValue;
1026  std::vector<int> m_daughterIndices;
1029  unsigned m_mdstIndex;
1031  std::vector<int> m_daughterProperties;
1040  int m_identifier = -1;
1041 
1047  std::vector<double> m_extraInfo;
1048 
1049  // transient data members
1056  mutable TClonesArray* m_arrayPointer;
1057 
1058  // private methods
1062  void setMomentumPositionErrorMatrix(const TrackFitResult* trackFit);
1063 
1068  void resetErrorMatrix();
1069 
1074  void resetJacobiMatrix();
1075 
1080  void storeErrorMatrix(const TMatrixFSym& errMatrix);
1081 
1086  void storeJacobiMatrix(const TMatrixF& jacobiMatrix);
1087 
1095  // TODO: this can be optimized for speed
1096  void fillDecayChain(std::vector<int>& decayChain) const;
1097 
1101  void setFlavorType();
1102 
1106  void setMdstArrayIndex(const int arrayIndex);
1107 
1113  int generatePDGCodeFromCharge(const int chargedSign, const Const::ChargedStable& chargedStable);
1114 
1116  // v8: added identifier, changed getMdstSource
1117  // v9: added m_pdgCodeUsedForFit
1118  // v10: added m_properties
1119  // v11: added m_daughterProperties
1120  // v12: renamed EParticleType m_particleType to EParticleSourceObject m_particleSource
1121  // v13: added m_momentumScale
1122  // v14: added m_jacobiMatrix
1123  // v15: added m_momentumScalingFactor and m_momentumSmearingFactor
1124  // v16: use double precision for private members
1125 
1126  friend class ParticleSubset;
1127  };
1128 
1130 } // end namespace Belle2
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:580
The ParticleType class for identifying different particle types.
Definition: Const.h:399
static const ParticleType neutron
neutron particle
Definition: Const.h:666
static const ChargedStable muon
muon particle
Definition: Const.h:651
static const ChargedStable pion
charged pion particle
Definition: Const.h:652
static const ParticleType Klong
K^0_L particle.
Definition: Const.h:669
static const ChargedStable proton
proton particle
Definition: Const.h:654
static const ChargedStable kaon
charged kaon particle
Definition: Const.h:653
static const ParticleType photon
photon particle
Definition: Const.h:664
static const ChargedStable electron
electron particle
Definition: Const.h:650
static const ChargedStable deuteron
deuteron particle
Definition: Const.h:655
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
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:26
Specialised SelectSubset<Particle> that also fixes daughter indices and all ParticleLists.
Class to store reconstructed particles.
Definition: Particle.h:74
void setProperty(const int properties)
sets m_properties
Definition: Particle.h:345
void removeExtraInfo()
Remove all stored extra info fields.
Definition: Particle.cc:1285
double getPx() const
Returns x component of momentum.
Definition: Particle.h:552
void updateJacobiMatrix()
Propagate the photon energy scaling to jacobian elements that were calculated using energy.
Definition: Particle.cc:257
TMatrixFSym getVertexErrorMatrix() const
Returns the 3x3 position error sub-matrix.
Definition: Particle.cc:451
bool isMostLikely() const
Returns true if the (track-based) particle is created with its most likely mass hypothesis based on P...
Definition: Particle.cc:1392
const KLMCluster * getKLMCluster() const
Returns the pointer to the KLMCluster object that was used to create this Particle (ParticleType == c...
Definition: Particle.cc:930
double m_momentumSmearingFactor
momentum smearing factor
Definition: Particle.h:1019
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:709
const Track * getTrack() const
Returns the pointer to the Track object that was used to create this Particle (ParticleType == c_Trac...
Definition: Particle.cc:849
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.
void setMomentumPositionErrorMatrix(const TrackFitResult *trackFit)
Sets the momentum, position and error matrix for this particle (created from charged Track)
Definition: Particle.cc:1005
void storeErrorMatrix(const TMatrixFSym &errMatrix)
Stores 7x7 error matrix into private member m_errMatrix.
Definition: Particle.cc:1095
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:1359
std::vector< const Belle2::Particle * > getFinalStateDaughters() const
Returns a vector of pointers to Final State daughter particles.
Definition: Particle.cc:653
const MCParticle * getMCParticle() const
Returns the pointer to the MCParticle object that was used to create this Particle (ParticleType == c...
Definition: Particle.cc:946
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:680
const ECLCluster * getECLCluster() const
Returns the pointer to the ECLCluster object that was used to create this Particle (if ParticleType =...
Definition: Particle.cc:895
void setExtraInfo(const std::string &name, double value)
Sets the user-defined data of given name to the given value.
Definition: Particle.cc:1318
EParticleSourceObject
particle source enumerators
Definition: Particle.h:81
double m_pValue
chi^2 probability of the fit.
Definition: Particle.h:1025
double m_pz
momentum component z
Definition: Particle.h:1016
int m_pdgCodeUsedForFit
PDG code used for the track fit.
Definition: Particle.h:1012
double m_momentumScale
effective momentum scale factor
Definition: Particle.h:1017
std::string getName() const override
Return name of this particle.
Definition: Particle.cc:1169
bool overlapsWith(const Particle *oParticle) const
Returns true if final state ancestors of oParticle overlap.
Definition: Particle.cc:741
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:506
TClonesArray * getArrayPointer() const
Returns the pointer to the store array which holds the daughter particles.
Definition: Particle.h:910
double getPz() const
Returns z component of momentum.
Definition: Particle.h:570
std::vector< std::string > getExtraInfoNames() const
get a list of the extra info names
Definition: Particle.cc:1179
double getX() const
Returns x component of vertex position.
Definition: Particle.h:597
bool isCopyOf(const Particle *oParticle, bool doDetailedComparison=false) const
Returns true if this Particle and oParticle are copies of each other.
Definition: Particle.cc:756
void writeExtraInfo(const std::string &name, const double value)
Sets the user defined extraInfo.
Definition: Particle.cc:1309
void setVertex(const ROOT::Math::XYZVector &vertex)
Sets position (decay vertex)
Definition: Particle.h:294
std::vector< int > getMdstArrayIndices(EParticleSourceObject type) const
Returns a vector of StoreArray indices of given MDST dataobjects.
Definition: Particle.cc:669
double m_jacobiMatrix[c_SizeMatrix]
error matrix (1D representation)
Definition: Particle.h:1024
void resetJacobiMatrix()
Resets 4x6 error matrix All elements are set to 0.0.
Definition: Particle.cc:1089
void set4VectorDividingByMomentumScaling(const ROOT::Math::PxPyPzEVector &p4)
Sets Lorentz vector dividing by the momentum scaling factor.
Definition: Particle.h:282
void storeJacobiMatrix(const TMatrixF &jacobiMatrix)
Stores 4x6 Jacobi matrix into private member m_jacobiMatrix.
Definition: Particle.cc:1106
bool isMostLikelyTrackFitResult() const
Returns true if the (track-based) particle is created with its most likely mass hypothesis based on T...
Definition: Particle.cc:1417
std::vector< double > m_extraInfo
Stores associated user defined values.
Definition: Particle.h:1047
double getEffectiveMomentumScale() const
Returns effective momentum scale which is the product of the momentum scaling and smearing factors.
Definition: Particle.h:579
unsigned m_mdstIndex
0-based index of MDST store array object
Definition: Particle.h:1029
double getPValue() const
Returns chi^2 probability of fit if done or -1.
Definition: Particle.h:624
Particle(const ROOT::Math::PxPyPzEVector &momentum, const int pdgCode)
Constructor from a Lorentz vector and PDG code.
void setFlavorType()
sets m_flavorType using m_pdgCode
Definition: Particle.cc:1154
double getEnergy() const
Returns total energy.
Definition: Particle.h:506
void setMomentumScalingFactor(double momentumScalingFactor)
Sets momentum scaling.
Definition: Particle.h:305
int getMdstSource() const
Returns unique identifier of final state particle (needed in particle combiner)
Definition: Particle.cc:371
ROOT::Math::XYZVector getVertex() const
Returns vertex position (POCA for charged, IP for neutral FS particles)
Definition: Particle.h:588
void fillAllDaughters(std::vector< const Belle2::Particle * > &allDaughters) const
Fill all generations' daughters into a vector.
Definition: Particle.cc:1131
bool hasExtraInfo(const std::string &name) const
Return whether the extra info with the given name is set.
Definition: Particle.cc:1267
std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
Definition: Particle.cc:1192
void setMdstArrayIndex(const int arrayIndex)
set mdst array index
Definition: Particle.cc:350
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:960
unsigned getMdstArrayIndex(void) const
Returns 0-based index of MDST store array object (0 for composite particles)
Definition: Particle.h:458
double m_py
momentum component y
Definition: Particle.h:1015
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:922
double m_x
position component x
Definition: Particle.h:1020
double m_px
momentum component x
Definition: Particle.h:1014
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:1399
EFlavorType getFlavorType() const
Returns flavor type of the decay (for FS particles: flavor type of particle)
Definition: Particle.h:440
~Particle()
Destructor.
void fillFSPDaughters(std::vector< const Belle2::Particle * > &fspDaughters) const
Fill final state particle daughters into a vector.
Definition: Particle.cc:1118
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:875
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:884
TClonesArray * m_arrayPointer
Internal pointer to DataStore array containing the daughters of this particle.
Definition: Particle.h:1056
EParticleSourceObject m_particleSource
(mdst) source of particle
Definition: Particle.h:1028
void fillDecayChain(std::vector< int > &decayChain) const
Fill vector with (PDGCode, MdstSource) pairs for the entire decay chain.
Definition: Particle.cc:1144
int getPDGCode(void) const
Returns PDG code.
Definition: Particle.h:425
double getPy() const
Returns y component of momentum.
Definition: Particle.h:561
bool wasExactFitHypothesisUsed() const
Returns true if the type represented by this Particle object was used use as a mass hypothesis during...
Definition: Particle.h:932
int getProperty() const
Returns particle property as a bit pattern The values are defined in the PropertyFlags enum and descr...
Definition: Particle.h:469
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:463
double m_momentumScalingFactor
momentum scaling factor
Definition: Particle.h:1018
unsigned getNDaughters(void) const
Returns number of daughter particles.
Definition: Particle.h:684
std::vector< Belle2::Particle * > getDaughters() const
Returns a vector of pointers to daughter particles.
Definition: Particle.cc:641
const std::vector< int > & getDaughterIndices() const
Returns a vector of store array indices of daughter particles.
Definition: Particle.h:693
double getZ() const
Returns z component of vertex position.
Definition: Particle.h:615
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.
void resetErrorMatrix()
Resets 7x7 error matrix All elements are set to 0.0.
Definition: Particle.cc:1083
double getPDGMass(void) const
Returns uncertainty on the invariant mass (requires valid momentum error matrix)
Definition: Particle.cc:608
void setMomentumSmearingFactor(double momentumSmearingFactor)
Sets momentum smearing.
Definition: Particle.h:315
EFlavorType m_flavorType
flavor type.
Definition: Particle.h:1027
int generatePDGCodeFromCharge(const int chargedSign, const Const::ChargedStable &chargedStable)
Generate the PDG code with correct sign, using the charge.
Definition: Particle.cc:1383
double getCharge(void) const
Returns particle charge.
Definition: Particle.cc:626
ROOT::Math::PxPyPzEVector get4Vector() const
Returns Lorentz vector.
Definition: Particle.h:516
void appendDaughter(int particleIndex, const bool updateType=true)
Appends index of daughter to daughters index array.
Definition: Particle.h:387
Particle()
Default constructor.
Definition: Particle.cc:45
TMatrixFSym getMomentumErrorMatrix() const
Returns the 4x4 momentum error matrix.
Definition: Particle.cc:439
double m_mass
particle (invariant) mass
Definition: Particle.h:1013
std::vector< const Belle2::Particle * > getAllDaughters() const
Returns a vector of pointers to all generations' daughter particles.
Definition: Particle.cc:661
double getAcoplanarity() const
Returns acoplanarity angle defined as the angle between the decay planes of the grand daughters in th...
Definition: Particle.cc:537
std::vector< int > m_daughterProperties
daughter particle properties
Definition: Particle.h:1031
double m_errMatrix[c_SizeMatrix]
error matrix (1D representation)
Definition: Particle.h:1023
std::vector< int > m_daughterIndices
daughter particle indices
Definition: Particle.h:1026
double getY() const
Returns y component of vertex position.
Definition: Particle.h:606
void addExtraInfo(const std::string &name, double value)
Sets the user-defined data of given name to the given value.
Definition: Particle.cc:1337
void set4Vector(const ROOT::Math::PxPyPzEVector &p4)
Sets Lorentz vector.
Definition: Particle.h:270
void setJacobiMatrix(const TMatrixF &jacobiMatrix)
Sets 4x6 jacobi matrix.
Definition: Particle.cc:411
int getExtraInfoMap() const
Return the id of the associated ParticleExtraInfoMap or -1 if no map is set.
Definition: Particle.h:878
double getPDGLifetime() const
Returns particle nominal lifetime.
Definition: Particle.cc:617
void setMomentumVertexErrorMatrix(const TMatrixFSym &errMatrix)
Sets 7x7 error matrix.
Definition: Particle.cc:397
ROOT::Math::XYZVector getMomentum() const
Returns momentum vector.
Definition: Particle.h:525
void setPValue(double pValue)
Sets chi^2 probability of fit.
Definition: Particle.h:337
EParticleSourceObject getParticleSource() const
Returns particle source as defined with enum EParticleSourceObject.
Definition: Particle.h:449
void updateMass(const int pdgCode)
Updates particle mass with the mass of the particle corresponding to the given PDG.
Definition: Particle.cc:601
double m_z
position component z
Definition: Particle.h:1022
void print() const
Prints the contents of a Particle object to standard output.
Definition: Particle.cc:1174
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:357
EFlavorType
describes flavor type, see getFlavorType().
Definition: Particle.h:93
@ c_Unflavored
Is its own antiparticle or we don't know whether it is a particle/antiparticle.
Definition: Particle.h:94
@ c_Flavored
Is either particle or antiparticle.
Definition: Particle.h:95
int m_pdgCode
PDG code.
Definition: Particle.h:1011
TMatrixFSym getMomentumVertexErrorMatrix() const
Returns 7x7 error matrix.
Definition: Particle.cc:424
PropertyFlags
Flags that describe the particle property, which are used in the MC matching.
Definition: Particle.h:115
@ c_IsIgnoreNeutrino
Is the particle MC matched with the ignore missing neutrino flag set?
Definition: Particle.h:121
@ c_IsIgnoreRadiatedPhotons
Is the particle MC matched with the ignore radiated photon flag set?
Definition: Particle.h:118
@ c_IsIgnoreGamma
Is the particle MC matched with the ignore missing gamma flag set?
Definition: Particle.h:122
@ c_IsUnspecified
Ordinary particles.
Definition: Particle.h:117
@ c_IsIgnoreBrems
Is the particle MC matched with the ignore added Brems gamma flag set?
Definition: Particle.h:123
@ c_IsIgnoreDecayInFlight
Is the particle MC matched with the ignore DecayInFlight flag set?
Definition: Particle.h:125
@ c_IsIgnoreMisID
Is the particle MC matched with the ignore MisID flag set?
Definition: Particle.h:124
@ c_IsIgnoreIntermediate
Is the particle MC matched with the ignore intermediate resonances flag set?
Definition: Particle.h:119
@ c_IsIgnoreMassive
Is the particle MC matched with the ignore missing massive particle flag set?
Definition: Particle.h:120
double getECLClusterEnergy() const
Returns the energy of the ECLCluster for the particle.
Definition: Particle.cc:923
const TrackFitResult * getTrackFitResult() const
Returns the pointer to the TrackFitResult that was used to create this Particle (ParticleType == c_Tr...
Definition: Particle.cc:858
double getMomentumMagnitude() const
Returns momentum magnitude.
Definition: Particle.h:534
Particle(const ROOT::Math::PxPyPzEVector &momentum, const int pdgCode, EFlavorType flavorType, const EParticleSourceObject particleType, const unsigned mdstIndex)
Constructor for final state particles.
void removeDaughter(const Particle *daughter, const bool updateType=true)
Removes index of daughter from daughters index array.
Definition: Particle.cc:692
double getP() const
Returns momentum magnitude (same as getMomentumMagnitude but with shorter name)
Definition: Particle.h:543
double m_y
position component y
Definition: Particle.h:1021
void setPDGCode(const int pdg)
Sets PDG code.
Definition: Particle.h:261
unsigned int getExtraInfoSize() const
Return the size of the extra info array.
Definition: Particle.h:884
int m_identifier
Identifier that can be used to identify whether the particle is unique or is a copy or representation...
Definition: Particle.h:1040
const std::vector< int > & getDaughterProperties() const
Returns a vector of properties of daughter particles.
Definition: Particle.h:702
int m_properties
particle property
Definition: Particle.h:1030
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
Definition: Particle.cc:635
ClassDefOverride(Particle, 16)
Class to store reconstructed particles.
double getExtraInfo(const std::string &name) const
Return given value if set.
Definition: Particle.cc:1290
ECLCluster::EHypothesisBit getECLClusterEHypothesisBit() const
Returns the ECLCluster EHypothesisBit for this Particle.
Definition: Particle.h:958
Particle(const ROOT::Math::PxPyPzEVector &momentum, const int pdgCode, EFlavorType flavorType, const std::vector< int > &daughterIndices, TClonesArray *arrayPointer=nullptr)
Constructor for composite particles.
bool replaceDaughterRecursively(const Particle *oldDaughter, Particle *newDaughter)
Apply replaceDaughter to all Particles in the decay tree by looping recursively through it,...
Definition: Particle.cc:727
double getMass() const
Returns invariant mass (= nominal for FS particles)
Definition: Particle.h:478
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:30
Abstract base class for different kinds of events.
Definition: ClusterUtils.h:23