KFMCParticle.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. //----------------------------------------------------------------------------
  2. // Implementation of the KFParticle class
  3. // .
  4. // @author I.Kisel, I.Kulakov, M.Zyzak
  5. // @version 1.0
  6. // @since 20.08.13
  7. //
  8. //
  9. // -= Copyright &copy ALICE HLT and CBM L1 Groups =-
  10. //____________________________________________________________________________
  11. #ifndef _KFMCParticle_h_
  12. #define _KFMCParticle_h_
  13. #include <vector>
  14. #ifdef HLTCA_STANDALONE
  15. #include "RootTypesDef.h"
  16. #else
  17. #include "TObject.h"
  18. #endif
  19. /** @class KFMCParticle
  20. ** @brief A class to store relations between mother and daughter Monte Carlo simulated particles.
  21. ** @author M.Zyzak, I.Kisel
  22. ** @date 05.02.2019
  23. ** @version 1.0
  24. **
  25. ** The class is used to calculate reconstruction efficiency of all Monte Carlo particles. It is
  26. ** simplifies the procedure for short-lived particles. Contains a vector with unique Ids of all
  27. ** MC daughters, a unique Id of the corresponding MC track, a unique Id of the MC mother particle,
  28. ** the PDG code of the MC particle, flags showing if particle can be reconstructed according
  29. ** to several different definitions, flags showing if particle creates a secondary vertex with
  30. ** two or more daughters, an index of the initial particle Id in case of the K->mu+nu and pi-> mu+nu
  31. ** decays, since GEANT engines do not store neutrinos.
  32. **/
  33. class KFMCParticle :public TObject
  34. {
  35. public:
  36. KFMCParticle();
  37. ~KFMCParticle();
  38. void AddDaughter( int i ); ///< Adds an Id of the new particle to the list with Ids of daughter particles.
  39. int NDaughters() const { return fDaughterIds.size(); } ///< Returns number of daughter particles.
  40. const std::vector<int>& GetDaughterIds() const { return fDaughterIds; } ///< Returns a reference to the vector with Id of daughter particle KFMCParticle::fDaughterIds.
  41. void CleanDaughters() { fDaughterIds.resize(0); } ///< Remove Ids of all daughter particles from the current object.
  42. void SetPDG(int pdg) {fPDG = pdg;} ///< Set the PDG code of the current particle KFMCParticle::fPDG.
  43. void SetMCTrackID(int id) {fMCTrackID = id;} ///< Sets the Id of the corresponding Monte Carlo track KFMCParticle::fMCTrackID.
  44. void SetMotherId(int id) {fMotherId = id;} ///< Sets the Id of the mother particle or primary vertex KFMCParticle::fMotherId.
  45. int GetMCTrackID() const {return fMCTrackID;} ///< Returns Id of the corresponding MC track KFMCParticle::fMCTrackID.
  46. int GetMotherId() const {return fMotherId;} ///< Returns Id of the mother particle or primary vertex KFMCParticle::fMotherId.
  47. int GetPDG() const {return fPDG;} ///< Returns PDG code of the current particle KFMCParticle::fPDG.
  48. bool IsReconstructable(int i) const {return fIsReconstructable[i];} ///< Returns a flag showing if particle can be reconstructed with KFMCParticle::fIsReconstructable index "i".
  49. void SetAsReconstructable(int i) { fIsReconstructable[i] = 1;} ///< Defines the particle as those which should be reconstructed for the efficiency set "i".
  50. bool IsReconstructableV0(int i) const {return fIsV0[i];} ///< Returns a flag showing if particle is a reconstructable V0.
  51. void SetAsReconstructableV0(int i) { fIsV0[i] = 1;} ///< Defines the particle as V0 which should be reconstructed for the efficiency set "i".
  52. void SetInitialParticleId(int i) {fInitialParticleId = i;} ///< Sets Id of the Monte Carlo particle, from which the current particle was copied.
  53. int InitialParticleId() const {return fInitialParticleId;} ///< Returns the Id of the Monte Carlo particle, from which the current particle was copied.
  54. private: //data
  55. std::vector<int> fDaughterIds; ///< A vector with Ids of the daughter Monte Carlo particles.
  56. int fMCTrackID; ///< A unique Id of the corresponding Monte Carlo track.
  57. int fMotherId; ///< A unique Id of the mother particle. If the current particle is primary the Id of the primary vertex with a negative sigh is stored.
  58. int fPDG; ///< A PDG code of the current particle.
  59. /** Flags for calculation of the efficiency, define the denominator in each set of efficiency.
  60. ** Flags 0-2 are used for particles reconstructed by the conventional method, 3 and 4 are used
  61. ** for particles found by the missing mass method: \n
  62. ** [0] - true for all particles, is used for calculation of the efficiency in 4pi;\n
  63. ** [1] - true if the particle is long-lived and can be reconstructed in the detector or
  64. ** if the particle is short-lived and all its daughter particles can be reconstructed; detector-dependent;\n
  65. ** [2] - true if the particle is long-lived and is reconstructed in the detector or
  66. ** if the particle is short-lived and all its daughter particles are reconstructed,
  67. ** is used in calculation of efficiency of the KF Particle Finder method;\n
  68. ** [3] - true if the particle is long-lived and is reconstructed in the detector or
  69. ** if the particle is short-lived, can be reconstructed by the missing mass method
  70. ** and all its daughter particles are reconstructed; \n
  71. ** [4] - true for all particles, which can be found by the missing mass method,
  72. ** is used for calculation of the efficiency in 4pi.
  73. **/
  74. bool fIsReconstructable[5];
  75. /** Flags to calculate efficiency of short-lived particles producing a secondary vertex with
  76. ** two or more daughters; similar to KFMCParticle::fIsReconstructable[0-2].
  77. **/
  78. bool fIsV0[3];
  79. /** For calculation of missing mass method efficiency a copy of the mother particle
  80. ** is created. fInitialParticleId is an Id of the initial mother particle.
  81. **/
  82. int fInitialParticleId;
  83. #ifndef KFParticleStandalone
  84. ClassDef( KFMCParticle, 1 )
  85. #endif
  86. };
  87. #endif