// ------------------------------------------------------------------------- // ----- PndStraightLineTrackFinderTask ----- // ----- Created 22/10/09 by M. Michel ----- // ------------------------------------------------------------------------- #include "TClonesArray.h" #include "TArrayD.h" #include "TGeoManager.h" #include "FairRootManager.h" #include "FairRun.h" #include "FairRuntimeDb.h" #include "PndStraightLineTrackFinderTask.h" #include "PndSdsDigiStrip.h" #include "TStopwatch.h" // #include "PndSdsPixelCluster.h" // ----- Default constructor ------------------------------------------- PndStraightLineTrackFinderTask::PndStraightLineTrackFinderTask(Int_t inFinderMode, TString hitBranch, TString clusterBranch, TString digiBranch, Int_t innSensPP) : FairTask("LMD Track Finding Task"), nSensPP(innSensPP) { fFinderMode = inFinderMode; fHitBranchStrip = hitBranch; fClusterBranchStrip = clusterBranch; fDigiBranchStrip = digiBranch; dXY = 0.1; flagStipSens = false; flagPixelSens = true; // dXY = 0.01;//TEST } // ------------------------------------------------------------------------- // ----- Destructor ---------------------------------------------------- PndStraightLineTrackFinderTask::~PndStraightLineTrackFinderTask() { } // ------------------------------------------------------------------------- // ----- Initialization of Parameter Containers ------------------------- void PndStraightLineTrackFinderTask::SetParContainers() { // Get Base Container /* FairRun* ana = FairRun::Instance(); FairRuntimeDb* rtdb=ana->GetRuntimeDb(); fGeoPar = (PndSdsGeoPar*)(rtdb->getContainer("PndSdsGeoPar")); */ } InitStatus PndStraightLineTrackFinderTask::ReInit() { InitStatus stat=kERROR; return stat; /* FairRun* ana = FairRun::Instance(); FairRuntimeDb* rtdb=ana->GetRuntimeDb(); fGeoPar=(PndSdsGeoPar*)(rtdb->getContainer("PndSdsGeoPar")); return kSUCCESS; */ } // ----- Public method Init -------------------------------------------- InitStatus PndStraightLineTrackFinderTask::Init() { //lmddim = PndLmdDim::Instance(); // lmddim -> Read_transformation_matrices("matrices.txt", true); //lmddim -> Read_transformation_matrices("matrices_perfect.txt", false); FairRootManager* ioman = FairRootManager::Instance(); if ( ! ioman ) { std::cout << "-E- PndStraightLineTrackFinderTask::Init: " << "RootManager not instantiated!" << std::endl; return kFATAL; } // Get input array fStripHitArray = (TClonesArray*) ioman->GetObject(fHitBranchStrip); if ( !fStripHitArray){ std::cout << "-W- PndStraightLineTrackFinderTask::Init: " << "No fStripHitArray!" << std::endl; return kERROR; } fStripClusterArray = (TClonesArray*) ioman->GetObject(fClusterBranchStrip); if ( !fStripClusterArray){ std::cout << "-W- PndStraightLineTrackFinderTask::Init: " << "No StripclusterArray!" << std::endl; //return kERROR; } fStripDigiArray = (TClonesArray*) ioman->GetObject(fDigiBranchStrip); if ( !fStripDigiArray){ std::cout << "-W- PndStraightLineTrackFinderTask::Init: " << "No StripdigiArray!" << std::endl; //return kERROR; } fTrackCandArray = new TClonesArray("PndTrackCand"); ioman->Register("MVDTestBeamTrackCand", "Mvd", fTrackCandArray, kTRUE); // fTruePointArray = new TClonesArray("PndSdsMCPoint"); std::cout << "-I- PndStraightLineTrackFinderTask: Initialisation successfull" << std::endl; return kSUCCESS; } // ------------------------------------------------------------------------- // ----- Private method SortHitsByDet -------------------------------------------- bool PndStraightLineTrackFinderTask::SortHitsByDet(std::vector< std::vector< std::pair > > &hitsd, Int_t nStripHits) { Int_t nPlanes=0; //sort in plane's for(Int_t iHit = 0; iHit < nStripHits; iHit++){ PndSdsHit* myHit = (PndSdsHit*)(fStripHitArray->At(iHit)); Int_t sensid = myHit->GetSensorID(); // Sensors: 1..32 // cout<<"sensid = "< Planes: 0..3 hitsd.at(planeid).push_back( make_pair (iHit,false) ); } for(Int_t iPlane = 0; iPlane < 4; iPlane++){ if(hitsd.at(iPlane).size()>0) nPlanes++; } // cout << "Hits: " << nStripHits << endl; if(fVerbose>2) { cout << "Hits: " << nStripHits << " in " << nPlanes << " plane(s)." << endl; for(Int_t idet = 0; idet < 4; idet++) cout << "Plane: "<< idet <<" DiscHits: "<< hitsd.at(idet).size() <2) return true; return false; } // ------------------------------------------------------------------------- // ----- Private method SortHitsByDet2 -------------------------------------------- bool PndStraightLineTrackFinderTask::SortHitsByDet2(std::vector< std::vector< std::pair > > &hitsd, Int_t nStripHits) { Int_t nPlanes=0; //sort in plane's for(Int_t iHit = 0; iHit < nStripHits; iHit++){ PndSdsHit* myHit = (PndSdsHit*)(fStripHitArray->At(iHit)); Int_t sensid = myHit->GetSensorID(); //int ihalf,iplane,imodule,iside,idie,isensor; //lmddim->Get_sensor_by_id(sensid,ihalf,iplane,imodule,iside,idie,isensor); // hitsd.at(iplane).push_back(iHit); hitsd.at(sensid).push_back( make_pair (iHit,false) ); // cout<<"sensid = "< Planes: 0..3 // hitsd.at(planeid).push_back( make_pair (iHit,false) ); } for(Int_t iPlane = 0; iPlane < 4; iPlane++){ if(hitsd.at(iPlane).size()>0) nPlanes++; } // cout << "Hits: " << nStripHits << endl; if(fVerbose>2) { cout << "Hits: " << nStripHits << " in " << nPlanes << " plane(s)." << endl; for(Int_t idet = 0; idet < 4; idet++) cout << "Plane: "<< idet <<" DiscHits: "<< hitsd.at(idet).size() <2) return true; return false; } // ------------------------------------------------------------------------- // ----- Private method SortHitsByZ -------------------------------------------- bool PndStraightLineTrackFinderTask::SortHitsByZ(std::vector< std::vector< std::pair > > &hitsd, Int_t nStripHits) { std::vector detZ; //find plane positions for (Int_t iHit = 0; iHit < nStripHits; iHit++){ Double_t tmp = ((PndSdsHit*) (fStripHitArray->At(iHit)))->GetZ(); bool newZ = true; for(Int_t idet = 0; idet < detZ.size(); idet++){ // if(tmp == detZ.at(idet)){ //check if already found // cout<<"tmp = "<2) { cout << "Hits: " << nStripHits << " in " << detZ.size() << " plane(s)." << endl; for(Int_t idet = 0; idet < detZ.size(); idet++) cout << "Plane: "<< idet <<" DiscHits: "<< hitsd.at(idet).size() <3) return true; return false; } // ------------------------------------------------------------------------- // ----- Private method FindHitsIII -------------------------------------------- void PndStraightLineTrackFinderTask::FindHitsIII(std::vector &tofill, std::vector< std::vector< std::pair > > &hitsd, Int_t nStripHits) { std::vector trackStart, trackVec;//pseudo tracks std::vector trackStartd, trackVecd;//save errors std::vector< Int_t > trackID2, trackID3; //for TrackCand //iterate first discs-hits with all seconds, save pseudo-tracks TVector3 start, tmp, vec, dstart, dvec; //temp-vars if(hitsd.size()<3) return; for (Int_t i=0; iAt(hitsd.at(1).at(i).first); start.SetXYZ(hit1->GetX(), hit1->GetY(), hit1->GetZ()); dstart.SetXYZ(hit1->GetDx(), hit1->GetDy(), hit1->GetDz()); for (Int_t k=0; kAt(hitsd.at(2).at(k).first); tmp.SetXYZ(hit2->GetX(), hit2->GetY(), hit2->GetZ()); vec = tmp - start; //calc direction vector for FINDING dvec.SetXYZ(hit2->GetDx(), hit2->GetDy(), hit2->GetDz()); if(vec.Theta()>0.03 && vec.Theta()<0.05 && vec.Phi()>-0.25 && vec.Phi()<0.25){ //ignore vectors with theta outside 2-9 mrad //if(0<1){ // if(vec.Theta()<0.01){ //ignore vectors with theta outside 10 mrad trackStart.push_back(start); trackStartd.push_back(dstart); trackVec.push_back(vec); //save vector from start to second trackVecd.push_back(dvec); //save error of second point for FIT, NOT error of direction vector //trackID1.push_back(hitsd.at(0).at(i).first); //save Hit-Id's for TrackCand //trackID2.push_back(hitsd.at(1).at(k).first); trackID2.push_back(i); //save Hit-Id's for TrackCand trackID3.push_back(k); } }//end of disc 2 (or 3 if none in disc 2) hits }//end of disc 1 hits if(fVerbose>1) cout << "Pseudos L2L3: "<< trackStart.size() < ids; //check if other discs have hits in track, add points for fitting --------------- for (Int_t i=0; i > otherIDs; for (Int_t idet=3; idet < 4; idet++){ //i know this is not a loop, but in case we someday will have more planes Double_t distClosest = 2*idet*dXY; //just bigger as possible Bool_t firstp = true; for (Int_t ihit=0; ihitAt(hitsd.at(idet).at(ihit).first); Double_t scale = (hit->GetZ()-start.z())/vec.z(); tmp = start + scale*vec; //extend search-vector to hit-plane Double_t distTmp = sqrt((tmp.x()-hit->GetX())*(tmp.x()-hit->GetX()) + (tmp.y()-hit->GetY())*(tmp.y()-hit->GetY())); if( distTmp<(idet*dXY) ){ //if in diameter if(firstp){ pntcnt++; ids.push_back(hitsd.at(idet).at(ihit).first); otherIDs.push_back( make_pair (idet,ihit) ); distClosest=distTmp; firstp=false; }else{ if(distTmp2) cout << " Track L2L3: "<< i << "#Planes: " << ids.size() <2){ //third hit found <=> !track found! PndTrackCand *myTCand = new PndTrackCand(); for (Int_t id=0; idAt(ids.at(id))); PndSdsClusterStrip* myCluster; PndSdsDigiStrip* astripdigi; if ( !fStripClusterArray || !fStripDigiArray){ //for ideal/fast Hit-Reco myTCand->AddHit(0,ids.at(id),myHit->GetPosition().Mag()); }else{ myCluster = (PndSdsClusterStrip*)(fStripClusterArray->At(myHit->GetClusterIndex())); astripdigi = (PndSdsDigiStrip*)fStripDigiArray->At(myCluster->GetDigiIndex(0)); myTCand->AddHit(astripdigi->GetDetID(),ids.at(id),myHit->GetPosition().Mag()); } } //mark used hits--------- hitsd.at(1).at(trackID2.at(i)).second=true; hitsd.at(2).at(trackID3.at(i)).second=true; for(Int_t id=0; idAt(ids.at(0))); // PndSdsHit* myHit1 = (PndSdsHit*)(fStripHitArray->At(ids.at(1))); // TVector3 hit0 = myHit0->GetPosition(); TVector3 hit1 = myHit1->GetPosition(); // TVector3 posSeed(hit0.X(),hit0.Y(),hit0.Z()); // vec*=1./vec.Mag(); // //shift trk out of plane [needed for correct treatment in Kalman Fillter and GEANE] // double sh_z = -0.035; //350 mkm // double sh_x = vec.X()*sh_z; // double sh_y = vec.Y()*sh_y; // TVector3 sh_point(sh_x,sh_y,sh_z); // posSeed +=sh_point; // myTCand->setTrackSeed(posSeed,vec,-1); // ///------------------------------------- tofill.push_back(*(myTCand)); //save Track Candidate //new((*fTrackCandArray)[trackCnt]) PndTrackCand(*(myTCand)); delete myTCand; }//Track Cand build }//end of pseudo-tracks } // ------------------------------------------------------------------------- // ----- Private method FindHitsII -------------------------------------------- void PndStraightLineTrackFinderTask::FindHitsII(std::vector &tofill, std::vector< std::vector< std::pair > > &hitsd, Int_t nStripHits) { std::vector trackStart, trackVec;//pseudo tracks std::vector trackStartd, trackVecd;//save errors std::vector< Int_t > trackID1, trackID3; //for TrackCand //iterate first discs-hits with all seconds, save pseudo-tracks TVector3 start, tmp, vec, dstart, dvec; //temp-vars if(hitsd.size()<3) return; for (Int_t i=0; iAt(hitsd.at(0).at(i).first); start.SetXYZ(hit1->GetX(), hit1->GetY(), hit1->GetZ()); dstart.SetXYZ(hit1->GetDx(), hit1->GetDy(), hit1->GetDz()); for (Int_t k=0; kAt(hitsd.at(2).at(k).first); tmp.SetXYZ(hit2->GetX(), hit2->GetY(), hit2->GetZ()); vec = tmp - start; //calc direction vector for FINDING dvec.SetXYZ(hit2->GetDx(), hit2->GetDy(), hit2->GetDz()); if(vec.Theta()>0.03 && vec.Theta()<0.05 && vec.Phi()>-0.25 && vec.Phi()<0.25){ //ignore vectors with theta outside 2-9 mrad // if(0<1){ // if(vec.Theta()<0.01){ //ignore vectors with theta outside 10 mrad trackStart.push_back(start); trackStartd.push_back(dstart); trackVec.push_back(vec); //save vector from start to second trackVecd.push_back(dvec); //save error of second point for FIT, NOT error of direction vector //trackID1.push_back(hitsd.at(0).at(i).first); //save Hit-Id's for TrackCand //trackID2.push_back(hitsd.at(1).at(k).first); trackID1.push_back(i); //save Hit-Id's for TrackCand trackID3.push_back(k); } }//end of disc 2 (or 3 if none in disc 2) hits }//end of disc 1 hits if(fVerbose>1) cout << "Pseudos L1L3: "<< trackStart.size() < ids; //check if other discs have hits in track, add points for fitting --------------- for (Int_t i=0; i > otherIDs; for (Int_t idet=3; idet < 4; idet++){ //i know this is not a loop, but in case we someday will have more planes Double_t distClosest = 2*idet*dXY; //just bigger as possible Bool_t firstp = true; for (Int_t ihit=0; ihitAt(hitsd.at(idet).at(ihit).first); Double_t scale = (hit->GetZ()-start.z())/vec.z(); tmp = start + scale*vec; //extend search-vector to hit-plane Double_t distTmp = sqrt((tmp.x()-hit->GetX())*(tmp.x()-hit->GetX()) + (tmp.y()-hit->GetY())*(tmp.y()-hit->GetY())); if( distTmp<(idet*dXY) ){ //if in diameter if(firstp){ pntcnt++; ids.push_back(hitsd.at(idet).at(ihit).first); otherIDs.push_back( make_pair (idet,ihit) ); distClosest=distTmp; firstp=false; }else{ if(distTmp2) cout << " Track L1L3: "<< i << "#Planes: " << ids.size() <2){ //third hit found <=> !track found! PndTrackCand *myTCand = new PndTrackCand(); for (Int_t id=0; idAt(ids.at(id))); PndSdsClusterStrip* myCluster; PndSdsDigiStrip* astripdigi; if ( !fStripClusterArray || !fStripDigiArray){ //for ideal/fast Hit-Reco myTCand->AddHit(0,ids.at(id),myHit->GetPosition().Mag()); }else{ myCluster = (PndSdsClusterStrip*)(fStripClusterArray->At(myHit->GetClusterIndex())); astripdigi = (PndSdsDigiStrip*)fStripDigiArray->At(myCluster->GetDigiIndex(0)); myTCand->AddHit(astripdigi->GetDetID(),ids.at(id),myHit->GetPosition().Mag()); } } //mark used hits--------- hitsd.at(0).at(trackID1.at(i)).second=true; hitsd.at(2).at(trackID3.at(i)).second=true; for(Int_t id=0; idAt(ids.at(0))); // PndSdsHit* myHit1 = (PndSdsHit*)(fStripHitArray->At(ids.at(1))); // TVector3 hit0 = myHit0->GetPosition(); TVector3 hit1 = myHit1->GetPosition(); // TVector3 posSeed(hit0.X(),hit0.Y(),hit0.Z()); // vec*=1./vec.Mag(); // //shift trk out of plane [needed for correct treatment in Kalman Fillter and GEANE] // double sh_z = -0.035; //350 mkm // double sh_x = vec.X()*sh_z; // double sh_y = vec.Y()*sh_y; // TVector3 sh_point(sh_x,sh_y,sh_z); // posSeed +=sh_point; // myTCand->setTrackSeed(posSeed,vec,-1); // ///------------------------------------- tofill.push_back(*(myTCand)); //save Track Candidate //new((*fTrackCandArray)[trackCnt]) PndTrackCand(*(myTCand)); delete myTCand; }//Track Cand build }//end of pseudo-tracks } // ------------------------------------------------------------------------- // ----- Private method FindHitsI -------------------------------------------- void PndStraightLineTrackFinderTask::FindHitsI(std::vector &tofill, std::vector< std::vector< std::pair > > &hitsd, Int_t nStripHits) { std::vector trackStart, trackVec;//pseudo tracks std::vector trackStartd, trackVecd;//save errors std::vector< Int_t > trackID1, trackID2; //for TrackCand //iterate first discs-hits with all seconds, save pseudo-tracks TVector3 start, tmp, vec, dstart, dvec; //temp-vars if(hitsd.size()<2) return; for (Int_t i=0; iAt(hitsd.at(0).at(i).first); start.SetXYZ(hit1->GetX(), hit1->GetY(), hit1->GetZ()); dstart.SetXYZ(hit1->GetDx(), hit1->GetDy(), hit1->GetDz()); for (Int_t k=0; kAt(hitsd.at(1).at(k).first); tmp.SetXYZ(hit2->GetX(), hit2->GetY(), hit2->GetZ()); vec = tmp - start; //calc direction vector for FINDING dvec.SetXYZ(hit2->GetDx(), hit2->GetDy(), hit2->GetDz()); // if(vec.Theta()>0.03 && vec.Theta()<0.05 && vec.Phi()>-0.25 && vec.Phi()<0.25){ //ignore vectors with theta outside 2-9 mrad // if(vec.Theta()<0.01){ //ignore vectors with theta outside 10 mrad trackStart.push_back(start); trackStartd.push_back(dstart); trackVec.push_back(vec); //save vector from start to second trackVecd.push_back(dvec); //save error of second point for FIT, NOT error of direction vector //trackID1.push_back(hitsd.at(0).at(i).first); //save Hit-Id's for TrackCand //trackID2.push_back(hitsd.at(1).at(k).first); trackID1.push_back(i); //save Hit-Id's for TrackCand trackID2.push_back(k); // } }//end of disc 2 (or 3 if none in disc 2) hits }//end of disc 1 hits if(fVerbose>1) cout << "Pseudos L1L2: "<< trackStart.size() < ids; //check if other discs have hits in track, add points for fitting --------------- for (Int_t i=0; i > otherIDs; for (Int_t idet=2; idet < 4; idet++){ Double_t distClosest = 2*idet*dXY; //just bigger as possible Bool_t firstp = true; for (Int_t ihit=0; ihitAt(hitsd.at(idet).at(ihit).first); Double_t scale = (hit->GetZ()-start.z())/vec.z(); tmp = start + scale*vec; //extend search-vector to hit-plane Double_t distTmp = sqrt((tmp.x()-hit->GetX())*(tmp.x()-hit->GetX()) + (tmp.y()-hit->GetY())*(tmp.y()-hit->GetY())); if( distTmp<(idet*dXY) ){ //if in diameter if(firstp){ pntcnt++; ids.push_back(hitsd.at(idet).at(ihit).first); otherIDs.push_back( make_pair (idet,ihit) ); distClosest=distTmp; firstp=false; }else{ if(distTmp2) cout << " Track L1L2: "<< i << "#Planes: " << ids.size() <2){ //third hit found <=> !track found! // if(ids.size()>3){ //4 hits are needed because 6 parameters are used in trk-fit! // // //third hit found <=> !track found! // // //check direction for reduction of ghost tracks // if(ids.size()>2 && // fabs(vec.Phi())<0.26 && vec.Theta()>3e-2 && vec.Theta()<5e-2){ if(fVerbose>2) cout << " Track: "<< i << "#Planes: " << ids.size() <At(ids.at(id))); PndSdsClusterStrip* myCluster; PndSdsDigiStrip* astripdigi; myTCand->AddHit(FairRootManager::Instance()->GetBranchId(fHitBranchStrip),ids.at(id),myHit->GetPosition().Mag()); } //mark used hits--------- hitsd.at(0).at(trackID1.at(i)).second=true; hitsd.at(1).at(trackID2.at(i)).second=true; for(Int_t id=0; idAt(ids.at(0))); // PndSdsHit* myHit1 = (PndSdsHit*)(fStripHitArray->At(ids.at(1))); // TVector3 hit0 = myHit0->GetPosition(); TVector3 hit1 = myHit1->GetPosition(); // double p1seed = (hit0.X()-hit1.X())/(hit0.Z()-hit1.Z()); // double p0seed = hit0.X() - p1seed*(hit0.Z()-Z0); // // double p0seed = 0.5*(hit0.X()+hit1.X()-p1seed*(hit0.Z()+hit1.Z()-2*1099.)); //TO DO: don't use const // double p3seed = (hit0.Y()-hit1.Y())/(hit0.Z()-hit1.Z()); // double p2seed = hit0.Y() - p3seed*(hit0.Z()-Z0); // //double p2seed = 0.5*(hit0.Y()+hit1.Y()-p1seed*(hit0.Z()+hit1.Z()-2*1099.)); //TO DO: don't use const // TVector3 posSeed(p0seed,p2seed,Z0); // TVector3 dirSeed(p1seed,p3seed,1.); // cout<<"posSeed:"<setTrackSeed(posSeed,vec,-1); // ///------------------------------------- tofill.push_back(*(myTCand)); //save Track Candidate //new((*fTrackCandArray)[trackCnt]) PndTrackCand(*(myTCand)); delete myTCand; }//Track Cand build }//end of pseudo-tracks } // ------------------------------------------------------------------------- // ----- Public method Exec -------------------------------------------- void PndStraightLineTrackFinderTask::Exec(Option_t*) { TStopwatch *timer_exec = new TStopwatch(); if(fVerbose>2) timer_exec->Start(); if(fVerbose>2) cout << "Evt " << FairRootManager::Instance()->GetEntryNr() << " started--------------"<Clear(); Int_t nStripHits = fStripHitArray->GetEntriesFast(); if(fVerbose>2) cout << "# Hits: \t"<< nStripHits <2) cout << "Evt finsihed: too less hits-----"< > > hitsd(4); bool resSortHits; if(flagStipSens) resSortHits = SortHitsByDet(hitsd, nStripHits);//!strip sensors else{ if(flagPixelSens) resSortHits = SortHitsByDet2(hitsd, nStripHits);//! pixel sensors else{ std::cout<<"Algorithm is needed sensor type! Please, set it via SetSensStripFlag(bool fS) or SetSensPixelFlag(bool fS)"<2) cout << "Evt finsihed: too less planes-----"<2){ cout<<"HitMap size: "<< hitsd.size() <0){ for (Int_t i=0; iAt(hitsd.at(0).at(i).first); cout<<"Plane0 Hit=("<GetX()<<", "<GetY()<<", "<GetZ()<<")"<1){ for (Int_t i=0; iAt(hitsd.at(1).at(i).first); cout<<"Plane1 Hit=("<GetX()<<", "<GetY()<<", "<GetZ()<<")"<2){ for (Int_t i=0; iAt(hitsd.at(2).at(i).first); cout<<"Plane2 Hit=("<GetX()<<", "<GetY()<<", "<GetZ()<<")"<3){ for (Int_t i=0; iAt(hitsd.at(3).at(i).first); cout<<"Plane3 Hit=("<GetX()<<", "<GetY()<<", "<GetZ()<<")"< theCands; //Track Candidates //--------find some tracks-------------- FindHitsI(theCands, hitsd, nStripHits); if(fFinderMode){ FindHitsII(theCands, hitsd, nStripHits); FindHitsIII(theCands, hitsd, nStripHits); } //fill tracklist für fitting for(int t=0; t2) cout << "Evt finsihed--------------"<2){ timer_exec->Stop(); Double_t rtime_exec = timer_exec->RealTime(); Double_t ctime_exec = timer_exec->CpuTime(); cout << "Real time for Exec:" << rtime_exec << " s, CPU time " << ctime_exec << " s" << endl; cout << endl; } } // ------------------------------------------------------------------------- Double_t PndStraightLineTrackFinderTask::GetTrackCurvature(PndMCTrack* myTrack) { TVector3 p = myTrack->GetMomentum(); return (2/TMath::Sqrt(p.Px()*p.Px() + p.Py()*p.Py())); } // ------------------------------------------------------------------------- Double_t PndStraightLineTrackFinderTask::GetTrackDip(PndMCTrack* myTrack) { TVector3 p= myTrack->GetMomentum(); return (p.Mag()/TMath::Sqrt(p.Px()*p.Px() + p.Py()*p.Py())); } // ------------------------------------------------------------------------- ClassImp(PndStraightLineTrackFinderTask);