]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSdEdxAnalyzer.cxx
defects from coverity fixed
[u/mrichter/AliRoot.git] / ITS / AliITSdEdxAnalyzer.cxx
index 3d61c24a04b5d3784c35125ca3559b4880ed4f92..80ddcf1718392f288b46368ade0d506d156a21b0 100644 (file)
@@ -28,7 +28,8 @@
 #include <TDatabasePDG.h>
 #include "AliITSdEdxAnalyzer.h"
 #include "AliExternalTrackParam.h"
-#include "AliITSpidESD.h"
+//#include "AliITSpidESD.h"
+#include "AliITSPIDResponse.h"
 #include "AliPID.h"
 
 ClassImp(AliITSdEdxAnalyzer)
@@ -221,27 +222,28 @@ Int_t AliITSdEdxAnalyzer::GetPaticleIdFromTPC(const AliESDtrack* track) const {
 //______________________________________________________________________
 Double_t AliITSdEdxAnalyzer::BetheBloch(const Float_t p, const Float_t m) const {
   //
+  static AliITSPIDResponse pidResponse;
   Double_t dedxbb=0.;
   if(fBBmodel==0){
     Double_t betagamma=p/m;
-    Double_t conv=fDensity*1E6*fThickness/116.31*fMIP;
+    Double_t conv=fDensity*1E6*fThickness/116.24*fMIP;
     dedxbb=conv*AliExternalTrackParam::BetheBlochSolid(betagamma);
   }else if(fBBmodel==1){
-    dedxbb=fMIP*AliITSpidESD::Bethe(p,m);
+    dedxbb=pidResponse.Bethe(p,m);
   }
   return dedxbb;
 }
 //______________________________________________________________________
 TGraph* AliITSdEdxAnalyzer::GetBetheBlochGraph(const Int_t pdgcode) const {
 // Fills a TGraph with Bethe-Bloch expe
 TGraph* g=new TGraph(0);
 TParticlePDG* p=TDatabasePDG::Instance()->GetParticle(pdgcode);
 Float_t mass=p->Mass();
 for(Int_t ip=0; ip<100;ip++){
-    Float_t p=fPMin+(ip+0.5)*(fPMax-fPMin)/100.;
-    g->SetPoint(ip,p,BetheBloch(p,mass));
 }
 g->GetXaxis()->SetTitle("Momentum (GeV/c)");
 g->GetYaxis()->SetTitle("dE/dx (keV/300 #mum)");
 return g;
+ // Fills a TGraph with Bethe-Bloch expe
+ TGraph* g=new TGraph(0);
TParticlePDG* part=TDatabasePDG::Instance()->GetParticle(pdgcode);
Float_t mass=part->Mass();
+ for(Int_t ip=0; ip<100;ip++){
+   Float_t p=fPMin+(ip+0.5)*(fPMax-fPMin)/100.;
+   g->SetPoint(ip,p,BetheBloch(p,mass));
+ }
+ g->GetXaxis()->SetTitle("Momentum (GeV/c)");
+ g->GetYaxis()->SetTitle("dE/dx (keV/300 #mum)");
+ return g;
 }