// 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];
-}
+//______________________________________________________________________
+AliITSpidESD::AliITSpidESD():TObject(){
+ //Default constructor
+
+}
Double_t AliITSpidESD::Bethe(Double_t bg) {
//
// This is the Bethe-Bloch function normalised to 1 at the minimum
/*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));
+ bethe=(1.+ bg2)/bg2*(TMath::Log(3.5*5940*bg) - bg2/(1.+ bg2));
return bethe/11.091;
}
-//_________________________________________________________________________
-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;
-}