]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDpidUtil.cxx
major TRD reconstruction update
[u/mrichter/AliRoot.git] / TRD / AliTRDpidUtil.cxx
index 52dbb1f96021c1495086e679b183587aa84d893f..85d5eaa8d42d7e2b1d8280ceb10eccfc23bc8353 100644 (file)
@@ -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;
+}
+