//----------------------------------------------------------- // 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 "TrackCand.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(),PndTpcClusterZ()); 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 method=0; bool foundAtAll=false; //std::cout<<"hit"<getNumHits()<_minHitsForFit)method=1; else method=0; // CORRELATE HIT WITH TRACK double matchQuality=99999; bool found=_correlators[method]->corr(trk,rhit,matchQuality); //std::cout<<"method="<addHit(rhit); } else { // which method? method=0; while(!_found[method])++method; // if first method has found use this .. // add track to best match PndTpcRiemannTrack* theTrk=candlist[_bestMatchIndex[method]]; theTrk->addHit(rhit); if(theTrk->getNumHits()>=_minHitsForFit)theTrk->refit(); } resetFlags(); } // end loop over cluster std::cout<getNumHits()<<" hits R="; if(candlist[i]->getNumHits()>=_minHitsForFit)std::cout<r(); std::cout<