]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDpidUtil.cxx
Reprocessing 2012 (TRD)
[u/mrichter/AliRoot.git] / TRD / AliTRDpidUtil.cxx
index 015fe6690d91b4c32b42834204bed2c6caa313a1..85d5eaa8d42d7e2b1d8280ceb10eccfc23bc8353 100644 (file)
@@ -188,9 +188,9 @@ Bool_t AliTRDpidUtil::IsElectron(const AliESDtrack *track, ETRDPIDMethod method)
   Double_t threshold = thresholdHist->GetBinContent(GetMomentumBin(track->P()) + 1);
   
   // Do Decision
-  Double_t pid_probs[5];
-  track->GetTRDpid(pid_probs);
-  if(pid_probs[AliPID::kElectron] >= threshold) return kTRUE;
+  Double_t pidProbs[5];
+  track->GetTRDpid(pidProbs);
+  if(pidProbs[AliPID::kElectron] >= threshold) return kTRUE;
   return kFALSE; 
 }
 
@@ -216,7 +216,7 @@ Double_t AliTRDpidUtil::GetSystematicError(const AliESDtrack *track, ETRDPIDMeth
 //________________________________________________________________________
 Int_t AliTRDpidUtil::Pdg2Pid(Int_t pdg){
   //
-  // Private Helper function to get the paticle species (ALICE notation) 
+  // Private Helper function to get the paticle species (ALICE notation)
   // from the Pdg code
   //
   Int_t species;
@@ -242,3 +242,14 @@ Int_t AliTRDpidUtil::Pdg2Pid(Int_t pdg){
   return species;
 }
 
+//________________________________________________________________________
+Int_t AliTRDpidUtil::Mass2Pid(Float_t m){
+  //
+  // Private Helper function to get the paticle species (ALICE notation)
+  // from the Pdg mass
+  //
+
+  for(Int_t is(0); is<AliPID::kSPECIES; is++) if(TMath::Abs(m-AliPID::ParticleMass(is))<1.e-4) return is;
+  return -1;
+}
+