Transition PWG0 -> PWGUD
[u/mrichter/AliRoot.git] / PWGUD / dNdPt / macros / plots / makeCompNSD.C
CommitLineData
2803ac99 1//------------------------------------------------------------------------------
2// makeCompNSD.C
3//
4// create figure with ALICE comparison to CMS and ATLAS
5//------------------------------------------------------------------------------
6
7
8
9void makeCompNSD()
10{
11
12gROOT->LoadMacro("divide.C");
13
14TGraphErrors *graphCms = new TGraphErrors(binsCms,ptCms,nsdCms,errPtCms,err2NsdCms);
15graphCms->SetMarkerColor(colorCms);
16graphCms->SetLineColor(colorCms);
17graphCms->SetMarkerStyle(26);
18
19TGraphAsymmErrors *graphAtlas = new TGraphAsymmErrors(binsAtlas,ptAtlas,nsdAtlas,lowErrPtAtlas,highErrPtAtlas,err2NsdAtlas,err2NsdAtlas);
20graphAtlas->SetMarkerColor(colorAtlas);
21graphAtlas->SetLineColor(colorAtlas);
22graphAtlas->SetMarkerStyle(25);
23
24TGraphErrors *graphAlice = new TGraphErrors(binsNsdAlice,ptNsdAlice,nsdAlice,0,err2NsdAlice);
25graphAlice->SetMarkerColor(colorAliceFit);
26graphAlice->SetLineColor(colorAliceFit);
27graphAlice->SetMarkerStyle(20);
28
29TMultiGraph *all = new TMultiGraph("all","");
30
31
32all->Add(graphAtlas);
33all->Add(graphCms);
34//all->Add(graphAlice);
35all->Add(graphAlice);
36//all->Draw("AP");
37//setAttrib(all);
38
39
40TGraphErrors *ratioAtlasAlice = divide(graphAtlas,graphAlice);
41ratioAtlasAlice->SetFillColor(colorAtlas);
42ratioAtlasAlice->SetLineColor(colorAtlas);
43ratioAtlasAlice->SetFillStyle(3354);
44
45TGraphErrors *ratioCmsAlice = divide(graphCms,graphAlice);
46ratioCmsAlice->SetFillColor(colorCms);
47ratioCmsAlice->SetLineColor(colorCms);
48ratioCmsAlice->SetFillStyle(3345);
49
50Double_t one[binsNsdAlice];
51for (Int_t i=0; i < binsNsdAlice; i++) {
52 one[i] = 1.0;
53}
54
55TGraphErrors *ratioAliceAlice = new TGraphErrors(binsNsdAlice,ptNsdAlice,one,0,relErr2NsdAlice);
56ratioAliceAlice->SetFillColor(colorAliceErrors);
57ratioAliceAlice->SetLineColor(20);
58
59TCanvas *can3 = new TCanvas("can3","CompNSD",520,700);
60
61TPad *pad3_1 = new TPad("pad3_1","pad3_1",0.0,0.35,1.0,1.0);
62setAttrib(pad3_1);
63
64TPad *pad3_2 = new TPad("pad3_2","pad3_2",0.0,0.0,1.0,0.35);
65setAttrib(pad3_2);
66//
67can3->cd();
68
69pad3_1->Draw();
70pad3_1->cd();
71pad3_1->SetLogx();
72pad3_1->SetLogy();
73//all->Draw("AE4");
74all->Draw("APZ");
75all->GetXaxis()->SetTitle("p_{T} [GeV/c]");
76all->GetXaxis()->SetTitleOffset(1.6);
77all->GetYaxis()->SetTitleOffset(1.6);
78all->GetYaxis()->SetTitle("1/N_{evt} 1/(2#pi p_{T}) (d^{2}N_{ch})/(d#eta dp_{T}) (GeV/c)^{-2}");
79all->GetXaxis()->SetLimits(minPt,maxPt);
80setAttrib(all);
81/*
82all->SetTitle("");
83all->UseCurrentStyle();
84all->GetXaxis()->SetRangeUser(minPt,maxPt);
85all->GetXaxis()->SetLabelOffset(0.0);
86all->GetXaxis()->SetTitleOffset(1.0);
87all->GetYaxis()->SetTitleOffset(1.5);
88all->GetYaxis()->SetTitleSize(0.06);
89all->GetYaxis()->SetLabelSize(0.06);
90all->GetXaxis()->SetNdivisions(405);
91all->GetXaxis()->SetLabelSize(0.0);
92*/
93
94
95
96graphAlice->SetFillColor(2);
97TLegend *l3_1 = new TLegend(0.2,0.03,0.65,0.261);
98l3_1->SetHeader("pp, NSD, #sqrt{s} = 900 GeV");
99l3_1->AddEntry(graphAlice,"ALICE | #eta | < 0.8","LP");
100l3_1->AddEntry(graphAtlas,"ATLAS | #eta | < 2.5","LP");
101l3_1->AddEntry(graphCms,"CMS | #eta | < 2.4","LP");
102//la->AddEntry(graphUA1,"UA1","p");
103//la->AddEntry(graphCMS,"CMS","p");
104//la->AddEntry(graphCMSred,"CMS, #eta<0.8","p");
105//la->AddEntry(graphATLAS,"ATLAS","p");
106l3_1->SetTextSize(legendTextSize);
107l3_1->SetFillColor(0);
108l3_1->SetLineColor(0);
109l3_1->Draw();
110
111
112//histo1->GetXaxis()->SetNdivisions(405);
113
114can3->cd();
115pad3_2->Draw();
116pad3_2->cd();
117pad3_2->SetLogx();
118
119TMultiGraph *ratios = new TMultiGraph("ratios","");
120
121
122ratios->Add(ratioAliceAlice);
123ratios->Add(ratioAtlasAlice);
124ratios->Add(ratioCmsAlice);
125
126;
127//ratio->SetTitle("ratio ALICE/ATLAS (different #eta)");
128ratios->Draw("AE3");
129ratios->GetXaxis()->SetLimits(minPt,maxPt);
130ratios->GetXaxis()->SetTitle("p_{T} (GeV/c)");
131ratios->GetXaxis()->SetTitleOffset(1.4);
132ratios->GetYaxis()->SetTitleOffset(0.9);
133ratios->GetYaxis()->SetTitle("ratio");
134ratios->GetYaxis()->SetLabelSize(0.07);
135ratios->GetXaxis()->SetLabelSize(0.07);
136ratios->GetXaxis()->SetTitleSize(0.07);
137ratios->GetYaxis()->SetTitleSize(0.07);
138ratios->GetYaxis()->CenterTitle();
139setAttrib(ratios);
140
141ratios->GetYaxis()->SetLabelOffset(0.023);
142
143//ratios->GetYaxis()->SetRangeUser(0.2,1.7);
144//ratios->GetYaxis()->SetLimits(0.2,1.7);
145
146/*
147ratios->UseCurrentStyle();
148ratios->GetXaxis()->SetTitleOffset(1.2);
149ratios->GetYaxis()->SetTitleOffset(0.6);
150ratios->GetXaxis()->SetTitleSize(0.135);
151ratios->GetYaxis()->SetTitleSize(0.135);
152ratios->GetXaxis()->SetLabelSize(0.135);
153ratios->GetYaxis()->SetLabelSize(0.135);
154ratios->GetXaxis()->SetLabelOffset(0.025);
155ratios->GetYaxis()->SetLabelOffset(0.06);
156ratios->GetXaxis()->SetTickLength(0.09);
157ratios->GetYaxis()->SetLabelOffset(0.025);
158ratios->GetXaxis()->SetNdivisions(405);
159ratios->GetYaxis()->SetNdivisions(402);
160ratios->GetXaxis()->SetRangeUser(minPt,maxPt);
161*/
162
163graphAlice->SetFillColor(2);
164TLegend *l3_2 = new TLegend(0.2,0.323,0.65,0.637);
165l3_2->AddEntry(ratioAliceAlice,"ALICE uncertainties","F");
166l3_2->AddEntry(ratioAtlasAlice,"ATLAS / ALICE","F");
167l3_2->AddEntry(ratioCmsAlice,"CMS / ALICE","F");
168l3_2->SetFillColor(0);
169l3_2->SetLineColor(0);
170l3_2->SetTextSize(legendTextSize);
171l3_2->Draw();
172
173
174//aliceData->Draw("AE4");
175TF1 *fOne = new TF1("one","1",0.1,20);
176fOne->SetRange(0.1,20);
177fOne->SetLineWidth(1);
178fOne->Draw("SAME");
179//ratio->GetYaxis()->SetTitle("ratio ALICE/ATLAS");
180/*
181histo1c->Draw();
182histo1c->GetXaxis()->SetLabelSize(0.08);
183histo1c->GetYaxis()->SetLabelSize(0.08);
184histo1c->GetXaxis()->SetNdivisions(405);
185histo1c->GetYaxis()->SetNdivisions(405);
186*/
187
188ratios->Draw("E3");
189fOne->Draw("SAME");
190logoPrelim(can3);
191}