// ************************************************************************* // Author: Martin Galuska // martin (dot) j [dot] galuska physik {dot} uni (minus) giessen de // // This class is loosely modeled after the // mvd/MvdTracking/PndRiemannTrackFinder // sttmvdtracking/PndMvdSttGemRiemannTrackFinder // classes // // // This is a class version of the HoughTest.C macro tracking test implementation minus all the plotting stuff // Take a look at the notes of the macro version // // // Recent Changes // Major code cleanup and deletion of test code / unneeded code // use PndFtsHoughTrackCand to store information about track candidates and Hough transforms // Find all peaks with a minimum height // Moved all Hough space related code to PndFtsHoughSpace -> Major code simplification, better maintainability // Fill PndTrackCands and PndTrack for output // // TODO // Match straight line for stations 5+6 to parabola // Add skewed hits // Add drift circles // Adaptive Hough // // // Created: 18.06.2013 // // ************************************************************************* #ifndef PndFtsHoughTrackFinder_H #define PndFtsHoughTrackFinder_H #include "TClonesArray.h" #include "PndTrackCand.h" #include "PndTrack.h" #include "Rtypes.h" // for Double_t, Int_t, etc #include #include #include #include #include "PndFtsHoughSpace.h" #include "PndFtsHoughTracklet.h" #include "PndFtsHoughTrackCand.h" class PndFtsHoughTrackerTask; class TString; class FairField; class TClonesArray; //class PndGeoFtsPar; //class TGraph; class FairHit; class PndFtsHoughTrackFinder { public: PndFtsHoughTrackFinder(PndFtsHoughTrackerTask *trackerTask, Int_t branchId, TClonesArray* hits, FairField* field); ///< Sets the array of all FTS hits and the branchId (super important!) virtual ~PndFtsHoughTrackFinder(); void FindTracks(); ///< Main function to start the track finding void SetVerbose (int verbose){fVerbose = verbose;}; void SetSaveDebugInfo(Bool_t saveDebugInfo){ fSaveDebugInfo = saveDebugInfo;}; // Output Int_t NTracks() const { return fHoughTrackCands.size(); }; ///< Returns the number of found tracks PndFtsHoughTrackCand GetHoughTrack(int i) const { return fHoughTrackCands[i]; }; ///< Returns the track with the index i PndTrack GetPndTrack(int i){ return fHoughTrackCands[i].getPndTrack(); }; // calculates first and last parameter, but uses an empty PndTrackCand which has to be set lateron using SetTrackCandRef PndTrackCand GetPndTrackCand(int i) { return fHoughTrackCands[i].getPndTrackCand(); }; // Parameters // void SetMinPeakHeightZxLineParabola(UInt_t val){ fMinPeakHeightZxLineParabola = val; }; // void SetMinPeakHeightZxParabola(UInt_t val){ fMinPeakHeightZxParabola = val; }; // void SetMinPeakHeightZxParabolaLine(UInt_t val){ fMinPeakHeightZxParabolaLine = val; }; // void SetMinPeakHeightZyLine(UInt_t val){ fMinPeakHeightZyLine= val; }; private: inline void Print(const std::vector& tracklets) const{ for (UInt_t i=0; i< tracklets.size(); ++i) { tracklets[i].Print(); } }; inline void PrintFoundTracklets(const std::vector& tracklets, const TString& option) const{ std::cout << tracklets.size() << " peaks found for " << option << '\n'; if (10 fHoughTrackCandsNew; ///< Temporary Hough Track Cands are used internally to store track cands std::vector fHoughTrackCands; ///< Hough Track Cands are used internally to store track cands // std::vector fTrackCand; // resulting track candidates, also used for returning PndTracks static const Double_t meinpi = 3.14159265359; // sets where the midpoint of the parabola is supposed to be static const Double_t fZLineParabola = 368.; // the value should coincide with the start of the dipole field // 368. was ok static const Double_t fZParabolaLine = 605.; // the value should coincide with the end of the dipole field // TODO determine this value Bool_t FilterTrackletsBasedOnSharedHits( UInt_t maxAcceptableSharedHits, std::vector &tracklets ); // takes the heighest peak (according to peak finder) // of all peaks that share > maxSameHits ClassDef(PndFtsHoughTrackFinder,1); }; #endif /*PndFtsHoughTrackFinder_H*/