KFMCTrack.h 6.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 KFMCTRACK_H
  12. #define KFMCTRACK_H
  13. #include <cmath>
  14. /** @class KFMCTrack
  15. ** @brief A class for storage of the Monte Carlo simulated track in the cartesian parametrisation.
  16. ** @author M.Zyzak, I.Kisel
  17. ** @date 05.02.2019
  18. ** @version 1.0
  19. **
  20. ** A track is described with the parameters { X, Y, Z, Px, Py, Pz, q/P }. Parameters are stored at
  21. ** the origin position. Class also contains Id of the mother track, PDG code for the current track,
  22. ** number of Monte Carlo points produced by the simulation engine at the detector stations,
  23. ** number of Monte Carlo points produced at the precise detectors (like MVD in CBM, HFT in STAR,
  24. ** ITS in ALICE, etc.). It also has a flag showing if track was found by the reconstruction procedure
  25. ** for efficiency calculation, and a flag showing if track was out of acceptance.
  26. **/
  27. class KFMCTrack
  28. {
  29. public:
  30. KFMCTrack():fMotherId(-1),fPDG(0),fNMCPoints(0), fNMCPixelPoints(0), fIsReconstructed(0),fIsOutOfDetector(0) {};
  31. int MotherId() const { return fMotherId; } ///< Returns a uniqueue Id of the mother track or primary vertex KFMCTrack::fMotherId.
  32. int PDG() const { return fPDG;} ///< Returns PDG code of the track KFMCTrack::fPDG.
  33. float Par( int i ) const { return fPar[i]; } ///< Returns value of the parameter KFMCTrack::fPar with index "i".
  34. float X() const { return fPar[0]; } ///< Returns X coordinate of the track at the origin position.
  35. float Y() const { return fPar[1]; } ///< Returns Y coordinate of the track at the origin position.
  36. float Z() const { return fPar[2]; } ///< Returns Y coordinate of the track at the origin position.
  37. float L() const { return sqrt(X()*X() + Y()*Y() + Z()*Z()); } ///< Returns distance from the origin of the track to a point {0,0,0}.
  38. float Px() const { return fPar[3]; } ///< Returns Px momentum component of the track at the origin position.
  39. float Py() const { return fPar[4]; } ///< Returns Py momentum component of the track at the origin position.
  40. float Pz() const { return fPar[5]; } ///< Returns Pz momentum component of the track at the origin position.
  41. float P() const { return sqrt(fPar[3]*fPar[3] + fPar[4]*fPar[4] + fPar[5]*fPar[5]); } ///< Returns momentum of the track.
  42. float Pt() const { return sqrt(fPar[3]*fPar[3] + fPar[4]*fPar[4]); } ///< Returns transverse momentum of the track.
  43. const float *Par() const { return fPar; } ///< Returns a pointer to the array with track parameters KFMCTrack::fPar.
  44. int NMCPoints() const { return fNMCPoints; } ///< Returns number of MC points KFMCTrack::fNMCPoints.
  45. int NMCPixelPoints() const { return fNMCPixelPoints; } ///< Returns number of MC points at the precise detectors KFMCTrack::fNMCPixelPoints.
  46. bool IsReconstructed() const { return fIsReconstructed; } ///< Returns a flag showing if track was found by the reconstruction procedure.
  47. bool IsOutOfDetector() const { return fIsOutOfDetector; } ///< Returns a flag showing if track was out of acceptance.
  48. void SetPar( int i, float v ) { fPar[i] = v; } ///< Sets a value "v" to the parameter with index "i".
  49. void SetX( float v ) { fPar[0] = v; } ///< Sets X coordinate at the origin position of the track.
  50. void SetY( float v ) { fPar[1] = v; } ///< Sets Y coordinate at the origin position of the track.
  51. void SetZ( float v ) { fPar[2] = v; } ///< Sets Z coordinate at the origin position of the track.
  52. void SetPx( float v ) { fPar[3] = v; } ///< Sets Px momentum component at the origin position of the track.
  53. void SetPy( float v ) { fPar[4] = v; } ///< Sets Py momentum component at the origin position of the track.
  54. void SetPz( float v ) { fPar[5] = v; } ///< Sets Pz momentum component at the origin position of the track.
  55. void SetQP( float v ) { fPar[6] = v; } ///< Sets q/P at the origin position of the track.
  56. void SetMotherId( int v ) { fMotherId = v; } ///< Sets a unique id of the mother track if track is secondary or primary vertex with a negative sign if it is primary.
  57. void SetPDG( int v ) { fPDG = v; } ///< Sets PDG code of the current track.
  58. void SetNMCPoints( int v ) { fNMCPoints = v; } ///< Sets number of MC points produced at the detector planes.
  59. void SetNMCPixelPoints( int v ){ fNMCPixelPoints = v; } ///< Sets number of the MC points produced at the precise detectors.
  60. void SetReconstructed() { fIsReconstructed = 1; } ///< Defines the track as reconstructed.
  61. void SetNotReconstructed() { fIsReconstructed = 0; } ///< Defines the track as not reconstructed.
  62. void SetOutOfDetector() { fIsOutOfDetector = 1; } ///< Defines the track out of acceptance.
  63. protected:
  64. int fMotherId; ///< Index of the mother track in tracks array. If track is produced at the primary vertex (PV) negative value with the PV Id is assigned.
  65. int fPDG; ///< The PDG code of the current Monte Carlo track.
  66. float fPar[7]; ///< Parameters of the track: { X, Y, Z, Px, Py, Pz, q/P }, where "q" is its charge.
  67. int fNMCPoints; ///< Total number of Monte Carlo points produced by the simulation engine at the detector stations.
  68. int fNMCPixelPoints; ///< Number of Monte Carlo points produced at the precise detectors (like MVD in CBM, HFT in STAR, ITS in ALICE, etc.).
  69. bool fIsReconstructed; ///< A flag showing if track was found by the reconstruction procedure. Is required for correct efficiency calculation.
  70. bool fIsOutOfDetector; ///< A flag showing if track was out of acceptance. Is required for correct calculation of the acceptance.
  71. };
  72. #endif