Fix in AliTrackerBase::PropagateTo... routines: length integral was not correctly...
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / ChargedHadrons / dNdPt / macros / plots / makePlotsAlice3.C
1 //------------------------------------------------------------------------------
2 // makePlotsAlice3.C
3 //
4 // create figure with ALICE INEL data and ratios to mod Hagedorn and powerlaw fit
5 // fit ratios in seperate panels
6 //------------------------------------------------------------------------------
7
8
9 void makePlotsAlice3() 
10 {
11
12 TGraphErrors *graphStatNsdAlice = new TGraphErrors(binsNsdAlice,ptNsdAlice,nsdAlice,0,statNsdAlice);
13 graphStatNsdAlice->SetMarkerColor(colorAliceFit);
14 graphStatNsdAlice->SetLineColor(colorAliceFit);
15 graphStatNsdAlice->SetLineWidth(1);
16 graphStatNsdAlice->SetMarkerStyle(20);
17 graphStatNsdAlice->SetTitle("");
18
19 TGraphErrors *graphStatInelAlice = new TGraphErrors(binsInelAlice,ptInelAlice,inelAlice,0,statInelAlice);
20 graphStatInelAlice->SetMarkerColor(colorAliceFit);
21 graphStatInelAlice->SetLineColor(colorAliceFit);
22 graphStatInelAlice->SetLineWidth(1);
23 graphStatInelAlice->SetMarkerStyle(20);
24 graphStatInelAlice->SetTitle("");
25
26 TGraphErrors *graphSystNsdAlice = new TGraphErrors(binsNsdAlice,centerPtNsdAlice,nsdAlice,0,systNsdAlice);
27 graphSystNsdAlice->SetMarkerColor(colorAlice);
28 graphSystNsdAlice->SetFillColor(colorAliceErrors);
29 graphSystNsdAlice->SetLineColor(20);
30 graphSystNsdAlice->SetTitle("");
31 graphSystNsdAlice->SetMarkerStyle(20);
32
33 TGraphErrors *graphSystInelAlice =  new TGraphErrors(binsInelAlice,centerPtInelAlice,inelAlice,0,systInelAlice);
34 graphSystInelAlice->SetMarkerColor(colorAlice);
35 graphSystInelAlice->SetFillColor(colorAliceErrors);
36 graphSystInelAlice->SetLineColor(20);
37 graphSystInelAlice->SetTitle("");
38 graphSystInelAlice->SetMarkerStyle(20);
39
40
41
42
43
44 TCanvas *can23 = new TCanvas("can23","PlotsAlice3_INEL",520,876);
45
46 TPad *pad23_1 = new TPad("pad23_1","pad23_1",0.0,425.0/876.0,1.0,1.0);
47 setAttrib(pad23_1);
48 pad23_1->SetBottomMargin(0);
49 //pad23_1->SetTopMargin(0);
50 pad23_1->SetBorderSize(0);
51
52
53
54 TPad *pad23_2 = new TPad("pad23_2","pad23_2",0.0,(425.0-175.0)/876.0,1.0,425.0/876.0);
55 setAttrib(pad23_2);.
56 pad23_2->SetTopMargin(0.0);
57 pad23_2->SetBottomMargin(0.0);
58 pad23_2->SetBorderSize(0);
59
60 TPad *pad23_3 = new TPad("pad23_2","pad23_2",0.0,0.0,1.0,(425.0-175.0)/876.0);
61 setAttrib(pad23_3);
62 pad23_3->SetTopMargin(0.0);
63 //pad23_3->SetBottomMargin(0);
64 pad23_3->SetBottomMargin(0.30);
65 pad23_3->SetBorderSize(0);
66
67
68 can23->cd();
69
70 pad23_1->Draw();
71 pad23_1->cd();
72 pad23_1->SetLogx();
73 pad23_1->SetLogy();
74
75 graphStatInelAlice->Draw("APZ");
76 //graphSystInelAlice->Draw("AE3");
77 graphStatInelAlice->GetXaxis()->SetLimits(minPt,maxPt);
78 graphStatInelAlice->GetXaxis()->SetTitle("p_{T} (GeV/c)");
79 graphStatInelAlice->GetXaxis()->SetTitleOffset(1.6);
80 graphStatInelAlice->GetYaxis()->SetTitleOffset(1.6);
81 graphStatInelAlice->GetYaxis()->SetTitle("1/N_{evt} 1/(2#pi p_{T}) (d^{2}N_{ch})/(d#eta dp_{T}) (GeV/c)^{-2}");
82 graphStatInelAlice->GetYaxis()->SetLimits(1.01e-7,10);
83 graphStatInelAlice->GetYaxis()->SetRangeUser(1.01e-7,10);
84 setAttrib(graphStatInelAlice);
85 graphStatInelAlice->GetYaxis()->SetTitleOffset(2.8);
86
87 //ptfunction2 = new TF1("ptfunction2","[0]*(1+(sqrt(0.14*0.14+x*x)-0.14)/([1]*[2]))^ ((-1) * [1])",0,12.0); 
88 ptfunction2 = new TF1("ptfunction2","[0]*(x/sqrt(0.14*0.14+x*x))*(1+(x)/([2]))^((-1) * [1])",0.0,10.0); 
89
90 powerlaw4 = new TF1("powerlaw4","[0]*x^[1]",0.0,10.0);
91
92 ptfunction2->SetParameter(0,54.931915);
93 ptfunction2->SetParameter(1,7.931081);
94 ptfunction2->SetParameter(2,0.148710);
95 ptfunction2->SetLineWidth(2);
96
97 graphStatInelAlice->Fit("ptfunction2","MN","",0.0,10.0);
98 graphStatInelAlice->Fit("powerlaw4","MN","",3.0,10.0);
99
100 ptfunction2->SetLineColor(colorCms);
101 powerlaw4->SetLineWidth(2);
102 powerlaw4->SetLineColor(colorAtlas);
103
104 powerlaw4->SetLineStyle(7); //was 7 for dashed
105 powerlaw4->SetRange(1,3);
106 powerlaw4->DrawCopy("SAME");
107
108 ptfunction2->SetLineStyle(1); //was 7 for dashed
109 ptfunction2->SetRange(4,10);
110 ptfunction2->DrawCopy("SAME");
111
112 powerlaw4->SetLineStyle(7);
113 powerlaw4->SetRange(3,10);
114 powerlaw4->DrawCopy("SAME");
115
116 ptfunction2->SetLineStyle(1);
117 ptfunction2->SetRange(0,4);
118 ptfunction2->DrawCopy("SAME");
119
120
121
122 //TLegend *leg23_1 = new TLegend(0.2,0.145,0.65,0.376);
123 TLegend *leg23_1 = new TLegend(0.2,0.03,0.65,0.261);
124 leg23_1->SetHeader("pp, INEL, #sqrt{s} = 900 GeV, | #eta | < 0.8");
125 //leg23_1->AddEntry("","ALICE pp, INEL","");
126 //leg23_1->AddEntry("","#sqrt{s} = 900 GeV, | #eta | < 0.8","");
127 //leg23_1->AddEntry("","#LT p_{T} #GT = (469 #pm 1 #pm 12) MeV/c","");
128 leg23_1->AddEntry(graphStatInelAlice,"ALICE data","LP");
129 leg23_1->AddEntry(ptfunction2,"mod. Hagedorn fit","L");
130 leg23_1->AddEntry(powerlaw4,"power law fit, p_{T} > 3 GeV/c","L");
131 //leg23_1->AddEntry("","n (3-10 GeV/c) = 6.63 #pm 0.12 #pm 0.01","");
132
133 leg23_1->SetFillColor(0);
134 leg23_1->SetLineColor(0);
135 leg23_1->SetTextSize(legendTextSize);
136 leg23_1->Draw();
137 /*
138 TLegend *leg23_11 = new TLegend(0.2,0.03,0.3,0.088);
139 leg23_11->SetFillColor(0);
140 leg23_11->SetLineColor(0);
141 leg23_11->SetTextSize(legendTextSize);
142 leg23_11->AddEntry("","A*p_{T}^{-n}; n = 6.63 #pm 0.12","");
143 leg23_11->Draw();
144 */
145
146 can23->cd();
147 /*
148 pad23_11->Draw();
149 pad23_11->cd();
150 */
151 pad23_2->SetTopMargin(0.0);
152 pad23_2->SetBottomMargin(0.0);
153 pad23_2->Draw();
154 pad23_2->cd();
155 pad23_2->SetLogx();
156
157
158 Double_t one[binsInelAlice];  
159 for (Int_t i=0; i < binsInelAlice; i++) { 
160     one[i] = 1.0;
161 }
162
163 TGraphErrors *systInelAlice = new TGraphErrors(binsInelAlice*2);
164 for (int i=0; i < binsInelAlice; i++) {
165    systInelAlice->SetPoint(i*2,lowPtInelAlice[i],1);
166    systInelAlice->SetPointError(i*2,0,relSystInelAlice[i]);
167    systInelAlice->SetPoint(i*2+1,highPtInelAlice[i],1);   
168    systInelAlice->SetPointError(i*2+1,0,relSystInelAlice[i]);
169 }
170 //TGraphErrors *ratioAliceAlice = new TGraphErrors(binsInelAlice,centerPtInelAlice,one,0,relErr2InelAlice);
171    
172 systInelAlice->Draw("AE3");
173 systInelAlice->SetFillColor(colorAliceErrors);
174 systInelAlice->SetLineColor(colorAliceErrors);
175 systInelAlice->SetTitle("");
176 systInelAlice->SetLineWidth(0);
177 systInelAlice->GetXaxis()->SetLimits(minPt,maxPt);
178 systInelAlice->GetXaxis()->SetTitle("p_{T} (GeV/c)");
179 systInelAlice->GetXaxis()->SetTitleOffset(1.4);
180 systInelAlice->GetYaxis()->SetTitleOffset(0.9);
181 systInelAlice->GetYaxis()->SetTitle("fit / data");
182 systInelAlice->GetYaxis()->CenterTitle();
183 systInelAlice->GetYaxis()->SetLabelSize(0.07);
184 systInelAlice->GetXaxis()->SetLabelSize(0.07);
185 systInelAlice->GetXaxis()->SetTitleSize(0.07);
186 systInelAlice->GetYaxis()->SetTitleSize(0.07);
187 systInelAlice->GetYaxis()->SetRangeUser(0.1,1.9);
188 systInelAlice->GetYaxis()->SetLimits(0.1,1.9);
189 setAttrib(systInelAlice);
190 systInelAlice->GetYaxis()->SetNdivisions(505);
191 systInelAlice->SetFillColor(colorAliceErrors);
192 systInelAlice->SetLineColor(20);
193 //systInelAlice->Clone()->Draw("L");
194 systInelAlice->GetYaxis()->SetTitleOffset(2.8);
195
196 TGraphErrors *ratioFitInelAlice = new TGraphErrors(binsInelAlice);
197 for (int i=0; i < binsInelAlice; i++) {
198    if (ptInelAlice[i] > 4.0) break;
199    ratioFitInelAlice->SetPoint(i,ptInelAlice[i],ptfunction2->Eval(ptInelAlice[i])/inelAlice[i]);
200    ratioFitInelAlice->SetPointError(i,0,statInelAlice[i]*ptfunction2->Eval(ptInelAlice[i])/(inelAlice[i]*inelAlice[i]));
201 }
202
203 TGraphErrors *ratioPFitInelAlice = new TGraphErrors(binsInelAlice);
204 for (int i=0; i < binsInelAlice; i++) {
205    ratioPFitInelAlice->SetPoint(i,ptInelAlice[i],powerlaw4->Eval(ptInelAlice[i])/inelAlice[i]);
206    ratioPFitInelAlice->SetPointError(i,0,statInelAlice[i]*powerlaw4->Eval(ptInelAlice[i])/(inelAlice[i]*inelAlice[i]));
207 }
208
209 TGraphErrors *ratioFitInelAliceNF = new TGraphErrors(binsInelAlice);
210 for (int i=0; i < binsInelAlice; i++) {
211    ratioFitInelAliceNF->SetPoint(i,ptInelAlice[i],ptfunction2->Eval(ptInelAlice[i])/inelAlice[i]);
212    ratioFitInelAliceNF->SetPointError(i,0,statInelAlice[i]*ptfunction2->Eval(ptInelAlice[i])/(inelAlice[i]*inelAlice[i]));
213 }
214
215 TGraphErrors *ratioPFitInelAliceNF = new TGraphErrors(binsInelAlice);
216 for (int i=0; i < binsInelAlice; i++) {
217    if (ptInelAlice[i] > 3.0) break;
218    ratioPFitInelAliceNF->SetPoint(i,ptInelAlice[i],powerlaw4->Eval(ptInelAlice[i])/inelAlice[i]);
219    ratioPFitInelAliceNF->SetPointError(i,0,statInelAlice[i]*powerlaw4->Eval(ptInelAlice[i])/(inelAlice[i]*inelAlice[i]));
220 }
221
222
223 systInelAlice->GetYaxis()->SetLabelOffset(0.023);
224
225 setAttrib(ratioFitInelAliceNF);
226 ratioFitInelAliceNF->SetLineWidth(1);
227 ratioFitInelAliceNF->SetMarkerStyle(20);
228 ratioFitInelAliceNF->SetMarkerColor(colorCms);
229 ratioFitInelAliceNF->SetLineColor(colorCms);
230 ratioFitInelAliceNF->Draw("PZ");
231
232 setAttrib(ratioFitInelAlice);
233 ratioFitInelAlice->SetLineWidth(1);
234 ratioFitInelAlice->SetMarkerStyle(20);
235 ratioFitInelAlice->SetMarkerColor(colorCms);
236 ratioFitInelAlice->SetLineColor(colorCms);
237 ratioFitInelAlice->Draw("PZ");
238
239
240 setAttrib(ratioPFitInelAlice);
241 ratioPFitInelAlice->SetLineWidth(1);
242 ratioPFitInelAlice->SetMarkerStyle(20);
243 ratioPFitInelAlice->SetMarkerColor(colorAtlas);
244 ratioPFitInelAlice->SetLineColor(colorAtlas);
245 //ratioPFitInelAlice->Draw("PZ");
246
247
248
249
250
251 TF1 *fOne = new TF1("one","1",0.1,20);
252 fOne->SetRange(0.1,20);
253 fOne->SetLineWidth(1);
254 fOne->Draw("SAME");
255
256 TLegend *l23_2 = new TLegend(0.200,0.053,0.65,0.353);
257 l23_2->AddEntry(systInelAlice,"ALICE systematic uncertainties","F");
258 l23_2->AddEntry(ratioFitInelAlice,"mod. Hagedorn","LP");
259 l23_2->SetFillColor(0);
260 l23_2->SetLineColor(0);
261 l23_2->SetTextSize(legendTextSize);
262 l23_2->Draw();
263
264 //ratioPFitInelAlice->Draw("PZ");
265
266
267
268 can23->cd();
269 // pad23_11->cd();
270
271 pad23_3->Draw();
272 pad23_3->cd();
273 pad23_3->SetLogx();
274
275 systInelAlice->Draw("AE3");
276 systInelAlice->SetFillColor(colorAliceErrors);
277 systInelAlice->SetLineColor(colorAliceErrors);
278 systInelAlice->SetTitle("");
279 systInelAlice->SetLineWidth(0);
280 systInelAlice->GetXaxis()->SetLimits(minPt,maxPt);
281 systInelAlice->GetXaxis()->SetTitle("p_{T} (GeV/c)");
282 systInelAlice->GetXaxis()->SetTitleOffset(3.6);
283 systInelAlice->GetYaxis()->SetTitleOffset(0.9);
284 systInelAlice->GetYaxis()->SetTitle("fit / data");
285 systInelAlice->GetYaxis()->CenterTitle();
286 systInelAlice->GetYaxis()->SetLabelSize(0.07);
287 systInelAlice->GetXaxis()->SetLabelSize(0.07);
288 systInelAlice->GetXaxis()->SetTitleSize(0.07);
289 systInelAlice->GetYaxis()->SetTitleSize(0.07);
290 systInelAlice->GetYaxis()->SetRangeUser(0.1,1.9);
291 systInelAlice->GetYaxis()->SetLimits(0.1,1.9);
292 systInelAlice->GetYaxis()->SetNdivisions(505);
293 setAttrib(systInelAlice);
294 systInelAlice->SetFillColor(colorAliceErrors);
295 systInelAlice->SetLineColor(20);
296 systInelAlice->GetYaxis()->SetTitleOffset(2.8);
297 systInelAlice->GetXaxis()->SetTitleOffset(4.6);
298
299 setAttrib(ratioPFitInelAlice);
300 ratioPFitInelAlice->SetLineWidth(1);
301 ratioPFitInelAlice->SetMarkerStyle(20);
302 ratioPFitInelAlice->SetMarkerColor(colorAtlas);
303 ratioPFitInelAlice->SetLineColor(colorAtlas);
304 ratioPFitInelAlice->Draw("PZ");
305
306 setAttrib(ratioPFitInelAliceNF);
307 ratioPFitInelAliceNF->SetLineWidth(1);
308 ratioPFitInelAliceNF->SetMarkerStyle(20);
309 ratioPFitInelAliceNF->SetMarkerColor(kWhite);
310 ratioPFitInelAliceNF->SetLineColor(kWhite);
311 ratioPFitInelAliceNF->DrawClone("PZ");
312
313 setAttrib(ratioPFitInelAliceNF);
314 ratioPFitInelAliceNF->SetLineWidth(1);
315 ratioPFitInelAliceNF->SetMarkerStyle(24);
316 ratioPFitInelAliceNF->SetMarkerColor(colorAtlas);
317 ratioPFitInelAliceNF->SetLineColor(colorAtlas);
318 ratioPFitInelAliceNF->Draw("PZ");
319
320 fOne->Draw("SAME");
321
322
323 TLegend *l23_3 = new TLegend(0.200,0.323,0.65,0.537);
324 l23_3->AddEntry(systInelAlice,"ALICE systematic uncertainties","F");
325 l23_3->AddEntry(ratioPFitInelAlice,"power law","LP");
326 l23_3->SetFillColor(0);
327 l23_3->SetLineColor(0);
328 l23_3->SetTextSize(legendTextSize);
329 l23_3->Draw();
330
331 logoPrelim(can23);
332 }