MpdKfPrimaryVertexFinder.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef MPD_KFPRIMARYVERTEXFINDER_H
  2. #define MPD_KFPRIMARYVERTEXFINDER_H
  3. #include "MpdKalmanTrack.h"
  4. #include "FairTask.h"
  5. #include "TMatrixD.h"
  6. #include "TClonesArray.h"
  7. #include "TF1.h"
  8. #include "TH1D.h"
  9. class MpdKfPrimaryVertexFinder :public FairTask
  10. {
  11. public:
  12. /** Constructor **/
  13. MpdKfPrimaryVertexFinder(const char *name="MpdKfPrimaryVertexFinder", Int_t iVerbose = 1);
  14. /** Destructor **/
  15. virtual ~MpdKfPrimaryVertexFinder();
  16. /// * FairTask methods
  17. /** Intialisation at begin of run. To be implemented in the derived class.
  18. *@value Success If not kSUCCESS, task will be set inactive.
  19. **/
  20. InitStatus Init();
  21. /** Reinitialisation.
  22. *@value Success If not kSUCCESS, task will be set inactive.
  23. **/
  24. InitStatus ReInit();
  25. /** Intialise parameter containers.
  26. **/
  27. void SetParContainers();
  28. void Exec(Option_t * option);
  29. /** Action after each event. **/
  30. void Finish();
  31. void Reset();
  32. // Set containers - to use the task as an "external" one
  33. void SetVertices(TClonesArray *vertCont) { fVertexCont = vertCont; } // set vertex container
  34. void SetTracks(TClonesArray *tracks) { fTracks = tracks; } // set track container
  35. void SetConstrFlag(Int_t flag = 1) { fConstrFlag = flag; } // set vertex constrain flag
  36. void SetSmoothSame(Int_t flag = 1) { fSmoothSame = flag; } // smooth original tracks
  37. void Smooth(); // smooth (update track momenta and track lengths)
  38. void Chi2Vertex(); // compute chi2-distance of tracks to primary vertex
  39. private:
  40. void EvalVertex(); // evaluate primary vertex position
  41. void FindVertex(); // find primary vertex
  42. void ComputeAandB(TMatrixD &xk0, const MpdKalmanTrack *track, const MpdKalmanTrack &trackM,
  43. TMatrixD &a, TMatrixD &b, TMatrixD &ck0); // compute matrices of derivatives
  44. void Proxim(const MpdKalmanTrack &track0,MpdKalmanTrack &track); // adjust track params
  45. void FillVertex(); // fill vertex info
  46. void Write();
  47. void Writedir2current( TObject *obj );
  48. Int_t fConstrFlag; // flag for storing tracks with vertex constrain ( if != 0)
  49. Int_t fSmoothSame; // flag for smoothing original tracks (if fConstrFlag == 0)
  50. Int_t fNPass; //
  51. Double_t fXYZ[3]; // vertex position
  52. TMatrixD fCovar; // vertex position covariance matrix
  53. TF1 *fUnc; // fitting function
  54. TH1D *fHist[3]; // X-,Y-,Z-histograms
  55. TDirectory *fHistoDir; //
  56. TClonesArray *fTracks; // TPC tracks
  57. TClonesArray *fMCTracks; // MC tracks
  58. TClonesArray *fVertexCont; // vertices
  59. TClonesArray *fVertTracks; // tracks with vertex constrain
  60. //TClonesArray *fSTSTrackMatch;
  61. //FairVertex *fPrimVtx;
  62. //FairStsKFTrackFitter fStsFitter;
  63. private:
  64. // Some constants
  65. static const Double_t fgkChi2Cut; // max accepted Chi2 of track to be added to the vertex
  66. ClassDef(MpdKfPrimaryVertexFinder,2);
  67. };
  68. #endif