1 //Christine Nattrass, University of Tennessee at Knoxville
2 //This macro is for plotting the dE/dx from the TPC as used for particle identification for the transverse energy analysis
3 //Particles identified are colored
4 //Uses the output of AliAnalysisTaskHadEt
6 void dEdx(char *prodname = "LHC10d4 PYTHIA D6T 7 TeV p+p", char *shortprodname = "LHC10d4",bool TPC = true, char *filename="Et.ESD.new.sim.LHC10d4.pp.merged.root"){
7 TFile *file = new TFile(filename);
9 cerr<<"Error, no file found"<<endl;
14 if(TPC) myname = "TPC";
15 TH2F *all = out2->FindObject(Form("dEdxAll%s",myname));
16 TH2F *pi = out2->FindObject(Form("dEdxPion%s",myname));
17 TH2F *k = out2->FindObject(Form("dEdxKaon%s",myname));
18 TH2F *p = out2->FindObject(Form("dEdxProton%s",myname));
19 TH2F *e = out2->FindObject(Form("dEdxElectron%s",myname));
20 gStyle->SetPalette(1);
21 pi->SetMarkerColor(2);
24 e->SetMarkerColor(TColor::kYellow);
28 e->SetLineColor(TColor::kYellow);
32 e->SetFillColor(TColor::kYellow);
34 if(!TPC){all->GetXaxis()->SetRange(all->GetXaxis()->FindBin(0.05));}
35 else{all->GetXaxis()->SetRange(all->GetXaxis()->FindBin(0.1));}
36 //all->GetYaxis()->SetRange(all->GetYaxis()->FindBin(35.0));
38 //e->SetMarkerStyle(20);
40 gStyle->SetOptTitle(0);
41 gStyle->SetOptStat(0);
43 TCanvas *c = new TCanvas("c","c",600,400);
44 c->SetTopMargin(0.02);
45 c->SetRightMargin(0.02);
50 c->SetFrameFillColor(0);
51 c->SetFrameBorderMode(0);
58 TLegend *leg = new TLegend(0.825503,0.768817,0.963087,0.954301);
59 leg->AddEntry(pi,"#pi^{#pm}","F");
60 leg->AddEntry(k,"K^{#pm}","F");
61 leg->AddEntry(p,"p,#bar{p}","F");
62 leg->AddEntry(e,"e^{#pm}","F");
65 leg->SetBorderSize(0);
71 TLatex *tex = new TLatex(0.119617,y,prodname);
72 tex->SetTextSize(0.0537634);
75 c->SaveAs(Form("pics/%s/dEdx.eps",shortprodname));
76 c->SaveAs(Form("pics/%s/dEdx.png",shortprodname));
79 c->SaveAs(Form("pics/%s/dEdxITS.eps",shortprodname));
80 c->SaveAs(Form("pics/%s/dEdxITS.png",shortprodname));