MpdMotherFitterSimple.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef MPDMOTHERFITTERSIMPLE_H
  2. #define MPDMOTHERFITTERSIMPLE_H
  3. /// \ingroup rec
  4. /// \class MpdMotherFitterSimple
  5. /// \brief Simple mother fitter for the MPD detector
  6. /// \bried (using helices and straight lines)
  7. ///
  8. /// \author Alexander Zinchenko, LHEP JINR Dubna
  9. class MpdKalmanTrack;
  10. #include "MpdHelix.h"
  11. #include "FairTask.h"
  12. #include <TLorentzVector.h>
  13. #include <TMatrixD.h>
  14. #include <TVector3.h>
  15. #include <vector>
  16. using std::vector;
  17. class TClonesArray;
  18. void FcnDist(Int_t &npar, Double_t *gin, Double_t &rf, Double_t *par, Int_t iflag); // compute distance between straight line and helix
  19. class MpdMotherFitterSimple : public FairTask
  20. {
  21. public:
  22. static MpdMotherFitterSimple* Instance(); ///< get singleton instance
  23. static MpdMotherFitterSimple* Instance(const char *name, const char *title="FAIR Task"); ///< get singleton instance
  24. virtual void Exec(Option_t * option);
  25. void Reset();
  26. void Register();
  27. //virtual InitStatus ReInit();
  28. TLorentzVector BuildMother(vector<Double_t> &mass, vector<MpdKalmanTrack*> &vDaughtTr,
  29. vector<TLorentzVector*> &vDaughLv); // build mother from tracks and/or Lorentz vectors
  30. void FindVertex(vector<MpdKalmanTrack*> vDaught); // find vertex from daughter tracks
  31. const Double_t* GetVertex() const { return fVtx; } // return vertex position
  32. const TVector3& GetMomN() const { return fMomN; } // return neutral particle momentum
  33. MpdHelix* GetHelix(Int_t i) const { return fTrC[i]; } // return track helix
  34. Double_t GetDca() const { return fDist; } // return distance between particles
  35. Double_t Phi(MpdHelix *helix) const; // return track Phi
  36. Double_t Pt(MpdHelix *helix) const { return TMath::Abs (fieldConst / helix->curvature()); } // track Pt
  37. Double_t FieldConst() const { return fieldConst; } // return field constant
  38. protected:
  39. virtual InitStatus Init();
  40. virtual InitStatus ReInit();
  41. virtual void Finish();
  42. virtual ~MpdMotherFitterSimple(); ///< Destructor
  43. private:
  44. MpdMotherFitterSimple(); ///< Default ctor
  45. MpdMotherFitterSimple(const char *name, const char *title="FAIR Task"); ///< Ctor
  46. static void DestroyInstance () { if (fgMF) delete fgMF; } // automatic deleting
  47. //void EvalVertex(vector<MpdKalmanTrack*> vDaught); // evaluate vertex from daughter tracks
  48. //void Smooth(vector<MpdKalmanTrack*> vDaught); // smooth (update track momenta and track lengths)
  49. //void ComputeAandB(TMatrixD &xk0, const MpdKalmanTrack *track, const MpdKalmanTrack &trackM,
  50. // TMatrixD &a, TMatrixD &b, TMatrixD &ck0); // compute matrices of derivatives
  51. //void Proxim(const MpdKalmanTrack &track0, MpdKalmanTrack &track); // adjust track params
  52. private:
  53. static MpdMotherFitterSimple* fgMF;
  54. Double_t fieldConst; //! mag. field constant
  55. Double_t fVtx[3]; //! decay vertex position
  56. //TMatrixD fCovar; //! covariance matrix
  57. MpdHelix *fTrC[3]; //! charged track helices
  58. TVector3 fMomN; //! neutral track momentum
  59. Double_t fDist; //! distance between particles
  60. ClassDef(MpdMotherFitterSimple,1);
  61. };
  62. #endif