2 Float_t gpTMax = 49.99;
7 Float_t gForceRange = -1;
10 const char* gText = "";
12 void SetRanges(TAxis* axis)
14 if (strcmp(axis->GetTitle(), "leading p_{T} (GeV/c)") == 0)
15 axis->SetRangeUser(0, (gEnergy == 900) ? 10 : 25);
17 if (strcmp(axis->GetTitle(), "multiplicity") == 0)
18 axis->SetRangeUser(0, 10);
21 void SetRanges(TH1* hist)
23 SetRanges(hist->GetXaxis());
24 SetRanges(hist->GetYaxis());
25 SetRanges(hist->GetZaxis());
28 void Prepare1DPlot(TH1* hist)
33 hist->SetLineWidth(2);
34 hist->SetStats(kFALSE);
36 hist->GetXaxis()->SetLabelOffset(0.02);
37 hist->GetXaxis()->SetTitleOffset(1.3);
38 hist->GetYaxis()->SetTitleOffset(1.3);
43 TH1* GetSystematicUncertainty(TH1* corr, TH1* trackHist)
47 systError = (TH1*) corr->Clone("systError");
50 else // for dphi evaluation
51 systError = new TH1F("systError", "", 100, 0, 50);
53 Float_t constantUnc = 0;
55 // particle composition
56 constantUnc += 0.8 ** 2;
59 if (gEnergy == 900 && gpTMin < 1.0)
60 constantUnc += 1.0 ** 2;
61 else if (gEnergy == 900 && gpTMin < 1.5)
62 constantUnc += 0.5 ** 2;
63 if (gEnergy == 7000 && gpTMin < 1.0)
64 constantUnc += 1.0 ** 2;
65 else if (gEnergy == 7000 && gpTMin < 1.5)
66 constantUnc += 0.6 ** 2;
69 if (gEnergy == 900 && gpTMin < 1.0)
70 constantUnc += 2.5 ** 2;
71 else if (gEnergy == 900 && gpTMin < 1.5)
72 constantUnc += 2.0 ** 2;
74 constantUnc += 3.0 ** 2;
76 // difference corrected with pythia and phojet
77 if (gEnergy == 900 && gpTMin < 1.0)
78 constantUnc += 0.6 ** 2;
79 else if (gEnergy == 900 && gpTMin < 1.5)
80 constantUnc += 0.8 ** 2;
82 if (gEnergy == 7000 && gpTMin < 1.0)
85 constantUnc += 0.6 ** 2;
87 constantUnc += 0.8 ** 2;
89 constantUnc += 1.0 ** 2;
91 else if (gEnergy == 7000 && gpTMin < 1.5)
92 constantUnc += 1.0 ** 2;
94 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
95 systError->SetBinContent(bin, constantUnc);
98 if (gUEHist == 0 || gUEHist == 2)
99 systError->Fill(0.75, 4.0 ** 2);
101 systError->Fill(0.75, 5.0 ** 2);
106 systError->Fill(1.25, 1.0 ** 2);
107 else if (gpTMin < 1.5)
108 systError->Fill(1.25, 2.0 ** 2);
113 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
114 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 1.0 ** 2);
118 if (gUEHist == 0 && gUEHist == 1)
119 systError->Fill(0.75, 2.0 ** 2);
121 systError->Fill(0.75, 1.2 ** 2);
125 systError->Fill(0.75, 1.0 ** 2);
128 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
131 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 0.5 ** 2);
132 if (gEnergy == 7000 && systError->GetXaxis()->GetBinCenter(bin) < 1.5)
133 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 2.0 ** 2);
134 else if (gEnergy == 7000)
135 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 1.0 ** 2);
138 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
139 systError->SetBinContent(bin, TMath::Sqrt(systError->GetBinContent(bin)));
143 //new TCanvas; trackHist->Draw();
144 //new TCanvas; systError->DrawCopy("");
147 for (Int_t i=1; i<=trackHist->GetNbinsX(); i++)
148 uncFlat += trackHist->GetBinContent(i) * systError->GetBinContent(systError->FindBin(trackHist->GetBinCenter(i)));
149 if (trackHist->Integral() > 0)
150 uncFlat /= trackHist->Integral();
152 systError = (TH1F*) corr->Clone("systError");
155 for (Int_t i=1; i<=systError->GetNbinsX(); i++)
156 systError->SetBinContent(i, uncFlat);
158 //new TCanvas; systError->DrawCopy("");
161 systError->SetFillColor(kGray);
162 systError->SetFillStyle(1001);
163 systError->SetMarkerStyle(0);
164 systError->SetLineColor(0);
169 void DrawRatio(TH1* corr, TH1* mc, const char* name, TH1* syst = 0)
173 TCanvas* canvas3 = new TCanvas(name, name, 600, 600);
174 canvas3->Range(0, 0, 1, 1);
176 TPad* pad1 = new TPad(Form("%s_1", name), "", 0, 0.5, 0.98, 0.98);
179 TPad* pad2 = new TPad(Form("%s_2", name), "", 0, 0.02, 0.98, 0.5);
182 pad1->SetRightMargin(0.01);
183 pad2->SetRightMargin(0.01);
184 pad1->SetTopMargin(0.05);
185 pad1->SetLeftMargin(0.13);
186 pad2->SetLeftMargin(0.13);
187 pad2->SetBottomMargin(0.22);
189 // no border between them
190 pad1->SetBottomMargin(0);
191 pad2->SetTopMargin(0);
198 TLegend* legend = new TLegend(0.15, 0.65, 0.55, 0.90);
200 TLegend* legend = new TLegend(0.55, 0.65, 0.95, 0.90);
202 legend->SetFillColor(0);
203 legend->AddEntry(corr, "Corrected");
204 legend->AddEntry(mc, "MC prediction");
205 legend->SetTextSize(0.08);
209 TH2F* dummy = new TH2F("dummy", "", 100, corr->GetXaxis()->GetBinLowEdge(1), corr->GetXaxis()->GetBinUpEdge(corr->GetNbinsX()), 1000, 0, TMath::Max(corr->GetMaximum(), mc->GetMaximum()) * 1.1);
210 dummy->SetYTitle(corr->GetYaxis()->GetTitle());
212 //dummy = new TH2F("dummy", "", 100, corr->GetXaxis()->GetBinLowEdge(1), corr->GetXaxis()->GetBinUpEdge(corr->GetNbinsX()), 1000, 13.5, 20.5);
213 //dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
215 dummy->SetStats(kFALSE);
216 dummy->SetXTitle(corr->GetXaxis()->GetTitle());
217 dummy->GetYaxis()->SetTitleOffset(1);
218 Prepare1DPlot(dummy);
220 dummy->GetXaxis()->SetLabelSize(0.08);
221 dummy->GetYaxis()->SetLabelSize(0.08);
222 dummy->GetXaxis()->SetTitleSize(0.08);
223 dummy->GetYaxis()->SetTitleSize(0.08);
224 dummy->GetYaxis()->SetTitleOffset(0.8);
227 dummy->GetYaxis()->SetRangeUser(0, gForceRange);
231 if (0 && gUEHist != 2)
233 const char* regionStr[] = { "Toward Region", "Away Region", "Transverse Region" };
234 latex = new TLatex(0.65, 0.1, regionStr[gRegion]);
235 latex->SetTextSize(0.075);
242 systError = (TH1*) syst->Clone("corrSystError");
243 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
245 systError->SetBinError(bin, corr->GetBinContent(bin) * syst->GetBinContent(bin) / 100);
246 systError->SetBinContent(bin, corr->GetBinContent(bin));
249 systError->Draw("E2 ][ SAME");
255 if (strlen(gText) > 0)
257 latex = new TLatex(0.2, 0.2, gText);
259 latex->SetTextSize(0.06);
266 //pad2->SetBottomMargin(0.15);
270 TH1* ratio = (TH1*) mc->Clone("ratio");
273 Float_t minR = TMath::Min(0.91, ratio->GetMinimum() * 0.95);
274 Float_t maxR = TMath::Max(1.09, ratio->GetMaximum() * 1.05);
279 TH1F dummy3("dummy3", ";;Ratio: MC / corr", 100, corr->GetXaxis()->GetBinLowEdge(1), corr->GetXaxis()->GetBinUpEdge(corr->GetNbinsX()));
280 dummy3.SetXTitle(corr->GetXaxis()->GetTitle());
281 Prepare1DPlot(&dummy3);
282 dummy3.SetStats(kFALSE);
283 for (Int_t i=1; i<=100; ++i)
284 dummy3.SetBinContent(i, 1);
285 dummy3.GetYaxis()->SetRangeUser(minR, maxR);
286 dummy3.SetLineWidth(2);
287 dummy3.GetXaxis()->SetLabelSize(0.08);
288 dummy3.GetYaxis()->SetLabelSize(0.08);
289 dummy3.GetXaxis()->SetTitleSize(0.08);
290 dummy3.GetYaxis()->SetTitleSize(0.08);
291 dummy3.GetYaxis()->SetTitleOffset(0.8);
296 // for the ratio add in quadrature
297 for (Int_t bin=1; bin<=syst->GetNbinsX(); bin++)
299 if (corr->GetBinError(bin) > 0)
300 syst->SetBinError(bin, TMath::Sqrt(TMath::Power(syst->GetBinContent(bin) / 100, 2) + TMath::Power(corr->GetBinError(bin) / corr->GetBinContent(bin), 2)));
302 syst->SetBinError(bin, 0);
303 syst->SetBinContent(bin, 1);
306 syst->Draw("E2 ][ SAME");
307 dummy3.DrawCopy("SAME");
312 ratio->Fit("pol0", "N");
315 //canvas3->SaveAs(Form("%s.eps", canvas3->GetTitle()));
320 gSystem->Load("libANALYSIS");
321 gSystem->Load("libANALYSISalice");
322 gSystem->Load("libCORRFW");
323 gSystem->Load("libJETAN");
324 gSystem->Load("libPWG4JetTasks");
327 void* GetUEHistogram(const char* fileName, TList** listRef = 0, Bool_t mixed = kFALSE)
329 file = TFile::Open(fileName);
333 list = (TList*) gFile->Get("PWG4_LeadingTrackUE/histosLeadingTrackUE");
335 list = (TList*) gFile->Get("PWG4_PhiCorrelations/histosPhiCorrelations");
344 return list->FindObject("AliUEHistogramsMixed");
346 if (list->FindObject("AliUEHistograms"))
347 return list->FindObject("AliUEHistograms");
349 return list->FindObject("AliUEHistogramsSame");
352 void CompareBias(const char* mcFile = "PWG4_JetTasksOutput.root", Int_t region, Int_t ueHist)
356 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(mcFile);
359 const char* axis = "z";
360 Float_t ptLeadMin = 0;
361 Float_t ptLeadMax = -1;
365 ptLeadMin = 0.51 + 0;
366 ptLeadMax = 1.99 + 0;
370 biasFromData = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepBiasStudy, AliUEHist::kCFStepReconstructed, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromData");
371 biasFromData2 = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepBiasStudy2, AliUEHist::kCFStepReconstructed, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromData2");
372 //biasFromData = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepRealLeading, region, axis)->Clone("biasFromData");
373 biasFromMC = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepTracked, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromMC");
374 //biasFromMC = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepRealLeading, region, axis)->Clone("biasFromMC");
376 /* biasFromData->Draw();
377 biasFromMC->SetLineColor(2);
378 biasFromMC->Draw("SAME");
381 DrawRatio(biasFromData, biasFromMC, "bias: data vs MC");
382 DrawRatio(biasFromData, biasFromData2, "bias: data vs data two step");
385 void CompareBiasWithData(const char* mcFile = "PWG4_JetTasksOutput.root", const char* dataFile = "esd.root", Int_t region = 2)
389 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(mcFile);
392 biasFromMC = (TH1*) h->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepTracked, region, "z")->Clone("biasFromMC");
394 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(dataFile);
397 biasFromData = (TH1*) h2->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepBiasStudy, AliUEHist::kCFStepReconstructed, region, "z")->Clone("biasFromData");
398 biasFromData2 = (TH1*) h2->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepBiasStudy2, AliUEHist::kCFStepReconstructed, region, "z")->Clone("biasFromData2");
400 DrawRatio(biasFromData, biasFromMC, "bias: data vs MC");
401 DrawRatio(biasFromData, biasFromData2, "bias: data vs data two step");
406 void Compare(const char* fileName1, const char* fileName2, Int_t id, Int_t step1, Int_t step2, Int_t region, Float_t ptLeadMin = -1, Float_t ptLeadMax = -1, Int_t centralityBegin = 0, Int_t centralityEnd = -1)
410 if (!gCache || !gFirst)
412 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
413 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
425 AliUEHistograms* h = (AliUEHistograms*) gFirst;
426 AliUEHistograms* h2 = (AliUEHistograms*) gSecond;
433 TH1* hist1 = h->GetUEHist(id)->GetUEHist(step1, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
434 //TH1* hist1 = h->GetUEHist(id)->GetUEHist(step1, region, ptLeadMin, ptLeadMax);
435 TH1* hist2 = h2->GetUEHist(id)->GetUEHist(step2, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
437 //hist1->Scale(1.0 / hist1->Integral());
438 //hist2->Scale(1.0 / hist2->Integral());
443 trackHist = h->GetUEHist(id)->GetTrackHist(region)->ShowProjection(2, 0);
444 // only keep bins under consideration
445 for (Int_t bin=1; bin<=trackHist->GetNbinsX(); bin++)
446 if (bin < trackHist->FindBin(ptLeadMin) || bin > trackHist->FindBin(ptLeadMax))
447 trackHist->SetBinContent(bin, 0);
450 // systematic uncertainty
451 TH1* syst = 0; //GetSystematicUncertainty(hist1, trackHist);
453 DrawRatio(hist1, hist2, Form("%d_%s_%d_%d_%d_%.2f_%.2f", count++, TString(gSystem->BaseName(fileName1)).Tokenize(".")->First()->GetName(), id, step1, region, ptLeadMin, ptLeadMax), syst);
456 void CompareEventHist(const char* fileName1, const char* fileName2, Int_t id, Int_t step, Int_t var)
460 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
463 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
466 TH1* hist1 = h->GetUEHist(id)->GetEventHist()->ShowProjection(var, step);
467 TH1* hist2 = h2->GetUEHist(id)->GetEventHist()->ShowProjection(var, step);
469 DrawRatio(hist1, hist2, "compare");
472 void CompareEventHist(const char* fileName1, const char* fileName2, Int_t id, Int_t step1, Int_t step2, Int_t var)
476 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
479 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
482 TH1* hist1 = h->GetUEHist(id)->GetEventHist()->ShowProjection(var, step1);
483 TH1* hist2 = h2->GetUEHist(id)->GetEventHist()->ShowProjection(var, step2);
485 DrawRatio(hist1, hist2, "compare");
488 void CompareStep(const char* fileName1, const char* fileName2, Int_t id, Int_t step, Int_t region, Float_t ptLeadMin = -1, Float_t ptLeadMax = -1)
490 // fileName1 is labelled Corrected in the plot
496 Compare(fileName1, fileName2, id, step, step, region, ptLeadMin, ptLeadMax);
499 void CompareStep(const char* fileName1, const char* fileName2, Int_t id, Int_t step1, Int_t step2, Int_t region, Float_t ptLeadMin = -1, Float_t ptLeadMax = -1, Int_t centralityBegin = 0, Int_t centralityEnd = -1)
501 // fileName1 is labelled Corrected in the plot
507 Compare(fileName1, fileName2, id, step1, step2, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
510 TH1* DrawStep(const char* fileName, Int_t id, Int_t step, Int_t region, Float_t ptLeadMin = -1, Float_t ptLeadMax = -1, Int_t centralityBegin = 0, Int_t centralityEnd = -1, Int_t twoD = 0, Bool_t mixed = kFALSE)
514 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, mixed);
518 return h->GetUEHist(id)->GetUEHist(step, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd, twoD)->DrawCopy();
521 void DrawExample(const char* fileName)
526 hist = DrawStep(fileName, 2, 6, 0, 4.01, 19.99, 1, 6, 0);
529 hist->SetYTitle("1/N_{trig} dN/d#Delta#phi");
531 hist = DrawStep(fileName, 2, 6, 0, 4.01, 19.99, 1, 6, 1);
534 hist->SetZTitle("1/N_{trig} d^{2}N/d#Delta#phid#Delta#eta");
535 hist->GetYaxis()->SetTitleOffset(1.5);
536 hist->GetZaxis()->SetTitleOffset(1.2);
539 hist2 = DrawStep(fileName, 2, 6, 0, 4.01, 19.99, 1, 6, 1, kTRUE);
542 hist2->SetZTitle("1/N_{trig} d^{2}N/d#Delta#phid#Delta#eta");
543 hist2->GetYaxis()->SetTitleOffset(1.5);
544 hist2->GetZaxis()->SetTitleOffset(1.2);
545 hist2->Draw("SURF1");
548 hist = (TH1*) hist->Clone();
550 hist->SetZTitle("C(dN/d#Delta#phi#Delta#eta)");
554 void DrawValidation(const char* fileName1, const char* fileName2)
559 CompareStep(fileName1, fileName2, 2, 6, 4, 0, 4.01, 19.99);
560 CompareStep(fileName1, fileName2, 2, 4, 4, 0, 4.01, 19.99);
562 CompareStep(fileName1, fileName2, 2, 4, 2, 0, 4.01, 19.99);
563 CompareStep(fileName1, fileName2, 2, 2, 2, 0, 4.01, 19.99);
566 void ProfileMultiplicity(const char* fileName = "PWG4_JetTasksOutput.root")
570 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
573 h->GetCorrelationMultiplicity()->Draw("colz");
577 h->GetCorrelationMultiplicity()->ProfileX()->DrawCopy()->Fit("pol1", "", "", 1, 10);
580 void SetupRanges(void* obj)
582 //((AliUEHistograms*) obj)->SetEtaRange(-0.79, 0.79);
583 ((AliUEHistograms*) obj)->SetPtRange(gpTMin, gpTMax);
584 ((AliUEHistograms*) obj)->SetCombineMinMax(kTRUE);
587 void DrawRatios(const char* name, void* correctedVoid, void* comparisonVoid, Int_t compareStep = -1, Int_t compareRegion = 2, Float_t ptLeadMin = -1, Float_t ptLeadMax = -1)
589 AliUEHist* corrected = (AliUEHist*) correctedVoid;
590 AliUEHist* comparison = (AliUEHist*) comparisonVoid;
592 Int_t beginStep = AliUEHist::kCFStepAll;
593 Int_t endStep = AliUEHist::kCFStepReconstructed;
595 if (compareStep != -1)
597 beginStep = compareStep;
598 endStep = compareStep;
601 Int_t beginRegion = 0;
604 if (compareRegion != -1)
606 beginRegion = compareRegion;
607 endRegion = compareRegion;
610 for (Int_t step=beginStep; step<=endStep; step++)
612 if (compareStep == -1 && (step == AliUEHist::kCFStepAnaTopology || step == AliUEHist::kCFStepTriggered))
615 for (Int_t region=beginRegion; region <= endRegion; region++)
617 Printf("%f %f", ptLeadMin, ptLeadMax);
618 TH1* corrHist = corrected->GetUEHist(step, region, ptLeadMin, ptLeadMax);
619 TH1* mcHist = comparison->GetUEHist(step, region, ptLeadMin, ptLeadMax);
621 DrawRatio(corrHist, mcHist, TString(Form("%s: step %d %s %s", name, step, corrected->GetStepTitle(step), corrected->GetRegionTitle(region))));
626 void DrawRatios(void* correctedVoid, void* comparisonVoid, Int_t compareStep = -1, Int_t compareRegion = 2, Int_t compareUEHist = 0)
628 AliUEHistograms* corrected = (AliUEHistograms*) correctedVoid;
629 AliUEHistograms* comparison = (AliUEHistograms*) comparisonVoid;
631 if (1 && compareUEHist == 2)
633 for (Float_t ptMin = 2.01; ptMin < 8; ptMin += 2)
635 ((AliUEHistograms*) corrected)->SetPtRange(ptMin, ptMin + 1.98);
636 ((AliUEHistograms*) comparison)->SetPtRange(ptMin, ptMin + 1.98);
638 DrawRatios(TString(Form("Dphi %d pT %f", compareUEHist, ptMin)), corrected->GetUEHist(compareUEHist), comparison->GetUEHist(compareUEHist), compareStep, compareRegion, 8.01, 19.99);
643 if (compareUEHist == -1)
645 for (Int_t i=0; i<2; i++)
646 DrawRatios(TString(Form("UE %d", i)), corrected->GetUEHist(i), comparison->GetUEHist(i), compareStep, compareRegion);
649 DrawRatios(TString(Form("UE %d", compareUEHist)), corrected->GetUEHist(compareUEHist), comparison->GetUEHist(compareUEHist), compareStep, compareRegion);
652 void CompareEventsTracks(void* corrVoid, void* mcVoid, Int_t compareStep, Int_t compareRegion, Int_t compareUEHist = 0)
654 AliUEHist* corr = ((AliUEHistograms*) corrVoid)->GetUEHist(compareUEHist);
655 AliUEHist* mc = ((AliUEHistograms*) mcVoid)->GetUEHist(compareUEHist);
657 Float_t ptLeadMin = 0;
658 Float_t ptLeadMax = -1;
661 if (compareUEHist == 2)
668 TH1* corrHist = corr->GetUEHist(compareStep, compareRegion, ptLeadMin, ptLeadMax);
669 TH1* mcHist = mc ->GetUEHist(compareStep, compareRegion, ptLeadMin, ptLeadMax);
671 DrawRatio(corrHist, mcHist, Form("check"));
673 corr->SetBinLimits(corr->GetTrackHist(compareRegion)->GetGrid(compareStep));
674 mc->SetBinLimits(corr->GetTrackHist(compareRegion)->GetGrid(compareStep));
676 corrHist = corr->GetTrackHist(compareRegion)->GetGrid(compareStep)->Project(axis);
677 mcHist = mc ->GetTrackHist(compareRegion)->GetGrid(compareStep)->Project(axis);
678 DrawRatio(corrHist, mcHist, Form("check2"));
680 corrHist = corr->GetEventHist()->GetGrid(compareStep)->Project(0);
681 mcHist = mc ->GetEventHist()->GetGrid(compareStep)->Project(0);
682 DrawRatio(corrHist, mcHist, Form("check3"));
685 void correctMC(const char* fileNameCorrections, const char* fileNameESD = 0, Int_t compareStep = -1, Int_t compareRegion = 2, Int_t compareUEHist = 0)
687 // corrects the reconstructed step in fileNameESD with fileNameCorr
688 // if fileNameESD is 0 data from fileNameCorr is taken
689 // afterwards the corrected distributions are compared with the MC stored in fileNameESD
693 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
695 corr->ExtendTrackingEfficiency();
697 AliUEHistograms* testSample = corr;
699 testSample = (AliUEHistograms*) GetUEHistogram(fileNameESD);
701 // copy to esd object
702 AliUEHistograms* esd = (AliUEHistograms*) corr->Clone();
704 esd->CopyReconstructedData(testSample);
707 SetupRanges(testSample);
715 file3 = TFile::Open("correctedMC.root", "RECREATE");
716 file3->mkdir("PWG4_PhiCorrelations");
717 file3->cd("PWG4_PhiCorrelations");
718 list->Write("histosPhiCorrelations", TObject::kSingleKey);
722 DrawRatios(esd, testSample, compareStep, compareRegion, compareUEHist);
726 esd->SetPtRange(2.01, 3.99);
727 corrected = esd->GetUEHist(2)->GetUEHist(0, 0, 4.01, 7.99, 0, -1, 1);
728 testSample->SetPtRange(2.01, 3.99);
729 mc = testSample->GetUEHist(2)->GetUEHist(0, 0, 4.01, 7.99, 0, -1, 1);
730 new TCanvas; corrected->DrawCopy("SURF1");
731 new TCanvas; mc->DrawCopy("SURF1");
732 new TCanvas; mc->DrawCopy("SURF1")->Divide(corrected);
735 //CompareEventsTracks(esd, testSample, compareStep, compareRegion, compareUEHist);
738 // function to compare only final step for all regions and distributions
740 void correctData(const char* fileNameCorrections, const char* fileNameESD, const char* contEnhancement = 0, Float_t contEncUpTo = 1.0, Int_t compareStep = 0, Int_t compareRegion = 0, Int_t compareUEHist = 2)
742 // corrects fileNameESD with fileNameCorrections and compares the two
746 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
749 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD, &list);
754 corr->ExtendTrackingEfficiency();
758 TFile::Open(contEnhancement);
759 contEncHist = (TH1*) gFile->Get("histo");
760 contEncHistFullRange = (TH1*) corr->GetUEHist(0)->GetTrackingEfficiency(1)->Clone("contEncHistFullRange");
762 contEncHistFullRange->Reset();
763 for (Int_t i=1; i<=contEncHistFullRange->GetNbinsX(); i++)
765 contEncHistFullRange->SetBinContent(i, 1);
766 if (i <= contEncHist->GetNbinsX() && contEncHist->GetXaxis()->GetBinCenter(i) < contEncUpTo && contEncHist->GetBinContent(i) > 0)
767 contEncHistFullRange->SetBinContent(i, contEncHist->GetBinContent(i));
769 corr->SetContaminationEnhancement((TH1F*) contEncHistFullRange);
773 //esd->GetUEHist(2)->AdditionalDPhiCorrection(0);
775 file3 = TFile::Open("corrected.root", "RECREATE");
776 file3->mkdir("PWG4_PhiCorrelations");
777 file3->cd("PWG4_PhiCorrelations");
778 list->Write(0, TObject::kSingleKey);
781 DrawRatios(esd, corr, compareStep, compareRegion, compareUEHist);
784 void ITSTPCEfficiency(const char* fileNameData, Int_t id, Int_t itsTPC = 0)
788 // uncertainty from dN/dpT paper
789 Double_t pTBins[] = {0.0, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 100.0};
790 Float_t effITS[] = {0., 0., 0.995, 0.98, 0.986, 0.996, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; // the last three are the same because i don't have entries
791 Float_t effTPC[] = {0., 0, 1.042, 1.026,1.021, 1.018, 1.015, 1.015, 1.012, 1.012, 1.007, 1.0075,1.006, 1.006, 1.004, 1.004, 1.009 }; // the last bins put as if they were the same
793 TH1F* effHist = new TH1F("effHist", "effHist", 39, pTBins);
794 for (Int_t i=0; i<39; i++)
799 effHist->SetBinContent(i+1, (itsTPC == 0) ? effITS[bin] : effTPC[bin]);
802 new TCanvas; effHist->Draw();
804 EffectOfModifiedTrackingEfficiency(fileNameData, id, 2, effHist, 1, -1, (itsTPC == 0) ? "ITS" : "TPC");
808 void EffectOfModifiedTrackingEfficiency(const char* fileNameData, Int_t id, Int_t region, TH1* trackingEff, Int_t axis1, Int_t axis2 = -1, const char* name = "EffectOfModifiedTrackingEfficiency")
810 // trackingEff should contain the change in tracking efficiency, i.e. between before and after in the eta-pT plane
814 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
815 SetupRanges(corrected);
817 AliUEHist* ueHist = corrected->GetUEHist(id);
819 Float_t ptLeadMin = -1;
820 Float_t ptLeadMax = -1;
823 // the uncertainty is flat in delta phi, so use this trick to get directly the uncertainty as function of leading pT
829 TH1* before = ueHist->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
832 // the CFStepTriggered step is overwritten here and cannot be used for comparison afterwards anymore
833 ueHist->CorrectTracks(AliUEHist::kCFStepAll, AliUEHist::kCFStepTriggered, (TH1*) 0, 0, -1);
835 // reapply tracking efficiency
836 ueHist->CorrectTracks(AliUEHist::kCFStepTriggered, AliUEHist::kCFStepAll, trackingEff, axis1, axis2);
839 TH1* after = ueHist->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
841 DrawRatio(before, after, name);
842 gPad->GetCanvas()->SaveAs(Form("%s.png", name));
845 void EffectOfTrackCuts(const char* fileNameData, Int_t id, const char* systFile)
849 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
850 effHist = (TH2D*) corrected->GetUEHist(0)->GetTrackingEfficiency()->Clone("effHist");
852 file = TFile::Open(systFile);
855 const char* systNames[] = { "NClusTPC", "Chi2TPC", "SigmaDCA" };
857 for (Int_t i=0; i<maxSyst; i++)
859 for (Int_t j=0; j<2; j++)
862 histName.Form("%s_syst_%s", systNames[i], (j == 0) ? "up" : "down");
863 systEffect = (TH2*) file->Get(histName);
867 for (Int_t x=1; x <= effHist->GetNbinsX(); x++)
868 for (Int_t y=1; y <= effHist->GetNbinsY(); y++)
869 effHist->SetBinContent(x, y, 1);
871 for (Int_t x=1; x <= systEffect->GetNbinsX(); x++)
872 for (Int_t y=1; y <= systEffect->GetNbinsY(); y++)
873 if (systEffect->GetBinContent(x, y) != 0)
874 effHist->SetBinContent(effHist->GetXaxis()->FindBin(systEffect->GetYaxis()->GetBinCenter(y)), effHist->GetYaxis()->FindBin(systEffect->GetXaxis()->GetBinCenter(x)), systEffect->GetBinContent(x, y));
877 //new TCanvas; systEffect->Draw("COLZ"); new TCanvas; effHist->Draw("COLZ");
879 EffectOfModifiedTrackingEfficiency(fileNameData, id, (id == 2) ? 0 : 2, effHist, 0, 1, histName);
886 void ModifyComposition(const char* fileNameData, const char* fileNameCorrections, Int_t id, Bool_t verbose = kFALSE)
890 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
891 SetupRanges(corrected);
893 AliUEHistograms* corrections = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
894 SetupRanges(corrections);
896 ueHistData = (AliUEHist*) corrected->GetUEHist(id);
897 ueHistCorrections = (AliUEHist*) corrections->GetUEHist(id);
900 // the CFStepTriggered step is overwritten here and cannot be used for comparison afterwards anymore
901 ueHistData->CorrectTracks(AliUEHist::kCFStepAll, AliUEHist::kCFStepTriggered, (TH1*) 0, 0);
904 Float_t ptLeadMin = -1;
905 Float_t ptLeadMax = -1;
909 // the uncertainty is flat in delta phi, so use this trick to get directly the uncertainty as function of leading pT
916 for (Int_t region=0; region<maxRegion; region++)
917 before[region] = ueHistData->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
919 //defaultEff = ueHistCorrections->GetTrackingEfficiency();
920 defaultEff = ueHistCorrections->GetTrackingCorrection();
921 //defaultEffpT = ueHistCorrections->GetTrackingEfficiency(1);
922 defaultEffpT = ueHistCorrections->GetTrackingCorrection(1);
923 defaultContainer = ueHistCorrections->GetTrackHistEfficiency();
926 defaultEffpT->Draw("");
928 Float_t largestDeviation[3];
929 for (Int_t i=0; i<maxRegion; i++)
930 largestDeviation[i] = 0;
932 for (Int_t i=0; i<7; i++)
934 // case 0: // default
935 // case 1: // + 30% kaons
936 // case 2: // - 30% kaons
937 // case 3: // + 30% protons
938 // case 4: // - 30% protons
939 // case 5: // + 30% others
940 // case 6: // - 30% others
941 Int_t correctionIndex = (i+1) / 2 + 1; // bin 1 == protons, bin 2 == kaons, ...
942 Double_t scaleFactor = (i % 2 == 1) ? 1.3 : 0.7;
946 newContainer = (AliCFContainer*) defaultContainer->Clone();
948 // modify, change all steps
949 for (Int_t j=0; j<newContainer->GetNStep(); j++)
951 THnSparse* grid = newContainer->GetGrid(j)->GetGrid();
953 for (Int_t binIdx = 0; binIdx < grid->GetNbins(); binIdx++)
956 Double_t value = grid->GetBinContent(binIdx, bins);
957 Double_t error = grid->GetBinError(binIdx);
959 if (bins[2] != correctionIndex)
962 value *= scaleFactor;
963 error *= scaleFactor;
965 grid->SetBinContent(bins, value);
966 grid->SetBinError(bins, error);
970 // put in corrections
971 ueHistCorrections->SetTrackHistEfficiency(newContainer);
974 //modifiedEff = ueHistCorrections->GetTrackingEfficiency();
975 modifiedEff = ueHistCorrections->GetTrackingCorrection();
976 modifiedEff->Divide(modifiedEff, defaultEff);
977 //modifiedEff->Draw("COLZ");
980 //modifiedEffpT = ueHistCorrections->GetTrackingEfficiency(1);
981 modifiedEffpT = ueHistCorrections->GetTrackingCorrection(1);
982 modifiedEffpT->SetLineColor(i+1);
983 modifiedEffpT->Draw("SAME");
985 // apply change in tracking efficiency
986 ueHistData->CorrectTracks(AliUEHist::kCFStepTriggered, AliUEHist::kCFStepAll, modifiedEff, 0, 1);
988 for (Int_t region=0; region<maxRegion; region++)
991 TH1* after = ueHistData->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
994 DrawRatio(before[region], (TH1*) after->Clone(), Form("Region %d Composition %d", region, i));
996 // ratio is flat, extract deviation
997 after->Divide(before[region]);
998 after->Fit("pol0", "0");
999 Float_t deviation = 100.0 - 100.0 * after->GetFunction("pol0")->GetParameter(0);
1000 Printf("Deviation for region %d case %d is %.2f %%", region, i, deviation);
1002 if (TMath::Abs(deviation) > largestDeviation[region])
1003 largestDeviation[region] = TMath::Abs(deviation);
1008 for (Int_t i=0; i<maxRegion; i++)
1009 Printf("Largest deviation in region %d is %f", i, largestDeviation[i]);
1026 if (line.Length() == 0)
1030 fileName.Form("%s/%s/PWG4_JetTasksOutput.root", "maps", line.Data());
1031 Printf("%s", fileName.Data());
1033 m.AddFile(fileName);
1037 m.OutputFile("merged.root");
1041 void MergeList2(const char* listFile, const char* dir, Bool_t onlyPrintEvents = kFALSE, const char* targetDir = "PWG4_LeadingTrackUE")
1048 AliUEHistograms* final = 0;
1049 TList* finalList = 0;
1056 if (line.Length() == 0)
1060 fileName.Form("%s/%s/PWG4_JetTasksOutput.root", dir, line.Data());
1061 Printf("%s", fileName.Data());
1064 AliUEHistograms* obj = (AliUEHistograms*) GetUEHistogram(fileName, &list);
1070 final = (AliUEHistograms*) obj;
1071 //final->GetEventCount()->Draw(); return;
1072 Printf("Events: %d", (Int_t) final->GetEventCount()->ProjectionX()->GetBinContent(4));
1077 additional = (AliUEHistograms*) obj;
1078 Printf("Events: %d", (Int_t) additional->GetEventCount()->ProjectionX()->GetBinContent(4));
1080 if (!onlyPrintEvents)
1083 list2.Add(additional);
1084 final->Merge(&list2);
1091 if (onlyPrintEvents)
1094 Printf("Total events (at step 0): %d", (Int_t) final->GetEventCount()->ProjectionX()->GetBinContent(4));
1096 file3 = TFile::Open("merged.root", "RECREATE");
1097 file3->mkdir(targetDir);
1098 file3->cd(targetDir);
1099 finalList->Write(0, TObject::kSingleKey);
1103 void PlotAll(const char* correctedFile, const char* mcFile)
1109 Float_t range[] = { 1.5, 2 };
1113 Float_t range[] = { 3, 10 };
1116 for (Int_t id=0; id<3; id++)
1119 gForceRange = range[id];
1125 for (Int_t region=0; region<3; region++)
1127 CompareStep(correctedFile, mcFile, id, 0, region);
1128 gPad->GetCanvas()->SaveAs(Form("%s_%s_%d_%d.png", TString(correctedFile).Tokenize(".")->First()->GetName(), TString(mcFile).Tokenize(".")->First()->GetName(), id, region));
1133 Float_t leadingPtArr[] = { 0.50, 2.0, 4.0, 6.0, 10.0, 20.0, 50.0 };
1134 for (Int_t leadingPtID=0; leadingPtID<6; leadingPtID++)
1136 CompareStep(correctedFile, mcFile, id, 0, 0, leadingPtArr[leadingPtID] + 0.01, leadingPtArr[leadingPtID+1] - 0.01);
1137 gPad->GetCanvas()->SaveAs(Form("%s_%s_%d_%.2f_%.2f.png", TString(correctedFile).Tokenize(".")->First()->GetName(), TString(mcFile).Tokenize(".")->First()->GetName(), id, leadingPtArr[leadingPtID], leadingPtArr[leadingPtID+1]));
1144 TGraph* GetFlow2040()
1146 // from first ALICE flow paper (provided by Raimond)
1147 // http://www-library.desy.de/spires/find/hep/www?eprint=arXiv:1011.3914
1149 // centrality 20-30%
1150 Double_t xCumulant4th2030ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1151 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
1152 5.500000,7.000000,9.000000};
1153 Double_t yCumulant4th2030ALICE[] = {0.000000,0.000000,0.030926,0.041076,0.052063,0.059429,0.070500,0.084461,0.086745,0.099254,
1154 0.109691,0.116398,0.130831,0.141959,0.158932,0.169680,0.171387,0.178858,0.171475,0.140358,
1155 0.000000,0.000000,0.000000};
1156 Double_t xErrCumulant4th2030ALICE[23] = {0.};
1157 Double_t yErrCumulant4th2030ALICE[] = {0.000000,0.000000,0.002857,0.003451,0.003567,0.003859,0.004609,0.004976,0.005412,0.006277,
1158 0.004748,0.005808,0.006896,0.007987,0.008683,0.008080,0.013278,0.018413,0.024873,0.026057,
1159 0.000000,0.000000,0.000000};
1160 Int_t nPointsCumulant4th2030ALICE = sizeof(xCumulant4th2030ALICE)/sizeof(Double_t);
1161 TGraphErrors *Cumulant4th2030ALICE = new TGraphErrors(nPointsCumulant4th2030ALICE,xCumulant4th2030ALICE,yCumulant4th2030ALICE,
1162 xErrCumulant4th2030ALICE,yErrCumulant4th2030ALICE);
1163 Cumulant4th2030ALICE->SetMarkerStyle(kFullSquare);
1164 Cumulant4th2030ALICE->SetMarkerColor(kRed);
1165 Cumulant4th2030ALICE->SetMarkerSize(1.2);
1166 Cumulant4th2030ALICE->SetFillStyle(1001);
1167 Cumulant4th2030ALICE->SetFillColor(kRed-10);
1169 //===================================================================================================================
1170 // centrality 30-40%
1171 Double_t xCumulant4th3040ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1172 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
1173 5.500000,7.000000,9.000000};
1174 Double_t yCumulant4th3040ALICE[] = {0.000000,0.000000,0.037071,0.048566,0.061083,0.070910,0.078831,0.091396,0.102026,0.109691,
1175 0.124449,0.139819,0.155561,0.165701,0.173678,0.191149,0.202015,0.204540,0.212560,0.195885,
1176 0.000000,0.000000,0.000000};
1177 Double_t xErrCumulant4th3040ALICE[23] = {0.};
1178 Double_t yErrCumulant4th3040ALICE[] = {0.000000,0.000000,0.002992,0.003364,0.003669,0.003931,0.004698,0.005261,0.005446,0.006151,
1179 0.004980,0.005741,0.007198,0.008576,0.010868,0.009926,0.015269,0.020691,0.027601,0.031834,
1180 0.000000,0.000000,0.000000};
1181 Int_t nPointsCumulant4th3040ALICE = sizeof(xCumulant4th3040ALICE)/sizeof(Double_t);
1182 TGraphErrors *Cumulant4th3040ALICE = new TGraphErrors(nPointsCumulant4th3040ALICE,xCumulant4th3040ALICE,yCumulant4th3040ALICE,
1183 xErrCumulant4th3040ALICE,yErrCumulant4th3040ALICE);
1184 Cumulant4th3040ALICE->SetMarkerStyle(kFullTriangleUp);
1185 Cumulant4th3040ALICE->SetMarkerColor(kGreen+2);
1186 Cumulant4th3040ALICE->SetMarkerSize(1.2);
1187 Cumulant4th3040ALICE->SetFillStyle(1001);
1188 Cumulant4th3040ALICE->SetFillColor(kGreen+2);
1190 // build average between the two (for class 20-40%)
1191 Double_t* yAverage = new Double_t[nPointsCumulant4th3040ALICE];
1192 for (Int_t i=0; i<nPointsCumulant4th3040ALICE; i++)
1193 yAverage[i] = (yCumulant4th2030ALICE[i] + yCumulant4th3040ALICE[i]) / 2;
1195 // assume flow constant above highest pT; not neccessarily physically sound ;)
1198 yAverage[20] = yAverage[19];
1199 xCumulant4th3040ALICE[20] = 100;
1200 nPointsCumulant4th3040ALICE -= 2;
1203 TGraph *flow2040 = new TGraph(nPointsCumulant4th3040ALICE,xCumulant4th3040ALICE,yAverage);
1207 flow2040->Draw("*A");
1208 Cumulant4th2030ALICE->Draw("PSAME");
1209 Cumulant4th3040ALICE->Draw("PSAME");
1217 TGraph* GetFlow1020()
1219 // from first ALICE flow paper (provided by Raimond)
1220 // http://www-library.desy.de/spires/find/hep/www?eprint=arXiv:1011.3914
1222 //===================================================================================================================
1223 // centrality 10-20%
1224 Double_t xCumulant4th1020ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1225 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
1226 5.500000,7.000000,9.000000};
1227 Double_t yCumulant4th1020ALICE[] = {0.000000,0.000000,0.024075,0.031505,0.040413,0.044981,0.055358,0.060563,0.063378,0.070030,
1228 0.082692,0.091611,0.099641,0.107223,0.122376,0.131240,0.137425,0.146050,0.131365,0.124708,
1229 0.000000,0.000000,0.000000};
1230 Double_t xErrCumulant4th1020ALICE[23] = {0.};
1231 Double_t yErrCumulant4th1020ALICE[] = {0.000000,0.000000,0.002413,0.002931,0.003444,0.003950,0.004338,0.004835,0.005059,0.005586,
1232 0.004521,0.005278,0.005999,0.007072,0.008260,0.007279,0.011897,0.017409,0.023995,0.025701,
1233 0.000000,0.000000,0.000000};
1234 Int_t nPointsCumulant4th1020ALICE = sizeof(xCumulant4th1020ALICE)/sizeof(Double_t);
1236 // assume flow constant above highest pT; not neccessarily physically sound ;)
1239 yCumulant4th1020ALICE[20] = yCumulant4th1020ALICE[19];
1240 xCumulant4th1020ALICE[20] = 100;
1241 nPointsCumulant4th1020ALICE -= 2;
1244 TGraphErrors *Cumulant4th1020ALICE = new TGraphErrors(nPointsCumulant4th1020ALICE,xCumulant4th1020ALICE,yCumulant4th1020ALICE,
1245 xErrCumulant4th1020ALICE,yErrCumulant4th1020ALICE);
1247 Cumulant4th1020ALICE->SetMarkerStyle(kFullCircle);
1248 Cumulant4th1020ALICE->SetMarkerColor(kBlue);
1249 Cumulant4th1020ALICE->SetMarkerSize(1.2);
1250 Cumulant4th1020ALICE->SetFillStyle(1001);
1251 Cumulant4th1020ALICE->SetFillColor(kBlue-10);
1253 TGraph *flow1020 = new TGraph(nPointsCumulant4th1020ALICE,xCumulant4th1020ALICE,yCumulant4th1020ALICE);
1257 flow1020->Draw("*A");
1258 Cumulant4th1020ALICE->Draw("PSAME");
1268 // takes flow measurement from 10-20% and scales by a factor extracted from Fig.3 in the ALICE flow paper
1269 // factor = integrated flow in 0-5% / integrated flow in 10-20%
1271 graph = GetFlow1020();
1272 for (Int_t i=0; i<graph->GetN(); i++)
1273 graph->GetY()[i] *= 0.016 / 0.055;
1279 TGraphErrors* GetFlow02(Int_t n)
1281 // private communication 28.01.11, Ante B. / Raimond
1286 Double_t xCumulant2nd0002ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1287 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1288 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
1290 Double_t yCumulant2nd0002ALICE_v2[] = {0.000000,0.000000,0.012173,0.015186,0.018580,0.021114,0.024646,0.027040,0.030269,0.032677,
1291 0.035332,0.037382,0.039228,0.040614,0.042460,0.044658,0.046246,0.050392,0.051436,0.054669,
1292 0.057330,0.063439,0.067425,0.060144,0.071260,0.070206,0.000000,0.000000,0.000000,0.000000,
1294 Double_t xErrCumulant2nd0002ALICE_v2[31] = {0.};
1295 Double_t yErrCumulant2nd0002ALICE_v2[] = {0.000000,0.000000,0.000256,0.000259,0.000271,0.000296,0.000322,0.000357,0.000397,0.000438,
1296 0.000483,0.000529,0.000590,0.000639,0.000713,0.000793,0.000877,0.000976,0.001070,0.001197,
1297 0.000725,0.001265,0.002069,0.003156,0.004605,0.006543,0.000000,0.000000,0.000000,0.000000,
1299 Int_t nPointsCumulant2nd0002ALICE_v2 = sizeof(xCumulant2nd0002ALICE_v2)/sizeof(Double_t);
1300 TGraphErrors *Cumulant2nd0002ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v2,xCumulant2nd0002ALICE_v2,yCumulant2nd0002ALICE_v2,
1301 xErrCumulant2nd0002ALICE_v2,yErrCumulant2nd0002ALICE_v2);
1302 Cumulant2nd0002ALICE_v2->SetMarkerStyle(kFullCircle);
1303 Cumulant2nd0002ALICE_v2->SetMarkerColor(kBlue);
1305 return Cumulant2nd0002ALICE_v2;
1311 Double_t xCumulant2nd0002ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1312 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1313 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
1315 Double_t yCumulant2nd0002ALICE_v3[] = {0.000000,0.000000,0.007696,0.008994,0.010544,0.013269,0.016330,0.019234,0.023465,0.026803,
1316 0.029906,0.032211,0.035300,0.038158,0.041861,0.046002,0.049382,0.053574,0.055773,0.059420,
1317 0.069373,0.079922,0.090265,0.103583,0.111358,0.090740,0.000000,0.000000,0.000000,0.000000,
1319 Double_t xErrCumulant2nd0002ALICE_v3[31] = {0.};
1320 Double_t yErrCumulant2nd0002ALICE_v3[] = {0.000000,0.000000,0.000318,0.000317,0.000333,0.000360,0.000392,0.000431,0.000476,0.000523,
1321 0.000575,0.000637,0.000707,0.000785,0.000878,0.000964,0.001064,0.001175,0.001320,0.001459,
1322 0.000889,0.001539,0.002530,0.003826,0.005614,0.007892,0.000000,0.000000,0.000000,0.000000,
1324 Int_t nPointsCumulant2nd0002ALICE_v3 = sizeof(xCumulant2nd0002ALICE_v3)/sizeof(Double_t);
1325 TGraphErrors *Cumulant2nd0002ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v3,xCumulant2nd0002ALICE_v3,yCumulant2nd0002ALICE_v3,
1326 xErrCumulant2nd0002ALICE_v3,yErrCumulant2nd0002ALICE_v3);
1327 Cumulant2nd0002ALICE_v3->SetMarkerStyle(kFullTriangleUp);
1328 Cumulant2nd0002ALICE_v3->SetMarkerSize(1.2);
1329 Cumulant2nd0002ALICE_v3->SetMarkerColor(kGreen+2);
1331 return Cumulant2nd0002ALICE_v3;
1337 Double_t xCumulant2nd0002ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1338 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1339 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
1341 Double_t yCumulant2nd0002ALICE_v4[] = {0.000000,0.000000,0.005710,0.006014,0.004483,0.005453,0.007714,0.006837,0.009721,0.011288,
1342 0.012531,0.016461,0.016606,0.018587,0.022722,0.025497,0.025832,0.030994,0.030349,0.034730,
1343 0.045529,0.061153,0.074238,0.079307,0.088885,0.085218,0.000000,0.000000,0.000000,0.000000,
1345 Double_t xErrCumulant2nd0002ALICE_v4[31] = {0.};
1346 Double_t yErrCumulant2nd0002ALICE_v4[] = {0.000000,0.000000,0.000488,0.000493,0.000523,0.000571,0.000609,0.000678,0.000742,0.000805,
1347 0.000903,0.000985,0.001100,0.001219,0.001352,0.001503,0.001682,0.001847,0.002060,0.002303,
1348 0.001400,0.002431,0.003974,0.006040,0.008901,0.012343,0.000000,0.000000,0.000000,0.000000,
1350 Int_t nPointsCumulant2nd0002ALICE_v4 = sizeof(xCumulant2nd0002ALICE_v4)/sizeof(Double_t);
1351 TGraphErrors *Cumulant2nd0002ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v4,xCumulant2nd0002ALICE_v4,yCumulant2nd0002ALICE_v4,
1352 xErrCumulant2nd0002ALICE_v4,yErrCumulant2nd0002ALICE_v4);
1353 Cumulant2nd0002ALICE_v4->SetMarkerStyle(kFullSquare);
1354 Cumulant2nd0002ALICE_v4->SetMarkerColor(kRed);
1356 return Cumulant2nd0002ALICE_v4;
1362 /* results up to 5 GeV/c
1364 TGraphErrors* GetFlow05(Int_t n)
1366 // private communication 02.02.11, Ante B. / Raimond
1370 // v2{2}(pt) for 0-5%:
1371 Double_t xCumulant2nd0005ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1372 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1373 Double_t yCumulant2nd0005ALICE_v2[] = {0.000000,0.000000,0.013891,0.017693,0.021693,0.025323,0.029131,0.032443,0.035781,0.038256,
1374 0.042801,0.047705,0.053229,0.057387,0.062677,0.068815,0.077695,0.082058,0.082511,0.079791};
1375 Double_t xErrCumulant2nd0005ALICE_v2[20] = {0.};
1376 Double_t yErrCumulant2nd0005ALICE_v2[] = {0.000000,0.000000,0.000149,0.000150,0.000160,0.000174,0.000191,0.000211,0.000233,0.000257,
1377 0.000208,0.000254,0.000311,0.000377,0.000464,0.000419,0.000726,0.001180,0.001791,0.002131};
1378 Int_t nPointsCumulant2nd0005ALICE_v2 = sizeof(xCumulant2nd0005ALICE_v2)/sizeof(Double_t);
1379 TGraphErrors *Cumulant2nd0005ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v2,xCumulant2nd0005ALICE_v2,yCumulant2nd0005ALICE_v2,
1380 xErrCumulant2nd0005ALICE_v2,yErrCumulant2nd0005ALICE_v2);
1381 Cumulant2nd0005ALICE_v2->SetMarkerStyle(kFullCircle);
1382 Cumulant2nd0005ALICE_v2->SetMarkerColor(kBlue);
1384 return Cumulant2nd0005ALICE_v2;
1389 // v3{2}(pt) for 0-5%:
1390 Double_t xCumulant2nd0005ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1391 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1392 Double_t yCumulant2nd0005ALICE_v3[] = {0.000000,0.000000,0.007788,0.009472,0.011596,0.014618,0.017540,0.021020,0.024946,0.028004,
1393 0.032330,0.039491,0.046368,0.053620,0.060662,0.071750,0.086746,0.097857,0.103111,0.104796};
1394 Double_t xErrCumulant2nd0005ALICE_v3[20] = {0.};
1395 Double_t yErrCumulant2nd0005ALICE_v3[] = {0.000000,0.000000,0.000194,0.000192,0.000204,0.000221,0.000241,0.000265,0.000293,0.000323,
1396 0.000266,0.000323,0.000397,0.000486,0.000601,0.000545,0.000947,0.001541,0.002328,0.002777};
1397 Int_t nPointsCumulant2nd0005ALICE_v3 = sizeof(xCumulant2nd0005ALICE_v3)/sizeof(Double_t);
1398 TGraphErrors *Cumulant2nd0005ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v3,xCumulant2nd0005ALICE_v3,yCumulant2nd0005ALICE_v3,
1399 xErrCumulant2nd0005ALICE_v3,yErrCumulant2nd0005ALICE_v3);
1400 Cumulant2nd0005ALICE_v3->SetMarkerStyle(kFullCircle);
1401 Cumulant2nd0005ALICE_v3->SetMarkerColor(kBlue);
1403 return Cumulant2nd0005ALICE_v3;
1408 // v4{2}(pt) for 0-5%:
1409 Double_t xCumulant2nd0005ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1410 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1411 Double_t yCumulant2nd0005ALICE_v4[] = {0.000000,0.000000,0.006121,0.006137,0.005598,0.005956,0.007262,0.007991,0.009159,0.012062,
1412 0.015085,0.019225,0.024782,0.030092,0.035708,0.046542,0.060077,0.076088,0.082964,0.085405};
1413 Double_t xErrCumulant2nd0005ALICE_v4[20] = {0.};
1414 Double_t yErrCumulant2nd0005ALICE_v4[] = {0.000000,0.000000,0.000275,0.000278,0.000294,0.000319,0.000346,0.000380,0.000419,0.000459,
1415 0.000378,0.000460,0.000570,0.000700,0.000865,0.000789,0.001370,0.002227,0.003370,0.004018};
1416 Int_t nPointsCumulant2nd0005ALICE_v4 = sizeof(xCumulant2nd0005ALICE_v4)/sizeof(Double_t);
1417 TGraphErrors *Cumulant2nd0005ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v4,xCumulant2nd0005ALICE_v4,yCumulant2nd0005ALICE_v4,
1418 xErrCumulant2nd0005ALICE_v4,yErrCumulant2nd0005ALICE_v4);
1419 Cumulant2nd0005ALICE_v4->SetMarkerStyle(kFullCircle);
1420 Cumulant2nd0005ALICE_v4->SetMarkerColor(kBlue);
1422 return Cumulant2nd0005ALICE_v4;
1428 TGraphErrors* GetFlow510(Int_t n)
1430 // private communication 02.02.11, Ante B. / Raimond
1434 // v2{2}(pt) for 5-10%:
1435 Double_t xCumulant2nd0510ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1436 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1437 Double_t yCumulant2nd0510ALICE_v2[] = {0.000000,0.000000,0.019872,0.026451,0.032901,0.039085,0.044930,0.050200,0.054887,0.060253,
1438 0.066587,0.075080,0.083303,0.090298,0.098782,0.109632,0.124486,0.129621,0.132076,0.120697};
1439 Double_t xErrCumulant2nd0510ALICE_v2[20] = {0.};
1440 Double_t yErrCumulant2nd0510ALICE_v2[] = {0.000000,0.000000,0.000150,0.000152,0.000163,0.000178,0.000196,0.000215,0.000237,0.000261,
1441 0.000213,0.000256,0.000313,0.000381,0.000468,0.000423,0.000727,0.001157,0.001741,0.002064};
1442 Int_t nPointsCumulant2nd0510ALICE_v2 = sizeof(xCumulant2nd0510ALICE_v2)/sizeof(Double_t);
1443 TGraphErrors *Cumulant2nd0510ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v2,xCumulant2nd0510ALICE_v2,yCumulant2nd0510ALICE_v2,
1444 xErrCumulant2nd0510ALICE_v2,yErrCumulant2nd0510ALICE_v2);
1445 Cumulant2nd0510ALICE_v2->SetMarkerStyle(kOpenCircle);
1446 Cumulant2nd0510ALICE_v2->SetMarkerColor(kBlue);
1448 return Cumulant2nd0510ALICE_v2;
1453 // v3{2}(pt) for 5-10%:
1454 Double_t xCumulant2nd0510ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1455 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1456 Double_t yCumulant2nd0510ALICE_v3[] = {0.000000,0.000000,0.008596,0.010700,0.013820,0.017524,0.021507,0.024316,0.028491,0.032880,
1457 0.038741,0.045830,0.052486,0.059560,0.067990,0.081006,0.097402,0.107050,0.111743,0.116434};
1458 Double_t xErrCumulant2nd0510ALICE_v3[20] = {0.};
1459 Double_t yErrCumulant2nd0510ALICE_v3[] = {0.000000,0.000000,0.000208,0.000207,0.000218,0.000235,0.000258,0.000284,0.000314,0.000347,
1460 0.000285,0.000345,0.000426,0.000521,0.000642,0.000586,0.001008,0.001611,0.002421,0.002853};
1461 Int_t nPointsCumulant2nd0510ALICE_v3 = sizeof(xCumulant2nd0510ALICE_v3)/sizeof(Double_t);
1462 TGraphErrors *Cumulant2nd0510ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v3,xCumulant2nd0510ALICE_v3,yCumulant2nd0510ALICE_v3,
1463 xErrCumulant2nd0510ALICE_v3,yErrCumulant2nd0510ALICE_v3);
1464 Cumulant2nd0510ALICE_v3->SetMarkerStyle(kOpenCircle);
1465 Cumulant2nd0510ALICE_v3->SetMarkerColor(kBlue);
1467 return Cumulant2nd0510ALICE_v3;
1472 // v4{2}(pt) for 5-10%:
1473 Double_t xCumulant2nd0510ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1474 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1475 Double_t yCumulant2nd0510ALICE_v4[] = {0.000000,0.000000,0.006466,0.006731,0.006344,0.007374,0.008775,0.010324,0.012323,0.014533,
1476 0.017261,0.022507,0.028776,0.035403,0.041936,0.051491,0.070340,0.080081,0.095077,0.088526};
1477 Double_t xErrCumulant2nd0510ALICE_v4[20] = {0.};
1478 Double_t yErrCumulant2nd0510ALICE_v4[] = {0.000000,0.000000,0.000292,0.000295,0.000312,0.000336,0.000366,0.000403,0.000443,0.000485,
1479 0.000399,0.000486,0.000603,0.000738,0.000914,0.000836,0.001443,0.002303,0.003448,0.004078};
1480 Int_t nPointsCumulant2nd0510ALICE_v4 = sizeof(xCumulant2nd0510ALICE_v4)/sizeof(Double_t);
1481 TGraphErrors *Cumulant2nd0510ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v4,xCumulant2nd0510ALICE_v4,yCumulant2nd0510ALICE_v4,
1482 xErrCumulant2nd0510ALICE_v4,yErrCumulant2nd0510ALICE_v4);
1483 Cumulant2nd0510ALICE_v4->SetMarkerStyle(kOpenCircle);
1484 Cumulant2nd0510ALICE_v4->SetMarkerColor(kBlue);
1486 return Cumulant2nd0510ALICE_v4;
1492 TGraphErrors* GetFlow1020(Int_t n)
1494 // private communication 02.02.11, Ante B. / Raimond
1498 // v2{2}(pt) for 10-20%:
1499 Double_t xCumulant2nd1020ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1500 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1501 Double_t yCumulant2nd1020ALICE_v2[] = {0.000000,0.000000,0.027683,0.037083,0.046511,0.055519,0.063979,0.071626,0.078537,0.085975,
1502 0.095001,0.106979,0.118456,0.129721,0.140641,0.155161,0.173402,0.179870,0.180616,0.168921};
1503 Double_t xErrCumulant2nd1020ALICE_v2[20] = {0.};
1504 Double_t yErrCumulant2nd1020ALICE_v2[] = {0.000000,0.000000,0.000121,0.000124,0.000134,0.000147,0.000163,0.000179,0.000198,0.000217,
1505 0.000177,0.000212,0.000257,0.000311,0.000380,0.000341,0.000569,0.000882,0.001309,0.001537};
1506 Int_t nPointsCumulant2nd1020ALICE_v2 = sizeof(xCumulant2nd1020ALICE_v2)/sizeof(Double_t);
1507 TGraphErrors *Cumulant2nd1020ALICE_v2 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v2,xCumulant2nd1020ALICE_v2,yCumulant2nd1020ALICE_v2,
1508 xErrCumulant2nd1020ALICE_v2,yErrCumulant2nd1020ALICE_v2);
1509 Cumulant2nd1020ALICE_v2->SetMarkerStyle(kFullSquare);
1510 Cumulant2nd1020ALICE_v2->SetMarkerColor(kRed);
1512 return Cumulant2nd1020ALICE_v2;
1517 // v3{2}(pt) for 10-20%:
1518 Double_t xCumulant2nd1020ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1519 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1520 Double_t yCumulant2nd1020ALICE_v3[] = {0.000000,0.000000,0.009830,0.012858,0.016111,0.020120,0.023948,0.028349,0.032741,0.037244,
1521 0.043385,0.051803,0.059374,0.068686,0.076763,0.090151,0.106530,0.117448,0.121383,0.118247};
1522 Double_t xErrCumulant2nd1020ALICE_v3[20] = {0.};
1523 Double_t yErrCumulant2nd1020ALICE_v3[] = {0.000000,0.000000,0.000171,0.000170,0.000180,0.000195,0.000215,0.000236,0.000261,0.000287,
1524 0.000236,0.000288,0.000353,0.000434,0.000536,0.000488,0.000823,0.001277,0.001892,0.002224};
1525 Int_t nPointsCumulant2nd1020ALICE_v3 = sizeof(xCumulant2nd1020ALICE_v3)/sizeof(Double_t);
1526 TGraphErrors *Cumulant2nd1020ALICE_v3 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v3,xCumulant2nd1020ALICE_v3,yCumulant2nd1020ALICE_v3,
1527 xErrCumulant2nd1020ALICE_v3,yErrCumulant2nd1020ALICE_v3);
1528 Cumulant2nd1020ALICE_v3->SetMarkerStyle(kFullSquare);
1529 Cumulant2nd1020ALICE_v3->SetMarkerColor(kRed);
1531 return Cumulant2nd1020ALICE_v3;
1536 // v4{2}(pt) for 10-20%:
1537 Double_t xCumulant2nd1020ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1538 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1539 Double_t yCumulant2nd1020ALICE_v4[] = {0.000000,0.000000,0.007423,0.007647,0.008189,0.008592,0.009489,0.011671,0.013739,0.017199,
1540 0.020084,0.026004,0.031843,0.038388,0.047357,0.057251,0.072433,0.086326,0.094282,0.097432};
1541 Double_t xErrCumulant2nd1020ALICE_v4[20] = {0.};
1542 Double_t yErrCumulant2nd1020ALICE_v4[] = {0.000000,0.000000,0.000243,0.000244,0.000257,0.000279,0.000306,0.000335,0.000368,0.000405,
1543 0.000333,0.000406,0.000502,0.000618,0.000770,0.000701,0.001185,0.001845,0.002730,0.003193};
1544 Int_t nPointsCumulant2nd1020ALICE_v4 = sizeof(xCumulant2nd1020ALICE_v4)/sizeof(Double_t);
1545 TGraphErrors *Cumulant2nd1020ALICE_v4 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v4,xCumulant2nd1020ALICE_v4,yCumulant2nd1020ALICE_v4,
1546 xErrCumulant2nd1020ALICE_v4,yErrCumulant2nd1020ALICE_v4);
1547 Cumulant2nd1020ALICE_v4->SetMarkerStyle(kFullSquare);
1548 Cumulant2nd1020ALICE_v4->SetMarkerColor(kRed);
1550 return Cumulant2nd1020ALICE_v4;
1556 TGraphErrors* GetFlow2030(Int_t n)
1558 // private communication 02.02.11, Ante B. / Raimond
1562 Double_t xCumulant2nd2030ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1563 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1564 Double_t yCumulant2nd2030ALICE_v2[] = {0.000000,0.000000,0.035557,0.048064,0.060768,0.072585,0.083808,0.093772,0.103310,0.112602,
1565 0.124846,0.140603,0.155345,0.169450,0.183077,0.200173,0.219693,0.225741,0.223318,0.207356};
1566 Double_t xErrCumulant2nd2030ALICE_v2[20] = {0.};
1567 Double_t yErrCumulant2nd2030ALICE_v2[] = {0.000000,0.000000,0.000144,0.000147,0.000159,0.000175,0.000194,0.000214,0.000235,0.000259,
1568 0.000211,0.000254,0.000310,0.000377,0.000464,0.000418,0.000677,0.001027,0.001513,0.001761};
1569 Int_t nPointsCumulant2nd2030ALICE_v2 = sizeof(xCumulant2nd2030ALICE_v2)/sizeof(Double_t);
1570 TGraphErrors *Cumulant2nd2030ALICE_v2 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v2,xCumulant2nd2030ALICE_v2,yCumulant2nd2030ALICE_v2,
1571 xErrCumulant2nd2030ALICE_v2,yErrCumulant2nd2030ALICE_v2);
1572 Cumulant2nd2030ALICE_v2->SetMarkerStyle(kOpenSquare);
1573 Cumulant2nd2030ALICE_v2->SetMarkerColor(kRed);
1575 return Cumulant2nd2030ALICE_v2;
1580 // v3{2}(pt) for 20-30%:
1581 Double_t xCumulant2nd2030ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1582 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1583 Double_t yCumulant2nd2030ALICE_v3[] = {0.000000,0.000000,0.011287,0.014937,0.018479,0.022962,0.027854,0.031938,0.037038,0.041443,
1584 0.049872,0.058720,0.068353,0.077692,0.087859,0.099863,0.116141,0.124486,0.124786,0.119520};
1585 Double_t xErrCumulant2nd2030ALICE_v3[20] = {0.};
1586 Double_t yErrCumulant2nd2030ALICE_v3[] = {0.000000,0.000000,0.000215,0.000216,0.000228,0.000248,0.000272,0.000300,0.000332,0.000366,
1587 0.000301,0.000369,0.000456,0.000561,0.000700,0.000636,0.001038,0.001574,0.002307,0.002676};
1588 Int_t nPointsCumulant2nd2030ALICE_v3 = sizeof(xCumulant2nd2030ALICE_v3)/sizeof(Double_t);
1589 TGraphErrors *Cumulant2nd2030ALICE_v3 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v3,xCumulant2nd2030ALICE_v3,yCumulant2nd2030ALICE_v3,
1590 xErrCumulant2nd2030ALICE_v3,yErrCumulant2nd2030ALICE_v3);
1591 Cumulant2nd2030ALICE_v3->SetMarkerStyle(kOpenSquare);
1592 Cumulant2nd2030ALICE_v3->SetMarkerColor(kRed);
1594 return Cumulant2nd2030ALICE_v3;
1599 // v4{2}(pt) for 20-30%:
1600 Double_t xCumulant2nd2030ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1601 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1602 Double_t yCumulant2nd2030ALICE_v4[] = {0.000000,0.000000,0.008435,0.009824,0.009387,0.010408,0.011458,0.013770,0.016335,0.019165,
1603 0.023770,0.030071,0.036231,0.043950,0.051803,0.065222,0.082155,0.091864,0.105061,0.105167};
1604 Double_t xErrCumulant2nd2030ALICE_v4[20] = {0.};
1605 Double_t yErrCumulant2nd2030ALICE_v4[] = {0.000000,0.000000,0.000308,0.000308,0.000328,0.000355,0.000391,0.000430,0.000473,0.000524,
1606 0.000430,0.000524,0.000652,0.000807,0.001006,0.000919,0.001502,0.002277,0.003339,0.003871};
1607 Int_t nPointsCumulant2nd2030ALICE_v4 = sizeof(xCumulant2nd2030ALICE_v4)/sizeof(Double_t);
1608 TGraphErrors *Cumulant2nd2030ALICE_v4 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v4,xCumulant2nd2030ALICE_v4,yCumulant2nd2030ALICE_v4,
1609 xErrCumulant2nd2030ALICE_v4,yErrCumulant2nd2030ALICE_v4);
1610 Cumulant2nd2030ALICE_v4->SetMarkerStyle(kOpenSquare);
1611 Cumulant2nd2030ALICE_v4->SetMarkerColor(kRed);
1613 return Cumulant2nd2030ALICE_v4;
1619 TGraphErrors* GetFlow3040(Int_t n)
1621 // private communication 02.02.11, Ante B. / Raimond
1625 // v2{2}(pt) for 30-40%:
1626 Double_t xCumulant2nd3040ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1627 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1628 Double_t yCumulant2nd3040ALICE_v2[] = {0.000000,0.000000,0.040797,0.055427,0.070543,0.084024,0.096562,0.109411,0.119853,0.130964,
1629 0.145377,0.163806,0.179825,0.196178,0.210377,0.226556,0.245686,0.247898,0.240058,0.225011};
1630 Double_t xErrCumulant2nd3040ALICE_v2[20] = {0.};
1631 Double_t yErrCumulant2nd3040ALICE_v2[] = {0.000000,0.000000,0.000177,0.000182,0.000197,0.000216,0.000239,0.000265,0.000293,0.000325,
1632 0.000266,0.000321,0.000395,0.000486,0.000603,0.000536,0.000840,0.001258,0.001843,0.002118};
1633 Int_t nPointsCumulant2nd3040ALICE_v2 = sizeof(xCumulant2nd3040ALICE_v2)/sizeof(Double_t);
1634 TGraphErrors *Cumulant2nd3040ALICE_v2 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v2,xCumulant2nd3040ALICE_v2,yCumulant2nd3040ALICE_v2,
1635 xErrCumulant2nd3040ALICE_v2,yErrCumulant2nd3040ALICE_v2);
1636 Cumulant2nd3040ALICE_v2->SetMarkerStyle(kFullTriangleUp);
1637 Cumulant2nd3040ALICE_v2->SetMarkerSize(1.2);
1638 Cumulant2nd3040ALICE_v2->SetMarkerColor(kGreen+2);
1640 return Cumulant2nd3040ALICE_v2;
1645 // v3{2}(pt) for 30-40%:
1646 Double_t xCumulant2nd3040ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1647 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1648 Double_t yCumulant2nd3040ALICE_v3[] = {0.000000,0.000000,0.012226,0.016391,0.020792,0.026208,0.030380,0.035710,0.041025,0.047062,
1649 0.053075,0.064201,0.074116,0.085314,0.094391,0.106819,0.124012,0.129388,0.134315,0.132330};
1650 Double_t xErrCumulant2nd3040ALICE_v3[20] = {0.};
1651 Double_t yErrCumulant2nd3040ALICE_v3[] = {0.000000,0.000000,0.000284,0.000286,0.000303,0.000329,0.000364,0.000403,0.000443,0.000492,
1652 0.000408,0.000500,0.000627,0.000778,0.000973,0.000874,0.001375,0.002050,0.002992,0.003438};
1653 Int_t nPointsCumulant2nd3040ALICE_v3 = sizeof(xCumulant2nd3040ALICE_v3)/sizeof(Double_t);
1654 TGraphErrors *Cumulant2nd3040ALICE_v3 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v3,xCumulant2nd3040ALICE_v3,yCumulant2nd3040ALICE_v3,
1655 xErrCumulant2nd3040ALICE_v3,yErrCumulant2nd3040ALICE_v3);
1656 Cumulant2nd3040ALICE_v3->SetMarkerStyle(kFullTriangleUp);
1657 Cumulant2nd3040ALICE_v3->SetMarkerSize(1.2);
1658 Cumulant2nd3040ALICE_v3->SetMarkerColor(kGreen+2);
1660 return Cumulant2nd3040ALICE_v3;
1665 // v4{2}(pt) for 30-40%:
1666 Double_t xCumulant2nd3040ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1667 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1668 Double_t yCumulant2nd3040ALICE_v4[] = {0.000000,0.000000,0.010718,0.011490,0.010994,0.012527,0.013748,0.016425,0.018857,0.021622,
1669 0.026853,0.034636,0.042651,0.049892,0.057795,0.070865,0.088486,0.101656,0.113886,0.118202};
1670 Double_t xErrCumulant2nd3040ALICE_v4[20] = {0.};
1671 Double_t yErrCumulant2nd3040ALICE_v4[] = {0.000000,0.000000,0.000401,0.000406,0.000433,0.000472,0.000521,0.000575,0.000634,0.000704,
1672 0.000580,0.000714,0.000890,0.001114,0.001398,0.001253,0.001974,0.002945,0.004290,0.004909};
1673 Int_t nPointsCumulant2nd3040ALICE_v4 = sizeof(xCumulant2nd3040ALICE_v4)/sizeof(Double_t);
1674 TGraphErrors *Cumulant2nd3040ALICE_v4 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v4,xCumulant2nd3040ALICE_v4,yCumulant2nd3040ALICE_v4,
1675 xErrCumulant2nd3040ALICE_v4,yErrCumulant2nd3040ALICE_v4);
1676 Cumulant2nd3040ALICE_v4->SetMarkerStyle(kFullTriangleUp);
1677 Cumulant2nd3040ALICE_v4->SetMarkerSize(1.2);
1678 Cumulant2nd3040ALICE_v4->SetMarkerColor(kGreen+2);
1680 return Cumulant2nd3040ALICE_v4;
1686 TGraphErrors* GetFlow4050(Int_t n)
1688 // private communication 02.02.11, Ante B. / Raimond
1692 // v2{2}(pt) for 40-50%:
1693 Double_t xCumulant2nd4050ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1694 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1695 Double_t yCumulant2nd4050ALICE_v2[] = {0.000000,0.000000,0.043593,0.059522,0.075558,0.090681,0.104453,0.117913,0.129349,0.141743,
1696 0.157076,0.176121,0.193651,0.208844,0.222402,0.238407,0.252512,0.253592,0.243571,0.233018};
1697 Double_t xErrCumulant2nd4050ALICE_v2[20] = {0.};
1698 Double_t yErrCumulant2nd4050ALICE_v2[] = {0.000000,0.000000,0.000234,0.000241,0.000261,0.000288,0.000322,0.000357,0.000395,0.000438,
1699 0.000362,0.000447,0.000555,0.000685,0.000846,0.000733,0.001121,0.001665,0.002433,0.002768};
1700 Int_t nPointsCumulant2nd4050ALICE_v2 = sizeof(xCumulant2nd4050ALICE_v2)/sizeof(Double_t);
1701 TGraphErrors *Cumulant2nd4050ALICE_v2 = new TGraphErrors(nPointsCumulant2nd4050ALICE_v2,xCumulant2nd4050ALICE_v2,yCumulant2nd4050ALICE_v2,
1702 xErrCumulant2nd4050ALICE_v2,yErrCumulant2nd4050ALICE_v2);
1703 Cumulant2nd4050ALICE_v2->SetMarkerStyle(kOpenTriangleUp);
1704 Cumulant2nd4050ALICE_v2->SetMarkerSize(1.2);
1705 Cumulant2nd4050ALICE_v2->SetMarkerColor(kGreen+2);
1707 return Cumulant2nd4050ALICE_v2;
1714 // results up to high pT
1716 TGraphErrors* GetFlow05(Int_t n)
1718 // private communication 09.03.11, Ante B. / Raimond
1722 // v2{2}(pt) for 0-5%:
1723 Double_t xCumulant2nd0005ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1724 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1725 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
1726 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
1727 Double_t yCumulant2nd0005ALICE[] = {0.000000,0.000000,0.018169,0.020988,0.024899,0.028309,0.031974,0.035188,0.038218,0.041202,
1728 0.043910,0.046560,0.048183,0.050640,0.052874,0.055334,0.056948,0.059427,0.061540,0.063218,
1729 0.065452,0.069222,0.072578,0.074723,0.077749,0.077178,0.080514,0.075325,0.077692,0.079710,
1730 0.073280,0.063849,0.068274,0.066045,0.071496,0.104352,0.091646,0.050220,0.124185,0.088535};
1731 Double_t xErrCumulant2nd0005ALICE[40] = {0.};
1732 Double_t yErrCumulant2nd0005ALICE[] = {0.000000,0.000000,0.000190,0.000191,0.000199,0.000212,0.000230,0.000248,0.000268,0.000293,
1733 0.000319,0.000346,0.000379,0.000418,0.000459,0.000502,0.000554,0.000614,0.000674,0.000749,
1734 0.000620,0.000769,0.000958,0.001182,0.001446,0.001331,0.001858,0.002552,0.003453,0.004606,
1735 0.004289,0.007006,0.010046,0.013853,0.017709,0.016630,0.025728,0.036763,0.045056,0.029011};
1736 Int_t nPointsCumulant2nd0005ALICE = sizeof(xCumulant2nd0005ALICE)/sizeof(Double_t);
1737 TGraphErrors *Cumulant2nd0005ALICE = new TGraphErrors(nPointsCumulant2nd0005ALICE,xCumulant2nd0005ALICE,yCumulant2nd0005ALICE,
1738 xErrCumulant2nd0005ALICE,yErrCumulant2nd0005ALICE);
1739 Cumulant2nd0005ALICE->SetMarkerStyle(kFullCircle);
1740 Cumulant2nd0005ALICE->SetMarkerColor(kBlue);
1742 return Cumulant2nd0005ALICE;
1756 TGraphErrors* GetFlow510(Int_t n)
1758 // private communication 09.03.11, Ante B. / Raimond
1762 // v2{2}(pt) for 5-10%:
1763 Double_t xCumulant2nd0510ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1764 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1765 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
1766 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
1767 Double_t yCumulant2nd0510ALICE[] = {0.000000,0.000000,0.022354,0.028064,0.034341,0.040769,0.046265,0.051160,0.056712,0.061354,
1768 0.066290,0.070340,0.074453,0.078444,0.082367,0.085785,0.088086,0.092676,0.096169,0.100366,
1769 0.104227,0.109710,0.117032,0.121784,0.122227,0.126537,0.127966,0.117790,0.117884,0.111436,
1770 0.104945,0.097640,0.086481,0.091663,0.091404,0.080132,0.015864,0.101500,0.033347,0.205130};
1771 Double_t xErrCumulant2nd0510ALICE[40] = {0.};
1772 Double_t yErrCumulant2nd0510ALICE[] = {0.000000,0.000000,0.000173,0.000176,0.000186,0.000199,0.000219,0.000236,0.000260,0.000283,
1773 0.000312,0.000340,0.000373,0.000410,0.000454,0.000501,0.000552,0.000610,0.000675,0.000753,
1774 0.000620,0.000774,0.000961,0.001183,0.001431,0.001309,0.001814,0.002481,0.003342,0.004379,
1775 0.004122,0.006716,0.009851,0.013626,0.017517,0.015790,0.025680,0.038041,0.054144,0.038987};
1776 Int_t nPointsCumulant2nd0510ALICE = sizeof(xCumulant2nd0510ALICE)/sizeof(Double_t);
1777 TGraphErrors *Cumulant2nd0510ALICE = new TGraphErrors(nPointsCumulant2nd0510ALICE,xCumulant2nd0510ALICE,yCumulant2nd0510ALICE,
1778 xErrCumulant2nd0510ALICE,yErrCumulant2nd0510ALICE);
1779 Cumulant2nd0510ALICE->SetMarkerStyle(kOpenCircle);
1780 Cumulant2nd0510ALICE->SetMarkerColor(kBlue);
1782 return Cumulant2nd0510ALICE;
1796 TGraphErrors* GetFlow1020(Int_t n)
1798 // private communication 09.03.11, Ante B. / Raimond
1802 // v2{2}(pt) for 10-20%:
1803 Double_t xCumulant2nd1020ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1804 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1805 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
1806 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
1807 Double_t yCumulant2nd1020ALICE[] = {0.000000,0.000000,0.028508,0.037698,0.046914,0.055750,0.063948,0.072298,0.079396,0.086829,
1808 0.093382,0.099676,0.105412,0.110792,0.116715,0.122327,0.127079,0.132302,0.137183,0.142346,
1809 0.149059,0.156729,0.164672,0.171840,0.175346,0.176824,0.178878,0.174979,0.169229,0.153109,
1810 0.139676,0.125686,0.120554,0.096537,0.084736,0.118152,0.116079,0.060032,0.093764,0.206506};
1811 Double_t xErrCumulant2nd1020ALICE[40] = {0.};
1812 Double_t yErrCumulant2nd1020ALICE[] = {0.000000,0.000000,0.000134,0.000136,0.000145,0.000158,0.000173,0.000190,0.000209,0.000229,
1813 0.000252,0.000275,0.000301,0.000331,0.000365,0.000401,0.000442,0.000488,0.000541,0.000599,
1814 0.000496,0.000614,0.000757,0.000915,0.001095,0.000989,0.001360,0.001847,0.002477,0.003234,
1815 0.003012,0.004867,0.007123,0.009774,0.012740,0.011682,0.019629,0.028568,0.039931,0.024776};
1816 Int_t nPointsCumulant2nd1020ALICE = sizeof(xCumulant2nd1020ALICE)/sizeof(Double_t);
1817 TGraphErrors *Cumulant2nd1020ALICE = new TGraphErrors(nPointsCumulant2nd1020ALICE,xCumulant2nd1020ALICE,yCumulant2nd1020ALICE,
1818 xErrCumulant2nd1020ALICE,yErrCumulant2nd1020ALICE);
1819 Cumulant2nd1020ALICE->SetMarkerStyle(kFullSquare);
1820 Cumulant2nd1020ALICE->SetMarkerColor(kRed);
1822 return Cumulant2nd1020ALICE;
1836 TGraphErrors* GetFlow2030(Int_t n)
1838 // private communication 09.03.11, Ante B. / Raimond
1842 // v2{2}(pt) for 20-30%:
1843 Double_t xCumulant2nd2030ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1844 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1845 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
1846 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
1847 Double_t yCumulant2nd2030ALICE[] = {0.000000,0.000000,0.035366,0.047465,0.060083,0.072090,0.083418,0.093576,0.103842,0.113110,
1848 0.122193,0.130168,0.138158,0.145627,0.152851,0.159129,0.166073,0.173144,0.178698,0.186188,
1849 0.192045,0.202199,0.210535,0.215004,0.220457,0.223339,0.224050,0.211567,0.203955,0.189716,
1850 0.165994,0.147185,0.131953,0.139331,0.151293,0.127406,0.153764,0.089628,0.161247,0.511418};
1851 Double_t xErrCumulant2nd2030ALICE[40] = {0.};
1852 Double_t yErrCumulant2nd2030ALICE[] = {0.000000,0.000000,0.000155,0.000157,0.000169,0.000184,0.000202,0.000222,0.000244,0.000269,
1853 0.000296,0.000325,0.000357,0.000394,0.000435,0.000481,0.000532,0.000589,0.000655,0.000731,
1854 0.000605,0.000743,0.000904,0.001081,0.001277,0.001145,0.001568,0.002119,0.002806,0.003635,
1855 0.003383,0.005346,0.007935,0.010739,0.014682,0.013434,0.021531,0.032352,0.040396,0.028472};
1856 Int_t nPointsCumulant2nd2030ALICE = sizeof(xCumulant2nd2030ALICE)/sizeof(Double_t);
1857 TGraphErrors *Cumulant2nd2030ALICE = new TGraphErrors(nPointsCumulant2nd2030ALICE,xCumulant2nd2030ALICE,yCumulant2nd2030ALICE,
1858 xErrCumulant2nd2030ALICE,yErrCumulant2nd2030ALICE);
1859 Cumulant2nd2030ALICE->SetMarkerStyle(kOpenSquare);
1860 Cumulant2nd2030ALICE->SetMarkerColor(kRed);
1862 return Cumulant2nd2030ALICE;
1876 TGraphErrors* GetFlow3040(Int_t n)
1878 // private communication 09.03.11, Ante B. / Raimond
1882 // v2{2}(pt) for 30-40%:
1883 Double_t xCumulant2nd3040ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1884 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1885 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
1886 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
1887 Double_t yCumulant2nd3040ALICE[] = {0.000000,0.000000,0.039584,0.054196,0.069291,0.082976,0.095622,0.108940,0.119830,0.131587,
1888 0.141091,0.150899,0.160573,0.168676,0.176301,0.183823,0.191672,0.199506,0.206854,0.212830,
1889 0.219526,0.229376,0.236513,0.240863,0.245961,0.245891,0.242608,0.234302,0.219580,0.212848,
1890 0.194666,0.190184,0.171036,0.159173,0.156932,0.141324,0.132809,0.182683,0.023272,0.032825};
1891 Double_t xErrCumulant2nd3040ALICE[40] = {0.};
1892 Double_t yErrCumulant2nd3040ALICE[] = {0.000000,0.000000,0.000189,0.000192,0.000205,0.000224,0.000247,0.000273,0.000302,0.000334,
1893 0.000369,0.000407,0.000448,0.000496,0.000552,0.000612,0.000682,0.000758,0.000844,0.000941,
1894 0.000774,0.000937,0.001123,0.001329,0.001565,0.001397,0.001911,0.002549,0.003378,0.004306,
1895 0.003987,0.006353,0.009128,0.013032,0.016891,0.015806,0.025150,0.035119,0.044487,0.050083};
1896 Int_t nPointsCumulant2nd3040ALICE = sizeof(xCumulant2nd3040ALICE)/sizeof(Double_t);
1897 TGraphErrors *Cumulant2nd3040ALICE = new TGraphErrors(nPointsCumulant2nd3040ALICE,xCumulant2nd3040ALICE,yCumulant2nd3040ALICE,
1898 xErrCumulant2nd3040ALICE,yErrCumulant2nd3040ALICE);
1899 Cumulant2nd3040ALICE->SetMarkerStyle(kFullTriangleUp);
1900 Cumulant2nd3040ALICE->SetMarkerColor(kGreen+2);
1902 return Cumulant2nd3040ALICE;
1916 TGraphErrors* GetFlow4050(Int_t n)
1918 // private communication 09.03.11, Ante B. / Raimond
1922 // v2{2}(pt) for 40-50%:
1923 Double_t xCumulant2nd4050ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1924 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1925 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
1926 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
1927 Double_t yCumulant2nd4050ALICE[] = {0.000000,0.000000,0.041872,0.058090,0.074444,0.089181,0.103780,0.117279,0.129769,0.142051,
1928 0.153185,0.163147,0.173309,0.181668,0.190998,0.197703,0.205011,0.211063,0.219587,0.223287,
1929 0.231163,0.239606,0.246533,0.251457,0.250034,0.252989,0.240823,0.236489,0.230268,0.204321,
1930 0.213476,0.200247,0.167065,0.190655,0.173573,0.166173,0.153232,0.173112,-0.123540,0.211999};
1931 Double_t xErrCumulant2nd4050ALICE[40] = {0.};
1932 Double_t yErrCumulant2nd4050ALICE[] = {0.000000,0.000000,0.000248,0.000251,0.000270,0.000296,0.000328,0.000363,0.000403,0.000447,
1933 0.000500,0.000556,0.000617,0.000687,0.000770,0.000857,0.000952,0.001057,0.001176,0.001297,
1934 0.001054,0.001265,0.001498,0.001767,0.002076,0.001849,0.002527,0.003358,0.004372,0.005573,
1935 0.005091,0.007981,0.011746,0.015732,0.021883,0.019866,0.032443,0.046521,0.051631,0.083717};
1936 Int_t nPointsCumulant2nd4050ALICE = sizeof(xCumulant2nd4050ALICE)/sizeof(Double_t);
1937 TGraphErrors *Cumulant2nd4050ALICE = new TGraphErrors(nPointsCumulant2nd4050ALICE,xCumulant2nd4050ALICE,yCumulant2nd4050ALICE,
1938 xErrCumulant2nd4050ALICE,yErrCumulant2nd4050ALICE);
1939 Cumulant2nd4050ALICE->SetMarkerStyle(kOpenTriangleUp);
1940 Cumulant2nd4050ALICE->SetMarkerColor(kGreen+2);
1942 return Cumulant2nd4050ALICE;
1949 Float_t CalculateFlow(TH1* ptDist, Float_t ptMin, Float_t ptMax, Int_t n, Int_t centralityBegin, Int_t centralityEnd)
1951 if (centralityBegin == 0 && centralityEnd == 2)
1952 flow = GetFlow02(n);
1953 else if (centralityBegin == 0 && centralityEnd == 5)
1954 flow = GetFlow05(n);
1955 else if (centralityBegin == 5 && centralityEnd == 10)
1956 flow = GetFlow510(n);
1957 else if (centralityBegin == 20 && centralityEnd == 30)
1958 flow = GetFlow2030(n);
1959 else if (centralityBegin == 30 && centralityEnd == 40)
1960 flow = GetFlow3040(n);
1961 else if (centralityBegin == 40 && centralityEnd == 50)
1962 flow = GetFlow4050(n);
1963 else if (centralityBegin > 50)
1964 flow = GetFlow4050(n);
1965 else if (centralityBegin == 0 && centralityEnd == 20)
1967 flow = GetFlow05(n);
1968 flow2 = GetFlow510(n);
1969 flow3 = GetFlow1020(n);
1971 // centrality width * dn/deta from http://arxiv.org/PS_cache/arxiv/pdf/1012/1012.1657v2.pdf
1972 Float_t mult[] = { 5 * 1601, 5 * 1294, 10 * 966 };
1974 if (flow->GetN() != flow2->GetN() || flow2->GetN() != flow3->GetN())
1975 AliFatal("Incompatible graphs");
1977 for (Int_t i=0; i<flow->GetN(); i++)
1979 // Printf("%f %f %f", flow->GetY()[i], flow2->GetY()[i], flow3->GetY()[i]);
1980 flow->GetY()[i] = flow->GetY()[i] * mult[0] + flow2->GetY()[i] * mult[1] + flow3->GetY()[i] * mult[2];
1981 flow->GetY()[i] /= mult[0] + mult[1] + mult[2];
1982 // Printf(" --> %f", flow->GetY()[i]);
1985 else if (centralityBegin == 20 && centralityEnd == 60)
1987 flow = GetFlow2030(n);
1988 flow2 = GetFlow3040(n);
1989 flow3 = GetFlow4050(n);
1991 // centrality width * dn/deta from http://arxiv.org/PS_cache/arxiv/pdf/1012/1012.1657v2.pdf
1992 Float_t mult[] = { 10 * 649, 10 * 426, 10 * (261+149) };
1994 if (flow->GetN() != flow2->GetN() || flow2->GetN() != flow3->GetN())
1995 AliFatal("Incompatible graphs");
1997 for (Int_t i=0; i<flow->GetN(); i++)
1999 // Printf("%f %f %f", flow->GetY()[i], flow2->GetY()[i], flow3->GetY()[i]);
2000 flow->GetY()[i] = flow->GetY()[i] * mult[0] + flow2->GetY()[i] * mult[1] + flow3->GetY()[i] * mult[2];
2001 flow->GetY()[i] /= mult[0] + mult[1] + mult[2];
2002 // Printf(" --> %f", flow->GetY()[i]);
2007 Printf("Flow range %d %d not available", centralityBegin, centralityEnd);
2013 for (Int_t bin = ptDist->FindBin(ptMin + 0.01); bin <= ptDist->FindBin(ptMax - 0.01); bin++)
2015 if (ptDist->GetBinCenter(bin) > flow->GetX()[flow->GetN()-1])
2016 vn += ptDist->GetBinContent(bin) * flow->GetY()[flow->GetN()-1];
2018 vn += ptDist->GetBinContent(bin) * flow->Eval(ptDist->GetBinCenter(bin));
2019 sum += ptDist->GetBinContent(bin);
2024 Printf("v_{%d} = %f for %f < pT < %f", n, vn, ptMin, ptMax);
2029 void CalculateFlow(const char* fileName, Int_t centralityBegin, Int_t centralityEnd)
2031 Float_t ptTrigMin = 2;
2032 Float_t ptTrigMax = 3;
2039 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
2041 cont = h->GetUEHist(2)->GetTrackHist(0);
2042 cont->GetGrid(6)->GetGrid()->GetAxis(3)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
2043 cont->GetGrid(6)->GetGrid()->GetAxis(2)->SetRangeUser(ptTrigMin + 0.01, ptTrigMax - 0.01);
2045 ptDist = cont->ShowProjection(1, 6);
2046 ptDist->Scale(1.0 / ptDist->Integral());
2048 cont = h->GetUEHist(2)->GetEventHist();
2049 cont->GetGrid(6)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
2051 ptDist2 = cont->ShowProjection(0, 6);
2052 ptDist2->Scale(1.0 / ptDist2->Integral());
2056 for (Int_t n=2; n<=4; n++)
2058 Float_t v2A = CalculateFlow(ptDist, ptMin, ptMax, n, centralityBegin, centralityEnd);
2059 Float_t v2T = CalculateFlow(ptDist2, ptTrigMin, ptTrigMax, n, centralityBegin, centralityEnd);
2061 str += Form("%f * %f, ", v2A, v2T);
2065 ptDist2->SetLineColor(2);
2066 ptDist2->Draw("SAME");
2068 Printf("%s", str.Data());
2071 // four dimensions for: nearside/awayside/normalization unc, trigger, centrality, case (same, same/mixed, same w/ v2 subtraction, same/mixed w/ v2 subtraction, some more cases...)
2072 TGraphErrors***** yields = 0;
2073 TString currentYieldFile;
2077 TFile::Open("yields.root", "RECREATE");
2078 for (Int_t i=0; i<3; i++)
2080 for (Int_t j=0; j<6; j++)
2082 for (Int_t k=0; k<4; k++)
2084 // CINT limitation here
2085 TGraphErrors** tmp = yields[i][j][k];
2086 for (Int_t l=0; l<31; l++)
2088 //Printf("%d %d %d %d", i, j, k, l);
2089 tmp[l]->Write(Form("yield_%d_%d_%d_%d", i, j, k, l));
2097 void ReadYields(const char* fileName = "yields.root")
2099 if (currentYieldFile == fileName)
2102 currentYieldFile = fileName;
2104 CreateYieldStructure();
2105 TFile::Open(fileName);
2106 for (Int_t i=0; i<3; i++)
2108 for (Int_t j=0; j<6; j++)
2110 for (Int_t k=0; k<4; k++)
2112 // CINT limitation here
2113 TGraphErrors** tmp = yields[i][j][k];
2114 for (Int_t l=0; l<31; l++)
2116 //Printf("%d %d %d %d", i, j, k, l);
2117 tmp[l] = gFile->Get(Form("yield_%d_%d_%d_%d", i, j, k, l));
2124 void CreateYieldStructure()
2128 yields = new TGraphErrors****[3];
2129 for (Int_t i=0; i<3; i++)
2131 yields[i] = new TGraphErrors***[6];
2132 for (Int_t j=0; j<6; j++)
2134 yields[i][j] = new TGraphErrors**[4];
2135 for (Int_t k=0; k<4; k++)
2137 yields[i][j][k] = new TGraphErrors*[31];
2138 // CINT limitation here
2139 TGraphErrors** tmp = yields[i][j][k];
2140 for (Int_t l=0; l<31; l++)
2142 //Printf("%d %d %d %d", i, j, k, l);
2143 TGraphErrors* graph = new TGraphErrors;
2152 void GraphShiftX(TGraphErrors* graph, Float_t offset)
2154 for (Int_t i=0; i<graph->GetN(); i++)
2155 graph->GetX()[i] += offset;
2158 const Float_t kPythiaScalingFactor = 0.935;
2160 void DrawYields(const char* fileName = "yields.root")
2162 ReadYields(fileName);
2164 c = new TCanvas("c", "c", 1800, 1200);
2167 Int_t markers1[] = { 24, 25, 26, 30 };
2168 Int_t markers2[] = { 20, 21, 22, 29 };
2169 Int_t colors[] = { 1, 2, 3, 4 };
2170 //Int_t caseList[] = { 0, 10+1, 10+1, 8, 10, 11, 12, 13, 1, 9 };
2171 Int_t caseList[] = { 0, 18, 18, 23, 18, 19, 20, 21, 22, 9 };
2172 const char* caseString[] = { "", "baseline sub", "baseline vs v2 sub comp", 0, "baseline sub comp", "Same/Mixed", "Same/Mixed - v2 subtr" };
2177 Int_t centralityList[] = { 0, 1, 2, 0, 0, 1 };
2178 Int_t centralityList2[] = { -1, -1, -1, 1, 2, 2 };
2179 Float_t factors[] = { 1, 1, 1, 1, 1, 1 };
2180 const char* centralityString[] = { "0-5%", "20-40%", "60-90%", "0-5% vs 20-40%", "0-5% vs 60-90%", "20-40% vs 60-90%" };
2184 Int_t centralityList[] = { 0, 2, 3, 0, 0, 2 };
2185 Int_t centralityList2[] = { -1, -1, -1, 2, 3, 3 };
2186 //Float_t factors[] = { 1, 1, 1, 1, 1.0/0.9, 1.0/0.9 };
2187 //Float_t factors[] = { 1, 1, 1, 1, 1.0/0.804, 1.0/0.804 };
2188 Float_t factors[] = { 1, 1, 1, 1, 1.0/kPythiaScalingFactor, 1.0/kPythiaScalingFactor };
2189 //Float_t factors[] = { 1, 1, 1, 1, 1.0, 1.0 };
2190 const char* centralityString[] = { "0-5%", "60-90%", "pp", "0-5% vs 60-90%", "0-5% vs pp", "60-90% vs pp" };
2193 l = new TLegend(0.5, 0.5, 0.9, 0.9);
2196 Float_t max[] = { 0.4, 2, 2, 2, 2, 10, 10 };
2197 Float_t max2[] = { 5, 2, 2, 2, 2, 2, 2, 2, 2 };
2199 dummy = new TH2F("dummy", ";p_{T,assoc};yield", 100, 0, 20, 20000, 0, 10);
2202 TGraphErrors* prevNear[6];
2203 TGraphErrors* prevAway[6];
2204 for (Int_t caseId=0; caseId<9; caseId++) // case 0->9
2206 for (Int_t k=0; k<6; k++) // centrality
2208 if (caseId != 3 && caseId < 5)
2211 c->cd(1 + k + caseId*6);
2213 c->cd(1 + k + (caseId-1)*6);
2214 currentDummy = dummy->DrawCopy();
2215 currentDummy->GetYaxis()->SetRangeUser(0, max[caseId]);
2219 latex = new TLatex(0.15, 0.95, Form("%s - %s", caseString[caseId], centralityString[k]));
2221 latex->SetTextSize(0.05);
2224 else if (caseId == 3)
2229 for (Int_t j=0; j<3; j++) // trigger pt
2231 if (caseId >= 2 && j != 1)
2233 Printf("%d %d %d %d", caseId, k, j, caseList[caseId]);
2237 // CINT limitation here
2238 TGraphErrors** tmp = yields[0][j][centralityList[k]];
2239 nearSide = tmp[caseList[caseId]];
2240 //new TCanvas; nearSide->Draw("AP"); return;
2242 nearSide->SetMarkerStyle(markers1[j]);
2243 nearSide->SetMarkerColor(colors[j]);
2244 nearSide->SetLineColor(colors[j]);
2246 if (caseId == 0 && k == 0)
2247 l->AddEntry(nearSide, Form("trig pt bin %d", j), "P");
2249 TGraphErrors** tmp = yields[1][j][centralityList[k]];
2250 awaySide = tmp[caseList[caseId]];
2251 awaySide->SetMarkerStyle(markers2[j]);
2252 awaySide->SetMarkerColor(colors[j]);
2253 awaySide->SetLineColor(colors[j]);
2255 GraphShiftX(nearSide, -0.1 + j*0.1);
2256 GraphShiftX(awaySide, -0.1 + j*0.1);
2260 nearSide->SetLineColor(caseId - 2);
2261 nearSide->SetMarkerColor(caseId - 2);
2262 awaySide->SetLineColor(caseId - 2);
2263 awaySide->SetMarkerColor(caseId - 2);
2268 nearSide->SetLineColor(caseId - 3);
2269 nearSide->SetMarkerColor(caseId - 3);
2270 awaySide->SetLineColor(caseId - 3);
2271 awaySide->SetMarkerColor(caseId - 3);
2276 prevNear[k] = (TGraphErrors*) nearSide->DrawClone("PSAME");
2277 prevAway[k] = (TGraphErrors*) awaySide->DrawClone("PSAME");
2282 for (Int_t i=0; i<nearSide->GetN(); i++)
2284 Printf("%f: %.0f%%", nearSide->GetX()[i], 100.0 * nearSide->GetEY()[i] / nearSide->GetY()[i]);
2285 Printf("%f: %.0f%%", awaySide->GetX()[i], 100.0 * awaySide->GetEY()[i] / awaySide->GetY()[i]);
2291 // CINT limitation here
2292 tmp = yields[0][j][centralityList[k]]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2293 tmp = yields[1][j][centralityList[k]]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2295 tmp = yields[0][j][centralityList2[k]];
2296 nearSidePeripheral = tmp[caseList[caseId]];
2297 if (iaa && caseId == 3 && k >= 4)
2298 nearSidePeripheral = tmp[caseList[caseId-1]];
2300 tmp = yields[1][j][centralityList2[k]];
2301 awaySidePeripheral = tmp[caseList[caseId]];
2302 if (iaa && caseId == 3 && k >= 4)
2303 awaySidePeripheral = tmp[caseList[caseId-1]];
2305 // nearSideCentral->Print();
2306 // nearSidePeripheral->Print();
2309 currentDummy->GetYaxis()->SetTitle("I_{CP}");
2311 currentDummy->GetYaxis()->SetTitle("I_{AA}");
2312 currentDummy->GetYaxis()->SetRangeUser(0, max2[caseId]);
2314 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
2316 if (i >= nearSidePeripheral->GetN())
2318 nearSideCentral->RemovePoint(i);
2323 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
2324 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
2326 nearSideCentral->RemovePoint(i);
2327 nearSidePeripheral->RemovePoint(i);
2332 nearSideCentral->GetEY()[i] = TMath::Sqrt(
2333 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
2334 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
2336 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
2337 nearSideCentral->GetY()[i] *= factors[k];
2339 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
2343 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
2345 if (i >= awaySidePeripheral->GetN())
2347 awaySideCentral->RemovePoint(i);
2352 //Printf("away %d", i);
2353 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
2355 awaySideCentral->RemovePoint(i);
2356 awaySidePeripheral->RemovePoint(i);
2361 awaySideCentral->GetEY()[i] = TMath::Sqrt(
2362 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
2363 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
2365 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
2366 awaySideCentral->GetY()[i] *= factors[k];
2368 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
2373 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
2374 nearSideCentral->SetLineColor(1);
2375 nearSideCentral->SetMarkerColor(1);
2377 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
2378 awaySideCentral->SetLineColor(1);
2379 awaySideCentral->SetMarkerColor(1);
2384 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
2385 nearSideCentral->SetLineColor(caseId - 3);
2386 nearSideCentral->SetMarkerColor(caseId - 3);
2388 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
2389 awaySideCentral->SetLineColor(caseId - 3);
2390 awaySideCentral->SetMarkerColor(caseId - 3);
2393 //Printf("%d", caseList[caseId]);
2395 // nearSideCentral->Print();
2397 nearSideCentral->Draw("PSAME");
2398 awaySideCentral->Draw("PSAME");
2402 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
2403 Printf("Near, bin %d pt = %f, difference %.1f%%", i, nearSideCentral->GetX()[i], 100.0 - 100.0 * nearSideCentral->GetY()[i] / prevNear[k]->Eval(nearSideCentral->GetX()[i]));
2404 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
2405 Printf("Away, bin %d pt = %f, difference %.1f%%", i, awaySideCentral->GetX()[i], 100.0 - 100.0 * awaySideCentral->GetY()[i] / prevAway[k]->Eval(awaySideCentral->GetX()[i]));
2408 prevNear[k] = nearSideCentral;
2409 prevAway[k] = awaySideCentral;
2412 if (caseId == 0 && k == 0)
2417 c->SaveAs("yields.png");
2420 void FitGaussians(const char* fileName, Bool_t flat)
2422 CreateYieldStructure();
2424 aliceFile = TFile::Open(fileName);
2426 Int_t maxLeadingPt = 3;
2427 Int_t maxAssocPt = 6;
2429 TCanvas* canvas = new TCanvas("FitGaussians", "FitGaussians", 1000, 700);
2430 canvas->Divide(maxAssocPt, maxLeadingPt);
2432 for (Int_t i=0; i<maxLeadingPt; i++)
2433 for (Int_t j=0; j<maxAssocPt; j++)
2436 for (Int_t aliceCentrality=0; aliceCentrality<4; aliceCentrality++)
2438 Printf("%d %d %d", i, j, aliceCentrality);
2440 canvas->cd(j+1 + (i) * maxAssocPt);
2441 gPad->SetLeftMargin(0.15);
2442 gPad->SetBottomMargin(0.2);
2443 //gPad->SetTopMargin(0.01);
2444 gPad->SetRightMargin(0.01);
2446 hist = (TH1*) aliceFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, (flat) ? "_fit_flat" : ""));
2451 gausFit = new TF1("gausFit", "[0] + gaus(1) + gaus(4)", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
2452 gausFit->SetParameters(0, 1, 0, 1, 1, TMath::Pi(), 1);
2453 gausFit->SetParLimits(0, -1, 10000);
2454 gausFit->SetParLimits(1, 0.001, 10000);
2455 gausFit->FixParameter(2, 0);
2456 gausFit->SetParLimits(3, 0.05, 10);
2457 gausFit->SetParLimits(4, 0.001, 10000);
2458 gausFit->FixParameter(5, TMath::Pi());
2459 gausFit->SetParLimits(6, 0.1, 10);
2461 gausFit->SetLineWidth(1);
2462 gausFit->SetLineColor(hist->GetLineColor());
2464 hist->Fit(gausFit, "0RIQ");
2465 gausFit->FixParameter(0, gausFit->GetParameter(0));
2466 hist->Fit(gausFit, "RI", (aliceCentrality == 0) ? "" : "SAME");
2467 //gausFit->DrawCopy("SAME");
2470 TPRegexp reg("(\\d+\\.\\d+) \\< p_\\{T,assoc\\} \\< (\\d+\\.\\d+)");
2471 arr = reg.MatchS(hist->GetTitle(), "", 0, 10);
2472 if (arr->GetEntries() != 3)
2475 Float_t pt1 = atof(arr->At(1)->GetName());
2476 Float_t pt2 = atof(arr->At(2)->GetName());
2478 FillYield(i, aliceCentrality, (pt1 + pt2) / 2, (pt2 - pt1) / 2, 18, gausFit->GetParameter(3), gausFit->GetParError(3), gausFit->GetParameter(6), gausFit->GetParError(6));
2483 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), hist->GetMinimum()), TMath::Max(first->GetMaximum(), hist->GetMaximum()));
2485 first->GetYaxis()->SetRangeUser(first->GetMinimum(), 2 * first->GetMaximum());
2493 for (Int_t j=0; j<3; j++)
2497 Int_t markers1[] = { 24, 25, 26, 30 };
2498 Int_t markers2[] = { 20, 21, 22, 29 };
2499 Int_t colors[] = { 1, 2, 3, 4 };
2501 dummy = new TH2F("dummy", ";p_{T,assoc};", 100, 0, 10, 1000, 0, 1);
2505 for (Int_t k=0; k<4; k++) // centrality
2507 // CINT limitation here
2508 TGraphErrors** tmp = yields[0][j][k];
2510 nearSide->SetMarkerStyle(markers1[k]);
2511 nearSide->SetMarkerColor(colors[k]);
2512 nearSide->SetLineColor(colors[k]);
2514 TGraphErrors** tmp = yields[1][j][k];
2516 awaySide->SetMarkerStyle(markers2[k]);
2517 awaySide->SetMarkerColor(colors[k]);
2518 awaySide->SetLineColor(colors[k]);
2520 nearSide->DrawClone("PSAME");
2521 awaySide->DrawClone("PSAME");
2526 void TsallisExamples()
2528 tsallis = new TF1("tsallis", "[0] * (1-[2]*(1-[1])*x*x)**(1/(1-[1]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
2530 Float_t q[] = { 1.0000001, 1.5, 2 };
2531 Float_t beta[] = { 0.1, 1, 10, 100 };
2533 dummy = new TH2F("dummy", "", 100, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), 100, 0, 1.2);
2537 legend = new TLegend(0.65, 0.5, 1, 1);
2538 legend->SetFillColor(0);
2540 for (Int_t i=0; i<3; i++)
2541 for (Int_t j=0; j<4; j++)
2543 tsallis->SetParameters(1, q[i], beta[j]);
2544 tsallis->SetLineColor(i+1);
2545 tsallis->SetLineStyle(j+1);
2547 legend->AddEntry(tsallis->DrawCopy("SAME"), Form("q = %.1f, #beta = %.1f", q[i], beta[j]), "L");
2553 void DrawTsallisParams()
2557 c = new TCanvas("c", "c", 900, 600);
2560 Int_t markers1[] = { 24, 25, 26, 30 };
2561 Int_t markers2[] = { 20, 21, 22, 29 };
2562 Int_t colors[] = { 1, 2, 3, 4 };
2563 Int_t caseList[] = { 12, 13, 8, 6, 8, 9, 10, 11, 1, 7 };
2564 const char* caseString[] = { "q", "beta" };
2565 const char* centralityString[] = { "0-5%", "20-40%", "60-90%", "0-5% vs 20-40%", "0-5% vs 60-90%", "20-40% vs 60-90%" };
2567 l = new TLegend(0.5, 0.5, 0.9, 0.9);
2570 Float_t max[] = { 3, 1000 };
2571 Float_t max2[] = { 5, 2 };
2573 dummy = new TH2F("dummy", ";p_{T,assoc};", 100, 0, 20, 1000, 0, 1000);
2576 for (Int_t caseId=0; caseId<2; caseId++) // case
2578 for (Int_t k=0; k<3; k++) // centrality
2580 c->cd(1 + k + caseId*3);
2582 currentDummy = dummy->DrawCopy();
2583 currentDummy->GetYaxis()->SetRangeUser(0, max[caseId]);
2584 if (caseId == 1 && k < 3)
2587 latex = new TLatex(0.15, 0.95, Form("%s - %s", caseString[caseId], centralityString[k]));
2589 latex->SetTextSize(0.05);
2592 for (Int_t j=0; j<2; j++) // trigger pt
2596 // CINT limitation here
2597 TGraphErrors** tmp = yields[0][j][k];
2598 nearSide = tmp[caseList[caseId]];
2599 nearSide->SetMarkerStyle(markers1[j]);
2600 nearSide->SetMarkerColor(colors[j]);
2601 nearSide->SetLineColor(colors[j]);
2603 if (caseId == 0 && k == 0)
2604 l->AddEntry(nearSide, Form("trig pt bin %d", j), "P");
2606 TGraphErrors** tmp = yields[1][j][k];
2607 awaySide = tmp[caseList[caseId]];
2608 awaySide->SetMarkerStyle(markers2[j]);
2609 awaySide->SetMarkerColor(colors[j]);
2610 awaySide->SetLineColor(colors[j]);
2612 GraphShiftX(nearSide, -0.1 + j*0.1);
2613 GraphShiftX(awaySide, -0.1 + j*0.1);
2615 Printf("%d %d %d", caseId, j, k);
2619 nearSide->DrawClone("PSAME");
2620 awaySide->DrawClone("PSAME");
2624 // CINT limitation here
2627 tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2628 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2629 tmp = yields[0][j][1]; nearSidePeripheral = tmp[caseList[caseId]];
2630 tmp = yields[1][j][1]; awaySidePeripheral = tmp[caseList[caseId]];
2634 tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2635 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2636 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
2637 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
2641 tmp = yields[0][j][1]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2642 tmp = yields[1][j][1]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2643 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
2644 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
2647 currentDummy->GetYaxis()->SetTitle("I_{CP}");
2648 currentDummy->GetYaxis()->SetRangeUser(0, max2[caseId]);
2650 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
2652 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
2653 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
2655 nearSideCentral->RemovePoint(i);
2656 nearSidePeripheral->RemovePoint(i);
2661 nearSideCentral->GetEY()[i] = TMath::Sqrt(
2662 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
2663 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
2665 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
2667 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
2671 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
2673 //Printf("away %d", i);
2674 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
2676 awaySideCentral->RemovePoint(i);
2677 awaySidePeripheral->RemovePoint(i);
2682 awaySideCentral->GetEY()[i] = TMath::Sqrt(
2683 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
2684 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
2686 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
2688 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
2693 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
2694 nearSideCentral->SetLineColor(1);
2695 nearSideCentral->SetMarkerColor(1);
2697 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
2698 awaySideCentral->SetLineColor(1);
2699 awaySideCentral->SetMarkerColor(1);
2704 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
2705 nearSideCentral->SetLineColor(caseId - 3);
2706 nearSideCentral->SetMarkerColor(caseId - 3);
2708 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
2709 awaySideCentral->SetLineColor(caseId - 3);
2710 awaySideCentral->SetMarkerColor(caseId - 3);
2713 //Printf("%d", caseList[caseId]);
2715 nearSideCentral->Draw("PSAME");
2716 awaySideCentral->Draw("PSAME");
2719 if (caseId == 0 && k == 0)
2724 c->SaveAs("tsallisparams.png");
2727 void DrawYieldLHCRHIC_ICP(const char* fileName = "yields.root")
2730 Int_t caseList[] = { 18 };
2733 ReadYields(fileName);
2735 c = new TCanvas("lhc_rhic", "lhc_rhic", 800, 600);
2739 dummy = new TH2F("dummy", ";p_{T,assoc};I_{CP}", 100, 0, 12, 1000, 0, 10);
2741 currentDummy = dummy->DrawCopy();
2742 currentDummy->GetYaxis()->SetRangeUser(0, 2);
2744 TGraphErrors** tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2745 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2746 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
2747 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
2749 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
2751 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
2752 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
2754 nearSideCentral->RemovePoint(i);
2755 nearSidePeripheral->RemovePoint(i);
2760 nearSideCentral->GetEY()[i] = TMath::Sqrt(
2761 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
2762 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
2764 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
2766 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
2770 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
2772 //Printf("away %d", i);
2773 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
2775 awaySideCentral->RemovePoint(i);
2776 awaySidePeripheral->RemovePoint(i);
2781 awaySideCentral->GetEY()[i] = TMath::Sqrt(
2782 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
2783 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
2785 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
2787 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
2790 nearSideCentral->SetMarkerStyle(21);
2791 nearSideCentral->SetLineColor(1);
2792 nearSideCentral->SetMarkerColor(1);
2794 awaySideCentral->SetMarkerStyle(25);
2795 awaySideCentral->SetLineColor(1);
2796 awaySideCentral->SetMarkerColor(1);
2798 nearSideCentral->Draw("PSAME");
2799 awaySideCentral->Draw("PSAME");
2801 legend = new TLegend(0.4, 0.8, 0.99, 0.99);
2802 legend->SetFillColor(0);
2803 legend->AddEntry(nearSideCentral, "ALICE I_{CP} Near 8-15 GeV 0-5%/60-90%", "P");
2804 legend->AddEntry(awaySideCentral, "ALICE I_{CP} Away 8-15 GeV 0-5%/60-90%", "P");
2808 nearSideCentral->Fit("pol1", "", "SAME", 4.5, 11.5);
2809 awaySideCentral->Fit("pol1", "", "SAME", 4.5, 11.5);
2810 nearSideCentral->GetFunction("pol1")->SetLineWidth(1);
2811 awaySideCentral->GetFunction("pol1")->SetLineWidth(1);
2817 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
2818 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
2820 //dndpt_central->Print();
2821 //dndpt_peripheral->Print();
2823 // ratio of Ncoll (from paper)
2824 // TODO there is also an uncertainty on that
2825 Double_t scale = 1690. / 15.7;
2826 Double_t scaleUnc = TMath::Sqrt(TMath::Power(131. / 1690., 2) + TMath::Power(0.7 / 15.7, 2));
2828 for (Int_t i=0; i<dndpt_central->GetN(); i++)
2830 dndpt_central->GetEY()[i] = TMath::Sqrt(TMath::Power(dndpt_central->GetEY()[i] / dndpt_central->GetY()[i], 2) +
2831 TMath::Power(dndpt_peripheral->GetEY()[i] / dndpt_peripheral->GetY()[i], 2));
2832 dndpt_central->GetY()[i] /= dndpt_peripheral->GetY()[i] * scale;
2833 dndpt_central->GetEY()[i] *= dndpt_central->GetY()[i];
2837 //dndpt_central->Print();
2838 //dndpt_central->Draw("AP");
2840 dndpt_central->Draw("*SAME");
2842 latex = new TLatex(0.34, 0.09, "9% N_{coll} scale uncertainty on R_{CP}");
2843 latex->SetTextSize(0.03);
2847 raa_central = ReadHepdata("raa_alice_central.txt", kFALSE, 3);
2848 raa_central->SetMarkerStyle(20);
2849 //raa_central->Draw("PSAME");
2851 legend->AddEntry(dndpt_central, "ALICE R_{CP} 0-5%/70-80%", "P");
2857 // calculate ICP from IAA(0-20) / IAA (20-60)
2858 // TODO only using uncertainties from IAA(0-20)
2859 // TODO systematic uncertainty stored in graph with _sys appended
2860 TFile::Open("rhic/pi0h_graphs.root");
2862 for (Int_t i=0; i<3; i+=2)
2864 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
2865 central = (TGraphErrors*) gFile->Get(Form("gIAA_3_0_%d", i));
2866 peripheral = (TGraphErrors*) gFile->Get(Form("gIAA_3_1_%d", i));
2868 for (Int_t j=0; j<central->GetN(); j++)
2870 central->GetY()[j] /= peripheral->GetY()[j];
2871 central->GetEY()[j] /= peripheral->GetY()[j];
2874 central->SetMarkerStyle((i == 0) ? 29 : 30);
2875 central->SetMarkerColor(2);
2876 central->SetLineColor(2);
2877 central->Draw("PSAME");
2878 legend->AddEntry(central, Form("PHENIX I_{CP} %s 9-12 GeV 0-20%/20-60%", (i == 0) ? "Near" : "Away"), "P");
2884 c->SaveAs("icp.png");
2887 TGraphErrors* GetRatio(const char* fileName, Int_t centrality1, Int_t centrality2, Int_t triggerId, Int_t caseId, Int_t side, const char* fileName2 = 0)
2889 // 0 = near side; 1 = away side
2891 ReadYields(fileName);
2893 TGraphErrors** tmp = yields[side][triggerId][centrality1];
2894 nearSideCentral = (TGraphErrors*) tmp[caseId]->Clone();
2897 ReadYields(fileName2);
2899 tmp = yields[side][triggerId][centrality2];
2900 nearSidePeripheral = (TGraphErrors*) tmp[caseId]->Clone();
2902 Printf("%d %d", nearSideCentral->GetN(), nearSidePeripheral->GetN());
2904 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
2906 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
2908 nearSideCentral->RemovePoint(i);
2909 nearSidePeripheral->RemovePoint(i);
2914 if (nearSideCentral->GetX()[i] != nearSidePeripheral->GetX()[i])
2916 Printf("Inconsistent x values %f %f", nearSideCentral->GetX()[i], nearSidePeripheral->GetX()[i]);
2920 Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
2922 nearSideCentral->GetEY()[i] = TMath::Sqrt(
2923 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
2924 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
2926 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
2928 if (centrality2 == 3)
2929 nearSideCentral->GetY()[i] /= kPythiaScalingFactor;
2931 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
2934 //nearSideCentral->GetXaxis()->SetTitle("p_{T, assoc}");
2935 //nearSideCentral->GetYaxis()->SetTitle((centrality2 == 3) ? "I_{AA}" : "I_{CP}");
2937 return nearSideCentral;
2940 TGraphErrors* GetIAA(const char* fileName, Int_t centrality, Int_t triggerId, Int_t caseId, Int_t side)
2942 return GetRatio(fileName, centrality, 3, triggerId, caseId, side);
2945 TGraphErrors* GetICP(const char* fileName, Int_t triggerId, Int_t caseId, Int_t side)
2947 return GetRatio(fileName, 1, 2, triggerId, caseId, side);
2950 void DrawYieldLHCRHIC_IAA(const char* fileName, Bool_t central, Bool_t rhic)
2953 Int_t caseList[] = { 18 };
2956 ReadYields(fileName);
2958 c = new TCanvas("lhc_rhic", "lhc_rhic", 800, 600);
2962 dummy = new TH2F("dummy", ";p_{T,assoc};I_{AA}", 100, 0, 12, 1000, 0, 10);
2964 currentDummy = dummy->DrawCopy();
2965 currentDummy->GetYaxis()->SetRangeUser(0, 3);
2967 Int_t nominatorBin = 0;
2971 nearSideCentral = GetIAA(fileName, nominatorBin, j, caseList[caseId], 0);
2972 awaySideCentral = GetIAA(fileName, nominatorBin, j, caseList[caseId], 1);
2974 nearSideCentral->SetMarkerStyle(21);
2975 nearSideCentral->SetLineColor(1);
2976 nearSideCentral->SetMarkerColor(1);
2978 awaySideCentral->SetMarkerStyle(25);
2979 awaySideCentral->SetLineColor(1);
2980 awaySideCentral->SetMarkerColor(1);
2982 nearSideCentral->Draw("PSAME");
2983 awaySideCentral->Draw("PSAME");
2985 legend = new TLegend(0.4, 0.8, 0.99, 0.99);
2986 legend->SetFillColor(0);
2987 legend->AddEntry(nearSideCentral, Form("ALICE I_{AA} Near 8-15 GeV %s%%/Pythia6", (central) ? "0-5" : "60-90"), "P");
2988 legend->AddEntry(awaySideCentral, Form("ALICE I_{AA} Away 8-15 GeV %s%%/Pythia6", (central) ? "0-5" : "60-90"), "P");
2993 // systematic uncertainty stored in graph with _sys appended
2994 TFile::Open("rhic/pi0h_graphs.root");
2996 for (Int_t i=0; i<3; i+=2)
2998 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
2999 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_2_%d_%d", (central) ? 0 : 1, i));
3000 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_2_%d_%d_sys", (central) ? 0 : 1, i));
3002 rhic_iaa->SetMarkerStyle((i == 0) ? 29 : 30);
3003 rhic_iaa->SetMarkerColor(2);
3004 rhic_iaa->SetLineColor(2);
3005 rhic_iaa->Draw("PSAME");
3006 rhic_iaa_sys->SetLineColor(2);
3007 rhic_iaa_sys->SetMarkerColor(2);
3008 rhic_iaa_sys->Draw("PSAME");
3009 legend->AddEntry(rhic_iaa, Form("PHENIX I_{AA} %s 7-9 GeV %s%%/pp", (i == 0) ? "Near" : "Away", (central) ? "0-20" : "20-60"), "P");
3011 for (Int_t i=0; i<3; i+=2)
3013 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
3014 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_3_%d_%d", (central) ? 0 : 1, i));
3015 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_3_%d_%d_sys", (central) ? 0 : 1, i));
3017 rhic_iaa->SetMarkerStyle((i == 0) ? 20 : 24);
3018 rhic_iaa->SetMarkerColor(4);
3019 rhic_iaa->SetLineColor(4);
3020 rhic_iaa->Draw("PSAME");
3021 rhic_iaa_sys->SetLineColor(4);
3022 rhic_iaa_sys->SetMarkerColor(4);
3023 rhic_iaa_sys->Draw("PSAME");
3024 legend->AddEntry(rhic_iaa, Form("PHENIX I_{AA} %s 9-12 GeV %s%%/pp", (i == 0) ? "Near" : "Away", (central) ? "0-20" : "20-60"), "P");
3030 c->SaveAs("iaa.png");
3033 void CompareIAAICP(const char* fileName1, const char* fileName2, Int_t nominatorBin, Int_t denominatorBin)
3037 //Int_t caseId = 12;
3039 nearSide1 = GetRatio(fileName1, nominatorBin, denominatorBin, j, caseId, 0);
3040 nearSide2 = GetRatio(fileName2, nominatorBin, denominatorBin, j, caseId, 0);
3041 awaySide1 = GetRatio(fileName1, nominatorBin, denominatorBin, j, caseId, 1);
3042 awaySide2 = GetRatio(fileName2, nominatorBin, denominatorBin, j, caseId, 1);
3044 /* ScaleGraph(nearSide2, 1.33);
3045 ScaleGraph(awaySide2, 1.33);*/
3048 dummy = new TH2F("dummy", Form(";p_{T,assoc};%s", (denominatorBin == 3) ? "I_{AA}" : "I_{CP}"), 100, 0, 12, 1000, 0, 10);
3050 currentDummy = dummy->DrawCopy();
3051 currentDummy->GetYaxis()->SetRangeUser(0, 3);
3053 nearSide1->SetMarkerStyle(21);
3054 nearSide1->SetLineColor(1);
3055 nearSide1->SetMarkerColor(1);
3057 nearSide2->SetMarkerStyle(21);
3058 nearSide2->SetLineColor(2);
3059 nearSide2->SetMarkerColor(2);
3061 awaySide1->SetMarkerStyle(25);
3062 awaySide1->SetLineColor(1);
3063 awaySide1->SetMarkerColor(1);
3065 awaySide2->SetMarkerStyle(25);
3066 awaySide2->SetLineColor(2);
3067 awaySide2->SetMarkerColor(2);
3069 RemovePointsBelowX(nearSide1, 3);
3070 RemovePointsBelowX(nearSide2, 3);
3071 RemovePointsBelowX(awaySide1, 3);
3072 RemovePointsBelowX(awaySide2, 3);
3074 nearSide1->DrawClone("PSAME");
3075 awaySide1->DrawClone("PSAME");
3076 nearSide2->DrawClone("PSAME");
3077 awaySide2->DrawClone("PSAME");
3080 currentDummy = dummy->DrawCopy();
3081 currentDummy->GetYaxis()->SetRangeUser(0.5, 1.5);
3085 DivideGraphs(nearSide1, nearSide2);
3086 DivideGraphs(awaySide1, awaySide2);
3088 nearSide1->Draw("PSAME");
3089 awaySide1->Draw("PSAME");
3091 nearSide1->Fit("pol0", "", "SAME", 3.01, 9.99);
3092 awaySide1->Fit("pol0", "", "SAME", 3.01, 9.99);
3095 void ScaleGraph(TGraphErrors* graph, Float_t factor)
3097 for (Int_t i=0; i<graph->GetN(); i++)
3099 graph->GetY()[i] *= factor;
3100 graph->GetEY()[i] *= factor;
3104 TGraphErrors* DrawBaselines(const char* fileName, Int_t numeratorBin, Int_t denominatorBin, Int_t side, Bool_t verbose = kTRUE)
3108 TGraphErrors* first = 0;
3109 TGraphErrors* max = 0;
3114 dummy = new TH2F("dummy", Form(";p_{T,assoc};%s", (denominatorBin == 3) ? "I_{AA}" : "I_{CP}"), 100, 0, 12, 1000, 0, 10);
3116 currentDummy = dummy->DrawCopy();
3117 currentDummy->GetYaxis()->SetRangeUser(0, 3);
3120 currentDummy = dummy->DrawCopy();
3121 currentDummy->GetYaxis()->SetRangeUser(0, 2);
3124 Int_t caseList[] = { 18, 19, 21, 22 };
3125 //Int_t caseList[] = { 23, 24, 26, 27 };
3127 for (Int_t caseId = 0; caseId < 4; caseId++)
3129 graph = GetRatio(fileName, numeratorBin, denominatorBin, j, caseList[caseId], side);
3131 graph->SetLineColor(caseId + 1);
3132 graph->SetMarkerColor(caseId + 1);
3134 RemovePointsBelowX(graph, 3);
3139 graph->DrawClone("*SAME");
3145 max = (TGraphErrors*) graph->Clone();
3146 for (Int_t i=0; i<max->GetN(); i++)
3149 max->GetEY()[i] = 0;
3154 DivideGraphs(graph, first);
3159 graph->DrawClone("*SAME");
3162 for (Int_t i=0; i<graph->GetN(); i++)
3164 if (max->GetY()[i] < TMath::Abs(graph->GetY()[i] - 1))
3165 max->GetY()[i] = TMath::Abs(graph->GetY()[i] - 1);
3176 max->GetXaxis()->SetTitle("p_{T, assoc}");
3177 max->GetYaxis()->SetTitle((denominatorBin == 3) ? "Effect on I_{AA}" : "Effect on I_{CP}");
3178 max->GetYaxis()->SetRangeUser(0, 0.4);
3183 void DrawBaselinesAll(const char* fileName)
3185 c = new TCanvas("c", "c", 800, 600);
3188 for (Int_t i=0; i<2; i++)
3190 c->cd(1+i*3); DrawBaselines(fileName, 0, 3, i, kFALSE)->Draw("A*");
3191 c->cd(2+i*3); DrawBaselines(fileName, 2, 3, i, kFALSE)->Draw("A*");
3192 c->cd(3+i*3); DrawBaselines(fileName, 0, 2, i, kFALSE)->Draw("A*");
3196 TGraphErrors* DrawSystUnc(TGraphErrors* graph, Int_t iaa_icp, Int_t awaySide)
3200 Float_t baseline = 1;
3203 else if (awaySide == 1)
3207 Float_t reference = 0;
3212 Float_t efficiency = 0.08;
3214 Float_t centrality = 1;
3216 centrality = (awaySide == 0) ? 0.02 : 0.06;
3217 else if (iaa_icp == 1)
3218 centrality = (awaySide == 0) ? 0.04 : 0.08;
3220 Float_t ptResolution = 0;
3222 Float_t total = TMath::Sqrt(baseline * baseline + efficiency * efficiency + centrality * centrality + ptResolution * ptResolution);
3224 Printf("Total syst: %f", total);
3226 systUnc = (TGraphErrors*) graph->Clone();
3227 for (Int_t i=0; i<systUnc->GetN(); i++)
3229 systUnc->GetEY()[i] = systUnc->GetY()[i] * total;
3230 systUnc->GetEX()[i] = 0;
3235 systUnc->SetLineColor(kGray + 1);
3236 systUnc->SetLineWidth(6);
3238 systUnc->Draw("PSAME");
3243 void IAA(const char* fileName, Int_t iaa)
3253 Int_t caseId[] = { 18, 23 };
3255 c = new TCanvas((iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", (iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", 1200, 600);
3256 c->Range(0, 0, 1, 1);
3258 TPad* pad1 = new TPad(Form("%s_2", fileName), "", 0, 0, 0.5, 1);
3261 TPad* pad2 = new TPad(Form("%s_1", fileName), "", 0.5, 0, 1, 1);
3265 gPad->SetRightMargin(0);
3266 gPad->SetTopMargin(0.05);
3267 gPad->SetLeftMargin(0.13);
3272 gPad->SetLeftMargin(0);
3273 gPad->SetTopMargin(0.05);
3274 gPad->SetRightMargin(0.13);
3279 dummy = new TH2F("dummy", Form(";p_{T,assoc} (GeV/c);%s", (iaa != 1) ? "I_{AA,Pythia}" : "I_{CP}"), 100, 1.5, 10.5, 1000, 0, 2.9);
3281 dummy->GetYaxis()->SetTitleOffset(1.3);
3282 dummy->GetXaxis()->SetTitleOffset(1.1);
3283 currentDummy = dummy->DrawCopy();
3285 latex = new TLatex(0.17, 0.90, "Near side");
3286 latex->SetTextSize(0.04);
3292 box = new TBox(2, 0.87, 2.5, 1.13);
3293 box->SetFillColor(kGray + 1);
3294 box->SetLineColor(kGray + 1);
3297 box2 = new TBox(2, 0.87 * 1.5, 2.5, 1.13 * 1.5);
3298 box2->SetFillColor(kGray + 1);
3299 box2->SetLineColor(kGray + 1);
3304 currentDummy = dummy->DrawCopy();
3309 latex = new TLatex(0.05, 0.90, "Away side");
3310 latex->SetTextSize(0.04);
3314 legend = new TLegend(0.17, 0.65, (iaa != 2) ? 0.53 : 0.82, 0.80);
3315 legend->SetFillColor(0);
3316 legend->SetTextSize(0.04);
3318 for (Int_t i=0; i<2; i++)
3320 nearSideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 0);
3322 nearSidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 0);
3323 awaySideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 1);
3325 awaySidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 1);
3327 RemovePointsBelowX(nearSideCentral, 3);
3328 RemovePointsBelowX(awaySideCentral, 3);
3329 RemovePointsAboveX(nearSideCentral, 10);
3330 RemovePointsAboveX(awaySideCentral, 10);
3332 RemoveXErrors(nearSideCentral); RemoveXErrors(awaySideCentral);
3336 RemovePointsBelowX(nearSidePeripheral, 3);
3337 RemovePointsBelowX(awaySidePeripheral, 3);
3338 RemovePointsAboveX(nearSidePeripheral, 10);
3339 RemovePointsAboveX(awaySidePeripheral, 10);
3340 ShiftPoints(nearSidePeripheral, 0.2);
3341 ShiftPoints(awaySidePeripheral, 0.2);
3342 RemoveXErrors(nearSidePeripheral); RemoveXErrors(awaySidePeripheral);
3345 nearSideCentral->SetMarkerStyle(21);
3346 nearSideCentral->SetLineColor(1);
3347 nearSideCentral->SetMarkerColor(1);
3349 awaySideCentral->SetMarkerStyle(21);
3350 awaySideCentral->SetLineColor(1);
3351 awaySideCentral->SetMarkerColor(1);
3355 nearSidePeripheral->SetMarkerStyle(22);
3356 nearSidePeripheral->SetLineColor(2);
3357 nearSidePeripheral->SetMarkerColor(2);
3359 awaySidePeripheral->SetMarkerStyle(22);
3360 awaySidePeripheral->SetLineColor(2);
3361 awaySidePeripheral->SetMarkerColor(2);
3368 legend->AddEntry(nearSideCentral, "0-5% / Pythia", "P");
3369 legend->AddEntry(nearSidePeripheral, "60-90% / Pythia", "P");
3373 legend->AddEntry(nearSideCentral, "0-20% / Pythia", "P");
3378 const char* style = "PSAME";
3384 DrawSystUnc(nearSideCentral, (iaa == 1), 0);
3385 nearSideCentral->DrawClone(style);
3389 DrawSystUnc(nearSidePeripheral, (iaa == 1), 0);
3390 nearSidePeripheral->DrawClone(style);
3395 DrawSystUnc(awaySideCentral, (iaa == 1), 1);
3396 awaySideCentral->DrawClone(style);
3400 DrawSystUnc(awaySidePeripheral, (iaa == 1), 1);
3401 awaySidePeripheral->DrawClone(style);
3408 // systematic uncertainty stored in graph with _sys appended
3409 TFile::Open("rhic/pi0h_graphs.root");
3411 for (Int_t ptTrigBin=2; ptTrigBin<4; ptTrigBin++)
3413 Bool_t central = kTRUE;
3414 for (Int_t i=0; i<3; i+=2)
3416 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
3417 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d", ptTrigBin, (central) ? 0 : 1, i));
3418 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d_sys", ptTrigBin, (central) ? 0 : 1, i));
3420 rhic_iaa->SetMarkerStyle((ptTrigBin == 2) ? 29 : 30);
3421 rhic_iaa->SetMarkerColor(2);
3422 rhic_iaa->SetLineColor(2);
3423 rhic_iaa_sys->SetLineColor(2);
3424 rhic_iaa_sys->SetMarkerColor(2);
3426 ShiftPoints(rhic_iaa, -0.05 + 0.05 * (ptTrigBin*2-4));
3427 ShiftPoints(rhic_iaa_sys, -0.05 + 0.05 * (ptTrigBin*2-4));
3433 rhic_iaa->Draw("PSAME");
3434 rhic_iaa_sys->Draw("PSAME");
3437 legend->AddEntry(rhic_iaa, Form("PHENIX %s GeV %s%% / pp", (ptTrigBin == 2) ? "7-9" : "9-12", (central) ? "0-20" : "20-60"), "P");
3442 for (Int_t i=0; i<2; i++)
3453 latex = new TLatex(xC, 0.84, "8 GeV/c < p_{T,trig} < 15 GeV/c");
3454 latex->SetTextSize(0.04);
3460 latex = new TLatex(xC, 0.78, "0-5% / 60-90%");
3461 latex->SetTextSize(0.04);
3466 latex = new TLatex(0.5+xC, 0.90, "ALICE preliminary");
3467 latex->SetTextSize(0.04);
3471 latex = new TLatex(0.5+xC, 0.84, "p_{T,assoc} < p_{T,trig}");
3472 latex->SetTextSize(0.04);
3476 latex = new TLatex(xC + 0.5 * i, 0.24, "Points: flat pedestal");
3477 latex->SetTextSize(0.04);
3481 latex = new TLatex(xC + 0.5 * i, 0.18, "Line: v_{2} subtracted");
3482 latex->SetTextSize(0.04);
3488 legend->DrawClone();
3489 legend->SetX1(legend->GetX1()-0.12);
3490 legend->SetX2(legend->GetX2()-0.12);
3494 c->SaveAs(Form("%s.eps", c->GetTitle()));
3495 c->SaveAs(Form("%s.png", c->GetTitle()));
3498 void RemoveXErrors(TGraphErrors* graph)
3500 for (Int_t i=0; i<graph->GetN(); i++)
3501 graph->GetEX()[i] = 0;
3504 void RemovePointsBelowX(TGraphErrors* graph, Float_t minX)
3507 while (i<graph->GetN())
3509 if (graph->GetX()[i] < minX)
3510 graph->RemovePoint(i);
3516 void RemovePointsAboveX(TGraphErrors* graph, Float_t maxX)
3519 while (i<graph->GetN())
3521 if (graph->GetX()[i] > maxX)
3522 graph->RemovePoint(i);
3528 void ShiftPoints(TGraphErrors* graph, Float_t dx)
3531 while (i<graph->GetN())
3533 graph->GetX()[i] += dx;
3538 void DivideGraphs(TGraphErrors* graph1, TGraphErrors* graph2)
3543 for (Int_t bin1 = 0; bin1 < graph1->GetN(); bin1++)
3545 Float_t x = graph1->GetX()[bin1];
3548 for (bin2 = 0; bin2<graph2->GetN(); bin2++)
3549 if (graph2->GetX()[bin2] >= x)
3552 if (bin2 == graph2->GetN())
3556 if (TMath::Abs(graph2->GetX()[bin2-1] - x) < TMath::Abs(graph2->GetX()[bin2] - x))
3559 if (graph1->GetY()[bin1] == 0 || graph2->GetY()[bin2] == 0 || bin2 == graph2->GetN())
3561 Printf("%d %d removed", bin1, bin2);
3562 graph1->RemovePoint(bin1--);
3566 Float_t graph2Extrapolated = graph2->GetY()[bin2];
3567 if (TMath::Abs(x - graph2->GetX()[bin2]) > 0.0001)
3569 Printf("%f %f %d %d not found", x, graph2->GetX()[bin2], bin1, bin2);
3570 graph1->RemovePoint(bin1--);
3574 Float_t value = graph1->GetY()[bin1] / graph2Extrapolated;
3575 Float_t error = value * TMath::Sqrt(TMath::Power(graph1->GetEY()[bin1] / graph1->GetY()[bin1], 2) + TMath::Power(graph2->GetEY()[bin2] / graph2->GetY()[bin2], 2));
3577 graph1->GetY()[bin1] = value;
3578 graph1->GetEY()[bin1] = error;
3580 Printf("%d %d %f %f %f %f", bin1, bin2, x, graph2Extrapolated, value, error);
3584 Float_t ExtractYields(TH1* hist, Int_t trigId, Int_t centralityId, Float_t ptA, Float_t ptW, Int_t caseId, Double_t normUnc)
3586 CreateYieldStructure();
3588 Float_t width = 0.69;
3589 //Float_t width = 0.5;
3590 //Float_t width = 0.85;
3592 //new TCanvas; hist->DrawCopy();
3594 Int_t binBegin = hist->FindBin(-width);
3595 Int_t binEnd = hist->FindBin(width);
3596 Double_t nearSideError = 0;
3597 Float_t nearSideYield = hist->IntegralAndError(binBegin, binEnd, nearSideError) / (binEnd - binBegin + 1);
3598 nearSideError /= (binEnd - binBegin + 1);
3600 Int_t binBegin = hist->FindBin(TMath::Pi() - width);
3601 Int_t binEnd = hist->FindBin(TMath::Pi() + width);
3602 Double_t awaySideError = 0;
3603 Float_t awaySideYield = hist->IntegralAndError(binBegin, binEnd, awaySideError) / (binEnd - binBegin + 1);
3604 awaySideError /= (binEnd - binBegin + 1);
3606 Printf("%d %d %f %d: %f+-%f %f+-%f (%f)", trigId, centralityId, ptA, caseId, nearSideYield, nearSideError, awaySideYield, awaySideError, normUnc);
3608 FillYield(trigId, centralityId, ptA, ptW, caseId, nearSideYield, TMath::Sqrt(nearSideError * nearSideError + normUnc * normUnc), awaySideYield, TMath::Sqrt(awaySideError * awaySideError + normUnc * normUnc));
3610 // store normUnc for error propagation later
3611 TGraphErrors** tmp = yields[2][trigId][centralityId];
3612 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, normUnc);
3614 return awaySideYield;
3617 void FillYield(Int_t trigId, Int_t centralityId, Float_t ptA, Float_t ptW, Int_t caseId, Double_t nearSideYield, Double_t nearSideError, Double_t awaySideYield, Double_t awaySideError)
3619 // CINT limitation here
3620 TGraphErrors** tmp = yields[0][trigId][centralityId];
3621 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, nearSideYield);
3622 tmp[caseId]->SetPointError(tmp[caseId]->GetN()-1, ptW, nearSideError);
3623 //tmp[caseId]->Print();
3625 tmp = yields[1][trigId][centralityId];
3626 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, awaySideYield);
3627 tmp[caseId]->SetPointError(tmp[caseId]->GetN()-1, ptW, awaySideError);
3630 Double_t hypgeo(Double_t a, Double_t b, Double_t c, Double_t z)
3632 // ROOT::Math::hyperg is only defined for |z| < 1
3634 return ROOT::Math::hyperg(a, b, c, z);
3636 // for z < -1 we can use an identity from http://en.wikipedia.org/wiki/Hypergeometric_function
3637 return TMath::Power(1-z, -b) * ROOT::Math::hyperg(c-a, b, c, z / (z-1));
3640 Double_t hypgeoder2(Double_t a, Double_t b, Double_t c, Double_t z)
3642 // derivate of hypgeo with parameter b: d/db hypgeo
3644 static TF1* func = 0;
3646 func = new TF1("hypgeoder2_func", "hypgeo([0], x, [1], [2])");
3648 func->SetParameters(a, c, z);
3649 return func->Derivative(b);
3652 void TsallisYieldUncertainty(Double_t n, Double_t q, Double_t beta, TMatrixDSym covMatrix, Int_t offset, Double_t& yield, Double_t& unc)
3654 gSystem->Load("libMathMore");
3656 TF1 tsallis("tsallis", "[0] * (1-[2]*(1-[1])*x*x)**(1/(1-[1]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
3658 // Integrate[N (1 - b (1 - q) x^2)^(1/(1 - q)), x] --> N x Hypergeometric2F1[1/2, 1/(-1 + q), 3/2, -b (-1 + q) x^2]
3659 // [0] = n, [1] = q, [2] = beta
3660 TF1 tsallisIntegral("tsallisIntegral", "[0]*x*hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x)");
3661 TF1 tsallisIntegralDerN("tsallisIntegralDerN", "x*hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x)");
3663 TF1 tsallisIntegralDerq("tsallisIntegralDerq", "[0]*x*(((1+[2]*([1]-1)*x*x)**(-1/([1]-1))-hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x))/2/([1]-1) - hypgeoder2(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x)/([1]-1)**2)");
3665 TF1 tsallisIntegralDerbeta("tsallisIntegralDerbeta", "[0]*x*((1+[2]*([1]-1)*x*x)**(-1/([1]-1))-hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x))/2/[2]");
3667 const Float_t width = 0.7;
3670 derivates[0] = new TF1("const", "1");
3671 derivates[1] = &tsallisIntegralDerN;
3672 derivates[2] = &tsallisIntegralDerq;
3673 derivates[3] = &tsallisIntegralDerbeta;
3675 Printf("%f %f %f", n, q, beta);
3677 tsallis.SetParameters(n, q, beta);
3678 tsallisIntegral.SetParameters(n, q, beta);
3679 for (Int_t i=1; i<4; i++)
3680 derivates[i]->SetParameters(n, q, beta);
3682 yield = tsallisIntegral.Eval(width) - tsallisIntegral.Eval(-width);
3683 Double_t yield2 = tsallis.Integral(-width, width);
3686 for (Int_t i=0; i<4; i++)
3687 for (Int_t j=0; j<4; j++)
3696 Double_t der1 = (derivates[i]->Eval(width) - derivates[i]->Eval(-width));
3697 Double_t der2 = (derivates[j]->Eval(width) - derivates[j]->Eval(-width));
3699 unc += der1 * der2 * covMatrix(covI, covJ);
3701 Printf("%d %d % .3e % .3e % .3e % .3e", i, j, der1, der2, covMatrix(covI, covJ), unc);
3704 unc = TMath::Sqrt(unc);
3707 yield2 /= width * 2;
3710 Printf("%f (%f) +- %f", yield, yield2, unc);
3713 double NLowestBinAverage(TH1 &h, int N)
3715 // Returns mean content of N lowest bins in h.
3719 std::list<double> content;
3720 std::list<double>::iterator i;
3722 for (int jbin=1; jbin<=h.GetNbinsX(); jbin++) {
3723 content.push_back(h.GetBinContent(jbin));
3727 for (i = content.begin(); i != content.end(); ++i) {
3737 Warning("NLowestBinAverage()",
3738 "Avg. of %d bins requested, %d used", N, counter);
3743 void DrawFlow(Float_t v2, TH1* hist, Float_t ptT, Float_t ptA, TH1* histMixed, Int_t trigId, Int_t centralityId, Int_t caseOffset, Float_t ptACenter, Float_t ptAWidth, Bool_t flatBaseLine = kFALSE, Int_t baseLineDetermination = 0)
3746 // 0 same with v2 (14 tsallis for baseline [28/29 tsallis params]; 15 yield from tsallis function)
3747 // [disabled] 1 same/mixed with v2 (15 tsallis for baseline)
3748 // 2 same no v2 (16 tsallis for baseline; 17 yield from tsallis function)
3749 // 4 same no v2 (18 flat fit 1)
3750 // 5 same no v2 (19 flat fit 2)
3751 // 6 same no v2 (20 flat avg over 2)
3752 // 7 same no v2 (21 flat avg over 4)
3753 // 8 same no v2 (22 flat avg over 8)
3754 // 9 same with v2 (23 flat fit 1)
3755 // 10 same with v2 (24 flat fit 2)
3756 // 11 same with v2 (25 flat avg over 2)
3757 // 12 same with v2 (26 flat avg over 4)
3758 // 13 same with v2 (27 flat avg over 8)
3760 // 30 gaussian fit width
3762 // same stuff for same/mixed
3763 if (0 && caseOffset == 0 && histMixed)
3765 TH1* clone = (TH1*) hist->Clone();
3766 clone->Divide(histMixed);
3767 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 1, ptACenter, ptAWidth);
3770 // same for other baseline subtractions
3771 if (caseOffset == 0)
3773 file = TFile::Open("dphi_corr.root", "UPDATE");
3777 TH1* clone = (TH1*) hist->Clone();
3778 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 2, ptACenter, ptAWidth, kTRUE, 0);
3780 clone = (TH1*) hist->Clone();
3781 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 4, ptACenter, ptAWidth, kTRUE, 1);
3783 clone = (TH1*) hist->Clone();
3784 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 5, ptACenter, ptAWidth, kTRUE, 2);
3786 clone = (TH1*) hist->Clone();
3787 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 6, ptACenter, ptAWidth, kTRUE, 3);
3789 clone = (TH1*) hist->Clone();
3790 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 7, ptACenter, ptAWidth, kTRUE, 4);
3792 clone = (TH1*) hist->Clone();
3793 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 8, ptACenter, ptAWidth, kTRUE, 5);
3795 clone = (TH1*) hist->Clone();
3796 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 9, ptACenter, ptAWidth, kFALSE, 1);
3798 clone = (TH1*) hist->Clone();
3799 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 10, ptACenter, ptAWidth, kFALSE, 2);
3801 clone = (TH1*) hist->Clone();
3802 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 11, ptACenter, ptAWidth, kFALSE, 3);
3804 clone = (TH1*) hist->Clone();
3805 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 12, ptACenter, ptAWidth, kFALSE, 4);
3807 clone = (TH1*) hist->Clone();
3808 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 13, ptACenter, ptAWidth, kFALSE, 5);
3811 Float_t awaySideYield = ExtractYields(hist, trigId, centralityId, ptACenter, ptAWidth, 0 + caseOffset, 0);
3816 /* Float_t v2Trig = flowGraph->Eval(ptT);
3817 Float_t v2Assoc = flowGraph->Eval(ptA);
3818 Float_t v2 = v2Trig * v2Assoc;
3819 Printf("%f %f: %.2f %.2f --> %.4f", ptT, ptA, v2Trig, v2Assoc, v2);*/
3821 TF1* flowFunc = new TF1("flowFunc", "[0] * (1+2*[1]*cos(2*x))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
3826 Float_t minBin = hist->FindBin(0.6);
3827 for (Int_t bin=hist->FindBin(0.6); bin<=hist->FindBin(1.8); bin++)
3828 if (hist->GetBinContent(bin) < hist->GetBinContent(minBin))
3831 Float_t norm = hist->GetBinContent(minBin) / (1 + 2 * v2 * cos(2 * hist->GetBinCenter(minBin)));
3832 Double_t normUnc = 0;
3836 if (baseLineDetermination == 0)
3839 if (centralityId == 0)
3840 hist->Fit("pol0", "0", "", 0.8., 1.2);
3842 hist->Fit("pol0", "0", "", 1.2, 1.6);
3844 //tsallis = new TF1("tsallis", "(1-[1]*(1-[0])*x*x)**(1/(1-[0]))", 0, 10)
3845 // (1-b(1-q)x*x)**(1/(1-q))
3847 // combination of two tsallis functions
3848 total = new TF1("total", "[0] + [1] * (1-[3]*(1-[2])*x*x)**(1/(1-[2])) + [4] * (1-[6]*(1-[5])*(x-TMath::Pi())*(x-TMath::Pi()))**(1/(1-[5]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
3849 //total = new TF1("total", "[0] + [1] * (1-[3]*(1-[2])*x*x)**(1/(1-[2])) + [4] * (1-[6]*(1-[5])*(x-TMath::Pi())*(x-TMath::Pi()))**(1/(1-[5])) + [1] * (1-[3]*(1-[2])*(x-TMath::TwoPi())*(x-TMath::TwoPi()))**(1/(1-[2])) + [4] * (1-[6]*(1-[5])*(x+TMath::Pi())*(x+TMath::Pi()))**(1/(1-[5]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
3850 // the latter is the correct function, but a very wide tsallis on the away side can fake a baseline, and then the baseline is significantly off
3851 total->SetParLimits(0, 0, 10000);
3852 total->SetParLimits(1, 0, 10000);
3853 total->SetParLimits(4, 0, 10000);
3855 total->SetParLimits(2, 1.0000001, 5);
3856 total->SetParLimits(5, 1.0000001, 5);
3858 total->SetParLimits(3, 0.1, 1000);
3859 total->SetParLimits(6, 0.1, 1000);
3861 total->SetParameters(1, 1, 1.5, 3, 1, 1.5, 1.1);
3864 hist->Fit(total, "0RI");
3865 fitResult = hist->Fit(total, "0RSI");
3867 if (0 && fitResult->CovMatrixStatus() > 0)
3869 TMatrixDSym cov(fitResult->GetCovarianceMatrix());
3872 Double_t nearSideYield, nearSideError;
3873 TsallisYieldUncertainty(total->GetParameter(1), total->GetParameter(2), total->GetParameter(3), cov, 0, nearSideYield, nearSideError);
3875 Double_t awaySideYield2, awaySideError;
3876 TsallisYieldUncertainty(total->GetParameter(4), total->GetParameter(5), total->GetParameter(6), cov, 3, awaySideYield2, awaySideError);
3878 FillYield(trigId, centralityId, ptACenter, ptAWidth, 14 + caseOffset + 1, nearSideYield, nearSideError, awaySideYield2, awaySideError);
3880 Printf("Chi2 %f / ndf %d = %f", total->GetChisquare(), total->GetNDF(), (total->GetNDF() > 0) ? total->GetChisquare() / total->GetNDF() : -1);
3882 total->SetLineColor(hist->GetLineColor());
3883 total->SetLineWidth(1);
3884 if (caseOffset == 2)
3887 total->DrawCopy("SAME");
3888 //total->SetParameter(5, total->GetParameter(5) - TMath::Sqrt(cov[5][5]));
3889 //total->DrawCopy("SAME");
3890 //total->SetParameter(5, total->GetParameter(5) + 2 * TMath::Sqrt(cov[5][5]));
3891 //Printf("%f", total->Integral(-0.7,0.7));
3892 //total->DrawCopy("SAME");
3895 if (caseOffset == 0)
3897 // store fit parameters
3900 FillYield(trigId, centralityId, ptACenter, ptAWidth, 28, total->GetParameter(2), total->GetParError(2), total->GetParameter(5), total->GetParError(5));
3902 FillYield(trigId, centralityId, ptACenter, ptAWidth, 29, total->GetParameter(3), total->GetParError(3), total->GetParameter(6), total->GetParError(6));
3907 gausFit = new TF1("gausFit", "[0] + gaus(1) + gaus(4)", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
3908 gausFit->SetParameters(1, 1, 0, 1, 1, TMath::Pi(), 0);
3909 gausFit->SetParLimits(0, 0, 10000);
3910 gausFit->SetParLimits(1, 0, 10000);
3911 gausFit->FixParameter(2, 0);
3912 gausFit->SetParLimits(3, 0.01, 10);
3913 gausFit->SetParLimits(4, 0, 10000);
3914 gausFit->FixParameter(5, TMath::Pi());
3915 gausFit->SetParLimits(6, 0.01, 10);
3917 hist->Fit(gausFit, "0RI");
3918 gausFit->SetLineWidth(1);
3919 gausFit->DrawCopy("SAME");
3921 FillYield(trigId, centralityId, ptACenter, ptAWidth, 30, gausFit->GetParameter(3), total->GetParError(3), total->GetParameter(6), total->GetParError(6));
3925 if (0 && cov[0][0] > 0)
3927 for (Int_t i=0; i<cov.GetNcols(); i++)
3928 for (Int_t j=0; j<cov.GetNrows(); j++)
3929 cov[j][i] /= TMath::Sqrt(cov[i][i]) * TMath::Sqrt(cov[j][j]);
3935 Float_t norm = func->GetParameter(0) / (1 - 2 * v2);
3936 Double_t normUnc = func->GetParError(0) / (1 - 2 * v2);
3939 else if (baseLineDetermination <= 2)
3944 if (baseLineDetermination == 1)
3946 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4, 1.5 * TMath::Pi() - 0.4 };
3947 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4, TMath::Pi() / 2 + 0.4, 1.5 * TMath::Pi() };
3949 else if (baseLineDetermination == 2)
3951 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4 - 0.2, 1.5 * TMath::Pi() - 0.4 - 0.2};
3952 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4 - 0.2, TMath::Pi() / 2 + 0.4 - 0.2, 1.5 * TMath::Pi() };
3958 for (Int_t i=0; i<3; i++)
3960 hist->Fit("pol0", "0Q", "", regionBegin[i], regionEnd[i]);
3961 func = hist->GetFunction("pol0");
3964 sum += func->GetParameter(0) / func->GetParError(0) / func->GetParError(0);
3965 weight += 1. / func->GetParError(0) / func->GetParError(0);
3972 weight = TMath::Sqrt(1. / weight);
3974 Float_t norm = sum / (1 - 2 * v2);
3975 Double_t normUnc = weight / (1 - 2 * v2);
3980 if (baseLineDetermination == 4)
3982 if (baseLineDetermination == 5)
3984 Float_t norm = NLowestBinAverage(*hist, bins);
3985 Double_t normUnc = 0;
3987 Printf("NLowestBinAverage %d --> %f", bins, norm);
3989 norm /= (1 - 2 * v2);
3992 Printf("Baseline: %f +- %f", norm, normUnc);
3995 if (caseOffset == 0)
3997 Float_t awaySideYieldNoBaseline = awaySideYield - norm * (1 - 2 * v2);
3998 Float_t v2YieldNoBaseline = norm * 2 * v2 * (1 + 1.4) / 1.4;
3999 Printf("Relative v2 contribution at centrality = %d, pT,t = %.1f, pT,a = %.1f: %.1f%% (%f %f)", centralityId, ptT, ptA, 100.0 * v2YieldNoBaseline / awaySideYieldNoBaseline, awaySideYieldNoBaseline, v2YieldNoBaseline);
4002 //flowFunc->SetParameters(hist->GetBinContent(hist->FindBin(1.4)) / (1.0 - 2.0 * v2), v2);
4003 flowFunc->SetParameters(norm, v2);
4004 flowFunc->SetLineWidth(1);
4005 if (caseOffset >= 4 && caseOffset <= 9 && caseOffset != 6)
4006 flowFunc->DrawCopy("SAME"); //->SetLineColor(caseOffset - 3);
4008 hist->Add(flowFunc, -1);
4009 if (caseOffset == 0)
4011 file = TFile::Open("dphi_corr.root", "UPDATE");
4012 hist->SetName(TString(hist->GetName()) + "_tsallis_v2");
4015 // hist->DrawCopy("SAME");
4017 if (caseOffset == 2 && flatBaseLine)
4019 file = TFile::Open("dphi_corr.root", "UPDATE");
4020 hist->SetName(TString(hist->GetName()) + "_tsallis_flat");
4023 // hist->DrawCopy("SAME");
4025 if (caseOffset == 4 && flatBaseLine)
4027 file = TFile::Open("dphi_corr.root", "UPDATE");
4028 hist->SetName(TString(hist->GetName()) + "_fit_flat");
4031 // hist->DrawCopy("SAME");
4034 ExtractYields(hist, trigId, centralityId, ptACenter, ptAWidth, 14 + caseOffset, normUnc);
4038 Printf("%f", histMixed->Integral() / histMixed->GetNbinsX());
4039 flowFunc->SetParameters(histMixed->Integral() / histMixed->GetNbinsX(), v2);
4040 flowFunc->SetLineColor(2);
4041 //if (caseOffset == 0)
4042 // flowFunc->DrawCopy("SAME");
4046 void RemoveBaseLine(TH1* hist)
4054 hist->Fit("pol0", "0", "", 1.07, 2.07);
4056 if (!hist->GetFunction("pol0"))
4059 Float_t zyam = hist->GetFunction("pol0")->GetParameter(0);
4066 for (Int_t i=1; i<=hist->GetNbinsX(); i++)
4067 hist->SetBinContent(i, hist->GetBinContent(i) - zyam);
4070 Int_t gHistCount = 0;
4071 void GetDistAndFlow(void* hVoid, void* hMixedVoid, TH1** hist, Float_t& v2, Int_t step, Int_t centralityBegin, Int_t centralityEnd, Float_t ptBegin, Float_t ptEnd, Int_t twoD = 0)
4073 h = (AliUEHistograms*) hVoid;
4074 hMixed = (AliUEHistograms*) hMixedVoid;
4076 *hist = h->GetUEHist(2)->GetUEHist(step, 0, ptBegin, ptEnd, h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityBegin), h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityEnd), twoD);
4078 *hist = (TH1*) (*hist)->Clone(Form("GetDistAndFlow_%d", gHistCount++));
4081 str.Form("%.1f < p_{T,trig} < %.1f", ptBegin - 0.01, ptEnd + 0.01);
4084 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
4087 newTitle.Form("%s - %s - %d-%d%%", str.Data(), str2.Data(), centralityBegin, centralityEnd);
4088 (*hist)->SetTitle(newTitle);
4092 histMixed = hMixed->GetUEHist(2)->GetUEHist(step, 0, ptBegin, ptEnd, hMixed->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityBegin), hMixed->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityEnd));
4094 //new TCanvas; (*hist)->DrawCopy(); histMixed->DrawCopy("SAME")->SetLineColor(2);
4096 Float_t totalPairs = (*hist)->Integral();
4098 (*hist)->Divide(histMixed);
4099 (*hist)->Scale(totalPairs / (*hist)->Integral());
4101 //(*hist)->DrawCopy("SAME")->SetLineColor(4);
4104 // calculate v2trigger
4105 h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
4106 ptDist = h->GetUEHist(2)->GetEventHist()->Project(step, 0);
4107 Float_t v2Trig = CalculateFlow(ptDist, ptBegin, ptEnd, 2, centralityBegin, centralityEnd);
4110 // calculate v2 assoc
4111 cont = h->GetUEHist(2)->GetTrackHist(0);
4112 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(step)->GetGrid()->GetAxis(3)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
4113 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(step)->GetGrid()->GetAxis(2)->SetRangeUser(ptBegin, ptEnd);
4114 ptDist = h->GetUEHist(2)->GetTrackHist(0)->Project(step, 1);
4115 Float_t v2Assoc = CalculateFlow(ptDist, gpTMin, gpTMax, 2, centralityBegin, centralityEnd);
4118 v2 = v2Trig * v2Assoc;
4121 void PlotDeltaPhiDistributions(const char* fileName1, const char* fileName2, Float_t yMax = 0.1, Int_t twoD = 0, Int_t centrBegin = 1, Int_t centrEnd = 1)
4125 Bool_t veryCentral = 0;
4126 Bool_t flowComparison = 0;
4127 Bool_t rhicOverlay = 0;
4128 Bool_t highStatBinning = 1;
4130 file = TFile::Open("dphi_corr.root", "RECREATE");
4133 Int_t leadingPtOffset = 1;
4135 if (veryCentral || flowComparison)
4137 Int_t maxLeadingPt = 2;
4138 Int_t maxAssocPt = 2;
4139 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
4140 //Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 4.0, 6.0, 10.0, 20.0, 40.0 };
4141 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
4143 else if (rhicOverlay) // RHIC binning
4145 Int_t maxLeadingPt = 4;
4146 Int_t maxAssocPt = 5;
4147 Float_t leadingPtArr[] = { 4.0, 5.0, 7.0, 9.0, 12.0 };
4148 Float_t assocPtArr[] = { 0.5, 1.0, 2.0, 3.0, 5.0, 7.0 };
4150 else if (highStatBinning)
4152 Int_t maxLeadingPt = 3;
4153 Int_t maxAssocPt = 2;
4154 Float_t leadingPtArr[] = { 4.0, 6.0, 8.0, 15.0 };
4155 Float_t assocPtArr[] = { 1.0, 4.0, 10.0 };
4157 else // ALICE binning
4161 Int_t maxLeadingPt = 3;
4162 Int_t maxAssocPt = 7;
4163 // Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 10.0, 15.0 };
4164 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
4165 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
4166 leadingPtOffset = 2;
4170 Int_t maxLeadingPt = 1;
4171 Int_t maxAssocPt = 4;
4172 Float_t leadingPtArr[] = { 8.0, 10.0, 15.0, 15.0 };
4173 Float_t assocPtArr[] = { 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
4174 leadingPtOffset = 2;
4178 Int_t nCentralityBins = 5;
4179 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
4180 //Int_t centralityBins[] = { 1, 3, 5, 7, 9, 13 };
4182 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
4183 AliUEHistograms* hMixed = 0;
4185 hMixed = (AliUEHistograms*) GetUEHistogram(fileName1, 0, kTRUE);
4187 AliUEHistograms* h2 = 0;
4189 h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
4191 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
4192 canvas->Divide(maxAssocPt, maxLeadingPt);
4194 TCanvas* canvas2 = new TCanvas("Centrality", "Centrality", 800, 600);
4195 centralityHist = (TH1*) h->GetCentralityDistribution();
4196 NormalizeToBinWidth(centralityHist);
4197 centralityHist->Draw();
4200 TLegend* legend = new TLegend(0.2, 0.5, 0.95, 0.90);
4201 TLegend* legend2 = new TLegend(0.5, 0.63, 0.95, 0.90);
4202 legend2->SetFillColor(0);
4203 legend2->SetTextSize(0.04);
4205 for (Int_t i=0; i<maxLeadingPt; i++)
4206 for (Int_t j=0; j<maxAssocPt; j++)
4209 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+leadingPtOffset]);
4214 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->SetRangeUser(0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
4215 centralityHist = h->GetUEHist(2)->GetEventHist()->ShowProjection(1, 6);
4216 centralityHist->SetLineColor(i+2);
4217 NormalizeToBinWidth(centralityHist);
4218 centralityHist->DrawCopy("SAME");
4219 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->SetRangeUser(0, 0, -1);
4220 legend2->AddEntry(centralityHist, str);
4223 canvas->cd(j+1 + i * maxAssocPt);
4224 gPad->SetLeftMargin(0.15);
4225 gPad->SetBottomMargin(0.2);
4226 gPad->SetTopMargin(0.01);
4227 gPad->SetRightMargin(0.01);
4229 if (i == 0 && j == 3)
4232 gpTMin = assocPtArr[j] + 0.01;
4233 gpTMax = assocPtArr[j+1] - 0.01;
4236 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
4239 // for HI file do not set range in eta anymore after it was changed to delta eta axis
4240 h->SetEtaRange(0, 0);
4244 SetupRanges(h2); // SetEtaRange(0, 0) does not need to be called for the leading track result
4245 h2->SetEtaRange(0, 0);
4250 SetupRanges(hMixed);
4251 hMixed->SetEtaRange(0, 0);
4257 if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
4264 // 40-80% --> 11, 14
4267 TString hist1Str, hist2Str, hist2bStr;
4270 for (Int_t k=0; k<3; k++)
4276 TH1* hist1 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 2); hist1Str = "0-2%";
4277 TH1* hist2 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 2, 3); hist2Str = "2-3%";
4278 TH1* hist2b = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, 10); hist2bStr = "30-40%";
4279 TH1* hist3 = 0; // h2->GetUEHist(2)->GetUEHist(0, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
4281 else if (flowComparison)
4283 TH1* hist1 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 5); hist1Str = "0-5%";
4284 TH1* hist2 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 10); hist2Str = "20-40%";
4285 TH1* hist2b = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, 10); hist2bStr = "30-40%";
4286 TH1* hist3 = 0; // h2->GetUEHist(2)->GetUEHist(0, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
4288 else if (rhicOverlay)
4290 TH1* hist1 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 8); hist1Str = "0-20%";
4291 TH1* hist2 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 12); hist2Str = "20-60%";
4292 TH1* hist2b = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15);hist2bStr = "60-90%";
4293 TH1* hist3 = h2->GetUEHist(2)->GetUEHist(0, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
4301 GetDistAndFlow(h, hMixed, &hist1, v2[0], step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist1Str = "0-5%";
4302 GetDistAndFlow(h, hMixed, &hist2, v2[1], step, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2Str = "0-20%";
4303 // GetDistAndFlow(h, hMixed, &hist2b, v2[2], step, 60, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2bStr = "60-80%";
4304 GetDistAndFlow(h, hMixed, &hist2b, v2[2], step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2bStr = "60-90%";
4306 Printf("%f %f %f", v2[0], v2[1], v2[2]);
4308 // TH1* hist1 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 8); hist1Str = "0-20%";
4309 // TH1* hist2 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 12); hist2Str = "20-60%";
4310 // TH1* hist2b = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15); hist2bStr = "60-90%";
4313 TH1* hist3 = h2->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
4317 RemoveBaseLine(hist1);
4318 RemoveBaseLine(hist2);
4319 RemoveBaseLine(hist2b);
4320 RemoveBaseLine(hist3);
4324 newTitle.Form("%s - %s", str.Data(), str2.Data());
4327 hist1->SetName(Form("dphi_%d_%d_%d", i, j, 0));
4328 hist1->SetTitle(newTitle + " - " + hist1Str);
4332 hist2->SetName(Form("dphi_%d_%d_%d", i, j, 1));
4333 hist2->SetTitle(newTitle + " - " + hist2Str);
4337 hist2b->SetName(Form("dphi_%d_%d_%d", i, j, 2));
4338 hist2b->SetTitle(newTitle + " - " + hist2bStr);
4342 hist3->SetName(Form("dphi_%d_%d_%d", i, j, 3));
4343 hist3->SetTitle(newTitle + " - pp");
4348 hist1->Scale(1.0 / hist1->Integral());
4349 hist2->Scale(1.0 / hist2->Integral());
4350 hist3->Scale(1.0 / hist3->Integral());
4353 if (i == 0 && j == 0)
4355 legend->SetFillColor(0);
4356 legend->AddEntry(hist1, "Pb+Pb 0-5%");
4358 legend->AddEntry(hist2, "Pb+Pb 20-40%");
4360 legend->AddEntry(hist2b, "Pb+Pb 60-90%");
4362 legend->AddEntry(hist3, "p+p 7 TeV");
4363 legend->SetTextSize(0.08);
4366 Prepare1DPlot(hist1);
4367 Prepare1DPlot(hist2);
4368 Prepare1DPlot(hist2b);
4369 Prepare1DPlot(hist3);
4371 Double_t yMin = 0.01;
4372 Double_t yMax2 = yMax;
4376 yMin = -0.01; //TMath::Min(hist1->GetMinimum(), hist2->GetMinimum()) * 0.97;
4377 yMax2 = TMath::Max((hist3) ? hist3->GetMaximum() : 0.0, TMath::Max(hist1->GetMaximum(), (hist2) ? hist2->GetMaximum() : 0.0)) * 1.03;
4382 TH2F* dummy = new TH2F("dummy", "", 100, hist1->GetXaxis()->GetBinLowEdge(1), hist1->GetXaxis()->GetBinUpEdge(hist1->GetNbinsX()), 1000, yMin, yMax2); //TMath::Max(hist1->GetMaximum(), hist2->GetMaximum()) * 1.1);
4383 dummy->SetStats(kFALSE);
4384 dummy->SetXTitle(hist1->GetXaxis()->GetTitle());
4385 dummy->SetYTitle(hist1->GetYaxis()->GetTitle());
4386 dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
4387 Prepare1DPlot(dummy);
4389 dummy->GetYaxis()->SetTitleOffset(0.8);
4391 dummy->GetXaxis()->SetLabelSize(0.08);
4392 dummy->GetYaxis()->SetLabelSize(0.08);
4393 dummy->GetXaxis()->SetTitleSize(0.08);
4394 dummy->GetYaxis()->SetTitleSize(0.08);
4396 dummy->GetYaxis()->SetTitleOffset(0.8);
4399 dummyTmp = dummy->DrawCopy();
4401 hist1->DrawCopy("SAME");
4405 SetupRanges(hMixed);
4406 // for HI file do not set range in eta anymore after it was changed to delta eta axis
4407 hMixed->SetEtaRange(0, 0);
4409 TH1* hist1Mixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 5);
4410 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], hist1Mixed, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
4412 //hist1Mixed->Draw("SAME");
4415 hist2->SetLineColor(2);
4416 hist2->DrawCopy("SAME");
4418 TH1* hist2Mixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 10);
4419 //hist2Mixed->SetLineColor(2);
4420 //hist2Mixed->Draw("SAME");
4422 DrawFlow(v2[1], hist2, leadingPtArr[i], assocPtArr[j], hist2Mixed, i, 1, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
4423 //DrawFlow(GetFlow05(), hist2, leadingPtArr[i], assocPtArr[j], hist2Mixed);
4427 hist2b->SetLineColor(3);
4428 hist2b->DrawCopy("SAME");
4430 TH1* hist2bMixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15);
4431 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], hist2bMixed, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
4432 //DrawFlow(GetFlow05(), hist2b, leadingPtArr[i], assocPtArr[j], hist2bMixed);
4436 hist3->SetLineColor(4);
4437 hist3->DrawCopy("SAME");
4439 DrawFlow(0, hist3, leadingPtArr[i], assocPtArr[j], 0, i, 3, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
4441 //dummyTmp->GetYaxis()->SetRangeUser(0, 1.1 * TMath::Max(TMath::Max(hist1->GetMaximum(), hist2->GetMaximum()), hist2b->GetMaximum()));
4443 else // delta eta delta phi
4447 if (assocPtArr[j] > leadingPtArr[i])
4454 if (assocPtArr[jRef] > leadingPtArr[i])
4458 gpTMin = assocPtArr[jRef] + 0.01;
4459 gpTMax = assocPtArr[jRef+1] - 0.01;
4461 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
4463 // use j for centrality
4464 if (j >= nCentralityBins)
4467 centrBegin = centralityBins[j];
4468 centrEnd = centralityBins[j+1] - 1;
4472 // for HI file do not set range in eta anymore after it was changed to delta eta axis
4473 h->SetEtaRange(0, 0);
4475 SetupRanges(hMixed);
4476 // for HI file do not set range in eta anymore after it was changed to delta eta axis
4477 hMixed->SetEtaRange(0, 0);
4479 TH2* histSame = (TH2*) h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centrBegin, centrEnd, kTRUE);
4480 TH2* histMixed = (TH2*) hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centrBegin, centrEnd, kTRUE);
4483 histSame->Rebin2D(2, 2);
4484 histMixed->Rebin2D(2, 2);
4488 // fit delta eta, assuming no dependence on dphi
4490 //new TCanvas; histMixed->DrawCopy("SURF1");
4492 histMixedproj = histMixed->ProjectionY();
4493 histMixedproj->Scale(1.0 / histMixed->GetNbinsX());
4495 for (Int_t x=1; x<=histMixed->GetNbinsX(); x++)
4496 for (Int_t y=1; y<=histMixed->GetNbinsY(); y++)
4497 histMixed->SetBinContent(x, y, histMixedproj->GetBinContent(y));
4499 //new TCanvas; histMixed->DrawCopy("SURF1");
4502 histSame->SetStats(0);
4503 histSame->GetYaxis()->SetRangeUser(-1.5, 1.5);
4504 histSame->SetTitle("");
4505 histSame->Divide(histMixed);
4506 histSame->DrawCopy("SURF1");
4509 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
4510 latex = new TLatex(0.15, 0.95, str3);
4512 latex->SetTextSize(0.08);
4516 latex = new TLatex(0.55, 0.8, str);
4518 latex->SetTextSize(0.06);
4521 latex = new TLatex(0.55, 0.88, str2);
4523 latex->SetTextSize(0.06);
4526 // if (i == 0) return;
4529 canvas->SaveAs(Form("DeltaPhi_%.2f.png", yMax));
4535 //name.Form("%s_%.2f_%.2f_%.2f_%.2f.png", TString(gSystem->BaseName(fileName1)).Tokenize(".")->First()->GetName(), leadingPtArr[i], leadingPtArr[i+1], assocPtArr[j], assocPtArr[j+1]);
4538 void PlotPtDistributions(const char* fileName1, Int_t centrBegin = 1, Int_t centrEnd = 2)
4542 Int_t maxLeadingPt = 3;
4543 Float_t leadingPtArr[] = { 1.0, 10.0, 20.0, 40.0 };
4545 Int_t nCentralityBins = 5;
4546 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
4548 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
4550 TCanvas* canvas = new TCanvas("Pt", "Pt", 1000, 1000);
4551 canvas->Divide(2, maxLeadingPt+2);
4553 TLegend* legend = new TLegend(0.2, 0.2, 0.95, 0.90);
4554 legend->SetFillColor(0);
4555 legend->SetTextSize(0.08);
4557 TLegend* legendB = new TLegend(0.2, 0.2, 0.95, 0.90);
4558 legendB->SetFillColor(0);
4559 legendB->SetTextSize(0.08);
4561 TLegend* legend2 = new TLegend(0.2, 0.2, 0.95, 0.90);
4562 legend2->SetFillColor(0);
4563 legend2->SetTextSize(0.08);
4565 Int_t colors[] = { 1, 2, 4, 6 };
4566 Int_t markers[] = { 20, 21, 22, 23, 24, 25 };
4568 for (Int_t i=0; i<maxLeadingPt; i++)
4570 Double_t ptMin = leadingPtArr[i] + 0.01;
4571 //Double_t ptMax = leadingPtArr[i+1] - 0.01;
4572 Double_t ptMax = 39.99;
4575 str.Form("%.1f < p_{T,trig} < %.1f", ptMin - 0.01, ptMax + 0.01);
4577 canvas->cd(2*i+1+2);
4578 gPad->SetLeftMargin(0.15);
4579 gPad->SetBottomMargin(0.2);
4580 gPad->SetTopMargin(0.01);
4581 gPad->SetRightMargin(0.01);
4587 TH2F* dummy = new TH2F("dummy", "", 100, 1, 40, 100, 1e-5, 1e3);
4588 dummy->SetStats(kFALSE);
4589 dummy->SetXTitle("p_{T,assoc}");
4590 dummy->SetYTitle("");
4591 dummy->GetYaxis()->SetTitleOffset(1);
4592 Prepare1DPlot(dummy);
4594 dummy->GetXaxis()->SetLabelSize(0.06);
4595 dummy->GetYaxis()->SetLabelSize(0.06);
4596 dummy->GetXaxis()->SetTitleSize(0.06);
4597 dummy->GetYaxis()->SetTitleSize(0.06);
4600 Float_t phiRange[] = { 0, TMath::Pi() / 2, TMath::Pi() };
4601 const char* phiLabels[] = { "Towards", "Transverse", "Away" };
4603 for (Int_t j=0; j<3; j++)
4605 TH1* centralEta = 0;
4610 centralEta = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[j] - TMath::Pi() / 4, phiRange[j] + TMath::Pi() / 4, -0.69, 0.69);
4611 sideEta1 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[j] - TMath::Pi() / 4, phiRange[j] + TMath::Pi() / 4, -1.39, -0.71);
4612 TH1* sideEta2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[j] - TMath::Pi() / 4, phiRange[j] + TMath::Pi() / 4, 0.71, 1.39);
4613 sideEta1->Add(sideEta2); // TODO can be done smarter? what about the errors?
4615 Prepare1DPlot(sideEta1);
4616 Prepare1DPlot(centralEta);
4618 centralEta->SetLineColor(colors[j]);
4619 sideEta1->SetLineColor(colors[j+1]);
4623 legend->AddEntry(centralEta->Clone(), Form("Jet, %s: |#eta| < 0.7, #phi ~ %.1f", phiLabels[j], phiRange[j]));
4624 legend->AddEntry(sideEta1->Clone(), Form("Ridge, %s: 0.7 < |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]));
4629 centralEta = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[j] - TMath::Pi() / 4, phiRange[j] + TMath::Pi() / 4, -1.39, 1.39);
4630 centralEta->Scale(0.5);
4631 centralEta->SetLineColor(colors[j+1]);
4633 Prepare1DPlot(centralEta);
4636 legend->AddEntry(centralEta->Clone(), Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]));
4639 canvas->cd(2*i+1+2);
4640 centralEta->DrawCopy("SAME");
4642 sideEta1->DrawCopy("SAME");
4644 centralEta->SetLineColor(colors[i]);
4645 centralEta->Scale(100.0 / centralEta->Integral());
4648 sideEta1->SetLineColor(colors[i]);
4649 sideEta1->Scale(100.0 / sideEta1->Integral());
4658 gPad->SetLeftMargin(0.15);
4659 gPad->SetBottomMargin(0.2);
4660 gPad->SetTopMargin(0.01);
4661 gPad->SetRightMargin(0.01);
4672 str3.Form("Jet, %s: |#eta| < 0.7, #phi ~ %.1f", phiLabels[j], phiRange[j]);
4674 str3.Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
4675 latex = new TLatex(0.2, 0.3, str3);
4677 latex->SetTextSize(0.08);
4682 legend2->AddEntry(centralEta->Clone(), str);
4684 centralEta->DrawCopy("SAME");
4688 canvas->cd(j*4+4+2);
4691 gPad->SetLeftMargin(0.15);
4692 gPad->SetBottomMargin(0.2);
4693 gPad->SetTopMargin(0.01);
4694 gPad->SetRightMargin(0.01);
4705 str3.Form("Ridge, %s: 0.7 < |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
4707 str3.Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
4708 latex = new TLatex(0.2, 0.3, str3);
4710 latex->SetTextSize(0.08);
4714 sideEta1->DrawCopy("SAME");
4719 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
4720 latex = new TLatex(0.2, 0.3, str3);
4722 latex->SetTextSize(0.08);
4724 latex2 = new TLatex(0.55, 0.8, str);
4726 latex2->SetTextSize(0.06);
4728 canvas->cd(2*i+1+2);
4742 TH1* GetNonSubtractedRHICYield(Int_t ptT, Int_t ptA, Int_t centrality)
4744 rhicFile = TFile::Open("rhic/postcorr_AuAu_iter6_ppg106final.root");
4746 corrFunc = (TH1*) rhicFile->Get(Form("pi0hdphi_%d_%d_%d_2", ptT, ptA, centrality));
4750 corrFunc->Scale(1.0 / corrFunc->Integral());
4752 corrFunc->Scale(TMath::TwoPi() / corrFunc->GetBinWidth(1));
4754 same = (TH1*) rhicFile->Get(Form("pi0hdphi_%d_%d_%d_0", ptT, ptA, centrality));
4755 Float_t nPairs = same->Integral();
4757 triggers = (TH1*) rhicFile->Get(Form("pi0pt_%d_%d", ptT, centrality));
4758 Float_t nTrigs = triggers->Integral();
4760 graph = (TGraph*) rhicFile->Get(Form("gS_%d_%d", ptT, centrality));
4762 Printf("%f %f %f %f", nPairs, nTrigs, nPairs / nTrigs, graph->GetY()[ptA]);
4764 corrFunc->Scale(nPairs / nTrigs);
4766 //corrFunc->Add(new TF1("func", "1", -5, 5), -1. / 3 * (corrFunc->GetBinContent(corrFunc->FindBin(1.5)) + corrFunc->GetBinContent(corrFunc->FindBin(1.2)) + corrFunc->GetBinContent(corrFunc->FindBin(1.0))));
4771 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4, 1.5 * TMath::Pi() - 0.4 };
4772 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4, TMath::Pi() / 2 + 0.4, 1.5 * TMath::Pi() };
4777 for (Int_t i=0; i<3; i++)
4779 corrFunc->Fit("pol0", "0Q", "", regionBegin[i], regionEnd[i]);
4780 func = corrFunc->GetFunction("pol0");
4783 sum += func->GetParameter(0) / func->GetParError(0) / func->GetParError(0);
4784 weight += 1. / func->GetParError(0) / func->GetParError(0);
4791 weight = TMath::Sqrt(1. / weight);
4793 corrFunc->Add(new TF1("func", "1", -5, 5), -sum);
4799 compHist = (TH1*) rhicFile->Get(Form("ptyMSMP_0_%d%d%d", ptT, ptA, centrality));
4800 compHist->DrawCopy("SAME");
4802 //compHist->Add((TF1*) compHist->GetListOfFunctions()->First());
4803 //compHist->DrawCopy("SAME");
4806 void DeltaPhiVsRHIC(Int_t rhicCentrality = 0, Int_t aliceCentrality = 0, Bool_t reduced = kFALSE)
4808 aliceFile = TFile::Open("alice_dphi_corr_rhicbinning.root");
4809 rhicFile = TFile::Open("rhic/postcorr_AuAu_iter6_ppg106final.root");
4811 Int_t maxLeadingPt = 4;
4812 Int_t maxAssocPt = 5;
4816 Int_t maxSelected = 4;
4817 Int_t selectedLead[] = { 0, 0, 2, 2 };
4818 Int_t selectedAssoc[] = { 1, 2, 3, 4 };
4820 maxLeadingPt = TMath::Sqrt(maxSelected);
4821 maxAssocPt = TMath::Sqrt(maxSelected);
4824 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
4825 canvas->Divide(maxAssocPt, maxLeadingPt);
4827 for (Int_t i=0; i<maxLeadingPt; i++)
4828 for (Int_t j=0; j<maxAssocPt; j++)
4830 Printf("%d %d", i, j);
4832 canvas->cd(j+1 + i * maxAssocPt);
4833 gPad->SetLeftMargin(0.15);
4834 gPad->SetBottomMargin(0.2);
4835 //gPad->SetTopMargin(0.01);
4836 gPad->SetRightMargin(0.01);
4843 iSel = selectedLead[j + i * maxAssocPt];
4844 jSel = selectedAssoc[j + i * maxAssocPt];
4847 //rhic = (TH1*) rhicFile->Get(Form("VptyMSMP_0_%d%d%d", iSel, jSel, rhicCentrality));
4848 rhic = GetNonSubtractedRHICYield(iSel, jSel, rhicCentrality);
4851 rhic->SetLineColor(2);
4852 rhic->SetMarkerStyle(1);
4854 alice = (TH1*) aliceFile->Get(Form("dphi_%d_%d_%d_fit_flat", iSel, jSel, aliceCentrality));
4858 // match near side yield
4861 Float_t factor = 0.5 * alice->Integral(alice->FindBin(-0.1), alice->FindBin(0.1)) / rhic->Integral(rhic->FindBin(-0.1), rhic->FindBin(0.1));
4863 Printf("%f", factor);
4864 rhic->Scale(factor);
4867 alice->SetLineColor(1);
4869 //alice->Rebin(36); rhic->Rebin(30);
4871 clone = alice->DrawCopy("");
4872 rhic->DrawCopy("SAME");
4874 //Printf("chi2 test: chi2/ndf = %f", alice->Chi2Test(rhic, "WW CHI2/NDF"));
4877 for (Int_t k=1; k<=rhic->GetNbinsX(); k++)
4879 chi2 += TMath::Power(rhic->GetBinContent(k) - alice->Interpolate(rhic->GetBinCenter(k)), 2) / (TMath::Power(rhic->GetBinError(k), 2) + TMath::Power(alice->GetBinError(alice->FindBin(rhic->GetBinCenter(k))), 2));
4884 Printf("chi2 test: chi2/ndf = %f", chi2);
4886 clone->GetYaxis()->SetRangeUser(TMath::Min(alice->GetMinimum(), rhic->GetMinimum()) * 1.1, TMath::Max(alice->GetMaximum(), rhic->GetMaximum()) * 1.1);
4888 for (Int_t bin=1; bin<=rhic->GetNbinsX(); bin++)
4890 Double_t aliceValue = alice->GetBinContent(alice->FindBin(rhic->GetXaxis()->GetBinCenter(bin)));
4891 if (aliceValue == 0)
4893 rhic->SetBinContent(bin, rhic->GetBinContent(bin) / aliceValue);
4894 rhic->SetBinError(bin, 0);
4900 rhic->SetLineColor(3);
4901 //rhic->DrawCopy("SAME");
4906 canvas->SaveAs("yield_comparison.png");
4909 void DeltaPhi(const char* fileName, const char* fileName2 = 0, Bool_t reduced = kFALSE, Bool_t ppComparison = kFALSE, Int_t mode = 0, const char* dataTag = "")
4911 // DeltaPhi("high_stat_binning_pp7_pt8.root", "high_stat_binning_pp7_pythia_pt8.root", 0, 1, 0, "pp 7 TeV")
4912 // DeltaPhi("high_stat_binning_pp900_pt8.root", "high_stat_binning_pp900_pythia_pt8.root", 0, 1, 0, "pp 0.9 TeV")
4916 aliceFile = TFile::Open(fileName);
4918 secondFile = TFile::Open(fileName2);
4920 Int_t maxLeadingPt = 3;
4921 Int_t maxAssocPt = 2;
4925 Int_t maxSelected = 4;
4926 Int_t selectedLead[] = { 0, 0, 2, 2 };
4927 Int_t selectedAssoc[] = { 1, 2, 3, 4 };
4929 maxLeadingPt = TMath::Sqrt(maxSelected);
4930 maxAssocPt = TMath::Sqrt(maxSelected);
4933 factorGraph = new TGraphErrors;
4935 TCanvas* canvas = new TCanvas(Form("%s_%s", fileName, fileName2 ? fileName2 : ""), Form("%s_%s", fileName, fileName2 ? fileName2 : ""), 800, 1200);
4936 canvas->Divide(maxAssocPt, maxLeadingPt);
4938 for (Int_t i=0; i<maxLeadingPt; i++)
4939 for (Int_t j=0; j<maxAssocPt; j++)
4942 TH1* peripheral = 0;
4943 for (Int_t aliceCentrality=0; aliceCentrality<4; aliceCentrality++)
4945 Printf("%d %d %d", i, j, aliceCentrality);
4947 canvas->cd(j+1 + i * maxAssocPt);
4951 Int_t centralitySel = aliceCentrality;
4952 currentFile = aliceFile;
4956 iSel = selectedLead[j + i * maxAssocPt];
4957 jSel = selectedAssoc[j + i * maxAssocPt];
4965 if (aliceCentrality == 1)
4966 currentFile = secondFile;
4967 else if (aliceCentrality == 2)
4971 if (aliceCentrality == 3)
4972 currentFile = secondFile;
4975 //alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", iSel, jSel, centralitySel, (centralitySel < 3) ? "_tsallis_flat" : ((flatOrTsallis) ? "" : "_fit_flat")));
4976 alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", iSel, jSel, centralitySel, "_fit_flat"));
4980 // match near side yield to peripheral
4981 if (1 && centralitySel == 3 && peripheral)
4983 if (mode == 0 || mode == 1)
4985 Double_t width = 0.5;
4986 Double_t error1, error2;
4987 Double_t integral1 = peripheral->IntegralAndError(peripheral->FindBin(-width), peripheral->FindBin(width), error1);
4988 Double_t integral2 = alice->IntegralAndError(alice->FindBin(-width), alice->FindBin(width), error2);
4991 Double_t tmpErr = 0;
4992 integral1 += peripheral->IntegralAndError(peripheral->FindBin(TMath::Pi() - width), peripheral->FindBin(TMath::Pi() + width), tmpErr);
4993 error1 = TMath::Sqrt(error1 * error1 + tmpErr * tmpErr);
4995 integral2 += alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), tmpErr);
4996 error2 = TMath::Sqrt(error2 * error2 + tmpErr * tmpErr);
5001 Double_t error1, error2;
5002 Double_t integral1 = peripheral->IntegralAndError(1, peripheral->GetNbinsX(), error1);
5003 Double_t integral2 = alice->IntegralAndError(1, alice->GetNbinsX(), error2);
5007 Double_t width = 1.0;
5008 Double_t error1, error2;
5009 Double_t integral1 = peripheral->IntegralAndError(peripheral->FindBin(TMath::Pi() - width), peripheral->FindBin(TMath::Pi() + width), error1);
5010 Double_t integral2 = alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), error2);
5013 Double_t factor = integral1 / integral2;
5015 //factor = 0.804 * 0.9;
5016 Printf("%f", factor);
5017 alice->Scale(factor);
5018 factorGraph->SetPoint(factorGraph->GetN(), factorGraph->GetN(), factor);
5019 factorGraph->SetPointError(factorGraph->GetN() - 1, 0, factor * TMath::Sqrt(TMath::Power(error1 / integral1, 2) + TMath::Power(error2 / integral2, 2)));
5022 if (ppComparison && aliceCentrality == 0)
5024 else if (aliceCentrality == 2)
5027 alice->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
5028 alice->SetXTitle("#Delta#phi (rad.)");
5029 alice->SetLineColor(aliceCentrality+1);
5030 alice->SetLineWidth(2);
5031 alice->SetMarkerColor(aliceCentrality+1);
5032 alice->GetYaxis()->SetTitleOffset(1.7);
5033 clone = alice->DrawCopy((aliceCentrality > 0) ? "SAME" : "");
5034 clone->SetTitle("");
5036 TString str(alice->GetTitle());
5037 str.ReplaceAll(" - ", "#");
5038 tokens = str.Tokenize("#");
5040 if (aliceCentrality == 0)
5042 for (Int_t k=0; k<2; k++)
5044 TString str(tokens->At(k)->GetName());
5045 str.ReplaceAll(".0", "");
5046 str.ReplaceAll("< p", "GeV/c < p");
5048 latex = new TLatex(0.52, 0.92-k*0.06, str);
5050 latex->SetTextSize(0.04);
5058 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), clone->GetMinimum()), TMath::Max(first->GetMaximum(), clone->GetMaximum()));
5065 //first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.2);
5066 first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.5);
5069 for (Int_t i=1; i<=6; i++)
5073 latex = new TLatex(0.6, 0.8, "ALICE preliminary");
5074 latex->SetTextSize(0.04);
5078 latex = new TLatex(0.6, 0.74, Form("%s uncorrected", dataTag));
5079 latex->SetTextSize(0.04);
5083 latex = new TLatex(0.6, 0.68, "Stat. uncertainties only");
5084 latex->SetTextSize(0.04);
5090 legend = new TLegend(0.3, 0.8, 0.47, 0.95);
5091 legend->SetFillColor(0);
5092 legend->SetTextSize(0.04);
5093 legend->AddEntry(peripheral, "Data");
5094 legend->AddEntry(alice, "Pythia");
5099 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
5100 canvas->SaveAs(Form("%s.png", canvas->GetName()));
5103 peripheral->Divide(alice);
5104 peripheral->DrawCopy();
5105 //alice->DrawCopy("SAME");
5108 graphCanvas = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("graphCanvas");
5109 factorGraph->SetMarkerStyle(20);
5112 graphCanvas = new TCanvas("graphCanvas", "graphCanvas", 800, 600);
5113 factorGraph->Draw("AP");
5118 factorGraph->SetLineColor(2);
5119 factorGraph->SetMarkerColor(2);
5120 factorGraph->Draw("SAMEP");
5122 factorGraph->GetYaxis()->SetRangeUser(0.6, 1.4);
5124 factorGraph->Print();
5127 void ComparePPYields(const char* histName = "_fit_flat")
5129 const char* files[] = { "high_stat_binning_pp900_pt8.root", "high_stat_binning_pp900_pythia_pt8.root", "high_stat_binning_pp276_pythia_pt8.root", "high_stat_binning_pp7_pythia_pt8.root", "high_stat_binning_pp7_pt8.root" };
5130 const char* titles[] = { "0.9 data", "0.9 Pythia", "2.76 Pythia", "7 Pythia", "7 data" };
5132 Int_t colors[] = { 1, 2, 3, 4, 6 };
5134 Int_t maxLeadingPt = 3;
5135 Int_t maxAssocPt = 2;
5137 TCanvas* canvas = new TCanvas("ComparePPYields", "ComparePPYields", 600, 900);
5138 canvas->Divide(maxAssocPt, maxLeadingPt);
5140 legend = new TLegend(0.5, 0.5, 0.8, 0.8);
5141 legend->SetFillColor(0);
5143 TGraphErrors** graphs = new TGraphErrors*[5];
5144 TGraphErrors** graphs2 = new TGraphErrors*[5];
5146 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
5148 graphs[nFiles] = new TGraphErrors;
5149 graphs2[nFiles] = new TGraphErrors;
5152 for (Int_t i=0; i<maxLeadingPt; i++)
5153 for (Int_t j=0; j<maxAssocPt; j++)
5155 canvas->cd(j+1 + i * maxAssocPt);
5156 gPad->SetLeftMargin(0.18);
5157 gPad->SetBottomMargin(0.1);
5158 gPad->SetTopMargin(0.01);
5159 gPad->SetRightMargin(0.01);
5163 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
5165 currentFile = TFile::Open(files[nFiles]);
5167 Int_t aliceCentrality = 3;
5169 Printf("%d %d %d", i, j, nFiles);
5171 alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, histName));
5175 alice->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
5176 alice->SetLineColor(colors[nFiles]);
5177 alice->SetMarkerColor(colors[nFiles]);
5178 alice->GetYaxis()->SetTitleOffset(1.7);
5179 clone = alice->DrawCopy((nFiles > 0) ? "SAME" : "");
5180 clone->SetTitle("");
5182 Double_t width = 0.7;
5183 Double_t error, error2;
5184 Double_t integral = alice->IntegralAndError(alice->FindBin(-width), alice->FindBin(width), error);
5185 Double_t integral2 = alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), error2);
5187 graphs[nFiles]->SetPoint(graphs[nFiles]->GetN(), j + i * maxAssocPt - 0.2, integral);
5188 graphs[nFiles]->SetPointError(graphs[nFiles]->GetN()-1, 0, error);
5190 graphs2[nFiles]->SetPoint(graphs2[nFiles]->GetN(), j + i * maxAssocPt + 0.2, integral2);
5191 graphs2[nFiles]->SetPointError(graphs2[nFiles]->GetN()-1, 0, error2);
5196 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), clone->GetMinimum()), TMath::Max(first->GetMaximum(), clone->GetMaximum()));
5200 TString str(alice->GetTitle());
5201 str.ReplaceAll(" - ", "#");
5202 tokens = str.Tokenize("#");
5204 for (Int_t k=0; k<2; k++)
5206 latex = new TLatex(0.6, 0.88-k*0.07, tokens->At(k)->GetName());
5208 latex->SetTextSize(0.04);
5213 if (i == 0 && j == 0)
5214 legend->AddEntry(clone, titles[nFiles]);
5217 first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.1);
5225 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
5227 graphs[nFiles]->SetMarkerStyle(25);
5228 graphs[nFiles]->SetLineColor(colors[nFiles]);
5229 graphs[nFiles]->SetMarkerColor(colors[nFiles]);
5230 clone2 = (TGraphErrors*) graphs[nFiles]->DrawClone((nFiles == 0) ? "AP" : "PSAME");
5231 clone2->GetYaxis()->SetRangeUser(0, 5);
5233 graphs2[nFiles]->SetMarkerStyle(26);
5234 graphs2[nFiles]->SetLineColor(colors[nFiles]);
5235 graphs2[nFiles]->SetMarkerColor(colors[nFiles]);
5236 graphs2[nFiles]->DrawClone("PSAME");
5240 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
5242 DivideGraphs(graphs[nFiles], graphs[4]);
5243 DivideGraphs(graphs2[nFiles], graphs2[4]);
5245 graphs[nFiles]->SetMarkerStyle(25);
5246 graphs[nFiles]->SetLineColor(colors[nFiles]);
5247 graphs[nFiles]->SetMarkerColor(colors[nFiles]);
5248 clone2 = (TGraphErrors*) graphs[nFiles]->DrawClone((nFiles == 0) ? "AP" : "PSAME");
5249 clone2->GetYaxis()->SetRangeUser(0, 1.5);
5251 graphs2[nFiles]->SetMarkerStyle(26);
5252 graphs2[nFiles]->SetLineColor(colors[nFiles]);
5253 graphs2[nFiles]->SetMarkerColor(colors[nFiles]);
5254 graphs2[nFiles]->DrawClone("PSAME");
5258 void DeltaPhiPreliminary(const char* fileName, const char* histName)
5262 currentFile = TFile::Open(fileName);
5264 TCanvas* canvas = new TCanvas(Form("dphi%s", histName), "dphi", 800, 800);
5265 canvas->Divide(2, 2);
5267 TLegend* legend = new TLegend(0.55, 0.47, 0.85, 0.65);
5268 legend->SetFillColor(0);
5269 legend->SetTextSize(0.04);
5271 Int_t colors[] = { 1, 2, 4, 6 };
5274 for (Int_t i=1; i<2; i++)
5275 for (Int_t j=2; j<6; j++)
5279 for (Int_t aliceCentrality=0; aliceCentrality<3; aliceCentrality+=2)
5281 Printf("%d %d %d", i, j, aliceCentrality);
5283 hist = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, histName));
5287 if (aliceCentrality == 3)
5288 hist->Scale(kPythiaScalingFactor);
5290 hist->GetYaxis()->SetTitleOffset(1.9);
5291 hist->SetLineColor(colors[aliceCentrality]);
5292 hist->SetMarkerColor(colors[aliceCentrality]);
5293 hist->SetLineWidth(2);
5294 hist->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
5295 hist->SetXTitle("#Delta#phi (rad.)");
5297 clone = hist->DrawCopy((aliceCentrality > 0) ? "SAME" : "");
5298 clone->SetTitle("");
5300 TString str(hist->GetTitle());
5301 str.ReplaceAll(" - ", "#");
5302 tokens = str.Tokenize("#");
5305 if (aliceCentrality == 0)
5307 for (Int_t k=0; k<2; k++)
5309 TString str(tokens->At(k)->GetName());
5310 str.ReplaceAll(".0", "");
5311 str.ReplaceAll("< p", "GeV/c < p");
5314 latex = new TLatex(0.5, 0.88-k*0.06, str);
5316 latex->SetTextSize(0.04);
5320 latex = new TLatex(0.5, 0.76, "ALICE preliminary");
5321 latex->SetTextSize(0.04);
5325 latex = new TLatex(0.5, 0.70, "Stat. uncertainties only");
5326 latex->SetTextSize(0.04);
5330 clone->GetYaxis()->SetRangeUser(0, clone->GetMaximum() * 1.2);
5335 if (aliceCentrality == 3)
5336 legend->AddEntry(hist, "Pythia");
5338 legend->AddEntry(hist, tokens->At(2)->GetName());
5348 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
5349 canvas->SaveAs(Form("%s.png", canvas->GetName()));
5352 void DeltaPhiBaseLinePreliminary(const char* fileName)
5358 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
5359 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
5360 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
5366 gpTMin = assocPtArr[j] + 0.01;
5367 gpTMax = assocPtArr[j+1] - 0.01;
5371 str.Form("%.0f GeV/c < p_{T,trig} < %.0f GeV/c", leadingPtArr[i], leadingPtArr[i+2]);
5374 str2.Form("%.0f GeV/c < p_{T,assoc} < %.0f GeV/c", gpTMin - 0.01, gpTMax + 0.01);
5380 GetDistAndFlow(h, 0, &hist1, v2[0], step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
5381 GetDistAndFlow(h, 0, &hist2b, v2[2], step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
5383 hist1->SetLineWidth(2);
5384 hist2b->SetLineWidth(2);
5386 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 1200, 1200);
5387 canvas->Divide(2, 2);
5390 // gPad->SetLeftMargin(0.20);
5392 hist1->GetYaxis()->SetTitleOffset(1.9);
5393 hist1->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
5394 hist1->SetXTitle("#Delta#phi (rad.)");
5395 hist1->SetTitle("");
5396 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0, 0.59);
5398 DrawFlow(v2[0], (TH1*) hist1->Clone(), leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5400 latex = new TLatex(0.5, 0.78, "0-5%");
5402 latex->SetTextSize(0.04);
5408 // gPad->SetLeftMargin(0.20);
5410 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.18, 0.295);
5411 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5416 // gPad->SetLeftMargin(0.20);
5418 hist2b->GetYaxis()->SetTitleOffset(1.9);
5419 hist2b->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
5420 hist2b->SetXTitle("#Delta#phi (rad.)");
5421 hist2b->SetTitle("");
5424 DrawFlow(v2[2], (TH1*) hist2b->Clone(), leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5426 latex = new TLatex(0.5, 0.78, "60-90%");
5428 latex->SetTextSize(0.04);
5432 // gPad->SetLeftMargin(0.20);
5434 hist2b->DrawCopy()->GetYaxis()->SetRangeUser(0.01, 0.13);
5435 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5440 for (Int_t i=1; i<=4; i++)
5444 latex = new TLatex(0.5, 0.84, str);
5446 latex->SetTextSize(0.04);
5449 latex = new TLatex(0.5, 0.90, str2);
5451 latex->SetTextSize(0.04);
5454 latex = new TLatex(0.5, 0.72, "ALICE preliminary");
5455 latex->SetTextSize(0.04);
5459 latex = new TLatex(0.5, 0.66, "Stat. uncertainties only");
5460 latex->SetTextSize(0.04);
5465 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
5466 canvas->SaveAs(Form("%s.png", canvas->GetName()));
5469 void DeltaPhiRidgePreliminary(const char* fileName)
5475 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
5476 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
5477 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
5483 gpTMin = assocPtArr[j] + 0.01;
5484 gpTMax = assocPtArr[j+1] - 0.01;
5488 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+2]);
5491 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
5497 TH1* hist2bPeak = 0;
5498 TH1* hist1Ridge = 0;
5499 TH1* hist2bRidge = 0;
5501 GetDistAndFlow(h, 0, &hist1, v2[0], step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
5502 // GetDistAndFlow(h, 0, &hist2b, v2[2], step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
5503 GetDistAndFlow(h, 0, &hist1Peak, v2[0], step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 10);
5505 GetDistAndFlow(h, 0, &hist1Ridge, v2[0], step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 11);
5509 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 800, 800);
5510 canvas->Divide(2, 2);
5513 gPad->SetLeftMargin(0.20);
5515 hist1->GetYaxis()->SetTitleOffset(1.9);
5516 hist1->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
5517 hist1->SetTitle("");
5520 /* hist1Peak->Scale(1./0.75);
5521 hist1Ridge->Scale(1./0.25);*/
5523 hist1Peak->SetLineColor(2);
5524 hist1Peak->DrawCopy("SAME");
5526 hist1Ridge->SetLineColor(4);
5527 hist1Ridge->DrawCopy("SAME");
5529 // hist1Peak->Add(hist1Ridge);
5530 // hist1Peak->DrawCopy("SAME")->SetLineColor(3);
5534 DrawFlow(v2[0], (TH1*) hist1->Clone(), leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5536 latex = new TLatex(0.65, 0.84, str);
5538 latex->SetTextSize(0.04);
5541 latex = new TLatex(0.65, 0.90, str2);
5543 latex->SetTextSize(0.04);
5546 latex = new TLatex(0.84, 0.78, "0-5%");
5548 latex->SetTextSize(0.04);
5552 gPad->SetLeftMargin(0.20);
5554 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.18, 0.28);
5555 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5559 latex = new TLatex(0.5, 0.90, "ALICE preliminary");
5560 latex->SetTextSize(0.04);
5564 latex = new TLatex(0.5, 0.84, "Statistical uncertainties only");
5565 latex->SetTextSize(0.04);
5570 gPad->SetLeftMargin(0.20);
5572 hist2b->GetYaxis()->SetTitleOffset(1.9);
5573 hist2b->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
5574 hist2b->SetTitle("");
5577 DrawFlow(v2[2], (TH1*) hist2b->Clone(), leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5579 latex = new TLatex(0.84, 0.78, "60-90%");
5581 latex->SetTextSize(0.04);
5585 gPad->SetLeftMargin(0.20);
5587 hist2b->DrawCopy()->GetYaxis()->SetRangeUser(0.01, 0.1);
5588 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5592 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
5593 canvas->SaveAs(Form("%s.png", canvas->GetName()));
5596 void MCScalingFactor(Int_t caseId)
5599 // x[5]=5, y[5]=0.813743, ex[5]=0, ey[5]=0.158446
5600 // x[5]=5, y[5]=1.09804, ex[5]=0, ey[5]=0.265434
5602 // x[5]=5, y[5]=1.02276, ex[5]=0, ey[5]=0.0199991
5603 // x[5]=5, y[5]=0.870247, ex[5]=0, ey[5]=0.0294444
5605 Float_t factors[] = { 0.814, 1.098, 1.022, 0.870 };
5606 Float_t errors[] = { 0.158, 0.265, 0.020, 0.029 };
5610 for (Int_t i=0; i<2; i++)
5615 avgs[i] = factors[2*i] / errors[2*i] / errors[2*i] + factors[2*i+1] / errors[2*i+1] / errors[2*i+1];
5616 avgs[i] /= 1. / errors[2*i] / errors[2*i] + 1. / errors[2*i+1] / errors[2*i+1];
5620 avgs[i] = factors[2*i];
5624 avgs[i] = factors[2*i+1];
5628 avgs[0] = factors[0];
5629 avgs[1] = factors[3];
5633 avgs[0] = factors[1];
5634 avgs[1] = factors[2];
5639 Float_t a = avgs[0];
5640 Float_t b = avgs[1];
5642 Printf("%f %f", a, b);
5644 Float_t linEx = a + (b-a)/(7.-0.9) * (2.76-0.9);
5645 Float_t logEx = a + (b-a)/(log(7.)-log(0.9)) * (log(2.76)-log(0.9));
5647 Printf("%f %f", linEx, logEx);
5650 void CompareDeltaPhi(const char* fileName1, const char* fileName2, Int_t centralityID, const char* dist = "_fit_flat", Bool_t reduced = kFALSE)
5652 firstFile = TFile::Open(fileName1);
5653 secondFile = TFile::Open(fileName2);
5655 Int_t maxLeadingPt = 3;
5656 Int_t maxAssocPt = 7;
5657 Int_t minLeadingPt = 0;
5658 Int_t minAssocPt = 0;
5668 TCanvas* canvas = new TCanvas(Form("%s %s", fileName1, fileName2 ? fileName2 : ""), Form("%s %s", fileName1, fileName2 ? fileName2 : ""), 1000, 700);
5669 canvas->Divide(maxAssocPt-minAssocPt, maxLeadingPt-minLeadingPt);
5671 for (Int_t i=minLeadingPt; i<maxLeadingPt; i++)
5672 for (Int_t j=minAssocPt; j<maxAssocPt; j++)
5674 Printf("%d %d", i, j);
5676 canvas->cd(j+1-minAssocPt + (i-minLeadingPt) * maxAssocPt);
5677 gPad->SetLeftMargin(0.15);
5678 gPad->SetBottomMargin(0.2);
5679 //gPad->SetTopMargin(0.01);
5680 gPad->SetRightMargin(0.01);
5682 hist1 = (TH1*) firstFile->Get(Form("dphi_%d_%d_%d%s", i, j, centralityID, dist));
5683 hist2 = (TH1*) secondFile->Get(Form("dphi_%d_%d_%d%s", i, j, centralityID, dist));
5687 hist1->SetLineColor(1);
5688 hist2->SetLineColor(2);
5690 hist1->DrawCopy()->GetYaxis()->SetRangeUser(hist1->GetMinimum(), hist1->GetMaximum() * 1.2);
5691 hist2->DrawCopy("SAME");
5693 if (strlen(dist) == 0)
5694 Printf("chi2 test: %f", hist1->Chi2Test(hist2, "UU NORM CHI2/NDF"));
5696 //DrawRatio(hist1, hist2, hist1->GetTitle());
5702 TH1* MACHCone(const char* fileName, Int_t centrality, const char* drawingOption, Bool_t plotContributions, Int_t twoD)
5706 TFile::Open("machcone_input.root");
5711 hist = (TH1*) gFile->Get("dphi_0_0_0");
5715 hist = (TH1*) gFile->Get("dphi_1_1_0");
5719 hist = (TH1*) gFile->Get("dphi_0_0_2");
5723 hist = (TH1*) gFile->Get("dphi_1_1_2");
5731 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
5733 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
5734 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
5736 Int_t i = centrality % 2;
5739 gpTMin = assocPtArr[i] + 0.01;
5740 gpTMax = assocPtArr[i+1] - 0.01;
5742 Int_t centralityBegin = 0;
5743 Int_t centralityEnd = 2;
5745 if (centrality >= 2)
5747 centralityBegin = 30;
5755 GetDistAndFlow(h, 0, &hist, v2[0], step, centralityBegin, centralityEnd, leadingPtArr[i] + 0.01, leadingPtArr[i+1] - 0.01, twoD);
5759 TString str(hist->GetTitle());
5760 str.ReplaceAll(" - ", "#");
5761 tokens = str.Tokenize("#");
5764 hist->SetLineColor(1);
5765 hist->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
5766 hist->SetXTitle("#Delta#phi (rad.)");
5767 hist = hist->DrawCopy(drawingOption);
5769 for (Int_t i=0; i<tokens->GetEntries(); i++)
5771 latex = new TLatex(0.6, 0.8-i*0.05, tokens->At(i)->GetName());
5773 latex->SetTextSize(0.04);
5777 // From CalculateFlow(...) above
5778 // v_{2} = 0.042293 for 1.000000 < pT < 2.000000
5779 // v_{2} = 0.060797 for 2.000000 < pT < 4.000000
5780 // v_{3} = 0.040318 for 1.000000 < pT < 2.000000
5781 // v_{3} = 0.077353 for 2.000000 < pT < 4.000000
5782 // v_{4} = 0.020557 for 1.000000 < pT < 2.000000
5783 // v_{4} = 0.056187 for 2.000000 < pT < 4.000000
5784 //Double_t vn[] = { 0, 0.042293 * 0.060797, 0.040318 * 0.077353, 0.020557 * 0.056187 };
5788 case 0: // 0-2%, 1-2 times 2-3
5789 /* v_{2} = 0.042240 for 1.000000 < pT < 2.000000
5790 v_{2} = 0.060385 for 2.000000 < pT < 3.000000
5791 v_{3} = 0.040230 for 1.000000 < pT < 2.000000
5792 v_{3} = 0.074648 for 2.000000 < pT < 3.000000
5793 v_{4} = 0.020487 for 1.000000 < pT < 2.000000
5794 v_{4} = 0.053341 for 2.000000 < pT < 3.000000*/
5795 Double_t vn[] = { 0, 0.042240 * 0.060385, 0.040230 * 0.074648, 0.020487 * 0.053341 };
5798 case 1: // 0-2%, 2-3 times 3-4
5799 // v_{2} = 0.058958 for 2.000000 < pT < 3.000000
5800 // v_{2} = 0.063784 for 3.000000 < pT < 4.000000
5801 // v_{3} = 0.072185 for 2.000000 < pT < 3.000000
5802 // v_{3} = 0.096924 for 3.000000 < pT < 4.000000
5803 // v_{4} = 0.049694 for 2.000000 < pT < 3.000000
5804 // v_{4} = 0.076772 for 3.000000 < pT < 4.000000
5805 Double_t vn[] = { 0, 0.058958 * 0.063784, 0.072185 * 0.096924, 0.049694 * 0.076772 };
5810 // /* v_{2} = 0.113591 for 2.000000 < pT < 3.000000
5811 // v_{2} = 0.130848 for 3.000000 < pT < 4.000000
5812 // v_{3} = 0.085376 for 2.000000 < pT < 3.000000
5813 // v_{3} = 0.109396 for 3.000000 < pT < 4.000000
5814 // v_{4} = 0.056515 for 2.000000 < pT < 3.000000
5815 // v_{4} = 0.087579 for 3.000000 < pT < 4.000000*/
5816 // Double_t vn[] = { 0, 0.113591 * 0.130848, 0.085376 * 0.109396, 0.056515 * 0.087579 };
5820 // /*v_{2} = 0.205376 for 2.000000 < pT < 3.000000
5821 // v_{2} = 0.224529 for 3.000000 < pT < 4.000000
5822 // v_{3} = 0.104202 for 2.000000 < pT < 3.000000
5823 // v_{3} = 0.124636 for 3.000000 < pT < 4.000000
5824 // v_{4} = 0.069736 for 2.000000 < pT < 3.000000
5825 // v_{4} = 0.098462 for 3.000000 < pT < 4.000000*/
5826 // Double_t vn[] = { 0, 0.205376 * 0.224529, 0.104202 * 0.124636, 0.069736 * 0.098462 };
5829 case 2: // 30-40%, 1-2 times 2-3
5830 /*v_{2} = 0.170185 for 1.000000 < pT < 2.000000
5831 v_{2} = 0.236121 for 2.000000 < pT < 3.000000
5832 v_{3} = 0.068512 for 1.000000 < pT < 2.000000
5833 v_{3} = 0.115416 for 2.000000 < pT < 3.000000
5834 v_{4} = 0.037889 for 1.000000 < pT < 2.000000
5835 v_{4} = 0.079676 for 2.000000 < pT < 3.000000*/
5836 Double_t vn[] = { 0, 0.170185 * 0.236121, 0.068512 * 0.115416, 0.037889 * 0.079676 };
5839 case 3: // 30-40%, 2-3 times 3-4
5840 /*v_{2} = 0.231893 for 2.000000 < pT < 3.000000
5841 v_{2} = 0.243978 for 3.000000 < pT < 4.000000
5842 v_{3} = 0.111616 for 2.000000 < pT < 3.000000
5843 v_{3} = 0.131851 for 3.000000 < pT < 4.000000
5844 v_{4} = 0.075781 for 2.000000 < pT < 3.000000
5845 v_{4} = 0.107771 for 3.000000 < pT < 4.000000*/
5847 Double_t vn[] = { 0, 0.231893 * 0.243978, 0.111616 * 0.131851, 0.075781 * 0.107771 };
5851 TF1* flowFunc = new TF1("flowFunc", "[0] * (1+2*[1]*cos(2*x)+2*[2]*cos(3*x)+2*[3]*cos(4*x))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
5852 //flowFunc->SetLineWidth(1);
5853 flowFunc->SetLineColor(2);
5854 flowFunc->SetLineStyle(2);
5855 for (Int_t i=0; i<3; i++)
5856 flowFunc->FixParameter(i+1, vn[i+1]);
5857 //flowFunc->SetParameter(0, 84.95); flowFunc->DrawClone("SAME");
5859 //flowFunc->SetParameter(0, 85.4); flowFunc->DrawClone("SAME");
5860 //flowFunc->SetParameter(0, 85.6); flowFunc->DrawClone("SAME");
5862 hist->Fit(flowFunc, "", "SAME", 1.8, 4.5);
5863 hist->GetYaxis()->SetRangeUser(hist->GetMinimum() * 0.95, hist->GetMaximum() * 1.05);
5864 flowFunc->SetRange(-0.5 * TMath::Pi(), 1.5 * TMath::Pi());
5865 flowFunc->Draw("SAME");
5867 //hist->GetYaxis()->SetRangeUser(84, 89);
5868 //flowFunc->SetParameter(4, 1);
5872 for (Int_t bin=hist->FindBin(1.8); bin<=hist->FindBin(4.5); bin++)
5874 chi2 += TMath::Power((hist->GetBinContent(bin) - flowFunc->Eval(hist->GetBinCenter(bin))) / hist->GetBinError(bin), 2);
5876 //Printf("%f", TMath::Power((hist->GetBinContent(bin) - flowFunc->Eval(hist->GetBinCenter(bin))) / hist->GetBinError(bin), 2));
5881 Printf("chi2/ndf = %f", chi2);
5883 if (!plotContributions)
5886 for (Int_t n=1; n<=4; n++)
5888 flowFuncPart = new TF1("flowFuncPart", "[0] * (1+2*[1]*cos([2]*x))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
5889 flowFuncPart->SetParameters(flowFunc->GetParameter(0), vn[n-1], n);
5890 flowFuncPart->SetLineWidth(1);
5891 flowFuncPart->SetLineStyle(n);
5892 flowFuncPart->Draw("SAME");
5898 void MACHConeAll(const char* fileName, Int_t twoD)
5904 c = new TCanvas("c", "c", 800, 800);
5907 Float_t rangesMin[] = { 42, 5.6, 9.5, 1.2 };
5908 Float_t rangesMax[] = { 44, 6.2, 12, 1.9 };
5916 for (Int_t i=0; i<4; i++)
5919 MACHCone(fileName, i, "", kTRUE, twoD)->GetYaxis()->SetRangeUser(rangesMin[i], rangesMax[i]);
5922 c->SaveAs(Form("machcone_%d.png", twoD));
5923 c->SaveAs(Form("machcone_%d.eps", twoD));
5924 c->SaveAs(Form("machcone_%d.C", twoD));
5929 MACHCone(3, "", kTRUE)->SetTitle("");
5932 hist1 = MACHCone(0, "", kFALSE);
5933 hist2 = MACHCone(1, "SAME", kFALSE);
5934 hist3 = MACHCone(2, "SAME", kFALSE);
5936 hist1->SetTitle("");
5937 hist1->GetYaxis()->SetRangeUser(1, 7);
5942 // Set style which will affect all plots.
5945 // gStyle->SetOptitle(0);
5946 // gStyle->SetOptStat(0);
5947 //gStyle->SetOptDate(1);
5948 // gStyle->SetPalette(8,0); // (1,0)
5949 gStyle->SetPalette(1); // (1,0)
5950 gStyle->SetDrawBorder(0);
5951 // gStyle->SetFillColor(0); // kills palete ???
5952 gStyle->SetCanvasColor(0);
5953 gStyle->SetPadColor(0);
5954 // gStyle->SetFillColor(0); // otherwize it affects Fill colors later
5955 gStyle->SetFrameFillColor(0);
5956 gStyle->SetCanvasBorderMode(0);
5957 gStyle->SetFrameLineWidth(2);
5958 // gStyle->SetFrameFillStyle(4000);
5959 gStyle->SetPadBorderMode(0);
5960 gStyle->SetPadTickX(1);
5961 gStyle->SetPadTickY(1);
5962 gStyle->SetPadBottomMargin(0.15);
5963 gStyle->SetPadLeftMargin(0.15);
5964 gStyle->SetHistLineWidth(2);
5965 gStyle->SetFuncWidth(2);
5966 gStyle->SetLineWidth(2);
5967 gStyle->SetLabelSize(0.05,"xyz");
5968 gStyle->SetLabelOffset(0.01,"y");
5969 gStyle->SetLabelColor(kBlack,"xyz");
5970 gStyle->SetTitleSize(0.06,"xyz");
5971 gStyle->SetTitleOffset(1.3,"y");
5972 gStyle->SetTitleFillColor(0);
5973 gStyle->SetLineWidth(2);
5974 gStyle->SetHistLineColor(1);
5975 gStyle->SetTextColor(1);
5976 gStyle->SetTitleTextColor(1);
5977 TGaxis::SetMaxDigits(4);
5978 gStyle->SetOptStat(0); // removes stat. box from all histos
5979 gROOT->ForceStyle();
5981 } // end of void SetFlowStyle()
5983 void PlotPtDistributionsSubtracted(const char* fileName1, Int_t centrBegin = 1, Int_t centrEnd = 6, Int_t fit = 0)
5987 Int_t nCentralityBins = 5;
5988 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
5990 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
5992 TCanvas* canvas = new TCanvas("Pt", "Pt", 1000, 1000);
5993 canvas->Divide(2, 2);
5995 TLegend* legend = new TLegend(0.3, 0.8, 0.99, 0.99);
5996 legend->SetFillColor(0);
5998 Int_t colors[] = { 1, 2, 4, 6, 3, 5 };
5999 Int_t markers[] = { 20, 21, 22, 23, 24, 25 };
6001 Double_t ptMin = 10.01;
6002 Double_t ptMax = 39.99;
6005 str.Form("%.1f < p_{T,trig} < %.1f", ptMin - 0.01, ptMax + 0.01);
6008 gPad->SetLeftMargin(0.15);
6009 gPad->SetBottomMargin(0.2);
6010 gPad->SetTopMargin(0.01);
6011 gPad->SetRightMargin(0.01);
6017 TH2F* dummy = new TH2F("dummy", "", 100, 1, 40, 100, 1e-5, 1e3);
6018 dummy->SetStats(kFALSE);
6019 dummy->SetXTitle("p_{T,assoc}");
6020 dummy->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
6021 dummy->GetYaxis()->SetTitleOffset(1);
6022 Prepare1DPlot(dummy);
6024 dummy->GetXaxis()->SetLabelSize(0.05);
6025 dummy->GetYaxis()->SetLabelSize(0.05);
6026 dummy->GetXaxis()->SetTitleSize(0.05);
6027 dummy->GetYaxis()->SetTitleSize(0.05);
6031 gPad->SetLeftMargin(0.15);
6032 gPad->SetBottomMargin(0.2);
6033 gPad->SetTopMargin(0.01);
6034 gPad->SetRightMargin(0.01);
6042 gPad->SetLeftMargin(0.15);
6043 gPad->SetBottomMargin(0.2);
6044 gPad->SetTopMargin(0.01);
6045 gPad->SetRightMargin(0.01);
6050 dummy = new TH2F("dummy2", "", 100, 1, 40, 100, 0, 100);
6051 dummy->SetStats(kFALSE);
6052 dummy->SetXTitle("p_{T,assoc}");
6053 dummy->SetYTitle("Ratio: Distribution / Inclusive");
6054 dummy->GetYaxis()->SetTitleOffset(1);
6055 Prepare1DPlot(dummy);
6056 dummy->GetXaxis()->SetLabelSize(0.05);
6057 dummy->GetYaxis()->SetLabelSize(0.05);
6058 dummy->GetXaxis()->SetTitleSize(0.05);
6059 dummy->GetYaxis()->SetTitleSize(0.05);
6063 gPad->SetLeftMargin(0.15);
6064 gPad->SetBottomMargin(0.2);
6065 gPad->SetTopMargin(0.01);
6066 gPad->SetRightMargin(0.01);
6073 // see GetAcceptanceScalingFactor
6074 Float_t scalingFactor = 0.328396; // 0.8
6075 //Float_t scalingFactor = 0.433268; // 0.7
6076 //Float_t scalingFactor = 0.895593; // 0.5 --> 1.6
6078 Float_t phiRange[] = { 0, TMath::Pi() / 2, TMath::Pi() };
6079 const char* phiLabels[] = { "Towards", "Transverse", "Away" };
6081 //Float_t phiSizeTowards = TMath::Pi() / 3;
6082 Float_t phiSizeTowards = 0.75;
6083 //Float_t etaLimit = 0.5;
6084 Float_t etaLimit = 0.8;
6086 towardsCentralEta = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, -etaLimit + 0.01, etaLimit - 0.01);
6087 towardsSideEta1 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, -1.59, -etaLimit - 0.01);
6088 TH1* towardsSideEta2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, etaLimit + 0.01, 1.59);
6089 towardsSideEta1->Add(towardsSideEta2); // TODO can be done smarter? what about the errors?
6091 Prepare1DPlot(towardsSideEta1);
6092 Prepare1DPlot(towardsCentralEta);
6094 towardsCentralEta->SetLineColor(colors[0]);
6095 towardsSideEta1->SetLineColor(colors[3]);
6096 //towardsSideEta1->SetLineStyle(2);
6098 legend->AddEntry(towardsCentralEta->Clone(), Form("Jet, %s: |#Delta#eta| < 0.8, #phi ~ %.1f", phiLabels[0], phiRange[0]));
6099 legend->AddEntry(towardsSideEta1->Clone(), Form("Ridge, %s: 0.8 < |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[0], phiRange[0]));
6101 // TODO update when data with new phi binning is available
6102 transverse = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[1] - TMath::Pi() / 3, phiRange[1] + TMath::Pi() / 3, -1.59, 1.59);
6104 transverse2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, -0.5 * TMath::Pi(), -TMath::Pi() / 3, -1.59, 1.59, kTRUE);
6105 transverse3 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, TMath::Pi() + TMath::Pi() / 3, 1.5 * TMath::Pi(), -1.59, 1.59, kTRUE);
6106 transverse->Add(transverse2);
6107 transverse->Add(transverse3);
6108 transverse->Scale(1.0 / (2.0 / 3 * TMath::Pi()));
6111 //transverseSideEta1 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[1] - TMath::Pi() / 4, phiRange[1] + TMath::Pi() / 4, -1.59, -0.81);
6112 //TH1* transverseSideEta2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[1] - TMath::Pi() / 4, phiRange[1] + TMath::Pi() / 4, 0.81, 1.59);
6113 //transverseSideEta1->Add(transverseSideEta2); // TODO can be done smarter? what about the errors?
6115 transverse->SetLineColor(colors[2]);
6116 //transverseSideEta1->SetLineColor(colors[2]);
6117 //transverseSideEta1->SetLineStyle(2);
6119 Prepare1DPlot(transverse);
6120 //Prepare1DPlot(transverseSideEta1);
6121 legend->AddEntry(transverse->Clone(), Form("%s: |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[1], phiRange[1]));
6122 //legend->AddEntry(transverseSideEta1->Clone(), Form("%s: 0.8 < |#Delta #eta| < 1.6, #phi ~ %.1f", phiLabels[1], phiRange[1]));
6124 away = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[2] - TMath::Pi() / 3, phiRange[2] + TMath::Pi() / 3, -1.59, 1.59);
6127 away2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[2] - TMath::Pi() / 4, phiRange[2] + TMath::Pi() / 4, -0.79, 0.79);
6128 away3 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[2] - TMath::Pi() / 4, phiRange[2] + TMath::Pi() / 4, -1.59, -0.81);
6129 away4 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[2] - TMath::Pi() / 4, phiRange[2] + TMath::Pi() / 4, 0.81, 1.59);
6133 away->SetLineColor(colors[1]);
6134 //away3->SetLineColor(colors[1]);
6135 //away3->SetLineStyle(2);
6137 Prepare1DPlot(away);
6138 legend->AddEntry(away->Clone(), Form("%s: |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[2], phiRange[2]));
6140 //inclusive = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), -1.59, 1.59);
6143 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1)->SetRange(centrBegin, centrEnd);
6144 inclusive = h->GetUEHist(2)->GetEventHist()->ShowProjection(0, 6);
6145 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1)->SetRange(0, -1);
6148 axis = h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1);
6150 inclusiveTmp = h->GetCorrelationpT()->ProjectionY("inclusiveTmp", h->GetCorrelationpT()->GetXaxis()->FindBin(axis->GetBinLowEdge(centrBegin) + 0.01), h->GetCorrelationpT()->GetXaxis()->FindBin(axis->GetBinUpEdge(centrEnd) - 0.01));
6152 //rebin to match other histograms
6153 //inclusive2 = inclusive->Rebin(away->GetNbinsX(), "inclusive2", away->GetXaxis()->GetXbins()->GetArray());
6155 // manually, as usual the ROOT function makes a SEGV
6156 inclusive = (TH1*) away->Clone("inclusive");
6159 for (Int_t bin=1; bin<=inclusiveTmp->GetNbinsX(); bin++)
6160 inclusive->Fill(inclusiveTmp->GetBinCenter(bin), inclusiveTmp->GetBinContent(bin));
6162 for (Int_t bin=1; bin<=inclusive->GetNbinsX(); bin++)
6163 inclusive->SetBinError(bin, TMath::Sqrt(inclusive->GetBinContent(bin)));
6165 // normalization: events, phase space
6166 inclusive->Scale(1.0 / h->GetCentralityDistribution()->Integral(centrBegin, centrEnd));
6167 inclusive->Scale(1.0 / (TMath::TwoPi() * 0.8 * 2));
6170 for (Int_t i=1; i<=inclusive->GetNbinsX(); i++)
6172 inclusive->SetBinContent(i, inclusive->GetBinContent(i) / inclusive->GetXaxis()->GetBinWidth(i));
6173 inclusive->SetBinError (i, inclusive->GetBinError(i) / inclusive->GetXaxis()->GetBinWidth(i));
6176 Prepare1DPlot(inclusive);
6177 inclusive->SetLineColor(colors[4]);
6178 legend->AddEntry(inclusive->Clone(), "Inclusive");
6180 //Prepare1DPlot(away3);
6181 //legend->AddEntry(away3->Clone(), Form("%s: 0.8 < |#Delta #eta| < 1.6, #phi ~ %.1f", phiLabels[2], phiRange[2]));
6183 // scale for acceptance to match acceptance of towardsCentralEta
6184 towardsSideEta1->Scale(1.0 / scalingFactor); // contains only "side-eta"
6185 transverse->Scale(1.0 / (1.0 + scalingFactor)); // full eta
6186 away->Scale(1.0 / (1.0 + scalingFactor)); // full eta
6187 inclusive->Scale(1.0 / (1.0 + scalingFactor)); // full eta (phi scaling implicit)
6190 towardsCentralEtaClone = towardsCentralEta->DrawCopy("SAME");
6191 towardsSideEta1Clone = towardsSideEta1->DrawCopy("SAME");
6192 transverseClone = transverse->DrawCopy("SAME");
6193 //transverseSideEta1->DrawCopy("SAME");
6194 awayClone = away->DrawCopy("SAME");
6195 inclusiveClone = inclusive->DrawCopy("SAME");
6196 //inclusive2->DrawCopy("SAME");
6197 //away3->DrawCopy("SAME");
6201 towardsCentralEtaR = (TH1*) towardsCentralEta->Clone("towardsCentralEtaR");
6202 towardsSideEta1R = (TH1*) towardsSideEta1->Clone("towardsSideEta1R");
6203 transverseR = (TH1*) transverse->Clone("transverseR");
6204 awayR = (TH1*) away->Clone("awayR");
6206 towardsCentralEtaR->Divide(inclusive);
6207 towardsSideEta1R->Divide(inclusive);
6208 transverseR->Divide(inclusive);
6209 awayR->Divide(inclusive);
6211 towardsCentralEtaR->DrawCopy("SAME");
6212 towardsSideEta1R->DrawCopy("SAME");
6213 transverseR->DrawCopy("SAME");
6214 awayR->DrawCopy("SAME");
6220 awayClone->Fit("expo", "", "SAME", 1.1, 2.9);
6221 awayClone->GetFunction("expo")->SetRange(1, 10);
6228 func = new TF1("func", "[0] * x**[1]");
6229 func->SetParameters(1, 1);
6231 Float_t limitLow = 2.1;
6232 Float_t limitHigh = 4.9;
6234 func2 = (TF1*) func->Clone();
6235 towardsCentralEtaClone->Fit(func2, "", "SAME", limitLow, limitHigh);
6236 towardsCentralEtaClone->GetFunction("func")->SetRange(1, 10);
6237 towardsCentralEtaClone->GetFunction("func")->SetLineColor(towardsCentralEtaClone->GetLineColor());
6239 func2 = (TF1*) func->Clone();
6240 towardsSideEta1Clone->Fit(func2, "", "SAME", limitLow, limitHigh);
6241 towardsSideEta1Clone->GetFunction("func")->SetRange(1, 10);
6242 towardsSideEta1Clone->GetFunction("func")->SetLineColor(towardsSideEta1Clone->GetLineColor());
6244 func2 = (TF1*) func->Clone();
6245 transverseClone->Fit(func2, "", "SAME", limitLow, limitHigh);
6246 transverseClone->GetFunction("func")->SetRange(1, 10);
6247 transverseClone->GetFunction("func")->SetLineColor(transverseClone->GetLineColor());
6249 func2 = (TF1*) func->Clone();
6250 awayClone->Fit(func2, "", "SAME", limitLow, limitHigh);
6251 awayClone->GetFunction("func")->SetRange(1, 10);
6252 awayClone->GetFunction("func")->SetLineColor(awayClone->GetLineColor());
6254 func2 = (TF1*) func->Clone();
6255 inclusiveClone->Fit(func2, "", "SAME", limitLow, limitHigh);
6256 inclusiveClone->GetFunction("func")->SetRange(1, 10);
6257 inclusiveClone->GetFunction("func")->SetLineColor(inclusiveClone->GetLineColor());
6260 // subtract transverse part
6261 away->Add(transverse, -1);
6262 //away3->Add(transverseSideEta1, -1);
6263 towardsCentralEta->Add(transverse, -1);
6264 towardsSideEta1->Add(transverse, -1);
6265 //inclusive->Add(transverse, -1);
6268 towardsCentralEta->DrawCopy("SAME");
6269 towardsSideEta1->DrawCopy("SAME");
6270 away->DrawCopy("SAME");
6271 inclusive->DrawCopy("SAME");
6272 //away3->DrawCopy("SAME");
6276 towardsCentralEtaR = (TH1*) towardsCentralEta->Clone("towardsCentralEtaR2");
6277 towardsSideEta1R = (TH1*) towardsSideEta1->Clone("towardsSideEta1R2");
6278 awayR = (TH1*) away->Clone("awayR2");
6280 towardsCentralEtaR->Divide(inclusive);
6281 towardsSideEta1R->Divide(inclusive);
6282 awayR->Divide(inclusive);
6284 towardsCentralEtaR->DrawCopy("SAME");
6285 towardsSideEta1R->DrawCopy("SAME");
6286 awayR->DrawCopy("SAME");
6292 away->Fit("expo", "", "SAME", 1.1, 2.9);
6293 away->GetFunction("expo")->SetRange(1, 10);
6300 func = new TF1("func", "[0] * x**[1]");
6301 func->SetParameters(1, 1);
6303 func2 = (TF1*) func->Clone();
6304 towardsCentralEta->Fit(func2, "", "SAME", limitLow, limitHigh);
6305 func2->SetRange(1, 10);
6307 func2 = (TF1*) func->Clone();
6308 towardsSideEta1->Fit(func2, "", "SAME", limitLow, limitHigh);
6309 func2->SetRange(1, 10);
6311 func2 = (TF1*) func->Clone();
6312 away->Fit(func2, "", "SAME", limitLow, limitHigh);
6313 func2->SetRange(1, 10);
6315 func2 = (TF1*) func->Clone();
6316 inclusive->Fit(func2, "", "SAME", limitLow, limitHigh);
6317 func2->SetRange(1, 10);
6320 for (Int_t i=1; i<=2; i++)
6325 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
6326 latex = new TLatex(0.2, 0.3, str3);
6328 latex->SetTextSize(0.06);
6330 latex2 = new TLatex(0.55, 0.6, str);
6332 latex2->SetTextSize(0.06);
6341 void CombineDeltaPhiWithWeighting()
6345 // xsection: 11.879829, ntrials: 8132994.000000
6348 // xsection: 0.623421, ntrials: 2293420.000000
6351 // xsection: 0.043815, ntrials: 1314525.375000
6353 // TODO is merging only same event distribution at present
6358 const char* inputList[] = { "mergejob/LHC11a2a_110124.root", "mergejob/LHC11a2b_110131.root", "mergejob/LHC11a2c_110131.root" };
6360 Float_t xSections[] = { 11.879829 * 1e6 / 8132994, 0.623421 * 1e6 / 2293420, 0.043815 * 1e6 / 1314525 };
6361 xSections[2] /= xSections[0];
6362 xSections[1] /= xSections[0];
6363 xSections[0] /= xSections[0];
6365 AliUEHistograms* files[3];
6366 TList* finalList = 0;
6367 for (Int_t i=0; i<nInput; i++)
6369 files[i] = (AliUEHistograms*) GetUEHistogram(inputList[i], (i == 0) ? &finalList : 0);
6372 files[i]->Scale(xSections[i]);
6374 TList* list2 = new TList;
6375 list2->Add(files[i]);
6376 files[0]->Merge(list2);
6380 TFile* file3 = TFile::Open("out.root", "RECREATE");
6381 file3->mkdir("PWG4_PhiCorrelations");
6382 file3->cd("PWG4_PhiCorrelations");
6383 finalList->Write(0, TObject::kSingleKey);
6387 void NormalizeToBinWidth(TH1* hist)
6390 // normalizes a 1-d histogram to its bin width
6393 for (Int_t i=1; i<=hist->GetNbinsX(); ++i)
6395 hist->SetBinContent(i, hist->GetBinContent(i) / hist->GetBinWidth(i));
6396 hist->SetBinError(i, hist->GetBinError(i) / hist->GetBinWidth(i));
6400 void GetAcceptanceScalingFactor(const char* fileName1, Float_t eta1 = 0.8, Float_t eta2 = 1.6)
6404 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1, 0, kTRUE);
6405 h->SetPtRange(1.01, 39.99);
6408 mixed = ((TH2*)h->GetUEHist(2)->GetUEHist(6, 0, 1.01, 39.99, 0, 16, kTRUE))->ProjectionY();
6411 Float_t left = mixed->Integral(mixed->FindBin(-eta2 + 0.01), mixed->FindBin(-eta1 - 0.01));
6412 Float_t center = mixed->Integral(mixed->FindBin(-eta1 + 0.01), mixed->FindBin(eta1 - 0.01));
6413 Float_t right = mixed->Integral(mixed->FindBin(eta1 + 0.01), mixed->FindBin(eta2 - 0.01));
6415 Printf("%f %f %f", left, center, right);
6416 Printf("%f", (left + right) / center);
6419 void TrackingEfficiencyCentralityDependence(const char* fileName, Int_t step1 = 2, Int_t step2 = 4)
6421 Int_t nCentralityBins = 3;
6422 Float_t centralityBins[] = { 0, 20, 40, 90 };
6424 Int_t colors[] = { 1, 2, 4, 6 };
6428 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
6431 dummy = new TH2F("dummy", ";p_{T};tracking efficiency", 100, 0, 20, 100, 0.7, 1.3);
6435 legend = new TLegend(0.13, 0.67, 0.31, 0.87);
6436 legend->SetTextSize(0.04);
6437 legend->SetFillColor(0);
6439 for (Int_t i=0; i<nCentralityBins; i++)
6441 eventHist = h->GetUEHist(2)->GetEventHist();
6443 eventHist->GetGrid(step1)->SetRangeUser(1, centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
6444 eventHist->GetGrid(step2)->SetRangeUser(1, centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
6446 TH1* hist1 = eventHist->ShowProjection(0, step1);
6447 TH1* hist2 = eventHist->ShowProjection(0, step2);
6449 hist2->Divide(hist1);
6451 hist2->SetLineColor(colors[i]);
6452 hist2->GetYaxis()->SetTitle("tracking efficiency");
6453 hist2->Draw("SAME");
6455 legend->AddEntry(hist2, Form("%.0f-%.0f%%", centralityBins[i], centralityBins[i+1]));
6462 TGraphErrors* ReadHepdata(const char* fileName, Bool_t errorsAreAdded = kFALSE, Int_t skipYErrors = 0, Int_t skipXerrors = 1)
6464 // expected format: x [x2] y [ye] [ye2] [xe]
6466 // skipYErrors: 0 --> ye present
6467 // 1 --> no errors ye
6468 // 2 --> y and ye are lower and upper error, i.e. y' = (y + ye) / 2 and ye = (ye - y) / 2
6469 // 3 --> ye and ye2 are stat and syst error, will be added in quadrature
6471 // skipXerrors: 0 --> xe present
6472 // 1 --> no errors xe
6473 // 2 --> x2 present, xe not present and is calculated from x2 - x
6475 ifstream fin(fileName);
6477 graph = new TGraphErrors(0);
6484 if (fin.peek() == '#')
6486 fin.getline(buffer, 2000);
6498 if (skipXerrors == 2)
6501 xe = (x2 - x + 1) / 2;
6502 x = x + (x2 - x) / 2;
6510 if (skipYErrors == 0)
6517 else if (skipYErrors == 2)
6524 Double_t newy = (y + ye) / 2;
6528 else if (skipYErrors == 3)
6540 ye = TMath::Sqrt(ye*ye + ye2*ye2);
6543 if (skipXerrors == 0)
6551 //Printf("%f %f %f %f", x, y, xe, ye);
6556 graph->SetPoint(graph->GetN(), x, y);
6557 graph->SetPointError(graph->GetN()-1, xe, ye);
6561 // read rest until end of line...
6562 fin.getline(buffer, 2000);
6566 Printf("%s: %f", fileName, sum);
6571 void EvaluateParticleEfficiency(const char* fileName)
6573 Int_t centralityBegin = 1;
6574 Int_t centralityEnd = 15;
6587 Float_t ptTriggerBegin = 4.01;
6588 Float_t ptTriggerEnd = 19.99;
6594 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
6595 AliUEHist* cont = h->GetUEHist(2);
6597 cont->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
6598 cont->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
6600 Int_t stepEff1 = step1 - (Int_t) AliUEHist::kCFStepAnaTopology;
6603 Int_t stepEff2 = step2 - (Int_t) AliUEHist::kCFStepAnaTopology;
6607 cont->GetTrackHistEfficiency()->GetGrid(stepEff1)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
6608 cont->GetTrackHistEfficiency()->GetGrid(stepEff2)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
6610 TH1* triggerParticle = cont->GetEventHist()->Project(step2, 0);
6611 triggerParticle->Divide(cont->GetEventHist()->Project(step1, 0));
6613 TH1* singleParticle = cont->GetTrackHistEfficiency()->Project(stepEff2, 1);
6614 singleParticle->Divide(cont->GetTrackHistEfficiency()->Project(stepEff1, 1));
6616 //singleParticle = singleParticle->Rebin(triggerParticle->GetNbinsX(), "singleRebin", triggerParticle->GetXaxis()->GetXbins()->GetArray());
6618 TGraphErrors* effectiveEffect = new TGraphErrors;
6619 TGraphErrors* triggerCorrelatedEffect = new TGraphErrors;
6620 TGraphErrors* afterBaseLine = new TGraphErrors;
6621 TGraphErrors* triggerCorrelatedEffect2D = new TGraphErrors;
6623 //TVirtualFitter::SetDefaultFitter("Linear");
6625 for (Int_t bin=3; bin<=triggerParticle->GetNbinsX(); bin++)
6627 if (triggerParticle->GetBinCenter(bin) > 10)
6630 cont->SetPtRange(triggerParticle->GetXaxis()->GetBinLowEdge(bin) + 0.01, triggerParticle->GetXaxis()->GetBinUpEdge(bin) - 0.01);
6632 TH1* hist1 = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd);
6633 TH1* hist2 = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd);
6635 // TODO the uncertainties on the ratios should be properly calculated! (if that helps ;))
6636 clone = (TH1*) hist2->Clone("clone");
6637 clone->Divide(hist1);
6639 //func = new TF1("func", "[0]", -10, 10);
6641 if ((Int_t) clone->Fit("pol0", "0", "", -10, 10) == 0)
6643 func = clone->GetFunction("pol0");
6644 effectiveEffect->SetPoint(effectiveEffect->GetN(), triggerParticle->GetBinCenter(bin) - 0.2, func->GetParameter(0));
6645 effectiveEffect->SetPointError(effectiveEffect->GetN()-1, 0, func->GetParError(0));
6650 clone->GetYaxis()->SetRangeUser(0.9, 1.3);
6652 func->DrawClone("SAME");
6656 if ((Int_t) clone->Fit("pol0", "0", "", -0.3, 0.3) == 0)
6658 func = clone->GetFunction("pol0");
6659 triggerCorrelatedEffect->SetPoint(triggerCorrelatedEffect->GetN(), triggerParticle->GetBinCenter(bin) - 0.1, func->GetParameter(0));
6660 triggerCorrelatedEffect->SetPointError(triggerCorrelatedEffect->GetN()-1, 0, func->GetParError(0));
6664 func->SetLineColor(2);
6665 func->DrawClone("SAME");
6669 if ((Int_t) hist2->Fit("pol0", "0", "", 1, 2) == 0)
6671 func = hist2->GetFunction("pol0");
6672 func->SetRange(-10, 10);
6673 hist2->Add(func, -1);
6675 if ((Int_t) hist1->Fit("pol0", "0", "", 1, 2) == 0)
6677 func = hist1->GetFunction("pol0");
6678 func->SetRange(-10, 10);
6679 hist1->Add(func, -1);
6681 //new TCanvas; hist1->DrawCopy();
6683 hist2->Divide(hist1);
6685 if ((Int_t) hist2->Fit("pol0", "0", "", -0.3, 0.3) == 0)
6687 func = hist2->GetFunction("pol0");
6688 afterBaseLine->SetPoint(afterBaseLine->GetN(), triggerParticle->GetBinCenter(bin) + 0.2, func->GetParameter(0));
6689 afterBaseLine->SetPointError(afterBaseLine->GetN()-1, 0, func->GetParError(0));
6694 hist2->GetYaxis()->SetRangeUser(0.9, 1.3);
6696 func->SetLineColor(4);
6697 func->DrawClone("SAME");
6704 TH2* hist1_2D = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
6705 TH2* hist2_2D = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
6707 //((TH2*)hist1)->Rebin2D(2, 2); ((TH2*)hist2)->Rebin2D(2, 2);
6709 hist2_2D->Divide(hist1_2D);
6714 hist2_2D->Draw("COLZ");
6717 //Printf("%d %d %d %d", hist2_2D->GetXaxis()->FindBin(-0.01), hist2_2D->GetXaxis()->FindBin(0.01), hist2_2D->GetYaxis()->FindBin(-0.01), hist2_2D->GetYaxis()->FindBin(0.01));
6720 Float_t integral = hist2_2D->IntegralAndError(hist2_2D->GetXaxis()->FindBin(-0.01), hist2_2D->GetXaxis()->FindBin(0.01), hist2_2D->GetYaxis()->FindBin(-0.01), hist2_2D->GetYaxis()->FindBin(0.01), error);
6722 integral /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
6723 integral /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
6725 error /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
6726 error /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
6728 triggerCorrelatedEffect2D->SetPoint(triggerCorrelatedEffect2D->GetN(), triggerParticle->GetBinCenter(bin) + 0.1, integral);
6729 triggerCorrelatedEffect2D->SetPointError(triggerCorrelatedEffect2D->GetN()-1, 0, error);
6736 triggerParticle->Draw();
6737 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
6739 singleParticle->SetLineColor(2);
6740 //singleParticle->Draw("SAME");
6742 effectiveEffect->SetMarkerStyle(24);
6743 effectiveEffect->Draw("PSAME");
6745 triggerCorrelatedEffect->SetMarkerStyle(25);
6746 triggerCorrelatedEffect->SetMarkerColor(2);
6747 triggerCorrelatedEffect->SetLineColor(2);
6748 triggerCorrelatedEffect->Draw("PSAME");
6750 triggerCorrelatedEffect2D->SetMarkerStyle(27);
6751 triggerCorrelatedEffect2D->SetMarkerColor(3);
6752 triggerCorrelatedEffect2D->SetLineColor(3);
6753 triggerCorrelatedEffect2D->Draw("PSAME");
6755 afterBaseLine->SetMarkerStyle(26);
6756 afterBaseLine->SetMarkerColor(4);
6757 afterBaseLine->SetLineColor(4);
6758 afterBaseLine->Draw("PSAME");
6760 legend = new TLegend(0.66, 0.15, 0.88, 0.38);
6761 legend->SetFillColor(0);
6762 legend->SetTextSize(0.04);
6763 legend->AddEntry(triggerParticle, "trigger", "L");
6764 //legend->AddEntry(singleParticle, "single", "L");
6765 legend->AddEntry(effectiveEffect, "effective", "P");
6766 legend->AddEntry(triggerCorrelatedEffect, "at 0", "P");
6767 legend->AddEntry(triggerCorrelatedEffect2D, "at 0 (2d)", "P");
6768 legend->AddEntry(afterBaseLine, "baseline", "P");
6772 void EvaluateParticleEfficiency2D(const char* fileName)
6774 Int_t centralityBegin = 1;
6775 Int_t centralityEnd = 15;
6792 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
6793 AliUEHist* cont = h->GetUEHist(2);
6795 cont->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
6796 cont->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
6798 Int_t stepEff1 = step1 - (Int_t) AliUEHist::kCFStepAnaTopology;
6801 Int_t stepEff2 = step2 - (Int_t) AliUEHist::kCFStepAnaTopology;
6805 cont->GetTrackHistEfficiency()->GetGrid(stepEff1)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
6806 cont->GetTrackHistEfficiency()->GetGrid(stepEff2)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
6808 TH1* triggerParticle = cont->GetEventHist()->Project(step2, 0);
6809 triggerParticle->Divide(cont->GetEventHist()->Project(step1, 0));
6811 TH1* singleParticle = cont->GetTrackHistEfficiency()->Project(stepEff2, 1);
6812 singleParticle->Divide(cont->GetTrackHistEfficiency()->Project(stepEff1, 1));
6814 cont->GetTrackHist(0)->GetGrid(step1)->SetRangeUser(0, -0.01, 0.01); // delta eta
6815 cont->GetTrackHist(0)->GetGrid(step1)->SetRangeUser(4, -0.01, 0.01); // delta phi
6816 TH2* tracksStep1 = (TH2*) cont->GetTrackHist(0)->Project(step1, 1, 2);
6818 cont->GetTrackHist(0)->GetGrid(step2)->SetRangeUser(0, -0.01, 0.01); // delta eta
6819 cont->GetTrackHist(0)->GetGrid(step2)->SetRangeUser(4, -0.01, 0.01); // delta phi
6820 TH2* tracksStep2 = (TH2*) cont->GetTrackHist(0)->Project(step2, 1, 2);
6822 tracksStep2->Divide(tracksStep1);
6824 TH1* triggersStep1 = cont->GetEventHist()->Project(step1, 0);
6825 TH1* triggersStep2 = cont->GetEventHist()->Project(step2, 0);
6827 for (Int_t x=1; x<=tracksStep2->GetNbinsX(); x++)
6828 for (Int_t y=1; y<=tracksStep2->GetNbinsY(); y++)
6829 if (singleParticle->GetBinContent(x) > 0)
6830 tracksStep2->SetBinContent(x, y, tracksStep2->GetBinContent(x, y) / triggersStep2->GetBinContent(y) * triggersStep1->GetBinContent(y) / singleParticle->GetBinContent(x));
6832 tracksStep2->SetBinContent(x, y, 0);
6835 tracksStep2->Draw("COLZ");
6837 TGraphErrors** triggerCorrelatedEffect2D = new TGraphErrors*[triggerParticle->GetNbinsX()+1];
6838 TGraphErrors** triggerCorrelatedEffect2DSub = new TGraphErrors*[triggerParticle->GetNbinsX()+1];
6840 for (Int_t bin1=0; bin1<=triggerParticle->GetNbinsX(); bin1++)
6842 triggerCorrelatedEffect2D[bin1] = 0;
6843 triggerCorrelatedEffect2DSub[bin1] = 0;
6846 for (Int_t bin1=5; bin1<=triggerParticle->GetNbinsX(); bin1++)
6848 if (triggerParticle->GetBinCenter(bin1) > 10)
6851 Float_t ptTriggerBegin = triggerParticle->GetXaxis()->GetBinLowEdge(bin1) + 0.01;
6852 Float_t ptTriggerEnd = triggerParticle->GetXaxis()->GetBinUpEdge(bin1) - 0.01;
6854 for (Int_t bin2=3; bin2<=triggerParticle->GetNbinsX(); bin2++)
6856 if (triggerParticle->GetBinCenter(bin2) > 8)
6862 cont->SetPtRange(triggerParticle->GetXaxis()->GetBinLowEdge(bin2) + 0.01, triggerParticle->GetXaxis()->GetBinUpEdge(bin2) - 0.01);
6865 TH2* hist1_2D = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
6866 TH2* hist2_2D = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
6868 //((TH2*)hist1)->Rebin2D(2, 2); ((TH2*)hist2)->Rebin2D(2, 2);
6870 hist2_2D->Divide(hist1_2D);
6875 hist2_2D->Draw("COLZ");
6878 //Printf("%d %d %d %d", hist2_2D->GetXaxis()->FindBin(-0.01), hist2_2D->GetXaxis()->FindBin(0.01), hist2_2D->GetYaxis()->FindBin(-0.01), hist2_2D->GetYaxis()->FindBin(0.01));
6881 Float_t integral = hist2_2D->IntegralAndError(hist2_2D->GetXaxis()->FindBin(-0.01), hist2_2D->GetXaxis()->FindBin(0.01), hist2_2D->GetYaxis()->FindBin(-0.01), hist2_2D->GetYaxis()->FindBin(0.01), error);
6883 integral /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
6884 integral /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
6886 error /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
6887 error /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
6892 if (!triggerCorrelatedEffect2D[bin1])
6893 triggerCorrelatedEffect2D[bin1] = new TGraphErrors;
6895 triggerCorrelatedEffect2D[bin1]->SetPoint(triggerCorrelatedEffect2D[bin1]->GetN(), triggerParticle->GetBinCenter(bin2) - 0.5 + 0.1 * bin1, integral);
6896 triggerCorrelatedEffect2D[bin1]->SetPointError(triggerCorrelatedEffect2D[bin1]->GetN()-1, 0, error);
6898 if (!triggerCorrelatedEffect2DSub[bin1])
6899 triggerCorrelatedEffect2DSub[bin1] = new TGraphErrors;
6901 triggerCorrelatedEffect2DSub[bin1]->SetPoint(triggerCorrelatedEffect2DSub[bin1]->GetN(), triggerParticle->GetBinCenter(bin2) - 0.5 + 0.1 * bin1, integral / triggerParticle->GetBinContent(bin2));
6902 triggerCorrelatedEffect2DSub[bin1]->SetPointError(triggerCorrelatedEffect2DSub[bin1]->GetN()-1, 0, error / triggerParticle->GetBinContent(bin2));
6913 triggerParticle->Draw();
6914 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
6916 legend = new TLegend(0.66, 0.15, 0.88, 0.38);
6917 legend->SetFillColor(0);
6918 legend->SetTextSize(0.04);
6919 legend->AddEntry(triggerParticle, "trigger", "L");
6924 for (Int_t bin1=3; bin1<=triggerParticle->GetNbinsX(); bin1++)
6925 if (triggerCorrelatedEffect2D[bin1])
6927 triggerCorrelatedEffect2D[bin1]->SetMarkerStyle(marker++);
6928 triggerCorrelatedEffect2D[bin1]->SetMarkerColor(color);
6929 triggerCorrelatedEffect2D[bin1]->SetLineColor(color++);
6930 triggerCorrelatedEffect2D[bin1]->Draw("PSAME");
6931 legend->AddEntry(triggerCorrelatedEffect2D[bin1], Form("pt %.2f", triggerParticle->GetBinCenter(bin1)), "P");
6937 triggerParticle->Draw();
6938 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
6943 for (Int_t bin1=3; bin1<=triggerParticle->GetNbinsX(); bin1++)
6944 if (triggerCorrelatedEffect2DSub[bin1])
6946 triggerCorrelatedEffect2DSub[bin1]->SetMarkerStyle(marker++);
6947 triggerCorrelatedEffect2DSub[bin1]->SetMarkerColor(color);
6948 triggerCorrelatedEffect2DSub[bin1]->SetLineColor(color++);
6949 triggerCorrelatedEffect2DSub[bin1]->Draw("PSAME");
6955 void DrawEventCount(const char* fileName)
6959 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
6960 h->GetEventCount()->Draw("TEXT");
6963 void CompareDCADistributions(const char* fileName1, const char* fileName2)
6965 TFile::Open(fileName1);
6966 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
6967 prim = (TH2*) list->FindObject("fDCAPrimaries");
6968 sec = (TH2*) list->FindObject("fDCASecondaries");
6970 TFile::Open(fileName2);
6971 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
6972 all = (TH2*) list->FindObject("fDCAPrimaries");
6976 TH2* histList[] = { prim, sec, all };
6987 for (Int_t i=0; i<3; i++)
6989 hist = histList[i]->ProjectionX("proj", prim->GetYaxis()->FindBin(-zCut), prim->GetYaxis()->FindBin(zCut))->DrawCopy(i>0?"SAME":"");
6991 //hist = histList[i]->ProjectionY("proj", prim->GetXaxis()->FindBin(-zCut), prim->GetXaxis()->FindBin(zCut))->DrawCopy(i>0?"SAME":"");
6992 hist->SetLineColor(i+1);
6998 hist->Scale(1.0 / hist->Integral(hist->GetXaxis()->FindBin(-0.5), hist->GetXaxis()->FindBin(0.5)) * count);
7000 count += hist->Integral(hist->GetXaxis()->FindBin(-0.5), hist->GetXaxis()->FindBin(0.5));
7005 ratio = (TH1*) hist->Clone("ratio");
7006 ratio->Add(primProj, -1);
7008 /* for (Int_t i=hist->GetXaxis()->FindBin(-0.1); i<=hist->GetXaxis()->FindBin(0.1); i++)
7009 ratio->SetBinContent(i, 0);*/
7011 for (Int_t i=1; i<=hist->GetNbinsX(); i++)
7012 ratio->SetBinError(i, 0);
7014 ratio->SetLineColor(4);
7015 ratio->DrawCopy("SAME E");
7022 secProj = (TH1*) secProj->Clone();
7025 ratio->Divide(secProj);
7027 /* for (Int_t i=1; i<=hist->GetNbinsX(); i++)
7028 ratio->SetBinError(i, 0);*/
7030 ratio->Draw("HIST");
7031 ratio->GetYaxis()->SetRangeUser(0.7, 1.3);
7033 ratio->Fit("pol0", "0+", "", -5, -1);
7034 ratio->Fit("pol0", "0+", "", 1, 5);
7037 void TrackCuts_CompareParameters(const char* fileName1, const char* fileName2, const char* histName, const char* cutFolder = "cuts_quality_only")
7039 // plotWhich: 0 = only before
7043 // mirror: kTRUE --> project negative values on the positive side
7045 Int_t plotWhich = 0;
7046 Bool_t mirror = kFALSE;
7049 files[0] = TFile::Open(fileName1);
7050 files[1] = TFile::Open(fileName2);
7053 Int_t colors[] = { 1, 2, 3, 4, 5, 6 };
7055 TLegend* legend = new TLegend(0.7, 0.85, 0.93, 0.98);
7056 legend->SetTextSize(0.04);
7057 legend->SetFillColor(0);
7059 TCanvas* c1 = new TCanvas(histName, histName, 1200, 600);
7061 //TCanvas* c2 = new TCanvas("c2", "c2", 800, 600);
7062 //TCanvas* c3 = new TCanvas("c3", "c3", 800, 600);
7064 const char* folders2[] = { "before_cuts", "after_cuts" };
7065 const char* names[] = { "MC", "Data" };
7066 Bool_t first = kTRUE;
7067 for (Int_t j = ((plotWhich < 2) ? 0 : 1); j < ((plotWhich > 0) ? 2 : 1); j++)
7071 for (Int_t i = 0; i < 2; i++)
7073 Printf("%d %d", j, i);
7075 folder.Form("%s/%s/%s", cutFolder, folders2[j], histName);
7076 TH1* hist = (TH1*) files[i]->Get(folder);
7080 for (Int_t bin=1; bin<=hist->GetXaxis()->FindBin(-0.0001); bin++)
7082 Int_t newBin = hist->GetXaxis()->FindBin(-hist->GetXaxis()->GetBinCenter(bin));
7085 hist->Fill(-hist->GetXaxis()->GetBinCenter(bin), hist->GetBinContent(bin));
7086 hist->SetBinContent(bin, 0);
7091 legend->AddEntry(hist, Form("%s %s", names[i], (plotWhich == 1) ? folders2[j] : " "));
7094 hist->SetLineColor(colors[count]);
7095 hist->Scale(1.0 / hist->Integral());
7097 hist->DrawCopy((count == 0) ? "" : "SAME");
7101 case 0: base = hist; break;
7102 case 1: base2 = hist; break;
7109 ratio->Divide(base2);
7111 ratio->GetYaxis()->SetRangeUser(0, 2);
7114 ratio->DrawCopy((first) ? "" : "SAME");
7118 c1->cd(1)->SetLogy();
7119 c1->cd(1)->SetGridx();
7120 c1->cd(1)->SetGridy();
7123 c1->cd(2)->SetGridx();
7124 c1->cd(2)->SetGridy();
7126 c1->SaveAs(Form("%s.png", histName));
7129 void PlotQA(const char* fileName)
7133 if (!gGrid && TString(fileName).BeginsWith("alien://"))
7134 TGrid::Connect("alien://");
7136 TFile::Open(fileName);
7139 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
7141 prim = (TH2*) list->FindObject("fDCAPrimaries");
7142 dcaxy = prim->ProjectionX("dcaxy", prim->GetYaxis()->FindBin(-3.2), prim->GetYaxis()->FindBin(3.2));
7143 dcaz = prim->ProjectionY("dcaz", prim->GetXaxis()->FindBin(-2.4), prim->GetXaxis()->FindBin(2.4));
7144 centrCorr = (TH2*) list->FindObject("fCentralityCorrelation");
7146 cuts = (AliESDtrackCuts*) list->FindObject("cuts_quality_dca");
7147 cluster = cuts->GetNClustersTPC(1);
7149 ptall = (TH1F*) cuts->GetPtHist(1)->Clone("ptall");
7150 if (ptall->Integral() > 0)
7151 ptall->Scale(1.0 / ptall->Integral());
7153 check_its = (AliESDtrackCuts*) list->FindObject("check_its");
7154 ptIts = (TH1F*) check_its->GetPtHist(1)->Clone("ptIts");
7155 if (ptIts->Integral() > 0)
7156 ptIts->Scale(1.0 / ptIts->Integral());
7158 global_cuts = (AliESDtrackCuts*) list->FindObject("global_cuts");
7159 ptItsAcc = (TH1*) global_cuts->GetPtHist(1)->Clone("ptItsAcc");
7160 if (ptItsAcc->Integral() > 0)
7161 ptItsAcc->Scale(1.0 / ptItsAcc->Integral());
7164 list = (TList*) gFile->Get("CentralityStat");
7165 centrQuality = (TH1*) list->FindObject("fHOutQuality");
7168 list = (TList*) gFile->Get("PhysSel");
7169 physSel = (AliPhysicsSelection*) list->FindObject("AliPhysicsSelection");
7172 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7173 centr = h->GetCentralityDistribution();
7174 NormalizeToBinWidth(centr);
7175 Int_t events = (Int_t) h->GetEventCount()->ProjectionX()->GetBinContent(3);
7177 h->SetPtRange(1.01, 3.99);
7178 dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, 4.01, 14.99, 1, 8);
7180 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
7181 hMixed->SetPtRange(1.01, 3.99);
7182 dphi_corr_mixed = hMixed->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, 4.01, 14.99, 1, 8);
7184 TString tmp(fileName);
7185 tmp.ReplaceAll("alien:///alice/cern.ch/user/j/jgrosseo/gridjob/dir_", "");
7186 tmp.ReplaceAll(".root", ".png");
7187 tmp.ReplaceAll("/", "-");
7189 title.Form("QA_%d_%s", physSel->GetCurrentRun(), tmp.Data());
7190 c = new TCanvas(title, title, 1200, 800);
7193 latex = new TLatex(0.15, 0.8, Form("%d events", events));
7194 latex->SetTextSize(0.075);
7197 c->cd(1); dcaxy->Draw(); dcaz->SetLineColor(2); dcaz->Draw("SAME"); gPad->SetLogy(); latex->Draw();
7198 c->cd(2); dphi_corr->Draw(); dphi_corr->GetYaxis()->SetRangeUser(dphi_corr->GetMinimum() * 0.9, dphi_corr->GetMaximum() * 1.1); dphi_corr_mixed->SetLineColor(2); dphi_corr_mixed->Draw("SAME");
7199 c->cd(3); cluster->Draw();
7200 c->cd(4); centrQuality->Draw();
7201 c->cd(5); centr->Draw("HIST");
7202 c->cd(6); centrCorr->Draw("COLZ"); gPad->SetLogz();
7203 c->cd(7); ptall->Draw(); ptIts->SetLineColor(2); ptIts->Draw("SAME"); ptItsAcc->SetLineColor(4); ptItsAcc->Draw("SAME"); gPad->SetLogy();
7205 c->SaveAs(Form("qa/%s", c->GetTitle()));
7208 void CompareStepsOnePlot(const char* fileName, Int_t caseId)
7212 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7214 Int_t stepList[] = { 0, 2, 4, 5, 6 };
7215 Int_t stepListNames[] = { 0, 2, 3, 4, 5 };
7216 //const char* names[] = { "All", "PhysSel+Vertex", "Reco Primaries", "Reco "
7217 // //Int_t stepList[] = { 2, 4, 5, 6 };
7220 // TH1* hist1 = h->GetUEHist(2)->GetUEHist(0, 0, 6.01, 9.99, 6, 14);
7221 // TH1* hist2 = h->GetUEHist(2)->GetUEHist(0, 0, 6.01, 7.99, 6, 14);
7222 // TH1* hist3 = h->GetUEHist(2)->GetUEHist(0, 0, 8.01, 9.99, 6, 14);
7225 // hist2->SetLineColor(2);
7226 // hist2->Draw("SAME");
7227 // hist3->SetLineColor(4);
7228 // hist3->Draw("SAME");
7232 legend = new TLegend(0.65, 0.45, 0.85, 0.85);
7233 legend->SetTextSize(0.04);
7234 legend->SetFillColor(0);
7238 for (Int_t i=0; i<5; i++)
7240 //TH1* hist1 = h->GetUEHist(2)->GetEventHist()->Project(stepList[i], 0);
7242 /* h->GetUEHist(2)->GetTrackHist(0)->GetGrid(stepList[i])->GetGrid()->GetAxis(1)->SetRangeUser(1.01, 3.99);
7243 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(stepList[i])->GetGrid()->GetAxis(2)->SetRangeUser(4.01, 19.99);
7244 TH1* hist1 = h->GetUEHist(2)->GetTrackHist(0)->Project(stepList[i], 4);*/
7247 TH1* hist1 = h->GetUEHist(2)->GetUEHist(stepList[i], 0, 4.01, 19.99, 6, 14);
7248 else if (caseId == 1)
7249 TH1* hist1 = h->GetUEHist(2)->GetEventHist()->Project(stepList[i], 0);
7253 hist1->SetMarkerStyle(24+i);
7254 hist1->SetTitle("");
7256 hist1->DrawCopy((i==0)?"":"SAME");
7257 hist1->Fit("pol0", "0");
7258 //hist1->Fit("pol0");
7259 histList[i] = hist1;
7260 legend->AddEntry(hist1, Form("Step %d", stepListNames[i]), "P");
7266 legend = new TLegend(0.65, 0.45, 0.85, 0.85);
7267 legend->SetTextSize(0.04);
7268 legend->SetFillColor(0);
7270 for (Int_t i=1; i<5; i++)
7272 histList[i]->DrawCopy((i==1)?"":"SAME")->Divide(histList[i-1]);
7273 legend->AddEntry(hist1, Form("Step %d/%d", stepListNames[i], stepListNames[i-1]), "P");
7279 for (Int_t i=0; i<5; i++)
7281 hist1 = histList[i];
7282 func = new TF1("func", "[0]", -10, 10);
7283 hist1->Fit(func, "0", "", 1, 2);
7284 hist1->Add(func, -1);
7285 hist1->DrawCopy((i==0)?"":"SAME");
7291 for (Int_t i=1; i<5; i++)
7293 histList[i]->DrawCopy((i==1)?"":"SAME")->Divide(histList[i-1]);
7299 void PtShift(const char* fileName)
7303 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7308 ptHist3 = h->GetCorrelationpT()->ProjectionY();
7309 ptHist3->GetXaxis()->SetRangeUser(0, 20);
7313 func = new TF1("func", "[0]+[1]*x**[2]", 4, 20);
7314 func->SetParLimits(2, -10, -1);
7315 func->SetParameters(0, 1, -4);
7316 ptHist3->Fit(func, "", "", 4, 20);
7321 ptHist3Shifted = (TH1*) ptHist3->Clone("ptHist3Shifted");
7322 for (Int_t i=1; i<ptHist3Shifted->GetNbinsX(); i++)
7323 //ptHist3Shifted->SetBinContent(i, ptHist3Shifted->GetBinContent(i+3));
7324 ptHist3Shifted->SetBinContent(i, ptHist3Shifted->GetBinContent(1.1*i));
7328 ptHist3Shifted->SetLineColor(2);
7331 ptHist3Shifted->Rebin(2);
7333 ptHist3->DrawCopy();
7334 ptHist3Shifted->DrawCopy("SAME");
7337 ptHist3->Divide(ptHist3Shifted);
7340 //ptHist3->Rebin(2); ptHist3->Scale(1.0 / 2);
7346 void RAA(const char* fileName, const char* fileName2)
7352 for (Int_t j=0; j<2; j++)
7355 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7361 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName2);
7364 ptHist3 = h->GetCorrelationpT()->ProjectionY(Form("proj1_%d", j), 1, 5);
7365 ptHist3->GetXaxis()->SetRangeUser(0, 20);
7367 //h->GetCentralityDistribution()->Draw(); new TCanvas;
7369 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(4.99));
7370 Printf("%d", nEvents);
7371 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
7377 hist[0]->DrawCopy("");
7378 hist[1]->DrawCopy("SAME")->SetLineColor(2);
7382 hist[1]->Divide(hist[0]);
7383 hist[1]->DrawCopy();
7385 raa_central = ReadHepdata("raa_alice_central.txt", kFALSE, 3);
7386 raa_central->SetMarkerStyle(20);
7387 raa_central->Draw("PSAME");
7390 void PtComparison(const char* fileName, const char* fileName2 = 0)
7397 for (Int_t j=0; j<2; j++)
7400 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7406 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName2);
7409 //new TCanvas; h->GetCorrelationpT()->Draw("COLZ");
7411 ptHist3 = h->GetCorrelationpT()->ProjectionY(Form("proj1_%d", j), 1, 5);
7412 ptHist3->GetXaxis()->SetRangeUser(0, 20);
7414 //h->GetCentralityDistribution()->Draw(); new TCanvas;
7416 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(4.99));
7417 Printf("%d", nEvents);
7418 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
7420 //ptHist3->Scale(1690);
7421 //ptHist3->Scale(1.0 / ptHist3->Integral(ptHist3->GetXaxis()->FindBin(1.01), ptHist3->GetNbinsX()) / 3 / 0.6);
7423 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
7424 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
7425 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
7427 //AliPWG0Helper::NormalizeToBinWidth(ptHist3);
7430 ptHist3->SetLineStyle(j+1);
7431 ptHist3->DrawCopy((j == 0) ? "HIST" : "HISTSAME")->SetLineColor(1);
7433 centralPt = (TH1*) ptHist3->Clone();;
7437 ptHist3 = h->GetCorrelationpT()->ProjectionY(Form("proj2_%d", j), 71, 80);
7438 ptHist3->GetXaxis()->SetRangeUser(0, 20);
7440 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(70.01), h->GetCentralityDistribution()->FindBin(79.99));
7441 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
7442 //ptHist3->Scale(10.0 / ptHist3->Integral(ptHist3->GetXaxis()->FindBin(1.01), ptHist3->GetNbinsX()) / 3 / 0.6);
7443 Printf("%d", nEvents);
7445 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
7446 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
7447 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
7450 ptHist3->SetLineStyle(j+1);
7451 ptHist3->DrawCopy("HISTSAME")->SetLineColor(2);
7453 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
7454 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
7456 // RemovePointsBelowX(dndpt_central, 1);
7457 // RemovePointsBelowX(dndpt_peripheral, 1);
7459 // NormalizeTo(dndpt_central, 1);
7460 // NormalizeTo(dndpt_peripheral, 10);
7462 dndpt_central->Draw("*SAME");
7463 dndpt_peripheral->SetLineColor(2);
7464 dndpt_peripheral->SetMarkerColor(2);
7465 dndpt_peripheral->Draw("*SAME");
7471 for (Int_t i=1; i<ptHist3->GetNbinsX(); i++)
7472 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / dndpt_peripheral->Eval(ptHist3->GetBinCenter(i)));
7474 for (Int_t i=1; i<centralPt->GetNbinsX(); i++)
7475 centralPt->SetBinContent(i, centralPt->GetBinContent(i) / dndpt_central->Eval(centralPt->GetBinCenter(i)));
7477 ptHist3->Rebin(2); ptHist3->Scale(0.5);
7478 centralPt->Rebin(2); centralPt->Scale(0.5);
7480 ptHist3->DrawCopy((j == 0) ? "" : "SAME")->SetLineColor(2);
7481 centralPt->DrawCopy("SAME")->SetLineColor(1);
7486 ReadYields("preliminaries/yields_110303.root");
7488 ptHist3->Scale(100);
7490 TGraphErrors** tmp = yields[0][1][0];
7492 nearSide->Draw("* SAME");
7494 TGraphErrors** tmp = yields[1][1][0];
7496 awaySide->SetLineColor(2);
7497 awaySide->SetMarkerColor(2);
7498 awaySide->Draw("* SAME");
7502 void style(Int_t styleId = 1)
7504 gStyle->SetPalette(1);
7505 gStyle->SetCanvasColor(10);
7506 gStyle->SetHistFillColor(10);
7507 gStyle->SetHistFillStyle(0);
7508 gStyle->SetOptStat(0);
7509 gStyle->SetPadTickX(1);
7510 gStyle->SetPadTickY(1);
7511 gStyle->SetAxisColor(1, "X");
7512 gStyle->SetAxisColor(1, "Y");
7513 gStyle->SetAxisColor(1, "Z");
7514 gStyle->SetLabelColor(1, "X");
7515 gStyle->SetLabelColor(1, "Y");
7516 gStyle->SetLabelColor(1, "Z");
7517 gStyle->SetTickLength(0.03, "X");
7518 gStyle->SetTickLength(0.03, "Y");
7519 gStyle->SetTickLength(0.03, "Z");
7520 gStyle->SetTitleXSize(0.05);
7521 gStyle->SetTitleYSize(0.05);
7522 gStyle->SetNdivisions(506, "X");
7523 gStyle->SetNdivisions(506, "Y");
7524 gStyle->SetNdivisions(506, "Z");
7526 //gStyle->SetPadGridX(1);
7527 //gStyle->SetPadGridY(1);
7529 //gStyle->SetLabelOffset(0.02, "X");
7530 //gStyle->SetLabelOffset(0.02, "Y");
7531 //gStyle->SetLabelOffset(0.02, "Z");
7532 gStyle->SetLabelSize(0.05, "X");
7533 gStyle->SetLabelSize(0.05, "Y");
7534 gStyle->SetLabelSize(0.05, "Z");
7536 gStyle->SetPadLeftMargin(0.12);
7537 gStyle->SetPadRightMargin(0.02);
7538 gStyle->SetPadBottomMargin(0.13);
7539 gStyle->SetPadTopMargin(0.02);
7541 gStyle->SetMarkerSize(1.4); // CKB
7543 const int iFont = 42; // type * 10 + prec 6: helvetica bold 13: times normal 2: times bold
7546 *-* 1 : times-medium-i-normal "Times New Roman" 1 4
7547 *-* 2 : times-bold-r-normal "Times New Roman" 0 7
7548 *-* 3 : times-bold-i-normal "Times New Roman" 1 7
7549 *-* 4 : helvetica-medium-r-normal "Arial" 0 4
7550 *-* 5 : helvetica-medium-o-normal "Arial" 1 4
7551 *-* 6 : helvetica-bold-r-normal "Arial" 0 7
7552 *-* 7 : helvetica-bold-o-normal "Arial" 1 7
7553 *-* 8 : courier-medium-r-normal "Courier New" 0 4
7554 *-* 9 : courier-medium-o-normal "Courier New" 1 4
7555 *-* 10 : courier-bold-r-normal "Courier New" 0 7
7556 *-* 11 : courier-bold-o-normal "Courier New" 1 7
7557 *-* 12 : symbol-medium-r-normal "Symbol" 0 6
7558 *-* 13 : times-medium-r-normal "Times New Roman" 0 4
7559 *-* 14 : "Wingdings" 0 4
7562 //gStyle->SetTitleXOffset(1); // 1.1
7563 //gStyle->SetTitleYOffset(1); // 1-4
7565 gStyle->SetLabelFont(iFont, "xyz");
7566 gStyle->SetStatFont(iFont);
7567 gStyle->SetTitleFont(iFont, "xyz");
7568 gStyle->SetTextFont(iFont);
7572 gStyle->SetLabelSize(0.07, "X");
7573 gStyle->SetLabelSize(0.07, "Y");
7574 gStyle->SetLabelSize(0.07, "Z");
7575 gStyle->SetTitleXSize(0.07);
7576 gStyle->SetTitleYSize(0.07);
7578 gStyle->SetPadLeftMargin(0.26);
7579 gStyle->SetPadRightMargin(0.01);
7580 gStyle->SetPadBottomMargin(0.15);
7581 gStyle->SetPadTopMargin(0.01);
7584 //gStyle->SetEndErrorSize(0.0);
7586 gROOT->ForceStyle();
7590 void NormalizeTo(TGraphErrors* graph, Float_t normalizeTo)
7593 for (Int_t i=0; i<graph->GetN(); i++)
7594 sum += graph->GetY()[i];
7596 if (normalizeTo > 0 && sum > 0)
7599 for (Int_t i=0; i<graph->GetN(); i++)
7601 graph->SetPoint(i, graph->GetX()[i], graph->GetY()[i] / sum);
7602 graph->SetPointError(i, graph->GetEX()[i], graph->GetEY()[i] / sum);