]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSpidESD.cxx
Bug fix related to reconstruction of simulated data in raw format (E. Fragiacomo)
[u/mrichter/AliRoot.git] / ITS / AliITSpidESD.cxx
index 17cc81b992e6710969e4d44bc724e6de1b88d92d..2d464c08aa9b8de332a4ac084c0516e869e92e06 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
+
 //-----------------------------------------------------------------
 //           Implementation of the ITS PID class
 // Very naive one... Should be made better by the detector experts...
 //      Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
 //-----------------------------------------------------------------
 
+#include <TMath.h>
+
 #include "AliITSpidESD.h"
-#include "AliESD.h"
 #include "AliESDtrack.h"
 
 ClassImp(AliITSpidESD)
 
-//_________________________________________________________________________
-AliITSpidESD::AliITSpidESD(Double_t *param)
-{
-  //
-  //  The main constructor
-  //
-  fMIP=param[0];
-  fRes=param[1];
-  fRange=param[2];
-}
 
-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;
-  /*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;
+//______________________________________________________________________
+AliITSpidESD::AliITSpidESD():TObject(){
+  //Default constructor
 }
 
-//_________________________________________________________________________
-Int_t AliITSpidESD::MakePID(AliESD *event)
-{
-  //
-  //  This function calculates the "detector response" PID probabilities 
-  //
-  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;
-    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=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;
-      }
-      p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
-    }
-    t->SetITSpid(p);
-  }
-  return 0;
+Double_t AliITSpidESD::Bethe(Double_t p,Double_t mass) {
+
+  Double_t mom=p*1000;//MeV
+  Double_t Mass=mass*1000;//Mev
+  Float_t dens =2.33; //g cm-3
+  Double_t K=0.307075;//MeVcm^2/g
+  Double_t ZovA=0.49848;
+  Double_t me=0.511;//MeV/c^2
+  Double_t I=173./1000000.;//MeV
+  Double_t En=TMath::Sqrt(mom*mom+Mass*Mass);//MeV
+  Double_t gamma=En/Mass;
+  Double_t beta=mom/En;
+  Double_t Tmax=2*me*beta*beta*gamma*gamma/(1+2*gamma*me/Mass+(me/Mass)*(me/Mass));
+  Double_t deltaover2=28.816*1e-6*TMath::Sqrt(dens*ZovA)+TMath::Log(beta*gamma)-0.5;
+  Double_t FNor=0.009164; //normalizing to 1 at the minimum of ionization
+
+  return K*ZovA*1/(beta*beta)*(0.5*TMath::Log(2*me*beta*beta*gamma*gamma*Tmax/(I*I))-beta*beta-deltaover2)*2.33*1000*0.03*FNor;
+
+
 }