#include <TFile.h>
#include <TParticlePDG.h>
#include <TDatabasePDG.h>
+#include "AliStack.h"
+#include "AliLog.h"
+#include "AliESDEvent.h"
+#include "AliStack.h"
#include "AliITSdEdxAnalyzer.h"
#include "AliExternalTrackParam.h"
-#include "AliITSpidESD.h"
+//#include "AliITSpidESD.h"
+#include "AliITSPIDResponse.h"
#include "AliPID.h"
ClassImp(AliITSdEdxAnalyzer)
}
//______________________________________________________________________
void AliITSdEdxAnalyzer::DeleteHistos(){
- //
+ // deletes the hitograms
if(fHistodEdx){
for(Int_t i=0; i<GetNHistos();i++) delete fHistodEdx[i];
delete [] fHistodEdx;
}
//______________________________________________________________________
void AliITSdEdxAnalyzer::BookHistos(){
- //
+ // defines the output histograms
fHistodEdx=new TH1F*[GetNHistos()];
fHistoDeltadEdx=new TH1F*[GetNHistos()];
for(Int_t iSpecie=0; iSpecie<kNParticles; iSpecie++){
}
//______________________________________________________________________
void AliITSdEdxAnalyzer:: WriteHistos(TString filename) const {
+ // stores output histogrma to file
TFile *outfile=new TFile(filename.Data(),"recreate");
outfile->cd();
for(Int_t i=0; i<GetNHistos();i++){
delete outfile;
}
//______________________________________________________________________
-void AliITSdEdxAnalyzer::ReadEvent(AliESDEvent* esd, AliStack* stack){
+void AliITSdEdxAnalyzer::ReadEvent(const AliESDEvent* esd, AliStack* stack){
// Fill histos
// if stack is !=0 MC truth is used to define particle specie
// else TPC pid is used to define particle specie
}
//______________________________________________________________________
Int_t AliITSdEdxAnalyzer::GetPaticleIdFromTPC(const AliESDtrack* track) const {
- //
+ // Returns the particle specie as identified by TPC
Double_t tpcpid[AliPID::kSPECIES];
track->GetTPCpid(tpcpid);
Int_t maxPos=-1;
}
//______________________________________________________________________
Double_t AliITSdEdxAnalyzer::BetheBloch(const Float_t p, const Float_t m) const {
- //
+ // Computes expected dE/dx value for given particle specie and momentum
+ static AliITSPIDResponse pidResponse;
Double_t dedxbb=0.;
if(fBBmodel==0){
Double_t betagamma=p/m;
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;
}