]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSpidESD.cxx
Example macro for the creation of tags (P.Christakoglou)
[u/mrichter/AliRoot.git] / ITS / AliITSpidESD.cxx
index c4109bd1858abae59859578d631fd315319356c6..17cc81b992e6710969e4d44bc724e6de1b88d92d 100644 (file)
@@ -41,7 +41,11 @@ Double_t AliITSpidESD::Bethe(Double_t bg) {
   // This is the Bethe-Bloch function normalised to 1 at the minimum
   //
   Double_t bg2=bg*bg;
-  Double_t bethe=(1.+ bg2)/bg2*(log(5940*bg2) - bg2/(1.+ bg2));
+  Double_t bethe;
+  /*if (bg<3.5) 
+     bethe=(1.+ bg2)/bg2*(log(5940*bg2) - bg2/(1.+ bg2));
+  else*/  // not 100% clear why...
+     bethe=(1.+ bg2)/bg2*(log(3.5*5940*bg) - bg2/(1.+ bg2));
   return bethe/11.091;
 }
 
@@ -51,27 +55,24 @@ Int_t AliITSpidESD::MakePID(AliESD *event)
   //
   //  This function calculates the "detector response" PID probabilities 
   //
-  static const Double_t masses[]={
-    0.000511, 0.105658, 0.139570, 0.493677, 0.938272, 1.875613
-  };
   Int_t ntrk=event->GetNumberOfTracks();
   for (Int_t i=0; i<ntrk; i++) {
     AliESDtrack *t=event->GetTrack(i);
     if ((t->GetStatus()&AliESDtrack::kITSin )==0)
       if ((t->GetStatus()&AliESDtrack::kITSout)==0) continue;
-    Int_t ns=AliESDtrack::kSPECIES;
+    Double_t mom=t->GetP();
+    Double_t dedx=t->GetITSsignal()/fMIP;
+    Int_t ns=AliPID::kSPECIES;
     Double_t p[10];
     for (Int_t j=0; j<ns; j++) {
-      Double_t mass=masses[j];
-      Double_t mom=t->GetP();
-      Double_t dedx=t->GetITSsignal()/fMIP;
+      Double_t mass=AliPID::ParticleMass(j);
       Double_t bethe=Bethe(mom/mass); 
       Double_t sigma=fRes*bethe;
       if (TMath::Abs(dedx-bethe) > fRange*sigma) {
-       p[j]=TMath::Exp(-0.5*fRange*fRange);
+       p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
         continue;
       }
-      p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma));
+      p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
     }
     t->SetITSpid(p);
   }