#ifndef PndForwardTrackFinderTask_H #define PndForwardTrackFinderTask_H #include "FairTask.h" #include "FairRuntimeDb.h" #include "FairRunAna.h" #include "FairHit.h" #include "PndGeoFtsPar.h" #include "PndFtsMapCreator.h" #include "PndFtsCellTrackletGenerator.h" #include "PndTrackCombiner.h" #include "PndLine.h" #include "PndFtsLineApproximator.h" #include "PndModuleCombiner.h" #include "PndWayFollower.h" #include "PndTrackCollection.h" #include "PndFtsPoint.h" #include "TClonesArray.h" #include "TVector3.h" #include #include #include /* * This task starts the forward track finder. * You can add the task to the root-macro to start the fts track finder. * */ class PndForwardTrackFinderTask: public FairTask { public: PndForwardTrackFinderTask() : eventNumber(0) { //the different part-algorithms need this parameter PndTrackCombiner::compDist = 0.8; //max distance for the piercing-points PndTrackCombiner::compAngle = 7; //max angle between the lines PndModuleCombiner::compDist = 0.8; //same parameter for module combiner PndModuleCombiner::compAngle = 7; PndTrackCombiner::compQuali = 700; //mixed parameter ( dist and angle ) PndWayFollower::qualiT = 4000; //mixed paranmeter for the way-follower PndModuleCombiner::hitAddT = 3; //dist parameter for the last step (adding hits afterwards) } virtual ~PndForwardTrackFinderTask(); virtual InitStatus Init(); virtual void SetParContainers(); virtual void Exec(Option_t* opt); virtual void FinishEvent(); virtual void Finish(); // save the parameter in root branch void saveCombined(vector combined,Int_t branch,Int_t branchID,Bool_t useOrgHits); void saveCorrectedTracklets(map>); void saveTrackCollection(vector coll,Bool_t withOrgHits); private: Int_t eventNumber; //the number of the processed event TClonesArray* fHits; //contains the fts-hits FairRootManager *fIoman; //needed for read and write to root data std::vector fFirstTrackCand; //contains the output of the cellular automaton //root branches for solutions and part-solutions: TClonesArray* planes; //for the trackCombiner TClonesArray* planesHit; TClonesArray* fFirstTrackCandArray; //for the track-candidates (output of cellular automaton) TClonesArray* correctedTracklets; //output of step 2 (approximate lines) with corrected hits TClonesArray* correctedHits; //the corrected hits after step 2 TClonesArray* fLayerTracks; //output of step 3 (combine inside one station) TClonesArray* fLayerTracksHits; //corrected hits after step 3 TClonesArray* fGlobalTracks; //output of step 4 (combine between stations) TClonesArray* fGlobalTracksHits; //corrected hits after step 4 TClonesArray* fTrackCollection; //contains the part-approximations (output of way-follower) TClonesArray* fTrackCollectionHits; //corrected hits of the part approximations TClonesArray* fFinalSolution; //final sollution of this algorithm TClonesArray* rootBranches[5]; //modules for the different parts of the algorithm PndFtsCellTrackletGenerator* fPndFtsCellTrackletGenerator; //for step 1 (cellular automaton) PndFtsLineApproximator* fPndFtsLineApproximator; //for step 2 (can approximate lines) PndTrackCombiner* fPndTrackCombiner; //for step 3 (can combine lines inside fts-station) //for step 4 and 6 (can combine lines between stations + add hits afterwards): PndModuleCombiner* fModuleCombiner; PndWayFollower* fWayFollower; //for step 5 (can find tracks inside magnatic field) //ClassDef(PndForwardTrackFinderTask,1); Int_t combinedTracksHitNum; //needet for the index in the root-branch Int_t combinedTracksTrackNum; map fOriginalHits; //a map from tubeID -> original fts hit //only used for statistics (not relevant for the algorithm): void createStatictcs(vector c,vector a); PndLineApproximation getBest(PndTrackCollection &c,vector a); Int_t getMcId(vector hits); Int_t dists[20]; Int_t angles[20]; ClassDef(PndForwardTrackFinderTask,1); }; #endif