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 const char* lastFileName = 0;
328 void* cacheSameEvent = 0;
329 void* cacheMixedEvent = 0;
331 void* GetUEHistogram(const char* fileName, TList** listRef = 0, Bool_t mixed = kFALSE)
333 if (!lastFileName || strcmp(lastFileName, fileName) != 0)
335 lastFileName = fileName;
336 file = TFile::Open(fileName);
340 list = (TList*) gFile->Get("PWG4_LeadingTrackUE/histosLeadingTrackUE");
342 list = (TList*) gFile->Get("PWG4_PhiCorrelations/histosPhiCorrelations");
350 cacheMixedEvent = list->FindObject("AliUEHistogramsMixed");
351 cacheSameEvent = list->FindObject("AliUEHistogramsSame");
354 return cacheMixedEvent;
356 if (list->FindObject("AliUEHistograms"))
357 return list->FindObject("AliUEHistograms");
359 return cacheSameEvent;
363 Printf("GetUEHistogram --> Using cache");
366 return cacheMixedEvent;
368 return cacheSameEvent;
372 void CompareBias(const char* mcFile = "PWG4_JetTasksOutput.root", Int_t region, Int_t ueHist)
376 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(mcFile);
379 const char* axis = "z";
380 Float_t ptLeadMin = 0;
381 Float_t ptLeadMax = -1;
385 ptLeadMin = 0.51 + 0;
386 ptLeadMax = 1.99 + 0;
390 biasFromData = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepBiasStudy, AliUEHist::kCFStepReconstructed, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromData");
391 biasFromData2 = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepBiasStudy2, AliUEHist::kCFStepReconstructed, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromData2");
392 //biasFromData = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepRealLeading, region, axis)->Clone("biasFromData");
393 biasFromMC = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepTracked, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromMC");
394 //biasFromMC = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepRealLeading, region, axis)->Clone("biasFromMC");
396 /* biasFromData->Draw();
397 biasFromMC->SetLineColor(2);
398 biasFromMC->Draw("SAME");
401 DrawRatio(biasFromData, biasFromMC, "bias: data vs MC");
402 DrawRatio(biasFromData, biasFromData2, "bias: data vs data two step");
405 void CompareBiasWithData(const char* mcFile = "PWG4_JetTasksOutput.root", const char* dataFile = "esd.root", Int_t region = 2)
409 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(mcFile);
412 biasFromMC = (TH1*) h->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepTracked, region, "z")->Clone("biasFromMC");
414 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(dataFile);
417 biasFromData = (TH1*) h2->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepBiasStudy, AliUEHist::kCFStepReconstructed, region, "z")->Clone("biasFromData");
418 biasFromData2 = (TH1*) h2->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepBiasStudy2, AliUEHist::kCFStepReconstructed, region, "z")->Clone("biasFromData2");
420 DrawRatio(biasFromData, biasFromMC, "bias: data vs MC");
421 DrawRatio(biasFromData, biasFromData2, "bias: data vs data two step");
426 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)
430 if (!gCache || !gFirst)
432 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
433 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
445 AliUEHistograms* h = (AliUEHistograms*) gFirst;
446 AliUEHistograms* h2 = (AliUEHistograms*) gSecond;
453 TH1* hist1 = h->GetUEHist(id)->GetUEHist(step1, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
454 //TH1* hist1 = h->GetUEHist(id)->GetUEHist(step1, region, ptLeadMin, ptLeadMax);
455 TH1* hist2 = h2->GetUEHist(id)->GetUEHist(step2, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
457 //hist1->Scale(1.0 / hist1->Integral());
458 //hist2->Scale(1.0 / hist2->Integral());
463 trackHist = h->GetUEHist(id)->GetTrackHist(region)->ShowProjection(2, 0);
464 // only keep bins under consideration
465 for (Int_t bin=1; bin<=trackHist->GetNbinsX(); bin++)
466 if (bin < trackHist->FindBin(ptLeadMin) || bin > trackHist->FindBin(ptLeadMax))
467 trackHist->SetBinContent(bin, 0);
470 // systematic uncertainty
471 TH1* syst = 0; //GetSystematicUncertainty(hist1, trackHist);
473 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);
476 void CompareEventHist(const char* fileName1, const char* fileName2, Int_t id, Int_t step, Int_t var)
480 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
483 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
486 TH1* hist1 = h->GetUEHist(id)->GetEventHist()->ShowProjection(var, step);
487 TH1* hist2 = h2->GetUEHist(id)->GetEventHist()->ShowProjection(var, step);
489 DrawRatio(hist1, hist2, "compare");
492 void CompareEventHist(const char* fileName1, const char* fileName2, Int_t id, Int_t step1, Int_t step2, Int_t var)
496 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
499 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
502 TH1* hist1 = h->GetUEHist(id)->GetEventHist()->ShowProjection(var, step1);
503 TH1* hist2 = h2->GetUEHist(id)->GetEventHist()->ShowProjection(var, step2);
505 DrawRatio(hist1, hist2, "compare");
508 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)
510 // fileName1 is labelled Corrected in the plot
516 Compare(fileName1, fileName2, id, step, step, region, ptLeadMin, ptLeadMax);
519 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)
521 // fileName1 is labelled Corrected in the plot
527 Compare(fileName1, fileName2, id, step1, step2, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
530 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)
534 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, mixed);
538 return h->GetUEHist(id)->GetUEHist(step, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd, twoD)->DrawCopy();
541 void DrawExample(const char* fileName)
546 hist = DrawStep(fileName, 2, 6, 0, 4.01, 19.99, 1, 6, 0);
549 hist->SetYTitle("1/N_{trig} dN/d#Delta#phi");
551 hist = DrawStep(fileName, 2, 6, 0, 4.01, 19.99, 1, 6, 1);
554 hist->SetZTitle("1/N_{trig} d^{2}N/d#Delta#phid#Delta#eta");
555 hist->GetYaxis()->SetTitleOffset(1.5);
556 hist->GetZaxis()->SetTitleOffset(1.2);
559 hist2 = DrawStep(fileName, 2, 6, 0, 4.01, 19.99, 1, 6, 1, kTRUE);
562 hist2->SetZTitle("1/N_{trig} d^{2}N/d#Delta#phid#Delta#eta");
563 hist2->GetYaxis()->SetTitleOffset(1.5);
564 hist2->GetZaxis()->SetTitleOffset(1.2);
565 hist2->Draw("SURF1");
568 hist = (TH1*) hist->Clone();
570 hist->SetZTitle("C(dN/d#Delta#phi#Delta#eta)");
574 void DrawValidation(const char* fileName1, const char* fileName2)
579 CompareStep(fileName1, fileName2, 2, 6, 4, 0, 4.01, 19.99);
580 CompareStep(fileName1, fileName2, 2, 4, 4, 0, 4.01, 19.99);
582 CompareStep(fileName1, fileName2, 2, 4, 2, 0, 4.01, 19.99);
583 CompareStep(fileName1, fileName2, 2, 2, 2, 0, 4.01, 19.99);
586 void ProfileMultiplicity(const char* fileName = "PWG4_JetTasksOutput.root")
590 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
593 h->GetCorrelationMultiplicity()->Draw("colz");
597 h->GetCorrelationMultiplicity()->ProfileX()->DrawCopy()->Fit("pol1", "", "", 1, 10);
600 void SetupRanges(void* obj)
602 //((AliUEHistograms*) obj)->SetEtaRange(-0.79, 0.79);
603 ((AliUEHistograms*) obj)->SetPtRange(gpTMin, gpTMax);
604 ((AliUEHistograms*) obj)->SetCombineMinMax(kTRUE);
607 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)
609 AliUEHist* corrected = (AliUEHist*) correctedVoid;
610 AliUEHist* comparison = (AliUEHist*) comparisonVoid;
612 Int_t beginStep = AliUEHist::kCFStepAll;
613 Int_t endStep = AliUEHist::kCFStepReconstructed;
615 if (compareStep != -1)
617 beginStep = compareStep;
618 endStep = compareStep;
621 Int_t beginRegion = 0;
624 if (compareRegion != -1)
626 beginRegion = compareRegion;
627 endRegion = compareRegion;
630 for (Int_t step=beginStep; step<=endStep; step++)
632 if (compareStep == -1 && (step == AliUEHist::kCFStepAnaTopology || step == AliUEHist::kCFStepTriggered))
635 for (Int_t region=beginRegion; region <= endRegion; region++)
637 Printf("%f %f", ptLeadMin, ptLeadMax);
638 TH1* corrHist = corrected->GetUEHist(step, region, ptLeadMin, ptLeadMax);
639 TH1* mcHist = comparison->GetUEHist(step, region, ptLeadMin, ptLeadMax);
641 DrawRatio(corrHist, mcHist, TString(Form("%s: step %d %s %s", name, step, corrected->GetStepTitle(step), corrected->GetRegionTitle(region))));
646 void DrawRatios(void* correctedVoid, void* comparisonVoid, Int_t compareStep = -1, Int_t compareRegion = 2, Int_t compareUEHist = 0)
648 AliUEHistograms* corrected = (AliUEHistograms*) correctedVoid;
649 AliUEHistograms* comparison = (AliUEHistograms*) comparisonVoid;
651 if (1 && compareUEHist == 2)
653 for (Float_t ptMin = 2.01; ptMin < 8; ptMin += 2)
655 ((AliUEHistograms*) corrected)->SetPtRange(ptMin, ptMin + 1.98);
656 ((AliUEHistograms*) comparison)->SetPtRange(ptMin, ptMin + 1.98);
658 DrawRatios(TString(Form("Dphi %d pT %f", compareUEHist, ptMin)), corrected->GetUEHist(compareUEHist), comparison->GetUEHist(compareUEHist), compareStep, compareRegion, 8.01, 19.99);
663 if (compareUEHist == -1)
665 for (Int_t i=0; i<2; i++)
666 DrawRatios(TString(Form("UE %d", i)), corrected->GetUEHist(i), comparison->GetUEHist(i), compareStep, compareRegion);
669 DrawRatios(TString(Form("UE %d", compareUEHist)), corrected->GetUEHist(compareUEHist), comparison->GetUEHist(compareUEHist), compareStep, compareRegion);
672 void CompareEventsTracks(void* corrVoid, void* mcVoid, Int_t compareStep, Int_t compareRegion, Int_t compareUEHist = 0)
674 AliUEHist* corr = ((AliUEHistograms*) corrVoid)->GetUEHist(compareUEHist);
675 AliUEHist* mc = ((AliUEHistograms*) mcVoid)->GetUEHist(compareUEHist);
677 Float_t ptLeadMin = 0;
678 Float_t ptLeadMax = -1;
681 if (compareUEHist == 2)
688 TH1* corrHist = corr->GetUEHist(compareStep, compareRegion, ptLeadMin, ptLeadMax);
689 TH1* mcHist = mc ->GetUEHist(compareStep, compareRegion, ptLeadMin, ptLeadMax);
691 DrawRatio(corrHist, mcHist, Form("check"));
693 corr->SetBinLimits(corr->GetTrackHist(compareRegion)->GetGrid(compareStep));
694 mc->SetBinLimits(corr->GetTrackHist(compareRegion)->GetGrid(compareStep));
696 corrHist = corr->GetTrackHist(compareRegion)->GetGrid(compareStep)->Project(axis);
697 mcHist = mc ->GetTrackHist(compareRegion)->GetGrid(compareStep)->Project(axis);
698 DrawRatio(corrHist, mcHist, Form("check2"));
700 corrHist = corr->GetEventHist()->GetGrid(compareStep)->Project(0);
701 mcHist = mc ->GetEventHist()->GetGrid(compareStep)->Project(0);
702 DrawRatio(corrHist, mcHist, Form("check3"));
705 void correctMC(const char* fileNameCorrections, const char* fileNameESD = 0, Int_t compareStep = -1, Int_t compareRegion = 2, Int_t compareUEHist = 0)
707 // corrects the reconstructed step in fileNameESD with fileNameCorr
708 // if fileNameESD is 0 data from fileNameCorr is taken
709 // afterwards the corrected distributions are compared with the MC stored in fileNameESD
713 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
715 corr->ExtendTrackingEfficiency();
717 AliUEHistograms* testSample = corr;
719 testSample = (AliUEHistograms*) GetUEHistogram(fileNameESD);
721 // copy to esd object
722 AliUEHistograms* esd = (AliUEHistograms*) corr->Clone();
724 esd->CopyReconstructedData(testSample);
727 SetupRanges(testSample);
735 file3 = TFile::Open("correctedMC.root", "RECREATE");
736 file3->mkdir("PWG4_PhiCorrelations");
737 file3->cd("PWG4_PhiCorrelations");
738 list->Write("histosPhiCorrelations", TObject::kSingleKey);
742 DrawRatios(esd, testSample, compareStep, compareRegion, compareUEHist);
746 esd->SetPtRange(2.01, 3.99);
747 corrected = esd->GetUEHist(2)->GetUEHist(0, 0, 4.01, 7.99, 0, -1, 1);
748 testSample->SetPtRange(2.01, 3.99);
749 mc = testSample->GetUEHist(2)->GetUEHist(0, 0, 4.01, 7.99, 0, -1, 1);
750 new TCanvas; corrected->DrawCopy("SURF1");
751 new TCanvas; mc->DrawCopy("SURF1");
752 new TCanvas; mc->DrawCopy("SURF1")->Divide(corrected);
755 //CompareEventsTracks(esd, testSample, compareStep, compareRegion, compareUEHist);
758 // function to compare only final step for all regions and distributions
760 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)
762 // corrects fileNameESD with fileNameCorrections and compares the two
766 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
769 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD, &list);
774 corr->ExtendTrackingEfficiency();
778 TFile::Open(contEnhancement);
779 contEncHist = (TH1*) gFile->Get("histo");
780 contEncHistFullRange = (TH1*) corr->GetUEHist(0)->GetTrackingEfficiency(1)->Clone("contEncHistFullRange");
782 contEncHistFullRange->Reset();
783 for (Int_t i=1; i<=contEncHistFullRange->GetNbinsX(); i++)
785 contEncHistFullRange->SetBinContent(i, 1);
786 if (i <= contEncHist->GetNbinsX() && contEncHist->GetXaxis()->GetBinCenter(i) < contEncUpTo && contEncHist->GetBinContent(i) > 0)
787 contEncHistFullRange->SetBinContent(i, contEncHist->GetBinContent(i));
789 corr->SetContaminationEnhancement((TH1F*) contEncHistFullRange);
793 //esd->GetUEHist(2)->AdditionalDPhiCorrection(0);
795 file3 = TFile::Open("corrected.root", "RECREATE");
796 file3->mkdir("PWG4_PhiCorrelations");
797 file3->cd("PWG4_PhiCorrelations");
798 list->Write(0, TObject::kSingleKey);
801 DrawRatios(esd, corr, compareStep, compareRegion, compareUEHist);
804 void ITSTPCEfficiency(const char* fileNameData, Int_t id, Int_t itsTPC = 0)
808 // uncertainty from dN/dpT paper
809 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};
810 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
811 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
813 TH1F* effHist = new TH1F("effHist", "effHist", 39, pTBins);
814 for (Int_t i=0; i<39; i++)
819 effHist->SetBinContent(i+1, (itsTPC == 0) ? effITS[bin] : effTPC[bin]);
822 new TCanvas; effHist->Draw();
824 EffectOfModifiedTrackingEfficiency(fileNameData, id, 2, effHist, 1, -1, (itsTPC == 0) ? "ITS" : "TPC");
828 void EffectOfModifiedTrackingEfficiency(const char* fileNameData, Int_t id, Int_t region, TH1* trackingEff, Int_t axis1, Int_t axis2 = -1, const char* name = "EffectOfModifiedTrackingEfficiency")
830 // trackingEff should contain the change in tracking efficiency, i.e. between before and after in the eta-pT plane
834 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
835 SetupRanges(corrected);
837 AliUEHist* ueHist = corrected->GetUEHist(id);
839 Float_t ptLeadMin = -1;
840 Float_t ptLeadMax = -1;
843 // the uncertainty is flat in delta phi, so use this trick to get directly the uncertainty as function of leading pT
849 TH1* before = ueHist->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
852 // the CFStepTriggered step is overwritten here and cannot be used for comparison afterwards anymore
853 ueHist->CorrectTracks(AliUEHist::kCFStepAll, AliUEHist::kCFStepTriggered, (TH1*) 0, 0, -1);
855 // reapply tracking efficiency
856 ueHist->CorrectTracks(AliUEHist::kCFStepTriggered, AliUEHist::kCFStepAll, trackingEff, axis1, axis2);
859 TH1* after = ueHist->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
861 DrawRatio(before, after, name);
862 gPad->GetCanvas()->SaveAs(Form("%s.png", name));
865 void EffectOfTrackCuts(const char* fileNameData, Int_t id, const char* systFile)
869 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
870 effHist = (TH2D*) corrected->GetUEHist(0)->GetTrackingEfficiency()->Clone("effHist");
872 file = TFile::Open(systFile);
875 const char* systNames[] = { "NClusTPC", "Chi2TPC", "SigmaDCA" };
877 for (Int_t i=0; i<maxSyst; i++)
879 for (Int_t j=0; j<2; j++)
882 histName.Form("%s_syst_%s", systNames[i], (j == 0) ? "up" : "down");
883 systEffect = (TH2*) file->Get(histName);
887 for (Int_t x=1; x <= effHist->GetNbinsX(); x++)
888 for (Int_t y=1; y <= effHist->GetNbinsY(); y++)
889 effHist->SetBinContent(x, y, 1);
891 for (Int_t x=1; x <= systEffect->GetNbinsX(); x++)
892 for (Int_t y=1; y <= systEffect->GetNbinsY(); y++)
893 if (systEffect->GetBinContent(x, y) != 0)
894 effHist->SetBinContent(effHist->GetXaxis()->FindBin(systEffect->GetYaxis()->GetBinCenter(y)), effHist->GetYaxis()->FindBin(systEffect->GetXaxis()->GetBinCenter(x)), systEffect->GetBinContent(x, y));
897 //new TCanvas; systEffect->Draw("COLZ"); new TCanvas; effHist->Draw("COLZ");
899 EffectOfModifiedTrackingEfficiency(fileNameData, id, (id == 2) ? 0 : 2, effHist, 0, 1, histName);
906 void ModifyComposition(const char* fileNameData, const char* fileNameCorrections, Int_t id, Bool_t verbose = kFALSE)
910 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
911 SetupRanges(corrected);
913 AliUEHistograms* corrections = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
914 SetupRanges(corrections);
916 ueHistData = (AliUEHist*) corrected->GetUEHist(id);
917 ueHistCorrections = (AliUEHist*) corrections->GetUEHist(id);
920 // the CFStepTriggered step is overwritten here and cannot be used for comparison afterwards anymore
921 ueHistData->CorrectTracks(AliUEHist::kCFStepAll, AliUEHist::kCFStepTriggered, (TH1*) 0, 0);
924 Float_t ptLeadMin = -1;
925 Float_t ptLeadMax = -1;
929 // the uncertainty is flat in delta phi, so use this trick to get directly the uncertainty as function of leading pT
936 for (Int_t region=0; region<maxRegion; region++)
937 before[region] = ueHistData->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
939 //defaultEff = ueHistCorrections->GetTrackingEfficiency();
940 defaultEff = ueHistCorrections->GetTrackingCorrection();
941 //defaultEffpT = ueHistCorrections->GetTrackingEfficiency(1);
942 defaultEffpT = ueHistCorrections->GetTrackingCorrection(1);
943 defaultContainer = ueHistCorrections->GetTrackHistEfficiency();
946 defaultEffpT->Draw("");
948 Float_t largestDeviation[3];
949 for (Int_t i=0; i<maxRegion; i++)
950 largestDeviation[i] = 0;
952 for (Int_t i=0; i<7; i++)
954 // case 0: // default
955 // case 1: // + 30% kaons
956 // case 2: // - 30% kaons
957 // case 3: // + 30% protons
958 // case 4: // - 30% protons
959 // case 5: // + 30% others
960 // case 6: // - 30% others
961 Int_t correctionIndex = (i+1) / 2 + 1; // bin 1 == protons, bin 2 == kaons, ...
962 Double_t scaleFactor = (i % 2 == 1) ? 1.3 : 0.7;
966 newContainer = (AliCFContainer*) defaultContainer->Clone();
968 // modify, change all steps
969 for (Int_t j=0; j<newContainer->GetNStep(); j++)
971 THnSparse* grid = newContainer->GetGrid(j)->GetGrid();
973 for (Int_t binIdx = 0; binIdx < grid->GetNbins(); binIdx++)
976 Double_t value = grid->GetBinContent(binIdx, bins);
977 Double_t error = grid->GetBinError(binIdx);
979 if (bins[2] != correctionIndex)
982 value *= scaleFactor;
983 error *= scaleFactor;
985 grid->SetBinContent(bins, value);
986 grid->SetBinError(bins, error);
990 // put in corrections
991 ueHistCorrections->SetTrackHistEfficiency(newContainer);
994 //modifiedEff = ueHistCorrections->GetTrackingEfficiency();
995 modifiedEff = ueHistCorrections->GetTrackingCorrection();
996 modifiedEff->Divide(modifiedEff, defaultEff);
997 //modifiedEff->Draw("COLZ");
1000 //modifiedEffpT = ueHistCorrections->GetTrackingEfficiency(1);
1001 modifiedEffpT = ueHistCorrections->GetTrackingCorrection(1);
1002 modifiedEffpT->SetLineColor(i+1);
1003 modifiedEffpT->Draw("SAME");
1005 // apply change in tracking efficiency
1006 ueHistData->CorrectTracks(AliUEHist::kCFStepTriggered, AliUEHist::kCFStepAll, modifiedEff, 0, 1);
1008 for (Int_t region=0; region<maxRegion; region++)
1011 TH1* after = ueHistData->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
1014 DrawRatio(before[region], (TH1*) after->Clone(), Form("Region %d Composition %d", region, i));
1016 // ratio is flat, extract deviation
1017 after->Divide(before[region]);
1018 after->Fit("pol0", "0");
1019 Float_t deviation = 100.0 - 100.0 * after->GetFunction("pol0")->GetParameter(0);
1020 Printf("Deviation for region %d case %d is %.2f %%", region, i, deviation);
1022 if (TMath::Abs(deviation) > largestDeviation[region])
1023 largestDeviation[region] = TMath::Abs(deviation);
1028 for (Int_t i=0; i<maxRegion; i++)
1029 Printf("Largest deviation in region %d is %f", i, largestDeviation[i]);
1046 if (line.Length() == 0)
1050 fileName.Form("%s/%s/PWG4_JetTasksOutput.root", "maps", line.Data());
1051 Printf("%s", fileName.Data());
1053 m.AddFile(fileName);
1057 m.OutputFile("merged.root");
1061 void MergeList2(const char* listFile, const char* dir, Bool_t onlyPrintEvents = kFALSE, const char* targetDir = "PWG4_LeadingTrackUE")
1068 AliUEHistograms* final = 0;
1069 TList* finalList = 0;
1076 if (line.Length() == 0)
1080 fileName.Form("%s/%s/PWG4_JetTasksOutput.root", dir, line.Data());
1081 Printf("%s", fileName.Data());
1084 AliUEHistograms* obj = (AliUEHistograms*) GetUEHistogram(fileName, &list);
1090 final = (AliUEHistograms*) obj;
1091 //final->GetEventCount()->Draw(); return;
1092 Printf("Events: %d", (Int_t) final->GetEventCount()->ProjectionX()->GetBinContent(4));
1097 additional = (AliUEHistograms*) obj;
1098 Printf("Events: %d", (Int_t) additional->GetEventCount()->ProjectionX()->GetBinContent(4));
1100 if (!onlyPrintEvents)
1103 list2.Add(additional);
1104 final->Merge(&list2);
1111 if (onlyPrintEvents)
1114 Printf("Total events (at step 0): %d", (Int_t) final->GetEventCount()->ProjectionX()->GetBinContent(4));
1116 file3 = TFile::Open("merged.root", "RECREATE");
1117 file3->mkdir(targetDir);
1118 file3->cd(targetDir);
1119 finalList->Write(0, TObject::kSingleKey);
1123 void PlotAll(const char* correctedFile, const char* mcFile)
1129 Float_t range[] = { 1.5, 2 };
1133 Float_t range[] = { 3, 10 };
1136 for (Int_t id=0; id<3; id++)
1139 gForceRange = range[id];
1145 for (Int_t region=0; region<3; region++)
1147 CompareStep(correctedFile, mcFile, id, 0, region);
1148 gPad->GetCanvas()->SaveAs(Form("%s_%s_%d_%d.png", TString(correctedFile).Tokenize(".")->First()->GetName(), TString(mcFile).Tokenize(".")->First()->GetName(), id, region));
1153 Float_t leadingPtArr[] = { 0.50, 2.0, 4.0, 6.0, 10.0, 20.0, 50.0 };
1154 for (Int_t leadingPtID=0; leadingPtID<6; leadingPtID++)
1156 CompareStep(correctedFile, mcFile, id, 0, 0, leadingPtArr[leadingPtID] + 0.01, leadingPtArr[leadingPtID+1] - 0.01);
1157 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]));
1164 TGraph* GetFlow2040()
1166 // from first ALICE flow paper (provided by Raimond)
1167 // http://www-library.desy.de/spires/find/hep/www?eprint=arXiv:1011.3914
1169 // centrality 20-30%
1170 Double_t xCumulant4th2030ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1171 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
1172 5.500000,7.000000,9.000000};
1173 Double_t yCumulant4th2030ALICE[] = {0.000000,0.000000,0.030926,0.041076,0.052063,0.059429,0.070500,0.084461,0.086745,0.099254,
1174 0.109691,0.116398,0.130831,0.141959,0.158932,0.169680,0.171387,0.178858,0.171475,0.140358,
1175 0.000000,0.000000,0.000000};
1176 Double_t xErrCumulant4th2030ALICE[23] = {0.};
1177 Double_t yErrCumulant4th2030ALICE[] = {0.000000,0.000000,0.002857,0.003451,0.003567,0.003859,0.004609,0.004976,0.005412,0.006277,
1178 0.004748,0.005808,0.006896,0.007987,0.008683,0.008080,0.013278,0.018413,0.024873,0.026057,
1179 0.000000,0.000000,0.000000};
1180 Int_t nPointsCumulant4th2030ALICE = sizeof(xCumulant4th2030ALICE)/sizeof(Double_t);
1181 TGraphErrors *Cumulant4th2030ALICE = new TGraphErrors(nPointsCumulant4th2030ALICE,xCumulant4th2030ALICE,yCumulant4th2030ALICE,
1182 xErrCumulant4th2030ALICE,yErrCumulant4th2030ALICE);
1183 Cumulant4th2030ALICE->SetMarkerStyle(kFullSquare);
1184 Cumulant4th2030ALICE->SetMarkerColor(kRed);
1185 Cumulant4th2030ALICE->SetMarkerSize(1.2);
1186 Cumulant4th2030ALICE->SetFillStyle(1001);
1187 Cumulant4th2030ALICE->SetFillColor(kRed-10);
1189 //===================================================================================================================
1190 // centrality 30-40%
1191 Double_t xCumulant4th3040ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1192 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
1193 5.500000,7.000000,9.000000};
1194 Double_t yCumulant4th3040ALICE[] = {0.000000,0.000000,0.037071,0.048566,0.061083,0.070910,0.078831,0.091396,0.102026,0.109691,
1195 0.124449,0.139819,0.155561,0.165701,0.173678,0.191149,0.202015,0.204540,0.212560,0.195885,
1196 0.000000,0.000000,0.000000};
1197 Double_t xErrCumulant4th3040ALICE[23] = {0.};
1198 Double_t yErrCumulant4th3040ALICE[] = {0.000000,0.000000,0.002992,0.003364,0.003669,0.003931,0.004698,0.005261,0.005446,0.006151,
1199 0.004980,0.005741,0.007198,0.008576,0.010868,0.009926,0.015269,0.020691,0.027601,0.031834,
1200 0.000000,0.000000,0.000000};
1201 Int_t nPointsCumulant4th3040ALICE = sizeof(xCumulant4th3040ALICE)/sizeof(Double_t);
1202 TGraphErrors *Cumulant4th3040ALICE = new TGraphErrors(nPointsCumulant4th3040ALICE,xCumulant4th3040ALICE,yCumulant4th3040ALICE,
1203 xErrCumulant4th3040ALICE,yErrCumulant4th3040ALICE);
1204 Cumulant4th3040ALICE->SetMarkerStyle(kFullTriangleUp);
1205 Cumulant4th3040ALICE->SetMarkerColor(kGreen+2);
1206 Cumulant4th3040ALICE->SetMarkerSize(1.2);
1207 Cumulant4th3040ALICE->SetFillStyle(1001);
1208 Cumulant4th3040ALICE->SetFillColor(kGreen+2);
1210 // build average between the two (for class 20-40%)
1211 Double_t* yAverage = new Double_t[nPointsCumulant4th3040ALICE];
1212 for (Int_t i=0; i<nPointsCumulant4th3040ALICE; i++)
1213 yAverage[i] = (yCumulant4th2030ALICE[i] + yCumulant4th3040ALICE[i]) / 2;
1215 // assume flow constant above highest pT; not neccessarily physically sound ;)
1218 yAverage[20] = yAverage[19];
1219 xCumulant4th3040ALICE[20] = 100;
1220 nPointsCumulant4th3040ALICE -= 2;
1223 TGraph *flow2040 = new TGraph(nPointsCumulant4th3040ALICE,xCumulant4th3040ALICE,yAverage);
1227 flow2040->Draw("*A");
1228 Cumulant4th2030ALICE->Draw("PSAME");
1229 Cumulant4th3040ALICE->Draw("PSAME");
1237 TGraph* GetFlow1020()
1239 // from first ALICE flow paper (provided by Raimond)
1240 // http://www-library.desy.de/spires/find/hep/www?eprint=arXiv:1011.3914
1242 //===================================================================================================================
1243 // centrality 10-20%
1244 Double_t xCumulant4th1020ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1245 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
1246 5.500000,7.000000,9.000000};
1247 Double_t yCumulant4th1020ALICE[] = {0.000000,0.000000,0.024075,0.031505,0.040413,0.044981,0.055358,0.060563,0.063378,0.070030,
1248 0.082692,0.091611,0.099641,0.107223,0.122376,0.131240,0.137425,0.146050,0.131365,0.124708,
1249 0.000000,0.000000,0.000000};
1250 Double_t xErrCumulant4th1020ALICE[23] = {0.};
1251 Double_t yErrCumulant4th1020ALICE[] = {0.000000,0.000000,0.002413,0.002931,0.003444,0.003950,0.004338,0.004835,0.005059,0.005586,
1252 0.004521,0.005278,0.005999,0.007072,0.008260,0.007279,0.011897,0.017409,0.023995,0.025701,
1253 0.000000,0.000000,0.000000};
1254 Int_t nPointsCumulant4th1020ALICE = sizeof(xCumulant4th1020ALICE)/sizeof(Double_t);
1256 // assume flow constant above highest pT; not neccessarily physically sound ;)
1259 yCumulant4th1020ALICE[20] = yCumulant4th1020ALICE[19];
1260 xCumulant4th1020ALICE[20] = 100;
1261 nPointsCumulant4th1020ALICE -= 2;
1264 TGraphErrors *Cumulant4th1020ALICE = new TGraphErrors(nPointsCumulant4th1020ALICE,xCumulant4th1020ALICE,yCumulant4th1020ALICE,
1265 xErrCumulant4th1020ALICE,yErrCumulant4th1020ALICE);
1267 Cumulant4th1020ALICE->SetMarkerStyle(kFullCircle);
1268 Cumulant4th1020ALICE->SetMarkerColor(kBlue);
1269 Cumulant4th1020ALICE->SetMarkerSize(1.2);
1270 Cumulant4th1020ALICE->SetFillStyle(1001);
1271 Cumulant4th1020ALICE->SetFillColor(kBlue-10);
1273 TGraph *flow1020 = new TGraph(nPointsCumulant4th1020ALICE,xCumulant4th1020ALICE,yCumulant4th1020ALICE);
1277 flow1020->Draw("*A");
1278 Cumulant4th1020ALICE->Draw("PSAME");
1288 // takes flow measurement from 10-20% and scales by a factor extracted from Fig.3 in the ALICE flow paper
1289 // factor = integrated flow in 0-5% / integrated flow in 10-20%
1291 graph = GetFlow1020();
1292 for (Int_t i=0; i<graph->GetN(); i++)
1293 graph->GetY()[i] *= 0.016 / 0.055;
1298 TGraphErrors* GetFlow01_Rap02(Int_t n)
1300 // private communication 19.04.11, Raimond / Ante
1304 // v2{SP}(pt) for 0-1%, rapidity gap = 0.2:
1305 const Int_t nPointsSP_0001ALICE_v2_etaGap02 = 18;
1306 Double_t xSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
1307 0.750000,0.850000,0.950000,1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1308 Double_t ySP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.009235,0.014105,0.017274,0.018245,0.023190,
1309 0.024871,0.028216,0.031506,0.034179,0.035337,0.039836,0.045261,0.043393,0.050693,0.056469,0.055247,0.049718,0.052748};
1310 Double_t xErrSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.};
1311 Double_t yErrSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.000515,0.000504,0.000532,0.000585,0.000641,
1312 0.000709,0.000788,0.000876,0.000723,0.000891,0.001098,0.001354,0.001671,0.001485,0.002463,0.004038,0.006441,0.008091};
1313 TGraphErrors *SP_0001ALICE_v2_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v2_etaGap02,xSP_0001ALICE_v2_etaGap02,
1314 ySP_0001ALICE_v2_etaGap02,xErrSP_0001ALICE_v2_etaGap02,yErrSP_0001ALICE_v2_etaGap02);
1315 SP_0001ALICE_v2_etaGap02->SetMarkerStyle(kFullCircle);
1316 SP_0001ALICE_v2_etaGap02->SetMarkerColor(kBlue);
1317 SP_0001ALICE_v2_etaGap02->SetFillStyle(1001);
1318 SP_0001ALICE_v2_etaGap02->SetFillColor(kBlue-10);
1320 return SP_0001ALICE_v2_etaGap02;
1325 // v3{SP}(pt) for 0-1%, rapidity gap = 0.2:
1326 const Int_t nPointsSP_0001ALICE_v3_etaGap02 = 18;
1327 Double_t xSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
1328 0.750000,0.850000,0.950000,1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1329 Double_t ySP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.005688,0.007222,0.010305,0.013795,0.016077,
1330 0.018693,0.022310,0.026991,0.030162,0.035119,0.043097,0.048201,0.058249,0.063273,0.079233,0.083465,0.087807,0.069577};
1331 Double_t xErrSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.};
1332 Double_t yErrSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.000585,0.000582,0.000614,0.000667,0.000734,
1333 0.000811,0.000898,0.000989,0.000817,0.001000,0.001234,0.001517,0.001874,0.001669,0.002765,0.004528,0.007202,0.009066};
1334 TGraphErrors *SP_0001ALICE_v3_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v3_etaGap02,xSP_0001ALICE_v3_etaGap02,ySP_0001ALICE_v3_etaGap02,
1335 xErrSP_0001ALICE_v3_etaGap02,yErrSP_0001ALICE_v3_etaGap02);
1336 SP_0001ALICE_v3_etaGap02->SetMarkerStyle(kFullTriangleUp);
1337 SP_0001ALICE_v3_etaGap02->SetMarkerSize(1.4);
1338 SP_0001ALICE_v3_etaGap02->SetMarkerColor(kGreen+2);
1339 SP_0001ALICE_v3_etaGap02->SetFillStyle(1001);
1340 SP_0001ALICE_v3_etaGap02->SetFillColor(kGreen-10);
1342 return SP_0001ALICE_v3_etaGap02;
1347 // v4{SP}(pt) for 0-1%, rapidity gap = 0.2:
1348 const Int_t nPointsSP_0001ALICE_v4_etaGap02 = 18;
1349 Double_t xSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
1350 0.750000,0.850000,0.950000,1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1351 Double_t ySP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.001189,0.003540,0.004682,0.004210,0.007032,
1352 0.008627,0.010226,0.013671,0.016214,0.020054,0.023878,0.033939,0.033693,0.040006,0.055612,0.066287,0.074857,0.078751};
1353 Double_t xErrSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.};
1354 Double_t yErrSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.001035,0.001017,0.001081,0.001187,0.001299,
1355 0.001432,0.001590,0.001757,0.001443,0.001769,0.002175,0.002674,0.003296,0.002924,0.004844,0.007921,0.012524,0.015771};
1356 TGraphErrors *SP_0001ALICE_v4_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v4_etaGap02,xSP_0001ALICE_v4_etaGap02,ySP_0001ALICE_v4_etaGap02,
1357 xErrSP_0001ALICE_v4_etaGap02,yErrSP_0001ALICE_v4_etaGap02);
1358 SP_0001ALICE_v4_etaGap02->SetMarkerStyle(kFullSquare);
1359 SP_0001ALICE_v4_etaGap02->SetMarkerColor(kRed);
1360 SP_0001ALICE_v4_etaGap02->SetFillStyle(1001);
1361 SP_0001ALICE_v4_etaGap02->SetFillColor(kRed-10);
1363 return SP_0001ALICE_v4_etaGap02;
1369 TGraphErrors* GetFlow01_Rap10(Int_t n)
1373 // v2{SP}(pt) for 0-1%, rapidity gap = 1.0:
1374 const Int_t nPointsSP_0001ALICE_v2_etaGap10 = 21;
1375 Double_t xSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,
1376 0.750000,0.850000,0.950000,1.100000,1.300000,1.500000,1.700000,1.900000,2.100000,2.300000,2.500000,2.700000,2.900000,
1377 3.250000,3.750000,4.500000};
1378 Double_t ySP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.009129,0.013461,0.017567,0.018041,0.020384,
1379 0.023780,0.021647,0.029543,0.028912,0.029464,0.037016,0.044131,0.043135,0.047286,0.051983,0.049311,0.050472,0.046569,
1380 0.036905,0.054836,0.030527};
1381 Double_t xErrSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.};
1382 Double_t yErrSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.001179,0.001152,0.001219,0.001339,0.001480,
1383 0.001644,0.001831,0.002016,0.001662,0.002033,0.002497,0.003056,0.003777,0.004645,0.005713,0.007069,0.008540,0.010447,
1384 0.009145,0.014749,0.018698};
1385 TGraphErrors *SP_0001ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v2_etaGap10,xSP_0001ALICE_v2_etaGap10,
1386 ySP_0001ALICE_v2_etaGap10,xErrSP_0001ALICE_v2_etaGap10,yErrSP_0001ALICE_v2_etaGap10);
1387 SP_0001ALICE_v2_etaGap10->SetMarkerStyle(kOpenCircle);
1388 SP_0001ALICE_v2_etaGap10->SetMarkerColor(kBlue);
1389 SP_0001ALICE_v2_etaGap10->SetFillStyle(1001);
1390 SP_0001ALICE_v2_etaGap10->SetFillColor(kBlue-10);
1392 return SP_0001ALICE_v2_etaGap10;
1397 // v3{SP}(pt) for 0-1%, rapidity gap = 1.0:
1398 const Int_t nPointsSP_0001ALICE_v3_etaGap10 = 18;
1399 Double_t xSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,
1400 0.750000,0.850000,0.950000,1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1401 Double_t ySP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.006373,0.008403,0.010848,0.011505,0.016728,
1402 0.018519,0.020163,0.027119,0.029315,0.036832,0.040974,0.043287,0.054395,0.060676,0.081763,0.074333,0.096016,0.074909};
1403 Double_t xErrSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.};
1404 Double_t yErrSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.001286,0.001269,0.001346,0.001474,0.001620,
1405 0.001796,0.001991,0.002187,0.001803,0.002203,0.002697,0.003316,0.004078,0.003640,0.006050,0.009873,0.015824,0.020174};
1406 TGraphErrors *SP_0001ALICE_v3_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v3_etaGap10,xSP_0001ALICE_v3_etaGap10,ySP_0001ALICE_v3_etaGap10,
1407 xErrSP_0001ALICE_v3_etaGap10,yErrSP_0001ALICE_v3_etaGap10);
1408 SP_0001ALICE_v3_etaGap10->SetMarkerStyle(kOpenTriangleUp);
1409 SP_0001ALICE_v3_etaGap10->SetMarkerSize(1.2);
1410 SP_0001ALICE_v3_etaGap10->SetMarkerColor(kGreen+2);
1411 SP_0001ALICE_v3_etaGap10->SetFillStyle(1001);
1412 SP_0001ALICE_v3_etaGap10->SetFillColor(kGreen-10);
1414 return SP_0001ALICE_v3_etaGap10;
1419 // v4{SP}(pt) for 0-1%, rapidity gap = 1.0:
1420 const Int_t nPointsSP_0001ALICE_v4_etaGap10 = 11;
1421 Double_t xSP_0001ALICE_v4_etaGap10[nPointsSP_0001ALICE_v4_etaGap10] = {0.300000,0.500000,0.700000,0.900000,1.200000,1.600000,2.000000,2.400000,2.800000,3.500000,4.500000};
1422 Double_t ySP_0001ALICE_v4_etaGap10[nPointsSP_0001ALICE_v4_etaGap10] = {-0.000458,0.006444,0.005490,0.010870,0.018866,0.024370,0.029703,0.052505,0.060334,0.048189,0.128184};
1423 Double_t xErrSP_0001ALICE_v4_etaGap10[nPointsSP_0001ALICE_v4_etaGap10] = {0.};
1424 Double_t yErrSP_0001ALICE_v4_etaGap10[nPointsSP_0001ALICE_v4_etaGap10] = {0.001901,0.002012,0.002477,0.003014,0.002852,0.004297,0.006491,0.009846,0.014623,0.017120,0.040568};
1425 TGraphErrors *SP_0001ALICE_v4_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v4_etaGap10,xSP_0001ALICE_v4_etaGap10,ySP_0001ALICE_v4_etaGap10,
1426 xErrSP_0001ALICE_v4_etaGap10,yErrSP_0001ALICE_v4_etaGap10);
1427 SP_0001ALICE_v4_etaGap10->SetMarkerStyle(kOpenSquare);
1428 SP_0001ALICE_v4_etaGap10->SetMarkerColor(kRed);
1429 SP_0001ALICE_v4_etaGap10->SetFillStyle(1001);
1430 SP_0001ALICE_v4_etaGap10->SetFillColor(kRed-10);
1432 return SP_0001ALICE_v4_etaGap10;
1436 TGraphErrors* GetFlow02_Rap10(Int_t n)
1438 // private communication 20.04.11, Ante B. / Raimond
1442 // v2{SP}(pt) for 00-02%, eta gap = 1.0:
1443 const Int_t nPointsSP_0002_v2_etaGap10 = 15;
1444 Double_t xSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
1445 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
1446 Double_t ySP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.010171,0.013190,0.017342,0.020629,0.022617,0.026549,
1447 0.027423,0.032261,0.037467,0.041001,0.045763,0.049327,0.049688,0.051480,0.038527};
1448 Double_t xErrSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.};
1449 Double_t yErrSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.000600,0.000590,0.000625,0.000683,0.000757,0.000839,
1450 0.000692,0.000848,0.000888,0.001209,0.001653,0.002252,0.002465,0.003968,0.009391};
1451 TGraphErrors *SP_0002_v2_etaGap10 = new TGraphErrors(nPointsSP_0002_v2_etaGap10,xSP_0002_v2_etaGap10,ySP_0002_v2_etaGap10,
1452 xErrSP_0002_v2_etaGap10,yErrSP_0002_v2_etaGap10);
1454 return SP_0002_v2_etaGap10;
1459 const Int_t nPointsSP_0002_v3_etaGap10 = 15;
1460 Double_t xSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
1461 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
1462 Double_t ySP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.006592,0.007286,0.012180,0.012242,0.017416,0.018393,
1463 0.024716,0.030980,0.037703,0.046558,0.051285,0.064613,0.074831,0.077093,0.082442};
1464 Double_t xErrSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.};
1465 Double_t yErrSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.000682,0.000676,0.000713,0.000782,0.000860,0.000953,
1466 0.000782,0.000957,0.001002,0.001361,0.001862,0.002541,0.002767,0.004466,0.010586};
1467 TGraphErrors *SP_0002_v3_etaGap10 = new TGraphErrors(nPointsSP_0002_v3_etaGap10,xSP_0002_v3_etaGap10,ySP_0002_v3_etaGap10,
1468 xErrSP_0002_v3_etaGap10,yErrSP_0002_v3_etaGap10);
1470 return SP_0002_v3_etaGap10;
1475 const Int_t nPointsSP_0002_v4_etaGap10 = 15;
1476 Double_t xSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
1477 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
1478 Double_t ySP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {-0.000533,0.001167,0.002081,0.005218,0.006826,0.008440,
1479 0.013009,0.014812,0.017125,0.030106,0.038279,0.050488,0.067640,0.071637,0.084239};
1480 Double_t xErrSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.};
1481 Double_t yErrSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.001427,0.001398,0.001482,0.001594,0.001758,0.001945,
1482 0.001593,0.001951,0.002046,0.002787,0.003802,0.005182,0.005663,0.009064,0.021449};
1483 TGraphErrors *SP_0002_v4_etaGap10 = new TGraphErrors(nPointsSP_0002_v4_etaGap10,xSP_0002_v4_etaGap10,ySP_0002_v4_etaGap10,
1484 xErrSP_0002_v4_etaGap10,yErrSP_0002_v4_etaGap10);
1485 return SP_0002_v4_etaGap10;
1489 TGraphErrors* GetFlow02(Int_t n)
1491 // private communication 28.01.11, Ante B. / Raimond
1496 Double_t xCumulant2nd0002ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1497 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1498 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
1500 Double_t yCumulant2nd0002ALICE_v2[] = {0.000000,0.000000,0.012173,0.015186,0.018580,0.021114,0.024646,0.027040,0.030269,0.032677,
1501 0.035332,0.037382,0.039228,0.040614,0.042460,0.044658,0.046246,0.050392,0.051436,0.054669,
1502 0.057330,0.063439,0.067425,0.060144,0.071260,0.070206,0.000000,0.000000,0.000000,0.000000,
1504 Double_t xErrCumulant2nd0002ALICE_v2[31] = {0.};
1505 Double_t yErrCumulant2nd0002ALICE_v2[] = {0.000000,0.000000,0.000256,0.000259,0.000271,0.000296,0.000322,0.000357,0.000397,0.000438,
1506 0.000483,0.000529,0.000590,0.000639,0.000713,0.000793,0.000877,0.000976,0.001070,0.001197,
1507 0.000725,0.001265,0.002069,0.003156,0.004605,0.006543,0.000000,0.000000,0.000000,0.000000,
1509 Int_t nPointsCumulant2nd0002ALICE_v2 = sizeof(xCumulant2nd0002ALICE_v2)/sizeof(Double_t);
1510 TGraphErrors *Cumulant2nd0002ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v2,xCumulant2nd0002ALICE_v2,yCumulant2nd0002ALICE_v2,
1511 xErrCumulant2nd0002ALICE_v2,yErrCumulant2nd0002ALICE_v2);
1512 Cumulant2nd0002ALICE_v2->SetMarkerStyle(kFullCircle);
1513 Cumulant2nd0002ALICE_v2->SetMarkerColor(kBlue);
1515 return Cumulant2nd0002ALICE_v2;
1521 Double_t xCumulant2nd0002ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1522 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1523 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
1525 Double_t yCumulant2nd0002ALICE_v3[] = {0.000000,0.000000,0.007696,0.008994,0.010544,0.013269,0.016330,0.019234,0.023465,0.026803,
1526 0.029906,0.032211,0.035300,0.038158,0.041861,0.046002,0.049382,0.053574,0.055773,0.059420,
1527 0.069373,0.079922,0.090265,0.103583,0.111358,0.090740,0.000000,0.000000,0.000000,0.000000,
1529 Double_t xErrCumulant2nd0002ALICE_v3[31] = {0.};
1530 Double_t yErrCumulant2nd0002ALICE_v3[] = {0.000000,0.000000,0.000318,0.000317,0.000333,0.000360,0.000392,0.000431,0.000476,0.000523,
1531 0.000575,0.000637,0.000707,0.000785,0.000878,0.000964,0.001064,0.001175,0.001320,0.001459,
1532 0.000889,0.001539,0.002530,0.003826,0.005614,0.007892,0.000000,0.000000,0.000000,0.000000,
1534 Int_t nPointsCumulant2nd0002ALICE_v3 = sizeof(xCumulant2nd0002ALICE_v3)/sizeof(Double_t);
1535 TGraphErrors *Cumulant2nd0002ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v3,xCumulant2nd0002ALICE_v3,yCumulant2nd0002ALICE_v3,
1536 xErrCumulant2nd0002ALICE_v3,yErrCumulant2nd0002ALICE_v3);
1537 Cumulant2nd0002ALICE_v3->SetMarkerStyle(kFullTriangleUp);
1538 Cumulant2nd0002ALICE_v3->SetMarkerSize(1.2);
1539 Cumulant2nd0002ALICE_v3->SetMarkerColor(kGreen+2);
1541 return Cumulant2nd0002ALICE_v3;
1547 Double_t xCumulant2nd0002ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1548 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1549 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
1551 Double_t yCumulant2nd0002ALICE_v4[] = {0.000000,0.000000,0.005710,0.006014,0.004483,0.005453,0.007714,0.006837,0.009721,0.011288,
1552 0.012531,0.016461,0.016606,0.018587,0.022722,0.025497,0.025832,0.030994,0.030349,0.034730,
1553 0.045529,0.061153,0.074238,0.079307,0.088885,0.085218,0.000000,0.000000,0.000000,0.000000,
1555 Double_t xErrCumulant2nd0002ALICE_v4[31] = {0.};
1556 Double_t yErrCumulant2nd0002ALICE_v4[] = {0.000000,0.000000,0.000488,0.000493,0.000523,0.000571,0.000609,0.000678,0.000742,0.000805,
1557 0.000903,0.000985,0.001100,0.001219,0.001352,0.001503,0.001682,0.001847,0.002060,0.002303,
1558 0.001400,0.002431,0.003974,0.006040,0.008901,0.012343,0.000000,0.000000,0.000000,0.000000,
1560 Int_t nPointsCumulant2nd0002ALICE_v4 = sizeof(xCumulant2nd0002ALICE_v4)/sizeof(Double_t);
1561 TGraphErrors *Cumulant2nd0002ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v4,xCumulant2nd0002ALICE_v4,yCumulant2nd0002ALICE_v4,
1562 xErrCumulant2nd0002ALICE_v4,yErrCumulant2nd0002ALICE_v4);
1563 Cumulant2nd0002ALICE_v4->SetMarkerStyle(kFullSquare);
1564 Cumulant2nd0002ALICE_v4->SetMarkerColor(kRed);
1566 return Cumulant2nd0002ALICE_v4;
1572 /* results up to 5 GeV/c
1574 TGraphErrors* GetFlow05(Int_t n)
1576 // private communication 02.02.11, Ante B. / Raimond
1580 // v2{2}(pt) for 0-5%:
1581 Double_t xCumulant2nd0005ALICE_v2[] = {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 yCumulant2nd0005ALICE_v2[] = {0.000000,0.000000,0.013891,0.017693,0.021693,0.025323,0.029131,0.032443,0.035781,0.038256,
1584 0.042801,0.047705,0.053229,0.057387,0.062677,0.068815,0.077695,0.082058,0.082511,0.079791};
1585 Double_t xErrCumulant2nd0005ALICE_v2[20] = {0.};
1586 Double_t yErrCumulant2nd0005ALICE_v2[] = {0.000000,0.000000,0.000149,0.000150,0.000160,0.000174,0.000191,0.000211,0.000233,0.000257,
1587 0.000208,0.000254,0.000311,0.000377,0.000464,0.000419,0.000726,0.001180,0.001791,0.002131};
1588 Int_t nPointsCumulant2nd0005ALICE_v2 = sizeof(xCumulant2nd0005ALICE_v2)/sizeof(Double_t);
1589 TGraphErrors *Cumulant2nd0005ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v2,xCumulant2nd0005ALICE_v2,yCumulant2nd0005ALICE_v2,
1590 xErrCumulant2nd0005ALICE_v2,yErrCumulant2nd0005ALICE_v2);
1591 Cumulant2nd0005ALICE_v2->SetMarkerStyle(kFullCircle);
1592 Cumulant2nd0005ALICE_v2->SetMarkerColor(kBlue);
1594 return Cumulant2nd0005ALICE_v2;
1599 // v3{2}(pt) for 0-5%:
1600 Double_t xCumulant2nd0005ALICE_v3[] = {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 yCumulant2nd0005ALICE_v3[] = {0.000000,0.000000,0.007788,0.009472,0.011596,0.014618,0.017540,0.021020,0.024946,0.028004,
1603 0.032330,0.039491,0.046368,0.053620,0.060662,0.071750,0.086746,0.097857,0.103111,0.104796};
1604 Double_t xErrCumulant2nd0005ALICE_v3[20] = {0.};
1605 Double_t yErrCumulant2nd0005ALICE_v3[] = {0.000000,0.000000,0.000194,0.000192,0.000204,0.000221,0.000241,0.000265,0.000293,0.000323,
1606 0.000266,0.000323,0.000397,0.000486,0.000601,0.000545,0.000947,0.001541,0.002328,0.002777};
1607 Int_t nPointsCumulant2nd0005ALICE_v3 = sizeof(xCumulant2nd0005ALICE_v3)/sizeof(Double_t);
1608 TGraphErrors *Cumulant2nd0005ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v3,xCumulant2nd0005ALICE_v3,yCumulant2nd0005ALICE_v3,
1609 xErrCumulant2nd0005ALICE_v3,yErrCumulant2nd0005ALICE_v3);
1610 Cumulant2nd0005ALICE_v3->SetMarkerStyle(kFullCircle);
1611 Cumulant2nd0005ALICE_v3->SetMarkerColor(kBlue);
1613 return Cumulant2nd0005ALICE_v3;
1618 // v4{2}(pt) for 0-5%:
1619 Double_t xCumulant2nd0005ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1620 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1621 Double_t yCumulant2nd0005ALICE_v4[] = {0.000000,0.000000,0.006121,0.006137,0.005598,0.005956,0.007262,0.007991,0.009159,0.012062,
1622 0.015085,0.019225,0.024782,0.030092,0.035708,0.046542,0.060077,0.076088,0.082964,0.085405};
1623 Double_t xErrCumulant2nd0005ALICE_v4[20] = {0.};
1624 Double_t yErrCumulant2nd0005ALICE_v4[] = {0.000000,0.000000,0.000275,0.000278,0.000294,0.000319,0.000346,0.000380,0.000419,0.000459,
1625 0.000378,0.000460,0.000570,0.000700,0.000865,0.000789,0.001370,0.002227,0.003370,0.004018};
1626 Int_t nPointsCumulant2nd0005ALICE_v4 = sizeof(xCumulant2nd0005ALICE_v4)/sizeof(Double_t);
1627 TGraphErrors *Cumulant2nd0005ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v4,xCumulant2nd0005ALICE_v4,yCumulant2nd0005ALICE_v4,
1628 xErrCumulant2nd0005ALICE_v4,yErrCumulant2nd0005ALICE_v4);
1629 Cumulant2nd0005ALICE_v4->SetMarkerStyle(kFullCircle);
1630 Cumulant2nd0005ALICE_v4->SetMarkerColor(kBlue);
1632 return Cumulant2nd0005ALICE_v4;
1638 TGraphErrors* GetFlow510(Int_t n)
1640 // private communication 02.02.11, Ante B. / Raimond
1644 // v2{2}(pt) for 5-10%:
1645 Double_t xCumulant2nd0510ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1646 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1647 Double_t yCumulant2nd0510ALICE_v2[] = {0.000000,0.000000,0.019872,0.026451,0.032901,0.039085,0.044930,0.050200,0.054887,0.060253,
1648 0.066587,0.075080,0.083303,0.090298,0.098782,0.109632,0.124486,0.129621,0.132076,0.120697};
1649 Double_t xErrCumulant2nd0510ALICE_v2[20] = {0.};
1650 Double_t yErrCumulant2nd0510ALICE_v2[] = {0.000000,0.000000,0.000150,0.000152,0.000163,0.000178,0.000196,0.000215,0.000237,0.000261,
1651 0.000213,0.000256,0.000313,0.000381,0.000468,0.000423,0.000727,0.001157,0.001741,0.002064};
1652 Int_t nPointsCumulant2nd0510ALICE_v2 = sizeof(xCumulant2nd0510ALICE_v2)/sizeof(Double_t);
1653 TGraphErrors *Cumulant2nd0510ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v2,xCumulant2nd0510ALICE_v2,yCumulant2nd0510ALICE_v2,
1654 xErrCumulant2nd0510ALICE_v2,yErrCumulant2nd0510ALICE_v2);
1655 Cumulant2nd0510ALICE_v2->SetMarkerStyle(kOpenCircle);
1656 Cumulant2nd0510ALICE_v2->SetMarkerColor(kBlue);
1658 return Cumulant2nd0510ALICE_v2;
1663 // v3{2}(pt) for 5-10%:
1664 Double_t xCumulant2nd0510ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1665 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1666 Double_t yCumulant2nd0510ALICE_v3[] = {0.000000,0.000000,0.008596,0.010700,0.013820,0.017524,0.021507,0.024316,0.028491,0.032880,
1667 0.038741,0.045830,0.052486,0.059560,0.067990,0.081006,0.097402,0.107050,0.111743,0.116434};
1668 Double_t xErrCumulant2nd0510ALICE_v3[20] = {0.};
1669 Double_t yErrCumulant2nd0510ALICE_v3[] = {0.000000,0.000000,0.000208,0.000207,0.000218,0.000235,0.000258,0.000284,0.000314,0.000347,
1670 0.000285,0.000345,0.000426,0.000521,0.000642,0.000586,0.001008,0.001611,0.002421,0.002853};
1671 Int_t nPointsCumulant2nd0510ALICE_v3 = sizeof(xCumulant2nd0510ALICE_v3)/sizeof(Double_t);
1672 TGraphErrors *Cumulant2nd0510ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v3,xCumulant2nd0510ALICE_v3,yCumulant2nd0510ALICE_v3,
1673 xErrCumulant2nd0510ALICE_v3,yErrCumulant2nd0510ALICE_v3);
1674 Cumulant2nd0510ALICE_v3->SetMarkerStyle(kOpenCircle);
1675 Cumulant2nd0510ALICE_v3->SetMarkerColor(kBlue);
1677 return Cumulant2nd0510ALICE_v3;
1682 // v4{2}(pt) for 5-10%:
1683 Double_t xCumulant2nd0510ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1684 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1685 Double_t yCumulant2nd0510ALICE_v4[] = {0.000000,0.000000,0.006466,0.006731,0.006344,0.007374,0.008775,0.010324,0.012323,0.014533,
1686 0.017261,0.022507,0.028776,0.035403,0.041936,0.051491,0.070340,0.080081,0.095077,0.088526};
1687 Double_t xErrCumulant2nd0510ALICE_v4[20] = {0.};
1688 Double_t yErrCumulant2nd0510ALICE_v4[] = {0.000000,0.000000,0.000292,0.000295,0.000312,0.000336,0.000366,0.000403,0.000443,0.000485,
1689 0.000399,0.000486,0.000603,0.000738,0.000914,0.000836,0.001443,0.002303,0.003448,0.004078};
1690 Int_t nPointsCumulant2nd0510ALICE_v4 = sizeof(xCumulant2nd0510ALICE_v4)/sizeof(Double_t);
1691 TGraphErrors *Cumulant2nd0510ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v4,xCumulant2nd0510ALICE_v4,yCumulant2nd0510ALICE_v4,
1692 xErrCumulant2nd0510ALICE_v4,yErrCumulant2nd0510ALICE_v4);
1693 Cumulant2nd0510ALICE_v4->SetMarkerStyle(kOpenCircle);
1694 Cumulant2nd0510ALICE_v4->SetMarkerColor(kBlue);
1696 return Cumulant2nd0510ALICE_v4;
1702 TGraphErrors* GetFlow1020(Int_t n)
1704 // private communication 02.02.11, Ante B. / Raimond
1708 // v2{2}(pt) for 10-20%:
1709 Double_t xCumulant2nd1020ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1710 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1711 Double_t yCumulant2nd1020ALICE_v2[] = {0.000000,0.000000,0.027683,0.037083,0.046511,0.055519,0.063979,0.071626,0.078537,0.085975,
1712 0.095001,0.106979,0.118456,0.129721,0.140641,0.155161,0.173402,0.179870,0.180616,0.168921};
1713 Double_t xErrCumulant2nd1020ALICE_v2[20] = {0.};
1714 Double_t yErrCumulant2nd1020ALICE_v2[] = {0.000000,0.000000,0.000121,0.000124,0.000134,0.000147,0.000163,0.000179,0.000198,0.000217,
1715 0.000177,0.000212,0.000257,0.000311,0.000380,0.000341,0.000569,0.000882,0.001309,0.001537};
1716 Int_t nPointsCumulant2nd1020ALICE_v2 = sizeof(xCumulant2nd1020ALICE_v2)/sizeof(Double_t);
1717 TGraphErrors *Cumulant2nd1020ALICE_v2 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v2,xCumulant2nd1020ALICE_v2,yCumulant2nd1020ALICE_v2,
1718 xErrCumulant2nd1020ALICE_v2,yErrCumulant2nd1020ALICE_v2);
1719 Cumulant2nd1020ALICE_v2->SetMarkerStyle(kFullSquare);
1720 Cumulant2nd1020ALICE_v2->SetMarkerColor(kRed);
1722 return Cumulant2nd1020ALICE_v2;
1727 // v3{2}(pt) for 10-20%:
1728 Double_t xCumulant2nd1020ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1729 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1730 Double_t yCumulant2nd1020ALICE_v3[] = {0.000000,0.000000,0.009830,0.012858,0.016111,0.020120,0.023948,0.028349,0.032741,0.037244,
1731 0.043385,0.051803,0.059374,0.068686,0.076763,0.090151,0.106530,0.117448,0.121383,0.118247};
1732 Double_t xErrCumulant2nd1020ALICE_v3[20] = {0.};
1733 Double_t yErrCumulant2nd1020ALICE_v3[] = {0.000000,0.000000,0.000171,0.000170,0.000180,0.000195,0.000215,0.000236,0.000261,0.000287,
1734 0.000236,0.000288,0.000353,0.000434,0.000536,0.000488,0.000823,0.001277,0.001892,0.002224};
1735 Int_t nPointsCumulant2nd1020ALICE_v3 = sizeof(xCumulant2nd1020ALICE_v3)/sizeof(Double_t);
1736 TGraphErrors *Cumulant2nd1020ALICE_v3 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v3,xCumulant2nd1020ALICE_v3,yCumulant2nd1020ALICE_v3,
1737 xErrCumulant2nd1020ALICE_v3,yErrCumulant2nd1020ALICE_v3);
1738 Cumulant2nd1020ALICE_v3->SetMarkerStyle(kFullSquare);
1739 Cumulant2nd1020ALICE_v3->SetMarkerColor(kRed);
1741 return Cumulant2nd1020ALICE_v3;
1746 // v4{2}(pt) for 10-20%:
1747 Double_t xCumulant2nd1020ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1748 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1749 Double_t yCumulant2nd1020ALICE_v4[] = {0.000000,0.000000,0.007423,0.007647,0.008189,0.008592,0.009489,0.011671,0.013739,0.017199,
1750 0.020084,0.026004,0.031843,0.038388,0.047357,0.057251,0.072433,0.086326,0.094282,0.097432};
1751 Double_t xErrCumulant2nd1020ALICE_v4[20] = {0.};
1752 Double_t yErrCumulant2nd1020ALICE_v4[] = {0.000000,0.000000,0.000243,0.000244,0.000257,0.000279,0.000306,0.000335,0.000368,0.000405,
1753 0.000333,0.000406,0.000502,0.000618,0.000770,0.000701,0.001185,0.001845,0.002730,0.003193};
1754 Int_t nPointsCumulant2nd1020ALICE_v4 = sizeof(xCumulant2nd1020ALICE_v4)/sizeof(Double_t);
1755 TGraphErrors *Cumulant2nd1020ALICE_v4 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v4,xCumulant2nd1020ALICE_v4,yCumulant2nd1020ALICE_v4,
1756 xErrCumulant2nd1020ALICE_v4,yErrCumulant2nd1020ALICE_v4);
1757 Cumulant2nd1020ALICE_v4->SetMarkerStyle(kFullSquare);
1758 Cumulant2nd1020ALICE_v4->SetMarkerColor(kRed);
1760 return Cumulant2nd1020ALICE_v4;
1766 TGraphErrors* GetFlow2030(Int_t n)
1768 // private communication 02.02.11, Ante B. / Raimond
1772 Double_t xCumulant2nd2030ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1773 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1774 Double_t yCumulant2nd2030ALICE_v2[] = {0.000000,0.000000,0.035557,0.048064,0.060768,0.072585,0.083808,0.093772,0.103310,0.112602,
1775 0.124846,0.140603,0.155345,0.169450,0.183077,0.200173,0.219693,0.225741,0.223318,0.207356};
1776 Double_t xErrCumulant2nd2030ALICE_v2[20] = {0.};
1777 Double_t yErrCumulant2nd2030ALICE_v2[] = {0.000000,0.000000,0.000144,0.000147,0.000159,0.000175,0.000194,0.000214,0.000235,0.000259,
1778 0.000211,0.000254,0.000310,0.000377,0.000464,0.000418,0.000677,0.001027,0.001513,0.001761};
1779 Int_t nPointsCumulant2nd2030ALICE_v2 = sizeof(xCumulant2nd2030ALICE_v2)/sizeof(Double_t);
1780 TGraphErrors *Cumulant2nd2030ALICE_v2 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v2,xCumulant2nd2030ALICE_v2,yCumulant2nd2030ALICE_v2,
1781 xErrCumulant2nd2030ALICE_v2,yErrCumulant2nd2030ALICE_v2);
1782 Cumulant2nd2030ALICE_v2->SetMarkerStyle(kOpenSquare);
1783 Cumulant2nd2030ALICE_v2->SetMarkerColor(kRed);
1785 return Cumulant2nd2030ALICE_v2;
1790 // v3{2}(pt) for 20-30%:
1791 Double_t xCumulant2nd2030ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1792 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1793 Double_t yCumulant2nd2030ALICE_v3[] = {0.000000,0.000000,0.011287,0.014937,0.018479,0.022962,0.027854,0.031938,0.037038,0.041443,
1794 0.049872,0.058720,0.068353,0.077692,0.087859,0.099863,0.116141,0.124486,0.124786,0.119520};
1795 Double_t xErrCumulant2nd2030ALICE_v3[20] = {0.};
1796 Double_t yErrCumulant2nd2030ALICE_v3[] = {0.000000,0.000000,0.000215,0.000216,0.000228,0.000248,0.000272,0.000300,0.000332,0.000366,
1797 0.000301,0.000369,0.000456,0.000561,0.000700,0.000636,0.001038,0.001574,0.002307,0.002676};
1798 Int_t nPointsCumulant2nd2030ALICE_v3 = sizeof(xCumulant2nd2030ALICE_v3)/sizeof(Double_t);
1799 TGraphErrors *Cumulant2nd2030ALICE_v3 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v3,xCumulant2nd2030ALICE_v3,yCumulant2nd2030ALICE_v3,
1800 xErrCumulant2nd2030ALICE_v3,yErrCumulant2nd2030ALICE_v3);
1801 Cumulant2nd2030ALICE_v3->SetMarkerStyle(kOpenSquare);
1802 Cumulant2nd2030ALICE_v3->SetMarkerColor(kRed);
1804 return Cumulant2nd2030ALICE_v3;
1809 // v4{2}(pt) for 20-30%:
1810 Double_t xCumulant2nd2030ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1811 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1812 Double_t yCumulant2nd2030ALICE_v4[] = {0.000000,0.000000,0.008435,0.009824,0.009387,0.010408,0.011458,0.013770,0.016335,0.019165,
1813 0.023770,0.030071,0.036231,0.043950,0.051803,0.065222,0.082155,0.091864,0.105061,0.105167};
1814 Double_t xErrCumulant2nd2030ALICE_v4[20] = {0.};
1815 Double_t yErrCumulant2nd2030ALICE_v4[] = {0.000000,0.000000,0.000308,0.000308,0.000328,0.000355,0.000391,0.000430,0.000473,0.000524,
1816 0.000430,0.000524,0.000652,0.000807,0.001006,0.000919,0.001502,0.002277,0.003339,0.003871};
1817 Int_t nPointsCumulant2nd2030ALICE_v4 = sizeof(xCumulant2nd2030ALICE_v4)/sizeof(Double_t);
1818 TGraphErrors *Cumulant2nd2030ALICE_v4 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v4,xCumulant2nd2030ALICE_v4,yCumulant2nd2030ALICE_v4,
1819 xErrCumulant2nd2030ALICE_v4,yErrCumulant2nd2030ALICE_v4);
1820 Cumulant2nd2030ALICE_v4->SetMarkerStyle(kOpenSquare);
1821 Cumulant2nd2030ALICE_v4->SetMarkerColor(kRed);
1823 return Cumulant2nd2030ALICE_v4;
1829 TGraphErrors* GetFlow3040(Int_t n)
1831 // private communication 02.02.11, Ante B. / Raimond
1835 // v2{2}(pt) for 30-40%:
1836 Double_t xCumulant2nd3040ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1837 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1838 Double_t yCumulant2nd3040ALICE_v2[] = {0.000000,0.000000,0.040797,0.055427,0.070543,0.084024,0.096562,0.109411,0.119853,0.130964,
1839 0.145377,0.163806,0.179825,0.196178,0.210377,0.226556,0.245686,0.247898,0.240058,0.225011};
1840 Double_t xErrCumulant2nd3040ALICE_v2[20] = {0.};
1841 Double_t yErrCumulant2nd3040ALICE_v2[] = {0.000000,0.000000,0.000177,0.000182,0.000197,0.000216,0.000239,0.000265,0.000293,0.000325,
1842 0.000266,0.000321,0.000395,0.000486,0.000603,0.000536,0.000840,0.001258,0.001843,0.002118};
1843 Int_t nPointsCumulant2nd3040ALICE_v2 = sizeof(xCumulant2nd3040ALICE_v2)/sizeof(Double_t);
1844 TGraphErrors *Cumulant2nd3040ALICE_v2 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v2,xCumulant2nd3040ALICE_v2,yCumulant2nd3040ALICE_v2,
1845 xErrCumulant2nd3040ALICE_v2,yErrCumulant2nd3040ALICE_v2);
1846 Cumulant2nd3040ALICE_v2->SetMarkerStyle(kFullTriangleUp);
1847 Cumulant2nd3040ALICE_v2->SetMarkerSize(1.2);
1848 Cumulant2nd3040ALICE_v2->SetMarkerColor(kGreen+2);
1850 return Cumulant2nd3040ALICE_v2;
1855 // v3{2}(pt) for 30-40%:
1856 Double_t xCumulant2nd3040ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1857 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1858 Double_t yCumulant2nd3040ALICE_v3[] = {0.000000,0.000000,0.012226,0.016391,0.020792,0.026208,0.030380,0.035710,0.041025,0.047062,
1859 0.053075,0.064201,0.074116,0.085314,0.094391,0.106819,0.124012,0.129388,0.134315,0.132330};
1860 Double_t xErrCumulant2nd3040ALICE_v3[20] = {0.};
1861 Double_t yErrCumulant2nd3040ALICE_v3[] = {0.000000,0.000000,0.000284,0.000286,0.000303,0.000329,0.000364,0.000403,0.000443,0.000492,
1862 0.000408,0.000500,0.000627,0.000778,0.000973,0.000874,0.001375,0.002050,0.002992,0.003438};
1863 Int_t nPointsCumulant2nd3040ALICE_v3 = sizeof(xCumulant2nd3040ALICE_v3)/sizeof(Double_t);
1864 TGraphErrors *Cumulant2nd3040ALICE_v3 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v3,xCumulant2nd3040ALICE_v3,yCumulant2nd3040ALICE_v3,
1865 xErrCumulant2nd3040ALICE_v3,yErrCumulant2nd3040ALICE_v3);
1866 Cumulant2nd3040ALICE_v3->SetMarkerStyle(kFullTriangleUp);
1867 Cumulant2nd3040ALICE_v3->SetMarkerSize(1.2);
1868 Cumulant2nd3040ALICE_v3->SetMarkerColor(kGreen+2);
1870 return Cumulant2nd3040ALICE_v3;
1875 // v4{2}(pt) for 30-40%:
1876 Double_t xCumulant2nd3040ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1877 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1878 Double_t yCumulant2nd3040ALICE_v4[] = {0.000000,0.000000,0.010718,0.011490,0.010994,0.012527,0.013748,0.016425,0.018857,0.021622,
1879 0.026853,0.034636,0.042651,0.049892,0.057795,0.070865,0.088486,0.101656,0.113886,0.118202};
1880 Double_t xErrCumulant2nd3040ALICE_v4[20] = {0.};
1881 Double_t yErrCumulant2nd3040ALICE_v4[] = {0.000000,0.000000,0.000401,0.000406,0.000433,0.000472,0.000521,0.000575,0.000634,0.000704,
1882 0.000580,0.000714,0.000890,0.001114,0.001398,0.001253,0.001974,0.002945,0.004290,0.004909};
1883 Int_t nPointsCumulant2nd3040ALICE_v4 = sizeof(xCumulant2nd3040ALICE_v4)/sizeof(Double_t);
1884 TGraphErrors *Cumulant2nd3040ALICE_v4 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v4,xCumulant2nd3040ALICE_v4,yCumulant2nd3040ALICE_v4,
1885 xErrCumulant2nd3040ALICE_v4,yErrCumulant2nd3040ALICE_v4);
1886 Cumulant2nd3040ALICE_v4->SetMarkerStyle(kFullTriangleUp);
1887 Cumulant2nd3040ALICE_v4->SetMarkerSize(1.2);
1888 Cumulant2nd3040ALICE_v4->SetMarkerColor(kGreen+2);
1890 return Cumulant2nd3040ALICE_v4;
1896 TGraphErrors* GetFlow4050(Int_t n)
1898 // private communication 02.02.11, Ante B. / Raimond
1902 // v2{2}(pt) for 40-50%:
1903 Double_t xCumulant2nd4050ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1904 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
1905 Double_t yCumulant2nd4050ALICE_v2[] = {0.000000,0.000000,0.043593,0.059522,0.075558,0.090681,0.104453,0.117913,0.129349,0.141743,
1906 0.157076,0.176121,0.193651,0.208844,0.222402,0.238407,0.252512,0.253592,0.243571,0.233018};
1907 Double_t xErrCumulant2nd4050ALICE_v2[20] = {0.};
1908 Double_t yErrCumulant2nd4050ALICE_v2[] = {0.000000,0.000000,0.000234,0.000241,0.000261,0.000288,0.000322,0.000357,0.000395,0.000438,
1909 0.000362,0.000447,0.000555,0.000685,0.000846,0.000733,0.001121,0.001665,0.002433,0.002768};
1910 Int_t nPointsCumulant2nd4050ALICE_v2 = sizeof(xCumulant2nd4050ALICE_v2)/sizeof(Double_t);
1911 TGraphErrors *Cumulant2nd4050ALICE_v2 = new TGraphErrors(nPointsCumulant2nd4050ALICE_v2,xCumulant2nd4050ALICE_v2,yCumulant2nd4050ALICE_v2,
1912 xErrCumulant2nd4050ALICE_v2,yErrCumulant2nd4050ALICE_v2);
1913 Cumulant2nd4050ALICE_v2->SetMarkerStyle(kOpenTriangleUp);
1914 Cumulant2nd4050ALICE_v2->SetMarkerSize(1.2);
1915 Cumulant2nd4050ALICE_v2->SetMarkerColor(kGreen+2);
1917 return Cumulant2nd4050ALICE_v2;
1924 // results up to high pT
1926 TGraphErrors* GetFlow05(Int_t n)
1928 // private communication 09.03.11, Ante B. / Raimond
1932 // v2{2}(pt) for 0-5%:
1933 Double_t xCumulant2nd0005ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1934 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1935 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
1936 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
1937 Double_t yCumulant2nd0005ALICE[] = {0.000000,0.000000,0.018169,0.020988,0.024899,0.028309,0.031974,0.035188,0.038218,0.041202,
1938 0.043910,0.046560,0.048183,0.050640,0.052874,0.055334,0.056948,0.059427,0.061540,0.063218,
1939 0.065452,0.069222,0.072578,0.074723,0.077749,0.077178,0.080514,0.075325,0.077692,0.079710,
1940 0.073280,0.063849,0.068274,0.066045,0.071496,0.104352,0.091646,0.050220,0.124185,0.088535};
1941 Double_t xErrCumulant2nd0005ALICE[40] = {0.};
1942 Double_t yErrCumulant2nd0005ALICE[] = {0.000000,0.000000,0.000190,0.000191,0.000199,0.000212,0.000230,0.000248,0.000268,0.000293,
1943 0.000319,0.000346,0.000379,0.000418,0.000459,0.000502,0.000554,0.000614,0.000674,0.000749,
1944 0.000620,0.000769,0.000958,0.001182,0.001446,0.001331,0.001858,0.002552,0.003453,0.004606,
1945 0.004289,0.007006,0.010046,0.013853,0.017709,0.016630,0.025728,0.036763,0.045056,0.029011};
1946 Int_t nPointsCumulant2nd0005ALICE = sizeof(xCumulant2nd0005ALICE)/sizeof(Double_t);
1947 TGraphErrors *Cumulant2nd0005ALICE = new TGraphErrors(nPointsCumulant2nd0005ALICE,xCumulant2nd0005ALICE,yCumulant2nd0005ALICE,
1948 xErrCumulant2nd0005ALICE,yErrCumulant2nd0005ALICE);
1949 Cumulant2nd0005ALICE->SetMarkerStyle(kFullCircle);
1950 Cumulant2nd0005ALICE->SetMarkerColor(kBlue);
1952 return Cumulant2nd0005ALICE;
1966 TGraphErrors* GetFlow510(Int_t n)
1968 // private communication 09.03.11, Ante B. / Raimond
1972 // v2{2}(pt) for 5-10%:
1973 Double_t xCumulant2nd0510ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
1974 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
1975 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
1976 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
1977 Double_t yCumulant2nd0510ALICE[] = {0.000000,0.000000,0.022354,0.028064,0.034341,0.040769,0.046265,0.051160,0.056712,0.061354,
1978 0.066290,0.070340,0.074453,0.078444,0.082367,0.085785,0.088086,0.092676,0.096169,0.100366,
1979 0.104227,0.109710,0.117032,0.121784,0.122227,0.126537,0.127966,0.117790,0.117884,0.111436,
1980 0.104945,0.097640,0.086481,0.091663,0.091404,0.080132,0.015864,0.101500,0.033347,0.205130};
1981 Double_t xErrCumulant2nd0510ALICE[40] = {0.};
1982 Double_t yErrCumulant2nd0510ALICE[] = {0.000000,0.000000,0.000173,0.000176,0.000186,0.000199,0.000219,0.000236,0.000260,0.000283,
1983 0.000312,0.000340,0.000373,0.000410,0.000454,0.000501,0.000552,0.000610,0.000675,0.000753,
1984 0.000620,0.000774,0.000961,0.001183,0.001431,0.001309,0.001814,0.002481,0.003342,0.004379,
1985 0.004122,0.006716,0.009851,0.013626,0.017517,0.015790,0.025680,0.038041,0.054144,0.038987};
1986 Int_t nPointsCumulant2nd0510ALICE = sizeof(xCumulant2nd0510ALICE)/sizeof(Double_t);
1987 TGraphErrors *Cumulant2nd0510ALICE = new TGraphErrors(nPointsCumulant2nd0510ALICE,xCumulant2nd0510ALICE,yCumulant2nd0510ALICE,
1988 xErrCumulant2nd0510ALICE,yErrCumulant2nd0510ALICE);
1989 Cumulant2nd0510ALICE->SetMarkerStyle(kOpenCircle);
1990 Cumulant2nd0510ALICE->SetMarkerColor(kBlue);
1992 return Cumulant2nd0510ALICE;
2006 TGraphErrors* GetFlow1020(Int_t n)
2008 // private communication 09.03.11, Ante B. / Raimond
2012 // v2{2}(pt) for 10-20%:
2013 Double_t xCumulant2nd1020ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2014 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2015 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
2016 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
2017 Double_t yCumulant2nd1020ALICE[] = {0.000000,0.000000,0.028508,0.037698,0.046914,0.055750,0.063948,0.072298,0.079396,0.086829,
2018 0.093382,0.099676,0.105412,0.110792,0.116715,0.122327,0.127079,0.132302,0.137183,0.142346,
2019 0.149059,0.156729,0.164672,0.171840,0.175346,0.176824,0.178878,0.174979,0.169229,0.153109,
2020 0.139676,0.125686,0.120554,0.096537,0.084736,0.118152,0.116079,0.060032,0.093764,0.206506};
2021 Double_t xErrCumulant2nd1020ALICE[40] = {0.};
2022 Double_t yErrCumulant2nd1020ALICE[] = {0.000000,0.000000,0.000134,0.000136,0.000145,0.000158,0.000173,0.000190,0.000209,0.000229,
2023 0.000252,0.000275,0.000301,0.000331,0.000365,0.000401,0.000442,0.000488,0.000541,0.000599,
2024 0.000496,0.000614,0.000757,0.000915,0.001095,0.000989,0.001360,0.001847,0.002477,0.003234,
2025 0.003012,0.004867,0.007123,0.009774,0.012740,0.011682,0.019629,0.028568,0.039931,0.024776};
2026 Int_t nPointsCumulant2nd1020ALICE = sizeof(xCumulant2nd1020ALICE)/sizeof(Double_t);
2027 TGraphErrors *Cumulant2nd1020ALICE = new TGraphErrors(nPointsCumulant2nd1020ALICE,xCumulant2nd1020ALICE,yCumulant2nd1020ALICE,
2028 xErrCumulant2nd1020ALICE,yErrCumulant2nd1020ALICE);
2029 Cumulant2nd1020ALICE->SetMarkerStyle(kFullSquare);
2030 Cumulant2nd1020ALICE->SetMarkerColor(kRed);
2032 return Cumulant2nd1020ALICE;
2046 TGraphErrors* GetFlow2030(Int_t n)
2048 // private communication 09.03.11, Ante B. / Raimond
2052 // v2{2}(pt) for 20-30%:
2053 Double_t xCumulant2nd2030ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2054 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2055 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
2056 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
2057 Double_t yCumulant2nd2030ALICE[] = {0.000000,0.000000,0.035366,0.047465,0.060083,0.072090,0.083418,0.093576,0.103842,0.113110,
2058 0.122193,0.130168,0.138158,0.145627,0.152851,0.159129,0.166073,0.173144,0.178698,0.186188,
2059 0.192045,0.202199,0.210535,0.215004,0.220457,0.223339,0.224050,0.211567,0.203955,0.189716,
2060 0.165994,0.147185,0.131953,0.139331,0.151293,0.127406,0.153764,0.089628,0.161247,0.511418};
2061 Double_t xErrCumulant2nd2030ALICE[40] = {0.};
2062 Double_t yErrCumulant2nd2030ALICE[] = {0.000000,0.000000,0.000155,0.000157,0.000169,0.000184,0.000202,0.000222,0.000244,0.000269,
2063 0.000296,0.000325,0.000357,0.000394,0.000435,0.000481,0.000532,0.000589,0.000655,0.000731,
2064 0.000605,0.000743,0.000904,0.001081,0.001277,0.001145,0.001568,0.002119,0.002806,0.003635,
2065 0.003383,0.005346,0.007935,0.010739,0.014682,0.013434,0.021531,0.032352,0.040396,0.028472};
2066 Int_t nPointsCumulant2nd2030ALICE = sizeof(xCumulant2nd2030ALICE)/sizeof(Double_t);
2067 TGraphErrors *Cumulant2nd2030ALICE = new TGraphErrors(nPointsCumulant2nd2030ALICE,xCumulant2nd2030ALICE,yCumulant2nd2030ALICE,
2068 xErrCumulant2nd2030ALICE,yErrCumulant2nd2030ALICE);
2069 Cumulant2nd2030ALICE->SetMarkerStyle(kOpenSquare);
2070 Cumulant2nd2030ALICE->SetMarkerColor(kRed);
2072 return Cumulant2nd2030ALICE;
2086 TGraphErrors* GetFlow3040(Int_t n)
2088 // private communication 09.03.11, Ante B. / Raimond
2092 // v2{2}(pt) for 30-40%:
2093 Double_t xCumulant2nd3040ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2094 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2095 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
2096 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
2097 Double_t yCumulant2nd3040ALICE[] = {0.000000,0.000000,0.039584,0.054196,0.069291,0.082976,0.095622,0.108940,0.119830,0.131587,
2098 0.141091,0.150899,0.160573,0.168676,0.176301,0.183823,0.191672,0.199506,0.206854,0.212830,
2099 0.219526,0.229376,0.236513,0.240863,0.245961,0.245891,0.242608,0.234302,0.219580,0.212848,
2100 0.194666,0.190184,0.171036,0.159173,0.156932,0.141324,0.132809,0.182683,0.023272,0.032825};
2101 Double_t xErrCumulant2nd3040ALICE[40] = {0.};
2102 Double_t yErrCumulant2nd3040ALICE[] = {0.000000,0.000000,0.000189,0.000192,0.000205,0.000224,0.000247,0.000273,0.000302,0.000334,
2103 0.000369,0.000407,0.000448,0.000496,0.000552,0.000612,0.000682,0.000758,0.000844,0.000941,
2104 0.000774,0.000937,0.001123,0.001329,0.001565,0.001397,0.001911,0.002549,0.003378,0.004306,
2105 0.003987,0.006353,0.009128,0.013032,0.016891,0.015806,0.025150,0.035119,0.044487,0.050083};
2106 Int_t nPointsCumulant2nd3040ALICE = sizeof(xCumulant2nd3040ALICE)/sizeof(Double_t);
2107 TGraphErrors *Cumulant2nd3040ALICE = new TGraphErrors(nPointsCumulant2nd3040ALICE,xCumulant2nd3040ALICE,yCumulant2nd3040ALICE,
2108 xErrCumulant2nd3040ALICE,yErrCumulant2nd3040ALICE);
2109 Cumulant2nd3040ALICE->SetMarkerStyle(kFullTriangleUp);
2110 Cumulant2nd3040ALICE->SetMarkerColor(kGreen+2);
2112 return Cumulant2nd3040ALICE;
2126 TGraphErrors* GetFlow4050(Int_t n)
2128 // private communication 09.03.11, Ante B. / Raimond
2132 // v2{2}(pt) for 40-50%:
2133 Double_t xCumulant2nd4050ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2134 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2135 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
2136 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
2137 Double_t yCumulant2nd4050ALICE[] = {0.000000,0.000000,0.041872,0.058090,0.074444,0.089181,0.103780,0.117279,0.129769,0.142051,
2138 0.153185,0.163147,0.173309,0.181668,0.190998,0.197703,0.205011,0.211063,0.219587,0.223287,
2139 0.231163,0.239606,0.246533,0.251457,0.250034,0.252989,0.240823,0.236489,0.230268,0.204321,
2140 0.213476,0.200247,0.167065,0.190655,0.173573,0.166173,0.153232,0.173112,-0.123540,0.211999};
2141 Double_t xErrCumulant2nd4050ALICE[40] = {0.};
2142 Double_t yErrCumulant2nd4050ALICE[] = {0.000000,0.000000,0.000248,0.000251,0.000270,0.000296,0.000328,0.000363,0.000403,0.000447,
2143 0.000500,0.000556,0.000617,0.000687,0.000770,0.000857,0.000952,0.001057,0.001176,0.001297,
2144 0.001054,0.001265,0.001498,0.001767,0.002076,0.001849,0.002527,0.003358,0.004372,0.005573,
2145 0.005091,0.007981,0.011746,0.015732,0.021883,0.019866,0.032443,0.046521,0.051631,0.083717};
2146 Int_t nPointsCumulant2nd4050ALICE = sizeof(xCumulant2nd4050ALICE)/sizeof(Double_t);
2147 TGraphErrors *Cumulant2nd4050ALICE = new TGraphErrors(nPointsCumulant2nd4050ALICE,xCumulant2nd4050ALICE,yCumulant2nd4050ALICE,
2148 xErrCumulant2nd4050ALICE,yErrCumulant2nd4050ALICE);
2149 Cumulant2nd4050ALICE->SetMarkerStyle(kOpenTriangleUp);
2150 Cumulant2nd4050ALICE->SetMarkerColor(kGreen+2);
2152 return Cumulant2nd4050ALICE;
2159 Float_t CalculateFlow(TH1* ptDist, Float_t ptMin, Float_t ptMax, Int_t n, Int_t centralityBegin, Int_t centralityEnd)
2161 if (centralityBegin == 0 && centralityEnd == 1)
2162 flow = GetFlow01_Rap10(n);
2163 else if (centralityBegin == 0 && centralityEnd == 2)
2164 flow = GetFlow02_Rap10(n);
2165 else if (centralityBegin == 0 && centralityEnd == 5)
2166 flow = GetFlow05(n);
2167 else if (centralityBegin == 5 && centralityEnd == 10)
2168 flow = GetFlow510(n);
2169 else if (centralityBegin == 20 && centralityEnd == 30)
2170 flow = GetFlow2030(n);
2171 else if (centralityBegin == 30 && centralityEnd == 40)
2172 flow = GetFlow3040(n);
2173 else if (centralityBegin == 40 && centralityEnd == 50)
2174 flow = GetFlow4050(n);
2175 else if (centralityBegin > 50)
2176 flow = GetFlow4050(n);
2177 else if (centralityBegin == 0 && centralityEnd == 20)
2179 flow = GetFlow05(n);
2180 flow2 = GetFlow510(n);
2181 flow3 = GetFlow1020(n);
2183 // centrality width * dn/deta from http://arxiv.org/PS_cache/arxiv/pdf/1012/1012.1657v2.pdf
2184 Float_t mult[] = { 5 * 1601, 5 * 1294, 10 * 966 };
2186 if (flow->GetN() != flow2->GetN() || flow2->GetN() != flow3->GetN())
2187 AliFatal("Incompatible graphs");
2189 for (Int_t i=0; i<flow->GetN(); i++)
2191 // Printf("%f %f %f", flow->GetY()[i], flow2->GetY()[i], flow3->GetY()[i]);
2192 flow->GetY()[i] = flow->GetY()[i] * mult[0] + flow2->GetY()[i] * mult[1] + flow3->GetY()[i] * mult[2];
2193 flow->GetY()[i] /= mult[0] + mult[1] + mult[2];
2194 // Printf(" --> %f", flow->GetY()[i]);
2197 else if (centralityBegin == 20 && centralityEnd == 60)
2199 flow = GetFlow2030(n);
2200 flow2 = GetFlow3040(n);
2201 flow3 = GetFlow4050(n);
2203 // centrality width * dn/deta from http://arxiv.org/PS_cache/arxiv/pdf/1012/1012.1657v2.pdf
2204 Float_t mult[] = { 10 * 649, 10 * 426, 10 * (261+149) };
2206 if (flow->GetN() != flow2->GetN() || flow2->GetN() != flow3->GetN())
2207 AliFatal("Incompatible graphs");
2209 for (Int_t i=0; i<flow->GetN(); i++)
2211 // Printf("%f %f %f", flow->GetY()[i], flow2->GetY()[i], flow3->GetY()[i]);
2212 flow->GetY()[i] = flow->GetY()[i] * mult[0] + flow2->GetY()[i] * mult[1] + flow3->GetY()[i] * mult[2];
2213 flow->GetY()[i] /= mult[0] + mult[1] + mult[2];
2214 // Printf(" --> %f", flow->GetY()[i]);
2219 Printf("Flow range %d %d not available", centralityBegin, centralityEnd);
2225 for (Int_t bin = ptDist->FindBin(ptMin + 0.01); bin <= ptDist->FindBin(ptMax - 0.01); bin++)
2227 if (ptDist->GetBinCenter(bin) > flow->GetX()[flow->GetN()-1])
2228 vn += ptDist->GetBinContent(bin) * flow->GetY()[flow->GetN()-1];
2230 vn += ptDist->GetBinContent(bin) * flow->Eval(ptDist->GetBinCenter(bin));
2231 sum += ptDist->GetBinContent(bin);
2236 Printf("v_{%d} = %f for %f < pT < %f", n, vn, ptMin, ptMax);
2241 void CalculateFlow(const char* fileName, Int_t centralityBegin, Int_t centralityEnd)
2243 Float_t ptTrigMin = 2;
2244 Float_t ptTrigMax = 3;
2251 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
2253 cont = h->GetUEHist(2)->GetTrackHist(0);
2254 cont->GetGrid(6)->GetGrid()->GetAxis(3)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
2255 cont->GetGrid(6)->GetGrid()->GetAxis(2)->SetRangeUser(ptTrigMin + 0.01, ptTrigMax - 0.01);
2257 ptDist = cont->ShowProjection(1, 6);
2258 ptDist->Scale(1.0 / ptDist->Integral());
2260 cont = h->GetUEHist(2)->GetEventHist();
2261 cont->GetGrid(6)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
2263 ptDist2 = cont->ShowProjection(0, 6);
2264 ptDist2->Scale(1.0 / ptDist2->Integral());
2268 for (Int_t n=2; n<=4; n++)
2270 Float_t v2A = CalculateFlow(ptDist, ptMin, ptMax, n, centralityBegin, centralityEnd);
2271 Float_t v2T = CalculateFlow(ptDist2, ptTrigMin, ptTrigMax, n, centralityBegin, centralityEnd);
2273 str += Form("%f * %f, ", v2A, v2T);
2277 ptDist2->SetLineColor(2);
2278 ptDist2->Draw("SAME");
2280 Printf("%s", str.Data());
2283 // 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...)
2284 TGraphErrors***** yields = 0;
2285 TString currentYieldFile;
2289 TFile::Open("yields.root", "RECREATE");
2290 for (Int_t i=0; i<3; i++)
2292 for (Int_t j=0; j<6; j++)
2294 for (Int_t k=0; k<4; k++)
2296 // CINT limitation here
2297 TGraphErrors** tmp = yields[i][j][k];
2298 for (Int_t l=0; l<31; l++)
2300 //Printf("%d %d %d %d", i, j, k, l);
2301 tmp[l]->Write(Form("yield_%d_%d_%d_%d", i, j, k, l));
2309 void ReadYields(const char* fileName = "yields.root")
2311 if (currentYieldFile == fileName)
2314 currentYieldFile = fileName;
2316 CreateYieldStructure();
2317 TFile::Open(fileName);
2318 for (Int_t i=0; i<3; i++)
2320 for (Int_t j=0; j<6; j++)
2322 for (Int_t k=0; k<4; k++)
2324 // CINT limitation here
2325 TGraphErrors** tmp = yields[i][j][k];
2326 for (Int_t l=0; l<31; l++)
2328 //Printf("%d %d %d %d", i, j, k, l);
2329 tmp[l] = gFile->Get(Form("yield_%d_%d_%d_%d", i, j, k, l));
2336 void CreateYieldStructure()
2340 yields = new TGraphErrors****[3];
2341 for (Int_t i=0; i<3; i++)
2343 yields[i] = new TGraphErrors***[6];
2344 for (Int_t j=0; j<6; j++)
2346 yields[i][j] = new TGraphErrors**[4];
2347 for (Int_t k=0; k<4; k++)
2349 yields[i][j][k] = new TGraphErrors*[31];
2350 // CINT limitation here
2351 TGraphErrors** tmp = yields[i][j][k];
2352 for (Int_t l=0; l<31; l++)
2354 //Printf("%d %d %d %d", i, j, k, l);
2355 TGraphErrors* graph = new TGraphErrors;
2364 void GraphShiftX(TGraphErrors* graph, Float_t offset)
2366 for (Int_t i=0; i<graph->GetN(); i++)
2367 graph->GetX()[i] += offset;
2370 // Float_t kPythiaScalingFactor = 0.935;
2371 Float_t kPythiaScalingFactor = 1;
2373 void DrawYields(const char* fileName = "yields.root")
2375 ReadYields(fileName);
2377 c = new TCanvas("c", "c", 1800, 1200);
2380 Int_t markers1[] = { 24, 25, 26, 30 };
2381 Int_t markers2[] = { 20, 21, 22, 29 };
2382 Int_t colors[] = { 1, 2, 3, 4 };
2383 //Int_t caseList[] = { 0, 10+1, 10+1, 8, 10, 11, 12, 13, 1, 9 };
2384 Int_t caseList[] = { 0, 18, 18, 23, 18, 19, 20, 21, 22, 9 };
2385 const char* caseString[] = { "", "baseline sub", "baseline vs v2 sub comp", 0, "baseline sub comp", "Same/Mixed", "Same/Mixed - v2 subtr" };
2390 Int_t centralityList[] = { 0, 1, 2, 0, 0, 1 };
2391 Int_t centralityList2[] = { -1, -1, -1, 1, 2, 2 };
2392 Float_t factors[] = { 1, 1, 1, 1, 1, 1 };
2393 const char* centralityString[] = { "0-5%", "20-40%", "60-90%", "0-5% vs 20-40%", "0-5% vs 60-90%", "20-40% vs 60-90%" };
2397 Int_t centralityList[] = { 0, 2, 3, 0, 0, 2 };
2398 Int_t centralityList2[] = { -1, -1, -1, 2, 3, 3 };
2399 //Float_t factors[] = { 1, 1, 1, 1, 1.0/0.9, 1.0/0.9 };
2400 //Float_t factors[] = { 1, 1, 1, 1, 1.0/0.804, 1.0/0.804 };
2401 Float_t factors[] = { 1, 1, 1, 1, 1.0/kPythiaScalingFactor, 1.0/kPythiaScalingFactor };
2402 //Float_t factors[] = { 1, 1, 1, 1, 1.0, 1.0 };
2403 const char* centralityString[] = { "0-5%", "60-90%", "pp", "0-5% vs 60-90%", "0-5% vs pp", "60-90% vs pp" };
2406 l = new TLegend(0.5, 0.5, 0.9, 0.9);
2409 Float_t max[] = { 0.4, 2, 2, 2, 2, 10, 10 };
2410 Float_t max2[] = { 5, 2, 2, 2, 2, 2, 2, 2, 2 };
2412 dummy = new TH2F("dummy", ";p_{T,assoc};yield", 100, 0, 20, 20000, 0, 10);
2415 TGraphErrors* prevNear[6];
2416 TGraphErrors* prevAway[6];
2417 for (Int_t caseId=0; caseId<9; caseId++) // case 0->9
2419 for (Int_t k=0; k<6; k++) // centrality
2421 if (caseId != 3 && caseId < 5)
2424 c->cd(1 + k + caseId*6);
2426 c->cd(1 + k + (caseId-1)*6);
2427 currentDummy = dummy->DrawCopy();
2428 currentDummy->GetYaxis()->SetRangeUser(0, max[caseId]);
2432 latex = new TLatex(0.15, 0.95, Form("%s - %s", caseString[caseId], centralityString[k]));
2434 latex->SetTextSize(0.05);
2437 else if (caseId == 3)
2442 for (Int_t j=0; j<3; j++) // trigger pt
2444 if (caseId >= 2 && j != 1)
2446 Printf("%d %d %d %d", caseId, k, j, caseList[caseId]);
2450 // CINT limitation here
2451 TGraphErrors** tmp = yields[0][j][centralityList[k]];
2452 nearSide = tmp[caseList[caseId]];
2453 //new TCanvas; nearSide->Draw("AP"); return;
2455 nearSide->SetMarkerStyle(markers1[j]);
2456 nearSide->SetMarkerColor(colors[j]);
2457 nearSide->SetLineColor(colors[j]);
2459 if (caseId == 0 && k == 0)
2460 l->AddEntry(nearSide, Form("trig pt bin %d", j), "P");
2462 TGraphErrors** tmp = yields[1][j][centralityList[k]];
2463 awaySide = tmp[caseList[caseId]];
2464 awaySide->SetMarkerStyle(markers2[j]);
2465 awaySide->SetMarkerColor(colors[j]);
2466 awaySide->SetLineColor(colors[j]);
2468 GraphShiftX(nearSide, -0.1 + j*0.1);
2469 GraphShiftX(awaySide, -0.1 + j*0.1);
2473 nearSide->SetLineColor(caseId - 2);
2474 nearSide->SetMarkerColor(caseId - 2);
2475 awaySide->SetLineColor(caseId - 2);
2476 awaySide->SetMarkerColor(caseId - 2);
2481 nearSide->SetLineColor(caseId - 3);
2482 nearSide->SetMarkerColor(caseId - 3);
2483 awaySide->SetLineColor(caseId - 3);
2484 awaySide->SetMarkerColor(caseId - 3);
2489 prevNear[k] = (TGraphErrors*) nearSide->DrawClone("PSAME");
2490 prevAway[k] = (TGraphErrors*) awaySide->DrawClone("PSAME");
2495 for (Int_t i=0; i<nearSide->GetN(); i++)
2497 Printf("%f: %.0f%%", nearSide->GetX()[i], 100.0 * nearSide->GetEY()[i] / nearSide->GetY()[i]);
2498 Printf("%f: %.0f%%", awaySide->GetX()[i], 100.0 * awaySide->GetEY()[i] / awaySide->GetY()[i]);
2504 // CINT limitation here
2505 tmp = yields[0][j][centralityList[k]]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2506 tmp = yields[1][j][centralityList[k]]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2508 tmp = yields[0][j][centralityList2[k]];
2509 nearSidePeripheral = tmp[caseList[caseId]];
2510 if (iaa && caseId == 3 && k >= 4)
2511 nearSidePeripheral = tmp[caseList[caseId-1]];
2513 tmp = yields[1][j][centralityList2[k]];
2514 awaySidePeripheral = tmp[caseList[caseId]];
2515 if (iaa && caseId == 3 && k >= 4)
2516 awaySidePeripheral = tmp[caseList[caseId-1]];
2518 // nearSideCentral->Print();
2519 // nearSidePeripheral->Print();
2522 currentDummy->GetYaxis()->SetTitle("I_{CP}");
2524 currentDummy->GetYaxis()->SetTitle("I_{AA}");
2525 currentDummy->GetYaxis()->SetRangeUser(0, max2[caseId]);
2527 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
2529 if (i >= nearSidePeripheral->GetN())
2531 nearSideCentral->RemovePoint(i);
2536 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
2537 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
2539 nearSideCentral->RemovePoint(i);
2540 nearSidePeripheral->RemovePoint(i);
2545 nearSideCentral->GetEY()[i] = TMath::Sqrt(
2546 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
2547 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
2549 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
2550 nearSideCentral->GetY()[i] *= factors[k];
2552 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
2556 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
2558 if (i >= awaySidePeripheral->GetN())
2560 awaySideCentral->RemovePoint(i);
2565 //Printf("away %d", i);
2566 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
2568 awaySideCentral->RemovePoint(i);
2569 awaySidePeripheral->RemovePoint(i);
2574 awaySideCentral->GetEY()[i] = TMath::Sqrt(
2575 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
2576 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
2578 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
2579 awaySideCentral->GetY()[i] *= factors[k];
2581 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
2586 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
2587 nearSideCentral->SetLineColor(1);
2588 nearSideCentral->SetMarkerColor(1);
2590 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
2591 awaySideCentral->SetLineColor(1);
2592 awaySideCentral->SetMarkerColor(1);
2597 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
2598 nearSideCentral->SetLineColor(caseId - 3);
2599 nearSideCentral->SetMarkerColor(caseId - 3);
2601 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
2602 awaySideCentral->SetLineColor(caseId - 3);
2603 awaySideCentral->SetMarkerColor(caseId - 3);
2606 //Printf("%d", caseList[caseId]);
2608 // nearSideCentral->Print();
2610 nearSideCentral->Draw("PSAME");
2611 awaySideCentral->Draw("PSAME");
2615 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
2616 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]));
2617 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
2618 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]));
2621 prevNear[k] = nearSideCentral;
2622 prevAway[k] = awaySideCentral;
2625 if (caseId == 0 && k == 0)
2630 c->SaveAs("yields.png");
2633 void FitGaussians(const char* fileName, Bool_t flat)
2635 CreateYieldStructure();
2637 aliceFile = TFile::Open(fileName);
2639 Int_t maxLeadingPt = 3;
2640 Int_t maxAssocPt = 6;
2642 TCanvas* canvas = new TCanvas("FitGaussians", "FitGaussians", 1000, 700);
2643 canvas->Divide(maxAssocPt, maxLeadingPt);
2645 for (Int_t i=0; i<maxLeadingPt; i++)
2646 for (Int_t j=0; j<maxAssocPt; j++)
2649 for (Int_t aliceCentrality=0; aliceCentrality<4; aliceCentrality++)
2651 Printf("%d %d %d", i, j, aliceCentrality);
2653 canvas->cd(j+1 + (i) * maxAssocPt);
2654 gPad->SetLeftMargin(0.15);
2655 gPad->SetBottomMargin(0.2);
2656 //gPad->SetTopMargin(0.01);
2657 gPad->SetRightMargin(0.01);
2659 hist = (TH1*) aliceFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, (flat) ? "_fit_flat" : ""));
2664 gausFit = new TF1("gausFit", "[0] + gaus(1) + gaus(4)", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
2665 gausFit->SetParameters(0, 1, 0, 1, 1, TMath::Pi(), 1);
2666 gausFit->SetParLimits(0, -1, 10000);
2667 gausFit->SetParLimits(1, 0.001, 10000);
2668 gausFit->FixParameter(2, 0);
2669 gausFit->SetParLimits(3, 0.05, 10);
2670 gausFit->SetParLimits(4, 0.001, 10000);
2671 gausFit->FixParameter(5, TMath::Pi());
2672 gausFit->SetParLimits(6, 0.1, 10);
2674 gausFit->SetLineWidth(1);
2675 gausFit->SetLineColor(hist->GetLineColor());
2677 hist->Fit(gausFit, "0RIQ");
2678 gausFit->FixParameter(0, gausFit->GetParameter(0));
2679 hist->Fit(gausFit, "RI", (aliceCentrality == 0) ? "" : "SAME");
2680 //gausFit->DrawCopy("SAME");
2683 TPRegexp reg("(\\d+\\.\\d+) \\< p_\\{T,assoc\\} \\< (\\d+\\.\\d+)");
2684 arr = reg.MatchS(hist->GetTitle(), "", 0, 10);
2685 if (arr->GetEntries() != 3)
2688 Float_t pt1 = atof(arr->At(1)->GetName());
2689 Float_t pt2 = atof(arr->At(2)->GetName());
2691 FillYield(i, aliceCentrality, (pt1 + pt2) / 2, (pt2 - pt1) / 2, 18, gausFit->GetParameter(3), gausFit->GetParError(3), gausFit->GetParameter(6), gausFit->GetParError(6));
2696 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), hist->GetMinimum()), TMath::Max(first->GetMaximum(), hist->GetMaximum()));
2698 first->GetYaxis()->SetRangeUser(first->GetMinimum(), 2 * first->GetMaximum());
2706 for (Int_t j=0; j<3; j++)
2710 Int_t markers1[] = { 24, 25, 26, 30 };
2711 Int_t markers2[] = { 20, 21, 22, 29 };
2712 Int_t colors[] = { 1, 2, 3, 4 };
2714 dummy = new TH2F("dummy", ";p_{T,assoc};", 100, 0, 10, 1000, 0, 1);
2718 for (Int_t k=0; k<4; k++) // centrality
2720 // CINT limitation here
2721 TGraphErrors** tmp = yields[0][j][k];
2723 nearSide->SetMarkerStyle(markers1[k]);
2724 nearSide->SetMarkerColor(colors[k]);
2725 nearSide->SetLineColor(colors[k]);
2727 TGraphErrors** tmp = yields[1][j][k];
2729 awaySide->SetMarkerStyle(markers2[k]);
2730 awaySide->SetMarkerColor(colors[k]);
2731 awaySide->SetLineColor(colors[k]);
2733 nearSide->DrawClone("PSAME");
2734 awaySide->DrawClone("PSAME");
2739 void TsallisExamples()
2741 tsallis = new TF1("tsallis", "[0] * (1-[2]*(1-[1])*x*x)**(1/(1-[1]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
2743 Float_t q[] = { 1.0000001, 1.5, 2 };
2744 Float_t beta[] = { 0.1, 1, 10, 100 };
2746 dummy = new TH2F("dummy", "", 100, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), 100, 0, 1.2);
2750 legend = new TLegend(0.65, 0.5, 1, 1);
2751 legend->SetFillColor(0);
2753 for (Int_t i=0; i<3; i++)
2754 for (Int_t j=0; j<4; j++)
2756 tsallis->SetParameters(1, q[i], beta[j]);
2757 tsallis->SetLineColor(i+1);
2758 tsallis->SetLineStyle(j+1);
2760 legend->AddEntry(tsallis->DrawCopy("SAME"), Form("q = %.1f, #beta = %.1f", q[i], beta[j]), "L");
2766 void DrawTsallisParams()
2770 c = new TCanvas("c", "c", 900, 600);
2773 Int_t markers1[] = { 24, 25, 26, 30 };
2774 Int_t markers2[] = { 20, 21, 22, 29 };
2775 Int_t colors[] = { 1, 2, 3, 4 };
2776 Int_t caseList[] = { 12, 13, 8, 6, 8, 9, 10, 11, 1, 7 };
2777 const char* caseString[] = { "q", "beta" };
2778 const char* centralityString[] = { "0-5%", "20-40%", "60-90%", "0-5% vs 20-40%", "0-5% vs 60-90%", "20-40% vs 60-90%" };
2780 l = new TLegend(0.5, 0.5, 0.9, 0.9);
2783 Float_t max[] = { 3, 1000 };
2784 Float_t max2[] = { 5, 2 };
2786 dummy = new TH2F("dummy", ";p_{T,assoc};", 100, 0, 20, 1000, 0, 1000);
2789 for (Int_t caseId=0; caseId<2; caseId++) // case
2791 for (Int_t k=0; k<3; k++) // centrality
2793 c->cd(1 + k + caseId*3);
2795 currentDummy = dummy->DrawCopy();
2796 currentDummy->GetYaxis()->SetRangeUser(0, max[caseId]);
2797 if (caseId == 1 && k < 3)
2800 latex = new TLatex(0.15, 0.95, Form("%s - %s", caseString[caseId], centralityString[k]));
2802 latex->SetTextSize(0.05);
2805 for (Int_t j=0; j<2; j++) // trigger pt
2809 // CINT limitation here
2810 TGraphErrors** tmp = yields[0][j][k];
2811 nearSide = tmp[caseList[caseId]];
2812 nearSide->SetMarkerStyle(markers1[j]);
2813 nearSide->SetMarkerColor(colors[j]);
2814 nearSide->SetLineColor(colors[j]);
2816 if (caseId == 0 && k == 0)
2817 l->AddEntry(nearSide, Form("trig pt bin %d", j), "P");
2819 TGraphErrors** tmp = yields[1][j][k];
2820 awaySide = tmp[caseList[caseId]];
2821 awaySide->SetMarkerStyle(markers2[j]);
2822 awaySide->SetMarkerColor(colors[j]);
2823 awaySide->SetLineColor(colors[j]);
2825 GraphShiftX(nearSide, -0.1 + j*0.1);
2826 GraphShiftX(awaySide, -0.1 + j*0.1);
2828 Printf("%d %d %d", caseId, j, k);
2832 nearSide->DrawClone("PSAME");
2833 awaySide->DrawClone("PSAME");
2837 // CINT limitation here
2840 tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2841 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2842 tmp = yields[0][j][1]; nearSidePeripheral = tmp[caseList[caseId]];
2843 tmp = yields[1][j][1]; awaySidePeripheral = tmp[caseList[caseId]];
2847 tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2848 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2849 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
2850 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
2854 tmp = yields[0][j][1]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2855 tmp = yields[1][j][1]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2856 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
2857 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
2860 currentDummy->GetYaxis()->SetTitle("I_{CP}");
2861 currentDummy->GetYaxis()->SetRangeUser(0, max2[caseId]);
2863 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
2865 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
2866 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
2868 nearSideCentral->RemovePoint(i);
2869 nearSidePeripheral->RemovePoint(i);
2874 nearSideCentral->GetEY()[i] = TMath::Sqrt(
2875 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
2876 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
2878 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
2880 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
2884 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
2886 //Printf("away %d", i);
2887 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
2889 awaySideCentral->RemovePoint(i);
2890 awaySidePeripheral->RemovePoint(i);
2895 awaySideCentral->GetEY()[i] = TMath::Sqrt(
2896 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
2897 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
2899 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
2901 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
2906 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
2907 nearSideCentral->SetLineColor(1);
2908 nearSideCentral->SetMarkerColor(1);
2910 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
2911 awaySideCentral->SetLineColor(1);
2912 awaySideCentral->SetMarkerColor(1);
2917 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
2918 nearSideCentral->SetLineColor(caseId - 3);
2919 nearSideCentral->SetMarkerColor(caseId - 3);
2921 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
2922 awaySideCentral->SetLineColor(caseId - 3);
2923 awaySideCentral->SetMarkerColor(caseId - 3);
2926 //Printf("%d", caseList[caseId]);
2928 nearSideCentral->Draw("PSAME");
2929 awaySideCentral->Draw("PSAME");
2932 if (caseId == 0 && k == 0)
2937 c->SaveAs("tsallisparams.png");
2940 void DrawYieldLHCRHIC_ICP(const char* fileName = "yields.root")
2943 Int_t caseList[] = { 18 };
2946 ReadYields(fileName);
2948 c = new TCanvas("lhc_rhic", "lhc_rhic", 800, 600);
2952 dummy = new TH2F("dummy", ";p_{T,assoc};I_{CP}", 100, 0, 12, 1000, 0, 10);
2954 currentDummy = dummy->DrawCopy();
2955 currentDummy->GetYaxis()->SetRangeUser(0, 2);
2957 TGraphErrors** tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2958 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
2959 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
2960 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
2962 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
2964 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
2965 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
2967 nearSideCentral->RemovePoint(i);
2968 nearSidePeripheral->RemovePoint(i);
2973 nearSideCentral->GetEY()[i] = TMath::Sqrt(
2974 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
2975 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
2977 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
2979 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
2983 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
2985 //Printf("away %d", i);
2986 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
2988 awaySideCentral->RemovePoint(i);
2989 awaySidePeripheral->RemovePoint(i);
2994 awaySideCentral->GetEY()[i] = TMath::Sqrt(
2995 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
2996 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
2998 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
3000 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
3003 nearSideCentral->SetMarkerStyle(21);
3004 nearSideCentral->SetLineColor(1);
3005 nearSideCentral->SetMarkerColor(1);
3007 awaySideCentral->SetMarkerStyle(25);
3008 awaySideCentral->SetLineColor(1);
3009 awaySideCentral->SetMarkerColor(1);
3011 nearSideCentral->Draw("PSAME");
3012 awaySideCentral->Draw("PSAME");
3014 legend = new TLegend(0.4, 0.8, 0.99, 0.99);
3015 legend->SetFillColor(0);
3016 legend->AddEntry(nearSideCentral, "ALICE I_{CP} Near 8-15 GeV 0-5%/60-90%", "P");
3017 legend->AddEntry(awaySideCentral, "ALICE I_{CP} Away 8-15 GeV 0-5%/60-90%", "P");
3021 nearSideCentral->Fit("pol1", "", "SAME", 4.5, 11.5);
3022 awaySideCentral->Fit("pol1", "", "SAME", 4.5, 11.5);
3023 nearSideCentral->GetFunction("pol1")->SetLineWidth(1);
3024 awaySideCentral->GetFunction("pol1")->SetLineWidth(1);
3030 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
3031 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
3033 //dndpt_central->Print();
3034 //dndpt_peripheral->Print();
3036 // ratio of Ncoll (from paper)
3037 // TODO there is also an uncertainty on that
3038 Double_t scale = 1690. / 15.7;
3039 Double_t scaleUnc = TMath::Sqrt(TMath::Power(131. / 1690., 2) + TMath::Power(0.7 / 15.7, 2));
3041 for (Int_t i=0; i<dndpt_central->GetN(); i++)
3043 dndpt_central->GetEY()[i] = TMath::Sqrt(TMath::Power(dndpt_central->GetEY()[i] / dndpt_central->GetY()[i], 2) +
3044 TMath::Power(dndpt_peripheral->GetEY()[i] / dndpt_peripheral->GetY()[i], 2));
3045 dndpt_central->GetY()[i] /= dndpt_peripheral->GetY()[i] * scale;
3046 dndpt_central->GetEY()[i] *= dndpt_central->GetY()[i];
3050 //dndpt_central->Print();
3051 //dndpt_central->Draw("AP");
3053 dndpt_central->Draw("*SAME");
3055 latex = new TLatex(0.34, 0.09, "9% N_{coll} scale uncertainty on R_{CP}");
3056 latex->SetTextSize(0.03);
3060 raa_central = ReadHepdata("raa_alice_central.txt", kFALSE, 3);
3061 raa_central->SetMarkerStyle(20);
3062 //raa_central->Draw("PSAME");
3064 legend->AddEntry(dndpt_central, "ALICE R_{CP} 0-5%/70-80%", "P");
3070 // calculate ICP from IAA(0-20) / IAA (20-60)
3071 // TODO only using uncertainties from IAA(0-20)
3072 // TODO systematic uncertainty stored in graph with _sys appended
3073 TFile::Open("rhic/pi0h_graphs.root");
3075 for (Int_t i=0; i<3; i+=2)
3077 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
3078 central = (TGraphErrors*) gFile->Get(Form("gIAA_3_0_%d", i));
3079 peripheral = (TGraphErrors*) gFile->Get(Form("gIAA_3_1_%d", i));
3081 for (Int_t j=0; j<central->GetN(); j++)
3083 central->GetY()[j] /= peripheral->GetY()[j];
3084 central->GetEY()[j] /= peripheral->GetY()[j];
3087 central->SetMarkerStyle((i == 0) ? 29 : 30);
3088 central->SetMarkerColor(2);
3089 central->SetLineColor(2);
3090 central->Draw("PSAME");
3091 legend->AddEntry(central, Form("PHENIX I_{CP} %s 9-12 GeV 0-20%/20-60%", (i == 0) ? "Near" : "Away"), "P");
3097 c->SaveAs("icp.png");
3100 TGraphErrors* GetRatio(const char* fileName, Int_t centrality1, Int_t centrality2, Int_t triggerId, Int_t caseId, Int_t side, const char* fileName2 = 0)
3102 // 0 = near side; 1 = away side
3104 ReadYields(fileName);
3106 TGraphErrors** tmp = yields[side][triggerId][centrality1];
3107 nearSideCentral = (TGraphErrors*) tmp[caseId]->Clone();
3110 ReadYields(fileName2);
3112 tmp = yields[side][triggerId][centrality2];
3113 nearSidePeripheral = (TGraphErrors*) tmp[caseId]->Clone();
3115 Printf("%d %d", nearSideCentral->GetN(), nearSidePeripheral->GetN());
3117 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
3119 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
3121 nearSideCentral->RemovePoint(i);
3122 nearSidePeripheral->RemovePoint(i);
3127 if (nearSideCentral->GetX()[i] != nearSidePeripheral->GetX()[i])
3129 Printf("Inconsistent x values %f %f", nearSideCentral->GetX()[i], nearSidePeripheral->GetX()[i]);
3133 Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
3135 nearSideCentral->GetEY()[i] = TMath::Sqrt(
3136 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
3137 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
3139 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
3141 if (centrality2 == 3)
3142 nearSideCentral->GetY()[i] /= kPythiaScalingFactor;
3144 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
3147 //nearSideCentral->GetXaxis()->SetTitle("p_{T, assoc}");
3148 //nearSideCentral->GetYaxis()->SetTitle((centrality2 == 3) ? "I_{AA}" : "I_{CP}");
3150 return nearSideCentral;
3153 TGraphErrors* GetIAA(const char* fileName, Int_t centrality, Int_t triggerId, Int_t caseId, Int_t side)
3155 return GetRatio(fileName, centrality, 3, triggerId, caseId, side);
3158 TGraphErrors* GetICP(const char* fileName, Int_t triggerId, Int_t caseId, Int_t side)
3160 return GetRatio(fileName, 1, 2, triggerId, caseId, side);
3163 void DrawYieldLHCRHIC_IAA(const char* fileName, Bool_t central, Bool_t rhic)
3166 Int_t caseList[] = { 18 };
3169 ReadYields(fileName);
3171 c = new TCanvas("lhc_rhic", "lhc_rhic", 800, 600);
3175 dummy = new TH2F("dummy", ";p_{T,assoc};I_{AA}", 100, 0, 12, 1000, 0, 10);
3177 currentDummy = dummy->DrawCopy();
3178 currentDummy->GetYaxis()->SetRangeUser(0, 3);
3180 Int_t nominatorBin = 0;
3184 nearSideCentral = GetIAA(fileName, nominatorBin, j, caseList[caseId], 0);
3185 awaySideCentral = GetIAA(fileName, nominatorBin, j, caseList[caseId], 1);
3187 nearSideCentral->SetMarkerStyle(21);
3188 nearSideCentral->SetLineColor(1);
3189 nearSideCentral->SetMarkerColor(1);
3191 awaySideCentral->SetMarkerStyle(25);
3192 awaySideCentral->SetLineColor(1);
3193 awaySideCentral->SetMarkerColor(1);
3195 nearSideCentral->Draw("PSAME");
3196 awaySideCentral->Draw("PSAME");
3198 legend = new TLegend(0.4, 0.8, 0.99, 0.99);
3199 legend->SetFillColor(0);
3200 legend->AddEntry(nearSideCentral, Form("ALICE I_{AA} Near 8-15 GeV %s%%/Pythia6", (central) ? "0-5" : "60-90"), "P");
3201 legend->AddEntry(awaySideCentral, Form("ALICE I_{AA} Away 8-15 GeV %s%%/Pythia6", (central) ? "0-5" : "60-90"), "P");
3206 // systematic uncertainty stored in graph with _sys appended
3207 TFile::Open("rhic/pi0h_graphs.root");
3209 for (Int_t i=0; i<3; i+=2)
3211 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
3212 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_2_%d_%d", (central) ? 0 : 1, i));
3213 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_2_%d_%d_sys", (central) ? 0 : 1, i));
3215 rhic_iaa->SetMarkerStyle((i == 0) ? 29 : 30);
3216 rhic_iaa->SetMarkerColor(2);
3217 rhic_iaa->SetLineColor(2);
3218 rhic_iaa->Draw("PSAME");
3219 rhic_iaa_sys->SetLineColor(2);
3220 rhic_iaa_sys->SetMarkerColor(2);
3221 rhic_iaa_sys->Draw("PSAME");
3222 legend->AddEntry(rhic_iaa, Form("PHENIX I_{AA} %s 7-9 GeV %s%%/pp", (i == 0) ? "Near" : "Away", (central) ? "0-20" : "20-60"), "P");
3224 for (Int_t i=0; i<3; i+=2)
3226 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
3227 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_3_%d_%d", (central) ? 0 : 1, i));
3228 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_3_%d_%d_sys", (central) ? 0 : 1, i));
3230 rhic_iaa->SetMarkerStyle((i == 0) ? 20 : 24);
3231 rhic_iaa->SetMarkerColor(4);
3232 rhic_iaa->SetLineColor(4);
3233 rhic_iaa->Draw("PSAME");
3234 rhic_iaa_sys->SetLineColor(4);
3235 rhic_iaa_sys->SetMarkerColor(4);
3236 rhic_iaa_sys->Draw("PSAME");
3237 legend->AddEntry(rhic_iaa, Form("PHENIX I_{AA} %s 9-12 GeV %s%%/pp", (i == 0) ? "Near" : "Away", (central) ? "0-20" : "20-60"), "P");
3243 c->SaveAs("iaa.png");
3246 void CompareIAAICP(const char* fileName1, const char* fileName2, Int_t nominatorBin, Int_t denominatorBin)
3250 //Int_t caseId = 12;
3252 nearSide1 = GetRatio(fileName1, nominatorBin, denominatorBin, j, caseId, 0);
3253 awaySide1 = GetRatio(fileName1, nominatorBin, denominatorBin, j, caseId, 1);
3255 kPythiaScalingFactor = 1;
3256 nearSide2 = GetRatio(fileName2, nominatorBin, denominatorBin, j, caseId, 0);
3257 awaySide2 = GetRatio(fileName2, nominatorBin, denominatorBin, j, caseId, 1);
3259 /* ScaleGraph(nearSide2, 1.33);
3260 ScaleGraph(awaySide2, 1.33);*/
3263 dummy = new TH2F("dummy", Form(";p_{T,assoc};%s", (denominatorBin == 3) ? "I_{AA}" : "I_{CP}"), 100, 0, 12, 1000, 0, 10);
3265 currentDummy = dummy->DrawCopy();
3266 currentDummy->GetYaxis()->SetRangeUser(0, 3);
3268 nearSide1->SetMarkerStyle(21);
3269 nearSide1->SetLineColor(1);
3270 nearSide1->SetMarkerColor(1);
3272 nearSide2->SetMarkerStyle(21);
3273 nearSide2->SetLineColor(2);
3274 nearSide2->SetMarkerColor(2);
3276 awaySide1->SetMarkerStyle(25);
3277 awaySide1->SetLineColor(1);
3278 awaySide1->SetMarkerColor(1);
3280 awaySide2->SetMarkerStyle(25);
3281 awaySide2->SetLineColor(2);
3282 awaySide2->SetMarkerColor(2);
3284 RemovePointsBelowX(nearSide1, 3);
3285 RemovePointsBelowX(nearSide2, 3);
3286 RemovePointsBelowX(awaySide1, 3);
3287 RemovePointsBelowX(awaySide2, 3);
3289 nearSide1->DrawClone("PSAME");
3290 awaySide1->DrawClone("PSAME");
3291 nearSide2->DrawClone("PSAME");
3292 awaySide2->DrawClone("PSAME");
3295 currentDummy = dummy->DrawCopy();
3296 currentDummy->GetYaxis()->SetRangeUser(0.5, 1.5);
3300 DivideGraphs(nearSide1, nearSide2);
3301 DivideGraphs(awaySide1, awaySide2);
3303 nearSide1->Draw("PSAME");
3304 awaySide1->Draw("PSAME");
3306 nearSide1->Fit("pol0", "", "SAME", 3.01, 9.99);
3307 awaySide1->Fit("pol0", "", "SAME", 3.01, 9.99);
3310 void ScaleGraph(TGraphErrors* graph, Float_t factor)
3312 for (Int_t i=0; i<graph->GetN(); i++)
3314 graph->GetY()[i] *= factor;
3315 graph->GetEY()[i] *= factor;
3319 TGraphErrors* DrawBaselines(const char* fileName, Int_t numeratorBin, Int_t denominatorBin, Int_t side, Bool_t verbose = kTRUE)
3323 TGraphErrors* first = 0;
3324 TGraphErrors* max = 0;
3329 dummy = new TH2F("dummy", Form(";p_{T,assoc};%s", (denominatorBin == 3) ? "I_{AA}" : "I_{CP}"), 100, 0, 12, 1000, 0, 10);
3331 currentDummy = dummy->DrawCopy();
3332 currentDummy->GetYaxis()->SetRangeUser(0, 3);
3335 currentDummy = dummy->DrawCopy();
3336 currentDummy->GetYaxis()->SetRangeUser(0, 2);
3339 Int_t caseList[] = { 18, 19, 21, 22 };
3340 //Int_t caseList[] = { 23, 24, 26, 27 };
3342 for (Int_t caseId = 0; caseId < 4; caseId++)
3344 graph = GetRatio(fileName, numeratorBin, denominatorBin, j, caseList[caseId], side);
3346 graph->SetLineColor(caseId + 1);
3347 graph->SetMarkerColor(caseId + 1);
3349 RemovePointsBelowX(graph, 3);
3354 graph->DrawClone("*SAME");
3360 max = (TGraphErrors*) graph->Clone();
3361 for (Int_t i=0; i<max->GetN(); i++)
3364 max->GetEY()[i] = 0;
3369 DivideGraphs(graph, first);
3374 graph->DrawClone("*SAME");
3377 for (Int_t i=0; i<graph->GetN(); i++)
3379 if (max->GetY()[i] < TMath::Abs(graph->GetY()[i] - 1))
3380 max->GetY()[i] = TMath::Abs(graph->GetY()[i] - 1);
3391 max->GetXaxis()->SetTitle("p_{T, assoc}");
3392 max->GetYaxis()->SetTitle((denominatorBin == 3) ? "Effect on I_{AA}" : "Effect on I_{CP}");
3393 max->GetYaxis()->SetRangeUser(0, 0.4);
3398 void DrawBaselinesAll(const char* fileName)
3400 c = new TCanvas("c", "c", 800, 600);
3403 for (Int_t i=0; i<2; i++)
3405 c->cd(1+i*3); DrawBaselines(fileName, 0, 3, i, kFALSE)->Draw("A*");
3406 c->cd(2+i*3); DrawBaselines(fileName, 2, 3, i, kFALSE)->Draw("A*");
3407 c->cd(3+i*3); DrawBaselines(fileName, 0, 2, i, kFALSE)->Draw("A*");
3411 TGraphErrors* DrawSystUnc(TGraphErrors* graph, Int_t iaa_icp, Int_t awaySide)
3415 Float_t baseline = 1;
3418 else if (awaySide == 1)
3422 Float_t reference = 0;
3427 Float_t efficiency = 0.08;
3429 Float_t centrality = 1;
3431 centrality = (awaySide == 0) ? 0.02 : 0.06;
3432 else if (iaa_icp == 1)
3433 centrality = (awaySide == 0) ? 0.04 : 0.08;
3435 Float_t ptResolution = 0;
3437 Float_t total = TMath::Sqrt(baseline * baseline + efficiency * efficiency + centrality * centrality + ptResolution * ptResolution);
3439 Printf("Total syst: %f", total);
3441 systUnc = (TGraphErrors*) graph->Clone();
3442 for (Int_t i=0; i<systUnc->GetN(); i++)
3444 systUnc->GetEY()[i] = systUnc->GetY()[i] * total;
3445 systUnc->GetEX()[i] = 0;
3450 systUnc->SetLineColor(kGray + 1);
3451 systUnc->SetLineWidth(6);
3453 systUnc->Draw("PSAME");
3458 void IAA(const char* fileName, Int_t iaa)
3465 if (kPythiaScalingFactor != 1)
3466 Printf("Using reference data scaling factor: %f", kPythiaScalingFactor);
3471 Int_t caseId[] = { 18, 23 };
3473 c = new TCanvas((iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", (iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", 1200, 600);
3474 c->Range(0, 0, 1, 1);
3476 TPad* pad1 = new TPad(Form("%s_2", fileName), "", 0, 0, 0.5, 1);
3479 TPad* pad2 = new TPad(Form("%s_1", fileName), "", 0.5, 0, 1, 1);
3483 gPad->SetRightMargin(0);
3484 gPad->SetTopMargin(0.05);
3485 gPad->SetLeftMargin(0.13);
3490 gPad->SetLeftMargin(0);
3491 gPad->SetTopMargin(0.05);
3492 gPad->SetRightMargin(0.13);
3497 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);
3499 dummy->GetYaxis()->SetTitleOffset(1.3);
3500 dummy->GetXaxis()->SetTitleOffset(1.1);
3501 currentDummy = dummy->DrawCopy();
3503 latex = new TLatex(0.17, 0.90, "Near side");
3504 latex->SetTextSize(0.04);
3510 box = new TBox(2, 0.87, 2.5, 1.13);
3511 box->SetFillColor(kGray + 1);
3512 box->SetLineColor(kGray + 1);
3515 box2 = new TBox(2, 0.87 * 1.5, 2.5, 1.13 * 1.5);
3516 box2->SetFillColor(kGray + 1);
3517 box2->SetLineColor(kGray + 1);
3522 currentDummy = dummy->DrawCopy();
3527 latex = new TLatex(0.05, 0.90, "Away side");
3528 latex->SetTextSize(0.04);
3532 legend = new TLegend(0.17, 0.65, (iaa != 2) ? 0.53 : 0.82, 0.80);
3533 legend->SetFillColor(0);
3534 legend->SetTextSize(0.04);
3536 for (Int_t i=0; i<2; i++)
3538 nearSideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 0);
3540 nearSidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 0);
3541 awaySideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 1);
3543 awaySidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 1);
3545 RemovePointsBelowX(nearSideCentral, 3);
3546 RemovePointsBelowX(awaySideCentral, 3);
3547 RemovePointsAboveX(nearSideCentral, 10);
3548 RemovePointsAboveX(awaySideCentral, 10);
3550 RemoveXErrors(nearSideCentral); RemoveXErrors(awaySideCentral);
3554 RemovePointsBelowX(nearSidePeripheral, 3);
3555 RemovePointsBelowX(awaySidePeripheral, 3);
3556 RemovePointsAboveX(nearSidePeripheral, 10);
3557 RemovePointsAboveX(awaySidePeripheral, 10);
3558 ShiftPoints(nearSidePeripheral, 0.2);
3559 ShiftPoints(awaySidePeripheral, 0.2);
3560 RemoveXErrors(nearSidePeripheral); RemoveXErrors(awaySidePeripheral);
3563 nearSideCentral->SetMarkerStyle(21);
3564 nearSideCentral->SetLineColor(1);
3565 nearSideCentral->SetMarkerColor(1);
3567 awaySideCentral->SetMarkerStyle(21);
3568 awaySideCentral->SetLineColor(1);
3569 awaySideCentral->SetMarkerColor(1);
3573 nearSidePeripheral->SetMarkerStyle(22);
3574 nearSidePeripheral->SetLineColor(2);
3575 nearSidePeripheral->SetMarkerColor(2);
3577 awaySidePeripheral->SetMarkerStyle(22);
3578 awaySidePeripheral->SetLineColor(2);
3579 awaySidePeripheral->SetMarkerColor(2);
3586 legend->AddEntry(nearSideCentral, "0-5% / Pythia", "P");
3587 legend->AddEntry(nearSidePeripheral, "60-90% / Pythia", "P");
3591 legend->AddEntry(nearSideCentral, "0-20% / Pythia", "P");
3596 const char* style = "PSAME";
3602 DrawSystUnc(nearSideCentral, (iaa == 1), 0);
3603 nearSideCentral->DrawClone(style);
3607 DrawSystUnc(nearSidePeripheral, (iaa == 1), 0);
3608 nearSidePeripheral->DrawClone(style);
3613 DrawSystUnc(awaySideCentral, (iaa == 1), 1);
3614 awaySideCentral->DrawClone(style);
3618 DrawSystUnc(awaySidePeripheral, (iaa == 1), 1);
3619 awaySidePeripheral->DrawClone(style);
3626 // systematic uncertainty stored in graph with _sys appended
3627 TFile::Open("rhic/pi0h_graphs.root");
3629 for (Int_t ptTrigBin=2; ptTrigBin<4; ptTrigBin++)
3631 Bool_t central = kTRUE;
3632 for (Int_t i=0; i<3; i+=2)
3634 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
3635 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d", ptTrigBin, (central) ? 0 : 1, i));
3636 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d_sys", ptTrigBin, (central) ? 0 : 1, i));
3638 rhic_iaa->SetMarkerStyle((ptTrigBin == 2) ? 29 : 30);
3639 rhic_iaa->SetMarkerColor(2);
3640 rhic_iaa->SetLineColor(2);
3641 rhic_iaa_sys->SetLineColor(2);
3642 rhic_iaa_sys->SetMarkerColor(2);
3644 ShiftPoints(rhic_iaa, -0.05 + 0.05 * (ptTrigBin*2-4));
3645 ShiftPoints(rhic_iaa_sys, -0.05 + 0.05 * (ptTrigBin*2-4));
3651 rhic_iaa->Draw("PSAME");
3652 rhic_iaa_sys->Draw("PSAME");
3655 legend->AddEntry(rhic_iaa, Form("PHENIX %s GeV %s%% / pp", (ptTrigBin == 2) ? "7-9" : "9-12", (central) ? "0-20" : "20-60"), "P");
3660 for (Int_t i=0; i<2; i++)
3671 latex = new TLatex(xC, 0.84, "8 GeV/c < p_{T,trig} < 15 GeV/c");
3672 latex->SetTextSize(0.04);
3678 latex = new TLatex(xC, 0.78, "0-5% / 60-90%");
3679 latex->SetTextSize(0.04);
3684 // latex = new TLatex(0.5+xC, 0.90, "ALICE preliminary");
3685 latex = new TLatex(0.5+xC, 0.90, "-- work in progress --");
3686 latex->SetTextSize(0.04);
3690 latex = new TLatex(0.5+xC, 0.84, "p_{T,assoc} < p_{T,trig}");
3691 latex->SetTextSize(0.04);
3695 latex = new TLatex(xC + 0.5 * i, 0.24, "Points: flat pedestal");
3696 latex->SetTextSize(0.04);
3700 latex = new TLatex(xC + 0.5 * i, 0.18, "Line: v_{2} subtracted");
3701 latex->SetTextSize(0.04);
3707 legend->DrawClone();
3708 legend->SetX1(legend->GetX1()-0.12);
3709 legend->SetX2(legend->GetX2()-0.12);
3713 c->SaveAs(Form("%s.eps", c->GetTitle()));
3714 c->SaveAs(Form("%s.png", c->GetTitle()));
3717 void RemoveXErrors(TGraphErrors* graph)
3719 for (Int_t i=0; i<graph->GetN(); i++)
3720 graph->GetEX()[i] = 0;
3723 void RemovePointsBelowX(TGraphErrors* graph, Float_t minX)
3726 while (i<graph->GetN())
3728 if (graph->GetX()[i] < minX)
3729 graph->RemovePoint(i);
3735 void RemovePointsAboveX(TGraphErrors* graph, Float_t maxX)
3738 while (i<graph->GetN())
3740 if (graph->GetX()[i] > maxX)
3741 graph->RemovePoint(i);
3747 void ShiftPoints(TGraphErrors* graph, Float_t dx)
3750 while (i<graph->GetN())
3752 graph->GetX()[i] += dx;
3757 void DivideGraphs(TGraphErrors* graph1, TGraphErrors* graph2)
3762 for (Int_t bin1 = 0; bin1 < graph1->GetN(); bin1++)
3764 Float_t x = graph1->GetX()[bin1];
3767 for (bin2 = 0; bin2<graph2->GetN(); bin2++)
3768 if (graph2->GetX()[bin2] >= x)
3771 if (bin2 == graph2->GetN())
3775 if (TMath::Abs(graph2->GetX()[bin2-1] - x) < TMath::Abs(graph2->GetX()[bin2] - x))
3778 if (graph1->GetY()[bin1] == 0 || graph2->GetY()[bin2] == 0 || bin2 == graph2->GetN())
3780 Printf("%d %d removed", bin1, bin2);
3781 graph1->RemovePoint(bin1--);
3785 Float_t graph2Extrapolated = graph2->GetY()[bin2];
3786 if (TMath::Abs(x - graph2->GetX()[bin2]) > 0.0001)
3788 Printf("%f %f %d %d not found", x, graph2->GetX()[bin2], bin1, bin2);
3789 graph1->RemovePoint(bin1--);
3793 Float_t value = graph1->GetY()[bin1] / graph2Extrapolated;
3794 Float_t error = value * TMath::Sqrt(TMath::Power(graph1->GetEY()[bin1] / graph1->GetY()[bin1], 2) + TMath::Power(graph2->GetEY()[bin2] / graph2->GetY()[bin2], 2));
3796 graph1->GetY()[bin1] = value;
3797 graph1->GetEY()[bin1] = error;
3799 Printf("%d %d %f %f %f %f", bin1, bin2, x, graph2Extrapolated, value, error);
3803 Float_t ExtractYields(TH1* hist, Int_t trigId, Int_t centralityId, Float_t ptA, Float_t ptW, Int_t caseId, Double_t normUnc)
3805 CreateYieldStructure();
3807 Float_t width = 0.69;
3808 //Float_t width = 0.5;
3809 //Float_t width = 0.85;
3811 //new TCanvas; hist->DrawCopy();
3813 Int_t binBegin = hist->FindBin(-width);
3814 Int_t binEnd = hist->FindBin(width);
3815 Double_t nearSideError = 0;
3816 Float_t nearSideYield = hist->IntegralAndError(binBegin, binEnd, nearSideError);
3817 nearSideYield *= hist->GetXaxis()->GetBinWidth(1);
3818 nearSideError *= hist->GetXaxis()->GetBinWidth(1);
3820 Int_t binBegin = hist->FindBin(TMath::Pi() - width);
3821 Int_t binEnd = hist->FindBin(TMath::Pi() + width);
3822 Double_t awaySideError = 0;
3823 Float_t awaySideYield = hist->IntegralAndError(binBegin, binEnd, awaySideError);
3824 awaySideYield *= hist->GetXaxis()->GetBinWidth(1);
3825 awaySideError *= hist->GetXaxis()->GetBinWidth(1);
3827 Printf("%d %d %f %d: %f+-%f %f+-%f (%f)", trigId, centralityId, ptA, caseId, nearSideYield, nearSideError, awaySideYield, awaySideError, normUnc);
3829 FillYield(trigId, centralityId, ptA, ptW, caseId, nearSideYield, TMath::Sqrt(nearSideError * nearSideError + normUnc * normUnc), awaySideYield, TMath::Sqrt(awaySideError * awaySideError + normUnc * normUnc));
3831 // store normUnc for error propagation later
3832 TGraphErrors** tmp = yields[2][trigId][centralityId];
3833 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, normUnc);
3835 return awaySideYield;
3838 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)
3840 // CINT limitation here
3841 TGraphErrors** tmp = yields[0][trigId][centralityId];
3842 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, nearSideYield);
3843 tmp[caseId]->SetPointError(tmp[caseId]->GetN()-1, ptW, nearSideError);
3844 //tmp[caseId]->Print();
3846 tmp = yields[1][trigId][centralityId];
3847 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, awaySideYield);
3848 tmp[caseId]->SetPointError(tmp[caseId]->GetN()-1, ptW, awaySideError);
3851 Double_t hypgeo(Double_t a, Double_t b, Double_t c, Double_t z)
3853 // ROOT::Math::hyperg is only defined for |z| < 1
3855 return ROOT::Math::hyperg(a, b, c, z);
3857 // for z < -1 we can use an identity from http://en.wikipedia.org/wiki/Hypergeometric_function
3858 return TMath::Power(1-z, -b) * ROOT::Math::hyperg(c-a, b, c, z / (z-1));
3861 Double_t hypgeoder2(Double_t a, Double_t b, Double_t c, Double_t z)
3863 // derivate of hypgeo with parameter b: d/db hypgeo
3865 static TF1* func = 0;
3867 func = new TF1("hypgeoder2_func", "hypgeo([0], x, [1], [2])");
3869 func->SetParameters(a, c, z);
3870 return func->Derivative(b);
3873 void TsallisYieldUncertainty(Double_t n, Double_t q, Double_t beta, TMatrixDSym covMatrix, Int_t offset, Double_t& yield, Double_t& unc)
3875 gSystem->Load("libMathMore");
3877 TF1 tsallis("tsallis", "[0] * (1-[2]*(1-[1])*x*x)**(1/(1-[1]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
3879 // 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]
3880 // [0] = n, [1] = q, [2] = beta
3881 TF1 tsallisIntegral("tsallisIntegral", "[0]*x*hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x)");
3882 TF1 tsallisIntegralDerN("tsallisIntegralDerN", "x*hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x)");
3884 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)");
3886 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]");
3888 const Float_t width = 0.7;
3891 derivates[0] = new TF1("const", "1");
3892 derivates[1] = &tsallisIntegralDerN;
3893 derivates[2] = &tsallisIntegralDerq;
3894 derivates[3] = &tsallisIntegralDerbeta;
3896 Printf("%f %f %f", n, q, beta);
3898 tsallis.SetParameters(n, q, beta);
3899 tsallisIntegral.SetParameters(n, q, beta);
3900 for (Int_t i=1; i<4; i++)
3901 derivates[i]->SetParameters(n, q, beta);
3903 yield = tsallisIntegral.Eval(width) - tsallisIntegral.Eval(-width);
3904 Double_t yield2 = tsallis.Integral(-width, width);
3907 for (Int_t i=0; i<4; i++)
3908 for (Int_t j=0; j<4; j++)
3917 Double_t der1 = (derivates[i]->Eval(width) - derivates[i]->Eval(-width));
3918 Double_t der2 = (derivates[j]->Eval(width) - derivates[j]->Eval(-width));
3920 unc += der1 * der2 * covMatrix(covI, covJ);
3922 Printf("%d %d % .3e % .3e % .3e % .3e", i, j, der1, der2, covMatrix(covI, covJ), unc);
3925 unc = TMath::Sqrt(unc);
3928 yield2 /= width * 2;
3931 Printf("%f (%f) +- %f", yield, yield2, unc);
3934 double NLowestBinAverage(TH1 &h, int N)
3936 // Returns mean content of N lowest bins in h.
3940 std::list<double> content;
3941 std::list<double>::iterator i;
3943 for (int jbin=1; jbin<=h.GetNbinsX(); jbin++) {
3944 content.push_back(h.GetBinContent(jbin));
3948 for (i = content.begin(); i != content.end(); ++i) {
3958 Warning("NLowestBinAverage()",
3959 "Avg. of %d bins requested, %d used", N, counter);
3964 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)
3967 // 0 same with v2 (14 tsallis for baseline [28/29 tsallis params]; 15 yield from tsallis function)
3968 // [disabled] 1 same/mixed with v2 (15 tsallis for baseline)
3969 // 2 same no v2 (16 tsallis for baseline; 17 yield from tsallis function)
3970 // 4 same no v2 (18 flat fit 1)
3971 // 5 same no v2 (19 flat fit 2)
3972 // 6 same no v2 (20 flat avg over 2)
3973 // 7 same no v2 (21 flat avg over 4)
3974 // 8 same no v2 (22 flat avg over 8)
3975 // 9 same with v2 (23 flat fit 1)
3976 // 10 same with v2 (24 flat fit 2)
3977 // 11 same with v2 (25 flat avg over 2)
3978 // 12 same with v2 (26 flat avg over 4)
3979 // 13 same with v2 (27 flat avg over 8)
3981 // 30 gaussian fit width
3983 // same stuff for same/mixed
3984 if (0 && caseOffset == 0 && histMixed)
3986 TH1* clone = (TH1*) hist->Clone();
3987 clone->Divide(histMixed);
3988 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 1, ptACenter, ptAWidth);
3991 // same for other baseline subtractions
3992 if (caseOffset == 0)
3994 file = TFile::Open("dphi_corr.root", "UPDATE");
3998 TH1* clone = (TH1*) hist->Clone();
3999 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 2, ptACenter, ptAWidth, kTRUE, 0);
4001 clone = (TH1*) hist->Clone();
4002 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 4, ptACenter, ptAWidth, kTRUE, 1);
4004 clone = (TH1*) hist->Clone();
4005 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 5, ptACenter, ptAWidth, kTRUE, 2);
4007 clone = (TH1*) hist->Clone();
4008 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 6, ptACenter, ptAWidth, kTRUE, 3);
4010 clone = (TH1*) hist->Clone();
4011 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 7, ptACenter, ptAWidth, kTRUE, 4);
4013 clone = (TH1*) hist->Clone();
4014 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 8, ptACenter, ptAWidth, kTRUE, 5);
4016 clone = (TH1*) hist->Clone();
4017 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 9, ptACenter, ptAWidth, kFALSE, 1);
4019 clone = (TH1*) hist->Clone();
4020 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 10, ptACenter, ptAWidth, kFALSE, 2);
4022 clone = (TH1*) hist->Clone();
4023 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 11, ptACenter, ptAWidth, kFALSE, 3);
4025 clone = (TH1*) hist->Clone();
4026 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 12, ptACenter, ptAWidth, kFALSE, 4);
4028 clone = (TH1*) hist->Clone();
4029 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 13, ptACenter, ptAWidth, kFALSE, 5);
4032 Float_t awaySideYield = ExtractYields(hist, trigId, centralityId, ptACenter, ptAWidth, 0 + caseOffset, 0);
4037 /* Float_t v2Trig = flowGraph->Eval(ptT);
4038 Float_t v2Assoc = flowGraph->Eval(ptA);
4039 Float_t v2 = v2Trig * v2Assoc;
4040 Printf("%f %f: %.2f %.2f --> %.4f", ptT, ptA, v2Trig, v2Assoc, v2);*/
4042 TF1* flowFunc = new TF1("flowFunc", "[0] * (1+2*[1]*cos(2*x))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
4047 Float_t minBin = hist->FindBin(0.6);
4048 for (Int_t bin=hist->FindBin(0.6); bin<=hist->FindBin(1.8); bin++)
4049 if (hist->GetBinContent(bin) < hist->GetBinContent(minBin))
4052 Float_t norm = hist->GetBinContent(minBin) / (1 + 2 * v2 * cos(2 * hist->GetBinCenter(minBin)));
4053 Double_t normUnc = 0;
4057 if (baseLineDetermination == 0)
4060 if (centralityId == 0)
4061 hist->Fit("pol0", "0", "", 0.8., 1.2);
4063 hist->Fit("pol0", "0", "", 1.2, 1.6);
4065 //tsallis = new TF1("tsallis", "(1-[1]*(1-[0])*x*x)**(1/(1-[0]))", 0, 10)
4066 // (1-b(1-q)x*x)**(1/(1-q))
4068 // combination of two tsallis functions
4069 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());
4070 //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());
4071 // 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
4072 total->SetParLimits(0, 0, 10000);
4073 total->SetParLimits(1, 0, 10000);
4074 total->SetParLimits(4, 0, 10000);
4076 total->SetParLimits(2, 1.0000001, 5);
4077 total->SetParLimits(5, 1.0000001, 5);
4079 total->SetParLimits(3, 0.1, 1000);
4080 total->SetParLimits(6, 0.1, 1000);
4082 total->SetParameters(1, 1, 1.5, 3, 1, 1.5, 1.1);
4085 hist->Fit(total, "0RI");
4086 fitResult = hist->Fit(total, "0RSI");
4088 if (0 && fitResult->CovMatrixStatus() > 0)
4090 TMatrixDSym cov(fitResult->GetCovarianceMatrix());
4093 Double_t nearSideYield, nearSideError;
4094 TsallisYieldUncertainty(total->GetParameter(1), total->GetParameter(2), total->GetParameter(3), cov, 0, nearSideYield, nearSideError);
4096 Double_t awaySideYield2, awaySideError;
4097 TsallisYieldUncertainty(total->GetParameter(4), total->GetParameter(5), total->GetParameter(6), cov, 3, awaySideYield2, awaySideError);
4099 FillYield(trigId, centralityId, ptACenter, ptAWidth, 14 + caseOffset + 1, nearSideYield, nearSideError, awaySideYield2, awaySideError);
4101 Printf("Chi2 %f / ndf %d = %f", total->GetChisquare(), total->GetNDF(), (total->GetNDF() > 0) ? total->GetChisquare() / total->GetNDF() : -1);
4103 total->SetLineColor(hist->GetLineColor());
4104 total->SetLineWidth(1);
4105 if (caseOffset == 2)
4108 total->DrawCopy("SAME");
4109 //total->SetParameter(5, total->GetParameter(5) - TMath::Sqrt(cov[5][5]));
4110 //total->DrawCopy("SAME");
4111 //total->SetParameter(5, total->GetParameter(5) + 2 * TMath::Sqrt(cov[5][5]));
4112 //Printf("%f", total->Integral(-0.7,0.7));
4113 //total->DrawCopy("SAME");
4116 if (caseOffset == 0)
4118 // store fit parameters
4121 FillYield(trigId, centralityId, ptACenter, ptAWidth, 28, total->GetParameter(2), total->GetParError(2), total->GetParameter(5), total->GetParError(5));
4123 FillYield(trigId, centralityId, ptACenter, ptAWidth, 29, total->GetParameter(3), total->GetParError(3), total->GetParameter(6), total->GetParError(6));
4128 gausFit = new TF1("gausFit", "[0] + gaus(1) + gaus(4)", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
4129 gausFit->SetParameters(1, 1, 0, 1, 1, TMath::Pi(), 0);
4130 gausFit->SetParLimits(0, 0, 10000);
4131 gausFit->SetParLimits(1, 0, 10000);
4132 gausFit->FixParameter(2, 0);
4133 gausFit->SetParLimits(3, 0.01, 10);
4134 gausFit->SetParLimits(4, 0, 10000);
4135 gausFit->FixParameter(5, TMath::Pi());
4136 gausFit->SetParLimits(6, 0.01, 10);
4138 hist->Fit(gausFit, "0RI");
4139 gausFit->SetLineWidth(1);
4140 gausFit->DrawCopy("SAME");
4142 FillYield(trigId, centralityId, ptACenter, ptAWidth, 30, gausFit->GetParameter(3), total->GetParError(3), total->GetParameter(6), total->GetParError(6));
4146 if (0 && cov[0][0] > 0)
4148 for (Int_t i=0; i<cov.GetNcols(); i++)
4149 for (Int_t j=0; j<cov.GetNrows(); j++)
4150 cov[j][i] /= TMath::Sqrt(cov[i][i]) * TMath::Sqrt(cov[j][j]);
4156 Float_t norm = func->GetParameter(0) / (1 - 2 * v2);
4157 Double_t normUnc = func->GetParError(0) / (1 - 2 * v2);
4160 else if (baseLineDetermination <= 2)
4165 if (baseLineDetermination == 1)
4167 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4, 1.5 * TMath::Pi() - 0.4 };
4168 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4, TMath::Pi() / 2 + 0.4, 1.5 * TMath::Pi() };
4170 else if (baseLineDetermination == 2)
4172 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4 - 0.2, 1.5 * TMath::Pi() - 0.4 - 0.2};
4173 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4 - 0.2, TMath::Pi() / 2 + 0.4 - 0.2, 1.5 * TMath::Pi() };
4179 for (Int_t i=0; i<3; i++)
4181 hist->Fit("pol0", "0Q", "", regionBegin[i], regionEnd[i]);
4182 func = hist->GetFunction("pol0");
4185 sum += func->GetParameter(0) / func->GetParError(0) / func->GetParError(0);
4186 weight += 1. / func->GetParError(0) / func->GetParError(0);
4193 weight = TMath::Sqrt(1. / weight);
4195 Float_t norm = sum / (1 - 2 * v2);
4196 Double_t normUnc = weight / (1 - 2 * v2);
4201 if (baseLineDetermination == 4)
4203 if (baseLineDetermination == 5)
4205 Float_t norm = NLowestBinAverage(*hist, bins);
4206 Double_t normUnc = 0;
4208 Printf("NLowestBinAverage %d --> %f", bins, norm);
4210 norm /= (1 - 2 * v2);
4213 Printf("Baseline: %f +- %f", norm, normUnc);
4216 if (caseOffset == 0)
4218 Float_t awaySideYieldNoBaseline = awaySideYield - norm * (1 - 2 * v2);
4219 Float_t v2YieldNoBaseline = norm * 2 * v2 * (1 + 1.4) / 1.4;
4220 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);
4223 //flowFunc->SetParameters(hist->GetBinContent(hist->FindBin(1.4)) / (1.0 - 2.0 * v2), v2);
4224 flowFunc->SetParameters(norm, v2);
4225 flowFunc->SetLineWidth(1);
4226 if (caseOffset >= 4 && caseOffset <= 9 && caseOffset != 6)
4227 flowFunc->DrawCopy("SAME"); //->SetLineColor(caseOffset - 3);
4229 hist->Add(flowFunc, -1);
4230 if (caseOffset == 0)
4232 file = TFile::Open("dphi_corr.root", "UPDATE");
4233 hist->SetName(TString(hist->GetName()) + "_tsallis_v2");
4236 // hist->DrawCopy("SAME");
4238 if (caseOffset == 2 && flatBaseLine)
4240 file = TFile::Open("dphi_corr.root", "UPDATE");
4241 hist->SetName(TString(hist->GetName()) + "_tsallis_flat");
4244 // hist->DrawCopy("SAME");
4246 if (caseOffset == 4 && flatBaseLine)
4248 file = TFile::Open("dphi_corr.root", "UPDATE");
4249 hist->SetName(TString(hist->GetName()) + "_fit_flat");
4252 // hist->DrawCopy("SAME");
4255 ExtractYields(hist, trigId, centralityId, ptACenter, ptAWidth, 14 + caseOffset, normUnc);
4259 Printf("%f", histMixed->Integral() / histMixed->GetNbinsX());
4260 flowFunc->SetParameters(histMixed->Integral() / histMixed->GetNbinsX(), v2);
4261 flowFunc->SetLineColor(2);
4262 //if (caseOffset == 0)
4263 // flowFunc->DrawCopy("SAME");
4267 void RemoveBaseLine(TH1* hist)
4275 hist->Fit("pol0", "0", "", 1.07, 2.07);
4277 if (!hist->GetFunction("pol0"))
4280 Float_t zyam = hist->GetFunction("pol0")->GetParameter(0);
4287 for (Int_t i=1; i<=hist->GetNbinsX(); i++)
4288 hist->SetBinContent(i, hist->GetBinContent(i) - zyam);
4291 TH2* cacheMixed = 0;
4292 Int_t gHistCount = 0;
4293 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, Bool_t equivMixedBin = kFALSE, Float_t* vn = 0, Bool_t scaleToPairs = kTRUE)
4295 h = (AliUEHistograms*) hVoid;
4296 hMixed = (AliUEHistograms*) hMixedVoid;
4298 Int_t centralityBeginBin = 0;
4299 Int_t centralityEndBin = -1;
4301 if (centralityEnd >= centralityBegin)
4303 centralityBeginBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityBegin);
4304 centralityEndBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityEnd);
4307 // 2d same and mixed event
4308 TH2* sameTwoD = h->GetUEHist(2)->GetUEHist(step, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, 1, kFALSE);
4314 // No centrality, nor pT associated dep of the mixed event observed. Use a larger range to get more statistics
4316 // TODO HACK. mixed event is not propagated to step0
4317 Int_t stepMixed = 6;
4320 hMixed->SetPtRange(1.0, 10);
4321 cacheMixed = (TH2*) hMixed->GetUEHist(2)->GetUEHist(stepMixed, 0, 1.0, 10.0, 1, 15, 1, kFALSE);
4324 TH2* mixedTwoD = cacheMixed;
4328 // use same bin for mixing
4330 Int_t stepMixed = 6;
4331 TH2* mixedTwoD = (TH2*) hMixed->GetUEHist(2)->GetUEHist(stepMixed, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, 1, kFALSE);
4336 // asssume flat in dphi, gain in statistics
4338 TH1* histMixedproj = mixedTwoD->ProjectionY();
4339 histMixedproj->Scale(1.0 / mixedTwoD->GetNbinsX());
4341 for (Int_t x=1; x<=mixedTwoD->GetNbinsX(); x++)
4342 for (Int_t y=1; y<=mixedTwoD->GetNbinsY(); y++)
4343 mixedTwoD->SetBinContent(x, y, histMixedproj->GetBinContent(y));
4346 // get mixed event normalization by assuming full acceptance at deta of 0 (only works for flat dphi)
4349 Double_t mixedNorm = mixedTwoD->Integral(1, mixedTwoD->GetNbinsX(), mixedTwoD->GetYaxis()->FindBin(-0.01), mixedTwoD->GetYaxis()->FindBin(0.01));
4350 mixedNorm /= mixedTwoD->GetNbinsX() * (mixedTwoD->GetYaxis()->FindBin(0.01) - mixedTwoD->GetYaxis()->FindBin(-0.01) + 1);
4353 Double_t mixedNorm = mixedTwoD->Integral() / sameTwoD->Integral();
4356 sameTwoD->Divide(mixedTwoD);
4357 sameTwoD->Scale(mixedNorm);
4360 sameTwoD->Draw("SURF1");
4364 // extract dphi distribution if requested
4371 Float_t etaLimit = 0.8;
4373 if (twoD == 0 || twoD == 10)
4376 Int_t etaEnd = sameTwoD->GetNbinsY();
4380 etaBegin = sameTwoD->GetYaxis()->FindBin(-etaLimit + 0.01);
4381 etaEnd = sameTwoD->GetYaxis()->FindBin(etaLimit - 0.01);
4384 *hist = sameTwoD->ProjectionX("proj", etaBegin, etaEnd);
4387 (*hist)->Scale(1.0 / (etaEnd - etaBegin + 1));
4389 else if (twoD == 11)
4391 *hist = sameTwoD->ProjectionX("proj", sameTwoD->GetYaxis()->FindBin(-etaLimit * 2 + 0.01), sameTwoD->GetYaxis()->FindBin(-etaLimit - 0.01));
4392 Int_t etaBins = sameTwoD->GetYaxis()->FindBin(-etaLimit - 0.01) - sameTwoD->GetYaxis()->FindBin(-etaLimit * 2 + 0.01) + 1;
4394 TH1D* tracksTmp = sameTwoD->ProjectionX("proj2", sameTwoD->GetYaxis()->FindBin(etaLimit + 0.01), sameTwoD->GetYaxis()->FindBin(2 * etaLimit - 0.01));
4395 etaBins += sameTwoD->GetYaxis()->FindBin(2 * etaLimit - 0.01) - sameTwoD->GetYaxis()->FindBin(etaLimit + 0.01) + 1;
4397 (*hist)->Add(tracksTmp);
4400 (*hist)->Scale(1.0 / etaBins);
4404 //*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);
4406 *hist = (TH1*) (*hist)->Clone(Form("GetDistAndFlow_%d", gHistCount++));
4409 str.Form("%.1f < p_{T,trig} < %.1f", ptBegin - 0.01, ptEnd + 0.01);
4412 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
4415 newTitle.Form("%s - %s - %d-%d%%", str.Data(), str2.Data(), centralityBegin, centralityEnd);
4416 (*hist)->SetTitle(newTitle);
4420 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));
4422 //new TCanvas; (*hist)->DrawCopy(); histMixed->DrawCopy("SAME")->SetLineColor(2);
4424 Float_t totalPairs = (*hist)->Integral();
4426 (*hist)->Divide(histMixed);
4427 (*hist)->Scale(totalPairs / (*hist)->Integral());
4429 //(*hist)->DrawCopy("SAME")->SetLineColor(4);
4434 // calculate v2trigger
4435 h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
4436 ptDist = h->GetUEHist(2)->GetEventHist()->Project(step, 0);
4438 for (Int_t i=2; i<=((vn) ? 4 : 2); i++)
4439 vTrig[i-1] = CalculateFlow(ptDist, ptBegin, ptEnd, i, centralityBegin, centralityEnd);
4442 // calculate v2 assoc
4443 cont = h->GetUEHist(2)->GetTrackHist(0);
4444 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(step)->GetGrid()->GetAxis(3)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
4445 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(step)->GetGrid()->GetAxis(2)->SetRangeUser(ptBegin, ptEnd);
4446 ptDist = h->GetUEHist(2)->GetTrackHist(0)->Project(step, 1);
4448 for (Int_t i=2; i<=((vn) ? 4 : 2); i++)
4449 vAssoc[i-1] = CalculateFlow(ptDist, gpTMin, gpTMax, i, centralityBegin, centralityEnd);
4453 *v2 = vTrig[2-1] * vAssoc[2-1];
4455 for (Int_t i=2; i<=4; i++)
4456 vn[i-1] = vTrig[i-1] * vAssoc[i-1];
4460 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)
4464 Bool_t veryCentral = 0;
4465 Bool_t flowComparison = 0;
4466 Bool_t rhicOverlay = 0;
4467 Bool_t highStatBinning = 0;
4469 file = TFile::Open("dphi_corr.root", "RECREATE");
4472 Int_t leadingPtOffset = 1;
4474 if (veryCentral || flowComparison)
4476 Int_t maxLeadingPt = 2;
4477 Int_t maxAssocPt = 2;
4478 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
4479 //Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 4.0, 6.0, 10.0, 20.0, 40.0 };
4480 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
4482 else if (rhicOverlay) // RHIC binning
4484 Int_t maxLeadingPt = 4;
4485 Int_t maxAssocPt = 5;
4486 Float_t leadingPtArr[] = { 4.0, 5.0, 7.0, 9.0, 12.0 };
4487 Float_t assocPtArr[] = { 0.5, 1.0, 2.0, 3.0, 5.0, 7.0 };
4489 else if (highStatBinning)
4491 Int_t maxLeadingPt = 3;
4492 Int_t maxAssocPt = 2;
4493 Float_t leadingPtArr[] = { 4.0, 6.0, 8.0, 15.0 };
4494 Float_t assocPtArr[] = { 1.0, 4.0, 10.0 };
4496 else // ALICE binning
4500 Int_t maxLeadingPt = 3;
4501 Int_t maxAssocPt = 7;
4502 // Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 10.0, 15.0 };
4503 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
4504 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
4505 leadingPtOffset = 2;
4509 Int_t maxLeadingPt = 1;
4510 Int_t maxAssocPt = 4;
4511 Float_t leadingPtArr[] = { 8.0, 10.0, 15.0, 15.0 };
4512 Float_t assocPtArr[] = { 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
4513 leadingPtOffset = 2;
4517 Int_t nCentralityBins = 5;
4518 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
4519 //Int_t centralityBins[] = { 1, 3, 5, 7, 9, 13 };
4521 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
4522 AliUEHistograms* hMixed = 0;
4524 hMixed = (AliUEHistograms*) GetUEHistogram(fileName1, 0, kTRUE);
4528 Printf("WARNING: Reading mixed event from preliminaries/corrected_110317.root");
4529 hMixed = (AliUEHistograms*) GetUEHistogram("preliminaries/corrected_110317.root", 0, kTRUE);
4532 AliUEHistograms* h2 = 0;
4534 h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
4536 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
4537 canvas->Divide(maxAssocPt, maxLeadingPt);
4539 TCanvas* canvas2 = new TCanvas("Centrality", "Centrality", 800, 600);
4540 centralityHist = (TH1*) h->GetCentralityDistribution();
4541 NormalizeToBinWidth(centralityHist);
4542 centralityHist->Draw();
4545 TLegend* legend = new TLegend(0.2, 0.5, 0.95, 0.90);
4546 TLegend* legend2 = new TLegend(0.5, 0.63, 0.95, 0.90);
4547 legend2->SetFillColor(0);
4548 legend2->SetTextSize(0.04);
4550 for (Int_t i=0; i<maxLeadingPt; i++)
4551 for (Int_t j=0; j<maxAssocPt; j++)
4554 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+leadingPtOffset]);
4559 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->SetRangeUser(0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
4560 centralityHist = h->GetUEHist(2)->GetEventHist()->ShowProjection(1, 6);
4561 centralityHist->SetLineColor(i+2);
4562 NormalizeToBinWidth(centralityHist);
4563 centralityHist->DrawCopy("SAME");
4564 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->SetRangeUser(0, 0, -1);
4565 legend2->AddEntry(centralityHist, str);
4568 canvas->cd(j+1 + i * maxAssocPt);
4569 gPad->SetLeftMargin(0.15);
4570 gPad->SetBottomMargin(0.2);
4571 gPad->SetTopMargin(0.01);
4572 gPad->SetRightMargin(0.01);
4574 if (i == 0 && j == 3)
4577 gpTMin = assocPtArr[j] + 0.01;
4578 gpTMax = assocPtArr[j+1] - 0.01;
4581 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
4584 // for HI file do not set range in eta anymore after it was changed to delta eta axis
4585 h->SetEtaRange(0, 0);
4589 SetupRanges(h2); // SetEtaRange(0, 0) does not need to be called for the leading track result
4590 h2->SetEtaRange(0, 0);
4595 SetupRanges(hMixed);
4596 hMixed->SetEtaRange(0, 0);
4602 if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
4609 // 40-80% --> 11, 14
4612 TString hist1Str, hist2Str, hist2bStr;
4615 for (Int_t k=0; k<3; k++)
4626 GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist1Str = "0-2%";
4627 // GetDistAndFlow(h, hMixed, &hist2, v2, step, 1, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2Str = "1-3%";
4628 GetDistAndFlow(h, hMixed, &hist2b, v2+2, step, 30, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2bStr = "30-40%";
4630 //TH1* hist1 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 2); hist1Str = "0-2%";
4631 //TH1* hist2 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 2, 3); hist2Str = "2-3%";
4632 //TH1* hist2b = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, 10); hist2bStr = "30-40%";
4634 else if (flowComparison)
4636 TH1* hist1 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 5); hist1Str = "0-5%";
4637 TH1* hist2 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 10); hist2Str = "20-40%";
4638 TH1* hist2b = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, 10); hist2bStr = "30-40%";
4639 TH1* hist3 = 0; // h2->GetUEHist(2)->GetUEHist(0, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
4641 else if (rhicOverlay)
4643 TH1* hist1 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 8); hist1Str = "0-20%";
4644 TH1* hist2 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 12); hist2Str = "20-60%";
4645 TH1* hist2b = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15);hist2bStr = "60-90%";
4646 TH1* hist3 = h2->GetUEHist(2)->GetUEHist(0, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
4654 GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist1Str = "0-5%";
4655 GetDistAndFlow(h, hMixed, &hist2, v2+1, step, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2Str = "0-20%";
4656 // GetDistAndFlow(h, hMixed, &hist2b, v2[2], step, 60, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2bStr = "60-80%";
4657 GetDistAndFlow(h, hMixed, &hist2b, v2+2, step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2bStr = "60-90%";
4659 Printf("%f %f %f", v2[0], v2[1], v2[2]);
4661 // TH1* hist1 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 8); hist1Str = "0-20%";
4662 // TH1* hist2 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 12); hist2Str = "20-60%";
4663 // TH1* hist2b = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15); hist2bStr = "60-90%";
4666 // TH1* hist3Old = h2->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
4668 GetDistAndFlow(h2, hMixed, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
4672 hist3Old->DrawCopy("SAME")->SetLineColor(2); */
4676 RemoveBaseLine(hist1);
4677 RemoveBaseLine(hist2);
4678 RemoveBaseLine(hist2b);
4679 RemoveBaseLine(hist3);
4683 newTitle.Form("%s - %s", str.Data(), str2.Data());
4686 hist1->SetName(Form("dphi_%d_%d_%d", i, j, 0));
4687 hist1->SetTitle(newTitle + " - " + hist1Str);
4691 hist2->SetName(Form("dphi_%d_%d_%d", i, j, 1));
4692 hist2->SetTitle(newTitle + " - " + hist2Str);
4696 hist2b->SetName(Form("dphi_%d_%d_%d", i, j, 2));
4697 hist2b->SetTitle(newTitle + " - " + hist2bStr);
4701 hist3->SetName(Form("dphi_%d_%d_%d", i, j, 3));
4702 hist3->SetTitle(newTitle + " - pp");
4707 hist1->Scale(1.0 / hist1->Integral());
4708 hist2->Scale(1.0 / hist2->Integral());
4709 hist3->Scale(1.0 / hist3->Integral());
4712 if (i == 0 && j == 0)
4714 legend->SetFillColor(0);
4715 legend->AddEntry(hist1, "Pb+Pb 0-5%");
4717 legend->AddEntry(hist2, "Pb+Pb 20-40%");
4719 legend->AddEntry(hist2b, "Pb+Pb 60-90%");
4721 legend->AddEntry(hist3, "p+p 7 TeV");
4722 legend->SetTextSize(0.08);
4725 Prepare1DPlot(hist1);
4726 Prepare1DPlot(hist2);
4727 Prepare1DPlot(hist2b);
4728 Prepare1DPlot(hist3);
4730 Double_t yMin = 0.01;
4731 Double_t yMax2 = yMax;
4735 yMin = -0.01; //TMath::Min(hist1->GetMinimum(), hist2->GetMinimum()) * 0.97;
4736 yMax2 = TMath::Max((hist3) ? hist3->GetMaximum() : 0.0, TMath::Max(hist1->GetMaximum(), (hist2) ? hist2->GetMaximum() : 0.0)) * 1.03;
4741 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);
4742 dummy->SetStats(kFALSE);
4743 dummy->SetXTitle(hist1->GetXaxis()->GetTitle());
4744 dummy->SetYTitle(hist1->GetYaxis()->GetTitle());
4745 dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
4746 Prepare1DPlot(dummy);
4748 dummy->GetYaxis()->SetTitleOffset(0.8);
4750 dummy->GetXaxis()->SetLabelSize(0.08);
4751 dummy->GetYaxis()->SetLabelSize(0.08);
4752 dummy->GetXaxis()->SetTitleSize(0.08);
4753 dummy->GetYaxis()->SetTitleSize(0.08);
4755 dummy->GetYaxis()->SetTitleOffset(0.8);
4758 dummyTmp = dummy->DrawCopy();
4760 hist1->DrawCopy("SAME");
4764 SetupRanges(hMixed);
4765 // for HI file do not set range in eta anymore after it was changed to delta eta axis
4766 hMixed->SetEtaRange(0, 0);
4768 TH1* hist1Mixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 5);
4769 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], hist1Mixed, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
4771 //hist1Mixed->Draw("SAME");
4774 hist2->SetLineColor(2);
4775 hist2->DrawCopy("SAME");
4777 TH1* hist2Mixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 10);
4778 //hist2Mixed->SetLineColor(2);
4779 //hist2Mixed->Draw("SAME");
4781 DrawFlow(v2[1], hist2, leadingPtArr[i], assocPtArr[j], hist2Mixed, i, 1, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
4782 //DrawFlow(GetFlow05(), hist2, leadingPtArr[i], assocPtArr[j], hist2Mixed);
4786 hist2b->SetLineColor(3);
4787 hist2b->DrawCopy("SAME");
4789 TH1* hist2bMixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15);
4790 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], hist2bMixed, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
4791 //DrawFlow(GetFlow05(), hist2b, leadingPtArr[i], assocPtArr[j], hist2bMixed);
4795 hist3->SetLineColor(4);
4796 hist3->DrawCopy("SAME");
4798 DrawFlow(0, hist3, leadingPtArr[i], assocPtArr[j], 0, i, 3, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
4800 //dummyTmp->GetYaxis()->SetRangeUser(0, 1.1 * TMath::Max(TMath::Max(hist1->GetMaximum(), hist2->GetMaximum()), hist2b->GetMaximum()));
4802 else // delta eta delta phi
4806 if (assocPtArr[j] > leadingPtArr[i])
4813 if (assocPtArr[jRef] > leadingPtArr[i])
4817 gpTMin = assocPtArr[jRef] + 0.01;
4818 gpTMax = assocPtArr[jRef+1] - 0.01;
4820 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
4822 // use j for centrality
4823 if (j >= nCentralityBins)
4826 centrBegin = centralityBins[j];
4827 centrEnd = centralityBins[j+1] - 1;
4831 // for HI file do not set range in eta anymore after it was changed to delta eta axis
4832 h->SetEtaRange(0, 0);
4834 SetupRanges(hMixed);
4835 // for HI file do not set range in eta anymore after it was changed to delta eta axis
4836 hMixed->SetEtaRange(0, 0);
4838 TH2* histSame = (TH2*) h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centrBegin, centrEnd, kTRUE);
4839 TH2* histMixed = (TH2*) hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centrBegin, centrEnd, kTRUE);
4842 histSame->Rebin2D(2, 2);
4843 histMixed->Rebin2D(2, 2);
4847 // fit delta eta, assuming no dependence on dphi
4849 //new TCanvas; histMixed->DrawCopy("SURF1");
4851 histMixedproj = histMixed->ProjectionY();
4852 histMixedproj->Scale(1.0 / histMixed->GetNbinsX());
4854 for (Int_t x=1; x<=histMixed->GetNbinsX(); x++)
4855 for (Int_t y=1; y<=histMixed->GetNbinsY(); y++)
4856 histMixed->SetBinContent(x, y, histMixedproj->GetBinContent(y));
4858 //new TCanvas; histMixed->DrawCopy("SURF1");
4861 histSame->SetStats(0);
4862 histSame->GetYaxis()->SetRangeUser(-1.5, 1.5);
4863 histSame->SetTitle("");
4864 histSame->Divide(histMixed);
4865 histSame->DrawCopy("SURF1");
4868 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
4869 latex = new TLatex(0.15, 0.95, str3);
4871 latex->SetTextSize(0.08);
4875 latex = new TLatex(0.55, 0.8, str);
4877 latex->SetTextSize(0.06);
4880 latex = new TLatex(0.55, 0.88, str2);
4882 latex->SetTextSize(0.06);
4885 // if (i == 0) return;
4888 canvas->SaveAs(Form("DeltaPhi_%.2f.png", yMax));
4894 //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]);
4897 void PlotPtDistributions(const char* fileName1, Int_t centrBegin = 1, Int_t centrEnd = 2)
4901 Int_t maxLeadingPt = 3;
4902 Float_t leadingPtArr[] = { 1.0, 10.0, 20.0, 40.0 };
4904 Int_t nCentralityBins = 5;
4905 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
4907 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
4909 TCanvas* canvas = new TCanvas("Pt", "Pt", 1000, 1000);
4910 canvas->Divide(2, maxLeadingPt+2);
4912 TLegend* legend = new TLegend(0.2, 0.2, 0.95, 0.90);
4913 legend->SetFillColor(0);
4914 legend->SetTextSize(0.08);
4916 TLegend* legendB = new TLegend(0.2, 0.2, 0.95, 0.90);
4917 legendB->SetFillColor(0);
4918 legendB->SetTextSize(0.08);
4920 TLegend* legend2 = new TLegend(0.2, 0.2, 0.95, 0.90);
4921 legend2->SetFillColor(0);
4922 legend2->SetTextSize(0.08);
4924 Int_t colors[] = { 1, 2, 4, 6 };
4925 Int_t markers[] = { 20, 21, 22, 23, 24, 25 };
4927 for (Int_t i=0; i<maxLeadingPt; i++)
4929 Double_t ptMin = leadingPtArr[i] + 0.01;
4930 //Double_t ptMax = leadingPtArr[i+1] - 0.01;
4931 Double_t ptMax = 39.99;
4934 str.Form("%.1f < p_{T,trig} < %.1f", ptMin - 0.01, ptMax + 0.01);
4936 canvas->cd(2*i+1+2);
4937 gPad->SetLeftMargin(0.15);
4938 gPad->SetBottomMargin(0.2);
4939 gPad->SetTopMargin(0.01);
4940 gPad->SetRightMargin(0.01);
4946 TH2F* dummy = new TH2F("dummy", "", 100, 1, 40, 100, 1e-5, 1e3);
4947 dummy->SetStats(kFALSE);
4948 dummy->SetXTitle("p_{T,assoc}");
4949 dummy->SetYTitle("");
4950 dummy->GetYaxis()->SetTitleOffset(1);
4951 Prepare1DPlot(dummy);
4953 dummy->GetXaxis()->SetLabelSize(0.06);
4954 dummy->GetYaxis()->SetLabelSize(0.06);
4955 dummy->GetXaxis()->SetTitleSize(0.06);
4956 dummy->GetYaxis()->SetTitleSize(0.06);
4959 Float_t phiRange[] = { 0, TMath::Pi() / 2, TMath::Pi() };
4960 const char* phiLabels[] = { "Towards", "Transverse", "Away" };
4962 for (Int_t j=0; j<3; j++)
4964 TH1* centralEta = 0;
4969 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);
4970 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);
4971 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);
4972 sideEta1->Add(sideEta2); // TODO can be done smarter? what about the errors?
4974 Prepare1DPlot(sideEta1);
4975 Prepare1DPlot(centralEta);
4977 centralEta->SetLineColor(colors[j]);
4978 sideEta1->SetLineColor(colors[j+1]);
4982 legend->AddEntry(centralEta->Clone(), Form("Jet, %s: |#eta| < 0.7, #phi ~ %.1f", phiLabels[j], phiRange[j]));
4983 legend->AddEntry(sideEta1->Clone(), Form("Ridge, %s: 0.7 < |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]));
4988 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);
4989 centralEta->Scale(0.5);
4990 centralEta->SetLineColor(colors[j+1]);
4992 Prepare1DPlot(centralEta);
4995 legend->AddEntry(centralEta->Clone(), Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]));
4998 canvas->cd(2*i+1+2);
4999 centralEta->DrawCopy("SAME");
5001 sideEta1->DrawCopy("SAME");
5003 centralEta->SetLineColor(colors[i]);
5004 centralEta->Scale(100.0 / centralEta->Integral());
5007 sideEta1->SetLineColor(colors[i]);
5008 sideEta1->Scale(100.0 / sideEta1->Integral());
5017 gPad->SetLeftMargin(0.15);
5018 gPad->SetBottomMargin(0.2);
5019 gPad->SetTopMargin(0.01);
5020 gPad->SetRightMargin(0.01);
5031 str3.Form("Jet, %s: |#eta| < 0.7, #phi ~ %.1f", phiLabels[j], phiRange[j]);
5033 str3.Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
5034 latex = new TLatex(0.2, 0.3, str3);
5036 latex->SetTextSize(0.08);
5041 legend2->AddEntry(centralEta->Clone(), str);
5043 centralEta->DrawCopy("SAME");
5047 canvas->cd(j*4+4+2);
5050 gPad->SetLeftMargin(0.15);
5051 gPad->SetBottomMargin(0.2);
5052 gPad->SetTopMargin(0.01);
5053 gPad->SetRightMargin(0.01);
5064 str3.Form("Ridge, %s: 0.7 < |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
5066 str3.Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
5067 latex = new TLatex(0.2, 0.3, str3);
5069 latex->SetTextSize(0.08);
5073 sideEta1->DrawCopy("SAME");
5078 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
5079 latex = new TLatex(0.2, 0.3, str3);
5081 latex->SetTextSize(0.08);
5083 latex2 = new TLatex(0.55, 0.8, str);
5085 latex2->SetTextSize(0.06);
5087 canvas->cd(2*i+1+2);
5101 TH1* GetNonSubtractedRHICYield(Int_t ptT, Int_t ptA, Int_t centrality)
5103 rhicFile = TFile::Open("rhic/postcorr_AuAu_iter6_ppg106final.root");
5105 corrFunc = (TH1*) rhicFile->Get(Form("pi0hdphi_%d_%d_%d_2", ptT, ptA, centrality));
5109 corrFunc->Scale(1.0 / corrFunc->Integral());
5111 corrFunc->Scale(TMath::TwoPi() / corrFunc->GetBinWidth(1));
5113 same = (TH1*) rhicFile->Get(Form("pi0hdphi_%d_%d_%d_0", ptT, ptA, centrality));
5114 Float_t nPairs = same->Integral();
5116 triggers = (TH1*) rhicFile->Get(Form("pi0pt_%d_%d", ptT, centrality));
5117 Float_t nTrigs = triggers->Integral();
5119 graph = (TGraph*) rhicFile->Get(Form("gS_%d_%d", ptT, centrality));
5121 Printf("%f %f %f %f", nPairs, nTrigs, nPairs / nTrigs, graph->GetY()[ptA]);
5123 corrFunc->Scale(nPairs / nTrigs);
5125 //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))));
5130 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4, 1.5 * TMath::Pi() - 0.4 };
5131 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4, TMath::Pi() / 2 + 0.4, 1.5 * TMath::Pi() };
5136 for (Int_t i=0; i<3; i++)
5138 corrFunc->Fit("pol0", "0Q", "", regionBegin[i], regionEnd[i]);
5139 func = corrFunc->GetFunction("pol0");
5142 sum += func->GetParameter(0) / func->GetParError(0) / func->GetParError(0);
5143 weight += 1. / func->GetParError(0) / func->GetParError(0);
5150 weight = TMath::Sqrt(1. / weight);
5152 corrFunc->Add(new TF1("func", "1", -5, 5), -sum);
5158 compHist = (TH1*) rhicFile->Get(Form("ptyMSMP_0_%d%d%d", ptT, ptA, centrality));
5159 compHist->DrawCopy("SAME");
5161 //compHist->Add((TF1*) compHist->GetListOfFunctions()->First());
5162 //compHist->DrawCopy("SAME");
5165 void DeltaPhiVsRHIC(Int_t rhicCentrality = 0, Int_t aliceCentrality = 0, Bool_t reduced = kFALSE)
5167 aliceFile = TFile::Open("alice_dphi_corr_rhicbinning.root");
5168 rhicFile = TFile::Open("rhic/postcorr_AuAu_iter6_ppg106final.root");
5170 Int_t maxLeadingPt = 4;
5171 Int_t maxAssocPt = 5;
5175 Int_t maxSelected = 4;
5176 Int_t selectedLead[] = { 0, 0, 2, 2 };
5177 Int_t selectedAssoc[] = { 1, 2, 3, 4 };
5179 maxLeadingPt = TMath::Sqrt(maxSelected);
5180 maxAssocPt = TMath::Sqrt(maxSelected);
5183 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
5184 canvas->Divide(maxAssocPt, maxLeadingPt);
5186 for (Int_t i=0; i<maxLeadingPt; i++)
5187 for (Int_t j=0; j<maxAssocPt; j++)
5189 Printf("%d %d", i, j);
5191 canvas->cd(j+1 + i * maxAssocPt);
5192 gPad->SetLeftMargin(0.15);
5193 gPad->SetBottomMargin(0.2);
5194 //gPad->SetTopMargin(0.01);
5195 gPad->SetRightMargin(0.01);
5202 iSel = selectedLead[j + i * maxAssocPt];
5203 jSel = selectedAssoc[j + i * maxAssocPt];
5206 //rhic = (TH1*) rhicFile->Get(Form("VptyMSMP_0_%d%d%d", iSel, jSel, rhicCentrality));
5207 rhic = GetNonSubtractedRHICYield(iSel, jSel, rhicCentrality);
5210 rhic->SetLineColor(2);
5211 rhic->SetMarkerStyle(1);
5213 alice = (TH1*) aliceFile->Get(Form("dphi_%d_%d_%d_fit_flat", iSel, jSel, aliceCentrality));
5217 // match near side yield
5220 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));
5222 Printf("%f", factor);
5223 rhic->Scale(factor);
5226 alice->SetLineColor(1);
5228 //alice->Rebin(36); rhic->Rebin(30);
5230 clone = alice->DrawCopy("");
5231 rhic->DrawCopy("SAME");
5233 //Printf("chi2 test: chi2/ndf = %f", alice->Chi2Test(rhic, "WW CHI2/NDF"));
5236 for (Int_t k=1; k<=rhic->GetNbinsX(); k++)
5238 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));
5243 Printf("chi2 test: chi2/ndf = %f", chi2);
5245 clone->GetYaxis()->SetRangeUser(TMath::Min(alice->GetMinimum(), rhic->GetMinimum()) * 1.1, TMath::Max(alice->GetMaximum(), rhic->GetMaximum()) * 1.1);
5247 for (Int_t bin=1; bin<=rhic->GetNbinsX(); bin++)
5249 Double_t aliceValue = alice->GetBinContent(alice->FindBin(rhic->GetXaxis()->GetBinCenter(bin)));
5250 if (aliceValue == 0)
5252 rhic->SetBinContent(bin, rhic->GetBinContent(bin) / aliceValue);
5253 rhic->SetBinError(bin, 0);
5259 rhic->SetLineColor(3);
5260 //rhic->DrawCopy("SAME");
5265 canvas->SaveAs("yield_comparison.png");
5268 void DeltaPhi(const char* fileName, const char* fileName2 = 0, Bool_t reduced = kFALSE, Bool_t ppComparison = kFALSE, Int_t mode = 0, const char* dataTag = "")
5270 // DeltaPhi("high_stat_binning_pp7_pt8.root", "high_stat_binning_pp7_pythia_pt8.root", 0, 1, 0, "pp 7 TeV")
5271 // DeltaPhi("high_stat_binning_pp900_pt8.root", "high_stat_binning_pp900_pythia_pt8.root", 0, 1, 0, "pp 0.9 TeV")
5275 aliceFile = TFile::Open(fileName);
5277 secondFile = TFile::Open(fileName2);
5279 Int_t maxLeadingPt = 3;
5280 Int_t maxAssocPt = 2;
5284 Int_t maxSelected = 4;
5285 Int_t selectedLead[] = { 0, 0, 2, 2 };
5286 Int_t selectedAssoc[] = { 1, 2, 3, 4 };
5288 maxLeadingPt = TMath::Sqrt(maxSelected);
5289 maxAssocPt = TMath::Sqrt(maxSelected);
5292 factorGraph = new TGraphErrors;
5294 TCanvas* canvas = new TCanvas(Form("%s_%s", fileName, fileName2 ? fileName2 : ""), Form("%s_%s", fileName, fileName2 ? fileName2 : ""), 800, 1200);
5295 canvas->Divide(maxAssocPt, maxLeadingPt);
5297 for (Int_t i=0; i<maxLeadingPt; i++)
5298 for (Int_t j=0; j<maxAssocPt; j++)
5301 TH1* peripheral = 0;
5302 for (Int_t aliceCentrality=0; aliceCentrality<4; aliceCentrality++)
5304 Printf("%d %d %d", i, j, aliceCentrality);
5306 canvas->cd(j+1 + i * maxAssocPt);
5310 Int_t centralitySel = aliceCentrality;
5311 currentFile = aliceFile;
5315 iSel = selectedLead[j + i * maxAssocPt];
5316 jSel = selectedAssoc[j + i * maxAssocPt];
5324 if (aliceCentrality == 1)
5325 currentFile = secondFile;
5326 else if (aliceCentrality == 2)
5330 if (aliceCentrality == 3)
5331 currentFile = secondFile;
5334 //alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", iSel, jSel, centralitySel, (centralitySel < 3) ? "_tsallis_flat" : ((flatOrTsallis) ? "" : "_fit_flat")));
5335 alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", iSel, jSel, centralitySel, "_fit_flat"));
5339 // match near side yield to peripheral
5340 if (1 && centralitySel == 3 && peripheral)
5342 if (mode == 0 || mode == 1)
5344 Double_t width = 0.5;
5345 Double_t error1, error2;
5346 Double_t integral1 = peripheral->IntegralAndError(peripheral->FindBin(-width), peripheral->FindBin(width), error1);
5347 Double_t integral2 = alice->IntegralAndError(alice->FindBin(-width), alice->FindBin(width), error2);
5350 Double_t tmpErr = 0;
5351 integral1 += peripheral->IntegralAndError(peripheral->FindBin(TMath::Pi() - width), peripheral->FindBin(TMath::Pi() + width), tmpErr);
5352 error1 = TMath::Sqrt(error1 * error1 + tmpErr * tmpErr);
5354 integral2 += alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), tmpErr);
5355 error2 = TMath::Sqrt(error2 * error2 + tmpErr * tmpErr);
5360 Double_t error1, error2;
5361 Double_t integral1 = peripheral->IntegralAndError(1, peripheral->GetNbinsX(), error1);
5362 Double_t integral2 = alice->IntegralAndError(1, alice->GetNbinsX(), error2);
5366 Double_t width = 1.0;
5367 Double_t error1, error2;
5368 Double_t integral1 = peripheral->IntegralAndError(peripheral->FindBin(TMath::Pi() - width), peripheral->FindBin(TMath::Pi() + width), error1);
5369 Double_t integral2 = alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), error2);
5372 Double_t factor = integral1 / integral2;
5374 //factor = 0.804 * 0.9;
5375 Printf("%f", factor);
5376 alice->Scale(factor);
5377 factorGraph->SetPoint(factorGraph->GetN(), factorGraph->GetN(), factor);
5378 factorGraph->SetPointError(factorGraph->GetN() - 1, 0, factor * TMath::Sqrt(TMath::Power(error1 / integral1, 2) + TMath::Power(error2 / integral2, 2)));
5381 if (ppComparison && aliceCentrality == 0)
5383 else if (aliceCentrality == 2)
5386 alice->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
5387 alice->SetXTitle("#Delta#phi (rad.)");
5388 alice->SetLineColor(aliceCentrality+1);
5389 alice->SetLineWidth(2);
5390 alice->SetMarkerColor(aliceCentrality+1);
5391 alice->GetYaxis()->SetTitleOffset(1.7);
5392 clone = alice->DrawCopy((aliceCentrality > 0) ? "SAME" : "");
5393 clone->SetTitle("");
5395 TString str(alice->GetTitle());
5396 str.ReplaceAll(" - ", "#");
5397 tokens = str.Tokenize("#");
5399 if (aliceCentrality == 0)
5401 for (Int_t k=0; k<2; k++)
5403 TString str(tokens->At(k)->GetName());
5404 str.ReplaceAll(".0", "");
5405 str.ReplaceAll("< p", "GeV/c < p");
5407 latex = new TLatex(0.52, 0.92-k*0.06, str);
5409 latex->SetTextSize(0.04);
5417 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), clone->GetMinimum()), TMath::Max(first->GetMaximum(), clone->GetMaximum()));
5424 //first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.2);
5425 first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.5);
5428 for (Int_t i=1; i<=6; i++)
5432 latex = new TLatex(0.6, 0.8, "ALICE preliminary");
5433 latex->SetTextSize(0.04);
5437 latex = new TLatex(0.6, 0.74, Form("%s uncorrected", dataTag));
5438 latex->SetTextSize(0.04);
5442 latex = new TLatex(0.6, 0.68, "Stat. uncertainties only");
5443 latex->SetTextSize(0.04);
5449 legend = new TLegend(0.3, 0.8, 0.47, 0.95);
5450 legend->SetFillColor(0);
5451 legend->SetTextSize(0.04);
5452 legend->AddEntry(peripheral, "Data");
5453 legend->AddEntry(alice, "Pythia");
5458 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
5459 canvas->SaveAs(Form("%s.png", canvas->GetName()));
5462 peripheral->Divide(alice);
5463 peripheral->DrawCopy();
5464 //alice->DrawCopy("SAME");
5467 graphCanvas = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("graphCanvas");
5468 factorGraph->SetMarkerStyle(20);
5471 graphCanvas = new TCanvas("graphCanvas", "graphCanvas", 800, 600);
5472 factorGraph->Draw("AP");
5477 factorGraph->SetLineColor(2);
5478 factorGraph->SetMarkerColor(2);
5479 factorGraph->Draw("SAMEP");
5481 factorGraph->GetYaxis()->SetRangeUser(0.6, 1.4);
5483 factorGraph->Print();
5486 void ComparePPYields(const char* histName = "_fit_flat")
5488 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" };
5489 const char* titles[] = { "0.9 data", "0.9 Pythia", "2.76 Pythia", "7 Pythia", "7 data" };
5491 Int_t colors[] = { 1, 2, 3, 4, 6 };
5493 Int_t maxLeadingPt = 3;
5494 Int_t maxAssocPt = 2;
5496 TCanvas* canvas = new TCanvas("ComparePPYields", "ComparePPYields", 600, 900);
5497 canvas->Divide(maxAssocPt, maxLeadingPt);
5499 legend = new TLegend(0.5, 0.5, 0.8, 0.8);
5500 legend->SetFillColor(0);
5502 TGraphErrors** graphs = new TGraphErrors*[5];
5503 TGraphErrors** graphs2 = new TGraphErrors*[5];
5505 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
5507 graphs[nFiles] = new TGraphErrors;
5508 graphs2[nFiles] = new TGraphErrors;
5511 for (Int_t i=0; i<maxLeadingPt; i++)
5512 for (Int_t j=0; j<maxAssocPt; j++)
5514 canvas->cd(j+1 + i * maxAssocPt);
5515 gPad->SetLeftMargin(0.18);
5516 gPad->SetBottomMargin(0.1);
5517 gPad->SetTopMargin(0.01);
5518 gPad->SetRightMargin(0.01);
5522 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
5524 currentFile = TFile::Open(files[nFiles]);
5526 Int_t aliceCentrality = 3;
5528 Printf("%d %d %d", i, j, nFiles);
5530 alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, histName));
5534 alice->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
5535 alice->SetLineColor(colors[nFiles]);
5536 alice->SetMarkerColor(colors[nFiles]);
5537 alice->GetYaxis()->SetTitleOffset(1.7);
5538 clone = alice->DrawCopy((nFiles > 0) ? "SAME" : "");
5539 clone->SetTitle("");
5541 Double_t width = 0.7;
5542 Double_t error, error2;
5543 Double_t integral = alice->IntegralAndError(alice->FindBin(-width), alice->FindBin(width), error);
5544 Double_t integral2 = alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), error2);
5546 graphs[nFiles]->SetPoint(graphs[nFiles]->GetN(), j + i * maxAssocPt - 0.2, integral);
5547 graphs[nFiles]->SetPointError(graphs[nFiles]->GetN()-1, 0, error);
5549 graphs2[nFiles]->SetPoint(graphs2[nFiles]->GetN(), j + i * maxAssocPt + 0.2, integral2);
5550 graphs2[nFiles]->SetPointError(graphs2[nFiles]->GetN()-1, 0, error2);
5555 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), clone->GetMinimum()), TMath::Max(first->GetMaximum(), clone->GetMaximum()));
5559 TString str(alice->GetTitle());
5560 str.ReplaceAll(" - ", "#");
5561 tokens = str.Tokenize("#");
5563 for (Int_t k=0; k<2; k++)
5565 latex = new TLatex(0.6, 0.88-k*0.07, tokens->At(k)->GetName());
5567 latex->SetTextSize(0.04);
5572 if (i == 0 && j == 0)
5573 legend->AddEntry(clone, titles[nFiles]);
5576 first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.1);
5584 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
5586 graphs[nFiles]->SetMarkerStyle(25);
5587 graphs[nFiles]->SetLineColor(colors[nFiles]);
5588 graphs[nFiles]->SetMarkerColor(colors[nFiles]);
5589 clone2 = (TGraphErrors*) graphs[nFiles]->DrawClone((nFiles == 0) ? "AP" : "PSAME");
5590 clone2->GetYaxis()->SetRangeUser(0, 5);
5592 graphs2[nFiles]->SetMarkerStyle(26);
5593 graphs2[nFiles]->SetLineColor(colors[nFiles]);
5594 graphs2[nFiles]->SetMarkerColor(colors[nFiles]);
5595 graphs2[nFiles]->DrawClone("PSAME");
5599 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
5601 DivideGraphs(graphs[nFiles], graphs[4]);
5602 DivideGraphs(graphs2[nFiles], graphs2[4]);
5604 graphs[nFiles]->SetMarkerStyle(25);
5605 graphs[nFiles]->SetLineColor(colors[nFiles]);
5606 graphs[nFiles]->SetMarkerColor(colors[nFiles]);
5607 clone2 = (TGraphErrors*) graphs[nFiles]->DrawClone((nFiles == 0) ? "AP" : "PSAME");
5608 clone2->GetYaxis()->SetRangeUser(0, 1.5);
5610 graphs2[nFiles]->SetMarkerStyle(26);
5611 graphs2[nFiles]->SetLineColor(colors[nFiles]);
5612 graphs2[nFiles]->SetMarkerColor(colors[nFiles]);
5613 graphs2[nFiles]->DrawClone("PSAME");
5617 void DeltaPhiPreliminary(const char* fileName, const char* histName)
5621 currentFile = TFile::Open(fileName);
5623 TCanvas* canvas = new TCanvas(Form("dphi%s", histName), "dphi", 800, 800);
5624 canvas->Divide(2, 2);
5626 TLegend* legend = new TLegend(0.55, 0.47, 0.85, 0.65);
5627 legend->SetFillColor(0);
5628 legend->SetTextSize(0.04);
5630 Int_t colors[] = { 1, 2, 4, 6 };
5633 for (Int_t i=1; i<2; i++)
5634 for (Int_t j=2; j<6; j++)
5638 for (Int_t aliceCentrality=0; aliceCentrality<3; aliceCentrality+=2)
5640 Printf("%d %d %d", i, j, aliceCentrality);
5642 hist = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, histName));
5646 if (aliceCentrality == 3)
5647 hist->Scale(kPythiaScalingFactor);
5649 hist->GetYaxis()->SetTitleOffset(1.9);
5650 hist->SetLineColor(colors[aliceCentrality]);
5651 hist->SetMarkerColor(colors[aliceCentrality]);
5652 hist->SetLineWidth(2);
5653 hist->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
5654 hist->SetXTitle("#Delta#phi (rad.)");
5656 clone = hist->DrawCopy((aliceCentrality > 0) ? "SAME" : "");
5657 clone->SetTitle("");
5659 TString str(hist->GetTitle());
5660 str.ReplaceAll(" - ", "#");
5661 tokens = str.Tokenize("#");
5664 if (aliceCentrality == 0)
5666 for (Int_t k=0; k<2; k++)
5668 TString str(tokens->At(k)->GetName());
5669 str.ReplaceAll(".0", "");
5670 str.ReplaceAll("< p", "GeV/c < p");
5673 latex = new TLatex(0.5, 0.88-k*0.06, str);
5675 latex->SetTextSize(0.04);
5679 latex = new TLatex(0.5, 0.76, "ALICE preliminary");
5680 latex->SetTextSize(0.04);
5684 latex = new TLatex(0.5, 0.70, "Stat. uncertainties only");
5685 latex->SetTextSize(0.04);
5689 clone->GetYaxis()->SetRangeUser(0, clone->GetMaximum() * 1.2);
5694 if (aliceCentrality == 3)
5695 legend->AddEntry(hist, "Pythia");
5697 legend->AddEntry(hist, tokens->At(2)->GetName());
5707 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
5708 canvas->SaveAs(Form("%s.png", canvas->GetName()));
5711 void DeltaPhiBaseLinePreliminary(const char* fileName)
5717 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
5718 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
5719 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
5725 gpTMin = assocPtArr[j] + 0.01;
5726 gpTMax = assocPtArr[j+1] - 0.01;
5730 str.Form("%.0f GeV/c < p_{T,trig} < %.0f GeV/c", leadingPtArr[i], leadingPtArr[i+2]);
5733 str2.Form("%.0f GeV/c < p_{T,assoc} < %.0f GeV/c", gpTMin - 0.01, gpTMax + 0.01);
5739 GetDistAndFlow(h, 0, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
5740 GetDistAndFlow(h, 0, &hist2b, v2+2, step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
5742 hist1->SetLineWidth(2);
5743 hist2b->SetLineWidth(2);
5745 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 1200, 1200);
5746 canvas->Divide(2, 2);
5749 // gPad->SetLeftMargin(0.20);
5751 hist1->GetYaxis()->SetTitleOffset(1.9);
5752 hist1->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
5753 hist1->SetXTitle("#Delta#phi (rad.)");
5754 hist1->SetTitle("");
5755 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0, 0.59);
5757 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);
5759 latex = new TLatex(0.5, 0.78, "0-5%");
5761 latex->SetTextSize(0.04);
5767 // gPad->SetLeftMargin(0.20);
5769 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.18, 0.295);
5770 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5775 // gPad->SetLeftMargin(0.20);
5777 hist2b->GetYaxis()->SetTitleOffset(1.9);
5778 hist2b->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
5779 hist2b->SetXTitle("#Delta#phi (rad.)");
5780 hist2b->SetTitle("");
5783 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);
5785 latex = new TLatex(0.5, 0.78, "60-90%");
5787 latex->SetTextSize(0.04);
5791 // gPad->SetLeftMargin(0.20);
5793 hist2b->DrawCopy()->GetYaxis()->SetRangeUser(0.01, 0.13);
5794 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5799 for (Int_t i=1; i<=4; i++)
5803 latex = new TLatex(0.5, 0.84, str);
5805 latex->SetTextSize(0.04);
5808 latex = new TLatex(0.5, 0.90, str2);
5810 latex->SetTextSize(0.04);
5813 latex = new TLatex(0.5, 0.72, "ALICE preliminary");
5814 latex->SetTextSize(0.04);
5818 latex = new TLatex(0.5, 0.66, "Stat. uncertainties only");
5819 latex->SetTextSize(0.04);
5824 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
5825 canvas->SaveAs(Form("%s.png", canvas->GetName()));
5828 void DeltaPhiRidgePreliminary(const char* fileName)
5834 Float_t leadingPtArr[] = { 2.0, 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
5835 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
5836 // Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
5837 // Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
5838 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE);
5839 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
5847 gpTMin = assocPtArr[j] + 0.01;
5848 gpTMax = assocPtArr[j+1] - 0.01;
5850 SetupRanges(hMixed);
5853 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+2]);
5856 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
5862 TH1* hist2bPeak = 0;
5863 TH1* hist1Ridge = 0;
5864 TH1* hist2bRidge = 0;
5867 TH1* hist2dMixed = 0;
5869 // GetDistAndFlow(h, 0, &hist2d, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 1);
5870 // GetDistAndFlow(hMixed, 0, &hist2dMixed, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 1);
5872 // //hist2d->Divide(hist2dMixed);
5873 // hist2dMixed->Draw("SURF1");
5875 GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
5876 // GetDistAndFlow(h, 0, &hist2b, v2[2], step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
5877 GetDistAndFlow(h, hMixed, &hist1Peak, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 10);
5879 GetDistAndFlow(h, hMixed, &hist1Ridge, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 11);
5883 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 800, 800);
5884 canvas->Divide(2, 2);
5887 gPad->SetLeftMargin(0.20);
5889 hist1->GetYaxis()->SetTitleOffset(1.9);
5890 hist1->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
5891 hist1->SetTitle("");
5894 hist1Peak->SetLineColor(2);
5895 hist1Peak->DrawCopy("SAME");
5897 hist1Ridge->SetLineColor(4);
5898 hist1Ridge->DrawCopy("SAME");
5900 // hist1Peak->Add(hist1Ridge);
5901 // hist1Peak->DrawCopy("SAME")->SetLineColor(3);
5905 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);
5907 latex = new TLatex(0.65, 0.84, str);
5909 latex->SetTextSize(0.04);
5912 latex = new TLatex(0.65, 0.90, str2);
5914 latex->SetTextSize(0.04);
5917 latex = new TLatex(0.84, 0.78, "0-5%");
5919 latex->SetTextSize(0.04);
5923 gPad->SetLeftMargin(0.20);
5925 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.18, 0.28);
5926 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5930 latex = new TLatex(0.5, 0.90, "ALICE preliminary");
5931 latex->SetTextSize(0.04);
5935 latex = new TLatex(0.5, 0.84, "Statistical uncertainties only");
5936 latex->SetTextSize(0.04);
5941 gPad->SetLeftMargin(0.20);
5943 hist2b->GetYaxis()->SetTitleOffset(1.9);
5944 hist2b->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
5945 hist2b->SetTitle("");
5948 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);
5950 latex = new TLatex(0.84, 0.78, "60-90%");
5952 latex->SetTextSize(0.04);
5956 gPad->SetLeftMargin(0.20);
5958 hist2b->DrawCopy()->GetYaxis()->SetRangeUser(0.01, 0.1);
5959 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
5963 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
5964 canvas->SaveAs(Form("%s.png", canvas->GetName()));
5967 void MCScalingFactor(Int_t caseId)
5970 // x[5]=5, y[5]=0.813743, ex[5]=0, ey[5]=0.158446
5971 // x[5]=5, y[5]=1.09804, ex[5]=0, ey[5]=0.265434
5973 // x[5]=5, y[5]=1.02276, ex[5]=0, ey[5]=0.0199991
5974 // x[5]=5, y[5]=0.870247, ex[5]=0, ey[5]=0.0294444
5976 Float_t factors[] = { 0.814, 1.098, 1.022, 0.870 };
5977 Float_t errors[] = { 0.158, 0.265, 0.020, 0.029 };
5981 for (Int_t i=0; i<2; i++)
5986 avgs[i] = factors[2*i] / errors[2*i] / errors[2*i] + factors[2*i+1] / errors[2*i+1] / errors[2*i+1];
5987 avgs[i] /= 1. / errors[2*i] / errors[2*i] + 1. / errors[2*i+1] / errors[2*i+1];
5991 avgs[i] = factors[2*i];
5995 avgs[i] = factors[2*i+1];
5999 avgs[0] = factors[0];
6000 avgs[1] = factors[3];
6004 avgs[0] = factors[1];
6005 avgs[1] = factors[2];
6010 Float_t a = avgs[0];
6011 Float_t b = avgs[1];
6013 Printf("%f %f", a, b);
6015 Float_t linEx = a + (b-a)/(7.-0.9) * (2.76-0.9);
6016 Float_t logEx = a + (b-a)/(log(7.)-log(0.9)) * (log(2.76)-log(0.9));
6018 Printf("%f %f", linEx, logEx);
6021 void CompareDeltaPhi(const char* fileName1, const char* fileName2, Int_t centralityID, const char* dist = "_fit_flat", Bool_t reduced = kFALSE)
6023 firstFile = TFile::Open(fileName1);
6024 secondFile = TFile::Open(fileName2);
6026 Int_t maxLeadingPt = 3;
6027 Int_t maxAssocPt = 7;
6028 Int_t minLeadingPt = 0;
6029 Int_t minAssocPt = 0;
6039 TCanvas* canvas = new TCanvas(Form("%s %s", fileName1, fileName2 ? fileName2 : ""), Form("%s %s", fileName1, fileName2 ? fileName2 : ""), 1000, 700);
6040 canvas->Divide(maxAssocPt-minAssocPt, maxLeadingPt-minLeadingPt);
6042 for (Int_t i=minLeadingPt; i<maxLeadingPt; i++)
6043 for (Int_t j=minAssocPt; j<maxAssocPt; j++)
6045 Printf("%d %d", i, j);
6047 canvas->cd(j+1-minAssocPt + (i-minLeadingPt) * maxAssocPt);
6048 gPad->SetLeftMargin(0.15);
6049 gPad->SetBottomMargin(0.2);
6050 //gPad->SetTopMargin(0.01);
6051 gPad->SetRightMargin(0.01);
6053 hist1 = (TH1*) firstFile->Get(Form("dphi_%d_%d_%d%s", i, j, centralityID, dist));
6054 hist2 = (TH1*) secondFile->Get(Form("dphi_%d_%d_%d%s", i, j, centralityID, dist));
6058 hist1->SetLineColor(1);
6059 hist2->SetLineColor(2);
6061 hist1->DrawCopy()->GetYaxis()->SetRangeUser(hist1->GetMinimum(), hist1->GetMaximum() * 1.2);
6062 hist2->DrawCopy("SAME");
6064 if (strlen(dist) == 0)
6065 Printf("chi2 test: %f", hist1->Chi2Test(hist2, "UU NORM CHI2/NDF"));
6067 //DrawRatio(hist1, hist2, hist1->GetTitle());
6073 TH1* MACHCone(const char* fileName, Int_t centrality, const char* drawingOption, Bool_t plotContributions, Int_t twoD, TF1** flowFuncP = 0)
6077 TFile::Open("machcone_input.root");
6082 hist = (TH1*) gFile->Get("dphi_0_0_0");
6086 hist = (TH1*) gFile->Get("dphi_1_1_0");
6090 hist = (TH1*) gFile->Get("dphi_0_0_2");
6094 hist = (TH1*) gFile->Get("dphi_1_1_2");
6102 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
6103 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
6105 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
6106 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
6107 // Float_t assocPtArr[] = { 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
6109 Int_t i = centrality % 2;
6114 gpTMin = assocPtArr[i] + 0.01;
6115 gpTMax = assocPtArr[i+1] - 0.01;
6117 Int_t centralityBegin = 0;
6118 Int_t centralityEnd = 1;
6120 if (centrality >= 2)
6122 centralityBegin = 30;
6127 SetupRanges(hMixed);
6136 Bool_t scaleToPairs = 1;
6138 GetDistAndFlow(h, hMixed, &hist, 0, step, centralityBegin, centralityEnd, leadingPtArr[j] + 0.01, leadingPtArr[j+1] - 0.01, twoD, kTRUE, vn, scaleToPairs);
6139 if (scaleToPairs && twoD == 11)
6142 Printf("%f %f %f", vn[2], vn[3], vn[4]);
6144 // mirror delta phi to improve stats
6147 for (Int_t bin=1; bin<=hist->GetNbinsX(); bin++)
6149 if (hist->GetBinCenter(bin) < 0 || hist->GetBinCenter(bin) > TMath::Pi())
6151 if (hist->GetBinCenter(bin) < 0)
6152 Int_t bin2 = hist->FindBin(-1.0 * hist->GetBinCenter(bin));
6154 Int_t bin2 = hist->FindBin(TMath::TwoPi() - hist->GetBinCenter(bin));
6156 Float_t combValue = hist->GetBinContent(bin) / hist->GetBinError(bin) / hist->GetBinError(bin) + hist->GetBinContent(bin2) / hist->GetBinError(bin2) / hist->GetBinError(bin2);
6158 Float_t weight = 1. / hist->GetBinError(bin) / hist->GetBinError(bin) + 1. / hist->GetBinError(bin2) / hist->GetBinError(bin2);
6159 combValue /= weight;
6161 Float_t combError = TMath::Sqrt(1.0 / weight);
6163 hist->SetBinContent(bin2, combValue);
6164 hist->SetBinError(bin2, combError);
6166 hist->SetBinContent(bin, combValue);
6167 hist->SetBinError(bin, combError);
6169 Printf("%d %d %f %f", bin, bin2, combValue, combError);
6175 TString str(hist->GetTitle());
6176 str.ReplaceAll(" - ", "#");
6177 tokens = str.Tokenize("#");
6180 hist->SetLineColor(1);
6181 hist->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
6182 hist->SetXTitle("#Delta#phi (rad.)");
6183 hist = (TH1*) hist->Clone();
6187 hist = hist->DrawCopy(drawingOption);
6189 for (Int_t i=0; i<tokens->GetEntries()-1; i++)
6191 if (centrality == 1)
6192 latex = new TLatex(0.6, 0.9 - i*0.05 - gPad->GetTopMargin(), tokens->At(i)->GetName());
6194 latex = new TLatex(0.6, 0.12 - i*0.05, tokens->At(i)->GetName());
6197 latex->SetTextSize(0.04);
6201 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());
6202 //flowFunc->SetLineWidth(1);
6203 flowFunc->SetLineColor(2);
6204 flowFunc->SetLineStyle(2);
6205 for (Int_t i=0; i<3; i++)
6206 flowFunc->FixParameter(i+1, vn[i+1]);
6207 //flowFunc->SetParameter(0, 84.95); flowFunc->DrawClone("SAME");
6209 //flowFunc->SetParameter(0, 85.4); flowFunc->DrawClone("SAME");
6210 //flowFunc->SetParameter(0, 85.6); flowFunc->DrawClone("SAME");
6212 // hist->Fit(flowFunc, "", "SAME", 1.8, 4.5);
6213 hist->Fit(flowFunc, "N", "", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
6214 hist->GetYaxis()->SetRangeUser(hist->GetMinimum() * 0.95, hist->GetMaximum() * 1.05);
6215 flowFunc->SetRange(-0.5 * TMath::Pi(), 1.5 * TMath::Pi());
6216 flowFunc->Draw("SAME");
6219 *flowFuncP = flowFunc;
6221 //hist->GetYaxis()->SetRangeUser(84, 89);
6222 //flowFunc->SetParameter(4, 1);
6226 for (Int_t bin=hist->FindBin(1.8); bin<=hist->FindBin(4.5); bin++)
6228 chi2 += TMath::Power((hist->GetBinContent(bin) - flowFunc->Eval(hist->GetBinCenter(bin))) / hist->GetBinError(bin), 2);
6230 //Printf("%f", TMath::Power((hist->GetBinContent(bin) - flowFunc->Eval(hist->GetBinCenter(bin))) / hist->GetBinError(bin), 2));
6235 Printf("chi2/ndf = %f", chi2);
6237 if (!plotContributions)
6240 for (Int_t n=1; n<=4; n++)
6242 flowFuncPart = new TF1("flowFuncPart", "[0] * (1+2*[1]*cos([2]*x))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
6243 flowFuncPart->SetParameters(flowFunc->GetParameter(0), vn[n-1], n);
6244 flowFuncPart->SetLineWidth(1);
6245 flowFuncPart->SetLineStyle(n);
6246 flowFuncPart->Draw("SAME");
6252 void MACHConeAll(const char* fileName)
6258 c = new TCanvas("c", "c", 300, 800);
6260 c->SetLeftMargin(0);
6261 c->SetRightMargin(0);
6262 c->SetBottomMargin(0);
6263 c->Divide(1, 2, 0, 0);
6265 Float_t rangesMin[] = { 136.1, 17.45, 18, 2.4 };
6266 Float_t rangesMax[] = { 139.4, 18.95, 23.5, 3.6 };
6268 for (Int_t i=0; i<2; i++)
6272 gPad->SetRightMargin(0.05);
6273 gPad->SetLeftMargin(0.20);
6274 gPad->SetTopMargin(0.15);
6275 gPad->SetBottomMargin(0.15);
6279 gPad->SetBottomMargin(0.01);
6283 gPad->SetTopMargin(0.01);
6284 gPad->SetBottomMargin(0.7);
6293 // hist = MACHCone(fileName, i, "", kTRUE, 0, &flowFunc);
6294 hist = (TH1*) MACHCone(fileName, i, 0, kFALSE, 0)->Clone("hist");
6295 hist->GetYaxis()->SetRangeUser(rangesMin[i], rangesMax[i]);
6296 hist->GetYaxis()->SetTitleOffset(1.7);
6302 // hist2 = MACHCone(fileName, i, 0, kFALSE, 11);
6303 hist2 = MACHCone(fileName, i, "SAME", kTRUE, 11, &flowFunc);
6304 //hist2->GetYaxis()->SetRangeUser(rangesMin[i], rangesMax[i]);
6306 hist2->SetLineColor(4);
6307 //hist2->Draw("SAME");
6310 // sample flowFunc with same binning
6311 flowFuncHist = (TH1*) hist->Clone("flowFuncHist");
6312 flowFuncHist->Reset();
6314 for (Int_t i=1; i<=flowFuncHist->GetNbinsX(); i++)
6316 flowFuncHist->SetBinContent(i, flowFunc->Integral(flowFuncHist->GetXaxis()->GetBinLowEdge(i), flowFuncHist->GetXaxis()->GetBinUpEdge(i)));
6317 flowFuncHist->SetBinError(i, 0);
6322 flowFuncHist->Scale(1.0 / flowFuncHist->GetBinWidth(1));
6325 // flowFuncHist->Draw();
6326 // flowFunc->Draw("SAME");
6330 residuals = (TH1*) hist->Clone("res1");
6331 residuals->SetYTitle("Residuals");
6332 residuals->Divide(flowFuncHist);
6335 residuals->GetYaxis()->SetNdivisions(505);
6336 residuals->GetYaxis()->SetRangeUser(0.995, 1.005);
6338 residuals = (TH1*) hist2->Clone("res2");
6339 residuals->Divide(flowFuncHist);
6341 residuals->SetLineColor(4);
6342 residuals->Draw("SAME");
6348 legend = new TLegend(0.43, 0.66, 0.91, 0.82);
6349 legend->SetFillColor(0);
6350 legend->SetTextSize(0.034);
6351 legend->SetTextAlign(22);
6353 legend->SetHeader("Centrality 0-1%");
6354 legend->AddEntry(hist, "|#eta| < 0.8 & All #Delta#eta", "L");
6355 legend->AddEntry(hist2, "|#eta| < 0.8 & |#Delta#eta| > 0.8 (2x)", "L");
6361 c->SaveAs(Form("machcone_%d.png", 0));
6362 c->SaveAs(Form("machcone_%d.eps", 0));
6363 c->SaveAs(Form("machcone_%d.C", 0));
6368 MACHCone(3, "", kTRUE)->SetTitle("");
6371 hist1 = MACHCone(0, "", kFALSE);
6372 hist2 = MACHCone(1, "SAME", kFALSE);
6373 hist3 = MACHCone(2, "SAME", kFALSE);
6375 hist1->SetTitle("");
6376 hist1->GetYaxis()->SetRangeUser(1, 7);
6381 // Set style which will affect all plots.
6384 // gStyle->SetOptitle(0);
6385 // gStyle->SetOptStat(0);
6386 //gStyle->SetOptDate(1);
6387 // gStyle->SetPalette(8,0); // (1,0)
6388 gStyle->SetPalette(1); // (1,0)
6389 gStyle->SetDrawBorder(0);
6390 // gStyle->SetFillColor(0); // kills palete ???
6391 gStyle->SetCanvasColor(0);
6392 gStyle->SetPadColor(0);
6393 // gStyle->SetFillColor(0); // otherwize it affects Fill colors later
6394 gStyle->SetFrameFillColor(0);
6395 gStyle->SetCanvasBorderMode(0);
6396 gStyle->SetFrameLineWidth(2);
6397 // gStyle->SetFrameFillStyle(4000);
6398 gStyle->SetPadBorderMode(0);
6399 gStyle->SetPadTickX(1);
6400 gStyle->SetPadTickY(1);
6401 gStyle->SetPadBottomMargin(0.15);
6402 gStyle->SetPadLeftMargin(0.15);
6403 gStyle->SetHistLineWidth(2);
6404 gStyle->SetFuncWidth(2);
6405 gStyle->SetLineWidth(2);
6406 gStyle->SetLabelSize(0.05,"xyz");
6407 gStyle->SetLabelOffset(0.01,"y");
6408 gStyle->SetLabelColor(kBlack,"xyz");
6409 gStyle->SetTitleSize(0.06,"xyz");
6410 gStyle->SetTitleOffset(1.3,"y");
6411 gStyle->SetTitleFillColor(0);
6412 gStyle->SetLineWidth(2);
6413 gStyle->SetHistLineColor(1);
6414 gStyle->SetTextColor(1);
6415 gStyle->SetTitleTextColor(1);
6416 TGaxis::SetMaxDigits(4);
6417 gStyle->SetOptStat(0); // removes stat. box from all histos
6418 gROOT->ForceStyle();
6420 } // end of void SetFlowStyle()
6422 void PlotPtDistributionsSubtracted(const char* fileName1, Int_t centrBegin = 1, Int_t centrEnd = 6, Int_t fit = 0)
6426 Int_t nCentralityBins = 5;
6427 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
6429 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
6431 TCanvas* canvas = new TCanvas("Pt", "Pt", 1000, 1000);
6432 canvas->Divide(2, 2);
6434 TLegend* legend = new TLegend(0.3, 0.8, 0.99, 0.99);
6435 legend->SetFillColor(0);
6437 Int_t colors[] = { 1, 2, 4, 6, 3, 5 };
6438 Int_t markers[] = { 20, 21, 22, 23, 24, 25 };
6440 Double_t ptMin = 10.01;
6441 Double_t ptMax = 39.99;
6444 str.Form("%.1f < p_{T,trig} < %.1f", ptMin - 0.01, ptMax + 0.01);
6447 gPad->SetLeftMargin(0.15);
6448 gPad->SetBottomMargin(0.2);
6449 gPad->SetTopMargin(0.01);
6450 gPad->SetRightMargin(0.01);
6456 TH2F* dummy = new TH2F("dummy", "", 100, 1, 40, 100, 1e-5, 1e3);
6457 dummy->SetStats(kFALSE);
6458 dummy->SetXTitle("p_{T,assoc}");
6459 dummy->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
6460 dummy->GetYaxis()->SetTitleOffset(1);
6461 Prepare1DPlot(dummy);
6463 dummy->GetXaxis()->SetLabelSize(0.05);
6464 dummy->GetYaxis()->SetLabelSize(0.05);
6465 dummy->GetXaxis()->SetTitleSize(0.05);
6466 dummy->GetYaxis()->SetTitleSize(0.05);
6470 gPad->SetLeftMargin(0.15);
6471 gPad->SetBottomMargin(0.2);
6472 gPad->SetTopMargin(0.01);
6473 gPad->SetRightMargin(0.01);
6481 gPad->SetLeftMargin(0.15);
6482 gPad->SetBottomMargin(0.2);
6483 gPad->SetTopMargin(0.01);
6484 gPad->SetRightMargin(0.01);
6489 dummy = new TH2F("dummy2", "", 100, 1, 40, 100, 0, 100);
6490 dummy->SetStats(kFALSE);
6491 dummy->SetXTitle("p_{T,assoc}");
6492 dummy->SetYTitle("Ratio: Distribution / Inclusive");
6493 dummy->GetYaxis()->SetTitleOffset(1);
6494 Prepare1DPlot(dummy);
6495 dummy->GetXaxis()->SetLabelSize(0.05);
6496 dummy->GetYaxis()->SetLabelSize(0.05);
6497 dummy->GetXaxis()->SetTitleSize(0.05);
6498 dummy->GetYaxis()->SetTitleSize(0.05);
6502 gPad->SetLeftMargin(0.15);
6503 gPad->SetBottomMargin(0.2);
6504 gPad->SetTopMargin(0.01);
6505 gPad->SetRightMargin(0.01);
6512 // see GetAcceptanceScalingFactor
6513 Float_t scalingFactor = 0.328396; // 0.8
6514 //Float_t scalingFactor = 0.433268; // 0.7
6515 //Float_t scalingFactor = 0.895593; // 0.5 --> 1.6
6517 Float_t phiRange[] = { 0, TMath::Pi() / 2, TMath::Pi() };
6518 const char* phiLabels[] = { "Towards", "Transverse", "Away" };
6520 //Float_t phiSizeTowards = TMath::Pi() / 3;
6521 Float_t phiSizeTowards = 0.75;
6522 //Float_t etaLimit = 0.5;
6523 Float_t etaLimit = 0.8;
6525 towardsCentralEta = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, -etaLimit + 0.01, etaLimit - 0.01);
6526 towardsSideEta1 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, -1.59, -etaLimit - 0.01);
6527 TH1* towardsSideEta2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, etaLimit + 0.01, 1.59);
6528 towardsSideEta1->Add(towardsSideEta2); // TODO can be done smarter? what about the errors?
6530 Prepare1DPlot(towardsSideEta1);
6531 Prepare1DPlot(towardsCentralEta);
6533 towardsCentralEta->SetLineColor(colors[0]);
6534 towardsSideEta1->SetLineColor(colors[3]);
6535 //towardsSideEta1->SetLineStyle(2);
6537 legend->AddEntry(towardsCentralEta->Clone(), Form("Jet, %s: |#Delta#eta| < 0.8, #phi ~ %.1f", phiLabels[0], phiRange[0]));
6538 legend->AddEntry(towardsSideEta1->Clone(), Form("Ridge, %s: 0.8 < |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[0], phiRange[0]));
6540 // TODO update when data with new phi binning is available
6541 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);
6543 transverse2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, -0.5 * TMath::Pi(), -TMath::Pi() / 3, -1.59, 1.59, kTRUE);
6544 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);
6545 transverse->Add(transverse2);
6546 transverse->Add(transverse3);
6547 transverse->Scale(1.0 / (2.0 / 3 * TMath::Pi()));
6550 //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);
6551 //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);
6552 //transverseSideEta1->Add(transverseSideEta2); // TODO can be done smarter? what about the errors?
6554 transverse->SetLineColor(colors[2]);
6555 //transverseSideEta1->SetLineColor(colors[2]);
6556 //transverseSideEta1->SetLineStyle(2);
6558 Prepare1DPlot(transverse);
6559 //Prepare1DPlot(transverseSideEta1);
6560 legend->AddEntry(transverse->Clone(), Form("%s: |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[1], phiRange[1]));
6561 //legend->AddEntry(transverseSideEta1->Clone(), Form("%s: 0.8 < |#Delta #eta| < 1.6, #phi ~ %.1f", phiLabels[1], phiRange[1]));
6563 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);
6566 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);
6567 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);
6568 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);
6572 away->SetLineColor(colors[1]);
6573 //away3->SetLineColor(colors[1]);
6574 //away3->SetLineStyle(2);
6576 Prepare1DPlot(away);
6577 legend->AddEntry(away->Clone(), Form("%s: |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[2], phiRange[2]));
6579 //inclusive = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), -1.59, 1.59);
6582 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1)->SetRange(centrBegin, centrEnd);
6583 inclusive = h->GetUEHist(2)->GetEventHist()->ShowProjection(0, 6);
6584 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1)->SetRange(0, -1);
6587 axis = h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1);
6589 inclusiveTmp = h->GetCorrelationpT()->ProjectionY("inclusiveTmp", h->GetCorrelationpT()->GetXaxis()->FindBin(axis->GetBinLowEdge(centrBegin) + 0.01), h->GetCorrelationpT()->GetXaxis()->FindBin(axis->GetBinUpEdge(centrEnd) - 0.01));
6591 //rebin to match other histograms
6592 //inclusive2 = inclusive->Rebin(away->GetNbinsX(), "inclusive2", away->GetXaxis()->GetXbins()->GetArray());
6594 // manually, as usual the ROOT function makes a SEGV
6595 inclusive = (TH1*) away->Clone("inclusive");
6598 for (Int_t bin=1; bin<=inclusiveTmp->GetNbinsX(); bin++)
6599 inclusive->Fill(inclusiveTmp->GetBinCenter(bin), inclusiveTmp->GetBinContent(bin));
6601 for (Int_t bin=1; bin<=inclusive->GetNbinsX(); bin++)
6602 inclusive->SetBinError(bin, TMath::Sqrt(inclusive->GetBinContent(bin)));
6604 // normalization: events, phase space
6605 inclusive->Scale(1.0 / h->GetCentralityDistribution()->Integral(centrBegin, centrEnd));
6606 inclusive->Scale(1.0 / (TMath::TwoPi() * 0.8 * 2));
6609 for (Int_t i=1; i<=inclusive->GetNbinsX(); i++)
6611 inclusive->SetBinContent(i, inclusive->GetBinContent(i) / inclusive->GetXaxis()->GetBinWidth(i));
6612 inclusive->SetBinError (i, inclusive->GetBinError(i) / inclusive->GetXaxis()->GetBinWidth(i));
6615 Prepare1DPlot(inclusive);
6616 inclusive->SetLineColor(colors[4]);
6617 legend->AddEntry(inclusive->Clone(), "Inclusive");
6619 //Prepare1DPlot(away3);
6620 //legend->AddEntry(away3->Clone(), Form("%s: 0.8 < |#Delta #eta| < 1.6, #phi ~ %.1f", phiLabels[2], phiRange[2]));
6622 // scale for acceptance to match acceptance of towardsCentralEta
6623 towardsSideEta1->Scale(1.0 / scalingFactor); // contains only "side-eta"
6624 transverse->Scale(1.0 / (1.0 + scalingFactor)); // full eta
6625 away->Scale(1.0 / (1.0 + scalingFactor)); // full eta
6626 inclusive->Scale(1.0 / (1.0 + scalingFactor)); // full eta (phi scaling implicit)
6629 towardsCentralEtaClone = towardsCentralEta->DrawCopy("SAME");
6630 towardsSideEta1Clone = towardsSideEta1->DrawCopy("SAME");
6631 transverseClone = transverse->DrawCopy("SAME");
6632 //transverseSideEta1->DrawCopy("SAME");
6633 awayClone = away->DrawCopy("SAME");
6634 inclusiveClone = inclusive->DrawCopy("SAME");
6635 //inclusive2->DrawCopy("SAME");
6636 //away3->DrawCopy("SAME");
6640 towardsCentralEtaR = (TH1*) towardsCentralEta->Clone("towardsCentralEtaR");
6641 towardsSideEta1R = (TH1*) towardsSideEta1->Clone("towardsSideEta1R");
6642 transverseR = (TH1*) transverse->Clone("transverseR");
6643 awayR = (TH1*) away->Clone("awayR");
6645 towardsCentralEtaR->Divide(inclusive);
6646 towardsSideEta1R->Divide(inclusive);
6647 transverseR->Divide(inclusive);
6648 awayR->Divide(inclusive);
6650 towardsCentralEtaR->DrawCopy("SAME");
6651 towardsSideEta1R->DrawCopy("SAME");
6652 transverseR->DrawCopy("SAME");
6653 awayR->DrawCopy("SAME");
6659 awayClone->Fit("expo", "", "SAME", 1.1, 2.9);
6660 awayClone->GetFunction("expo")->SetRange(1, 10);
6667 func = new TF1("func", "[0] * x**[1]");
6668 func->SetParameters(1, 1);
6670 Float_t limitLow = 2.1;
6671 Float_t limitHigh = 4.9;
6673 func2 = (TF1*) func->Clone();
6674 towardsCentralEtaClone->Fit(func2, "", "SAME", limitLow, limitHigh);
6675 towardsCentralEtaClone->GetFunction("func")->SetRange(1, 10);
6676 towardsCentralEtaClone->GetFunction("func")->SetLineColor(towardsCentralEtaClone->GetLineColor());
6678 func2 = (TF1*) func->Clone();
6679 towardsSideEta1Clone->Fit(func2, "", "SAME", limitLow, limitHigh);
6680 towardsSideEta1Clone->GetFunction("func")->SetRange(1, 10);
6681 towardsSideEta1Clone->GetFunction("func")->SetLineColor(towardsSideEta1Clone->GetLineColor());
6683 func2 = (TF1*) func->Clone();
6684 transverseClone->Fit(func2, "", "SAME", limitLow, limitHigh);
6685 transverseClone->GetFunction("func")->SetRange(1, 10);
6686 transverseClone->GetFunction("func")->SetLineColor(transverseClone->GetLineColor());
6688 func2 = (TF1*) func->Clone();
6689 awayClone->Fit(func2, "", "SAME", limitLow, limitHigh);
6690 awayClone->GetFunction("func")->SetRange(1, 10);
6691 awayClone->GetFunction("func")->SetLineColor(awayClone->GetLineColor());
6693 func2 = (TF1*) func->Clone();
6694 inclusiveClone->Fit(func2, "", "SAME", limitLow, limitHigh);
6695 inclusiveClone->GetFunction("func")->SetRange(1, 10);
6696 inclusiveClone->GetFunction("func")->SetLineColor(inclusiveClone->GetLineColor());
6699 // subtract transverse part
6700 away->Add(transverse, -1);
6701 //away3->Add(transverseSideEta1, -1);
6702 towardsCentralEta->Add(transverse, -1);
6703 towardsSideEta1->Add(transverse, -1);
6704 //inclusive->Add(transverse, -1);
6707 towardsCentralEta->DrawCopy("SAME");
6708 towardsSideEta1->DrawCopy("SAME");
6709 away->DrawCopy("SAME");
6710 inclusive->DrawCopy("SAME");
6711 //away3->DrawCopy("SAME");
6715 towardsCentralEtaR = (TH1*) towardsCentralEta->Clone("towardsCentralEtaR2");
6716 towardsSideEta1R = (TH1*) towardsSideEta1->Clone("towardsSideEta1R2");
6717 awayR = (TH1*) away->Clone("awayR2");
6719 towardsCentralEtaR->Divide(inclusive);
6720 towardsSideEta1R->Divide(inclusive);
6721 awayR->Divide(inclusive);
6723 towardsCentralEtaR->DrawCopy("SAME");
6724 towardsSideEta1R->DrawCopy("SAME");
6725 awayR->DrawCopy("SAME");
6731 away->Fit("expo", "", "SAME", 1.1, 2.9);
6732 away->GetFunction("expo")->SetRange(1, 10);
6739 func = new TF1("func", "[0] * x**[1]");
6740 func->SetParameters(1, 1);
6742 func2 = (TF1*) func->Clone();
6743 towardsCentralEta->Fit(func2, "", "SAME", limitLow, limitHigh);
6744 func2->SetRange(1, 10);
6746 func2 = (TF1*) func->Clone();
6747 towardsSideEta1->Fit(func2, "", "SAME", limitLow, limitHigh);
6748 func2->SetRange(1, 10);
6750 func2 = (TF1*) func->Clone();
6751 away->Fit(func2, "", "SAME", limitLow, limitHigh);
6752 func2->SetRange(1, 10);
6754 func2 = (TF1*) func->Clone();
6755 inclusive->Fit(func2, "", "SAME", limitLow, limitHigh);
6756 func2->SetRange(1, 10);
6759 for (Int_t i=1; i<=2; i++)
6764 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
6765 latex = new TLatex(0.2, 0.3, str3);
6767 latex->SetTextSize(0.06);
6769 latex2 = new TLatex(0.55, 0.6, str);
6771 latex2->SetTextSize(0.06);
6780 void CombineDeltaPhiWithWeighting()
6784 // xsection: 11.879829, ntrials: 8132994.000000
6787 // xsection: 0.623421, ntrials: 2293420.000000
6790 // xsection: 0.043815, ntrials: 1314525.375000
6792 // TODO is merging only same event distribution at present
6797 const char* inputList[] = { "mergejob/LHC11a2a_110124.root", "mergejob/LHC11a2b_110131.root", "mergejob/LHC11a2c_110131.root" };
6799 Float_t xSections[] = { 11.879829 * 1e6 / 8132994, 0.623421 * 1e6 / 2293420, 0.043815 * 1e6 / 1314525 };
6800 xSections[2] /= xSections[0];
6801 xSections[1] /= xSections[0];
6802 xSections[0] /= xSections[0];
6804 AliUEHistograms* files[3];
6805 TList* finalList = 0;
6806 for (Int_t i=0; i<nInput; i++)
6808 files[i] = (AliUEHistograms*) GetUEHistogram(inputList[i], (i == 0) ? &finalList : 0);
6811 files[i]->Scale(xSections[i]);
6813 TList* list2 = new TList;
6814 list2->Add(files[i]);
6815 files[0]->Merge(list2);
6819 TFile* file3 = TFile::Open("out.root", "RECREATE");
6820 file3->mkdir("PWG4_PhiCorrelations");
6821 file3->cd("PWG4_PhiCorrelations");
6822 finalList->Write(0, TObject::kSingleKey);
6826 void NormalizeToBinWidth(TH1* hist)
6829 // normalizes a 1-d histogram to its bin width
6832 for (Int_t i=1; i<=hist->GetNbinsX(); ++i)
6834 hist->SetBinContent(i, hist->GetBinContent(i) / hist->GetBinWidth(i));
6835 hist->SetBinError(i, hist->GetBinError(i) / hist->GetBinWidth(i));
6839 void GetAcceptanceScalingFactor(const char* fileName1, Float_t eta1 = 0.8, Float_t eta2 = 1.6)
6843 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1, 0, kTRUE);
6844 h->SetPtRange(1.01, 39.99);
6847 mixed = ((TH2*)h->GetUEHist(2)->GetUEHist(6, 0, 1.01, 39.99, 0, 16, kTRUE))->ProjectionY();
6850 Float_t left = mixed->Integral(mixed->FindBin(-eta2 + 0.01), mixed->FindBin(-eta1 - 0.01));
6851 Float_t center = mixed->Integral(mixed->FindBin(-eta1 + 0.01), mixed->FindBin(eta1 - 0.01));
6852 Float_t right = mixed->Integral(mixed->FindBin(eta1 + 0.01), mixed->FindBin(eta2 - 0.01));
6854 Printf("%f %f %f", left, center, right);
6855 Printf("%f", (left + right) / center);
6858 void TrackingEfficiencyCentralityDependence(const char* fileName, Int_t step1 = 2, Int_t step2 = 4)
6860 Int_t nCentralityBins = 3;
6861 Float_t centralityBins[] = { 0, 20, 40, 90 };
6863 Int_t colors[] = { 1, 2, 4, 6 };
6867 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
6870 dummy = new TH2F("dummy", ";p_{T};tracking efficiency", 100, 0, 20, 100, 0.7, 1.3);
6874 legend = new TLegend(0.13, 0.67, 0.31, 0.87);
6875 legend->SetTextSize(0.04);
6876 legend->SetFillColor(0);
6878 for (Int_t i=0; i<nCentralityBins; i++)
6880 eventHist = h->GetUEHist(2)->GetEventHist();
6882 eventHist->GetGrid(step1)->SetRangeUser(1, centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
6883 eventHist->GetGrid(step2)->SetRangeUser(1, centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
6885 TH1* hist1 = eventHist->ShowProjection(0, step1);
6886 TH1* hist2 = eventHist->ShowProjection(0, step2);
6888 hist2->Divide(hist1);
6890 hist2->SetLineColor(colors[i]);
6891 hist2->GetYaxis()->SetTitle("tracking efficiency");
6892 hist2->Draw("SAME");
6894 legend->AddEntry(hist2, Form("%.0f-%.0f%%", centralityBins[i], centralityBins[i+1]));
6901 TGraphErrors* ReadHepdata(const char* fileName, Bool_t errorsAreAdded = kFALSE, Int_t skipYErrors = 0, Int_t skipXerrors = 1)
6903 // expected format: x [x2] y [ye] [ye2] [xe]
6905 // skipYErrors: 0 --> ye present
6906 // 1 --> no errors ye
6907 // 2 --> y and ye are lower and upper error, i.e. y' = (y + ye) / 2 and ye = (ye - y) / 2
6908 // 3 --> ye and ye2 are stat and syst error, will be added in quadrature
6910 // skipXerrors: 0 --> xe present
6911 // 1 --> no errors xe
6912 // 2 --> x2 present, xe not present and is calculated from x2 - x
6914 ifstream fin(fileName);
6916 graph = new TGraphErrors(0);
6923 if (fin.peek() == '#')
6925 fin.getline(buffer, 2000);
6937 if (skipXerrors == 2)
6940 xe = (x2 - x + 1) / 2;
6941 x = x + (x2 - x) / 2;
6949 if (skipYErrors == 0)
6956 else if (skipYErrors == 2)
6963 Double_t newy = (y + ye) / 2;
6967 else if (skipYErrors == 3)
6979 ye = TMath::Sqrt(ye*ye + ye2*ye2);
6982 if (skipXerrors == 0)
6990 //Printf("%f %f %f %f", x, y, xe, ye);
6995 graph->SetPoint(graph->GetN(), x, y);
6996 graph->SetPointError(graph->GetN()-1, xe, ye);
7000 // read rest until end of line...
7001 fin.getline(buffer, 2000);
7005 Printf("%s: %f", fileName, sum);
7010 void EvaluateParticleEfficiency(const char* fileName)
7012 Int_t centralityBegin = 1;
7013 Int_t centralityEnd = 15;
7026 Float_t ptTriggerBegin = 4.01;
7027 Float_t ptTriggerEnd = 19.99;
7033 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7034 AliUEHist* cont = h->GetUEHist(2);
7036 cont->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
7037 cont->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
7039 Int_t stepEff1 = step1 - (Int_t) AliUEHist::kCFStepAnaTopology;
7042 Int_t stepEff2 = step2 - (Int_t) AliUEHist::kCFStepAnaTopology;
7046 cont->GetTrackHistEfficiency()->GetGrid(stepEff1)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
7047 cont->GetTrackHistEfficiency()->GetGrid(stepEff2)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
7049 TH1* triggerParticle = cont->GetEventHist()->Project(step2, 0);
7050 triggerParticle->Divide(cont->GetEventHist()->Project(step1, 0));
7052 TH1* singleParticle = cont->GetTrackHistEfficiency()->Project(stepEff2, 1);
7053 singleParticle->Divide(cont->GetTrackHistEfficiency()->Project(stepEff1, 1));
7055 //singleParticle = singleParticle->Rebin(triggerParticle->GetNbinsX(), "singleRebin", triggerParticle->GetXaxis()->GetXbins()->GetArray());
7057 TGraphErrors* effectiveEffect = new TGraphErrors;
7058 TGraphErrors* triggerCorrelatedEffect = new TGraphErrors;
7059 TGraphErrors* afterBaseLine = new TGraphErrors;
7060 TGraphErrors* triggerCorrelatedEffect2D = new TGraphErrors;
7062 //TVirtualFitter::SetDefaultFitter("Linear");
7064 for (Int_t bin=3; bin<=triggerParticle->GetNbinsX(); bin++)
7066 if (triggerParticle->GetBinCenter(bin) > 10)
7069 cont->SetPtRange(triggerParticle->GetXaxis()->GetBinLowEdge(bin) + 0.01, triggerParticle->GetXaxis()->GetBinUpEdge(bin) - 0.01);
7071 TH1* hist1 = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd);
7072 TH1* hist2 = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd);
7074 // TODO the uncertainties on the ratios should be properly calculated! (if that helps ;))
7075 clone = (TH1*) hist2->Clone("clone");
7076 clone->Divide(hist1);
7078 //func = new TF1("func", "[0]", -10, 10);
7080 if ((Int_t) clone->Fit("pol0", "0", "", -10, 10) == 0)
7082 func = clone->GetFunction("pol0");
7083 effectiveEffect->SetPoint(effectiveEffect->GetN(), triggerParticle->GetBinCenter(bin) - 0.2, func->GetParameter(0));
7084 effectiveEffect->SetPointError(effectiveEffect->GetN()-1, 0, func->GetParError(0));
7089 clone->GetYaxis()->SetRangeUser(0.9, 1.3);
7091 func->DrawClone("SAME");
7095 if ((Int_t) clone->Fit("pol0", "0", "", -0.3, 0.3) == 0)
7097 func = clone->GetFunction("pol0");
7098 triggerCorrelatedEffect->SetPoint(triggerCorrelatedEffect->GetN(), triggerParticle->GetBinCenter(bin) - 0.1, func->GetParameter(0));
7099 triggerCorrelatedEffect->SetPointError(triggerCorrelatedEffect->GetN()-1, 0, func->GetParError(0));
7103 func->SetLineColor(2);
7104 func->DrawClone("SAME");
7108 if ((Int_t) hist2->Fit("pol0", "0", "", 1, 2) == 0)
7110 func = hist2->GetFunction("pol0");
7111 func->SetRange(-10, 10);
7112 hist2->Add(func, -1);
7114 if ((Int_t) hist1->Fit("pol0", "0", "", 1, 2) == 0)
7116 func = hist1->GetFunction("pol0");
7117 func->SetRange(-10, 10);
7118 hist1->Add(func, -1);
7120 //new TCanvas; hist1->DrawCopy();
7122 hist2->Divide(hist1);
7124 if ((Int_t) hist2->Fit("pol0", "0", "", -0.3, 0.3) == 0)
7126 func = hist2->GetFunction("pol0");
7127 afterBaseLine->SetPoint(afterBaseLine->GetN(), triggerParticle->GetBinCenter(bin) + 0.2, func->GetParameter(0));
7128 afterBaseLine->SetPointError(afterBaseLine->GetN()-1, 0, func->GetParError(0));
7133 hist2->GetYaxis()->SetRangeUser(0.9, 1.3);
7135 func->SetLineColor(4);
7136 func->DrawClone("SAME");
7143 TH2* hist1_2D = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
7144 TH2* hist2_2D = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
7146 //((TH2*)hist1)->Rebin2D(2, 2); ((TH2*)hist2)->Rebin2D(2, 2);
7148 hist2_2D->Divide(hist1_2D);
7153 hist2_2D->Draw("COLZ");
7156 //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));
7159 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);
7161 integral /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
7162 integral /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
7164 error /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
7165 error /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
7167 triggerCorrelatedEffect2D->SetPoint(triggerCorrelatedEffect2D->GetN(), triggerParticle->GetBinCenter(bin) + 0.1, integral);
7168 triggerCorrelatedEffect2D->SetPointError(triggerCorrelatedEffect2D->GetN()-1, 0, error);
7175 triggerParticle->Draw();
7176 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
7178 singleParticle->SetLineColor(2);
7179 //singleParticle->Draw("SAME");
7181 effectiveEffect->SetMarkerStyle(24);
7182 effectiveEffect->Draw("PSAME");
7184 triggerCorrelatedEffect->SetMarkerStyle(25);
7185 triggerCorrelatedEffect->SetMarkerColor(2);
7186 triggerCorrelatedEffect->SetLineColor(2);
7187 triggerCorrelatedEffect->Draw("PSAME");
7189 triggerCorrelatedEffect2D->SetMarkerStyle(27);
7190 triggerCorrelatedEffect2D->SetMarkerColor(3);
7191 triggerCorrelatedEffect2D->SetLineColor(3);
7192 triggerCorrelatedEffect2D->Draw("PSAME");
7194 afterBaseLine->SetMarkerStyle(26);
7195 afterBaseLine->SetMarkerColor(4);
7196 afterBaseLine->SetLineColor(4);
7197 afterBaseLine->Draw("PSAME");
7199 legend = new TLegend(0.66, 0.15, 0.88, 0.38);
7200 legend->SetFillColor(0);
7201 legend->SetTextSize(0.04);
7202 legend->AddEntry(triggerParticle, "trigger", "L");
7203 //legend->AddEntry(singleParticle, "single", "L");
7204 legend->AddEntry(effectiveEffect, "effective", "P");
7205 legend->AddEntry(triggerCorrelatedEffect, "at 0", "P");
7206 legend->AddEntry(triggerCorrelatedEffect2D, "at 0 (2d)", "P");
7207 legend->AddEntry(afterBaseLine, "baseline", "P");
7211 void EvaluateParticleEfficiency2D(const char* fileName)
7213 Int_t centralityBegin = 1;
7214 Int_t centralityEnd = 15;
7231 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7232 AliUEHist* cont = h->GetUEHist(2);
7234 cont->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
7235 cont->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
7237 Int_t stepEff1 = step1 - (Int_t) AliUEHist::kCFStepAnaTopology;
7240 Int_t stepEff2 = step2 - (Int_t) AliUEHist::kCFStepAnaTopology;
7244 cont->GetTrackHistEfficiency()->GetGrid(stepEff1)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
7245 cont->GetTrackHistEfficiency()->GetGrid(stepEff2)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
7247 TH1* triggerParticle = cont->GetEventHist()->Project(step2, 0);
7248 triggerParticle->Divide(cont->GetEventHist()->Project(step1, 0));
7250 TH1* singleParticle = cont->GetTrackHistEfficiency()->Project(stepEff2, 1);
7251 singleParticle->Divide(cont->GetTrackHistEfficiency()->Project(stepEff1, 1));
7253 cont->GetTrackHist(0)->GetGrid(step1)->SetRangeUser(0, -0.01, 0.01); // delta eta
7254 cont->GetTrackHist(0)->GetGrid(step1)->SetRangeUser(4, -0.01, 0.01); // delta phi
7255 TH2* tracksStep1 = (TH2*) cont->GetTrackHist(0)->Project(step1, 1, 2);
7257 cont->GetTrackHist(0)->GetGrid(step2)->SetRangeUser(0, -0.01, 0.01); // delta eta
7258 cont->GetTrackHist(0)->GetGrid(step2)->SetRangeUser(4, -0.01, 0.01); // delta phi
7259 TH2* tracksStep2 = (TH2*) cont->GetTrackHist(0)->Project(step2, 1, 2);
7261 tracksStep2->Divide(tracksStep1);
7263 TH1* triggersStep1 = cont->GetEventHist()->Project(step1, 0);
7264 TH1* triggersStep2 = cont->GetEventHist()->Project(step2, 0);
7266 for (Int_t x=1; x<=tracksStep2->GetNbinsX(); x++)
7267 for (Int_t y=1; y<=tracksStep2->GetNbinsY(); y++)
7268 if (singleParticle->GetBinContent(x) > 0)
7269 tracksStep2->SetBinContent(x, y, tracksStep2->GetBinContent(x, y) / triggersStep2->GetBinContent(y) * triggersStep1->GetBinContent(y) / singleParticle->GetBinContent(x));
7271 tracksStep2->SetBinContent(x, y, 0);
7274 tracksStep2->Draw("COLZ");
7276 TGraphErrors** triggerCorrelatedEffect2D = new TGraphErrors*[triggerParticle->GetNbinsX()+1];
7277 TGraphErrors** triggerCorrelatedEffect2DSub = new TGraphErrors*[triggerParticle->GetNbinsX()+1];
7279 for (Int_t bin1=0; bin1<=triggerParticle->GetNbinsX(); bin1++)
7281 triggerCorrelatedEffect2D[bin1] = 0;
7282 triggerCorrelatedEffect2DSub[bin1] = 0;
7285 for (Int_t bin1=5; bin1<=triggerParticle->GetNbinsX(); bin1++)
7287 if (triggerParticle->GetBinCenter(bin1) > 10)
7290 Float_t ptTriggerBegin = triggerParticle->GetXaxis()->GetBinLowEdge(bin1) + 0.01;
7291 Float_t ptTriggerEnd = triggerParticle->GetXaxis()->GetBinUpEdge(bin1) - 0.01;
7293 for (Int_t bin2=3; bin2<=triggerParticle->GetNbinsX(); bin2++)
7295 if (triggerParticle->GetBinCenter(bin2) > 8)
7301 cont->SetPtRange(triggerParticle->GetXaxis()->GetBinLowEdge(bin2) + 0.01, triggerParticle->GetXaxis()->GetBinUpEdge(bin2) - 0.01);
7304 TH2* hist1_2D = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
7305 TH2* hist2_2D = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
7307 //((TH2*)hist1)->Rebin2D(2, 2); ((TH2*)hist2)->Rebin2D(2, 2);
7309 hist2_2D->Divide(hist1_2D);
7314 hist2_2D->Draw("COLZ");
7317 //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));
7320 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);
7322 integral /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
7323 integral /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
7325 error /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
7326 error /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
7331 if (!triggerCorrelatedEffect2D[bin1])
7332 triggerCorrelatedEffect2D[bin1] = new TGraphErrors;
7334 triggerCorrelatedEffect2D[bin1]->SetPoint(triggerCorrelatedEffect2D[bin1]->GetN(), triggerParticle->GetBinCenter(bin2) - 0.5 + 0.1 * bin1, integral);
7335 triggerCorrelatedEffect2D[bin1]->SetPointError(triggerCorrelatedEffect2D[bin1]->GetN()-1, 0, error);
7337 if (!triggerCorrelatedEffect2DSub[bin1])
7338 triggerCorrelatedEffect2DSub[bin1] = new TGraphErrors;
7340 triggerCorrelatedEffect2DSub[bin1]->SetPoint(triggerCorrelatedEffect2DSub[bin1]->GetN(), triggerParticle->GetBinCenter(bin2) - 0.5 + 0.1 * bin1, integral / triggerParticle->GetBinContent(bin2));
7341 triggerCorrelatedEffect2DSub[bin1]->SetPointError(triggerCorrelatedEffect2DSub[bin1]->GetN()-1, 0, error / triggerParticle->GetBinContent(bin2));
7352 triggerParticle->Draw();
7353 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
7355 legend = new TLegend(0.66, 0.15, 0.88, 0.38);
7356 legend->SetFillColor(0);
7357 legend->SetTextSize(0.04);
7358 legend->AddEntry(triggerParticle, "trigger", "L");
7363 for (Int_t bin1=3; bin1<=triggerParticle->GetNbinsX(); bin1++)
7364 if (triggerCorrelatedEffect2D[bin1])
7366 triggerCorrelatedEffect2D[bin1]->SetMarkerStyle(marker++);
7367 triggerCorrelatedEffect2D[bin1]->SetMarkerColor(color);
7368 triggerCorrelatedEffect2D[bin1]->SetLineColor(color++);
7369 triggerCorrelatedEffect2D[bin1]->Draw("PSAME");
7370 legend->AddEntry(triggerCorrelatedEffect2D[bin1], Form("pt %.2f", triggerParticle->GetBinCenter(bin1)), "P");
7376 triggerParticle->Draw();
7377 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
7382 for (Int_t bin1=3; bin1<=triggerParticle->GetNbinsX(); bin1++)
7383 if (triggerCorrelatedEffect2DSub[bin1])
7385 triggerCorrelatedEffect2DSub[bin1]->SetMarkerStyle(marker++);
7386 triggerCorrelatedEffect2DSub[bin1]->SetMarkerColor(color);
7387 triggerCorrelatedEffect2DSub[bin1]->SetLineColor(color++);
7388 triggerCorrelatedEffect2DSub[bin1]->Draw("PSAME");
7394 void DrawEventCount(const char* fileName)
7398 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7399 h->GetEventCount()->Draw("TEXT");
7402 void CompareDCADistributions(const char* fileName1, const char* fileName2)
7404 TFile::Open(fileName1);
7405 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
7406 prim = (TH2*) list->FindObject("fDCAPrimaries");
7407 sec = (TH2*) list->FindObject("fDCASecondaries");
7409 TFile::Open(fileName2);
7410 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
7411 all = (TH2*) list->FindObject("fDCAPrimaries");
7415 TH2* histList[] = { prim, sec, all };
7426 for (Int_t i=0; i<3; i++)
7428 hist = histList[i]->ProjectionX("proj", prim->GetYaxis()->FindBin(-zCut), prim->GetYaxis()->FindBin(zCut))->DrawCopy(i>0?"SAME":"");
7430 //hist = histList[i]->ProjectionY("proj", prim->GetXaxis()->FindBin(-zCut), prim->GetXaxis()->FindBin(zCut))->DrawCopy(i>0?"SAME":"");
7431 hist->SetLineColor(i+1);
7437 hist->Scale(1.0 / hist->Integral(hist->GetXaxis()->FindBin(-0.5), hist->GetXaxis()->FindBin(0.5)) * count);
7439 count += hist->Integral(hist->GetXaxis()->FindBin(-0.5), hist->GetXaxis()->FindBin(0.5));
7444 ratio = (TH1*) hist->Clone("ratio");
7445 ratio->Add(primProj, -1);
7447 /* for (Int_t i=hist->GetXaxis()->FindBin(-0.1); i<=hist->GetXaxis()->FindBin(0.1); i++)
7448 ratio->SetBinContent(i, 0);*/
7450 for (Int_t i=1; i<=hist->GetNbinsX(); i++)
7451 ratio->SetBinError(i, 0);
7453 ratio->SetLineColor(4);
7454 ratio->DrawCopy("SAME E");
7461 secProj = (TH1*) secProj->Clone();
7464 ratio->Divide(secProj);
7466 /* for (Int_t i=1; i<=hist->GetNbinsX(); i++)
7467 ratio->SetBinError(i, 0);*/
7469 ratio->Draw("HIST");
7470 ratio->GetYaxis()->SetRangeUser(0.7, 1.3);
7472 ratio->Fit("pol0", "0+", "", -5, -1);
7473 ratio->Fit("pol0", "0+", "", 1, 5);
7476 void TrackCuts_CompareParameters(const char* fileName1, const char* fileName2, const char* histName, const char* cutFolder = "cuts_quality_only")
7478 // plotWhich: 0 = only before
7482 // mirror: kTRUE --> project negative values on the positive side
7484 Int_t plotWhich = 0;
7485 Bool_t mirror = kFALSE;
7488 files[0] = TFile::Open(fileName1);
7489 files[1] = TFile::Open(fileName2);
7492 Int_t colors[] = { 1, 2, 3, 4, 5, 6 };
7494 TLegend* legend = new TLegend(0.7, 0.85, 0.93, 0.98);
7495 legend->SetTextSize(0.04);
7496 legend->SetFillColor(0);
7498 TCanvas* c1 = new TCanvas(histName, histName, 1200, 600);
7500 //TCanvas* c2 = new TCanvas("c2", "c2", 800, 600);
7501 //TCanvas* c3 = new TCanvas("c3", "c3", 800, 600);
7503 const char* folders2[] = { "before_cuts", "after_cuts" };
7504 const char* names[] = { "MC", "Data" };
7505 Bool_t first = kTRUE;
7506 for (Int_t j = ((plotWhich < 2) ? 0 : 1); j < ((plotWhich > 0) ? 2 : 1); j++)
7510 for (Int_t i = 0; i < 2; i++)
7512 Printf("%d %d", j, i);
7514 folder.Form("%s/%s/%s", cutFolder, folders2[j], histName);
7515 TH1* hist = (TH1*) files[i]->Get(folder);
7519 for (Int_t bin=1; bin<=hist->GetXaxis()->FindBin(-0.0001); bin++)
7521 Int_t newBin = hist->GetXaxis()->FindBin(-hist->GetXaxis()->GetBinCenter(bin));
7524 hist->Fill(-hist->GetXaxis()->GetBinCenter(bin), hist->GetBinContent(bin));
7525 hist->SetBinContent(bin, 0);
7530 legend->AddEntry(hist, Form("%s %s", names[i], (plotWhich == 1) ? folders2[j] : " "));
7533 hist->SetLineColor(colors[count]);
7534 hist->Scale(1.0 / hist->Integral());
7536 hist->DrawCopy((count == 0) ? "" : "SAME");
7540 case 0: base = hist; break;
7541 case 1: base2 = hist; break;
7548 ratio->Divide(base2);
7550 ratio->GetYaxis()->SetRangeUser(0, 2);
7553 ratio->DrawCopy((first) ? "" : "SAME");
7557 c1->cd(1)->SetLogy();
7558 c1->cd(1)->SetGridx();
7559 c1->cd(1)->SetGridy();
7562 c1->cd(2)->SetGridx();
7563 c1->cd(2)->SetGridy();
7565 c1->SaveAs(Form("%s.png", histName));
7568 void PlotQA(const char* fileName)
7572 if (!gGrid && TString(fileName).BeginsWith("alien://"))
7573 TGrid::Connect("alien://");
7575 TFile::Open(fileName);
7578 Int_t runNumber = 0;
7579 list = (TList*) gFile->Get("PhysSel");
7582 physSel = (AliPhysicsSelection*) list->FindObject("AliPhysicsSelection");
7583 // runNumber = physSel->GetCurrentRun();
7586 TString tmp(fileName);
7587 tmp.ReplaceAll("alien:///alice/cern.ch/user/j/jgrosseo/gridjob/dir_", "");
7588 tmp.ReplaceAll(".root", ".png");
7589 tmp.ReplaceAll("/", "-");
7591 title.Form("QA_%d_%s", runNumber, tmp.Data());
7592 c = new TCanvas(title, title, 1200, 800);
7596 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
7599 prim = (TH2*) list->FindObject("fDCAPrimaries");
7600 dcaxy = prim->ProjectionX("dcaxy", prim->GetYaxis()->FindBin(-3.2), prim->GetYaxis()->FindBin(3.2));
7601 dcaz = prim->ProjectionY("dcaz", prim->GetXaxis()->FindBin(-2.4), prim->GetXaxis()->FindBin(2.4));
7602 centrCorr = (TH2*) list->FindObject("fCentralityCorrelation");
7604 c->cd(1); dcaxy->Draw(); dcaz->SetLineColor(2); dcaz->Draw("SAME"); gPad->SetLogy();
7605 c->cd(6); centrCorr->Draw("COLZ"); gPad->SetLogz();
7607 cuts = (AliESDtrackCuts*) list->FindObject("cuts_quality_dca");
7610 cluster = cuts->GetNClustersTPC(1);
7611 c->cd(3); cluster->Draw();
7613 ptall = (TH1F*) cuts->GetPtHist(1)->Clone("ptall");
7614 if (ptall->Integral() > 0)
7615 ptall->Scale(1.0 / ptall->Integral());
7621 check_its = (AliESDtrackCuts*) list->FindObject("check_its");
7624 ptIts = (TH1F*) check_its->GetPtHist(1)->Clone("ptIts");
7625 if (ptIts->Integral() > 0)
7626 ptIts->Scale(1.0 / ptIts->Integral());
7630 global_cuts = (AliESDtrackCuts*) list->FindObject("global_cuts");
7633 ptItsAcc = (TH1*) global_cuts->GetPtHist(1)->Clone("ptItsAcc");
7634 if (ptItsAcc->Integral() > 0)
7635 ptItsAcc->Scale(1.0 / ptItsAcc->Integral());
7640 ptIts->SetLineColor(2);
7641 ptIts->Draw("SAME");
7646 ptItsAcc->SetLineColor(4);
7647 ptItsAcc->Draw("SAME");
7655 list = (TList*) gFile->Get("CentralityStat");
7656 TH1* centrQuality = 0;
7659 centrQuality = (TH1*) list->FindObject("fHOutQuality");
7661 c->cd(4); if (centrQuality) centrQuality->Draw();
7665 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7666 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->FillParent();
7667 centr = h->GetCentralityDistribution();
7668 NormalizeToBinWidth(centr);
7669 Int_t events = (Int_t) h->GetEventCount()->ProjectionX()->GetBinContent(3);
7671 h->SetPtRange(1.01, 3.99);
7672 dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, 4.01, 14.99, 1, 8);
7674 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
7675 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->FillParent();
7676 hMixed->SetPtRange(1.01, 3.99);
7677 dphi_corr_mixed = hMixed->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, 4.01, 14.99, 1, 8);
7679 if (runNumber != 0 && runNumber != h->GetRunNumber())
7680 AliFatal("Run numbers inconsistent");
7682 Printf("%d", h->GetRunNumber());
7684 runNumber = h->GetRunNumber();
7686 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");
7687 c->cd(5); centr->Draw("HIST");
7690 latex = new TLatex(0.15, 0.8, Form("%d events", events));
7691 latex->SetTextSize(0.075);
7696 h->GetEventCount()->Draw("TEXT");
7698 title.Form("QA_%d_%s", runNumber, tmp.Data());
7701 c->SaveAs(Form("qa/%s", c->GetTitle()));
7704 void CompareStepsOnePlot(const char* fileName, Int_t caseId)
7708 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7710 Int_t stepList[] = { 0, 2, 4, 5, 6 };
7711 Int_t stepListNames[] = { 0, 2, 3, 4, 5 };
7712 //const char* names[] = { "All", "PhysSel+Vertex", "Reco Primaries", "Reco "
7713 // //Int_t stepList[] = { 2, 4, 5, 6 };
7716 // TH1* hist1 = h->GetUEHist(2)->GetUEHist(0, 0, 6.01, 9.99, 6, 14);
7717 // TH1* hist2 = h->GetUEHist(2)->GetUEHist(0, 0, 6.01, 7.99, 6, 14);
7718 // TH1* hist3 = h->GetUEHist(2)->GetUEHist(0, 0, 8.01, 9.99, 6, 14);
7721 // hist2->SetLineColor(2);
7722 // hist2->Draw("SAME");
7723 // hist3->SetLineColor(4);
7724 // hist3->Draw("SAME");
7728 legend = new TLegend(0.65, 0.45, 0.85, 0.85);
7729 legend->SetTextSize(0.04);
7730 legend->SetFillColor(0);
7734 for (Int_t i=0; i<5; i++)
7736 //TH1* hist1 = h->GetUEHist(2)->GetEventHist()->Project(stepList[i], 0);
7738 /* h->GetUEHist(2)->GetTrackHist(0)->GetGrid(stepList[i])->GetGrid()->GetAxis(1)->SetRangeUser(1.01, 3.99);
7739 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(stepList[i])->GetGrid()->GetAxis(2)->SetRangeUser(4.01, 19.99);
7740 TH1* hist1 = h->GetUEHist(2)->GetTrackHist(0)->Project(stepList[i], 4);*/
7743 TH1* hist1 = h->GetUEHist(2)->GetUEHist(stepList[i], 0, 4.01, 19.99, 6, 14);
7744 else if (caseId == 1)
7745 TH1* hist1 = h->GetUEHist(2)->GetEventHist()->Project(stepList[i], 0);
7749 hist1->SetMarkerStyle(24+i);
7750 hist1->SetTitle("");
7752 hist1->DrawCopy((i==0)?"":"SAME");
7753 hist1->Fit("pol0", "0");
7754 //hist1->Fit("pol0");
7755 histList[i] = hist1;
7756 legend->AddEntry(hist1, Form("Step %d", stepListNames[i]), "P");
7762 legend = new TLegend(0.65, 0.45, 0.85, 0.85);
7763 legend->SetTextSize(0.04);
7764 legend->SetFillColor(0);
7766 for (Int_t i=1; i<5; i++)
7768 histList[i]->DrawCopy((i==1)?"":"SAME")->Divide(histList[i-1]);
7769 legend->AddEntry(hist1, Form("Step %d/%d", stepListNames[i], stepListNames[i-1]), "P");
7775 for (Int_t i=0; i<5; i++)
7777 hist1 = histList[i];
7778 func = new TF1("func", "[0]", -10, 10);
7779 hist1->Fit(func, "0", "", 1, 2);
7780 hist1->Add(func, -1);
7781 hist1->DrawCopy((i==0)?"":"SAME");
7787 for (Int_t i=1; i<5; i++)
7789 histList[i]->DrawCopy((i==1)?"":"SAME")->Divide(histList[i-1]);
7795 void PtShift(const char* fileName)
7799 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7804 ptHist3 = h->GetCorrelationpT()->ProjectionY();
7805 ptHist3->GetXaxis()->SetRangeUser(0, 20);
7809 func = new TF1("func", "[0]+[1]*x**[2]", 4, 20);
7810 func->SetParLimits(2, -10, -1);
7811 func->SetParameters(0, 1, -4);
7812 ptHist3->Fit(func, "", "", 4, 20);
7817 ptHist3Shifted = (TH1*) ptHist3->Clone("ptHist3Shifted");
7818 for (Int_t i=1; i<ptHist3Shifted->GetNbinsX(); i++)
7819 //ptHist3Shifted->SetBinContent(i, ptHist3Shifted->GetBinContent(i+3));
7820 ptHist3Shifted->SetBinContent(i, ptHist3Shifted->GetBinContent(1.1*i));
7824 ptHist3Shifted->SetLineColor(2);
7827 ptHist3Shifted->Rebin(2);
7829 ptHist3->DrawCopy();
7830 ptHist3Shifted->DrawCopy("SAME");
7833 ptHist3->Divide(ptHist3Shifted);
7836 //ptHist3->Rebin(2); ptHist3->Scale(1.0 / 2);
7842 void RAA(const char* fileName, const char* fileName2)
7848 for (Int_t j=0; j<2; j++)
7851 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7857 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName2);
7860 ptHist3 = h->GetCorrelationpT()->ProjectionY(Form("proj1_%d", j), 1, 5);
7861 ptHist3->GetXaxis()->SetRangeUser(0, 20);
7863 //h->GetCentralityDistribution()->Draw(); new TCanvas;
7865 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(4.99));
7866 Printf("%d", nEvents);
7867 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
7873 hist[0]->DrawCopy("");
7874 hist[1]->DrawCopy("SAME")->SetLineColor(2);
7878 hist[1]->Divide(hist[0]);
7879 hist[1]->DrawCopy();
7881 raa_central = ReadHepdata("raa_alice_central.txt", kFALSE, 3);
7882 raa_central->SetMarkerStyle(20);
7883 raa_central->Draw("PSAME");
7886 void PtComparison(const char* fileName, const char* fileName2 = 0)
7893 for (Int_t j=0; j<2; j++)
7896 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
7902 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName2);
7905 //new TCanvas; h->GetCorrelationpT()->Draw("COLZ");
7907 ptHist3 = h->GetCorrelationpT()->ProjectionY(Form("proj1_%d", j), 1, 5);
7908 ptHist3->GetXaxis()->SetRangeUser(0, 20);
7910 //h->GetCentralityDistribution()->Draw(); new TCanvas;
7912 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(4.99));
7913 Printf("%d", nEvents);
7914 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
7916 //ptHist3->Scale(1690);
7917 //ptHist3->Scale(1.0 / ptHist3->Integral(ptHist3->GetXaxis()->FindBin(1.01), ptHist3->GetNbinsX()) / 3 / 0.6);
7919 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
7920 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
7921 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
7923 //AliPWG0Helper::NormalizeToBinWidth(ptHist3);
7926 ptHist3->SetLineStyle(j+1);
7927 ptHist3->DrawCopy((j == 0) ? "HIST" : "HISTSAME")->SetLineColor(1);
7929 centralPt = (TH1*) ptHist3->Clone();;
7933 ptHist3 = h->GetCorrelationpT()->ProjectionY(Form("proj2_%d", j), 71, 80);
7934 ptHist3->GetXaxis()->SetRangeUser(0, 20);
7936 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(70.01), h->GetCentralityDistribution()->FindBin(79.99));
7937 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
7938 //ptHist3->Scale(10.0 / ptHist3->Integral(ptHist3->GetXaxis()->FindBin(1.01), ptHist3->GetNbinsX()) / 3 / 0.6);
7939 Printf("%d", nEvents);
7941 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
7942 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
7943 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
7946 ptHist3->SetLineStyle(j+1);
7947 ptHist3->DrawCopy("HISTSAME")->SetLineColor(2);
7949 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
7950 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
7952 // RemovePointsBelowX(dndpt_central, 1);
7953 // RemovePointsBelowX(dndpt_peripheral, 1);
7955 // NormalizeTo(dndpt_central, 1);
7956 // NormalizeTo(dndpt_peripheral, 10);
7958 dndpt_central->Draw("*SAME");
7959 dndpt_peripheral->SetLineColor(2);
7960 dndpt_peripheral->SetMarkerColor(2);
7961 dndpt_peripheral->Draw("*SAME");
7967 for (Int_t i=1; i<ptHist3->GetNbinsX(); i++)
7968 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / dndpt_peripheral->Eval(ptHist3->GetBinCenter(i)));
7970 for (Int_t i=1; i<centralPt->GetNbinsX(); i++)
7971 centralPt->SetBinContent(i, centralPt->GetBinContent(i) / dndpt_central->Eval(centralPt->GetBinCenter(i)));
7973 ptHist3->Rebin(2); ptHist3->Scale(0.5);
7974 centralPt->Rebin(2); centralPt->Scale(0.5);
7976 ptHist3->DrawCopy((j == 0) ? "" : "SAME")->SetLineColor(2);
7977 centralPt->DrawCopy("SAME")->SetLineColor(1);
7982 ReadYields("preliminaries/yields_110303.root");
7984 ptHist3->Scale(100);
7986 TGraphErrors** tmp = yields[0][1][0];
7988 nearSide->Draw("* SAME");
7990 TGraphErrors** tmp = yields[1][1][0];
7992 awaySide->SetLineColor(2);
7993 awaySide->SetMarkerColor(2);
7994 awaySide->Draw("* SAME");
7998 void style(Int_t styleId = 1)
8000 gStyle->SetPalette(1);
8001 gStyle->SetCanvasColor(10);
8002 gStyle->SetHistFillColor(10);
8003 gStyle->SetHistFillStyle(0);
8004 gStyle->SetOptStat(0);
8005 gStyle->SetPadTickX(1);
8006 gStyle->SetPadTickY(1);
8007 gStyle->SetAxisColor(1, "X");
8008 gStyle->SetAxisColor(1, "Y");
8009 gStyle->SetAxisColor(1, "Z");
8010 gStyle->SetLabelColor(1, "X");
8011 gStyle->SetLabelColor(1, "Y");
8012 gStyle->SetLabelColor(1, "Z");
8013 gStyle->SetTickLength(0.03, "X");
8014 gStyle->SetTickLength(0.03, "Y");
8015 gStyle->SetTickLength(0.03, "Z");
8016 gStyle->SetTitleXSize(0.05);
8017 gStyle->SetTitleYSize(0.05);
8018 gStyle->SetNdivisions(506, "X");
8019 gStyle->SetNdivisions(506, "Y");
8020 gStyle->SetNdivisions(506, "Z");
8022 //gStyle->SetPadGridX(1);
8023 //gStyle->SetPadGridY(1);
8025 //gStyle->SetLabelOffset(0.02, "X");
8026 //gStyle->SetLabelOffset(0.02, "Y");
8027 //gStyle->SetLabelOffset(0.02, "Z");
8028 gStyle->SetLabelSize(0.05, "X");
8029 gStyle->SetLabelSize(0.05, "Y");
8030 gStyle->SetLabelSize(0.05, "Z");
8032 gStyle->SetPadLeftMargin(0.12);
8033 gStyle->SetPadRightMargin(0.02);
8034 gStyle->SetPadBottomMargin(0.13);
8035 gStyle->SetPadTopMargin(0.02);
8037 gStyle->SetMarkerSize(1.4); // CKB
8039 const int iFont = 42; // type * 10 + prec 6: helvetica bold 13: times normal 2: times bold
8042 *-* 1 : times-medium-i-normal "Times New Roman" 1 4
8043 *-* 2 : times-bold-r-normal "Times New Roman" 0 7
8044 *-* 3 : times-bold-i-normal "Times New Roman" 1 7
8045 *-* 4 : helvetica-medium-r-normal "Arial" 0 4
8046 *-* 5 : helvetica-medium-o-normal "Arial" 1 4
8047 *-* 6 : helvetica-bold-r-normal "Arial" 0 7
8048 *-* 7 : helvetica-bold-o-normal "Arial" 1 7
8049 *-* 8 : courier-medium-r-normal "Courier New" 0 4
8050 *-* 9 : courier-medium-o-normal "Courier New" 1 4
8051 *-* 10 : courier-bold-r-normal "Courier New" 0 7
8052 *-* 11 : courier-bold-o-normal "Courier New" 1 7
8053 *-* 12 : symbol-medium-r-normal "Symbol" 0 6
8054 *-* 13 : times-medium-r-normal "Times New Roman" 0 4
8055 *-* 14 : "Wingdings" 0 4
8058 //gStyle->SetTitleXOffset(1); // 1.1
8059 //gStyle->SetTitleYOffset(1); // 1-4
8061 gStyle->SetLabelFont(iFont, "xyz");
8062 gStyle->SetStatFont(iFont);
8063 gStyle->SetTitleFont(iFont, "xyz");
8064 gStyle->SetTextFont(iFont);
8068 gStyle->SetLabelSize(0.07, "X");
8069 gStyle->SetLabelSize(0.07, "Y");
8070 gStyle->SetLabelSize(0.07, "Z");
8071 gStyle->SetTitleXSize(0.07);
8072 gStyle->SetTitleYSize(0.07);
8074 gStyle->SetPadLeftMargin(0.26);
8075 gStyle->SetPadRightMargin(0.01);
8076 gStyle->SetPadBottomMargin(0.15);
8077 gStyle->SetPadTopMargin(0.01);
8080 //gStyle->SetEndErrorSize(0.0);
8082 gROOT->ForceStyle();
8086 void NormalizeTo(TGraphErrors* graph, Float_t normalizeTo)
8089 for (Int_t i=0; i<graph->GetN(); i++)
8090 sum += graph->GetY()[i];
8092 if (normalizeTo > 0 && sum > 0)
8095 for (Int_t i=0; i<graph->GetN(); i++)
8097 graph->SetPoint(i, graph->GetX()[i], graph->GetY()[i] / sum);
8098 graph->SetPointError(i, graph->GetEX()[i], graph->GetEY()[i] / sum);
8103 void CompareMixedEvent(const char* fileName)
8107 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
8108 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
8109 Int_t leadingPtOffset = 2;
8110 Int_t centralityBins[] = { 0, 0, 1, 6, 9, 16 };
8112 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
8115 for (Int_t j=2; j<5; j++)
8117 gpTMin = assocPtArr[j] + 0.01;
8118 gpTMax = assocPtArr[j+1] - 0.01;
8123 SetupRanges(hMixed);
8125 TH2* mixed = hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centralityBins[j], centralityBins[j+1]-1, 1);
8129 TH1* histMixedproj = mixed->ProjectionY();
8130 histMixedproj->Scale(1.0 / mixed->GetNbinsX());
8132 for (Int_t x=1; x<=mixed->GetNbinsX(); x++)
8133 for (Int_t y=1; y<=mixed->GetNbinsY(); y++)
8134 mixed->SetBinContent(x, y, histMixedproj->GetBinContent(y));
8136 histMixedproj->Scale(1.0 / (0.5 * (histMixedproj->GetBinContent(histMixedproj->GetXaxis()->FindBin(-0.01)) + histMixedproj->GetBinContent(histMixedproj->GetXaxis()->FindBin(0.01)))));
8138 histMixedproj->DrawCopy((j == 2) ? "" : "SAME")->SetLineColor(j-1);
8142 void FillParentTHnSparse(const char* fileName)
8148 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, &list);
8149 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->FillParent();
8150 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
8152 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
8153 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->FillParent();
8154 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
8156 TString newFileName(fileName);
8157 newFileName.ReplaceAll(".root", "");
8158 newFileName += "_.root";
8160 file3 = TFile::Open(newFileName, "RECREATE");
8161 file3->mkdir("PWG4_PhiCorrelations");
8162 file3->cd("PWG4_PhiCorrelations");
8163 list->Write("histosPhiCorrelations", TObject::kSingleKey);
8167 void CompareZVertex(const char* fileName)
8171 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
8172 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
8174 axis = h->GetUEHist(2)->GetEventHist()->GetAxis(2, 0);
8180 SetupRanges(hMixed);
8182 TFile::Open("test.root", "RECREATE");
8184 for (Int_t i=0; i<=axis->GetNbins(); i++)
8189 h->SetZVtxRange(h->GetUEHist(2)->GetEventHist()->GetAxis(2, 0)->GetBinLowEdge(i) + 0.01, h->GetUEHist(2)->GetEventHist()->GetAxis(2, 0)->GetBinUpEdge(i) - 0.01);
8190 hMixed->SetZVtxRange(h->GetUEHist(2)->GetEventHist()->GetAxis(2, 0)->GetBinLowEdge(i) + 0.01, h->GetUEHist(2)->GetEventHist()->GetAxis(2, 0)->GetBinUpEdge(i) - 0.01);
8193 GetDistAndFlow(h, hMixed, &hist, 0, 6, 0, 10, 0.51, 1.99, 1, kTRUE, 0, kFALSE);
8196 hist->DrawCopy("SURF1");
8198 hist->Write(Form("detadphi_%d", i));
8200 // if (i == 0) break;
8204 hist->SetLineColor(i+1);
8205 hist->Scale(1.0 / hist->Integral() / hist->GetBinWidth(1));
8206 hist->Draw((i == 0) ? "" : "SAME");
8212 void DrawZRanges(Float_t min, Float_t max)
8214 TFile::Open("test.root");
8216 for (Int_t i=0; i<8; i++)
8218 hist = (TH2*) gFile->Get(Form("detadphi_%d", i));
8220 proj = hist->ProjectionY("proj", hist->GetXaxis()->FindBin(min), hist->GetXaxis()->FindBin(max));
8221 proj->Scale(1.0 / (hist->GetXaxis()->FindBin(max) - hist->GetXaxis()->FindBin(min) + 1));
8223 proj->SetLineColor(i+1);
8224 proj->DrawCopy((i == 0) ? "" : "SAME");