//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // Implementation of class PndTpcRiemannTrackFinder // see PndTpcRiemannTrackFinder.h for details // // Environment: // Software developed for the PANDA Detector at FAIR. // // Author List: // Sebastian Neubert TUM (original author) // // //----------------------------------------------------------- // Panda Headers ---------------------- // This Class' Header ------------------ #include "PndTpcRiemannTrackFinder.h" // C/C++ Headers ---------------------- #include #include // Collaborating Class Headers -------- #include "DebugLogger.h" #include "PndTpcClusterRadius.h" #include "PndTpcClusterZ.h" #include "GFTrackCand.h" #include "PndTpcCluster.h" #include "PndTpcRiemannTrack.h" #include "PndTpcRiemannHit.h" #include "PndTpcProximityHTCorrelator.h" #include "PndTpcRiemannHTCorrelator.h" // Class Member definitions ----------- PndTpcRiemannTrackFinder::PndTpcRiemannTrackFinder() : _minHitsForFit(5) { // correlators in decreasing priority! //addCorrelator(new PndTpcProximityHTCorrelator(1.)); //addCorrelator(new PndTpcRiemannHTCorrelator(5.E-4)); } PndTpcRiemannTrackFinder::~PndTpcRiemannTrackFinder() { for(int i=0;i<_correlators.size();++i){ if(_correlators[i]!=NULL){ delete _correlators[i]; _correlators[i]=NULL; } } _correlators.clear(); } void PndTpcRiemannTrackFinder::addCorrelator(PndTpcAbsHitTrackCorrelator* c) { _correlators.push_back(c); _found.push_back(false); _bestMatchQuality.push_back(9999); _bestMatchIndex.push_back(0); } unsigned int PndTpcRiemannTrackFinder::buildTracks(std::vector& cll, std::vector& candlist) { //std::sort(cll.begin(),cll.end(),PndTpcClusterRadius()); unsigned int ncl=cll.size(); for(unsigned int icl=0;iclpos().Print(); PndTpcRiemannHit* rhit=new PndTpcRiemannHit(cll[icl]); unsigned int ntrks=candlist.size(); unsigned int maxlevel=0; // index of deepest correlator reached bool foundAtAll=false; //std::cout<<"hit"<corr(trk,rhit,survive,matchQuality); if(!applicable)continue; // try the next correlator if(!survive){ trksurvive=false; break; // track has failed this level --> can be excluded } if(icormatchQuality){ _bestMatchQuality[icor]=matchQuality; _bestMatchIndex[icor]=itrk; trksurvive=true; } } // end loop over correlator foundAtAll|=trksurvive; } // end loop over tracks if(!foundAtAll)// new track { PndTpcRiemannTrack* trk=new PndTpcRiemannTrack(); candlist.push_back(trk); //std::cout<<"Creating new track"<addHit(rhit); } else { // add hit to best match // use the bestMatch from deepest level // std::cout<<"bestMatch[0]="<<_bestMatchIndex[0] // <<" bestMatch[1]="<<_bestMatchIndex[1]<addHit(rhit); if(theTrk->getNumHits()>=_minHitsForFit){ theTrk->refit(); theTrk->szFit(); } } resetFlags(); } // end loop over cluster std::cout<getNumHits()<<" hits R="; // if(candlist[i]->getNumHits()>=_minHitsForFit)std::cout<r(); // std::cout<