MpdEctTrackFinderTpc.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef MPD_ECTTRACKFINDERTPC_H
  2. #define MPD_ECTTRACKFINDERTPC_H
  3. #include "TH1.h"
  4. #include "FairTask.h"
  5. //#include "FairStsKFTrackFitter.h"
  6. //#include "TLorentzVector.h"
  7. class MpdKalmanHitZ;
  8. class MpdKalmanHit;
  9. class MpdKalmanTrack;
  10. //class MpdStrawendcapPoint;
  11. class MpdEctKalmanTrack;
  12. class FairGeoTransform;
  13. class TClonesArray;
  14. class TVector2;
  15. class MpdEctTrackFinderTpc :public FairTask
  16. {
  17. public:
  18. /** Constructor **/
  19. MpdEctTrackFinderTpc(const char *name="MpdEctTrackFinderTpc", Int_t iVerbose = 1 );
  20. /** Destructor **/
  21. virtual ~MpdEctTrackFinderTpc();
  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 Mirror() { return fMirror; } ///< mirror flag (if TRUE - use ECT mirror hits)
  39. private:
  40. // Some constants
  41. static const Double_t fgkChi2Cut; ///< max accepted Chi2 of hit for track
  42. static const Int_t fgkNlays = 60 * 2, fgkNtube = 700, fgkNlays2 = 60; // nLaysMax, nTubesMax
  43. private:
  44. void InitGeo(); ///< initialize detector geometry
  45. Int_t GetNofHitsInLayer(Int_t lay) { return (Int_t)fhLays->GetCellContent(lay+1,0); }
  46. Int_t GetHitsInLayer(Int_t lay) { return fLayPointers[lay]; } ///< first index of hits in layer
  47. void GetTrackSeeds(Int_t iPass); // build track seeds
  48. void DoTracking(Int_t iPass); // run tracking
  49. void MakeKalmanHits(); // create Kalman hits
  50. void MakeKalmanHitsTgem(); // create Kalman hits for TGEM
  51. void MakeKalmanHitsDch(); // create Kalman hits for DCH
  52. void PassWall(MpdEctKalmanTrack *track, Double_t thick); ///< pass TPC end-plate
  53. Int_t RunKalmanFilter(MpdEctKalmanTrack *track, Int_t layBeg); ///< run Kalman filter
  54. void SelectTracks(Int_t iPass); ///< do track selection and compute shared hit multiplicities
  55. void RemoveDoubles(); ///< remove double tracks
  56. Int_t NofCommonHits(MpdEctKalmanTrack* track, MpdEctKalmanTrack* track1, Int_t dir = 1); ///< get number of common hits
  57. void AddHits(); // add hit objects to tracks
  58. Int_t HitMotherId(MpdKalmanHit* hit, Int_t idM, Int_t &id1); // check if hit has the same mother ID as idM
  59. void StoreTracks(Int_t iPass); // transfer tracks from fTrackCand to fTracks
  60. void ExcludeHits(); // exclude used hits
  61. void Write();
  62. void Writedir2current( TObject *obj );
  63. Double_t Proxim(Double_t phi0, Double_t phi); // adjust angle for continuity
  64. Double_t Proxim(MpdKalmanTrack *track, const MpdKalmanHit *hit); ///< adjust R-Phi coord. for continuity
  65. TVector2 GetDistance(MpdEctKalmanTrack *track, MpdKalmanHit *hit); ///< hit-track distance
  66. Int_t fDetType; // detector type: 1 = ECT, 0 = TGEM, 2 = DCH
  67. Int_t fNPass;
  68. Bool_t fMirror; // kTRUE if use ECT mirror hits
  69. Bool_t fExact; // exact match flag (if 1 exact match of IDs)
  70. //Int_t fNofLays; //!< actual number of detector layers
  71. Int_t fNofTubes; //!< actual number of tubes in a layer
  72. Double_t frMinMax[3]; //!< min / max radii of ECT and tube radius
  73. Double_t fZplanes[fgkNlays];
  74. TDirectory *fHistoDir;
  75. TH1F *fhNBranches;
  76. Double_t fZtpc; // Z-edge of TPC
  77. TClonesArray *fEctPoints; //! ECT MC points
  78. TClonesArray *fEctHits; //! ECT Hits
  79. TClonesArray *fKHits; //!< array of Kalman hits
  80. TClonesArray *fTpcTracks; //!< array of TPC tracks
  81. TClonesArray *fMCTracks; //!< array of MC tracks
  82. //TClonesArray *fSTSTrackMatch;
  83. TClonesArray *fTracks; //! ECT tracks
  84. TClonesArray *fTrackCand; //! ECT track candidates
  85. Int_t *fLayPointers; //!< locations of hits from different layers
  86. TH1F *fhLays; //!< histo with layer hit multiplicities
  87. //std::set<Int_t> fTpcUsed; //!< used TPC tracks
  88. FairGeoTransform *fTransf[fgkNlays][fgkNtube];
  89. //FairVertex *fPrimVtx;
  90. //FairStsKFTrackFitter fStsFitter;
  91. ClassDef(MpdEctTrackFinderTpc,1);
  92. };
  93. #endif