X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=PWG0%2FesdTrackCuts%2FAliESDtrackCuts.cxx;h=98ead8e1349c800487d0af42dabdb4851fbb2958;hp=a63421f2341a08c36fbeed024693eb3b906cd89b;hb=c5858666253db4c84cafaa01a891154b7bec408c;hpb=aa93c798e8af438ee81450096239eb42c28169bb diff --git a/PWG0/esdTrackCuts/AliESDtrackCuts.cxx b/PWG0/esdTrackCuts/AliESDtrackCuts.cxx index a63421f2341..98ead8e1349 100644 --- a/PWG0/esdTrackCuts/AliESDtrackCuts.cxx +++ b/PWG0/esdTrackCuts/AliESDtrackCuts.cxx @@ -297,10 +297,14 @@ AliESDtrackCuts::AcceptTrack(AliESDtrack* esdTrack) { // It means that for a 2-dim gauss: n_sigma(d) = Sqrt(2)*ErfInv(1 - Exp((-x**2)/2) // Can this be expressed in a different way? // + // + // FIX: I don't think this is correct!!! Keeping d as n_sigma for now... + Float_t nSigmaToVertex = -1; if (bRes[0]!=0 && bRes[1]!=0) { Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2)); - nSigmaToVertex = TMath::Sqrt(2)*(TMath::ErfInverse(1 - TMath::Exp(0.5*(-d*d)))); + nSigmaToVertex = d;//TMath::Sqrt(2)*(TMath::ErfInverse(1 - TMath::Exp(0.5*(-d*d)))); + // JF solution: nSigmaToVertex = TMath::ErfInverse(TMath::Sqrt(2.0/TMath::Pi()) * TMath::Erf(d / TMath::Sqrt(2))) * TMath::Sqrt(2); } // getting the kinematic variables of the track @@ -460,11 +464,11 @@ AliESDtrackCuts::GetAcceptedTracks(AliESD* esd) // TObjArray* acceptedTracks = new TObjArray(); - + // loop over esd tracks for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) { AliESDtrack* track = esd->GetTrack(iTrack); - + if (AcceptTrack(track)) acceptedTracks->Add(track); } @@ -472,6 +476,27 @@ AliESDtrackCuts::GetAcceptedTracks(AliESD* esd) return acceptedTracks; } +//____________________________________________________________________ +Int_t +AliESDtrackCuts::CountAcceptedTracks(AliESD* esd) +{ + // + // returns an the number of tracks that pass the cuts + // + + Int_t count = 0; + + // loop over esd tracks + for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) { + AliESDtrack* track = esd->GetTrack(iTrack); + + if (AcceptTrack(track)) + count++; + } + + return count; +} + //____________________________________________________________________ void AliESDtrackCuts::DefineHistograms(Int_t color) { //