MpdEctTrackFinderTof.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #ifndef MPD_ECTTRACKFINDERTOF_H
  2. #define MPD_ECTTRACKFINDERTOF_H
  3. #include "FairTask.h"
  4. //#include "FairStsKFTrackFitter.h"
  5. //#include "TLorentzVector.h"
  6. #include "TH1.h"
  7. #include <map>
  8. class MpdKalmanHit;
  9. class MpdKalmanTrack;
  10. class MpdTofHit;
  11. class MpdEctKalmanTrack;
  12. class FairGeoTransform;
  13. class TClonesArray;
  14. class TVector2;
  15. class MpdEctTrackFinderTof :public FairTask
  16. {
  17. public:
  18. /** Constructor **/
  19. MpdEctTrackFinderTof(const char *name="MpdEctTrackFinderTof", Int_t iVerbose = 1 );
  20. /** Destructor **/
  21. virtual ~MpdEctTrackFinderTof();
  22. /// * FairTask methods
  23. /** Intialisation at begin of run. To be implemented in the derived class.
  24. *@value Success If not kSUCCESS, task will be set inactive.
  25. **/
  26. InitStatus Init();
  27. /** Reinitialisation.
  28. *@value Success If not kSUCCESS, task will be set inactive.
  29. **/
  30. InitStatus ReInit();
  31. /** Intialise parameter containers.
  32. **/
  33. void SetParContainers();
  34. void Exec(Option_t * option);
  35. /** Action after each event. **/
  36. void Finish();
  37. void Reset();
  38. Bool_t Tpc() { return fTpc; } ///< TPC flag (if TRUE - reco after TPC to ECT reco)
  39. void SetTpc(Bool_t tpc) { fTpc = tpc; } ///< set TPC flag (if TRUE - reco after TPC to ECT reco)
  40. private:
  41. // Some constants
  42. static const Double_t fgkChi2Cut; ///< max accepted Chi2 of hit for track
  43. static const Int_t fgkNlays = 60 * 2, fgkNtube = 700, fgkNlays2 = 60; // nLaysMax, nTubesMax
  44. private:
  45. void InitGeo(); ///< initialize detector geometry
  46. Int_t GetNofHitsInLayer(Int_t lay) { return (Int_t)fhLays->GetCellContent(lay+1,0); }
  47. Int_t GetHitsInLayer(Int_t lay) { return fLayPointers[lay]; } ///< first index of hits in layer
  48. void MatchEtof(); ///< match tracks with ETOF hits
  49. void GetTrackSeeds(Int_t iPass); // build track seeds
  50. void DoTracking(Int_t iPass); // run tracking
  51. void MakeKalmanHits(); // create Kalman hits
  52. void EvalParams(const MpdTofHit *tof, const MpdKalmanHit *ect, MpdEctKalmanTrack *track,
  53. Double_t rEct, Double_t phEct); // evaluate params
  54. void EvalCovar(const MpdTofHit *tof, const MpdKalmanHit *ect, MpdEctKalmanTrack *track,
  55. Double_t rEct, Double_t phEct); // eval. covariance
  56. Int_t RunKalmanFilter(MpdEctKalmanTrack *track, Int_t layBeg); ///< run Kalman filter
  57. void RemoveDoubles(); ///< remove double tracks
  58. Int_t NofCommonHits(MpdEctKalmanTrack* track, MpdEctKalmanTrack* track1); ///< get number of common hits
  59. void AddHits(); // add hit objects to tracks
  60. Int_t HitMotherId(MpdKalmanHit* hit, Int_t idM, Int_t &id1); // check if hit has the same mother ID as idM
  61. void SetTrackID(MpdEctKalmanTrack *track); // set track ID from IDs of its hits
  62. void SelectTracks(Int_t iPass); ///< do track selection and compute shared hit multiplicities
  63. void StoreTracks(Int_t iPass); // transfer tracks from fTrackCand to fTracks
  64. void ExcludeHits() { }; // exclude used hits
  65. void Write();
  66. void Writedir2current( TObject *obj );
  67. Double_t Proxim(MpdKalmanTrack *track, const MpdKalmanHit *hit); ///< adjust R-Phi coord. for continuity
  68. TVector2 GetDistance(MpdEctKalmanTrack *track, MpdKalmanHit *hit); ///< hit-track distance
  69. void MatchTpc(); ///< match tracks with TPC tracks
  70. void PassWall(MpdEctKalmanTrack *track, Double_t thick); ///< pass TPC end-plate
  71. void GoToBeamLine(); // propagate tracks to the beam line
  72. Double_t CorrectForLoss(Double_t pt, Double_t the, Int_t id); // correct for dE loss in pipe
  73. Int_t GetParticleId(Int_t id); ///< particle ID for track id
  74. void MergeWithTpc(MpdEctKalmanTrack *track); ///< merge track with TPC track
  75. void Smooth(); ///< primary vertex constraints
  76. void GoOutward(); ///< go outward
  77. Int_t fNPass;
  78. Bool_t fTpc;
  79. //Int_t fNofLays; //!< actual number of detector layers
  80. Int_t fNofTubes; //!< actual number of tubes in a layer
  81. Double_t frMinMax[3]; //!< min / max radii of ECT and tube radius
  82. Double_t fZplanes[fgkNlays];
  83. TDirectory *fHistoDir;
  84. TH1F *fhNBranches;
  85. Int_t fExact; //!< exact match flag (if 1 match IDs)
  86. TClonesArray *fEctHits; //! ECT hits
  87. TClonesArray *fTofHits; //! TOF hits
  88. TClonesArray *fTofPoints; //! TOF points
  89. TClonesArray *fKHits; //!< array of Kalman hits
  90. TClonesArray *fMCTracks; //!< array of MC tracks
  91. //TClonesArray *fSTSTrackMatch;
  92. TClonesArray *fTracks; //! ECT tracks
  93. TClonesArray *fTpcTracks; //! TPC tracks
  94. TClonesArray *fTrackCand; //! ECT track candidates
  95. TClonesArray *fPrimVtx; //! event vertices
  96. Int_t *fLayPointers; //!< locations of hits from different layers
  97. TH1F *fhLays; //!< histo with layer hit multiplicities
  98. FairGeoTransform *fTransf[fgkNlays][fgkNtube];
  99. std::map<Int_t,std::pair<Double_t,Double_t> > fWireMap;
  100. //FairVertex *fPrimVtx;
  101. //FairStsKFTrackFitter fStsFitter;
  102. ClassDef(MpdEctTrackFinderTof,1);
  103. };
  104. #endif