1 #if !defined(__CINT__) || defined(__MAKECINT__)
3 #include <TClassTable.h>
9 #include <TInterpreter.h>
11 #include "AliHeader.h"
12 #include "AliITSdEdxAnalyzer.h"
13 #include "AliRunLoader.h"
14 #include "AliESDEvent.h"
17 Bool_t MakeITSdEdxAnalysis(TString path=".",Int_t nmombins=16){
19 if (gClassTable->GetID("AliRun") < 0) {
20 gInterpreter->ExecuteMacro("loadlibs.C");
23 TString galicefile = path+"/galice.root";
24 TString esdfile = path+"/AliESDs.root";
26 AliRunLoader* runLoader = AliRunLoader::Open(galicefile.Data());
28 printf("Error in getting run loader");
31 runLoader->LoadHeader();
32 runLoader->LoadKinematics();
34 TFile* esdFile = TFile::Open(esdfile.Data());
35 if (!esdFile || !esdFile->IsOpen()) {
36 printf("Error in opening ESD file");
40 AliESDEvent * esd = new AliESDEvent;
41 TTree* tree = (TTree*) esdFile->Get("esdTree");
43 printf("Error: no ESD tree found");
46 esd->ReadFromTree(tree);
47 AliITSdEdxAnalyzer* enan=new AliITSdEdxAnalyzer(nmombins,0.1,3.1);
48 enan->SetMIPdEdx(79.);
50 for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) {
51 runLoader->GetEvent(iEvent);
52 tree->GetEvent(iEvent);
54 printf("Error: no ESD object found for event %d", iEvent);
57 AliStack* stack = runLoader->Stack();
58 enan->ReadEvent(esd,stack);
64 TCanvas* c1=new TCanvas("c1","dEdx - pions - layer 4");
66 for(Int_t i=0; i<nmombins;i++){
67 TH1F* h=enan->GetSingleLayerdEdxHisto(4,211,i);
73 TCanvas* c1b=new TCanvas("c1b","dEdx - pions - Truncated mean");
75 for(Int_t i=0; i<nmombins;i++){
76 TH1F* h=enan->GetTruncatedMeandEdxHisto(211,i);
81 TCanvas* c2=new TCanvas("c2","Delta dEdx - pions - layer 4");
83 for(Int_t i=0; i<nmombins;i++){
84 TH1F* h=enan->GetSingleLayerDeltadEdxHisto(4,211,i);
89 TCanvas* c2b=new TCanvas("c2b","Delta dEdx - pions - Truncated Mean");
91 for(Int_t i=0; i<nmombins;i++){
92 TH1F* h=enan->GetTruncatedMeanDeltadEdxHisto(211,i);
97 gStyle->SetPalette(1);
100 c3=new TCanvas("c3","dEdx vs. p - pions - layer 4");
101 TH2F* h2=enan->GetSingleLayerdEdxVsPHisto(4,211);
103 enan->SetUseBBFromAliExternalTrackParam();
104 TGraph* gpion1=enan->GetBetheBlochGraph(211);
105 gpion1->Draw("LSAME");
106 enan->SetUseBBFromAliITSpidESD();
107 TGraph* gpion2=enan->GetBetheBlochGraph(211);
108 gpion2->SetLineColor(2);
109 gpion2->Draw("LSAME");
112 c3b=new TCanvas("c3b","dEdx vs. p - pions - Truncated Mean");
113 TH2F* h2b=enan->GetTruncatedMeandEdxVsPHisto(211);
115 gpion1->Draw("LSAME");
116 gpion2->Draw("LSAME");