]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSpidESD1.cxx
New default values for baselines (F.Prino)
[u/mrichter/AliRoot.git] / ITS / AliITSpidESD1.cxx
index a9228bf97367759fd225b1c76f9946146fcdc390..2e012f04588da1b9a51e3c8968d56d1e804e0128 100755 (executable)
@@ -13,6 +13,8 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
+
 //-----------------------------------------------------------------
 // ITS PID method # 1
 //           Implementation of the ITS PID class
@@ -21,7 +23,7 @@
 //-----------------------------------------------------------------
 #include "AliITSpidESD.h"
 #include "AliITSpidESD1.h"
-#include "AliESD.h"
+#include "AliESDEvent.h"
 #include "AliESDtrack.h"
 
 ClassImp(AliITSpidESD1)
@@ -46,7 +48,7 @@ fRange(param[2])
 
 
 //_________________________________________________________________________
-Int_t AliITSpidESD1::MakePID(AliESD *event)
+Int_t AliITSpidESD1::MakePID(AliESDEvent *event)
 {
   //
   //  This function calculates the "detector response" PID probabilities 
@@ -58,19 +60,31 @@ Int_t AliITSpidESD1::MakePID(AliESD *event)
       if ((t->GetStatus()&AliESDtrack::kITSout)==0) continue;
     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=AliPID::ParticleMass(j);
-      Double_t bethe=AliITSpidESD::Bethe(mom/mass); 
+    Bool_t mismatch=kTRUE, heavy=kTRUE;
+    for (Int_t j=0; j<AliPID::kSPECIES; j++) {
+      Double_t mass=AliPID::ParticleMass(j);//GeV/c^2
+      Double_t bethe=AliITSpidESD::Bethe(mom,mass);
       Double_t sigma=fRes*bethe;
       if (TMath::Abs(dedx-bethe) > fRange*sigma) {
        p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
-        continue;
+      } else {
+        p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
+        mismatch=kFALSE;
       }
-      p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
+
+      // Check for particles heavier than (AliPID::kSPECIES - 1)
+      if (dedx < (bethe + fRange*sigma)) heavy=kFALSE;
+
     }
+
+    if (mismatch)
+       for (Int_t j=0; j<AliPID::kSPECIES; j++) p[j]=1/AliPID::kSPECIES;
+
     t->SetITSpid(p);
+
+    if (heavy) t->ResetStatus(AliESDtrack::kITSpid);
+
   }
   return 0;
 }