2 Float_t gpTMax = 49.99;
7 Float_t gForceRange = -1;
10 Float_t gZVtxRange = -1;
11 const char* gText = "";
12 TString Sign[]={"Plus","Minus"};
18 Bool_t gIsTrkletsTrklets=kFALSE;
19 Bool_t gIsMuTrklets=kFALSE;
21 void SetRanges(TAxis* axis)
23 if (strcmp(axis->GetTitle(), "leading p_{T} (GeV/c)") == 0)
24 axis->SetRangeUser(0, (gEnergy == 900) ? 10 : 25);
26 if (strcmp(axis->GetTitle(), "multiplicity") == 0)
27 axis->SetRangeUser(0, 10);
30 void SetRanges(TH1* hist)
32 SetRanges(hist->GetXaxis());
33 SetRanges(hist->GetYaxis());
34 SetRanges(hist->GetZaxis());
37 void Prepare1DPlot(TH1* hist)
42 hist->SetLineWidth(2);
43 hist->SetStats(kFALSE);
45 hist->GetXaxis()->SetLabelOffset(0.02);
46 hist->GetXaxis()->SetTitleOffset(1.3);
47 hist->GetYaxis()->SetTitleOffset(1.3);
52 TH1* GetSystematicUncertainty(TH1* corr, TH1* trackHist)
56 systError = (TH1*) corr->Clone("systError");
59 else // for dphi evaluation
60 systError = new TH1F("systError", "", 100, 0, 50);
62 Float_t constantUnc = 0;
64 // particle composition
65 constantUnc += 0.8 ** 2;
68 if (gEnergy == 900 && gpTMin < 1.0)
69 constantUnc += 1.0 ** 2;
70 else if (gEnergy == 900 && gpTMin < 1.5)
71 constantUnc += 0.5 ** 2;
72 if (gEnergy == 7000 && gpTMin < 1.0)
73 constantUnc += 1.0 ** 2;
74 else if (gEnergy == 7000 && gpTMin < 1.5)
75 constantUnc += 0.6 ** 2;
78 if (gEnergy == 900 && gpTMin < 1.0)
79 constantUnc += 2.5 ** 2;
80 else if (gEnergy == 900 && gpTMin < 1.5)
81 constantUnc += 2.0 ** 2;
83 constantUnc += 3.0 ** 2;
85 // difference corrected with pythia and phojet
86 if (gEnergy == 900 && gpTMin < 1.0)
87 constantUnc += 0.6 ** 2;
88 else if (gEnergy == 900 && gpTMin < 1.5)
89 constantUnc += 0.8 ** 2;
91 if (gEnergy == 7000 && gpTMin < 1.0)
94 constantUnc += 0.6 ** 2;
96 constantUnc += 0.8 ** 2;
98 constantUnc += 1.0 ** 2;
100 else if (gEnergy == 7000 && gpTMin < 1.5)
101 constantUnc += 1.0 ** 2;
103 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
104 systError->SetBinContent(bin, constantUnc);
107 if (gUEHist == 0 || gUEHist == 2)
108 systError->Fill(0.75, 4.0 ** 2);
110 systError->Fill(0.75, 5.0 ** 2);
115 systError->Fill(1.25, 1.0 ** 2);
116 else if (gpTMin < 1.5)
117 systError->Fill(1.25, 2.0 ** 2);
122 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
123 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 1.0 ** 2);
127 if (gUEHist == 0 && gUEHist == 1)
128 systError->Fill(0.75, 2.0 ** 2);
130 systError->Fill(0.75, 1.2 ** 2);
134 systError->Fill(0.75, 1.0 ** 2);
137 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
140 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 0.5 ** 2);
141 if (gEnergy == 7000 && systError->GetXaxis()->GetBinCenter(bin) < 1.5)
142 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 2.0 ** 2);
143 else if (gEnergy == 7000)
144 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 1.0 ** 2);
147 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
148 systError->SetBinContent(bin, TMath::Sqrt(systError->GetBinContent(bin)));
152 //new TCanvas; trackHist->Draw();
153 //new TCanvas; systError->DrawCopy("");
156 for (Int_t i=1; i<=trackHist->GetNbinsX(); i++)
157 uncFlat += trackHist->GetBinContent(i) * systError->GetBinContent(systError->FindBin(trackHist->GetBinCenter(i)));
158 if (trackHist->Integral() > 0)
159 uncFlat /= trackHist->Integral();
161 systError = (TH1F*) corr->Clone("systError");
164 for (Int_t i=1; i<=systError->GetNbinsX(); i++)
165 systError->SetBinContent(i, uncFlat);
167 //new TCanvas; systError->DrawCopy("");
170 systError->SetFillColor(kGray);
171 systError->SetFillStyle(1001);
172 systError->SetMarkerStyle(0);
173 systError->SetLineColor(0);
178 void DrawRatio(TH1* corr, TH1* mc, const char* name, TH1* syst = 0)
182 TCanvas* canvas3 = new TCanvas(name, name, 600, 600);
183 canvas3->Range(0, 0, 1, 1);
185 TPad* pad1 = new TPad(Form("%s_1", name), "", 0, 0.5, 0.98, 0.98);
188 TPad* pad2 = new TPad(Form("%s_2", name), "", 0, 0.02, 0.98, 0.5);
191 pad1->SetRightMargin(0.01);
192 pad2->SetRightMargin(0.01);
193 pad1->SetTopMargin(0.05);
194 pad1->SetLeftMargin(0.13);
195 pad2->SetLeftMargin(0.13);
196 pad2->SetBottomMargin(0.22);
198 // no border between them
199 pad1->SetBottomMargin(0);
200 pad2->SetTopMargin(0);
207 TLegend* legend = new TLegend(0.15, 0.65, 0.55, 0.90);
209 TLegend* legend = new TLegend(0.55, 0.65, 0.95, 0.90);
211 legend->SetFillColor(0);
212 legend->AddEntry(corr, "Corrected");
213 legend->AddEntry(mc, "MC prediction");
214 legend->SetTextSize(0.08);
218 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);
219 dummy->SetYTitle(corr->GetYaxis()->GetTitle());
221 //dummy = new TH2F("dummy", "", 100, corr->GetXaxis()->GetBinLowEdge(1), corr->GetXaxis()->GetBinUpEdge(corr->GetNbinsX()), 1000, 13.5, 20.5);
222 //dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
224 dummy->SetStats(kFALSE);
225 dummy->SetXTitle(corr->GetXaxis()->GetTitle());
226 dummy->GetYaxis()->SetTitleOffset(1);
227 Prepare1DPlot(dummy);
229 dummy->GetXaxis()->SetLabelSize(0.08);
230 dummy->GetYaxis()->SetLabelSize(0.08);
231 dummy->GetXaxis()->SetTitleSize(0.08);
232 dummy->GetYaxis()->SetTitleSize(0.08);
233 dummy->GetYaxis()->SetTitleOffset(0.8);
236 dummy->GetYaxis()->SetRangeUser(0, gForceRange);
240 if (0 && gUEHist != 2)
242 const char* regionStr[] = { "Toward Region", "Away Region", "Transverse Region" };
243 latex = new TLatex(0.65, 0.1, regionStr[gRegion]);
244 latex->SetTextSize(0.075);
251 systError = (TH1*) syst->Clone("corrSystError");
252 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
254 systError->SetBinError(bin, corr->GetBinContent(bin) * syst->GetBinContent(bin) / 100);
255 systError->SetBinContent(bin, corr->GetBinContent(bin));
258 systError->Draw("E2 ][ SAME");
264 if (strlen(gText) > 0)
266 latex = new TLatex(0.2, 0.2, gText);
268 latex->SetTextSize(0.06);
275 //pad2->SetBottomMargin(0.15);
279 TH1* ratio = (TH1*) mc->Clone("ratio");
282 Float_t minR = TMath::Min(0.91, ratio->GetMinimum() * 0.95);
283 Float_t maxR = TMath::Max(1.09, ratio->GetMaximum() * 1.05);
288 TH1F dummy3("dummy3", ";;Ratio: MC / corr", 100, corr->GetXaxis()->GetBinLowEdge(1), corr->GetXaxis()->GetBinUpEdge(corr->GetNbinsX()));
289 dummy3.SetXTitle(corr->GetXaxis()->GetTitle());
290 Prepare1DPlot(&dummy3);
291 dummy3.SetStats(kFALSE);
292 for (Int_t i=1; i<=100; ++i)
293 dummy3.SetBinContent(i, 1);
294 dummy3.GetYaxis()->SetRangeUser(minR, maxR);
295 dummy3.SetLineWidth(2);
296 dummy3.GetXaxis()->SetLabelSize(0.08);
297 dummy3.GetYaxis()->SetLabelSize(0.08);
298 dummy3.GetXaxis()->SetTitleSize(0.08);
299 dummy3.GetYaxis()->SetTitleSize(0.08);
300 dummy3.GetYaxis()->SetTitleOffset(0.8);
305 // for the ratio add in quadrature
306 for (Int_t bin=1; bin<=syst->GetNbinsX(); bin++)
308 if (corr->GetBinError(bin) > 0)
309 syst->SetBinError(bin, TMath::Sqrt(TMath::Power(syst->GetBinContent(bin) / 100, 2) + TMath::Power(corr->GetBinError(bin) / corr->GetBinContent(bin), 2)));
311 syst->SetBinError(bin, 0);
312 syst->SetBinContent(bin, 1);
315 syst->Draw("E2 ][ SAME");
316 dummy3.DrawCopy("SAME");
321 ratio->Fit("pol0", "N");
324 //canvas3->SaveAs(Form("%s.eps", canvas3->GetTitle()));
329 gSystem->Load("libANALYSIS");
330 gSystem->Load("libANALYSISalice");
331 gSystem->Load("libCORRFW");
332 gSystem->Load("libPWGTools");
333 gSystem->Load("libPWGCFCorrelationsBase");
336 const char* lastFileName = 0;
337 void* cacheSameEvent = 0;
338 void* cacheMixedEvent = 0;
340 void* GetUEHistogram(const char* fileName, TList** listRef = 0, Bool_t mixed = kFALSE, const char* tag = "")
342 if (!lastFileName || strcmp(lastFileName, fileName) != 0)
344 lastFileName = fileName;
345 file = TFile::Open(fileName);
349 list = (TList*) gFile->Get("PWG4_LeadingTrackUE/histosLeadingTrackUE");
351 list = (TList*) gFile->Get(Form("PWG4_PhiCorrelations/histosPhiCorrelations%s", tag));
353 list = (TList*) gFile->Get("PWG4_PhiCorrelations/histosPhiCorrelations_Syst");
361 cacheMixedEvent = list->FindObject("AliUEHistogramsMixed");
362 cacheSameEvent = list->FindObject("AliUEHistogramsSame");
365 return cacheMixedEvent;
367 if (list->FindObject("AliUEHistograms"))
368 return list->FindObject("AliUEHistograms");
370 return cacheSameEvent;
374 Printf("GetUEHistogram --> Using cache for %s", fileName);
377 return cacheMixedEvent;
379 return cacheSameEvent;
383 void CompareBias(const char* mcFile = "PWG4_JetTasksOutput.root", Int_t region, Int_t ueHist)
387 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(mcFile);
390 const char* axis = "z";
391 Float_t ptLeadMin = 0;
392 Float_t ptLeadMax = -1;
396 ptLeadMin = 0.51 + 0;
397 ptLeadMax = 1.99 + 0;
401 biasFromData = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepBiasStudy, AliUEHist::kCFStepReconstructed, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromData");
402 biasFromData2 = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepBiasStudy2, AliUEHist::kCFStepReconstructed, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromData2");
403 //biasFromData = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepRealLeading, region, axis)->Clone("biasFromData");
404 biasFromMC = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepTracked, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromMC");
405 //biasFromMC = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepRealLeading, region, axis)->Clone("biasFromMC");
407 /* biasFromData->Draw();
408 biasFromMC->SetLineColor(2);
409 biasFromMC->Draw("SAME");
412 DrawRatio(biasFromData, biasFromMC, "bias: data vs MC");
413 DrawRatio(biasFromData, biasFromData2, "bias: data vs data two step");
416 void CompareBiasWithData(const char* mcFile = "PWG4_JetTasksOutput.root", const char* dataFile = "esd.root", Int_t region = 2)
420 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(mcFile);
423 biasFromMC = (TH1*) h->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepTracked, region, "z")->Clone("biasFromMC");
425 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(dataFile);
428 biasFromData = (TH1*) h2->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepBiasStudy, AliUEHist::kCFStepReconstructed, region, "z")->Clone("biasFromData");
429 biasFromData2 = (TH1*) h2->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepBiasStudy2, AliUEHist::kCFStepReconstructed, region, "z")->Clone("biasFromData2");
431 DrawRatio(biasFromData, biasFromMC, "bias: data vs MC");
432 DrawRatio(biasFromData, biasFromData2, "bias: data vs data two step");
437 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)
441 if (!gCache || !gFirst)
443 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
444 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
456 AliUEHistograms* h = (AliUEHistograms*) gFirst;
457 AliUEHistograms* h2 = (AliUEHistograms*) gSecond;
464 TH1* hist1 = h->GetUEHist(id)->GetUEHist(step1, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
465 //TH1* hist1 = h->GetUEHist(id)->GetUEHist(step1, region, ptLeadMin, ptLeadMax);
466 TH1* hist2 = h2->GetUEHist(id)->GetUEHist(step2, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
468 //hist1->Scale(1.0 / hist1->Integral());
469 //hist2->Scale(1.0 / hist2->Integral());
474 trackHist = h->GetUEHist(id)->GetTrackHist(region)->ShowProjection(2, 0);
475 // only keep bins under consideration
476 for (Int_t bin=1; bin<=trackHist->GetNbinsX(); bin++)
477 if (bin < trackHist->FindBin(ptLeadMin) || bin > trackHist->FindBin(ptLeadMax))
478 trackHist->SetBinContent(bin, 0);
481 // systematic uncertainty
482 TH1* syst = 0; //GetSystematicUncertainty(hist1, trackHist);
484 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);
487 void CompareEventHist(const char* fileName1, const char* fileName2, Int_t id, Int_t step, Int_t var)
491 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
494 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
497 TH1* hist1 = h->GetUEHist(id)->GetEventHist()->ShowProjection(var, step);
498 TH1* hist2 = h2->GetUEHist(id)->GetEventHist()->ShowProjection(var, step);
500 // hist1 = hist1->Rebin(hist2->GetNbinsX(), "new", hist2->GetXaxis()->GetXbins()->GetArray());
502 // hist2 = hist2->Rebin(hist1->GetNbinsX(), "new", hist1->GetXaxis()->GetXbins()->GetArray());
504 DrawRatio(hist1, hist2, "compare");
507 void CompareEventHist(const char* fileName1, const char* fileName2, Int_t id, Int_t step1, Int_t step2, Int_t var)
511 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
514 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
517 // h->GetUEHist(id)->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(1, 5);
518 // h2->GetUEHist(id)->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(1, 5);
520 TH1* hist1 = h->GetUEHist(id)->GetEventHist()->ShowProjection(var, step1);
521 TH1* hist2 = h2->GetUEHist(id)->GetEventHist()->ShowProjection(var, step2);
523 DrawRatio(hist1, hist2, "compare");
526 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)
528 // fileName1 is labelled Corrected in the plot
534 Compare(fileName1, fileName2, id, step, step, region, ptLeadMin, ptLeadMax);
537 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)
539 // fileName1 is labelled Corrected in the plot
545 Compare(fileName1, fileName2, id, step1, step2, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
548 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)
552 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, mixed);
556 return h->GetUEHist(id)->GetUEHist(step, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd, twoD)->DrawCopy();
559 void DrawProjectionsRidge(const char* fileName, const char* fileNamePbPbMix = 0)
561 if (!fileNamePbPbMix)
562 fileNamePbPbMix = fileName;
569 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
570 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
576 GetDistAndFlow(h, hMixed, &hist1, 0, 8, 0, 100, 3.01, 3.99, 1, kTRUE, 0, kTRUE);
578 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
580 // NormalizeToBinWidth(hist1);
582 proj1y = ((TH2*) hist1)->ProjectionY("proj1y", hist1->GetXaxis()->FindBin(-0.5), hist1->GetXaxis()->FindBin(0.5));
583 proj1x = ((TH2*) hist1)->ProjectionX("proj1x", hist1->GetYaxis()->FindBin(-1.79), hist1->GetYaxis()->FindBin(1.79));
585 proj1y->Scale(1.0 / (hist1->GetXaxis()->FindBin(0.5) - hist1->GetXaxis()->FindBin(-0.5) + 1));
586 proj1x->Scale(1.0 / (hist1->GetYaxis()->FindBin(1.79) - hist1->GetYaxis()->FindBin(-1.79) + 1));
588 proj1y->GetXaxis()->SetTitleOffset(1);
589 proj1x->GetXaxis()->SetTitleOffset(1);
591 Float_t zyam = proj1x->GetBinContent(proj1x->GetXaxis()->FindBin(TMath::Pi()/2));
592 proj1x->Add(new TF1("func", "-1", -100, 100), zyam);
593 proj1y->Add(new TF1("func", "-1", -100, 100), zyam);
595 new TCanvas("c", "c", 800, 800);
596 gPad->SetLeftMargin(0.15);
598 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
599 hist1->GetXaxis()->SetTitleOffset(1.5);
600 hist1->GetYaxis()->SetTitleOffset(2);
601 hist1->SetStats(kFALSE);
602 hist1->DrawCopy("SURF1");
604 // new TCanvas; proj1y->Draw(); new TCanvas; proj1x->Draw(); return;
607 GetDistAndFlow(h, hMixed, &hist2, 0, 8, 40, 100, 4.01, 5.99, 1, kTRUE, 0, kTRUE);
609 // ((TH2*) hist2)->Rebin2D(2, 2); hist2->Scale(0.25);
610 // NormalizeToBinWidth(hist2);
612 proj2y = ((TH2*) hist2)->ProjectionY("proj2y", hist1->GetXaxis()->FindBin(-0.5), hist1->GetXaxis()->FindBin(0.5));
613 proj2x = ((TH2*) hist2)->ProjectionX("proj2x", hist1->GetYaxis()->FindBin(-1.79), hist1->GetYaxis()->FindBin(1.79));
615 proj2y->Scale(1.0 / (hist1->GetXaxis()->FindBin(0.5) - hist1->GetXaxis()->FindBin(-0.5) + 1));
616 proj2x->Scale(1.0 / (hist1->GetYaxis()->FindBin(1.79) - hist1->GetYaxis()->FindBin(-1.79) + 1));
618 zyam = proj2x->GetBinContent(proj2x->GetXaxis()->FindBin(TMath::Pi()/2));
619 proj2x->Add(new TF1("func", "-1", -100, 100), zyam);
620 proj2y->Add(new TF1("func", "-1", -100, 100), zyam);
622 proj2y->SetLineColor(2); proj2x->SetLineColor(2);
624 new TCanvas; proj1y->Draw(); proj2y->Draw("SAME");
625 new TCanvas; proj1x->Draw(); proj2x->Draw("SAME");
627 new TCanvas("c2", "c2", 800, 800);
628 gPad->SetLeftMargin(0.15);
630 hist2->GetYaxis()->SetRangeUser(-1.79, 1.79);
631 hist2->GetXaxis()->SetTitleOffset(1.5);
632 hist2->GetYaxis()->SetTitleOffset(2);
633 hist2->SetStats(kFALSE);
634 hist2->DrawCopy("SURF1");
637 void DrawExample(const char* fileName, const char* fileNamePbPbMix = 0)
639 if (!fileNamePbPbMix)
640 fileNamePbPbMix = fileName;
647 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
648 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
654 GetDistAndFlow(h, hMixed, &hist1, 0, 8, 0, 40, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
656 ((TH2*) hist1)->Rebin2D(2, 2);
659 // NormalizeToBinWidth(hist1);
661 new TCanvas("c", "c", 800, 800);
662 gPad->SetLeftMargin(0.15);
664 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
665 hist1->GetXaxis()->SetTitleOffset(1.5);
666 hist1->GetYaxis()->SetTitleOffset(2);
667 hist1->SetStats(kFALSE);
668 hist1->DrawCopy("SURF1");
671 GetDistAndFlow(h, hMixed, &hist2, 0, 8, 40, 100, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
673 ((TH2*) hist2)->Rebin2D(2, 2); hist2->Scale(0.25);
675 // NormalizeToBinWidth(hist1);
677 new TCanvas("c2", "c2", 800, 800);
678 gPad->SetLeftMargin(0.15);
680 hist2->GetYaxis()->SetRangeUser(-1.79, 1.79);
681 hist2->GetXaxis()->SetTitleOffset(1.5);
682 hist2->GetYaxis()->SetTitleOffset(2);
683 hist2->SetStats(kFALSE);
684 hist2->DrawCopy("SURF1");
692 GetDistAndFlow(h, hMixed, &hist1, 0, 0, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
694 ((TH2*) hist1)->Rebin2D(2, 2);
695 // NormalizeToBinWidth(hist1);
697 new TCanvas("c2", "c2", 800, 800);
698 gPad->SetLeftMargin(0.15);
700 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
701 hist1->GetXaxis()->SetTitleOffset(1.5);
702 hist1->GetYaxis()->SetTitleOffset(2);
703 hist1->SetStats(kFALSE);
704 hist1->DrawCopy("SURF1");
706 hist1->Divide(hist2);
708 new TCanvas("c5", "c5", 800, 800);
709 gPad->SetLeftMargin(0.15);
711 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
712 hist1->GetXaxis()->SetTitleOffset(1.5);
713 hist1->GetYaxis()->SetTitleOffset(2);
714 hist1->SetStats(kFALSE);
715 hist1->DrawCopy("SURF1");
719 GetDistAndFlow(h, hMixed, &hist1, 0, 6, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE, 6);
721 ((TH2*) hist1)->Rebin2D(2, 2);
722 // NormalizeToBinWidth(hist1);
724 new TCanvas("c3", "c3", 800, 800);
725 gPad->SetLeftMargin(0.15);
727 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
728 hist1->GetXaxis()->SetTitleOffset(1.5);
729 hist1->GetYaxis()->SetTitleOffset(2);
730 hist1->SetStats(kFALSE);
731 hist1->DrawCopy("SURF1");
736 // GetDistAndFlow(h, hMixed, &hist1, 0, 4, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE, 6);
738 // ((TH2*) hist1)->Rebin2D(2, 2);
739 // // hist1->Scale(0.25);
741 // // NormalizeToBinWidth(hist1);
743 // new TCanvas("c1b", "c1b", 800, 800);
744 // gPad->SetLeftMargin(0.15);
745 // hist1->SetTitle("");
746 // hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
747 // hist1->GetXaxis()->SetTitleOffset(1.5);
748 // hist1->GetYaxis()->SetTitleOffset(2);
749 // hist1->SetStats(kFALSE);
750 // hist1->DrawCopy("SURF1");
755 // GetDistAndFlow(h, 0, &hist1, 0, 8, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
757 // NormalizeToBinWidth(hist1);
759 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
761 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
763 // Float_t factor = 1.0 / (2.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j)));
764 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
765 // hist1->SetBinError(i, j, hist1->GetBinError(i, j) * factor);
769 /* new TCanvas("c4", "c4", 800, 800);
770 gPad->SetLeftMargin(0.15);
772 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
773 hist1->GetXaxis()->SetTitleOffset(1.5);
774 hist1->GetYaxis()->SetTitleOffset(2);
775 hist1->SetStats(kFALSE);
776 hist1->DrawCopy("SURF1"); */
778 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram("corrected.root");
779 AliUEHistograms* h2Mixed = (AliUEHistograms*) GetUEHistogram("corrected.root", 0, kTRUE);
781 SetupRanges(h2Mixed);
783 GetDistAndFlow(h2, h2Mixed, &hist1, 0, 8, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
784 ((TH2*) hist1)->Rebin2D(2, 2);
786 new TCanvas("c4", "c4", 800, 800);
787 gPad->SetLeftMargin(0.15);
789 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
790 hist1->GetXaxis()->SetTitleOffset(1.5);
791 hist1->GetYaxis()->SetTitleOffset(2);
792 hist1->SetStats(kFALSE);
793 hist1->DrawCopy("SURF1");
795 hist1->Divide(hist2);
797 new TCanvas("c5", "c5", 800, 800);
798 gPad->SetLeftMargin(0.15);
800 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
801 hist1->GetXaxis()->SetTitleOffset(1.5);
802 hist1->GetYaxis()->SetTitleOffset(2);
803 hist1->SetStats(kFALSE);
804 hist1->DrawCopy("SURF1");
806 // hist1->Divide(histMixed);
808 // NormalizeToBinWidth(hist1);
810 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
812 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
814 // Float_t factor = 1.0 / (2.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j)));
815 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
816 // hist1->SetBinError(i, j
817 // }, hist1->GetBinError(i, j) * factor);
820 // new TCanvas("c6", "c6", 800, 800);
821 // gPad->SetLeftMargin(0.15);
822 // hist1->SetTitle("");
823 // hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
824 // hist1->GetXaxis()->SetTitleOffset(1.5);
825 // hist1->GetYaxis()->SetTitleOffset(2);
826 // hist1->SetStats(kFALSE);
827 // hist1->DrawCopy("SURF1");
831 GetSumOfRatios(h, hMixed, &hist1, 6, 60, 90, 8.01, 9.99, kTRUE);
832 new TCanvas("c2", "c2", 800, 800);
833 gPad->SetLeftMargin(0.15);
835 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
836 hist1->GetXaxis()->SetTitleOffset(1.5);
837 hist1->GetYaxis()->SetTitleOffset(2);
838 hist1->SetStats(kFALSE);
839 hist1->Draw("SURF1");
843 latex = new TLatex(0.82, 0.74, "ALICE performance");
844 latex->SetTextSize(0.02);
845 latex->SetTextAlign(22);
848 latex = new TLatex(0.82, 0.72, "Pb-Pb 2.76 TeV");
849 latex->SetTextSize(0.02);
850 latex->SetTextAlign(22);
853 latex = new TLatex(0.82, 0.70, "28.09.11");
854 latex->SetTextSize(0.02);
855 latex->SetTextAlign(22);
859 DrawALICELogo(0.75, 0.75, 0.9, 0.9);
862 void DrawExample2(const char* fileName)
866 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
867 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
875 GetSumOfRatios(h, hMixed, &hist1, 8, 0, 5, 0.51, 0.99);
877 new TCanvas("c", "c", 800, 800);
878 gPad->SetLeftMargin(0.15);
879 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
880 hist1->GetXaxis()->SetTitleOffset(1.5);
881 hist1->GetYaxis()->SetTitleOffset(2);
882 hist1->SetStats(kFALSE);
883 hist1->DrawCopy("SURF1");
886 void CompareZVtxWeighting(const char* fileName, Int_t step = 8)
893 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
894 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
900 GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 10, 5.01, 9.99, 1, kTRUE, 0, kTRUE);
901 hist1->Scale(1.0 / 0.972222);
904 GetSumOfRatios(h, hMixed, &hist2, step, 0, 10, 5.01, 9.99, kTRUE);
906 c = new TCanvas("c", "c", 1200, 400);
909 c->cd(1); hist1->DrawCopy("SURF1");
910 c->cd(2); hist2->DrawCopy("SURF1");
913 hist1->Divide(hist2);
915 c->cd(3); hist1->DrawCopy("COLZ");
918 void DrawSameMixed(const char* fileName, const char* fileNamePbPbMix = 0, Int_t step = 6)
920 if (!fileNamePbPbMix)
921 fileNamePbPbMix = fileName;
928 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
929 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
935 GetDistAndFlow(h, 0, &hist1, 0, step, 0, 80, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
937 // ((TH2*) hist1)->Rebin2D(2, 2);
938 // hist1->Scale(0.25);
940 NormalizeToBinWidth(hist1);
942 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
944 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
946 // Float_t factor = 1.0 / (2.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j) / 0.9));
947 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
948 // hist1->SetBinError(i, j, hist1->GetBinError(i, j) * factor);
952 c = new TCanvas("c", "c", 1600, 800);
955 gPad->SetLeftMargin(0.15);
957 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
958 hist1->GetZaxis()->SetTitleOffset(1.8);
959 hist1->GetXaxis()->SetTitleOffset(1.5);
960 hist1->GetYaxis()->SetTitleOffset(2);
961 hist1->GetZaxis()->SetTitle("same event pairs (a.u.)");
962 hist1->SetStats(kFALSE);
963 hist1->DrawCopy("SURF1");
965 DrawALICELogo(kFALSE, 0.2, 0.7, 0.4, 0.9);
969 GetDistAndFlow(hMixed, 0, &hist1, 0, step, 0, 80, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
971 // ((TH2*) hist1)->Rebin2D(2, 2);
972 NormalizeToBinWidth(hist1);
974 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
976 // Float_t factor = 1.0 / (1.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j)) / 6.0);
977 // Printf("%d %f", j, factor);
978 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
980 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
981 // hist1->SetBinError(i, j, hist1->GetBinError(i, j) * factor);
986 gPad->SetLeftMargin(0.15);
988 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
989 hist1->GetZaxis()->SetTitleOffset(1.8);
990 hist1->GetXaxis()->SetTitleOffset(1.5);
991 hist1->GetYaxis()->SetTitleOffset(2);
992 hist1->GetZaxis()->SetTitle("mixed event pairs (a.u.)");
993 hist1->SetStats(kFALSE);
994 hist1->DrawCopy("SURF1");
996 DrawALICELogo(kFALSE, 0.2, 0.7, 0.4, 0.9);
998 c->SaveAs(Form("samemixed_%d.eps", step));
999 c->SaveAs(Form("samemixed_%d.png", step));
1001 new TCanvas("c3", "c3", 800, 800);
1002 gPad->SetLeftMargin(0.15);
1003 hist2->Divide(hist1);
1004 hist2->DrawCopy("SURF1");
1007 void Validation2DAllStepsNew(const char* fileName, Int_t bin = 0)
1009 Int_t centralityFrom = 0;
1010 Int_t centralityTo = 80;
1015 Float_t ptTrigBegin = 2.01;
1016 Float_t ptTrigEnd = 3.99;
1047 centralityFrom = 60;
1060 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1061 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1064 SetupRanges(hMixed);
1068 GetSumOfRatios(h, hMixed, &hist[0], 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1069 GetSumOfRatios(h, hMixed, &hist[1], 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1070 GetSumOfRatios(h, hMixed, &hist[2], 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1071 GetSumOfRatios(h, hMixed, &hist[3], 6, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1072 GetSumOfRatios(h, hMixed, &hist[4], 8, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1073 GetSumOfRatios(h, hMixed, &hist[5], 10, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1075 c = new TCanvas("c", "c", 1600, 1000);
1078 Float_t peakYield1[6];
1079 Float_t baselineValues1[6];
1081 for (Int_t i=0; i<6; i++)
1086 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1087 hist[i]->Scale(1.0 / hist[i]->GetYaxis()->GetBinWidth(1));
1089 ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1092 for (Int_t i=0; i<6; i++)
1098 hist[i]->GetYaxis()->SetRangeUser(-1.99, 1.99);
1099 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1100 hist[i]->GetYaxis()->SetTitleOffset(2);
1101 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1102 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1103 hist[i]->SetStats(kFALSE);
1104 hist[i]->DrawCopy("SURF1");
1109 TH2* clone = (TH2*) hist[i]->Clone();
1110 clone->Divide(hist[5]);
1111 clone->DrawCopy("COLZ");
1112 gPad->SetRightMargin(0.15);
1116 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj1_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1119 baselineValues1[i] = proj1->Integral(proj1->FindBin(TMath::Pi()/2 - 0.2), proj1->FindBin(TMath::Pi()/2 + 0.2)) / (proj1->FindBin(TMath::Pi()/2 + 0.2) - proj1->FindBin(TMath::Pi()/2 - 0.2) + 1);
1120 peakYield1[i] = proj1->Integral(proj1->GetXaxis()->FindBin(-1), proj1->GetXaxis()->FindBin(1)) / (proj1->GetXaxis()->FindBin(0.99) - proj1->GetXaxis()->FindBin(-0.99) + 1) - baselineValues1[i];
1121 Printf("%d: %f %f", i, peakYield1[i], baselineValues1[i]);
1125 proj2 = ((TH2*) hist[5])->ProjectionX(Form("proj2_%d", i), hist[5]->GetYaxis()->FindBin(-0.99), hist[5]->GetYaxis()->FindBin(0.99));
1126 proj2->SetLineColor(2);
1127 proj2->DrawCopy("SAME");
1130 proj1->Divide(proj1, proj2, 1, 1, "B");
1135 c = new TCanvas("c2", "c2", 1600, 1000);
1138 for (Int_t i=0; i<6; i++)
1144 hist[i]->GetYaxis()->SetRangeUser(-1.99, 1.99);
1145 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1146 hist[i]->GetYaxis()->SetTitleOffset(2);
1147 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1148 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1149 hist[i]->SetStats(kFALSE);
1150 hist[i]->DrawCopy("SURF1");
1153 TH2* clone = (TH2*) hist[i]->Clone();
1154 clone->Divide(hist[0]);
1155 clone->DrawCopy("COLZ");
1156 gPad->SetRightMargin(0.15);
1159 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj3_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1162 proj2 = ((TH2*) hist[0])->ProjectionX(Form("proj4_%d", i), hist[0]->GetYaxis()->FindBin(-0.99), hist[0]->GetYaxis()->FindBin(0.99));
1163 proj2->SetLineColor(2);
1164 proj2->DrawCopy("SAME");
1167 proj1->Divide(proj1, proj2, 1, 1, "B");
1171 c = new TCanvas("c3", "c3", 1600, 1000);
1174 for (Int_t i=3; i<4; i++)
1180 hist[i]->GetYaxis()->SetRangeUser(-1.99, 1.99);
1181 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1182 hist[i]->GetYaxis()->SetTitleOffset(2);
1183 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1184 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1185 hist[i]->SetStats(kFALSE);
1186 hist[i]->DrawCopy("SURF1");
1189 TH2* clone = (TH2*) hist[i]->Clone();
1190 clone->Divide(hist[4]);
1191 clone->DrawCopy("COLZ");
1192 gPad->SetRightMargin(0.15);
1195 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj4_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1198 proj2 = ((TH2*) hist[4])->ProjectionX(Form("proj5_%d", i), hist[4]->GetYaxis()->FindBin(-0.99), hist[4]->GetYaxis()->FindBin(0.99));
1199 proj2->SetLineColor(2);
1200 proj2->DrawCopy("SAME");
1203 proj1->Divide(proj1, proj2, 1, 1, "B");
1207 c = new TCanvas("c4", "c4", 1200, 400);
1210 for (Int_t i=0; i<1; i++)
1218 TH2* clone = (TH2*) hist[i]->Clone();
1219 clone->Divide(hist[5]);
1220 clone->DrawCopy("COLZ");
1221 gPad->SetRightMargin(0.15);
1225 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj1_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1228 baselineValues1[i] = proj1->Integral(proj1->FindBin(TMath::Pi()/2 - 0.2), proj1->FindBin(TMath::Pi()/2 + 0.2)) / (proj1->FindBin(TMath::Pi()/2 + 0.2) - proj1->FindBin(TMath::Pi()/2 - 0.2) + 1);
1229 peakYield1[i] = proj1->Integral(proj1->GetXaxis()->FindBin(-1), proj1->GetXaxis()->FindBin(1)) / (proj1->GetXaxis()->FindBin(0.99) - proj1->GetXaxis()->FindBin(-0.99) + 1) - baselineValues1[i];
1230 Printf("%d: %f %f", i, peakYield1[i], baselineValues1[i]);
1234 proj2 = ((TH2*) hist[5])->ProjectionX(Form("proj2_%d", i), hist[5]->GetYaxis()->FindBin(-0.99), hist[5]->GetYaxis()->FindBin(0.99));
1235 proj2->SetLineColor(2);
1236 proj2->DrawCopy("SAME");
1239 proj1->Divide(proj1, proj2, 1, 1, "B");
1244 for (Int_t i=0; i<6; i++)
1245 Printf("%d/%d: %f %f", i, 0, peakYield1[i] / peakYield1[0] - 1, baselineValues1[i] / baselineValues1[0] - 1);
1249 for (Int_t i=0; i<6; i++)
1250 Printf("%d/%d: %f %f", i, 5, peakYield1[i] / peakYield1[5] - 1, baselineValues1[i] / baselineValues1[5] - 1);
1254 void Validation2DAllBins(const char* fileName, const char *fileName2)
1256 /* Int_t is[] = { 0, 1, 2, 3, 4, 5};
1257 Int_t js[] = { 1, 2, 3, 4, 5, 6 };
1259 /* Int_t is[] = { 0, 1, 1, 2, 2, 2, 3, 3, 3 };
1260 Int_t js[] = { 1, 1, 2, 1, 2, 3, 1, 2, 3 };*/
1261 Int_t is[] = { 0, 1, 1, 2, 2, 2, 3 };
1262 Int_t js[] = { 1, 1, 2, 1, 2, 3, 3 };
1265 file1 = TFile::Open(fileName);
1268 file2 = TFile::Open(fileName2);
1270 file3 = TFile::Open("non_closure.root", "RECREATE");
1273 Float_t baselineValues1, baselineValues2, peakYield1, peakYield2;
1277 for (Int_t centr=0; centr<4; centr++)
1279 for (Int_t i=0; i<n; i++)
1283 c = new TCanvas(Form("c%d", padID), Form("c%d", padID), 1100, 750);
1289 TH2* hist1 = (TH2*) file1->Get(Form("dphi_%d_%d_%d", is[i], js[i], centr));
1294 hist2 = (TH2*) file2->Get(Form("dphi_%d_%d_%d", is[i], js[i], centr));
1296 hist2 = (TH2*) file1->Get(Form("dphi_%d_%d_%d", is[i], js[i], centr+4));
1298 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1299 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1300 hist2->Scale(1.0 / hist2->GetYaxis()->GetBinWidth(1));
1302 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1303 ((TH2*) hist2)->Rebin2D(2, 2); hist2->Scale(0.25);
1305 const Float_t outerEta = 1.8;
1306 const Float_t exclusion = 0.5;
1309 proj1 = ((TH2*) hist1)->ProjectionX(Form("proj1a_%d_%d", centr, i), hist1->GetYaxis()->FindBin(-outerEta + 0.01), hist1->GetYaxis()->FindBin(-exclusion - 0.01));
1310 proj1b = ((TH2*) hist1)->ProjectionX(Form("proj1b_%d_%d", centr, i), hist1->GetYaxis()->FindBin(exclusion + 0.01), hist1->GetYaxis()->FindBin(outerEta - 0.01));
1312 copy = proj1->DrawCopy();
1313 copy->GetYaxis()->SetRangeUser(proj1->GetMinimum() * 0.9, proj1->GetMaximum() * 1.2);
1314 proj1c = ((TH2*) hist1)->ProjectionX(Form("proj1c_%d_%d", centr, i), hist1->GetYaxis()->FindBin(-outerEta + 0.01), hist1->GetYaxis()->FindBin(outerEta - 0.01));
1315 proj1c->SetLineColor(2);
1316 proj1c->DrawCopy("SAME");
1317 copy->SetMinimum(TMath::Min(copy->GetMinimum(), proj1c->GetMinimum()));
1318 copy->SetMaximum(1.2 * TMath::Max(copy->GetMaximum(), proj1c->GetMaximum()));
1320 Double_t baselineValues1E, peakYield1E;
1321 baselineValues1 = proj1->IntegralAndError(proj1->FindBin(TMath::Pi()/2 - 0.2), proj1->FindBin(TMath::Pi()/2 + 0.2), baselineValues1E);
1322 baselineValues1 /= (proj1->FindBin(TMath::Pi()/2 + 0.2) - proj1->FindBin(TMath::Pi()/2 - 0.2) + 1);
1323 baselineValues1E /= (proj1->FindBin(TMath::Pi()/2 + 0.2) - proj1->FindBin(TMath::Pi()/2 - 0.2) + 1);
1324 peakYield1 = proj1->IntegralAndError(proj1->GetXaxis()->FindBin(-1), proj1->GetXaxis()->FindBin(1), peakYield1E);
1325 peakYield1 /= (proj1->GetXaxis()->FindBin(0.99) - proj1->GetXaxis()->FindBin(-0.99) + 1);
1326 peakYield1E /= (proj1->GetXaxis()->FindBin(0.99) - proj1->GetXaxis()->FindBin(-0.99) + 1);
1327 peakYield1 -= baselineValues1;
1328 peakYield1E = TMath::Sqrt(peakYield1E * peakYield1E + baselineValues1E * baselineValues1E);
1330 proj2 = ((TH2*) hist2)->ProjectionX(Form("proj2a_%d_%d", centr, i), hist2->GetYaxis()->FindBin(-outerEta + 0.01), hist2->GetYaxis()->FindBin(-exclusion - 0.01));
1331 proj2b = ((TH2*) hist2)->ProjectionX(Form("proj2b_%d_%d", centr, i), hist2->GetYaxis()->FindBin(exclusion + 0.01), hist2->GetYaxis()->FindBin(outerEta - 0.01));
1333 proj2->SetLineColor(3);
1334 proj2->DrawCopy("SAME");
1335 proj2c = ((TH2*) hist2)->ProjectionX(Form("proj2c_%d_%d", centr, i), hist2->GetYaxis()->FindBin(-outerEta + 0.01), hist2->GetYaxis()->FindBin(outerEta - 0.01));
1336 proj2c->SetLineColor(4);
1337 proj2c->DrawCopy("SAME");
1339 Double_t baselineValues2E, peakYield2E;
1340 baselineValues2 = proj2->IntegralAndError(proj1->FindBin(TMath::Pi()/2 - 0.2), proj2->FindBin(TMath::Pi()/2 + 0.2), baselineValues2E);
1341 baselineValues2 /= (proj2->FindBin(TMath::Pi()/2 + 0.2) - proj2->FindBin(TMath::Pi()/2 - 0.2) + 1);
1342 baselineValues2E /= (proj2->FindBin(TMath::Pi()/2 + 0.2) - proj2->FindBin(TMath::Pi()/2 - 0.2) + 1);
1343 peakYield2 = proj2->IntegralAndError(proj2->GetXaxis()->FindBin(-1), proj2->GetXaxis()->FindBin(1), peakYield2E);
1344 peakYield2 /= (proj2->GetXaxis()->FindBin(0.99) - proj2->GetXaxis()->FindBin(-0.99) + 1);
1345 peakYield2E /= (proj2->GetXaxis()->FindBin(0.99) - proj2->GetXaxis()->FindBin(-0.99) + 1);
1346 peakYield2 -= baselineValues2;
1347 peakYield2E = TMath::Sqrt(peakYield2E * peakYield2E + baselineValues2E * baselineValues2E);
1349 // Printf("%d: %f %f %f %f %.2f%% %.2f%%", i, peakYield1, baselineValues1, peakYield2, baselineValues2, 100.0 * peakYield1 / peakYield2 - 100, 100.0 * baselineValues1 / baselineValues2 - 100);
1350 Printf("%s: %.2f%% +- %.2f%% %.2f%% +- %.2f%%",
1352 100.0 * peakYield1 / peakYield2 - 100,
1353 100.0 * peakYield1 / peakYield2 * TMath::Sqrt(TMath::Power(peakYield1E / peakYield1, 2) + TMath::Power(peakYield2E / peakYield2, 2)),
1354 100.0 * baselineValues1 / baselineValues2 - 100,
1355 100.0 * baselineValues1 / baselineValues2 * TMath::Sqrt(TMath::Power(baselineValues1E / baselineValues1, 2) + TMath::Power(baselineValues2E / baselineValues2, 2))
1359 proj1->Divide(proj1, proj2, 1, 1, "B");
1360 proj1c->Divide(proj1c, proj2c, 1, 1, "B");
1361 // proj1->Add(proj2, -1);
1363 proj1c->SetLineColor(2);
1364 proj1c->Draw("SAME");
1367 hist1->Divide(hist2);
1368 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
1369 hist1->Draw("COLZ");
1371 file3 = TFile::Open("non_closure.root", "UPDATE");
1372 proj1->Write(Form("non_closure_%d_%d_%d", is[i], js[i], centr));
1373 proj1c->Write(Form("non_closure_all_%d_%d_%d", is[i], js[i], centr));
1374 hist1->Write(Form("non_closure_2d_%d_%d_%d", is[i], js[i], centr));
1382 void Validation2DAllSteps(const char* fileName, const char* fileNameCorrected = "corrected.root", Int_t startStep = 8)
1384 Int_t centralityFrom = 0;
1385 Int_t centralityTo = 80;
1390 Float_t ptTrigBegin = 2.01;
1391 Float_t ptTrigEnd = 2.99;
1395 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1396 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1398 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected);
1399 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected, 0, kTRUE);
1402 SetupRanges(hMixed);
1404 SetupRanges(hMixed2);
1409 // GetSumOfRatios(h, hMixed, &hist[0], 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, kTRUE);
1411 GetDistAndFlow(h, hMixed, &hist[0], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 0);
1412 GetDistAndFlow(h, hMixed, &hist[1], 0, 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1413 GetDistAndFlow(h, hMixed, &hist[2], 0, 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1414 GetDistAndFlow(h, hMixed, &hist[3], 0, startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1415 GetDistAndFlow(h2, hMixed2, &hist2[0], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1416 GetDistAndFlow(h2, hMixed2, &hist2[1], 0, 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1417 GetDistAndFlow(h2, hMixed2, &hist2[2], 0, 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1418 GetDistAndFlow(h2, hMixed2, &hist2[3], 0, startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1420 c = new TCanvas("c", "c", 1600, 1000);
1423 Float_t peakYield1[4];
1424 Float_t baselineValues1[4];
1425 Float_t peakYield2[4];
1426 Float_t baselineValues2[4];
1427 for (Int_t i=0; i<4; i++)
1429 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1430 hist[i]->Scale(1.0 / hist[i]->GetYaxis()->GetBinWidth(1));
1431 hist2[i]->Scale(1.0 / hist2[i]->GetYaxis()->GetBinWidth(1));
1433 ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1434 // ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1437 hist[i]->GetYaxis()->SetRangeUser(-1.59, 1.59);
1438 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1439 hist[i]->GetYaxis()->SetTitleOffset(2);
1440 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1441 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1442 hist[i]->SetStats(kFALSE);
1443 hist[i]->DrawCopy("SURF1");
1445 ((TH2*) hist2[i])->Rebin2D(2, 2); hist2[i]->Scale(0.25);
1446 // ((TH2*) hist2[i])->Rebin2D(2, 2); hist2[i]->Scale(0.25);
1448 // TF2* func2 = new TF2("func2", "[0]+[1]*exp(-0.5*((x/[2])**2+(y/[3])**2))", -1, 1, -0.99, 0.99);
1449 // func2->SetParameters(0, 1, 0.5, 0.5);
1450 // hist[i]->Fit(func2, "0R");
1451 // hist[i]->Fit(func2, "0R");
1454 // func2->DrawClone("SURF1");
1456 // baselineValues1[i] = func2->GetParameter(0);
1457 // func2->SetParameter(0, 0);
1458 // peakYield1[i] = func2->Integral(-0.5 * TMath::Pi(), 0.5 * TMath::Pi(), -1.4, 1.4);
1459 // Printf("%f %f", peakYield1[i], baselineValues1[i]);
1462 hist2[i]->GetYaxis()->SetRangeUser(-1.59, 1.59);
1463 hist2[i]->GetXaxis()->SetTitleOffset(1.5);
1464 hist2[i]->GetYaxis()->SetTitleOffset(2);
1465 hist2[i]->GetZaxis()->SetTitleOffset(1.8);
1466 hist2[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1467 hist2[i]->SetStats(kFALSE);
1468 hist2[i]->DrawCopy("SURF1");
1471 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj1_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1474 baselineValues1[i] = proj1->GetMinimum();
1475 peakYield1[i] = proj1->Integral(proj1->GetXaxis()->FindBin(-1), proj1->GetXaxis()->FindBin(1)) / (proj1->GetXaxis()->FindBin(0.99) - proj1->GetXaxis()->FindBin(-0.99) + 1) - baselineValues1[i];
1476 Printf("%f %f", peakYield1[i], baselineValues1[i]);
1478 proj2 = ((TH2*) hist2[i])->ProjectionX(Form("proj2_%d", i), hist2[i]->GetYaxis()->FindBin(-0.99), hist2[i]->GetYaxis()->FindBin(0.99));
1479 proj2->SetLineColor(2);
1480 proj2->DrawCopy("SAME");
1482 baselineValues2[i] = proj2->GetMinimum();
1483 peakYield2[i] = proj2->Integral(proj2->GetXaxis()->FindBin(-1), proj2->GetXaxis()->FindBin(1)) / (proj2->GetXaxis()->FindBin(0.99) - proj2->GetXaxis()->FindBin(-0.99) + 1) - baselineValues2[i];
1484 Printf("%f %f", peakYield2[i], baselineValues2[i]);
1487 proj1->Divide(proj2);
1490 // func2 = new TF2("func2", "[0]+[1]*exp(-0.5*((x/[2])**2+(y/[3])**2))", -1, 1, -0.99, 0.99);
1491 // func2->SetParameters(0, 1, 0.5, 0.5);
1492 // hist2[i]->Fit(func2, "0R");
1493 // hist2[i]->Fit(func2, "0R");
1496 // func2->DrawClone("SURF1");
1498 // baselineValues2[i] = func2->GetParameter(0);
1499 // func2->SetParameter(0, 0);
1500 // peakYield2[i] = func2->Integral(-0.5 * TMath::Pi(), 0.5 * TMath::Pi(), -1.4, 1.4);
1501 // Printf("%f %f", peakYield2[i], baselineValues2[i]);
1504 TH2* clone = (TH2*) hist[i]->Clone();
1505 clone->Divide(hist2[i]);
1506 // clone->Add(hist2[i], -1);
1507 clone->DrawCopy("COLZ");
1508 gPad->SetRightMargin(0.15);
1510 /* baselineValues1[i] = clone->Integral(1, clone->GetNbinsX(), clone->GetYaxis()->FindBin(-0.99), clone->GetYaxis()->FindBin(0.99)) / clone->GetNbinsX() / (clone->GetYaxis()->FindBin(0.99) - clone->GetYaxis()->FindBin(-0.99) + 1);
1511 peakYield1[i] = clone->Integral(clone->GetXaxis()->FindBin(-0.5), clone->GetXaxis()->FindBin(0.5), clone->GetYaxis()->FindBin(-0.49), clone->GetYaxis()->FindBin(0.49)) / (clone->GetXaxis()->FindBin(0.5) - clone->GetXaxis()->FindBin(-0.5) + 1) / (clone->GetYaxis()->FindBin(0.49) - clone->GetYaxis()->FindBin(-0.49) + 1);*/
1516 for (Int_t i=0; i<4; i++)
1518 Printf("%d: %f %f", i, peakYield1[i] / peakYield2[i] - 1, baselineValues1[i] / baselineValues2[i] - 1);
1519 // Printf("%d: %f %f", i, peakYield1[i] - 1, baselineValues1[i] - 1);
1523 void CorrelatedContaminationEffect(const char* fileName, const char* fileNameCorrected = "corrected.root", Int_t bin = 0, Int_t startStep = 8)
1525 Int_t centralityFrom = 0;
1526 Int_t centralityTo = 80;
1531 Float_t ptTrigBegin = 2.01;
1532 Float_t ptTrigEnd = 3.99;
1554 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1555 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1557 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected);
1558 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected, 0, kTRUE);
1561 SetupRanges(hMixed);
1563 SetupRanges(hMixed2);
1567 Int_t maxFilled = 5;
1568 GetSumOfRatios(h, hMixed, &hist[0], 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1569 GetSumOfRatios(h, hMixed, &hist[1], 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1570 GetSumOfRatios(h, hMixed, &hist[2], 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1571 GetSumOfRatios(h, hMixed, &hist[3], 6, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1572 GetSumOfRatios(h, hMixed, &hist[4], startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1573 // GetSumOfRatios(h2, hMixed2, &hist[5], startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1575 // GetDistAndFlow(h, hMixed, &hist[0], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 0);
1576 // GetDistAndFlow(h, hMixed, &hist[1], 0, 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1577 // GetDistAndFlow(h, hMixed, &hist[2], 0, 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1578 // GetDistAndFlow(h, hMixed, &hist[3], 0, 6, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1579 // GetDistAndFlow(h, hMixed, &hist[4], 0, startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1580 // GetDistAndFlow(h2, hMixed2, &hist[5], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1582 c = new TCanvas("c", "c", 1600, 1000);
1585 for (Int_t i=0; i<maxFilled; i++)
1587 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1588 hist[i]->Scale(1.0 / hist[i]->GetYaxis()->GetBinWidth(1));
1590 ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1591 // ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1594 hist[i]->GetYaxis()->SetRangeUser(-1.59, 1.59);
1595 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1596 hist[i]->GetYaxis()->SetTitleOffset(2);
1597 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1598 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1599 hist[i]->SetStats(kFALSE);
1600 hist[i]->DrawCopy("SURF1");
1603 for (Int_t i=1; i<maxFilled; i++)
1605 TH2* clone = (TH2*) hist[i]->Clone();
1607 clone->Divide(hist[i-1]);
1609 clone->Divide(hist[2]);
1611 clone->Divide(hist[0]);
1614 gPad->SetRightMargin(0.15);
1615 // hist1->SetTitle("");
1616 // clone->GetZaxis()->SetRangeUser(0.8, 1.2);
1617 clone->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1618 clone->SetStats(kFALSE);
1619 clone->DrawCopy("COLZ");
1622 Float_t peakYield[6];
1623 Float_t baselineValues[6];
1624 for (Int_t i=0; i<maxFilled; i++)
1626 Int_t phi1 = hist[i]->GetXaxis()->FindBin(-1);
1627 Int_t phi2 = hist[i]->GetXaxis()->FindBin(1);
1628 Int_t eta1 = hist[i]->GetYaxis()->FindBin(-1.59);
1629 Int_t eta2 = hist[i]->GetYaxis()->FindBin(1.01);
1630 Int_t eta3 = hist[i]->GetYaxis()->FindBin(1.59);
1631 Float_t baseline = ((TH2*) hist[i])->Integral(phi1, phi2, eta2, eta3, "width") / (phi2 - phi1 + 1) / (eta3 - eta2 + 1);
1632 Float_t peak = ((TH2*) hist[i])->Integral(phi1, phi2, eta1, eta3, "width");
1633 Printf("%f %f", baseline, peak);
1634 peak -= baseline * (eta3 - eta1 + 1) * (phi2 - phi1 + 1);
1636 peakYield[i] = peak;
1637 baselineValues[i] = baseline;
1640 for (Int_t i=1; i<maxFilled; i++)
1643 Printf("%d/%d: %f %f", i, i-1, peakYield[i] / peakYield[i-1] - 1, baselineValues[i] / baselineValues[i-1] - 1);
1645 Printf("%d/%d: %f %f", i, 2, peakYield[i] / peakYield[2] - 1, baselineValues[i] / baselineValues[2] - 1);
1647 Printf("%d/%d: %f %f", 0, i, peakYield[0] / peakYield[i] - 1, baselineValues[0] / baselineValues[i] - 1);
1650 c = new TCanvas("c2", "c2", 1600, 1000);
1652 for (Int_t i=0; i<maxFilled; i++)
1655 hist[i]->DrawCopy("SURF1");
1657 TF2* func2 = new TF2("func2", "[0]+[1]*exp(-0.5*((x/[2])**2+(y/[3])**2))", -0.5 * TMath::Pi(), 0.5 * TMath::Pi(), -1.4, 1.4);
1658 func2->SetParameters(0, 1, 0.5, 0.5);
1659 // func2->SetParLimits(1, 0, 10);
1660 // func2->SetParLimits(2, sigmaFitLimit, 1);
1661 // func2->SetParLimits(3, sigmaFitLimit, 1);
1662 hist[i]->Fit(func2, "0R");
1665 func2->DrawClone("SURF1");
1667 baselineValues[i] = func2->GetParameter(0);
1668 func2->SetParameter(0, 0);
1669 peakYield[i] = func2->Integral(-0.5 * TMath::Pi(), 0.5 * TMath::Pi(), -1.4, 1.4);
1670 Printf("%f %f", peakYield[i], baselineValues[i]);
1673 for (Int_t i=1; i<maxFilled; i++)
1676 Printf("%d/%d: %f %f", i, i-1, peakYield[i] / peakYield[i-1] - 1, baselineValues[i] / baselineValues[i-1] - 1);
1678 Printf("%d/%d: %f %f", i, 2, peakYield[i] / peakYield[2] - 1, baselineValues[i] / baselineValues[2] - 1);
1680 Printf("%d/%d: %f %f", 0, i, peakYield[0] / peakYield[i] - 1, baselineValues[0] / baselineValues[i] - 1);
1683 for (Int_t i=1; i<maxFilled; i++)
1685 Printf("%d/%d: %f %f", 0, i, peakYield[0] / peakYield[i] - 1, baselineValues[0] / baselineValues[i] - 1);
1689 void DrawValidation2D(const char* fileName, const char* fileNameCorrected = "corrected.root", Int_t startStep = 8)
1691 Int_t centralityTo = 80;
1698 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1699 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1702 SetupRanges(hMixed);
1705 GetDistAndFlow(h, hMixed, &hist1, 0, 0, 0, centralityTo, 2.01, 3.99, 1, kTRUE, 0, kTRUE, 0);
1706 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1707 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1709 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1710 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1712 // NormalizeToBinWidth(hist1);
1714 c = new TCanvas("c", "c", 1000, 1000);
1718 gPad->SetLeftMargin(0.15);
1719 // hist1->SetTitle("");
1720 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1721 hist1->GetXaxis()->SetTitleOffset(1.5);
1722 hist1->GetYaxis()->SetTitleOffset(2);
1723 hist1->GetZaxis()->SetTitleOffset(1.8);
1724 hist1->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1725 hist1->SetStats(kFALSE);
1726 hist1->DrawCopy("SURF1");
1727 DrawLatex(0.1, 0.85, 1, "MC", 0.04);
1728 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1732 GetDistAndFlow(h, hMixed, &hist1, 0, startStep, 0, centralityTo, 2.01, 3.99, 1, kTRUE, 0, kTRUE, startStep);
1733 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1734 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1736 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1737 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1738 // NormalizeToBinWidth(hist1);
1741 gPad->SetLeftMargin(0.15);
1742 hist1->SetTitle("");
1743 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1744 hist1->GetXaxis()->SetTitleOffset(1.5);
1745 hist1->GetYaxis()->SetTitleOffset(2);
1746 hist1->GetZaxis()->SetTitleOffset(1.8);
1747 hist1->SetStats(kFALSE);
1748 hist1->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1749 hist1->DrawCopy("SURF1");
1750 DrawLatex(0.1, 0.85, 1, "Uncorrected", 0.04);
1751 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1753 c2 = new TCanvas("c3", "c3", 800, 800);
1754 // hist2->Scale(1.09);
1755 hist1->Divide(hist2);
1756 // hist1->Add(hist2, -1);
1757 hist1->DrawCopy("SURF1");
1761 // AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram("LHC11a10a_bis_AOD090_120406_zvtx_rebinned_corrected.root");
1762 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected);
1765 GetDistAndFlow(h2, hMixed, &hist1, 0, 0, 0, centralityTo, 2.01, 3.99, 1, kTRUE, 0, kTRUE, startStep);
1766 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1767 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1769 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1770 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1773 gPad->SetLeftMargin(0.15);
1774 hist1->SetTitle("");
1775 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1776 hist1->GetXaxis()->SetTitleOffset(1.5);
1777 hist1->GetZaxis()->SetTitleOffset(1.8);
1778 hist1->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1779 hist1->GetYaxis()->SetTitleOffset(2);
1780 hist1->SetStats(kFALSE);
1781 hist1->DrawCopy("SURF1");
1782 DrawLatex(0.1, 0.85, 1, "Corrected", 0.04);
1783 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1785 hist1->Divide(hist2);
1788 gPad->SetRightMargin(0.15);
1789 hist1->SetTitle("");
1790 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1791 hist1->GetXaxis()->SetTitleOffset(1.2);
1792 hist1->GetYaxis()->SetTitleOffset(1.2);
1793 hist1->GetZaxis()->SetTitle("Ratio: Corrected / MC");
1794 hist1->SetStats(kFALSE);
1795 hist1->GetZaxis()->SetRangeUser(0.99, 1.01);
1796 hist1->DrawCopy("COLZ");
1798 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1800 c->SaveAs("validation.eps");
1801 c->SaveAs("validation.gif");
1804 void DrawValidation(const char* fileName1, const char* fileName2)
1809 CompareStep(fileName1, fileName2, 2, 6, 4, 0, 4.01, 19.99);
1810 CompareStep(fileName1, fileName2, 2, 4, 4, 0, 4.01, 19.99);
1812 CompareStep(fileName1, fileName2, 2, 4, 2, 0, 4.01, 19.99);
1813 CompareStep(fileName1, fileName2, 2, 2, 2, 0, 4.01, 19.99);
1816 void ProfileMultiplicity(const char* fileName = "PWG4_JetTasksOutput.root")
1820 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1823 h->GetCorrelationMultiplicity()->Draw("colz");
1827 h->GetCorrelationMultiplicity()->ProfileX()->DrawCopy()->Fit("pol1", "", "", 1, 10);
1830 void SetupRanges(void* obj)
1834 ((AliUEHistograms*) obj)->SetEtaRange(0, 0);
1835 // ((AliUEHistograms*) obj)->SetEtaRange(-0.99, 0.99); Printf("WARNING: Setting eta Range!");
1836 ((AliUEHistograms*) obj)->SetPtRange(gpTMin, gpTMax);
1837 ((AliUEHistograms*) obj)->SetCombineMinMax(kTRUE);
1839 ((AliUEHistograms*) obj)->SetZVtxRange(-gZVtxRange+0.01, gZVtxRange-0.01);
1842 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)
1844 AliUEHist* corrected = (AliUEHist*) correctedVoid;
1845 AliUEHist* comparison = (AliUEHist*) comparisonVoid;
1847 Int_t beginStep = AliUEHist::kCFStepAll;
1848 Int_t endStep = AliUEHist::kCFStepReconstructed;
1850 if (compareStep != -1)
1852 beginStep = compareStep;
1853 endStep = compareStep;
1856 Int_t beginRegion = 0;
1857 Int_t endRegion = 2;
1859 if (compareRegion != -1)
1861 beginRegion = compareRegion;
1862 endRegion = compareRegion;
1865 for (Int_t step=beginStep; step<=endStep; step++)
1867 if (compareStep == -1 && (step == AliUEHist::kCFStepAnaTopology || step == AliUEHist::kCFStepTriggered))
1870 for (Int_t region=beginRegion; region <= endRegion; region++)
1872 Printf("%f %f", ptLeadMin, ptLeadMax);
1873 TH1* corrHist = corrected->GetUEHist(step, region, ptLeadMin, ptLeadMax);
1874 TH1* mcHist = comparison->GetUEHist(step, region, ptLeadMin, ptLeadMax);
1876 DrawRatio(corrHist, mcHist, TString(Form("%s: step %d %s %s", name, step, corrected->GetStepTitle(step), corrected->GetRegionTitle(region))));
1881 void DrawRatios(void* correctedVoid, void* comparisonVoid, Int_t compareStep = -1, Int_t compareRegion = 2, Int_t compareUEHist = 0)
1883 AliUEHistograms* corrected = (AliUEHistograms*) correctedVoid;
1884 AliUEHistograms* comparison = (AliUEHistograms*) comparisonVoid;
1886 if (1 && compareUEHist == 2)
1888 for (Float_t ptMin = 2.01; ptMin < 8; ptMin += 2)
1890 ((AliUEHistograms*) corrected)->SetPtRange(ptMin, ptMin + 1.98);
1891 ((AliUEHistograms*) comparison)->SetPtRange(ptMin, ptMin + 1.98);
1893 DrawRatios(TString(Form("Dphi %d pT %f", compareUEHist, ptMin)), corrected->GetUEHist(compareUEHist), comparison->GetUEHist(compareUEHist), compareStep, compareRegion, 8.01, 19.99);
1898 if (compareUEHist == -1)
1900 for (Int_t i=0; i<2; i++)
1901 DrawRatios(TString(Form("UE %d", i)), corrected->GetUEHist(i), comparison->GetUEHist(i), compareStep, compareRegion);
1904 DrawRatios(TString(Form("UE %d", compareUEHist)), corrected->GetUEHist(compareUEHist), comparison->GetUEHist(compareUEHist), compareStep, compareRegion);
1907 void CompareEventsTracks(void* corrVoid, void* mcVoid, Int_t compareStep, Int_t compareRegion, Int_t compareUEHist = 0)
1909 AliUEHist* corr = ((AliUEHistograms*) corrVoid)->GetUEHist(compareUEHist);
1910 AliUEHist* mc = ((AliUEHistograms*) mcVoid)->GetUEHist(compareUEHist);
1912 Float_t ptLeadMin = 0;
1913 Float_t ptLeadMax = -1;
1916 if (compareUEHist == 2)
1923 TH1* corrHist = corr->GetUEHist(compareStep, compareRegion, ptLeadMin, ptLeadMax);
1924 TH1* mcHist = mc ->GetUEHist(compareStep, compareRegion, ptLeadMin, ptLeadMax);
1926 DrawRatio(corrHist, mcHist, Form("check"));
1928 corr->SetBinLimits(corr->GetTrackHist(compareRegion)->GetGrid(compareStep));
1929 mc->SetBinLimits(corr->GetTrackHist(compareRegion)->GetGrid(compareStep));
1931 corrHist = corr->GetTrackHist(compareRegion)->GetGrid(compareStep)->Project(axis);
1932 mcHist = mc ->GetTrackHist(compareRegion)->GetGrid(compareStep)->Project(axis);
1933 DrawRatio(corrHist, mcHist, Form("check2"));
1935 corrHist = corr->GetEventHist()->GetGrid(compareStep)->Project(0);
1936 mcHist = mc ->GetEventHist()->GetGrid(compareStep)->Project(0);
1937 DrawRatio(corrHist, mcHist, Form("check3"));
1940 void CopyReconstructedData(const char* fileName)
1944 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1945 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1948 AliUEHistograms* onlyRec = (AliUEHistograms*) h->Clone();
1950 onlyRec->CopyReconstructedData(h);
1952 AliUEHistograms* onlyRecMixed = (AliUEHistograms*) hMixed->Clone();
1953 onlyRecMixed->Reset();
1954 onlyRecMixed->CopyReconstructedData(hMixed);
1956 TString newFileName(fileName);
1957 newFileName.ReplaceAll(".root", "");
1958 newFileName += "_onlyreco.root";
1962 list->Add(onlyRecMixed);
1964 file3 = TFile::Open(newFileName, "RECREATE");
1965 file3->mkdir("PWG4_PhiCorrelations");
1966 file3->cd("PWG4_PhiCorrelations");
1967 list->Write("histosPhiCorrelations", TObject::kSingleKey);
1971 void correctMC(const char* fileNameCorrections, const char* fileNameESD = 0, Int_t compareStep = -1, Int_t compareRegion = 2, Int_t compareUEHist = 0)
1973 // corrects the reconstructed step in fileNameESD with fileNameCorr
1974 // if fileNameESD is 0 data from fileNameCorr is taken
1975 // afterwards the corrected distributions are compared with the MC stored in fileNameESD
1979 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
1982 corr->ExtendTrackingEfficiency();
1984 AliUEHistograms* testSample = corr;
1986 testSample = (AliUEHistograms*) GetUEHistogram(fileNameESD);
1988 // copy to esd object
1989 AliUEHistograms* esd = (AliUEHistograms*) corr->Clone();
1991 esd->CopyReconstructedData(testSample);
1994 SetupRanges(testSample);
2002 file3 = TFile::Open("correctedMC.root", "RECREATE");
2003 file3->mkdir("PWG4_PhiCorrelations");
2004 file3->cd("PWG4_PhiCorrelations");
2005 list->Write("histosPhiCorrelations", TObject::kSingleKey);
2009 DrawRatios(esd, testSample, compareStep, compareRegion, compareUEHist);
2013 esd->SetPtRange(2.01, 3.99);
2014 corrected = esd->GetUEHist(2)->GetUEHist(0, 0, 4.01, 7.99, 0, -1, 1);
2015 testSample->SetPtRange(2.01, 3.99);
2016 mc = testSample->GetUEHist(2)->GetUEHist(0, 0, 4.01, 7.99, 0, -1, 1);
2017 new TCanvas; corrected->DrawCopy("SURF1");
2018 new TCanvas; mc->DrawCopy("SURF1");
2019 new TCanvas; mc->DrawCopy("SURF1")->Divide(corrected);
2022 //CompareEventsTracks(esd, testSample, compareStep, compareRegion, compareUEHist);
2025 // function to compare only final step for all regions and distributions
2027 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)
2029 // corrects fileNameESD with fileNameCorrections and compares the two
2033 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
2036 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD, &list);
2041 Float_t etaRange = 1.2;
2042 Printf(">>>>> Using eta range: |eta| < %f", etaRange);
2043 corr->SetEtaRange(-etaRange+0.01, etaRange-0.01);
2044 corr->ExtendTrackingEfficiency(0);
2046 // corr->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepTracked, AliUEHist::kCFStepTrackedOnlyPrim, 1, -1, 2);
2049 if (contEnhancement)
2051 TFile::Open(contEnhancement);
2052 contEncHist = (TH1*) gFile->Get("histo");
2053 contEncHistFullRange = (TH1*) corr->GetUEHist(0)->GetTrackingEfficiency(1)->Clone("contEncHistFullRange");
2055 contEncHistFullRange->Reset();
2056 for (Int_t i=1; i<=contEncHistFullRange->GetNbinsX(); i++)
2058 contEncHistFullRange->SetBinContent(i, 1);
2059 if (i <= contEncHist->GetNbinsX() && contEncHist->GetXaxis()->GetBinCenter(i) < contEncUpTo && contEncHist->GetBinContent(i) > 0)
2060 contEncHistFullRange->SetBinContent(i, contEncHist->GetBinContent(i));
2062 corr->SetContaminationEnhancement((TH1F*) contEncHistFullRange);
2066 //esd->GetUEHist(2)->AdditionalDPhiCorrection(0);
2068 file3 = TFile::Open("corrected.root", "RECREATE");
2069 file3->mkdir("PWG4_PhiCorrelations");
2070 file3->cd("PWG4_PhiCorrelations");
2071 list->Write("histosPhiCorrelations", TObject::kSingleKey);
2074 // DrawRatios(esd, corr, compareStep, compareRegion, compareUEHist);
2077 void ITSTPCEfficiency(const char* fileNameData, Int_t id, Int_t itsTPC = 0)
2081 // uncertainty from dN/dpT paper
2082 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};
2083 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
2084 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
2086 TH1F* effHist = new TH1F("effHist", "effHist", 39, pTBins);
2087 for (Int_t i=0; i<39; i++)
2092 effHist->SetBinContent(i+1, (itsTPC == 0) ? effITS[bin] : effTPC[bin]);
2095 new TCanvas; effHist->Draw();
2097 EffectOfModifiedTrackingEfficiency(fileNameData, id, 2, effHist, 1, -1, (itsTPC == 0) ? "ITS" : "TPC");
2101 void EffectOfModifiedTrackingEfficiency(const char* fileNameData, Int_t id, Int_t region, TH1* trackingEff, Int_t axis1, Int_t axis2 = -1, const char* name = "EffectOfModifiedTrackingEfficiency")
2103 // trackingEff should contain the change in tracking efficiency, i.e. between before and after in the eta-pT plane
2107 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
2108 SetupRanges(corrected);
2110 AliUEHist* ueHist = corrected->GetUEHist(id);
2112 Float_t ptLeadMin = -1;
2113 Float_t ptLeadMax = -1;
2116 // the uncertainty is flat in delta phi, so use this trick to get directly the uncertainty as function of leading pT
2122 TH1* before = ueHist->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2125 // the CFStepTriggered step is overwritten here and cannot be used for comparison afterwards anymore
2126 ueHist->CorrectTracks(AliUEHist::kCFStepAll, AliUEHist::kCFStepTriggered, (TH1*) 0, 0, -1);
2128 // reapply tracking efficiency
2129 ueHist->CorrectTracks(AliUEHist::kCFStepTriggered, AliUEHist::kCFStepAll, trackingEff, axis1, axis2);
2132 TH1* after = ueHist->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2134 DrawRatio(before, after, name);
2135 gPad->GetCanvas()->SaveAs(Form("%s.png", name));
2138 void EffectOfTrackCuts(const char* fileNameData, Int_t id, const char* systFile)
2142 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
2143 effHist = (TH2D*) corrected->GetUEHist(0)->GetTrackingEfficiency()->Clone("effHist");
2145 file = TFile::Open(systFile);
2148 const char* systNames[] = { "NClusTPC", "Chi2TPC", "SigmaDCA" };
2150 for (Int_t i=0; i<maxSyst; i++)
2152 for (Int_t j=0; j<2; j++)
2155 histName.Form("%s_syst_%s", systNames[i], (j == 0) ? "up" : "down");
2156 systEffect = (TH2*) file->Get(histName);
2160 for (Int_t x=1; x <= effHist->GetNbinsX(); x++)
2161 for (Int_t y=1; y <= effHist->GetNbinsY(); y++)
2162 effHist->SetBinContent(x, y, 1);
2164 for (Int_t x=1; x <= systEffect->GetNbinsX(); x++)
2165 for (Int_t y=1; y <= systEffect->GetNbinsY(); y++)
2166 if (systEffect->GetBinContent(x, y) != 0)
2167 effHist->SetBinContent(effHist->GetXaxis()->FindBin(systEffect->GetYaxis()->GetBinCenter(y)), effHist->GetYaxis()->FindBin(systEffect->GetXaxis()->GetBinCenter(x)), systEffect->GetBinContent(x, y));
2170 //new TCanvas; systEffect->Draw("COLZ"); new TCanvas; effHist->Draw("COLZ");
2172 EffectOfModifiedTrackingEfficiency(fileNameData, id, (id == 2) ? 0 : 2, effHist, 0, 1, histName);
2179 void ModifyComposition(const char* fileNameData, const char* fileNameCorrections, Int_t id, Bool_t verbose = kFALSE)
2183 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
2184 SetupRanges(corrected);
2186 AliUEHistograms* corrections = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
2187 SetupRanges(corrections);
2189 ueHistData = (AliUEHist*) corrected->GetUEHist(id);
2190 ueHistCorrections = (AliUEHist*) corrections->GetUEHist(id);
2193 // the CFStepTriggered step is overwritten here and cannot be used for comparison afterwards anymore
2194 ueHistData->CorrectTracks(AliUEHist::kCFStepAll, AliUEHist::kCFStepTriggered, (TH1*) 0, 0);
2196 Int_t maxRegion = 3;
2197 Float_t ptLeadMin = -1;
2198 Float_t ptLeadMax = -1;
2202 // the uncertainty is flat in delta phi, so use this trick to get directly the uncertainty as function of leading pT
2209 for (Int_t region=0; region<maxRegion; region++)
2210 before[region] = ueHistData->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2212 //defaultEff = ueHistCorrections->GetTrackingEfficiency();
2213 defaultEff = ueHistCorrections->GetTrackingCorrection();
2214 //defaultEffpT = ueHistCorrections->GetTrackingEfficiency(1);
2215 defaultEffpT = ueHistCorrections->GetTrackingCorrection(1);
2216 defaultContainer = ueHistCorrections->GetTrackHistEfficiency();
2219 defaultEffpT->Draw("");
2221 Float_t largestDeviation[3];
2222 for (Int_t i=0; i<maxRegion; i++)
2223 largestDeviation[i] = 0;
2225 for (Int_t i=0; i<7; i++)
2227 // case 0: // default
2228 // case 1: // + 30% kaons
2229 // case 2: // - 30% kaons
2230 // case 3: // + 30% protons
2231 // case 4: // - 30% protons
2232 // case 5: // + 30% others
2233 // case 6: // - 30% others
2234 Int_t correctionIndex = (i+1) / 2 + 1; // bin 1 == protons, bin 2 == kaons, ...
2235 Double_t scaleFactor = (i % 2 == 1) ? 1.3 : 0.7;
2239 newContainer = (AliCFContainer*) defaultContainer->Clone();
2241 // modify, change all steps
2242 for (Int_t j=0; j<newContainer->GetNStep(); j++)
2244 THnSparse* grid = newContainer->GetGrid(j)->GetGrid();
2246 for (Int_t binIdx = 0; binIdx < grid->GetNbins(); binIdx++)
2249 Double_t value = grid->GetBinContent(binIdx, bins);
2250 Double_t error = grid->GetBinError(binIdx);
2252 if (bins[2] != correctionIndex)
2255 value *= scaleFactor;
2256 error *= scaleFactor;
2258 grid->SetBinContent(bins, value);
2259 grid->SetBinError(bins, error);
2263 // put in corrections
2264 ueHistCorrections->SetTrackHistEfficiency(newContainer);
2267 //modifiedEff = ueHistCorrections->GetTrackingEfficiency();
2268 modifiedEff = ueHistCorrections->GetTrackingCorrection();
2269 modifiedEff->Divide(modifiedEff, defaultEff);
2270 //modifiedEff->Draw("COLZ");
2273 //modifiedEffpT = ueHistCorrections->GetTrackingEfficiency(1);
2274 modifiedEffpT = ueHistCorrections->GetTrackingCorrection(1);
2275 modifiedEffpT->SetLineColor(i+1);
2276 modifiedEffpT->Draw("SAME");
2278 // apply change in tracking efficiency
2279 ueHistData->CorrectTracks(AliUEHist::kCFStepTriggered, AliUEHist::kCFStepAll, modifiedEff, 0, 1);
2281 for (Int_t region=0; region<maxRegion; region++)
2284 TH1* after = ueHistData->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2287 DrawRatio(before[region], (TH1*) after->Clone(), Form("Region %d Composition %d", region, i));
2289 // ratio is flat, extract deviation
2290 after->Divide(before[region]);
2291 after->Fit("pol0", "0");
2292 Float_t deviation = 100.0 - 100.0 * after->GetFunction("pol0")->GetParameter(0);
2293 Printf("Deviation for region %d case %d is %.2f %%", region, i, deviation);
2295 if (TMath::Abs(deviation) > largestDeviation[region])
2296 largestDeviation[region] = TMath::Abs(deviation);
2301 for (Int_t i=0; i<maxRegion; i++)
2302 Printf("Largest deviation in region %d is %f", i, largestDeviation[i]);
2305 void MergeList(const char* prefix = "", const char* suffix = "", Bool_t copy = kFALSE)
2308 gSystem->Load("libPWGflowBase");
2309 gSystem->Load("libPWGflowTasks");
2314 TFileMerger m(copy);
2321 if (line.Length() == 0)
2325 fileName.Form("%s%s%s", prefix, line.Data(), suffix);
2326 // fileName.Form("alien://%s", line.Data());
2327 Printf("%s", fileName.Data());
2329 m.AddFile(fileName);
2333 m.OutputFile("merged.root");
2337 void Merge2(const char* file1, const char* file2)
2346 m.OutputFile("merged.root");
2350 void Merge3(const char* file1, const char* file2, const char* file3)
2360 m.OutputFile("merged.root");
2364 void MergeList2(const char* listFile, const char* dir, Bool_t onlyPrintEvents = kFALSE, const char* targetDir = "PWG4_LeadingTrackUE")
2371 AliUEHistograms* final = 0;
2372 TList* finalList = 0;
2379 if (line.Length() == 0)
2383 fileName.Form("%s/%s/PWG4_JetTasksOutput.root", dir, line.Data());
2384 Printf("%s", fileName.Data());
2387 AliUEHistograms* obj = (AliUEHistograms*) GetUEHistogram(fileName, &list);
2393 final = (AliUEHistograms*) obj;
2394 //final->GetEventCount()->Draw(); return;
2395 Printf("Events: %d", (Int_t) final->GetEventCount()->ProjectionX()->GetBinContent(4));
2400 additional = (AliUEHistograms*) obj;
2401 Printf("Events: %d", (Int_t) additional->GetEventCount()->ProjectionX()->GetBinContent(4));
2403 if (!onlyPrintEvents)
2406 list2.Add(additional);
2407 final->Merge(&list2);
2414 if (onlyPrintEvents)
2417 Printf("Total events (at step 0): %d", (Int_t) final->GetEventCount()->ProjectionX()->GetBinContent(4));
2419 file3 = TFile::Open("merged.root", "RECREATE");
2420 file3->mkdir(targetDir);
2421 file3->cd(targetDir);
2422 finalList->Write(0, TObject::kSingleKey);
2426 void PlotAll(const char* correctedFile, const char* mcFile)
2432 Float_t range[] = { 1.5, 2 };
2436 Float_t range[] = { 3, 10 };
2439 for (Int_t id=0; id<3; id++)
2442 gForceRange = range[id];
2448 for (Int_t region=0; region<3; region++)
2450 CompareStep(correctedFile, mcFile, id, 0, region);
2451 gPad->GetCanvas()->SaveAs(Form("%s_%s_%d_%d.png", TString(correctedFile).Tokenize(".")->First()->GetName(), TString(mcFile).Tokenize(".")->First()->GetName(), id, region));
2456 Float_t leadingPtArr[] = { 0.50, 2.0, 4.0, 6.0, 10.0, 20.0, 50.0 };
2457 for (Int_t leadingPtID=0; leadingPtID<6; leadingPtID++)
2459 CompareStep(correctedFile, mcFile, id, 0, 0, leadingPtArr[leadingPtID] + 0.01, leadingPtArr[leadingPtID+1] - 0.01);
2460 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]));
2467 TGraph* GetFlow2040()
2469 // from first ALICE flow paper (provided by Raimond)
2470 // http://www-library.desy.de/spires/find/hep/www?eprint=arXiv:1011.3914
2472 // centrality 20-30%
2473 Double_t xCumulant4th2030ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2474 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
2475 5.500000,7.000000,9.000000};
2476 Double_t yCumulant4th2030ALICE[] = {0.000000,0.000000,0.030926,0.041076,0.052063,0.059429,0.070500,0.084461,0.086745,0.099254,
2477 0.109691,0.116398,0.130831,0.141959,0.158932,0.169680,0.171387,0.178858,0.171475,0.140358,
2478 0.000000,0.000000,0.000000};
2479 Double_t xErrCumulant4th2030ALICE[23] = {0.};
2480 Double_t yErrCumulant4th2030ALICE[] = {0.000000,0.000000,0.002857,0.003451,0.003567,0.003859,0.004609,0.004976,0.005412,0.006277,
2481 0.004748,0.005808,0.006896,0.007987,0.008683,0.008080,0.013278,0.018413,0.024873,0.026057,
2482 0.000000,0.000000,0.000000};
2483 Int_t nPointsCumulant4th2030ALICE = sizeof(xCumulant4th2030ALICE)/sizeof(Double_t);
2484 TGraphErrors *Cumulant4th2030ALICE = new TGraphErrors(nPointsCumulant4th2030ALICE,xCumulant4th2030ALICE,yCumulant4th2030ALICE,
2485 xErrCumulant4th2030ALICE,yErrCumulant4th2030ALICE);
2486 Cumulant4th2030ALICE->SetMarkerStyle(kFullSquare);
2487 Cumulant4th2030ALICE->SetMarkerColor(kRed);
2488 Cumulant4th2030ALICE->SetMarkerSize(1.2);
2489 Cumulant4th2030ALICE->SetFillStyle(1001);
2490 Cumulant4th2030ALICE->SetFillColor(kRed-10);
2492 //===================================================================================================================
2493 // centrality 30-40%
2494 Double_t xCumulant4th3040ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2495 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
2496 5.500000,7.000000,9.000000};
2497 Double_t yCumulant4th3040ALICE[] = {0.000000,0.000000,0.037071,0.048566,0.061083,0.070910,0.078831,0.091396,0.102026,0.109691,
2498 0.124449,0.139819,0.155561,0.165701,0.173678,0.191149,0.202015,0.204540,0.212560,0.195885,
2499 0.000000,0.000000,0.000000};
2500 Double_t xErrCumulant4th3040ALICE[23] = {0.};
2501 Double_t yErrCumulant4th3040ALICE[] = {0.000000,0.000000,0.002992,0.003364,0.003669,0.003931,0.004698,0.005261,0.005446,0.006151,
2502 0.004980,0.005741,0.007198,0.008576,0.010868,0.009926,0.015269,0.020691,0.027601,0.031834,
2503 0.000000,0.000000,0.000000};
2504 Int_t nPointsCumulant4th3040ALICE = sizeof(xCumulant4th3040ALICE)/sizeof(Double_t);
2505 TGraphErrors *Cumulant4th3040ALICE = new TGraphErrors(nPointsCumulant4th3040ALICE,xCumulant4th3040ALICE,yCumulant4th3040ALICE,
2506 xErrCumulant4th3040ALICE,yErrCumulant4th3040ALICE);
2507 Cumulant4th3040ALICE->SetMarkerStyle(kFullTriangleUp);
2508 Cumulant4th3040ALICE->SetMarkerColor(kGreen+2);
2509 Cumulant4th3040ALICE->SetMarkerSize(1.2);
2510 Cumulant4th3040ALICE->SetFillStyle(1001);
2511 Cumulant4th3040ALICE->SetFillColor(kGreen+2);
2513 // build average between the two (for class 20-40%)
2514 Double_t* yAverage = new Double_t[nPointsCumulant4th3040ALICE];
2515 for (Int_t i=0; i<nPointsCumulant4th3040ALICE; i++)
2516 yAverage[i] = (yCumulant4th2030ALICE[i] + yCumulant4th3040ALICE[i]) / 2;
2518 // assume flow constant above highest pT; not neccessarily physically sound ;)
2521 yAverage[20] = yAverage[19];
2522 xCumulant4th3040ALICE[20] = 100;
2523 nPointsCumulant4th3040ALICE -= 2;
2526 TGraph *flow2040 = new TGraph(nPointsCumulant4th3040ALICE,xCumulant4th3040ALICE,yAverage);
2530 flow2040->Draw("*A");
2531 Cumulant4th2030ALICE->Draw("PSAME");
2532 Cumulant4th3040ALICE->Draw("PSAME");
2540 TGraph* GetFlow1020()
2542 // from first ALICE flow paper (provided by Raimond)
2543 // http://www-library.desy.de/spires/find/hep/www?eprint=arXiv:1011.3914
2545 //===================================================================================================================
2546 // centrality 10-20%
2547 Double_t xCumulant4th1020ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2548 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
2549 5.500000,7.000000,9.000000};
2550 Double_t yCumulant4th1020ALICE[] = {0.000000,0.000000,0.024075,0.031505,0.040413,0.044981,0.055358,0.060563,0.063378,0.070030,
2551 0.082692,0.091611,0.099641,0.107223,0.122376,0.131240,0.137425,0.146050,0.131365,0.124708,
2552 0.000000,0.000000,0.000000};
2553 Double_t xErrCumulant4th1020ALICE[23] = {0.};
2554 Double_t yErrCumulant4th1020ALICE[] = {0.000000,0.000000,0.002413,0.002931,0.003444,0.003950,0.004338,0.004835,0.005059,0.005586,
2555 0.004521,0.005278,0.005999,0.007072,0.008260,0.007279,0.011897,0.017409,0.023995,0.025701,
2556 0.000000,0.000000,0.000000};
2557 Int_t nPointsCumulant4th1020ALICE = sizeof(xCumulant4th1020ALICE)/sizeof(Double_t);
2559 // assume flow constant above highest pT; not neccessarily physically sound ;)
2562 yCumulant4th1020ALICE[20] = yCumulant4th1020ALICE[19];
2563 xCumulant4th1020ALICE[20] = 100;
2564 nPointsCumulant4th1020ALICE -= 2;
2567 TGraphErrors *Cumulant4th1020ALICE = new TGraphErrors(nPointsCumulant4th1020ALICE,xCumulant4th1020ALICE,yCumulant4th1020ALICE,
2568 xErrCumulant4th1020ALICE,yErrCumulant4th1020ALICE);
2570 Cumulant4th1020ALICE->SetMarkerStyle(kFullCircle);
2571 Cumulant4th1020ALICE->SetMarkerColor(kBlue);
2572 Cumulant4th1020ALICE->SetMarkerSize(1.2);
2573 Cumulant4th1020ALICE->SetFillStyle(1001);
2574 Cumulant4th1020ALICE->SetFillColor(kBlue-10);
2576 TGraph *flow1020 = new TGraph(nPointsCumulant4th1020ALICE,xCumulant4th1020ALICE,yCumulant4th1020ALICE);
2580 flow1020->Draw("*A");
2581 Cumulant4th1020ALICE->Draw("PSAME");
2591 // takes flow measurement from 10-20% and scales by a factor extracted from Fig.3 in the ALICE flow paper
2592 // factor = integrated flow in 0-5% / integrated flow in 10-20%
2594 graph = GetFlow1020();
2595 for (Int_t i=0; i<graph->GetN(); i++)
2596 graph->GetY()[i] *= 0.016 / 0.055;
2601 TGraphErrors* GetFlow01_Rap02(Int_t n)
2603 // private communication 19.04.11, Raimond / Ante
2607 // v2{SP}(pt) for 0-1%, rapidity gap = 0.2:
2608 const Int_t nPointsSP_0001ALICE_v2_etaGap02 = 18;
2609 Double_t xSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2610 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};
2611 Double_t ySP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.009235,0.014105,0.017274,0.018245,0.023190,
2612 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};
2613 Double_t xErrSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.};
2614 Double_t yErrSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.000515,0.000504,0.000532,0.000585,0.000641,
2615 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};
2616 TGraphErrors *SP_0001ALICE_v2_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v2_etaGap02,xSP_0001ALICE_v2_etaGap02,
2617 ySP_0001ALICE_v2_etaGap02,xErrSP_0001ALICE_v2_etaGap02,yErrSP_0001ALICE_v2_etaGap02);
2618 SP_0001ALICE_v2_etaGap02->SetMarkerStyle(kFullCircle);
2619 SP_0001ALICE_v2_etaGap02->SetMarkerColor(kBlue);
2620 SP_0001ALICE_v2_etaGap02->SetFillStyle(1001);
2621 SP_0001ALICE_v2_etaGap02->SetFillColor(kBlue-10);
2623 return SP_0001ALICE_v2_etaGap02;
2628 // v3{SP}(pt) for 0-1%, rapidity gap = 0.2:
2629 const Int_t nPointsSP_0001ALICE_v3_etaGap02 = 18;
2630 Double_t xSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2631 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};
2632 Double_t ySP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.005688,0.007222,0.010305,0.013795,0.016077,
2633 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};
2634 Double_t xErrSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.};
2635 Double_t yErrSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.000585,0.000582,0.000614,0.000667,0.000734,
2636 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};
2637 TGraphErrors *SP_0001ALICE_v3_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v3_etaGap02,xSP_0001ALICE_v3_etaGap02,ySP_0001ALICE_v3_etaGap02,
2638 xErrSP_0001ALICE_v3_etaGap02,yErrSP_0001ALICE_v3_etaGap02);
2639 SP_0001ALICE_v3_etaGap02->SetMarkerStyle(kFullTriangleUp);
2640 SP_0001ALICE_v3_etaGap02->SetMarkerSize(1.4);
2641 SP_0001ALICE_v3_etaGap02->SetMarkerColor(kGreen+2);
2642 SP_0001ALICE_v3_etaGap02->SetFillStyle(1001);
2643 SP_0001ALICE_v3_etaGap02->SetFillColor(kGreen-10);
2645 return SP_0001ALICE_v3_etaGap02;
2650 // v4{SP}(pt) for 0-1%, rapidity gap = 0.2:
2651 const Int_t nPointsSP_0001ALICE_v4_etaGap02 = 18;
2652 Double_t xSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2653 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};
2654 Double_t ySP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.001189,0.003540,0.004682,0.004210,0.007032,
2655 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};
2656 Double_t xErrSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.};
2657 Double_t yErrSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.001035,0.001017,0.001081,0.001187,0.001299,
2658 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};
2659 TGraphErrors *SP_0001ALICE_v4_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v4_etaGap02,xSP_0001ALICE_v4_etaGap02,ySP_0001ALICE_v4_etaGap02,
2660 xErrSP_0001ALICE_v4_etaGap02,yErrSP_0001ALICE_v4_etaGap02);
2661 SP_0001ALICE_v4_etaGap02->SetMarkerStyle(kFullSquare);
2662 SP_0001ALICE_v4_etaGap02->SetMarkerColor(kRed);
2663 SP_0001ALICE_v4_etaGap02->SetFillStyle(1001);
2664 SP_0001ALICE_v4_etaGap02->SetFillColor(kRed-10);
2666 return SP_0001ALICE_v4_etaGap02;
2672 TGraphErrors* GetFlow01_Rap10(Int_t n)
2676 // v2{SP}(pt) for 0-1%, rapidity gap = 1.0:
2677 const Int_t nPointsSP_0001ALICE_v2_etaGap10 = 21;
2678 Double_t xSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2679 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,
2680 3.250000,3.750000,4.500000};
2681 Double_t ySP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.009129,0.013461,0.017567,0.018041,0.020384,
2682 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,
2683 0.036905,0.054836,0.030527};
2684 Double_t xErrSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.};
2685 Double_t yErrSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.001179,0.001152,0.001219,0.001339,0.001480,
2686 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,
2687 0.009145,0.014749,0.018698};
2688 TGraphErrors *SP_0001ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v2_etaGap10,xSP_0001ALICE_v2_etaGap10,
2689 ySP_0001ALICE_v2_etaGap10,xErrSP_0001ALICE_v2_etaGap10,yErrSP_0001ALICE_v2_etaGap10);
2690 SP_0001ALICE_v2_etaGap10->SetMarkerStyle(kOpenCircle);
2691 SP_0001ALICE_v2_etaGap10->SetMarkerColor(kBlue);
2692 SP_0001ALICE_v2_etaGap10->SetFillStyle(1001);
2693 SP_0001ALICE_v2_etaGap10->SetFillColor(kBlue-10);
2695 return SP_0001ALICE_v2_etaGap10;
2700 // v3{SP}(pt) for 0-1%, rapidity gap = 1.0:
2701 const Int_t nPointsSP_0001ALICE_v3_etaGap10 = 18;
2702 Double_t xSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2703 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};
2704 Double_t ySP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.006373,0.008403,0.010848,0.011505,0.016728,
2705 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};
2706 Double_t xErrSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.};
2707 Double_t yErrSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.001286,0.001269,0.001346,0.001474,0.001620,
2708 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};
2709 TGraphErrors *SP_0001ALICE_v3_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v3_etaGap10,xSP_0001ALICE_v3_etaGap10,ySP_0001ALICE_v3_etaGap10,
2710 xErrSP_0001ALICE_v3_etaGap10,yErrSP_0001ALICE_v3_etaGap10);
2711 SP_0001ALICE_v3_etaGap10->SetMarkerStyle(kOpenTriangleUp);
2712 SP_0001ALICE_v3_etaGap10->SetMarkerSize(1.2);
2713 SP_0001ALICE_v3_etaGap10->SetMarkerColor(kGreen+2);
2714 SP_0001ALICE_v3_etaGap10->SetFillStyle(1001);
2715 SP_0001ALICE_v3_etaGap10->SetFillColor(kGreen-10);
2717 return SP_0001ALICE_v3_etaGap10;
2722 // v4{SP}(pt) for 0-1%, rapidity gap = 1.0:
2723 const Int_t nPointsSP_0001ALICE_v4_etaGap10 = 11;
2724 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};
2725 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};
2726 Double_t xErrSP_0001ALICE_v4_etaGap10[nPointsSP_0001ALICE_v4_etaGap10] = {0.};
2727 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};
2728 TGraphErrors *SP_0001ALICE_v4_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v4_etaGap10,xSP_0001ALICE_v4_etaGap10,ySP_0001ALICE_v4_etaGap10,
2729 xErrSP_0001ALICE_v4_etaGap10,yErrSP_0001ALICE_v4_etaGap10);
2730 SP_0001ALICE_v4_etaGap10->SetMarkerStyle(kOpenSquare);
2731 SP_0001ALICE_v4_etaGap10->SetMarkerColor(kRed);
2732 SP_0001ALICE_v4_etaGap10->SetFillStyle(1001);
2733 SP_0001ALICE_v4_etaGap10->SetFillColor(kRed-10);
2735 return SP_0001ALICE_v4_etaGap10;
2740 // v5{SP}(pt) for 0-1%, rapidity gap = 1.0:
2741 const Int_t nPointsSP_0001ALICE_v5_etaGap10 = 11;
2742 Double_t xSP_0001ALICE_v5_etaGap10[nPointsSP_0001ALICE_v5_etaGap10] = {0.300000,0.500000,0.700000,0.900000,1.200000,1.600000,2.000000,2.400000,2.800000,3.500000,4.500000};
2743 Double_t ySP_0001ALICE_v5_etaGap10[nPointsSP_0001ALICE_v5_etaGap10] = {0.007022,0.001344,0.008380,0.004298,-0.001444,0.014114,0.015012,0.041880,0.019820,0.042083,0.015268};
2744 Double_t xErrSP_0001ALICE_v5_etaGap10[nPointsSP_0001ALICE_v5_etaGap10] = {0.};
2745 Double_t yErrSP_0001ALICE_v5_etaGap10[nPointsSP_0001ALICE_v5_etaGap10] = {0.002713,0.003167,0.003741,0.004650,0.004525,0.006578,0.009986,0.015185,0.022535,0.026356,0.064773};
2746 TGraphErrors *SP_0001ALICE_v5_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v5_etaGap10,xSP_0001ALICE_v5_etaGap10,ySP_0001ALICE_v5_etaGap10,
2747 xErrSP_0001ALICE_v5_etaGap10,yErrSP_0001ALICE_v5_etaGap10);
2748 return SP_0001ALICE_v5_etaGap10;
2752 TGraphErrors* GetFlow02_Rap10(Int_t n)
2754 // private communication 20.04.11, Ante B. / Raimond
2758 // v2{SP}(pt) for 00-02%, eta gap = 1.0:
2759 const Int_t nPointsSP_0002_v2_etaGap10 = 15;
2760 Double_t xSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
2761 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
2762 Double_t ySP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.010171,0.013190,0.017342,0.020629,0.022617,0.026549,
2763 0.027423,0.032261,0.037467,0.041001,0.045763,0.049327,0.049688,0.051480,0.038527};
2764 Double_t xErrSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.};
2765 Double_t yErrSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.000600,0.000590,0.000625,0.000683,0.000757,0.000839,
2766 0.000692,0.000848,0.000888,0.001209,0.001653,0.002252,0.002465,0.003968,0.009391};
2767 TGraphErrors *SP_0002_v2_etaGap10 = new TGraphErrors(nPointsSP_0002_v2_etaGap10,xSP_0002_v2_etaGap10,ySP_0002_v2_etaGap10,
2768 xErrSP_0002_v2_etaGap10,yErrSP_0002_v2_etaGap10);
2770 return SP_0002_v2_etaGap10;
2775 const Int_t nPointsSP_0002_v3_etaGap10 = 15;
2776 Double_t xSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
2777 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
2778 Double_t ySP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.006592,0.007286,0.012180,0.012242,0.017416,0.018393,
2779 0.024716,0.030980,0.037703,0.046558,0.051285,0.064613,0.074831,0.077093,0.082442};
2780 Double_t xErrSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.};
2781 Double_t yErrSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.000682,0.000676,0.000713,0.000782,0.000860,0.000953,
2782 0.000782,0.000957,0.001002,0.001361,0.001862,0.002541,0.002767,0.004466,0.010586};
2783 TGraphErrors *SP_0002_v3_etaGap10 = new TGraphErrors(nPointsSP_0002_v3_etaGap10,xSP_0002_v3_etaGap10,ySP_0002_v3_etaGap10,
2784 xErrSP_0002_v3_etaGap10,yErrSP_0002_v3_etaGap10);
2786 return SP_0002_v3_etaGap10;
2791 const Int_t nPointsSP_0002_v4_etaGap10 = 15;
2792 Double_t xSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
2793 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
2794 Double_t ySP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {-0.000533,0.001167,0.002081,0.005218,0.006826,0.008440,
2795 0.013009,0.014812,0.017125,0.030106,0.038279,0.050488,0.067640,0.071637,0.084239};
2796 Double_t xErrSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.};
2797 Double_t yErrSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.001427,0.001398,0.001482,0.001594,0.001758,0.001945,
2798 0.001593,0.001951,0.002046,0.002787,0.003802,0.005182,0.005663,0.009064,0.021449};
2799 TGraphErrors *SP_0002_v4_etaGap10 = new TGraphErrors(nPointsSP_0002_v4_etaGap10,xSP_0002_v4_etaGap10,ySP_0002_v4_etaGap10,
2800 xErrSP_0002_v4_etaGap10,yErrSP_0002_v4_etaGap10);
2801 return SP_0002_v4_etaGap10;
2806 // v5{SP}(pt) for 00-02%, eta gap = 0.2:
2807 const Int_t nPointsSP_0002_v5_etaGap02 = 13;
2808 Double_t xSP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.300000,0.500000,0.700000,0.900000,1.100000,1.300000,1.500000,
2809 1.700000,2.000000,2.550000,3.250000,3.950000,4.650000};
2810 Double_t ySP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.000570,0.002922,0.002151,0.005256,0.006287,0.005849,0.009399,
2811 0.011420,0.012455,0.032134,0.057009,0.020607,0.013551};
2812 Double_t xErrSP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.};
2813 Double_t yErrSP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.001074,0.001155,0.001433,0.001725,0.002123,0.002608,0.003196,
2814 0.003930,0.003755,0.004869,0.009719,0.018353,0.031814};
2815 TGraphErrors *SP_0002_v5_etaGap02 = new TGraphErrors(nPointsSP_0002_v5_etaGap02,xSP_0002_v5_etaGap02,ySP_0002_v5_etaGap02,
2816 xErrSP_0002_v5_etaGap02,yErrSP_0002_v5_etaGap02);
2817 return SP_0002_v5_etaGap02;
2821 TGraphErrors* GetFlow02(Int_t n)
2823 // private communication 28.01.11, Ante B. / Raimond
2828 Double_t xCumulant2nd0002ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2829 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2830 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
2832 Double_t yCumulant2nd0002ALICE_v2[] = {0.000000,0.000000,0.012173,0.015186,0.018580,0.021114,0.024646,0.027040,0.030269,0.032677,
2833 0.035332,0.037382,0.039228,0.040614,0.042460,0.044658,0.046246,0.050392,0.051436,0.054669,
2834 0.057330,0.063439,0.067425,0.060144,0.071260,0.070206,0.000000,0.000000,0.000000,0.000000,
2836 Double_t xErrCumulant2nd0002ALICE_v2[31] = {0.};
2837 Double_t yErrCumulant2nd0002ALICE_v2[] = {0.000000,0.000000,0.000256,0.000259,0.000271,0.000296,0.000322,0.000357,0.000397,0.000438,
2838 0.000483,0.000529,0.000590,0.000639,0.000713,0.000793,0.000877,0.000976,0.001070,0.001197,
2839 0.000725,0.001265,0.002069,0.003156,0.004605,0.006543,0.000000,0.000000,0.000000,0.000000,
2841 Int_t nPointsCumulant2nd0002ALICE_v2 = sizeof(xCumulant2nd0002ALICE_v2)/sizeof(Double_t);
2842 TGraphErrors *Cumulant2nd0002ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v2,xCumulant2nd0002ALICE_v2,yCumulant2nd0002ALICE_v2,
2843 xErrCumulant2nd0002ALICE_v2,yErrCumulant2nd0002ALICE_v2);
2844 Cumulant2nd0002ALICE_v2->SetMarkerStyle(kFullCircle);
2845 Cumulant2nd0002ALICE_v2->SetMarkerColor(kBlue);
2847 return Cumulant2nd0002ALICE_v2;
2853 Double_t xCumulant2nd0002ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2854 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2855 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
2857 Double_t yCumulant2nd0002ALICE_v3[] = {0.000000,0.000000,0.007696,0.008994,0.010544,0.013269,0.016330,0.019234,0.023465,0.026803,
2858 0.029906,0.032211,0.035300,0.038158,0.041861,0.046002,0.049382,0.053574,0.055773,0.059420,
2859 0.069373,0.079922,0.090265,0.103583,0.111358,0.090740,0.000000,0.000000,0.000000,0.000000,
2861 Double_t xErrCumulant2nd0002ALICE_v3[31] = {0.};
2862 Double_t yErrCumulant2nd0002ALICE_v3[] = {0.000000,0.000000,0.000318,0.000317,0.000333,0.000360,0.000392,0.000431,0.000476,0.000523,
2863 0.000575,0.000637,0.000707,0.000785,0.000878,0.000964,0.001064,0.001175,0.001320,0.001459,
2864 0.000889,0.001539,0.002530,0.003826,0.005614,0.007892,0.000000,0.000000,0.000000,0.000000,
2866 Int_t nPointsCumulant2nd0002ALICE_v3 = sizeof(xCumulant2nd0002ALICE_v3)/sizeof(Double_t);
2867 TGraphErrors *Cumulant2nd0002ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v3,xCumulant2nd0002ALICE_v3,yCumulant2nd0002ALICE_v3,
2868 xErrCumulant2nd0002ALICE_v3,yErrCumulant2nd0002ALICE_v3);
2869 Cumulant2nd0002ALICE_v3->SetMarkerStyle(kFullTriangleUp);
2870 Cumulant2nd0002ALICE_v3->SetMarkerSize(1.2);
2871 Cumulant2nd0002ALICE_v3->SetMarkerColor(kGreen+2);
2873 return Cumulant2nd0002ALICE_v3;
2879 Double_t xCumulant2nd0002ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2880 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2881 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
2883 Double_t yCumulant2nd0002ALICE_v4[] = {0.000000,0.000000,0.005710,0.006014,0.004483,0.005453,0.007714,0.006837,0.009721,0.011288,
2884 0.012531,0.016461,0.016606,0.018587,0.022722,0.025497,0.025832,0.030994,0.030349,0.034730,
2885 0.045529,0.061153,0.074238,0.079307,0.088885,0.085218,0.000000,0.000000,0.000000,0.000000,
2887 Double_t xErrCumulant2nd0002ALICE_v4[31] = {0.};
2888 Double_t yErrCumulant2nd0002ALICE_v4[] = {0.000000,0.000000,0.000488,0.000493,0.000523,0.000571,0.000609,0.000678,0.000742,0.000805,
2889 0.000903,0.000985,0.001100,0.001219,0.001352,0.001503,0.001682,0.001847,0.002060,0.002303,
2890 0.001400,0.002431,0.003974,0.006040,0.008901,0.012343,0.000000,0.000000,0.000000,0.000000,
2892 Int_t nPointsCumulant2nd0002ALICE_v4 = sizeof(xCumulant2nd0002ALICE_v4)/sizeof(Double_t);
2893 TGraphErrors *Cumulant2nd0002ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v4,xCumulant2nd0002ALICE_v4,yCumulant2nd0002ALICE_v4,
2894 xErrCumulant2nd0002ALICE_v4,yErrCumulant2nd0002ALICE_v4);
2895 Cumulant2nd0002ALICE_v4->SetMarkerStyle(kFullSquare);
2896 Cumulant2nd0002ALICE_v4->SetMarkerColor(kRed);
2898 return Cumulant2nd0002ALICE_v4;
2904 /* results up to 5 GeV/c
2906 TGraphErrors* GetFlow05(Int_t n)
2908 // private communication 02.02.11, Ante B. / Raimond
2912 // v2{2}(pt) for 0-5%:
2913 Double_t xCumulant2nd0005ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2914 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2915 Double_t yCumulant2nd0005ALICE_v2[] = {0.000000,0.000000,0.013891,0.017693,0.021693,0.025323,0.029131,0.032443,0.035781,0.038256,
2916 0.042801,0.047705,0.053229,0.057387,0.062677,0.068815,0.077695,0.082058,0.082511,0.079791};
2917 Double_t xErrCumulant2nd0005ALICE_v2[20] = {0.};
2918 Double_t yErrCumulant2nd0005ALICE_v2[] = {0.000000,0.000000,0.000149,0.000150,0.000160,0.000174,0.000191,0.000211,0.000233,0.000257,
2919 0.000208,0.000254,0.000311,0.000377,0.000464,0.000419,0.000726,0.001180,0.001791,0.002131};
2920 Int_t nPointsCumulant2nd0005ALICE_v2 = sizeof(xCumulant2nd0005ALICE_v2)/sizeof(Double_t);
2921 TGraphErrors *Cumulant2nd0005ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v2,xCumulant2nd0005ALICE_v2,yCumulant2nd0005ALICE_v2,
2922 xErrCumulant2nd0005ALICE_v2,yErrCumulant2nd0005ALICE_v2);
2923 Cumulant2nd0005ALICE_v2->SetMarkerStyle(kFullCircle);
2924 Cumulant2nd0005ALICE_v2->SetMarkerColor(kBlue);
2926 return Cumulant2nd0005ALICE_v2;
2931 // v3{2}(pt) for 0-5%:
2932 Double_t xCumulant2nd0005ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2933 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2934 Double_t yCumulant2nd0005ALICE_v3[] = {0.000000,0.000000,0.007788,0.009472,0.011596,0.014618,0.017540,0.021020,0.024946,0.028004,
2935 0.032330,0.039491,0.046368,0.053620,0.060662,0.071750,0.086746,0.097857,0.103111,0.104796};
2936 Double_t xErrCumulant2nd0005ALICE_v3[20] = {0.};
2937 Double_t yErrCumulant2nd0005ALICE_v3[] = {0.000000,0.000000,0.000194,0.000192,0.000204,0.000221,0.000241,0.000265,0.000293,0.000323,
2938 0.000266,0.000323,0.000397,0.000486,0.000601,0.000545,0.000947,0.001541,0.002328,0.002777};
2939 Int_t nPointsCumulant2nd0005ALICE_v3 = sizeof(xCumulant2nd0005ALICE_v3)/sizeof(Double_t);
2940 TGraphErrors *Cumulant2nd0005ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v3,xCumulant2nd0005ALICE_v3,yCumulant2nd0005ALICE_v3,
2941 xErrCumulant2nd0005ALICE_v3,yErrCumulant2nd0005ALICE_v3);
2942 Cumulant2nd0005ALICE_v3->SetMarkerStyle(kFullCircle);
2943 Cumulant2nd0005ALICE_v3->SetMarkerColor(kBlue);
2945 return Cumulant2nd0005ALICE_v3;
2950 // v4{2}(pt) for 0-5%:
2951 Double_t xCumulant2nd0005ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2952 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2953 Double_t yCumulant2nd0005ALICE_v4[] = {0.000000,0.000000,0.006121,0.006137,0.005598,0.005956,0.007262,0.007991,0.009159,0.012062,
2954 0.015085,0.019225,0.024782,0.030092,0.035708,0.046542,0.060077,0.076088,0.082964,0.085405};
2955 Double_t xErrCumulant2nd0005ALICE_v4[20] = {0.};
2956 Double_t yErrCumulant2nd0005ALICE_v4[] = {0.000000,0.000000,0.000275,0.000278,0.000294,0.000319,0.000346,0.000380,0.000419,0.000459,
2957 0.000378,0.000460,0.000570,0.000700,0.000865,0.000789,0.001370,0.002227,0.003370,0.004018};
2958 Int_t nPointsCumulant2nd0005ALICE_v4 = sizeof(xCumulant2nd0005ALICE_v4)/sizeof(Double_t);
2959 TGraphErrors *Cumulant2nd0005ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v4,xCumulant2nd0005ALICE_v4,yCumulant2nd0005ALICE_v4,
2960 xErrCumulant2nd0005ALICE_v4,yErrCumulant2nd0005ALICE_v4);
2961 Cumulant2nd0005ALICE_v4->SetMarkerStyle(kFullCircle);
2962 Cumulant2nd0005ALICE_v4->SetMarkerColor(kBlue);
2964 return Cumulant2nd0005ALICE_v4;
2970 TGraphErrors* GetFlow510(Int_t n)
2972 // private communication 02.02.11, Ante B. / Raimond
2976 // v2{2}(pt) for 5-10%:
2977 Double_t xCumulant2nd0510ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2978 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2979 Double_t yCumulant2nd0510ALICE_v2[] = {0.000000,0.000000,0.019872,0.026451,0.032901,0.039085,0.044930,0.050200,0.054887,0.060253,
2980 0.066587,0.075080,0.083303,0.090298,0.098782,0.109632,0.124486,0.129621,0.132076,0.120697};
2981 Double_t xErrCumulant2nd0510ALICE_v2[20] = {0.};
2982 Double_t yErrCumulant2nd0510ALICE_v2[] = {0.000000,0.000000,0.000150,0.000152,0.000163,0.000178,0.000196,0.000215,0.000237,0.000261,
2983 0.000213,0.000256,0.000313,0.000381,0.000468,0.000423,0.000727,0.001157,0.001741,0.002064};
2984 Int_t nPointsCumulant2nd0510ALICE_v2 = sizeof(xCumulant2nd0510ALICE_v2)/sizeof(Double_t);
2985 TGraphErrors *Cumulant2nd0510ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v2,xCumulant2nd0510ALICE_v2,yCumulant2nd0510ALICE_v2,
2986 xErrCumulant2nd0510ALICE_v2,yErrCumulant2nd0510ALICE_v2);
2987 Cumulant2nd0510ALICE_v2->SetMarkerStyle(kOpenCircle);
2988 Cumulant2nd0510ALICE_v2->SetMarkerColor(kBlue);
2990 return Cumulant2nd0510ALICE_v2;
2995 // v3{2}(pt) for 5-10%:
2996 Double_t xCumulant2nd0510ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2997 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2998 Double_t yCumulant2nd0510ALICE_v3[] = {0.000000,0.000000,0.008596,0.010700,0.013820,0.017524,0.021507,0.024316,0.028491,0.032880,
2999 0.038741,0.045830,0.052486,0.059560,0.067990,0.081006,0.097402,0.107050,0.111743,0.116434};
3000 Double_t xErrCumulant2nd0510ALICE_v3[20] = {0.};
3001 Double_t yErrCumulant2nd0510ALICE_v3[] = {0.000000,0.000000,0.000208,0.000207,0.000218,0.000235,0.000258,0.000284,0.000314,0.000347,
3002 0.000285,0.000345,0.000426,0.000521,0.000642,0.000586,0.001008,0.001611,0.002421,0.002853};
3003 Int_t nPointsCumulant2nd0510ALICE_v3 = sizeof(xCumulant2nd0510ALICE_v3)/sizeof(Double_t);
3004 TGraphErrors *Cumulant2nd0510ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v3,xCumulant2nd0510ALICE_v3,yCumulant2nd0510ALICE_v3,
3005 xErrCumulant2nd0510ALICE_v3,yErrCumulant2nd0510ALICE_v3);
3006 Cumulant2nd0510ALICE_v3->SetMarkerStyle(kOpenCircle);
3007 Cumulant2nd0510ALICE_v3->SetMarkerColor(kBlue);
3009 return Cumulant2nd0510ALICE_v3;
3014 // v4{2}(pt) for 5-10%:
3015 Double_t xCumulant2nd0510ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3016 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3017 Double_t yCumulant2nd0510ALICE_v4[] = {0.000000,0.000000,0.006466,0.006731,0.006344,0.007374,0.008775,0.010324,0.012323,0.014533,
3018 0.017261,0.022507,0.028776,0.035403,0.041936,0.051491,0.070340,0.080081,0.095077,0.088526};
3019 Double_t xErrCumulant2nd0510ALICE_v4[20] = {0.};
3020 Double_t yErrCumulant2nd0510ALICE_v4[] = {0.000000,0.000000,0.000292,0.000295,0.000312,0.000336,0.000366,0.000403,0.000443,0.000485,
3021 0.000399,0.000486,0.000603,0.000738,0.000914,0.000836,0.001443,0.002303,0.003448,0.004078};
3022 Int_t nPointsCumulant2nd0510ALICE_v4 = sizeof(xCumulant2nd0510ALICE_v4)/sizeof(Double_t);
3023 TGraphErrors *Cumulant2nd0510ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v4,xCumulant2nd0510ALICE_v4,yCumulant2nd0510ALICE_v4,
3024 xErrCumulant2nd0510ALICE_v4,yErrCumulant2nd0510ALICE_v4);
3025 Cumulant2nd0510ALICE_v4->SetMarkerStyle(kOpenCircle);
3026 Cumulant2nd0510ALICE_v4->SetMarkerColor(kBlue);
3028 return Cumulant2nd0510ALICE_v4;
3034 TGraphErrors* GetFlow1020(Int_t n)
3036 // private communication 02.02.11, Ante B. / Raimond
3040 // v2{2}(pt) for 10-20%:
3041 Double_t xCumulant2nd1020ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3042 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3043 Double_t yCumulant2nd1020ALICE_v2[] = {0.000000,0.000000,0.027683,0.037083,0.046511,0.055519,0.063979,0.071626,0.078537,0.085975,
3044 0.095001,0.106979,0.118456,0.129721,0.140641,0.155161,0.173402,0.179870,0.180616,0.168921};
3045 Double_t xErrCumulant2nd1020ALICE_v2[20] = {0.};
3046 Double_t yErrCumulant2nd1020ALICE_v2[] = {0.000000,0.000000,0.000121,0.000124,0.000134,0.000147,0.000163,0.000179,0.000198,0.000217,
3047 0.000177,0.000212,0.000257,0.000311,0.000380,0.000341,0.000569,0.000882,0.001309,0.001537};
3048 Int_t nPointsCumulant2nd1020ALICE_v2 = sizeof(xCumulant2nd1020ALICE_v2)/sizeof(Double_t);
3049 TGraphErrors *Cumulant2nd1020ALICE_v2 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v2,xCumulant2nd1020ALICE_v2,yCumulant2nd1020ALICE_v2,
3050 xErrCumulant2nd1020ALICE_v2,yErrCumulant2nd1020ALICE_v2);
3051 Cumulant2nd1020ALICE_v2->SetMarkerStyle(kFullSquare);
3052 Cumulant2nd1020ALICE_v2->SetMarkerColor(kRed);
3054 return Cumulant2nd1020ALICE_v2;
3059 // v3{2}(pt) for 10-20%:
3060 Double_t xCumulant2nd1020ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3061 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3062 Double_t yCumulant2nd1020ALICE_v3[] = {0.000000,0.000000,0.009830,0.012858,0.016111,0.020120,0.023948,0.028349,0.032741,0.037244,
3063 0.043385,0.051803,0.059374,0.068686,0.076763,0.090151,0.106530,0.117448,0.121383,0.118247};
3064 Double_t xErrCumulant2nd1020ALICE_v3[20] = {0.};
3065 Double_t yErrCumulant2nd1020ALICE_v3[] = {0.000000,0.000000,0.000171,0.000170,0.000180,0.000195,0.000215,0.000236,0.000261,0.000287,
3066 0.000236,0.000288,0.000353,0.000434,0.000536,0.000488,0.000823,0.001277,0.001892,0.002224};
3067 Int_t nPointsCumulant2nd1020ALICE_v3 = sizeof(xCumulant2nd1020ALICE_v3)/sizeof(Double_t);
3068 TGraphErrors *Cumulant2nd1020ALICE_v3 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v3,xCumulant2nd1020ALICE_v3,yCumulant2nd1020ALICE_v3,
3069 xErrCumulant2nd1020ALICE_v3,yErrCumulant2nd1020ALICE_v3);
3070 Cumulant2nd1020ALICE_v3->SetMarkerStyle(kFullSquare);
3071 Cumulant2nd1020ALICE_v3->SetMarkerColor(kRed);
3073 return Cumulant2nd1020ALICE_v3;
3078 // v4{2}(pt) for 10-20%:
3079 Double_t xCumulant2nd1020ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3080 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3081 Double_t yCumulant2nd1020ALICE_v4[] = {0.000000,0.000000,0.007423,0.007647,0.008189,0.008592,0.009489,0.011671,0.013739,0.017199,
3082 0.020084,0.026004,0.031843,0.038388,0.047357,0.057251,0.072433,0.086326,0.094282,0.097432};
3083 Double_t xErrCumulant2nd1020ALICE_v4[20] = {0.};
3084 Double_t yErrCumulant2nd1020ALICE_v4[] = {0.000000,0.000000,0.000243,0.000244,0.000257,0.000279,0.000306,0.000335,0.000368,0.000405,
3085 0.000333,0.000406,0.000502,0.000618,0.000770,0.000701,0.001185,0.001845,0.002730,0.003193};
3086 Int_t nPointsCumulant2nd1020ALICE_v4 = sizeof(xCumulant2nd1020ALICE_v4)/sizeof(Double_t);
3087 TGraphErrors *Cumulant2nd1020ALICE_v4 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v4,xCumulant2nd1020ALICE_v4,yCumulant2nd1020ALICE_v4,
3088 xErrCumulant2nd1020ALICE_v4,yErrCumulant2nd1020ALICE_v4);
3089 Cumulant2nd1020ALICE_v4->SetMarkerStyle(kFullSquare);
3090 Cumulant2nd1020ALICE_v4->SetMarkerColor(kRed);
3092 return Cumulant2nd1020ALICE_v4;
3098 TGraphErrors* GetFlow2030(Int_t n)
3100 // private communication 02.02.11, Ante B. / Raimond
3104 Double_t xCumulant2nd2030ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3105 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3106 Double_t yCumulant2nd2030ALICE_v2[] = {0.000000,0.000000,0.035557,0.048064,0.060768,0.072585,0.083808,0.093772,0.103310,0.112602,
3107 0.124846,0.140603,0.155345,0.169450,0.183077,0.200173,0.219693,0.225741,0.223318,0.207356};
3108 Double_t xErrCumulant2nd2030ALICE_v2[20] = {0.};
3109 Double_t yErrCumulant2nd2030ALICE_v2[] = {0.000000,0.000000,0.000144,0.000147,0.000159,0.000175,0.000194,0.000214,0.000235,0.000259,
3110 0.000211,0.000254,0.000310,0.000377,0.000464,0.000418,0.000677,0.001027,0.001513,0.001761};
3111 Int_t nPointsCumulant2nd2030ALICE_v2 = sizeof(xCumulant2nd2030ALICE_v2)/sizeof(Double_t);
3112 TGraphErrors *Cumulant2nd2030ALICE_v2 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v2,xCumulant2nd2030ALICE_v2,yCumulant2nd2030ALICE_v2,
3113 xErrCumulant2nd2030ALICE_v2,yErrCumulant2nd2030ALICE_v2);
3114 Cumulant2nd2030ALICE_v2->SetMarkerStyle(kOpenSquare);
3115 Cumulant2nd2030ALICE_v2->SetMarkerColor(kRed);
3117 return Cumulant2nd2030ALICE_v2;
3122 // v3{2}(pt) for 20-30%:
3123 Double_t xCumulant2nd2030ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3124 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3125 Double_t yCumulant2nd2030ALICE_v3[] = {0.000000,0.000000,0.011287,0.014937,0.018479,0.022962,0.027854,0.031938,0.037038,0.041443,
3126 0.049872,0.058720,0.068353,0.077692,0.087859,0.099863,0.116141,0.124486,0.124786,0.119520};
3127 Double_t xErrCumulant2nd2030ALICE_v3[20] = {0.};
3128 Double_t yErrCumulant2nd2030ALICE_v3[] = {0.000000,0.000000,0.000215,0.000216,0.000228,0.000248,0.000272,0.000300,0.000332,0.000366,
3129 0.000301,0.000369,0.000456,0.000561,0.000700,0.000636,0.001038,0.001574,0.002307,0.002676};
3130 Int_t nPointsCumulant2nd2030ALICE_v3 = sizeof(xCumulant2nd2030ALICE_v3)/sizeof(Double_t);
3131 TGraphErrors *Cumulant2nd2030ALICE_v3 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v3,xCumulant2nd2030ALICE_v3,yCumulant2nd2030ALICE_v3,
3132 xErrCumulant2nd2030ALICE_v3,yErrCumulant2nd2030ALICE_v3);
3133 Cumulant2nd2030ALICE_v3->SetMarkerStyle(kOpenSquare);
3134 Cumulant2nd2030ALICE_v3->SetMarkerColor(kRed);
3136 return Cumulant2nd2030ALICE_v3;
3141 // v4{2}(pt) for 20-30%:
3142 Double_t xCumulant2nd2030ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3143 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3144 Double_t yCumulant2nd2030ALICE_v4[] = {0.000000,0.000000,0.008435,0.009824,0.009387,0.010408,0.011458,0.013770,0.016335,0.019165,
3145 0.023770,0.030071,0.036231,0.043950,0.051803,0.065222,0.082155,0.091864,0.105061,0.105167};
3146 Double_t xErrCumulant2nd2030ALICE_v4[20] = {0.};
3147 Double_t yErrCumulant2nd2030ALICE_v4[] = {0.000000,0.000000,0.000308,0.000308,0.000328,0.000355,0.000391,0.000430,0.000473,0.000524,
3148 0.000430,0.000524,0.000652,0.000807,0.001006,0.000919,0.001502,0.002277,0.003339,0.003871};
3149 Int_t nPointsCumulant2nd2030ALICE_v4 = sizeof(xCumulant2nd2030ALICE_v4)/sizeof(Double_t);
3150 TGraphErrors *Cumulant2nd2030ALICE_v4 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v4,xCumulant2nd2030ALICE_v4,yCumulant2nd2030ALICE_v4,
3151 xErrCumulant2nd2030ALICE_v4,yErrCumulant2nd2030ALICE_v4);
3152 Cumulant2nd2030ALICE_v4->SetMarkerStyle(kOpenSquare);
3153 Cumulant2nd2030ALICE_v4->SetMarkerColor(kRed);
3155 return Cumulant2nd2030ALICE_v4;
3161 TGraphErrors* GetFlow3040(Int_t n)
3163 // private communication 02.02.11, Ante B. / Raimond
3167 // v2{2}(pt) for 30-40%:
3168 Double_t xCumulant2nd3040ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3169 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3170 Double_t yCumulant2nd3040ALICE_v2[] = {0.000000,0.000000,0.040797,0.055427,0.070543,0.084024,0.096562,0.109411,0.119853,0.130964,
3171 0.145377,0.163806,0.179825,0.196178,0.210377,0.226556,0.245686,0.247898,0.240058,0.225011};
3172 Double_t xErrCumulant2nd3040ALICE_v2[20] = {0.};
3173 Double_t yErrCumulant2nd3040ALICE_v2[] = {0.000000,0.000000,0.000177,0.000182,0.000197,0.000216,0.000239,0.000265,0.000293,0.000325,
3174 0.000266,0.000321,0.000395,0.000486,0.000603,0.000536,0.000840,0.001258,0.001843,0.002118};
3175 Int_t nPointsCumulant2nd3040ALICE_v2 = sizeof(xCumulant2nd3040ALICE_v2)/sizeof(Double_t);
3176 TGraphErrors *Cumulant2nd3040ALICE_v2 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v2,xCumulant2nd3040ALICE_v2,yCumulant2nd3040ALICE_v2,
3177 xErrCumulant2nd3040ALICE_v2,yErrCumulant2nd3040ALICE_v2);
3178 Cumulant2nd3040ALICE_v2->SetMarkerStyle(kFullTriangleUp);
3179 Cumulant2nd3040ALICE_v2->SetMarkerSize(1.2);
3180 Cumulant2nd3040ALICE_v2->SetMarkerColor(kGreen+2);
3182 return Cumulant2nd3040ALICE_v2;
3187 // v3{2}(pt) for 30-40%:
3188 Double_t xCumulant2nd3040ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3189 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3190 Double_t yCumulant2nd3040ALICE_v3[] = {0.000000,0.000000,0.012226,0.016391,0.020792,0.026208,0.030380,0.035710,0.041025,0.047062,
3191 0.053075,0.064201,0.074116,0.085314,0.094391,0.106819,0.124012,0.129388,0.134315,0.132330};
3192 Double_t xErrCumulant2nd3040ALICE_v3[20] = {0.};
3193 Double_t yErrCumulant2nd3040ALICE_v3[] = {0.000000,0.000000,0.000284,0.000286,0.000303,0.000329,0.000364,0.000403,0.000443,0.000492,
3194 0.000408,0.000500,0.000627,0.000778,0.000973,0.000874,0.001375,0.002050,0.002992,0.003438};
3195 Int_t nPointsCumulant2nd3040ALICE_v3 = sizeof(xCumulant2nd3040ALICE_v3)/sizeof(Double_t);
3196 TGraphErrors *Cumulant2nd3040ALICE_v3 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v3,xCumulant2nd3040ALICE_v3,yCumulant2nd3040ALICE_v3,
3197 xErrCumulant2nd3040ALICE_v3,yErrCumulant2nd3040ALICE_v3);
3198 Cumulant2nd3040ALICE_v3->SetMarkerStyle(kFullTriangleUp);
3199 Cumulant2nd3040ALICE_v3->SetMarkerSize(1.2);
3200 Cumulant2nd3040ALICE_v3->SetMarkerColor(kGreen+2);
3202 return Cumulant2nd3040ALICE_v3;
3207 // v4{2}(pt) for 30-40%:
3208 Double_t xCumulant2nd3040ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3209 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3210 Double_t yCumulant2nd3040ALICE_v4[] = {0.000000,0.000000,0.010718,0.011490,0.010994,0.012527,0.013748,0.016425,0.018857,0.021622,
3211 0.026853,0.034636,0.042651,0.049892,0.057795,0.070865,0.088486,0.101656,0.113886,0.118202};
3212 Double_t xErrCumulant2nd3040ALICE_v4[20] = {0.};
3213 Double_t yErrCumulant2nd3040ALICE_v4[] = {0.000000,0.000000,0.000401,0.000406,0.000433,0.000472,0.000521,0.000575,0.000634,0.000704,
3214 0.000580,0.000714,0.000890,0.001114,0.001398,0.001253,0.001974,0.002945,0.004290,0.004909};
3215 Int_t nPointsCumulant2nd3040ALICE_v4 = sizeof(xCumulant2nd3040ALICE_v4)/sizeof(Double_t);
3216 TGraphErrors *Cumulant2nd3040ALICE_v4 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v4,xCumulant2nd3040ALICE_v4,yCumulant2nd3040ALICE_v4,
3217 xErrCumulant2nd3040ALICE_v4,yErrCumulant2nd3040ALICE_v4);
3218 Cumulant2nd3040ALICE_v4->SetMarkerStyle(kFullTriangleUp);
3219 Cumulant2nd3040ALICE_v4->SetMarkerSize(1.2);
3220 Cumulant2nd3040ALICE_v4->SetMarkerColor(kGreen+2);
3222 return Cumulant2nd3040ALICE_v4;
3228 TGraphErrors* GetFlow4050(Int_t n)
3230 // private communication 02.02.11, Ante B. / Raimond
3234 // v2{2}(pt) for 40-50%:
3235 Double_t xCumulant2nd4050ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3236 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3237 Double_t yCumulant2nd4050ALICE_v2[] = {0.000000,0.000000,0.043593,0.059522,0.075558,0.090681,0.104453,0.117913,0.129349,0.141743,
3238 0.157076,0.176121,0.193651,0.208844,0.222402,0.238407,0.252512,0.253592,0.243571,0.233018};
3239 Double_t xErrCumulant2nd4050ALICE_v2[20] = {0.};
3240 Double_t yErrCumulant2nd4050ALICE_v2[] = {0.000000,0.000000,0.000234,0.000241,0.000261,0.000288,0.000322,0.000357,0.000395,0.000438,
3241 0.000362,0.000447,0.000555,0.000685,0.000846,0.000733,0.001121,0.001665,0.002433,0.002768};
3242 Int_t nPointsCumulant2nd4050ALICE_v2 = sizeof(xCumulant2nd4050ALICE_v2)/sizeof(Double_t);
3243 TGraphErrors *Cumulant2nd4050ALICE_v2 = new TGraphErrors(nPointsCumulant2nd4050ALICE_v2,xCumulant2nd4050ALICE_v2,yCumulant2nd4050ALICE_v2,
3244 xErrCumulant2nd4050ALICE_v2,yErrCumulant2nd4050ALICE_v2);
3245 Cumulant2nd4050ALICE_v2->SetMarkerStyle(kOpenTriangleUp);
3246 Cumulant2nd4050ALICE_v2->SetMarkerSize(1.2);
3247 Cumulant2nd4050ALICE_v2->SetMarkerColor(kGreen+2);
3249 return Cumulant2nd4050ALICE_v2;
3256 // results up to high pT
3258 TGraphErrors* GetFlow05(Int_t n)
3260 // private communication 09.03.11, Ante B. / Raimond
3264 // v2{2}(pt) for 0-5%:
3265 Double_t xCumulant2nd0005ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3266 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3267 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3268 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3269 Double_t yCumulant2nd0005ALICE[] = {0.000000,0.000000,0.018169,0.020988,0.024899,0.028309,0.031974,0.035188,0.038218,0.041202,
3270 0.043910,0.046560,0.048183,0.050640,0.052874,0.055334,0.056948,0.059427,0.061540,0.063218,
3271 0.065452,0.069222,0.072578,0.074723,0.077749,0.077178,0.080514,0.075325,0.077692,0.079710,
3272 0.073280,0.063849,0.068274,0.066045,0.071496,0.104352,0.091646,0.050220,0.124185,0.088535};
3273 Double_t xErrCumulant2nd0005ALICE[40] = {0.};
3274 Double_t yErrCumulant2nd0005ALICE[] = {0.000000,0.000000,0.000190,0.000191,0.000199,0.000212,0.000230,0.000248,0.000268,0.000293,
3275 0.000319,0.000346,0.000379,0.000418,0.000459,0.000502,0.000554,0.000614,0.000674,0.000749,
3276 0.000620,0.000769,0.000958,0.001182,0.001446,0.001331,0.001858,0.002552,0.003453,0.004606,
3277 0.004289,0.007006,0.010046,0.013853,0.017709,0.016630,0.025728,0.036763,0.045056,0.029011};
3278 Int_t nPointsCumulant2nd0005ALICE = sizeof(xCumulant2nd0005ALICE)/sizeof(Double_t);
3279 TGraphErrors *Cumulant2nd0005ALICE = new TGraphErrors(nPointsCumulant2nd0005ALICE,xCumulant2nd0005ALICE,yCumulant2nd0005ALICE,
3280 xErrCumulant2nd0005ALICE,yErrCumulant2nd0005ALICE);
3281 Cumulant2nd0005ALICE->SetMarkerStyle(kFullCircle);
3282 Cumulant2nd0005ALICE->SetMarkerColor(kBlue);
3284 return Cumulant2nd0005ALICE;
3298 TGraphErrors* GetFlow05_Rap10(Int_t n)
3300 // private communication 17.05.11, Ante B. / should correspond to machcone paper draft
3304 // v2{SP}(pt) for 00-05%:
3305 const Int_t nPointsSP_0005ALICE_v2_etaGap10 = 17;
3306 Double_t xSP_0005ALICE_v2_etaGap10[nPointsSP_0005ALICE_v2_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.900000,1.100000,
3307 1.300000,1.500000,1.700000,1.900000,2.200000,2.600000,3.000000,3.650000,4.550000};
3308 Double_t ySP_0005ALICE_v2_etaGap10[nPointsSP_0005ALICE_v2_etaGap10] = {0.013672,0.015745,0.019944,0.024169,0.026921,0.030296,0.034916,0.038472,
3309 0.043103,0.046626,0.052386,0.057132,0.060070,0.068419,0.061459,0.056816,0.050311};
3310 Double_t xErrSP_0005ALICE_v2_etaGap10[nPointsSP_0005ALICE_v2_etaGap10] = {0.};
3311 Double_t yErrSP_0005ALICE_v2_etaGap10[nPointsSP_0005ALICE_v2_etaGap10] = {0.000813,0.000804,0.000852,0.000930,0.001029,0.001140,0.000939,0.001155,
3312 0.001410,0.001736,0.002131,0.002620,0.002502,0.003759,0.005615,0.006617,0.014242};
3313 TGraphErrors *GrSP_0005ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v2_etaGap10,xSP_0005ALICE_v2_etaGap10,ySP_0005ALICE_v2_etaGap10,
3314 xErrSP_0005ALICE_v2_etaGap10,yErrSP_0005ALICE_v2_etaGap10);
3316 return GrSP_0005ALICE_v2_etaGap10;
3321 // v3{SP}(pt) for 00-05%:
3322 const Int_t nPointsSP_0005ALICE_v3_etaGap10 = 16;
3323 Double_t xSP_0005ALICE_v3_etaGap10[nPointsSP_0005ALICE_v3_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.900000,1.100000,
3324 1.300000,1.500000,1.700000,1.900000,2.300000,2.900000,3.650000,4.550000};
3325 Double_t ySP_0005ALICE_v3_etaGap10[nPointsSP_0005ALICE_v3_etaGap10] = {0.006303,0.009800,0.011143,0.014246,0.017628,0.019437,0.028412,0.030580,
3326 0.038730,0.045653,0.052469,0.062303,0.071522,0.082223,0.083373,0.076951};
3327 Double_t xErrSP_0005ALICE_v3_etaGap10[nPointsSP_0005ALICE_v3_etaGap10] = {0.};
3328 Double_t yErrSP_0005ALICE_v3_etaGap10[nPointsSP_0005ALICE_v3_etaGap10] = {0.001012,0.000996,0.001062,0.001158,0.001277,0.001415,0.001158,0.001422,
3329 0.001734,0.002124,0.002610,0.003206,0.002724,0.004977,0.008123,0.017180};
3330 TGraphErrors *GrSP_0005ALICE_v3_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v3_etaGap10,xSP_0005ALICE_v3_etaGap10,ySP_0005ALICE_v3_etaGap10,
3331 xErrSP_0005ALICE_v3_etaGap10,yErrSP_0005ALICE_v3_etaGap10);
3334 return GrSP_0005ALICE_v3_etaGap10;
3339 // v4{SP}(pt) for 00-05%:
3340 const Int_t nPointsSP_0005ALICE_v4_etaGap10 = 11;
3341 Double_t xSP_0005ALICE_v4_etaGap10[nPointsSP_0005ALICE_v4_etaGap10] = {0.300000,0.500000,0.700000,0.950000,1.250000,1.550000,1.850000,2.300000,2.900000,3.650000,4.550000};
3342 Double_t ySP_0005ALICE_v4_etaGap10[nPointsSP_0005ALICE_v4_etaGap10] = {0.002042,0.002556,0.009693,0.013286,0.016780,0.027865,0.031797,0.051101,0.060164,
3344 Double_t xErrSP_0005ALICE_v4_etaGap10[nPointsSP_0005ALICE_v4_etaGap10] = {0.};
3345 Double_t yErrSP_0005ALICE_v4_etaGap10[nPointsSP_0005ALICE_v4_etaGap10] = {0.001460,0.001624,0.001930,0.002021,0.002737,0.003717,0.005042,0.005564,0.010160,
3347 TGraphErrors *GrSP_0005ALICE_v4_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v4_etaGap10,xSP_0005ALICE_v4_etaGap10,ySP_0005ALICE_v4_etaGap10,
3348 xErrSP_0005ALICE_v4_etaGap10,yErrSP_0005ALICE_v4_etaGap10);
3350 return GrSP_0005ALICE_v4_etaGap10;
3355 // v5{SP}(pt) for 00-05%:
3356 const Int_t nPointsSP_0005ALICE_v5_etaGap10 = 12;
3357 Double_t xSP_0005ALICE_v5_etaGap10[nPointsSP_0005ALICE_v5_etaGap10] = {0.300000,0.500000,0.700000,0.900000,1.100000,1.300000,1.600000,2.000000,2.400000,
3358 2.800000,3.500000,4.500000};
3359 Double_t ySP_0005ALICE_v5_etaGap10[nPointsSP_0005ALICE_v5_etaGap10] = {0.002016,0.003409,0.004029,0.002665,0.002765,0.003042,0.013241,0.015430,0.031845,
3360 0.031373,0.068504,0.017964};
3361 Double_t xErrSP_0005ALICE_v5_etaGap10[nPointsSP_0005ALICE_v5_etaGap10] = {0.};
3362 Double_t yErrSP_0005ALICE_v5_etaGap10[nPointsSP_0005ALICE_v5_etaGap10] = {0.001260,0.001386,0.001696,0.002101,0.002560,0.003119,0.002970,0.004472,0.006802,
3363 0.010073,0.011899,0.027756};
3364 TGraphErrors *GrSP_0005ALICE_v5_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v5_etaGap10,xSP_0005ALICE_v5_etaGap10,ySP_0005ALICE_v5_etaGap10,
3365 xErrSP_0005ALICE_v5_etaGap10,yErrSP_0005ALICE_v5_etaGap10);
3367 return GrSP_0005ALICE_v5_etaGap10;
3373 TGraphErrors* GetFlow510(Int_t n)
3375 // private communication 09.03.11, Ante B. / Raimond
3379 // v2{2}(pt) for 5-10%:
3380 Double_t xCumulant2nd0510ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3381 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3382 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3383 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3384 Double_t yCumulant2nd0510ALICE[] = {0.000000,0.000000,0.022354,0.028064,0.034341,0.040769,0.046265,0.051160,0.056712,0.061354,
3385 0.066290,0.070340,0.074453,0.078444,0.082367,0.085785,0.088086,0.092676,0.096169,0.100366,
3386 0.104227,0.109710,0.117032,0.121784,0.122227,0.126537,0.127966,0.117790,0.117884,0.111436,
3387 0.104945,0.097640,0.086481,0.091663,0.091404,0.080132,0.015864,0.101500,0.033347,0.205130};
3388 Double_t xErrCumulant2nd0510ALICE[40] = {0.};
3389 Double_t yErrCumulant2nd0510ALICE[] = {0.000000,0.000000,0.000173,0.000176,0.000186,0.000199,0.000219,0.000236,0.000260,0.000283,
3390 0.000312,0.000340,0.000373,0.000410,0.000454,0.000501,0.000552,0.000610,0.000675,0.000753,
3391 0.000620,0.000774,0.000961,0.001183,0.001431,0.001309,0.001814,0.002481,0.003342,0.004379,
3392 0.004122,0.006716,0.009851,0.013626,0.017517,0.015790,0.025680,0.038041,0.054144,0.038987};
3393 Int_t nPointsCumulant2nd0510ALICE = sizeof(xCumulant2nd0510ALICE)/sizeof(Double_t);
3394 TGraphErrors *Cumulant2nd0510ALICE = new TGraphErrors(nPointsCumulant2nd0510ALICE,xCumulant2nd0510ALICE,yCumulant2nd0510ALICE,
3395 xErrCumulant2nd0510ALICE,yErrCumulant2nd0510ALICE);
3396 Cumulant2nd0510ALICE->SetMarkerStyle(kOpenCircle);
3397 Cumulant2nd0510ALICE->SetMarkerColor(kBlue);
3399 return Cumulant2nd0510ALICE;
3413 TGraphErrors* GetFlow510_Rap10(Int_t n)
3415 // private communication 18.05.11, Ante B.
3419 // v2{SP}(pt) for 05-10%, rapidity gap = 1.0:
3420 const Int_t nPointsSP_0510ALICE_v2_etaGap10 = 19;
3421 Double_t xSP_0510ALICE_v2_etaGap10[nPointsSP_0510ALICE_v2_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3422 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.250000,
3424 Double_t ySP_0510ALICE_v2_etaGap10[nPointsSP_0510ALICE_v2_etaGap10] = {0.018634,0.025538,0.032157,0.038272,0.044020,0.049252,0.055627,0.059272,
3425 0.066516,0.073891,0.080945,0.090386,0.094505,0.106393,0.120303,0.122586,0.121731,0.107343,
3427 Double_t xErrSP_0510ALICE_v2_etaGap10[nPointsSP_0510ALICE_v2_etaGap10] = {0.};
3428 Double_t yErrSP_0510ALICE_v2_etaGap10[nPointsSP_0510ALICE_v2_etaGap10] = {0.000419,0.000411,0.000435,0.000474,0.000523,0.000580,0.000643,0.000712,
3429 0.000586,0.000717,0.000880,0.001082,0.001333,0.001189,0.001969,0.003199,0.005011,0.007602,
3431 TGraphErrors *GrSP_0510ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_0510ALICE_v2_etaGap10,xSP_0510ALICE_v2_etaGap10,
3432 ySP_0510ALICE_v2_etaGap10,xErrSP_0510ALICE_v2_etaGap10,
3433 yErrSP_0510ALICE_v2_etaGap10);
3435 return GrSP_0510ALICE_v2_etaGap10;
3441 TGraphErrors* GetFlow1020(Int_t n)
3443 // private communication 09.03.11, Ante B. / Raimond
3447 // v2{2}(pt) for 10-20%:
3448 Double_t xCumulant2nd1020ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3449 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3450 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3451 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3452 Double_t yCumulant2nd1020ALICE[] = {0.000000,0.000000,0.028508,0.037698,0.046914,0.055750,0.063948,0.072298,0.079396,0.086829,
3453 0.093382,0.099676,0.105412,0.110792,0.116715,0.122327,0.127079,0.132302,0.137183,0.142346,
3454 0.149059,0.156729,0.164672,0.171840,0.175346,0.176824,0.178878,0.174979,0.169229,0.153109,
3455 0.139676,0.125686,0.120554,0.096537,0.084736,0.118152,0.116079,0.060032,0.093764,0.206506};
3456 Double_t xErrCumulant2nd1020ALICE[40] = {0.};
3457 Double_t yErrCumulant2nd1020ALICE[] = {0.000000,0.000000,0.000134,0.000136,0.000145,0.000158,0.000173,0.000190,0.000209,0.000229,
3458 0.000252,0.000275,0.000301,0.000331,0.000365,0.000401,0.000442,0.000488,0.000541,0.000599,
3459 0.000496,0.000614,0.000757,0.000915,0.001095,0.000989,0.001360,0.001847,0.002477,0.003234,
3460 0.003012,0.004867,0.007123,0.009774,0.012740,0.011682,0.019629,0.028568,0.039931,0.024776};
3461 Int_t nPointsCumulant2nd1020ALICE = sizeof(xCumulant2nd1020ALICE)/sizeof(Double_t);
3462 TGraphErrors *Cumulant2nd1020ALICE = new TGraphErrors(nPointsCumulant2nd1020ALICE,xCumulant2nd1020ALICE,yCumulant2nd1020ALICE,
3463 xErrCumulant2nd1020ALICE,yErrCumulant2nd1020ALICE);
3464 Cumulant2nd1020ALICE->SetMarkerStyle(kFullSquare);
3465 Cumulant2nd1020ALICE->SetMarkerColor(kRed);
3467 return Cumulant2nd1020ALICE;
3481 TGraphErrors* GetFlow1020_Rap10(Int_t n)
3483 // private communication 18.05.11, Ante B.
3487 // v2{SP}(pt) for 10-20%, rapidity gap = 1.0:
3488 const Int_t nPointsSP_1020ALICE_v2_etaGap10 = 19;
3489 Double_t xSP_1020ALICE_v2_etaGap10[nPointsSP_1020ALICE_v2_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3490 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.250000,
3492 Double_t ySP_1020ALICE_v2_etaGap10[nPointsSP_1020ALICE_v2_etaGap10] = {0.026592,0.036955,0.046103,0.055537,0.063461,0.070993,0.078751,0.085723,
3493 0.094701,0.105631,0.117906,0.128147,0.138505,0.153494,0.166651,0.172691,0.177337,0.155068,
3495 Double_t xErrSP_1020ALICE_v2_etaGap10[nPointsSP_1020ALICE_v2_etaGap10] = {0.};
3496 Double_t yErrSP_1020ALICE_v2_etaGap10[nPointsSP_1020ALICE_v2_etaGap10] = {0.000302,0.000296,0.000314,0.000342,0.000377,0.000418,0.000465,0.000515,
3497 0.000423,0.000517,0.000634,0.000779,0.000959,0.000856,0.001406,0.002266,0.003528,0.005281,
3499 TGraphErrors *GrSP_1020ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_1020ALICE_v2_etaGap10,xSP_1020ALICE_v2_etaGap10,
3500 ySP_1020ALICE_v2_etaGap10,xErrSP_1020ALICE_v2_etaGap10,
3501 yErrSP_1020ALICE_v2_etaGap10);
3503 return GrSP_1020ALICE_v2_etaGap10;
3509 TGraphErrors* GetFlow2030(Int_t n)
3511 // private communication 09.03.11, Ante B. / Raimond
3515 // v2{2}(pt) for 20-30%:
3516 Double_t xCumulant2nd2030ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3517 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3518 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3519 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3520 Double_t yCumulant2nd2030ALICE[] = {0.000000,0.000000,0.035366,0.047465,0.060083,0.072090,0.083418,0.093576,0.103842,0.113110,
3521 0.122193,0.130168,0.138158,0.145627,0.152851,0.159129,0.166073,0.173144,0.178698,0.186188,
3522 0.192045,0.202199,0.210535,0.215004,0.220457,0.223339,0.224050,0.211567,0.203955,0.189716,
3523 0.165994,0.147185,0.131953,0.139331,0.151293,0.127406,0.153764,0.089628,0.161247,0.511418};
3524 Double_t xErrCumulant2nd2030ALICE[40] = {0.};
3525 Double_t yErrCumulant2nd2030ALICE[] = {0.000000,0.000000,0.000155,0.000157,0.000169,0.000184,0.000202,0.000222,0.000244,0.000269,
3526 0.000296,0.000325,0.000357,0.000394,0.000435,0.000481,0.000532,0.000589,0.000655,0.000731,
3527 0.000605,0.000743,0.000904,0.001081,0.001277,0.001145,0.001568,0.002119,0.002806,0.003635,
3528 0.003383,0.005346,0.007935,0.010739,0.014682,0.013434,0.021531,0.032352,0.040396,0.028472};
3529 Int_t nPointsCumulant2nd2030ALICE = sizeof(xCumulant2nd2030ALICE)/sizeof(Double_t);
3530 TGraphErrors *Cumulant2nd2030ALICE = new TGraphErrors(nPointsCumulant2nd2030ALICE,xCumulant2nd2030ALICE,yCumulant2nd2030ALICE,
3531 xErrCumulant2nd2030ALICE,yErrCumulant2nd2030ALICE);
3532 Cumulant2nd2030ALICE->SetMarkerStyle(kOpenSquare);
3533 Cumulant2nd2030ALICE->SetMarkerColor(kRed);
3535 return Cumulant2nd2030ALICE;
3549 TGraphErrors* GetFlow3040(Int_t n)
3551 // private communication 09.03.11, Ante B. / Raimond
3555 // v2{2}(pt) for 30-40%:
3556 Double_t xCumulant2nd3040ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3557 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3558 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3559 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3560 Double_t yCumulant2nd3040ALICE[] = {0.000000,0.000000,0.039584,0.054196,0.069291,0.082976,0.095622,0.108940,0.119830,0.131587,
3561 0.141091,0.150899,0.160573,0.168676,0.176301,0.183823,0.191672,0.199506,0.206854,0.212830,
3562 0.219526,0.229376,0.236513,0.240863,0.245961,0.245891,0.242608,0.234302,0.219580,0.212848,
3563 0.194666,0.190184,0.171036,0.159173,0.156932,0.141324,0.132809,0.182683,0.023272,0.032825};
3564 Double_t xErrCumulant2nd3040ALICE[40] = {0.};
3565 Double_t yErrCumulant2nd3040ALICE[] = {0.000000,0.000000,0.000189,0.000192,0.000205,0.000224,0.000247,0.000273,0.000302,0.000334,
3566 0.000369,0.000407,0.000448,0.000496,0.000552,0.000612,0.000682,0.000758,0.000844,0.000941,
3567 0.000774,0.000937,0.001123,0.001329,0.001565,0.001397,0.001911,0.002549,0.003378,0.004306,
3568 0.003987,0.006353,0.009128,0.013032,0.016891,0.015806,0.025150,0.035119,0.044487,0.050083};
3569 Int_t nPointsCumulant2nd3040ALICE = sizeof(xCumulant2nd3040ALICE)/sizeof(Double_t);
3570 TGraphErrors *Cumulant2nd3040ALICE = new TGraphErrors(nPointsCumulant2nd3040ALICE,xCumulant2nd3040ALICE,yCumulant2nd3040ALICE,
3571 xErrCumulant2nd3040ALICE,yErrCumulant2nd3040ALICE);
3572 Cumulant2nd3040ALICE->SetMarkerStyle(kFullTriangleUp);
3573 Cumulant2nd3040ALICE->SetMarkerColor(kGreen+2);
3575 return Cumulant2nd3040ALICE;
3589 TGraphErrors* GetFlow4050(Int_t n)
3591 // private communication 09.03.11, Ante B. / Raimond
3595 // v2{2}(pt) for 40-50%:
3596 Double_t xCumulant2nd4050ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3597 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3598 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3599 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3600 Double_t yCumulant2nd4050ALICE[] = {0.000000,0.000000,0.041872,0.058090,0.074444,0.089181,0.103780,0.117279,0.129769,0.142051,
3601 0.153185,0.163147,0.173309,0.181668,0.190998,0.197703,0.205011,0.211063,0.219587,0.223287,
3602 0.231163,0.239606,0.246533,0.251457,0.250034,0.252989,0.240823,0.236489,0.230268,0.204321,
3603 0.213476,0.200247,0.167065,0.190655,0.173573,0.166173,0.153232,0.173112,-0.123540,0.211999};
3604 Double_t xErrCumulant2nd4050ALICE[40] = {0.};
3605 Double_t yErrCumulant2nd4050ALICE[] = {0.000000,0.000000,0.000248,0.000251,0.000270,0.000296,0.000328,0.000363,0.000403,0.000447,
3606 0.000500,0.000556,0.000617,0.000687,0.000770,0.000857,0.000952,0.001057,0.001176,0.001297,
3607 0.001054,0.001265,0.001498,0.001767,0.002076,0.001849,0.002527,0.003358,0.004372,0.005573,
3608 0.005091,0.007981,0.011746,0.015732,0.021883,0.019866,0.032443,0.046521,0.051631,0.083717};
3609 Int_t nPointsCumulant2nd4050ALICE = sizeof(xCumulant2nd4050ALICE)/sizeof(Double_t);
3610 TGraphErrors *Cumulant2nd4050ALICE = new TGraphErrors(nPointsCumulant2nd4050ALICE,xCumulant2nd4050ALICE,yCumulant2nd4050ALICE,
3611 xErrCumulant2nd4050ALICE,yErrCumulant2nd4050ALICE);
3612 Cumulant2nd4050ALICE->SetMarkerStyle(kOpenTriangleUp);
3613 Cumulant2nd4050ALICE->SetMarkerColor(kGreen+2);
3615 return Cumulant2nd4050ALICE;
3621 TGraphErrors* GetFlow6070_Rap10(Int_t n)
3623 // private communication 18.05.11, Ante B.
3627 // v2{SP}(pt) for 60-70%, rapidity gap = 1.0:
3628 const Int_t nPointsSP_6070ALICE_v2_etaGap10 = 9;
3629 Double_t xSP_6070ALICE_v2_etaGap10[nPointsSP_6070ALICE_v2_etaGap10] = {0.300000,0.500000,0.700000,0.900000,1.250000,1.750000,2.500000,3.500000,4.500000};
3630 Double_t ySP_6070ALICE_v2_etaGap10[nPointsSP_6070ALICE_v2_etaGap10] = {0.044958,0.073313,0.105726,0.120423,0.147537,0.186749,0.205423,0.208575,0.185938};
3631 Double_t xErrSP_6070ALICE_v2_etaGap10[nPointsSP_6070ALICE_v2_etaGap10] = {0.};
3632 Double_t yErrSP_6070ALICE_v2_etaGap10[nPointsSP_6070ALICE_v2_etaGap10] = {0.001520,0.001772,0.002245,0.002842,0.002600,0.004443,0.006240,0.014665,0.028810};
3633 TGraphErrors *GrSP_6070ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_6070ALICE_v2_etaGap10,xSP_6070ALICE_v2_etaGap10,
3634 ySP_6070ALICE_v2_etaGap10,xErrSP_6070ALICE_v2_etaGap10,
3635 yErrSP_6070ALICE_v2_etaGap10);
3637 return GrSP_6070ALICE_v2_etaGap10;
3643 Float_t CalculateFlow(TH1* ptDist, Float_t ptMin, Float_t ptMax, Int_t n, Int_t centralityBegin, Int_t centralityEnd)
3645 if (centralityBegin == 0 && centralityEnd == 1)
3646 flow = GetFlow01_Rap10(n);
3647 else if (centralityBegin == 0 && centralityEnd == 2)
3648 flow = GetFlow02_Rap10(n);
3649 else if (centralityBegin == 0 && centralityEnd == 5)
3650 flow = GetFlow05_Rap10(n);
3651 else if (centralityBegin == 5 && centralityEnd == 10)
3652 flow = GetFlow510_Rap10(n);
3653 else if (centralityBegin == 20 && centralityEnd == 30)
3654 flow = GetFlow2030(n);
3655 else if (centralityBegin == 30 && centralityEnd == 40)
3656 flow = GetFlow3040(n);
3657 else if (centralityBegin == 40 && centralityEnd == 50)
3658 flow = GetFlow4050(n);
3659 else if (centralityBegin > 50)
3660 flow = GetFlow6070_Rap10(n);
3661 else if (centralityBegin == 0 && centralityEnd == 20)
3663 flow1 = GetFlow05_Rap10(n);
3664 flow2 = GetFlow510_Rap10(n);
3665 flow3 = GetFlow1020_Rap10(n);
3667 flow = (TGraphErrors*) flow2->Clone();
3669 // centrality width * dn/deta from http://arxiv.org/PS_cache/arxiv/pdf/1012/1012.1657v2.pdf
3670 Float_t mult[] = { 5 * 1601, 5 * 1294, 10 * 966 };
3672 for (Int_t i=0; i<flow->GetN(); i++)
3674 Float_t x= flow->GetX()[i];
3676 // Printf("%f: %f %f %f", x, flow1->Eval(x), flow2->Eval(x), flow3->Eval(x));
3677 flow->GetY()[i] = flow1->Eval(x) * mult[0] + flow2->Eval(x) * mult[1] + flow3->Eval(x) * mult[2];
3678 flow->GetY()[i] /= mult[0] + mult[1] + mult[2];
3679 // Printf(" --> %f", flow->GetY()[i]);
3682 else if (centralityBegin == 20 && centralityEnd == 60)
3684 flow = GetFlow2030(n);
3685 flow2 = GetFlow3040(n);
3686 flow3 = GetFlow4050(n);
3688 // centrality width * dn/deta from http://arxiv.org/PS_cache/arxiv/pdf/1012/1012.1657v2.pdf
3689 Float_t mult[] = { 10 * 649, 10 * 426, 10 * (261+149) };
3691 if (flow->GetN() != flow2->GetN() || flow2->GetN() != flow3->GetN())
3692 AliFatal("Incompatible graphs");
3694 for (Int_t i=0; i<flow->GetN(); i++)
3696 // Printf("%f %f %f", flow->GetY()[i], flow2->GetY()[i], flow3->GetY()[i]);
3697 flow->GetY()[i] = flow->GetY()[i] * mult[0] + flow2->GetY()[i] * mult[1] + flow3->GetY()[i] * mult[2];
3698 flow->GetY()[i] /= mult[0] + mult[1] + mult[2];
3699 // Printf(" --> %f", flow->GetY()[i]);
3704 Printf("Flow range %d %d not available", centralityBegin, centralityEnd);
3710 for (Int_t bin = ptDist->FindBin(ptMin + 0.01); bin <= ptDist->FindBin(ptMax - 0.01); bin++)
3712 if (ptDist->GetBinCenter(bin) > flow->GetX()[flow->GetN()-1])
3713 vn += ptDist->GetBinContent(bin) * flow->GetY()[flow->GetN()-1];
3715 vn += ptDist->GetBinContent(bin) * flow->Eval(ptDist->GetBinCenter(bin));
3716 sum += ptDist->GetBinContent(bin);
3722 Printf("v_{%d} = %f for %f < pT < %f", n, vn, ptMin, ptMax);
3727 void CalculateFlow(const char* fileName, Int_t centralityBegin, Int_t centralityEnd)
3729 Float_t ptTrigMin = 2;
3730 Float_t ptTrigMax = 3;
3737 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
3739 cont = h->GetUEHist(2)->GetTrackHist(0);
3740 cont->GetGrid(6)->GetGrid()->GetAxis(3)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
3741 cont->GetGrid(6)->GetGrid()->GetAxis(2)->SetRangeUser(ptTrigMin + 0.01, ptTrigMax - 0.01);
3743 ptDist = cont->ShowProjection(1, 6);
3744 ptDist->Scale(1.0 / ptDist->Integral());
3746 cont = h->GetUEHist(2)->GetEventHist();
3747 cont->GetGrid(6)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
3749 ptDist2 = cont->ShowProjection(0, 6);
3750 ptDist2->Scale(1.0 / ptDist2->Integral());
3754 for (Int_t n=2; n<=4; n++)
3756 Float_t v2A = CalculateFlow(ptDist, ptMin, ptMax, n, centralityBegin, centralityEnd);
3757 Float_t v2T = CalculateFlow(ptDist2, ptTrigMin, ptTrigMax, n, centralityBegin, centralityEnd);
3759 str += Form("%f * %f, ", v2A, v2T);
3763 ptDist2->SetLineColor(2);
3764 ptDist2->Draw("SAME");
3766 Printf("%s", str.Data());
3769 // 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...)
3770 TGraphErrors***** yields = 0;
3771 TString currentYieldFile;
3775 TFile::Open("yields.root", "RECREATE");
3776 for (Int_t i=0; i<3; i++)
3778 for (Int_t j=0; j<6; j++)
3780 for (Int_t k=0; k<4; k++)
3782 // CINT limitation here
3783 TGraphErrors** tmp = yields[i][j][k];
3784 for (Int_t l=0; l<31; l++)
3786 //Printf("%d %d %d %d", i, j, k, l);
3787 tmp[l]->Write(Form("yield_%d_%d_%d_%d", i, j, k, l));
3795 void ReadYields(const char* fileName = "yields.root")
3797 if (currentYieldFile == fileName)
3800 currentYieldFile = fileName;
3802 CreateYieldStructure();
3803 TFile::Open(fileName);
3804 for (Int_t i=0; i<3; i++)
3806 for (Int_t j=0; j<6; j++)
3808 for (Int_t k=0; k<4; k++)
3810 // CINT limitation here
3811 TGraphErrors** tmp = yields[i][j][k];
3812 for (Int_t l=0; l<31; l++)
3814 //Printf("%d %d %d %d", i, j, k, l);
3815 tmp[l] = gFile->Get(Form("yield_%d_%d_%d_%d", i, j, k, l));
3822 void CreateYieldStructure()
3826 yields = new TGraphErrors****[3];
3827 for (Int_t i=0; i<3; i++)
3829 yields[i] = new TGraphErrors***[6];
3830 for (Int_t j=0; j<6; j++)
3832 yields[i][j] = new TGraphErrors**[4];
3833 for (Int_t k=0; k<4; k++)
3835 yields[i][j][k] = new TGraphErrors*[31];
3836 // CINT limitation here
3837 TGraphErrors** tmp = yields[i][j][k];
3838 for (Int_t l=0; l<31; l++)
3840 //Printf("%d %d %d %d", i, j, k, l);
3841 TGraphErrors* graph = new TGraphErrors;
3850 void GraphShiftX(TGraphErrors* graph, Float_t offset)
3852 for (Int_t i=0; i<graph->GetN(); i++)
3853 graph->GetX()[i] += offset;
3856 // Float_t kPythiaScalingFactor = 0.935;
3857 Float_t kPythiaScalingFactor = 1;
3859 void DrawYields(const char* fileName = "yields.root")
3861 ReadYields(fileName);
3863 c = new TCanvas("c", "c", 1800, 1200);
3866 Int_t markers1[] = { 24, 25, 26, 30 };
3867 Int_t markers2[] = { 20, 21, 22, 29 };
3868 Int_t colors[] = { 1, 2, 3, 4 };
3869 //Int_t caseList[] = { 0, 10+1, 10+1, 8, 10, 11, 12, 13, 1, 9 };
3870 Int_t caseList[] = { 0, 18, 18, 23, 18, 19, 20, 21, 22, 9 };
3871 const char* caseString[] = { "", "baseline sub", "baseline vs v2 sub comp", 0, "baseline sub comp", "Same/Mixed", "Same/Mixed - v2 subtr" };
3876 Int_t centralityList[] = { 0, 1, 2, 0, 0, 1 };
3877 Int_t centralityList2[] = { -1, -1, -1, 1, 2, 2 };
3878 Float_t factors[] = { 1, 1, 1, 1, 1, 1 };
3879 const char* centralityString[] = { "0-5%", "20-40%", "60-90%", "0-5% vs 20-40%", "0-5% vs 60-90%", "20-40% vs 60-90%" };
3883 Int_t centralityList[] = { 0, 2, 3, 0, 0, 2 };
3884 Int_t centralityList2[] = { -1, -1, -1, 2, 3, 3 };
3885 //Float_t factors[] = { 1, 1, 1, 1, 1.0/0.9, 1.0/0.9 };
3886 //Float_t factors[] = { 1, 1, 1, 1, 1.0/0.804, 1.0/0.804 };
3887 Float_t factors[] = { 1, 1, 1, 1, 1.0/kPythiaScalingFactor, 1.0/kPythiaScalingFactor };
3888 //Float_t factors[] = { 1, 1, 1, 1, 1.0, 1.0 };
3889 const char* centralityString[] = { "0-5%", "60-90%", "pp", "0-5% vs 60-90%", "0-5% vs pp", "60-90% vs pp" };
3892 l = new TLegend(0.5, 0.5, 0.9, 0.9);
3895 Float_t max[] = { 0.4, 2, 2, 2, 2, 10, 10 };
3896 Float_t max2[] = { 5, 2, 2, 2, 2, 2, 2, 2, 2 };
3898 dummy = new TH2F("dummy", ";p_{T,assoc};yield", 100, 0, 20, 20000, 0, 10);
3901 TGraphErrors* prevNear[6];
3902 TGraphErrors* prevAway[6];
3903 for (Int_t caseId=0; caseId<9; caseId++) // case 0->9
3905 for (Int_t k=0; k<6; k++) // centrality
3907 if (caseId != 3 && caseId < 5)
3910 c->cd(1 + k + caseId*6);
3912 c->cd(1 + k + (caseId-1)*6);
3913 currentDummy = dummy->DrawCopy();
3914 currentDummy->GetYaxis()->SetRangeUser(0, max[caseId]);
3918 latex = new TLatex(0.15, 0.95, Form("%s - %s", caseString[caseId], centralityString[k]));
3920 latex->SetTextSize(0.05);
3923 else if (caseId == 3)
3928 for (Int_t j=0; j<3; j++) // trigger pt
3930 if (caseId >= 2 && j != 1)
3932 Printf("%d %d %d %d", caseId, k, j, caseList[caseId]);
3936 // CINT limitation here
3937 TGraphErrors** tmp = yields[0][j][centralityList[k]];
3938 nearSide = tmp[caseList[caseId]];
3939 //new TCanvas; nearSide->Draw("AP"); return;
3941 nearSide->SetMarkerStyle(markers1[j]);
3942 nearSide->SetMarkerColor(colors[j]);
3943 nearSide->SetLineColor(colors[j]);
3945 if (caseId == 0 && k == 0)
3946 l->AddEntry(nearSide, Form("trig pt bin %d", j), "P");
3948 TGraphErrors** tmp = yields[1][j][centralityList[k]];
3949 awaySide = tmp[caseList[caseId]];
3950 awaySide->SetMarkerStyle(markers2[j]);
3951 awaySide->SetMarkerColor(colors[j]);
3952 awaySide->SetLineColor(colors[j]);
3954 GraphShiftX(nearSide, -0.1 + j*0.1);
3955 GraphShiftX(awaySide, -0.1 + j*0.1);
3959 nearSide->SetLineColor(caseId - 2);
3960 nearSide->SetMarkerColor(caseId - 2);
3961 awaySide->SetLineColor(caseId - 2);
3962 awaySide->SetMarkerColor(caseId - 2);
3967 nearSide->SetLineColor(caseId - 3);
3968 nearSide->SetMarkerColor(caseId - 3);
3969 awaySide->SetLineColor(caseId - 3);
3970 awaySide->SetMarkerColor(caseId - 3);
3975 prevNear[k] = (TGraphErrors*) nearSide->DrawClone("PSAME");
3976 prevAway[k] = (TGraphErrors*) awaySide->DrawClone("PSAME");
3981 for (Int_t i=0; i<nearSide->GetN(); i++)
3983 Printf("%f: %.0f%%", nearSide->GetX()[i], 100.0 * nearSide->GetEY()[i] / nearSide->GetY()[i]);
3984 Printf("%f: %.0f%%", awaySide->GetX()[i], 100.0 * awaySide->GetEY()[i] / awaySide->GetY()[i]);
3990 // CINT limitation here
3991 tmp = yields[0][j][centralityList[k]]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
3992 tmp = yields[1][j][centralityList[k]]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
3994 tmp = yields[0][j][centralityList2[k]];
3995 nearSidePeripheral = tmp[caseList[caseId]];
3996 if (iaa && caseId == 3 && k >= 4)
3997 nearSidePeripheral = tmp[caseList[caseId-1]];
3999 tmp = yields[1][j][centralityList2[k]];
4000 awaySidePeripheral = tmp[caseList[caseId]];
4001 if (iaa && caseId == 3 && k >= 4)
4002 awaySidePeripheral = tmp[caseList[caseId-1]];
4004 // nearSideCentral->Print();
4005 // nearSidePeripheral->Print();
4008 currentDummy->GetYaxis()->SetTitle("I_{CP}");
4010 currentDummy->GetYaxis()->SetTitle("I_{AA}");
4011 currentDummy->GetYaxis()->SetRangeUser(0, max2[caseId]);
4013 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4015 if (i >= nearSidePeripheral->GetN())
4017 nearSideCentral->RemovePoint(i);
4022 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4023 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4025 nearSideCentral->RemovePoint(i);
4026 nearSidePeripheral->RemovePoint(i);
4031 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4032 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4033 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4035 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4036 nearSideCentral->GetY()[i] *= factors[k];
4038 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4042 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4044 if (i >= awaySidePeripheral->GetN())
4046 awaySideCentral->RemovePoint(i);
4051 //Printf("away %d", i);
4052 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
4054 awaySideCentral->RemovePoint(i);
4055 awaySidePeripheral->RemovePoint(i);
4060 awaySideCentral->GetEY()[i] = TMath::Sqrt(
4061 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
4062 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
4064 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
4065 awaySideCentral->GetY()[i] *= factors[k];
4067 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
4072 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4073 nearSideCentral->SetLineColor(1);
4074 nearSideCentral->SetMarkerColor(1);
4076 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4077 awaySideCentral->SetLineColor(1);
4078 awaySideCentral->SetMarkerColor(1);
4083 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4084 nearSideCentral->SetLineColor(caseId - 3);
4085 nearSideCentral->SetMarkerColor(caseId - 3);
4087 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4088 awaySideCentral->SetLineColor(caseId - 3);
4089 awaySideCentral->SetMarkerColor(caseId - 3);
4092 //Printf("%d", caseList[caseId]);
4094 // nearSideCentral->Print();
4096 nearSideCentral->Draw("PSAME");
4097 awaySideCentral->Draw("PSAME");
4101 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4102 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]));
4103 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4104 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]));
4107 prevNear[k] = nearSideCentral;
4108 prevAway[k] = awaySideCentral;
4111 if (caseId == 0 && k == 0)
4116 c->SaveAs("yields.png");
4119 void FitGaussians(const char* fileName, Bool_t flat)
4121 CreateYieldStructure();
4123 aliceFile = TFile::Open(fileName);
4125 Int_t maxLeadingPt = 3;
4126 Int_t maxAssocPt = 3;
4128 TCanvas* canvas = new TCanvas("FitGaussians", "FitGaussians", 1000, 700);
4129 canvas->Divide(maxAssocPt, maxLeadingPt);
4131 for (Int_t i=0; i<maxLeadingPt; i++)
4132 for (Int_t j=0; j<maxAssocPt; j++)
4135 for (Int_t aliceCentrality=0; aliceCentrality<4; aliceCentrality++)
4137 Printf("%d %d %d", i, j, aliceCentrality);
4139 canvas->cd(j+1 + (i) * maxAssocPt);
4140 gPad->SetLeftMargin(0.15);
4141 gPad->SetBottomMargin(0.2);
4142 //gPad->SetTopMargin(0.01);
4143 gPad->SetRightMargin(0.01);
4145 hist = (TH1*) aliceFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, (flat) ? "_fit_flat" : ""));
4152 gausFit = new TF1("gausFit", "[0] + gaus(1) + gaus(4)", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
4153 gausFit->SetParameters(0, 1, 0, 1, 1, TMath::Pi(), 1);
4154 gausFit->SetParLimits(0, -1, 10000);
4155 gausFit->SetParLimits(1, 0.001, 10000);
4156 gausFit->FixParameter(2, 0);
4157 gausFit->SetParLimits(3, 0.05, 10);
4158 gausFit->SetParLimits(4, 0.001, 10000);
4159 gausFit->FixParameter(5, TMath::Pi());
4160 gausFit->SetParLimits(6, 0.1, 10);
4162 gausFit->SetLineWidth(1);
4163 gausFit->SetLineColor(hist->GetLineColor());
4165 hist->Fit(gausFit, "0RIQ");
4166 gausFit->FixParameter(0, gausFit->GetParameter(0));
4167 hist->Fit(gausFit, "RI", (aliceCentrality == 0) ? "" : "SAME");
4168 //gausFit->DrawCopy("SAME");
4171 TPRegexp reg("(\\d+\\.\\d+) \\< p_\\{T,assoc\\} \\< (\\d+\\.\\d+)");
4172 arr = reg.MatchS(hist->GetTitle(), "", 0, 10);
4173 if (arr->GetEntries() != 3)
4176 Float_t pt1 = atof(arr->At(1)->GetName());
4177 Float_t pt2 = atof(arr->At(2)->GetName());
4179 FillYield(i, aliceCentrality, (pt1 + pt2) / 2, (pt2 - pt1) / 2, 18, gausFit->GetParameter(3), gausFit->GetParError(3), gausFit->GetParameter(6), gausFit->GetParError(6));
4184 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), hist->GetMinimum()), TMath::Max(first->GetMaximum(), hist->GetMaximum()));
4186 first->GetYaxis()->SetRangeUser(first->GetMinimum(), 2 * first->GetMaximum());
4194 for (Int_t j=0; j<maxLeadingPt; j++)
4198 Int_t markers1[] = { 24, 25, 26, 30 };
4199 Int_t markers2[] = { 20, 21, 22, 29 };
4200 Int_t colors[] = { 1, 2, 3, 4 };
4202 dummy = new TH2F("dummy", ";p_{T,assoc};", 100, 0, 10, 1000, 0, 1);
4206 for (Int_t k=0; k<4; k++) // centrality
4208 // CINT limitation here
4209 TGraphErrors** tmp = yields[0][j][k];
4211 nearSide->SetMarkerStyle(markers1[k]);
4212 nearSide->SetMarkerColor(colors[k]);
4213 nearSide->SetLineColor(colors[k]);
4215 TGraphErrors** tmp = yields[1][j][k];
4217 awaySide->SetMarkerStyle(markers2[k]);
4218 awaySide->SetMarkerColor(colors[k]);
4219 awaySide->SetLineColor(colors[k]);
4221 nearSide->DrawClone("PSAME");
4222 awaySide->DrawClone("PSAME");
4227 void TsallisExamples()
4229 tsallis = new TF1("tsallis", "[0] * (1-[2]*(1-[1])*x*x)**(1/(1-[1]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
4231 Float_t q[] = { 1.0000001, 1.5, 2 };
4232 Float_t beta[] = { 0.1, 1, 10, 100 };
4234 dummy = new TH2F("dummy", "", 100, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), 100, 0, 1.2);
4238 legend = new TLegend(0.65, 0.5, 1, 1);
4239 legend->SetFillColor(0);
4241 for (Int_t i=0; i<3; i++)
4242 for (Int_t j=0; j<4; j++)
4244 tsallis->SetParameters(1, q[i], beta[j]);
4245 tsallis->SetLineColor(i+1);
4246 tsallis->SetLineStyle(j+1);
4248 legend->AddEntry(tsallis->DrawCopy("SAME"), Form("q = %.1f, #beta = %.1f", q[i], beta[j]), "L");
4254 void DrawTsallisParams()
4258 c = new TCanvas("c", "c", 900, 600);
4261 Int_t markers1[] = { 24, 25, 26, 30 };
4262 Int_t markers2[] = { 20, 21, 22, 29 };
4263 Int_t colors[] = { 1, 2, 3, 4 };
4264 Int_t caseList[] = { 12, 13, 8, 6, 8, 9, 10, 11, 1, 7 };
4265 const char* caseString[] = { "q", "beta" };
4266 const char* centralityString[] = { "0-5%", "20-40%", "60-90%", "0-5% vs 20-40%", "0-5% vs 60-90%", "20-40% vs 60-90%" };
4268 l = new TLegend(0.5, 0.5, 0.9, 0.9);
4271 Float_t max[] = { 3, 1000 };
4272 Float_t max2[] = { 5, 2 };
4274 dummy = new TH2F("dummy", ";p_{T,assoc};", 100, 0, 20, 1000, 0, 1000);
4277 for (Int_t caseId=0; caseId<2; caseId++) // case
4279 for (Int_t k=0; k<3; k++) // centrality
4281 c->cd(1 + k + caseId*3);
4283 currentDummy = dummy->DrawCopy();
4284 currentDummy->GetYaxis()->SetRangeUser(0, max[caseId]);
4285 if (caseId == 1 && k < 3)
4288 latex = new TLatex(0.15, 0.95, Form("%s - %s", caseString[caseId], centralityString[k]));
4290 latex->SetTextSize(0.05);
4293 for (Int_t j=0; j<2; j++) // trigger pt
4297 // CINT limitation here
4298 TGraphErrors** tmp = yields[0][j][k];
4299 nearSide = tmp[caseList[caseId]];
4300 nearSide->SetMarkerStyle(markers1[j]);
4301 nearSide->SetMarkerColor(colors[j]);
4302 nearSide->SetLineColor(colors[j]);
4304 if (caseId == 0 && k == 0)
4305 l->AddEntry(nearSide, Form("trig pt bin %d", j), "P");
4307 TGraphErrors** tmp = yields[1][j][k];
4308 awaySide = tmp[caseList[caseId]];
4309 awaySide->SetMarkerStyle(markers2[j]);
4310 awaySide->SetMarkerColor(colors[j]);
4311 awaySide->SetLineColor(colors[j]);
4313 GraphShiftX(nearSide, -0.1 + j*0.1);
4314 GraphShiftX(awaySide, -0.1 + j*0.1);
4316 Printf("%d %d %d", caseId, j, k);
4320 nearSide->DrawClone("PSAME");
4321 awaySide->DrawClone("PSAME");
4325 // CINT limitation here
4328 tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4329 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4330 tmp = yields[0][j][1]; nearSidePeripheral = tmp[caseList[caseId]];
4331 tmp = yields[1][j][1]; awaySidePeripheral = tmp[caseList[caseId]];
4335 tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4336 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4337 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
4338 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
4342 tmp = yields[0][j][1]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4343 tmp = yields[1][j][1]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4344 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
4345 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
4348 currentDummy->GetYaxis()->SetTitle("I_{CP}");
4349 currentDummy->GetYaxis()->SetRangeUser(0, max2[caseId]);
4351 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4353 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4354 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4356 nearSideCentral->RemovePoint(i);
4357 nearSidePeripheral->RemovePoint(i);
4362 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4363 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4364 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4366 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4368 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4372 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4374 //Printf("away %d", i);
4375 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
4377 awaySideCentral->RemovePoint(i);
4378 awaySidePeripheral->RemovePoint(i);
4383 awaySideCentral->GetEY()[i] = TMath::Sqrt(
4384 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
4385 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
4387 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
4389 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
4394 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4395 nearSideCentral->SetLineColor(1);
4396 nearSideCentral->SetMarkerColor(1);
4398 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4399 awaySideCentral->SetLineColor(1);
4400 awaySideCentral->SetMarkerColor(1);
4405 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4406 nearSideCentral->SetLineColor(caseId - 3);
4407 nearSideCentral->SetMarkerColor(caseId - 3);
4409 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4410 awaySideCentral->SetLineColor(caseId - 3);
4411 awaySideCentral->SetMarkerColor(caseId - 3);
4414 //Printf("%d", caseList[caseId]);
4416 nearSideCentral->Draw("PSAME");
4417 awaySideCentral->Draw("PSAME");
4420 if (caseId == 0 && k == 0)
4425 c->SaveAs("tsallisparams.png");
4428 void DrawYieldLHCRHIC_ICP(const char* fileName = "yields.root")
4431 Int_t caseList[] = { 18 };
4434 ReadYields(fileName);
4436 c = new TCanvas("lhc_rhic", "lhc_rhic", 800, 600);
4440 dummy = new TH2F("dummy", ";p_{T,assoc};I_{CP}", 100, 0, 12, 1000, 0, 10);
4442 currentDummy = dummy->DrawCopy();
4443 currentDummy->GetYaxis()->SetRangeUser(0, 2);
4445 TGraphErrors** tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4446 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4447 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
4448 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
4450 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4452 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4453 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4455 nearSideCentral->RemovePoint(i);
4456 nearSidePeripheral->RemovePoint(i);
4461 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4462 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4463 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4465 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4467 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4471 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4473 //Printf("away %d", i);
4474 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
4476 awaySideCentral->RemovePoint(i);
4477 awaySidePeripheral->RemovePoint(i);
4482 awaySideCentral->GetEY()[i] = TMath::Sqrt(
4483 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
4484 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
4486 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
4488 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
4491 nearSideCentral->SetMarkerStyle(21);
4492 nearSideCentral->SetLineColor(1);
4493 nearSideCentral->SetMarkerColor(1);
4495 awaySideCentral->SetMarkerStyle(25);
4496 awaySideCentral->SetLineColor(1);
4497 awaySideCentral->SetMarkerColor(1);
4499 nearSideCentral->Draw("PSAME");
4500 awaySideCentral->Draw("PSAME");
4502 legend = new TLegend(0.4, 0.8, 0.99, 0.99);
4503 legend->SetFillColor(0);
4504 legend->AddEntry(nearSideCentral, "ALICE I_{CP} Near 8-15 GeV 0-5%/60-90%", "P");
4505 legend->AddEntry(awaySideCentral, "ALICE I_{CP} Away 8-15 GeV 0-5%/60-90%", "P");
4509 nearSideCentral->Fit("pol1", "", "SAME", 4.5, 11.5);
4510 awaySideCentral->Fit("pol1", "", "SAME", 4.5, 11.5);
4511 nearSideCentral->GetFunction("pol1")->SetLineWidth(1);
4512 awaySideCentral->GetFunction("pol1")->SetLineWidth(1);
4518 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
4519 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
4521 //dndpt_central->Print();
4522 //dndpt_peripheral->Print();
4524 // ratio of Ncoll (from paper)
4525 // TODO there is also an uncertainty on that
4526 Double_t scale = 1690. / 15.7;
4527 Double_t scaleUnc = TMath::Sqrt(TMath::Power(131. / 1690., 2) + TMath::Power(0.7 / 15.7, 2));
4529 for (Int_t i=0; i<dndpt_central->GetN(); i++)
4531 dndpt_central->GetEY()[i] = TMath::Sqrt(TMath::Power(dndpt_central->GetEY()[i] / dndpt_central->GetY()[i], 2) +
4532 TMath::Power(dndpt_peripheral->GetEY()[i] / dndpt_peripheral->GetY()[i], 2));
4533 dndpt_central->GetY()[i] /= dndpt_peripheral->GetY()[i] * scale;
4534 dndpt_central->GetEY()[i] *= dndpt_central->GetY()[i];
4538 //dndpt_central->Print();
4539 //dndpt_central->Draw("AP");
4541 dndpt_central->Draw("*SAME");
4543 latex = new TLatex(0.34, 0.09, "9% N_{coll} scale uncertainty on R_{CP}");
4544 latex->SetTextSize(0.03);
4548 raa_central = ReadHepdata("raa_alice_central.txt", kFALSE, 3);
4549 raa_central->SetMarkerStyle(20);
4550 //raa_central->Draw("PSAME");
4552 legend->AddEntry(dndpt_central, "ALICE R_{CP} 0-5%/70-80%", "P");
4558 // calculate ICP from IAA(0-20) / IAA (20-60)
4559 // TODO only using uncertainties from IAA(0-20)
4560 // TODO systematic uncertainty stored in graph with _sys appended
4561 TFile::Open("rhic/pi0h_graphs.root");
4563 for (Int_t i=0; i<3; i+=2)
4565 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
4566 central = (TGraphErrors*) gFile->Get(Form("gIAA_3_0_%d", i));
4567 peripheral = (TGraphErrors*) gFile->Get(Form("gIAA_3_1_%d", i));
4569 for (Int_t j=0; j<central->GetN(); j++)
4571 central->GetY()[j] /= peripheral->GetY()[j];
4572 central->GetEY()[j] /= peripheral->GetY()[j];
4575 central->SetMarkerStyle((i == 0) ? 29 : 30);
4576 central->SetMarkerColor(2);
4577 central->SetLineColor(2);
4578 central->Draw("PSAME");
4579 legend->AddEntry(central, Form("PHENIX I_{CP} %s 9-12 GeV 0-20%/20-60%", (i == 0) ? "Near" : "Away"), "P");
4585 c->SaveAs("icp.png");
4588 TGraphErrors* GetRatio(const char* fileName, Int_t centrality1, Int_t centrality2, Int_t triggerId, Int_t caseId, Int_t side, const char* fileName2 = 0)
4590 // 0 = near side; 1 = away side
4592 ReadYields(fileName);
4594 TGraphErrors** tmp = yields[side][triggerId][centrality1];
4595 nearSideCentral = (TGraphErrors*) tmp[caseId]->Clone();
4598 ReadYields(fileName2);
4600 tmp = yields[side][triggerId][centrality2];
4601 nearSidePeripheral = (TGraphErrors*) tmp[caseId]->Clone();
4603 // Printf("%d %d", nearSideCentral->GetN(), nearSidePeripheral->GetN());
4605 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4607 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4609 nearSideCentral->RemovePoint(i);
4610 nearSidePeripheral->RemovePoint(i);
4615 if (nearSideCentral->GetX()[i] != nearSidePeripheral->GetX()[i])
4617 Printf("Inconsistent x values %f %f", nearSideCentral->GetX()[i], nearSidePeripheral->GetX()[i]);
4621 // printf("%f %f %f", nearSideCentral->GetX()[i], nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4623 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4624 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4625 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4627 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4629 if (centrality2 == 3)
4630 nearSideCentral->GetY()[i] /= kPythiaScalingFactor;
4632 // Printf(" %f", nearSideCentral->GetY()[i]);
4634 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4637 //nearSideCentral->GetXaxis()->SetTitle("p_{T, assoc}");
4638 //nearSideCentral->GetYaxis()->SetTitle((centrality2 == 3) ? "I_{AA}" : "I_{CP}");
4640 if (0 && side == 1 && centrality2 == 3)
4642 Printf("\n\n\nWARNING !!! Fudging different away side acceptance (only for second file)\n\n\n");
4643 ScaleGraph(nearSideCentral, 1.56);
4646 return nearSideCentral;
4649 TGraphErrors* GetIAA(const char* fileName, Int_t centrality, Int_t triggerId, Int_t caseId, Int_t side)
4651 return GetRatio(fileName, centrality, 3, triggerId, caseId, side);
4654 TGraphErrors* GetICP(const char* fileName, Int_t triggerId, Int_t caseId, Int_t side)
4656 return GetRatio(fileName, 1, 2, triggerId, caseId, side);
4659 void DrawYieldLHCRHIC_IAA(const char* fileName, Bool_t central, Bool_t rhic)
4662 Int_t caseList[] = { 18 };
4665 ReadYields(fileName);
4667 c = new TCanvas("lhc_rhic", "lhc_rhic", 800, 600);
4671 dummy = new TH2F("dummy", ";p_{T,assoc};I_{AA}", 100, 0, 12, 1000, 0, 10);
4673 currentDummy = dummy->DrawCopy();
4674 currentDummy->GetYaxis()->SetRangeUser(0, 3);
4676 Int_t nominatorBin = 0;
4680 nearSideCentral = GetIAA(fileName, nominatorBin, j, caseList[caseId], 0);
4681 awaySideCentral = GetIAA(fileName, nominatorBin, j, caseList[caseId], 1);
4683 nearSideCentral->SetMarkerStyle(21);
4684 nearSideCentral->SetLineColor(1);
4685 nearSideCentral->SetMarkerColor(1);
4687 awaySideCentral->SetMarkerStyle(25);
4688 awaySideCentral->SetLineColor(1);
4689 awaySideCentral->SetMarkerColor(1);
4691 nearSideCentral->Draw("PSAME");
4692 awaySideCentral->Draw("PSAME");
4694 legend = new TLegend(0.4, 0.8, 0.99, 0.99);
4695 legend->SetFillColor(0);
4696 legend->AddEntry(nearSideCentral, Form("ALICE I_{AA} Near 8-15 GeV %s%%/Pythia6", (central) ? "0-5" : "60-90"), "P");
4697 legend->AddEntry(awaySideCentral, Form("ALICE I_{AA} Away 8-15 GeV %s%%/Pythia6", (central) ? "0-5" : "60-90"), "P");
4702 // systematic uncertainty stored in graph with _sys appended
4703 TFile::Open("rhic/pi0h_graphs.root");
4705 for (Int_t i=0; i<3; i+=2)
4707 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
4708 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_2_%d_%d", (central) ? 0 : 1, i));
4709 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_2_%d_%d_sys", (central) ? 0 : 1, i));
4711 rhic_iaa->SetMarkerStyle((i == 0) ? 29 : 30);
4712 rhic_iaa->SetMarkerColor(2);
4713 rhic_iaa->SetLineColor(2);
4714 rhic_iaa->Draw("PSAME");
4715 rhic_iaa_sys->SetLineColor(2);
4716 rhic_iaa_sys->SetMarkerColor(2);
4717 rhic_iaa_sys->Draw("PSAME");
4718 legend->AddEntry(rhic_iaa, Form("PHENIX I_{AA} %s 7-9 GeV %s%%/pp", (i == 0) ? "Near" : "Away", (central) ? "0-20" : "20-60"), "P");
4720 for (Int_t i=0; i<3; i+=2)
4722 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
4723 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_3_%d_%d", (central) ? 0 : 1, i));
4724 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_3_%d_%d_sys", (central) ? 0 : 1, i));
4726 rhic_iaa->SetMarkerStyle((i == 0) ? 20 : 24);
4727 rhic_iaa->SetMarkerColor(4);
4728 rhic_iaa->SetLineColor(4);
4729 rhic_iaa->Draw("PSAME");
4730 rhic_iaa_sys->SetLineColor(4);
4731 rhic_iaa_sys->SetMarkerColor(4);
4732 rhic_iaa_sys->Draw("PSAME");
4733 legend->AddEntry(rhic_iaa, Form("PHENIX I_{AA} %s 9-12 GeV %s%%/pp", (i == 0) ? "Near" : "Away", (central) ? "0-20" : "20-60"), "P");
4739 c->SaveAs("iaa.png");
4742 void CompareIAAICP(const char* fileName1, const char* fileName2, Int_t nominatorBin, Int_t denominatorBin, Bool_t skipAway = kFALSE)
4746 // caseId = 23; Printf("WARNING: Comparing case 23");
4747 //Int_t caseId = 12;
4749 nearSide1 = GetRatio(fileName1, nominatorBin, denominatorBin, j, caseId, 0);
4751 awaySide1 = GetRatio(fileName1, nominatorBin, denominatorBin, j, caseId, 1);
4753 awaySide1 = new TGraphErrors;
4755 kPythiaScalingFactor = 1;
4756 nearSide2 = GetRatio(fileName2, nominatorBin, denominatorBin, j, caseId, 0);
4758 awaySide2 = GetRatio(fileName2, nominatorBin, denominatorBin, j, caseId, 1);
4760 awaySide2 = new TGraphErrors;
4762 // Printf("\n\n\nWARNING !!! Fudging different away side acceptance (only for second file)\n\n\n");
4763 // ScaleGraph(awaySide2, 1.56);
4765 /* ScaleGraph(nearSide2, 1.33);
4766 ScaleGraph(awaySide2, 1.33);*/
4769 dummy = new TH2F("dummy", Form(";p_{T,assoc};%s", (denominatorBin == 3) ? "I_{AA}" : "I_{CP}"), 100, 2, 12, 1000, 0, 10);
4771 currentDummy = dummy->DrawCopy();
4772 currentDummy->GetYaxis()->SetRangeUser(0, 2.5);
4774 nearSide1->SetMarkerStyle(21);
4775 nearSide1->SetLineColor(1);
4776 nearSide1->SetMarkerColor(1);
4778 nearSide2->SetMarkerStyle(21);
4779 nearSide2->SetLineColor(2);
4780 nearSide2->SetMarkerColor(2);
4782 awaySide1->SetMarkerStyle(25);
4783 awaySide1->SetLineColor(1);
4784 awaySide1->SetMarkerColor(1);
4786 awaySide2->SetMarkerStyle(25);
4787 awaySide2->SetLineColor(2);
4788 awaySide2->SetMarkerColor(2);
4790 RemovePointsBelowX(nearSide1, 3);
4791 RemovePointsBelowX(nearSide2, 3);
4792 RemovePointsBelowX(awaySide1, 3);
4793 RemovePointsBelowX(awaySide2, 3);
4798 nearSide1->DrawClone("PSAME");
4799 awaySide1->DrawClone("PSAME");
4800 nearSide2->DrawClone("PSAME");
4801 awaySide2->DrawClone("PSAME");
4804 currentDummy = dummy->DrawCopy();
4805 currentDummy->GetYaxis()->SetRangeUser(0.5, 1.5);
4809 DivideGraphs(nearSide1, nearSide2);
4810 DivideGraphs(awaySide1, awaySide2);
4812 nearSide1->Draw("PSAME");
4813 awaySide1->Draw("PSAME");
4815 nearSide1->Fit("pol0", "", "SAME", 3.01, 9.99);
4816 awaySide1->Fit("pol0", "", "SAME", 3.01, 9.99);
4819 void ScaleGraph(TGraphErrors* graph, Float_t factor)
4821 for (Int_t i=0; i<graph->GetN(); i++)
4823 graph->GetY()[i] *= factor;
4824 graph->GetEY()[i] *= factor;
4828 TGraphErrors* DrawBaselines(const char* fileName, Int_t numeratorBin, Int_t denominatorBin, Int_t side, Bool_t verbose = kTRUE)
4832 TGraphErrors* first = 0;
4833 TGraphErrors* max = 0;
4838 dummy = new TH2F("dummy", Form(";p_{T,assoc};%s", (denominatorBin == 3) ? "I_{AA}" : "I_{CP}"), 100, 0, 12, 1000, 0, 10);
4840 currentDummy = dummy->DrawCopy();
4841 currentDummy->GetYaxis()->SetRangeUser(0, 3);
4844 currentDummy = dummy->DrawCopy();
4845 currentDummy->GetYaxis()->SetRangeUser(0, 2);
4848 // Int_t caseList[] = { 18, 19, 21, 22 };
4849 //Int_t caseList[] = { 23, 24, 26, 27 };
4850 Int_t caseList[] = { 18, 19, 22 };
4852 for (Int_t caseId = 0; caseId < 3; caseId++)
4854 graph = GetRatio(fileName, numeratorBin, denominatorBin, j, caseList[caseId], side);
4856 graph->SetLineColor(caseId + 1);
4857 graph->SetMarkerColor(caseId + 1);
4859 RemovePointsBelowX(graph, 3);
4864 graph->DrawClone("*SAME");
4870 max = (TGraphErrors*) graph->Clone();
4871 for (Int_t i=0; i<max->GetN(); i++)
4874 max->GetEY()[i] = 0;
4879 DivideGraphs(graph, first);
4884 graph->DrawClone("*SAME");
4887 for (Int_t i=0; i<graph->GetN(); i++)
4889 if (max->GetY()[i] < TMath::Abs(graph->GetY()[i] - 1))
4890 max->GetY()[i] = TMath::Abs(graph->GetY()[i] - 1);
4901 max->GetXaxis()->SetTitle("p_{T, assoc}");
4902 max->GetYaxis()->SetTitle((denominatorBin == 3) ? "Effect on I_{AA}" : "Effect on I_{CP}");
4903 max->GetYaxis()->SetRangeUser(0, 0.4);
4908 void DrawBaselinesAll(const char* fileName)
4910 c = new TCanvas("c", "c", 1000, 600);
4913 for (Int_t i=0; i<2; i++)
4915 c->cd(1+i*4); DrawBaselines(fileName, 0, 3, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4916 c->cd(2+i*4); DrawBaselines(fileName, 1, 3, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4917 c->cd(3+i*4); DrawBaselines(fileName, 2, 3, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4918 c->cd(4+i*4); DrawBaselines(fileName, 0, 2, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4922 TGraphErrors* DrawSystUncIAAPYTHIA(TGraphErrors* graph, Int_t iaa_icp, Int_t awaySide)
4926 Float_t baseline = 1;
4929 else if (awaySide == 1)
4933 Float_t reference = 0;
4938 Float_t efficiency = 0.08;
4940 Float_t centrality = 1;
4942 centrality = (awaySide == 0) ? 0.02 : 0.06;
4943 else if (iaa_icp == 1)
4944 centrality = (awaySide == 0) ? 0.04 : 0.08;
4946 Float_t ptResolution = 0;
4948 Float_t total = TMath::Sqrt(baseline * baseline + efficiency * efficiency + centrality * centrality + ptResolution * ptResolution);
4950 Printf("Total syst: %f", total);
4952 systUnc = (TGraphErrors*) graph->Clone();
4953 for (Int_t i=0; i<systUnc->GetN(); i++)
4955 systUnc->GetEY()[i] = systUnc->GetY()[i] * total;
4956 systUnc->GetEX()[i] = 0;
4961 systUnc->SetLineColor(kGray + 1);
4962 systUnc->SetLineWidth(6);
4964 systUnc->Draw("PSAME");
4969 TGraphErrors* DrawSystUncPreliminaries(TGraphErrors* graph, Int_t iaa_icp, Int_t awaySide, Int_t iaa, Bool_t central)
4973 Float_t baseline = 1;
4976 else if (awaySide == 1)
4978 if (iaa == 0 && central || iaa == 1)
4980 else if (iaa == 0 && !central)
4982 else if (iaa == 2 && central)
4987 Float_t reference = 0;
4992 Float_t efficiency = 0.08;
4996 Float_t centrality = 1;
4999 else if (iaa_icp == 1)
5002 Float_t ptResolution = 0.03;
5004 Float_t integrationWindow = 0;
5006 integrationWindow = 0.03;
5008 Float_t total = TMath::Sqrt(baseline * baseline + efficiency * efficiency + centrality * centrality + ptResolution * ptResolution + integrationWindow * integrationWindow);
5010 Printf("Total syst: %f", total);
5012 systUnc = (TGraphErrors*) graph->Clone();
5013 for (Int_t i=0; i<systUnc->GetN(); i++)
5015 systUnc->GetEY()[i] = systUnc->GetY()[i] * total;
5016 systUnc->GetEX()[i] = 0;
5021 systUnc->SetLineColor(kGray + 1);
5022 systUnc->SetLineWidth(6);
5024 systUnc->Draw("PSAME");
5029 TGraphErrors* DrawSystUnc(TGraphErrors* graph, Int_t iaa_icp, Int_t awaySide, Int_t iaa, Bool_t central, Float_t shift = 0.0)
5031 // iaa_icp: iaa = 0, icp = 1
5033 Float_t baseline = 1;
5036 else if (awaySide == 1)
5038 if (iaa == 0 && central || iaa == 1)
5040 else if (iaa == 0 && !central)
5042 else if (iaa == 2 && central)
5047 Float_t reference = 0;
5052 Float_t efficiency = 0.04;
5054 Float_t centrality = 1;
5057 else if (iaa_icp == 1)
5060 Float_t ptResolution = 0;
5062 Float_t integrationWindow = 0;
5064 integrationWindow = 0.03;
5066 Float_t corrections = 1;
5069 else if (iaa_icp == 1)
5072 Float_t twoTrack = 0.01;
5074 Float_t total = TMath::Sqrt(baseline * baseline + efficiency * efficiency + centrality * centrality + ptResolution * ptResolution + integrationWindow * integrationWindow + corrections * corrections + twoTrack * twoTrack);
5076 Printf("%f %f %f %f %f %f %f --> Total syst: %f", baseline, efficiency, centrality, ptResolution, integrationWindow, corrections, twoTrack, total);
5078 systUnc = (TGraphErrors*) graph->Clone();
5079 for (Int_t i=0; i<systUnc->GetN(); i++)
5081 systUnc->GetEY()[i] = systUnc->GetY()[i] * total;
5082 systUnc->GetEX()[i] = 0;
5083 Printf("pt = %.2f y = %.2f +- %.2f (stat.) +- %.2f (syst.)", graph->GetX()[i] - shift, graph->GetY()[i], graph->GetEY()[i], systUnc->GetEY()[i]);
5088 systUnc->SetLineColor(kGray + 1);
5089 systUnc->SetLineWidth(4);
5091 systUnc->Draw("PSAME e2");
5096 void IAA(const char* fileName, Int_t iaa, const char* fileNameEtaGap = 0)
5102 // 3 = IAA LHC with theory
5104 Bool_t showTheory = 0;
5105 Bool_t showSTAR = 0;
5119 if (kPythiaScalingFactor != 1)
5120 Printf("Using reference data scaling factor: %f", kPythiaScalingFactor);
5125 Int_t caseId[] = { 18, 23 };
5127 c = new TCanvas((iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", (iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", 900, 450);
5128 c->Range(0, 0, 1, 1);
5130 TPad* pad1 = new TPad(Form("%s_2", fileName), "", 0, 0, 0.5, 1);
5133 TPad* pad2 = new TPad(Form("%s_1", fileName), "", 0.5, 0, 1, 1);
5137 gPad->SetRightMargin(0);
5138 gPad->SetTopMargin(0.05);
5139 gPad->SetLeftMargin(0.13);
5141 // gPad->SetGridy();
5144 gPad->SetLeftMargin(0);
5145 gPad->SetTopMargin(0.05);
5146 gPad->SetRightMargin(0.13);
5148 // gPad->SetGridy();
5151 // 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);
5152 dummy = new TH2F("dummy", Form(";p_{T,assoc} (GeV/#font[12]{c});%s", (iaa != 1) ? "I_{AA}" : "I_{CP}"), 100, 1.5, 10.5, 1000, 0, 2.4);
5154 // dummy->GetYaxis()->SetTitleOffset(1.3);
5155 dummy->GetXaxis()->SetTitleOffset(1.1);
5156 currentDummy = dummy->DrawCopy();
5158 gStyle->SetTextAlign(13);
5160 latex = new TLatex(0.17, 0.90, "Near-side_{ }");
5161 latex->SetTextSize(0.04);
5167 // box = new TBox(2, 0.87, 2.5, 1.13);
5168 // box->SetFillColor(kGray + 1);
5169 // box->SetLineColor(kGray + 1);
5172 // box2 = new TBox(2, 0.87 * 1.5, 2.5, 1.13 * 1.5);
5173 // box2->SetFillColor(kGray + 1);
5174 // box2->SetLineColor(kGray + 1);
5179 currentDummy = dummy->DrawCopy();
5184 latex = new TLatex(0.05, 0.90, "Away-side");
5185 latex->SetTextSize(0.04);
5189 legend = new TLegend(0.27, (showTheory) ? 0.60 : 0.62, (iaa != 2 && !showSTAR) ? 0.63 : 0.95, 0.77);
5190 legend->SetFillColor(0);
5191 legend->SetBorderSize(0);
5192 legend->SetTextSize((iaa != 2) ? 0.04 : 0.035);
5194 for (Int_t i=0; i<2; i++)
5196 nearSideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 0);
5198 nearSidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 0);
5199 awaySideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 1);
5201 awaySidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 1);
5203 RemovePointsBelowX(nearSideCentral, 3);
5204 RemovePointsBelowX(awaySideCentral, 3);
5205 RemovePointsAboveX(nearSideCentral, 10);
5206 RemovePointsAboveX(awaySideCentral, 10);
5208 RemoveXErrors(nearSideCentral); RemoveXErrors(awaySideCentral);
5212 RemovePointsBelowX(nearSidePeripheral, 3);
5213 RemovePointsBelowX(awaySidePeripheral, 3);
5214 RemovePointsAboveX(nearSidePeripheral, 10);
5215 RemovePointsAboveX(awaySidePeripheral, 10);
5216 ShiftPoints(nearSidePeripheral, 0.2);
5217 ShiftPoints(awaySidePeripheral, 0.2);
5218 RemoveXErrors(nearSidePeripheral); RemoveXErrors(awaySidePeripheral);
5221 nearSideCentral->SetMarkerStyle(21);
5222 nearSideCentral->SetLineColor(1);
5223 nearSideCentral->SetMarkerColor(1);
5225 awaySideCentral->SetMarkerStyle(21);
5226 awaySideCentral->SetLineColor(1);
5227 awaySideCentral->SetMarkerColor(1);
5231 nearSideCentral->SetLineColor(2);
5232 nearSideCentral->SetMarkerColor(2);
5233 awaySideCentral->SetLineColor(2);
5234 awaySideCentral->SetMarkerColor(2);
5239 nearSidePeripheral->SetMarkerStyle(22);
5240 nearSidePeripheral->SetLineColor(2);
5241 nearSidePeripheral->SetMarkerColor(2);
5243 awaySidePeripheral->SetMarkerStyle(22);
5244 awaySidePeripheral->SetLineColor(2);
5245 awaySidePeripheral->SetMarkerColor(2);
5250 // TString denominatorStr("Pythia");
5251 TString denominatorStr("pp");
5254 legend->AddEntry(nearSideCentral, Form("%s0-5% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5256 legend->AddEntry(nearSidePeripheral, Form("%s60-90% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5260 // legend->AddEntry(nearSideCentral, Form("0-20% / %s", denominatorStr.Data()), "P");
5261 legend->AddEntry(nearSideCentral, Form("ALICE 8 GeV/#font[12]{c} < p_{T,trig} < 15 GeV/#font[12]{c}", denominatorStr.Data()), "P");
5266 const char* style = "PSAME";
5270 awaySideCentral->Print();
5274 DrawSystUnc(nearSideCentral, (iaa == 1), 0, iaa, kTRUE);
5275 nearSideCentral->DrawClone(style);
5276 if (iaa == 0 && !showTheory)
5279 DrawSystUnc(nearSidePeripheral, (iaa == 1), 0, iaa, kFALSE);
5280 nearSidePeripheral->DrawClone(style);
5285 DrawSystUnc(awaySideCentral, (iaa == 1), 1, iaa, kTRUE);
5286 awaySideCentral->DrawClone(style);
5287 if (iaa == 0 && !showTheory)
5290 DrawSystUnc(awaySidePeripheral, (iaa == 1), 1, iaa, kFALSE);
5291 awaySidePeripheral->DrawClone(style);
5299 nearSideEtaGapCentral = GetRatio(fileNameEtaGap, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[0], 0);
5300 RemovePointsBelowX(nearSideEtaGapCentral, 3);
5301 RemovePointsAboveX(nearSideEtaGapCentral, 10);
5302 RemoveXErrors(nearSideEtaGapCentral);
5303 nearSideEtaGapCentral->SetMarkerStyle(25);
5304 nearSideEtaGapCentral->SetLineColor(1);
5305 nearSideEtaGapCentral->SetMarkerColor(1);
5306 nearSideEtaGapCentral->Draw("PSAME");
5310 nearSideEtaGapPeripheral = GetRatio(fileNameEtaGap, 2, 3, j, caseId[0], 0);
5311 RemovePointsBelowX(nearSideEtaGapPeripheral, 3);
5312 RemovePointsAboveX(nearSideEtaGapPeripheral, 10);
5313 RemoveXErrors(nearSideEtaGapPeripheral);
5314 ShiftPoints(nearSideEtaGapPeripheral, 0.2);
5315 nearSideEtaGapPeripheral->SetMarkerStyle(26);
5316 nearSideEtaGapPeripheral->SetLineColor(2);
5317 nearSideEtaGapPeripheral->SetMarkerColor(2);
5318 nearSideEtaGapPeripheral->Draw("PSAME");
5324 // IAA, RHIC, PHENIX
5325 // systematic uncertainty stored in graph with _sys appended
5326 TFile::Open("rhic/pi0h_graphs.root");
5328 legend2 = new TLegend(0.5, 0.16, 0.96, 0.27);
5329 legend2->SetFillColor(0);
5331 for (Int_t ptTrigBin=2; ptTrigBin<4; ptTrigBin++)
5333 Bool_t central = kTRUE;
5334 for (Int_t i=0; i<3; i+=2)
5336 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
5337 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d", ptTrigBin, (central) ? 0 : 1, i));
5338 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d_sys", ptTrigBin, (central) ? 0 : 1, i));
5340 rhic_iaa->SetMarkerStyle((ptTrigBin == 2) ? 20 : 33);
5341 rhic_iaa->SetMarkerColor(2);
5342 rhic_iaa->SetLineColor(2);
5343 rhic_iaa_sys->SetLineColor(2);
5344 rhic_iaa_sys->SetMarkerColor(2);
5346 RemovePointsBelowX(rhic_iaa, 2);
5347 RemovePointsBelowX(rhic_iaa_sys, 2);
5351 rhic_iaa_sys->Print();
5353 ShiftPoints(rhic_iaa, -0.05 + 0.05 * (ptTrigBin*2-4));
5354 ShiftPoints(rhic_iaa_sys, -0.05 + 0.05 * (ptTrigBin*2-4));
5360 rhic_iaa->Draw("PSAME");
5361 rhic_iaa_sys->Draw("PSAME");
5364 legend->AddEntry(rhic_iaa, Form("PHENIX %s GeV/c < p_{T,trig} < %s GeV/c", (ptTrigBin == 2) ? "7" : "9", (ptTrigBin == 2) ? "9" : "12", (central) ? "0-20" : "20-60"), "P");
5365 // legend->AddEntry(rhic_iaa, Form("PHENIX %s GeV/c < p_{T,trig} < %s GeV/c %s%% / pp", (ptTrigBin == 2) ? "7" : "9", (ptTrigBin == 2) ? "9" : "12", (central) ? "0-20" : "20-60"), "P");
5373 if (iaa == 0 && showSTAR)
5375 for (Int_t i=0; i<2; i++)
5377 const char* centralityStr = "05";
5379 centralityStr = "4080";
5382 // systematic uncertainty stored in graph with _sys appended
5383 nearSide = ReadHepdata(Form("rhic/star_iaa_%s_near.txt", centralityStr));
5384 awaySide = ReadHepdata(Form("rhic/star_iaa_%s_away.txt", centralityStr));
5386 nearSide->SetMarkerStyle(20 + i * 13);
5387 nearSide->SetMarkerColor(4);
5388 nearSide->SetLineColor(4);
5390 awaySide->SetMarkerStyle(20 + i * 13);
5391 awaySide->SetMarkerColor(4);
5392 awaySide->SetLineColor(4);
5394 ShiftPoints(nearSide, -0.1 + 0.2 * i);
5395 ShiftPoints(awaySide, -0.1 + 0.2 * i);
5398 nearSide->Draw("PSAME");
5400 awaySide->Draw("PSAME");
5402 legend->AddEntry(nearSide, Form("STAR Au-Au 0.2 TeV %s / dAu", (i == 0) ? "0-5%" : "40-80%"), "P");
5406 // Theory predictions
5407 if (showTheory && iaa == 0)
5409 const char* theoryList[] = { "AdS", "ASW", "YaJEM", "YaJEM-D", "XinNian" };
5411 Int_t markers[] = { 27, 28, 29, 30, 34 };
5413 for (Int_t i=0; i<nTheory; i++)
5415 nearSide = ReadHepdata(Form("theory/IAA_near_%s.dat", theoryList[i]));
5416 awaySide = ReadHepdata(Form("theory/IAA_away_%s.dat", theoryList[i]));
5418 nearSide->SetMarkerStyle(markers[i]);
5419 awaySide->SetMarkerStyle(markers[i]);
5421 RemovePointsBelowX(nearSide, 3);
5422 RemovePointsBelowX(awaySide, 3);
5424 Float_t shiftBy = (i % 2 == 0) ? -0.2 : 0.2;
5425 ShiftPoints(nearSide, shiftBy);
5426 ShiftPoints(awaySide, shiftBy);
5429 nearSide->Draw("PSAME");
5432 awaySide->Draw("PSAME");
5435 theoryList[i] = "AdS/CFT";
5437 theoryList[i] = "X-N Wang";
5438 legend->AddEntry(nearSide, theoryList[i], "P");
5442 for (Int_t i=0; i<2; i++)
5454 latex = new TLatex(xC, 0.84, "0-20% / pp");
5456 latex = new TLatex(0.35+xC, 0.9, "8 GeV/#font[12]{c} < p_{T,trig} < 15 GeV/#font[12]{c}");
5457 latex->SetTextSize(0.04);
5462 line = new TLine(1.5, 1, 10.5, 1);
5463 line->SetLineStyle(2);
5468 latex = new TLatex(xC, 0.84, "0-5% / 60-90%");
5469 latex->SetTextSize(0.04);
5474 latex = new TLatex(0.65+xC, 0.90, "ALICE");
5475 // latex = new TLatex(0.5+xC, 0.90, "-- work in progress --");
5476 latex->SetTextSize(0.04);
5481 latex = new TLatex(0.35+xC, 0.84, "p_{T,assoc} < p_{T,trig}");
5482 latex->SetTextSize(0.04);
5487 if (iaa == 1 || iaa == 0)
5489 if (iaa == 0 && showSTAR)
5490 latex = new TLatex(0.3+xC, 0.90, "|#eta| < 1.0");
5492 latex = new TLatex(xC + 0.65, 0.20, "|#eta| < 1.0");
5493 latex->SetTextSize(0.04);
5499 if (iaa == 1 || (iaa == 0 && !showSTAR))
5501 latex = new TLatex(0.5+xC, 0.72, "Pb-Pb 2.76 TeV");
5502 latex->SetTextSize(0.04);
5510 latex = new TLatex(0.5, 0.24, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
5512 latex = new TLatex(xC, 0.6, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
5513 latex->SetTextSize(0.035);
5518 latex = new TLatex(0.5, 0.18, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
5520 latex = new TLatex(xC, 0.54, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
5521 latex->SetTextSize(0.035);
5526 if (showTheory && iaa == 0 && i == 1)
5527 latex = new TLatex(xC, 0.18, "Points: flat pedestal");
5529 latex = new TLatex(xC + 0.5 * i, 0.26, "Points: flat pedestal");
5530 latex->SetTextSize(0.04);
5535 latex = new TLatex(xC + 0.5 * i, 0.20, "Line: v_{2} subtracted");
5536 latex->SetTextSize(0.04);
5541 if (iaa != 1 && i == 1)
5543 legendClone = (TLegend*) legend->DrawClone();
5544 if (showTheory && iaa == 0 && i == 0)
5545 legendClone->GetListOfPrimitives()->RemoveLast();
5547 // legendClone->SetY1(legendClone->GetY1()-0.05);
5549 legend->SetX1(legend->GetX1()-0.12);
5550 legend->SetX2(legend->GetX2()-0.12);
5553 /* if (i == 0 && iaa != 2)
5554 DrawALICELogo(0.83,0.15,0.98,0.30);
5556 DrawALICELogo(0.62 + xC,0.48,0.77 + xC,0.63);*/
5559 c->SaveAs(Form("%s.eps", c->GetTitle()));
5560 c->SaveAs(Form("%s.png", c->GetTitle()));
5563 void IAAPaper(const char* fileName, Int_t iaa, const char* fileNameEtaGap = 0)
5569 Bool_t showTheory = 0;
5570 Bool_t showSTAR = 0;
5584 if (kPythiaScalingFactor != 1)
5585 Printf("Using reference data scaling factor: %f", kPythiaScalingFactor);
5590 Int_t caseId[] = { 18, 23 };
5592 c = new TCanvas((iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", (iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", 900, 450);
5593 c->Range(0, 0, 1, 1);
5595 TPad* pad1 = new TPad(Form("%s_2", fileName), "", 0, 0, 0.5, 1);
5598 TPad* pad2 = new TPad(Form("%s_1", fileName), "", 0.5, 0, 1, 1);
5602 gPad->SetRightMargin(0);
5603 gPad->SetTopMargin(0.05);
5604 gPad->SetLeftMargin(0.13);
5606 // gPad->SetGridy();
5609 gPad->SetLeftMargin(0);
5610 gPad->SetTopMargin(0.05);
5611 gPad->SetRightMargin(0.13);
5613 // gPad->SetGridy();
5616 // 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);
5617 dummy = new TH2F("dummy", Form(";#font[12]{p}_{t,assoc} (GeV/#font[12]{c});%s", (iaa != 1) ? "#font[12]{I}_{AA}" : "#font[12]{I}_{CP} (0-5% / 60-90%)"), 100, 1.5, 10.5, 1000, 0, 2.4);
5619 // dummy->GetYaxis()->SetTitleOffset(1.3);
5620 dummy->GetXaxis()->SetTitleOffset(1.1);
5621 currentDummy = dummy->DrawCopy();
5623 gStyle->SetTextAlign(13);
5625 latex = new TLatex(0.17, 0.90, "Near-side_{ }");
5626 latex->SetTextSize(0.04);
5630 latex = new TLatex(0.17, /*(iaa == 1) ? 0.78 :*/ 0.84, "#sqrt{#font[12]{s}_{NN}} = 2.76 TeV");
5631 latex->SetTextSize(0.04);
5635 latex = new TLatex(0.17, 0.2, (iaa == 1) ? "b)" : "a)");
5636 latex->SetTextSize(0.04);
5642 // box = new TBox(2, 0.87, 2.5, 1.13);
5643 // box->SetFillColor(kGray + 1);
5644 // box->SetLineColor(kGray + 1);
5647 // box2 = new TBox(2, 0.87 * 1.5, 2.5, 1.13 * 1.5);
5648 // box2->SetFillColor(kGray + 1);
5649 // box2->SetLineColor(kGray + 1);
5654 currentDummy = dummy->DrawCopy();
5659 latex = new TLatex(0.05, 0.90, "Away-side");
5660 latex->SetTextSize(0.04);
5665 legend = new TLegend(0.22, 0.60, 0.67, 0.73);
5667 legend = new TLegend(0.12, 0.60, 0.76, 0.79);
5668 legend->SetFillColor(0);
5669 legend->SetBorderSize(0);
5670 legend->SetTextSize((iaa != 2) ? 0.04 : 0.035);
5672 for (Int_t i=0; i<2; i++)
5674 nearSideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 0);
5676 nearSidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 0);
5677 awaySideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 1);
5679 awaySidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 1);
5681 RemovePointsBelowX(nearSideCentral, 3);
5682 RemovePointsBelowX(awaySideCentral, 3);
5683 RemovePointsAboveX(nearSideCentral, 10);
5684 RemovePointsAboveX(awaySideCentral, 10);
5686 ShiftPoints(nearSideCentral, -0.05);
5687 ShiftPoints(awaySideCentral, -0.05);
5691 ShiftPoints(nearSideCentral, -0.2);
5692 ShiftPoints(awaySideCentral, -0.2);
5696 ShiftPoints(nearSidePeripheral, 0.2);
5697 ShiftPoints(awaySidePeripheral, 0.2);
5701 RemoveXErrors(nearSideCentral); RemoveXErrors(awaySideCentral);
5705 RemovePointsBelowX(nearSidePeripheral, 3);
5706 RemovePointsBelowX(awaySidePeripheral, 3);
5707 RemovePointsAboveX(nearSidePeripheral, 10);
5708 RemovePointsAboveX(awaySidePeripheral, 10);
5709 ShiftPoints(nearSidePeripheral, 0.05);
5710 ShiftPoints(awaySidePeripheral, 0.05);
5711 RemoveXErrors(nearSidePeripheral); RemoveXErrors(awaySidePeripheral);
5714 nearSideCentral->SetMarkerStyle((i == 0) ? 25 : 27);
5715 nearSideCentral->SetLineColor(1);
5716 nearSideCentral->SetMarkerColor(1);
5718 awaySideCentral->SetMarkerStyle((i == 0) ? 25 : 27);
5719 awaySideCentral->SetLineColor(1);
5720 awaySideCentral->SetMarkerColor(1);
5724 nearSideCentral->SetLineColor(2);
5725 nearSideCentral->SetMarkerColor(2);
5726 awaySideCentral->SetLineColor(2);
5727 awaySideCentral->SetMarkerColor(2);
5732 nearSidePeripheral->SetMarkerStyle((i == 0) ? 21 : 33);
5733 nearSidePeripheral->SetLineColor(2);
5734 nearSidePeripheral->SetMarkerColor(2);
5736 awaySidePeripheral->SetMarkerStyle((i == 0) ? 21 : 33);
5737 awaySidePeripheral->SetLineColor(2);
5738 awaySidePeripheral->SetMarkerColor(2);
5743 // TString denominatorStr("Pythia");
5744 TString denominatorStr("pp");
5747 legend->SetHeader("0-5% Pb-Pb/pp 60-90% Pb-Pb/pp");
5748 legend->SetNColumns(2);
5750 legend->AddEntry(nearSideCentral, (i == 0) ? "Flat bkg" : "#font[12]{v}_{2} bkg", "P");
5752 legend->AddEntry(nearSidePeripheral, (i == 0) ? "Flat bkg" : "#font[12]{v}_{2} bkg", "P");
5754 // legend->AddEntry(nearSideCentral, Form("%s0-5% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5756 // legend->AddEntry(nearSidePeripheral, Form("%s60-90% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5759 // legend->AddEntry(nearSideCentral, Form("0-20% / %s", denominatorStr.Data()), "P");
5760 legend->AddEntry(nearSideCentral, Form("ALICE 8 GeV/#font[12]{c} < p_{T,trig} < 15 GeV/#font[12]{c}", denominatorStr.Data()), "P");
5765 const char* style = "PSAME";
5767 // style = "LSAMEX";
5771 DrawSystUnc(nearSideCentral, (iaa == 1), 0, iaa, kTRUE, -0.05 - 0.2 * i);
5772 nearSideCentral->DrawClone(style);
5773 if (iaa == 0 && !showTheory)
5776 DrawSystUnc(nearSidePeripheral, (iaa == 1), 0, iaa, kFALSE, 0.05 + ((iaa == 0) ? i * 0.2 : 0));
5777 nearSidePeripheral->DrawClone(style);
5782 DrawSystUnc(awaySideCentral, (iaa == 1), 1, iaa, kTRUE, -0.05 - 0.2 * i);
5783 awaySideCentral->DrawClone(style);
5784 if (iaa == 0 && !showTheory)
5787 DrawSystUnc(awaySidePeripheral, (iaa == 1), 1, iaa, kFALSE, 0.05 + ((iaa == 0) ? i * 0.2 : 0));
5788 awaySidePeripheral->DrawClone(style);
5796 nearSideEtaGapCentral = GetRatio(fileNameEtaGap, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[0], 0);
5797 RemovePointsBelowX(nearSideEtaGapCentral, 3);
5798 RemovePointsAboveX(nearSideEtaGapCentral, 10);
5799 RemoveXErrors(nearSideEtaGapCentral);
5800 nearSideEtaGapCentral->SetMarkerStyle(24);
5801 nearSideEtaGapCentral->SetLineColor(1);
5802 nearSideEtaGapCentral->SetMarkerColor(1);
5803 ShiftPoints(nearSideEtaGapCentral, -0.45);
5804 DrawSystUnc(nearSideEtaGapCentral, (iaa == 1), 0, iaa, kTRUE, -0.45);
5805 nearSideEtaGapCentral->Draw("PSAME");
5807 legend->AddEntry(nearSideEtaGapCentral, "#font[12]{#eta}-gap", "P");
5812 nearSideEtaGapPeripheral = GetRatio(fileNameEtaGap, 2, 3, j, caseId[0], 0);
5813 RemovePointsBelowX(nearSideEtaGapPeripheral, 3);
5814 RemovePointsAboveX(nearSideEtaGapPeripheral, 10);
5815 RemoveXErrors(nearSideEtaGapPeripheral);
5816 nearSideEtaGapPeripheral->SetMarkerStyle(20);
5817 nearSideEtaGapPeripheral->SetLineColor(2);
5818 nearSideEtaGapPeripheral->SetMarkerColor(2);
5819 ShiftPoints(nearSideEtaGapPeripheral, 0.45);
5820 DrawSystUnc(nearSideEtaGapPeripheral, (iaa == 1), 0, iaa, kFALSE, 0.45);
5821 nearSideEtaGapPeripheral->Draw("PSAME");
5823 legend->AddEntry(nearSideEtaGapPeripheral, "#font[12]{#eta}-gap", "P");
5829 // add pythia line showing gluon filtering
5830 // from Jan Rak, by mail, 22.09.11
5831 // pp CF calculated without any adjustment
5832 // AA CF also no adjustment. Particles (h+-) in acceptance are identified with their parent string parton (status 71)
5833 // and the flavor of parent hard outgoing parton (status 23) which is the parent of string parton 71 is checked.
5834 // If it is a gluon the particle is ignored.
5836 Float_t xVal[] = { 3.5, 4.5, 5.5, 7, 9};
5837 Float_t yVal[] = { 0.779418, 0.794234, 0.82759, 0.856457, 0.880526 };
5838 gluonfiltering = new TGraph(5, xVal, yVal);
5840 gluonfiltering->Draw("L");
5842 legend3 = new TLegend(0.38, 0.15, 0.58, 0.25);
5843 legend3->SetFillColor(0);
5844 legend3->SetBorderSize(0);
5845 legend3->SetTextSize(0.04);
5846 legend3->AddEntry(gluonfiltering, "PYTHIA quark-only fragmentation", "L");
5852 // IAA, RHIC, PHENIX
5853 // systematic uncertainty stored in graph with _sys appended
5854 TFile::Open("rhic/pi0h_graphs.root");
5856 legend2 = new TLegend(0.5, 0.16, 0.96, 0.27);
5857 legend2->SetFillColor(0);
5859 for (Int_t ptTrigBin=2; ptTrigBin<4; ptTrigBin++)
5861 Bool_t central = kTRUE;
5862 for (Int_t i=0; i<3; i+=2)
5864 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
5865 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d", ptTrigBin, (central) ? 0 : 1, i));
5866 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d_sys", ptTrigBin, (central) ? 0 : 1, i));
5868 rhic_iaa->SetMarkerStyle((ptTrigBin == 2) ? 20 : 33);
5869 rhic_iaa->SetMarkerColor(2);
5870 rhic_iaa->SetLineColor(2);
5871 rhic_iaa_sys->SetLineColor(2);
5872 rhic_iaa_sys->SetMarkerColor(2);
5874 ShiftPoints(rhic_iaa, -0.05 + 0.05 * (ptTrigBin*2-4));
5875 ShiftPoints(rhic_iaa_sys, -0.05 + 0.05 * (ptTrigBin*2-4));
5881 rhic_iaa->Draw("PSAME");
5882 rhic_iaa_sys->Draw("PSAME");
5885 legend->AddEntry(rhic_iaa, Form("PHENIX %s GeV/c < p_{T,trig} < %s GeV/c", (ptTrigBin == 2) ? "7" : "9", (ptTrigBin == 2) ? "9" : "12", (central) ? "0-20" : "20-60"), "P");
5886 // legend->AddEntry(rhic_iaa, Form("PHENIX %s GeV/c < p_{T,trig} < %s GeV/c %s%% / pp", (ptTrigBin == 2) ? "7" : "9", (ptTrigBin == 2) ? "9" : "12", (central) ? "0-20" : "20-60"), "P");
5894 if (iaa == 0 && showSTAR)
5896 for (Int_t i=0; i<2; i++)
5898 const char* centralityStr = "05";
5900 centralityStr = "4080";
5903 // systematic uncertainty stored in graph with _sys appended
5904 nearSide = ReadHepdata(Form("rhic/star_iaa_%s_near.txt", centralityStr));
5905 awaySide = ReadHepdata(Form("rhic/star_iaa_%s_away.txt", centralityStr));
5907 nearSide->SetMarkerStyle(20 + i * 13);
5908 nearSide->SetMarkerColor(4);
5909 nearSide->SetLineColor(4);
5911 awaySide->SetMarkerStyle(20 + i * 13);
5912 awaySide->SetMarkerColor(4);
5913 awaySide->SetLineColor(4);
5915 ShiftPoints(nearSide, -0.1 + 0.2 * i);
5916 ShiftPoints(awaySide, -0.1 + 0.2 * i);
5919 nearSide->Draw("PSAME");
5921 awaySide->Draw("PSAME");
5923 legend->AddEntry(nearSide, Form("STAR Au-Au 0.2 TeV %s / dAu", (i == 0) ? "0-5%" : "40-80%"), "P");
5927 // Theory predictions
5928 if (showTheory && iaa == 0)
5930 const char* theoryList[] = { "AdS", "ASW", "YaJEM", "YaJEM-D", "XinNian" };
5932 Int_t markers[] = { 27, 28, 29, 30, 34 };
5934 for (Int_t i=0; i<nTheory; i++)
5936 nearSide = ReadHepdata(Form("theory/IAA_near_%s.dat", theoryList[i]));
5937 awaySide = ReadHepdata(Form("theory/IAA_away_%s.dat", theoryList[i]));
5939 nearSide->SetMarkerStyle(markers[i]);
5940 awaySide->SetMarkerStyle(markers[i]);
5942 RemovePointsBelowX(nearSide, 3);
5943 RemovePointsBelowX(awaySide, 3);
5945 Float_t shiftBy = (i % 2 == 0) ? -0.2 : 0.2;
5946 ShiftPoints(nearSide, shiftBy);
5947 ShiftPoints(awaySide, shiftBy);
5950 nearSide->Draw("PSAME");
5953 awaySide->Draw("PSAME");
5956 theoryList[i] = "AdS/CFT";
5958 theoryList[i] = "X-N Wang";
5959 legend->AddEntry(nearSide, theoryList[i], "P");
5963 for (Int_t i=0; i<2; i++)
5975 latex = new TLatex(xC, 0.84, "0-20% / pp");
5977 latex = new TLatex(0.35+xC, 0.9, "8 GeV/#font[12]{c} < #font[12]{p}_{t,trig} < 15 GeV/#font[12]{c}");
5978 latex->SetTextSize(0.04);
5983 line = new TLine(1.5, 1, 10.5, 1);
5984 line->SetLineStyle(2);
5987 // if (iaa == 1 && i == 0)
5989 // latex = new TLatex(xC, 0.84, "0-5% / 60-90%");
5990 // latex->SetTextSize(0.04);
5995 latex = new TLatex(0.65+xC, 0.90, "ALICE");
5996 // latex = new TLatex(0.5+xC, 0.90, "-- work in progress --");
5997 latex->SetTextSize(0.04);
6002 latex = new TLatex(0.35+xC, 0.84, "#font[12]{p}_{t,assoc} < #font[12]{p}_{t,trig}");
6003 latex->SetTextSize(0.04);
6008 if (iaa == 1 || iaa == 0)
6010 if (iaa == 0 && showSTAR)
6011 latex = new TLatex(0.3+xC, 0.90, "|#font[12]{#eta}| < 1.0");
6013 latex = new TLatex(0.82, 0.84, "|#font[12]{#eta}| < 1.0");
6014 latex->SetTextSize(0.04);
6020 if (iaa == 1 || (iaa == 0 && !showSTAR))
6022 latex = new TLatex(0.5+xC, 0.72, "Pb-Pb 2.76 TeV");
6023 latex->SetTextSize(0.04);
6031 latex = new TLatex(0.5, 0.24, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
6033 latex = new TLatex(xC, 0.6, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
6034 latex->SetTextSize(0.035);
6039 latex = new TLatex(0.5, 0.18, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
6041 latex = new TLatex(xC, 0.54, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
6042 latex->SetTextSize(0.035);
6049 legendClone = (TLegend*) legend->DrawClone();
6050 if (showTheory && iaa == 0 && i == 0)
6051 legendClone->GetListOfPrimitives()->RemoveLast();
6053 // legendClone->SetY1(legendClone->GetY1()-0.05);
6055 legend->SetX1(legend->GetX1()-0.12);
6056 legend->SetX2(legend->GetX2()-0.12);
6061 /* if (i == 0 && iaa != 2)
6062 DrawALICELogo(0.83,0.15,0.98,0.30);
6064 DrawALICELogo(0.62 + xC,0.48,0.77 + xC,0.63);*/
6067 c->SaveAs(Form("%s.eps", c->GetTitle()));
6068 c->SaveAs(Form("%s.png", c->GetTitle()));
6072 void DrawALICELogo(Float_t x1, Float_t y1, Float_t x2, Float_t y2, Bool_t debug = kFALSE)
6074 DrawALICELogo(kTRUE, x1, y1, x2, y2, debug);
6077 void DrawALICELogo(Bool_t prel, Float_t x1, Float_t y1, Float_t x2, Float_t y2, Bool_t debug = kFALSE)
6079 // correct for aspect ratio of figure plus aspect ratio of pad (coordinates are NDC!)
6080 // Printf("%d %f %d %f", gPad->GetCanvas()->GetWindowHeight(), gPad->GetHNDC(), gPad->GetCanvas()->GetWindowWidth(), gPad->GetWNDC());
6081 //x2 = x1 + (y2 - y1) * 0.891 * gPad->GetCanvas()->GetWindowHeight() * gPad->GetHNDC() / (gPad->GetWNDC() * gPad->GetCanvas()->GetWindowWidth());
6082 x2 = x1 + (y2 - y1) * (466. / 523) * gPad->GetWh() * gPad->GetHNDC() / (gPad->GetWNDC() * gPad->GetWw());
6083 // Printf("%f %f %f %f", x1, x2, y1, y2);
6086 DrawLatex((x1+x2)/2, y1, 1, "09.05.12", 0.03)->SetTextAlign(23);
6087 TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo", x1, y1, x2, y2);
6089 myPadLogo->SetFillColor(2); // color to first figure out where is the pad then comment !
6090 myPadLogo->SetLeftMargin(0);
6091 myPadLogo->SetTopMargin(0);
6092 myPadLogo->SetRightMargin(0);
6093 myPadLogo->SetBottomMargin(0);
6096 // TASImage *myAliceLogo = new TASImage("~/alice_logo_transparent.png");
6097 TASImage *myAliceLogo = new TASImage((prel) ? "~/alice_logo_preliminary.eps" : "~/alice_logo_performance.eps");
6098 myAliceLogo->Draw();
6101 void RemoveXErrors(TGraphErrors* graph)
6103 for (Int_t i=0; i<graph->GetN(); i++)
6104 graph->GetEX()[i] = 0;
6107 void RemovePointsBelowX(TGraphErrors* graph, Float_t minX)
6110 while (i<graph->GetN())
6112 if (graph->GetX()[i] < minX)
6113 graph->RemovePoint(i);
6119 void RemovePointsAboveX(TGraphErrors* graph, Float_t maxX)
6122 while (i<graph->GetN())
6124 if (graph->GetX()[i] > maxX)
6125 graph->RemovePoint(i);
6131 void ShiftPoints(TGraphErrors* graph, Float_t dx)
6134 while (i<graph->GetN())
6136 graph->GetX()[i] += dx;
6141 void DivideGraphs(TGraphErrors* graph1, TGraphErrors* graph2)
6146 for (Int_t bin1 = 0; bin1 < graph1->GetN(); bin1++)
6148 Float_t x = graph1->GetX()[bin1];
6151 for (bin2 = 0; bin2<graph2->GetN(); bin2++)
6152 if (graph2->GetX()[bin2] >= x)
6155 if (bin2 == graph2->GetN())
6159 if (TMath::Abs(graph2->GetX()[bin2-1] - x) < TMath::Abs(graph2->GetX()[bin2] - x))
6162 if (graph1->GetY()[bin1] == 0 || graph2->GetY()[bin2] == 0 || bin2 == graph2->GetN())
6164 Printf("%d %d removed", bin1, bin2);
6165 graph1->RemovePoint(bin1--);
6169 Float_t graph2Extrapolated = graph2->GetY()[bin2];
6170 if (TMath::Abs(x - graph2->GetX()[bin2]) > 0.0001)
6172 Printf("%f %f %d %d not found", x, graph2->GetX()[bin2], bin1, bin2);
6173 graph1->RemovePoint(bin1--);
6177 Float_t value = graph1->GetY()[bin1] / graph2Extrapolated;
6178 Float_t error = value * TMath::Sqrt(TMath::Power(graph1->GetEY()[bin1] / graph1->GetY()[bin1], 2) + TMath::Power(graph2->GetEY()[bin2] / graph2->GetY()[bin2], 2));
6180 graph1->GetY()[bin1] = value;
6181 graph1->GetEY()[bin1] = error;
6183 Printf("%d %d %f %f %f %f", bin1, bin2, x, graph2Extrapolated, value, error);
6187 Float_t ExtractYields(TH1* hist, Int_t trigId, Int_t centralityId, Float_t ptA, Float_t ptW, Int_t caseId, Double_t normUnc)
6189 CreateYieldStructure();
6191 Float_t width = 0.69;
6192 // Float_t width = 0.5; Printf("WARNING. Using integration width 0.5");
6193 // Float_t width = 0.85; Printf("WARNING. Using integration width 0.85");
6195 //new TCanvas; hist->DrawCopy();
6197 Int_t binBegin = hist->FindBin(-width);
6198 Int_t binEnd = hist->FindBin(width);
6199 Double_t nearSideError = 0;
6200 Float_t nearSideYield = hist->IntegralAndError(binBegin, binEnd, nearSideError);
6201 nearSideYield *= hist->GetXaxis()->GetBinWidth(1);
6202 nearSideError *= hist->GetXaxis()->GetBinWidth(1);
6204 Int_t binBegin = hist->FindBin(TMath::Pi() - width);
6205 Int_t binEnd = hist->FindBin(TMath::Pi() + width);
6206 Double_t awaySideError = 0;
6207 Float_t awaySideYield = hist->IntegralAndError(binBegin, binEnd, awaySideError);
6208 awaySideYield *= hist->GetXaxis()->GetBinWidth(1);
6209 awaySideError *= hist->GetXaxis()->GetBinWidth(1);
6211 Printf("%d %d %f %d: %f+-%f %f+-%f (%f)", trigId, centralityId, ptA, caseId, nearSideYield, nearSideError, awaySideYield, awaySideError, normUnc);
6213 FillYield(trigId, centralityId, ptA, ptW, caseId, nearSideYield, TMath::Sqrt(nearSideError * nearSideError + normUnc * normUnc), awaySideYield, TMath::Sqrt(awaySideError * awaySideError + normUnc * normUnc));
6215 // store normUnc for error propagation later
6216 TGraphErrors** tmp = yields[2][trigId][centralityId];
6217 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, normUnc);
6219 return awaySideYield;
6222 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)
6224 // CINT limitation here
6225 TGraphErrors** tmp = yields[0][trigId][centralityId];
6226 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, nearSideYield);
6227 tmp[caseId]->SetPointError(tmp[caseId]->GetN()-1, ptW, nearSideError);
6228 //tmp[caseId]->Print();
6230 tmp = yields[1][trigId][centralityId];
6231 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, awaySideYield);
6232 tmp[caseId]->SetPointError(tmp[caseId]->GetN()-1, ptW, awaySideError);
6235 Double_t hypgeo(Double_t a, Double_t b, Double_t c, Double_t z)
6237 // ROOT::Math::hyperg is only defined for |z| < 1
6239 return ROOT::Math::hyperg(a, b, c, z);
6241 // for z < -1 we can use an identity from http://en.wikipedia.org/wiki/Hypergeometric_function
6242 return TMath::Power(1-z, -b) * ROOT::Math::hyperg(c-a, b, c, z / (z-1));
6245 Double_t hypgeoder2(Double_t a, Double_t b, Double_t c, Double_t z)
6247 // derivate of hypgeo with parameter b: d/db hypgeo
6249 static TF1* func = 0;
6251 func = new TF1("hypgeoder2_func", "hypgeo([0], x, [1], [2])");
6253 func->SetParameters(a, c, z);
6254 return func->Derivative(b);
6257 void TsallisYieldUncertainty(Double_t n, Double_t q, Double_t beta, TMatrixDSym covMatrix, Int_t offset, Double_t& yield, Double_t& unc)
6259 gSystem->Load("libMathMore");
6261 TF1 tsallis("tsallis", "[0] * (1-[2]*(1-[1])*x*x)**(1/(1-[1]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
6263 // 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]
6264 // [0] = n, [1] = q, [2] = beta
6265 TF1 tsallisIntegral("tsallisIntegral", "[0]*x*hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x)");
6266 TF1 tsallisIntegralDerN("tsallisIntegralDerN", "x*hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x)");
6268 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)");
6270 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]");
6272 const Float_t width = 0.7;
6275 derivates[0] = new TF1("const", "1");
6276 derivates[1] = &tsallisIntegralDerN;
6277 derivates[2] = &tsallisIntegralDerq;
6278 derivates[3] = &tsallisIntegralDerbeta;
6280 Printf("%f %f %f", n, q, beta);
6282 tsallis.SetParameters(n, q, beta);
6283 tsallisIntegral.SetParameters(n, q, beta);
6284 for (Int_t i=1; i<4; i++)
6285 derivates[i]->SetParameters(n, q, beta);
6287 yield = tsallisIntegral.Eval(width) - tsallisIntegral.Eval(-width);
6288 Double_t yield2 = tsallis.Integral(-width, width);
6291 for (Int_t i=0; i<4; i++)
6292 for (Int_t j=0; j<4; j++)
6301 Double_t der1 = (derivates[i]->Eval(width) - derivates[i]->Eval(-width));
6302 Double_t der2 = (derivates[j]->Eval(width) - derivates[j]->Eval(-width));
6304 unc += der1 * der2 * covMatrix(covI, covJ);
6306 Printf("%d %d % .3e % .3e % .3e % .3e", i, j, der1, der2, covMatrix(covI, covJ), unc);
6309 unc = TMath::Sqrt(unc);
6312 yield2 /= width * 2;
6315 Printf("%f (%f) +- %f", yield, yield2, unc);
6318 double NLowestBinAverage(TH1 &h, int N)
6320 // Returns mean content of N lowest bins in h.
6324 std::list<double> content;
6325 std::list<double>::iterator i;
6327 for (int jbin=1; jbin<=h.GetNbinsX(); jbin++) {
6328 content.push_back(h.GetBinContent(jbin));
6332 for (i = content.begin(); i != content.end(); ++i) {
6342 Warning("NLowestBinAverage()",
6343 "Avg. of %d bins requested, %d used", N, counter);
6348 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, Float_t* vn = 0)
6351 // 0 same with v2 (14 tsallis for baseline [28/29 tsallis params]; 15 yield from tsallis function)
6352 // [disabled] 1 same/mixed with v2 (15 tsallis for baseline)
6353 // 2 same no v2 (16 tsallis for baseline; 17 yield from tsallis function)
6354 // 4 same no v2 (18 flat fit 1)
6355 // 5 same no v2 (19 flat fit 2)
6356 // 6 same no v2 (20 flat avg over 4)
6357 // 7 same no v2 (21 flat avg over 8)
6358 // 8 same no v2 (22 flat avg over 16)
6359 // 9 same with v2 (23 flat fit 1)
6360 // 10 same with v2 (24 flat fit 2)
6361 // 11 same with v2 (25 flat avg over 4)
6362 // 12 same with v2 (26 flat avg over 8)
6363 // 13 same with v2 (27 flat avg over 16)
6365 // 30 gaussian fit width
6367 // same stuff for same/mixed
6368 if (0 && caseOffset == 0 && histMixed)
6370 TH1* clone = (TH1*) hist->Clone();
6371 clone->Divide(histMixed);
6372 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 1, ptACenter, ptAWidth, kFALSE, 0, vn);
6375 // same for other baseline subtractions
6376 if (caseOffset == 0)
6378 file = TFile::Open("dphi_corr.root", "UPDATE");
6382 TH1* clone = (TH1*) hist->Clone();
6383 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 2, ptACenter, ptAWidth, kTRUE, 0, vn);
6385 clone = (TH1*) hist->Clone();
6386 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 4, ptACenter, ptAWidth, kTRUE, 1, vn);
6388 clone = (TH1*) hist->Clone();
6389 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 5, ptACenter, ptAWidth, kTRUE, 2, vn);
6391 clone = (TH1*) hist->Clone();
6392 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 6, ptACenter, ptAWidth, kTRUE, 3, vn);
6394 clone = (TH1*) hist->Clone();
6395 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 7, ptACenter, ptAWidth, kTRUE, 4, vn);
6397 clone = (TH1*) hist->Clone();
6398 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 8, ptACenter, ptAWidth, kTRUE, 5, vn);
6400 clone = (TH1*) hist->Clone();
6401 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 9, ptACenter, ptAWidth, kFALSE, 1, vn);
6403 clone = (TH1*) hist->Clone();
6404 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 10, ptACenter, ptAWidth, kFALSE, 2, vn);
6406 clone = (TH1*) hist->Clone();
6407 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 11, ptACenter, ptAWidth, kFALSE, 3, vn);
6409 clone = (TH1*) hist->Clone();
6410 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 12, ptACenter, ptAWidth, kFALSE, 4, vn);
6412 clone = (TH1*) hist->Clone();
6413 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 13, ptACenter, ptAWidth, kFALSE, 5, vn);
6416 Float_t awaySideYield = ExtractYields(hist, trigId, centralityId, ptACenter, ptAWidth, 0 + caseOffset, 0);
6424 /* Float_t v2Trig = flowGraph->Eval(ptT);
6425 Float_t v2Assoc = flowGraph->Eval(ptA);
6426 Float_t v2 = v2Trig * v2Assoc;
6427 Printf("%f %f: %.2f %.2f --> %.4f", ptT, ptA, v2Trig, v2Assoc, v2);*/
6429 TF1* flowFunc = new TF1("flowFunc", "[0] * (1+2*[1]*cos(2*x)+2*[2]*cos(3*x)+2*[3]*cos(4*x)+2*[4]*cos(5*x))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
6434 Float_t minBin = hist->FindBin(0.6);
6435 for (Int_t bin=hist->FindBin(0.6); bin<=hist->FindBin(1.8); bin++)
6436 if (hist->GetBinContent(bin) < hist->GetBinContent(minBin))
6439 Float_t norm = hist->GetBinContent(minBin) / (1 + 2 * v2 * cos(2 * hist->GetBinCenter(minBin)));
6440 Double_t normUnc = 0;
6444 if (baseLineDetermination == 0)
6448 if (centralityId == 0)
6449 hist->Fit("pol0", "0", "", 0.8., 1.2);
6451 hist->Fit("pol0", "0", "", 1.2, 1.6);
6453 //tsallis = new TF1("tsallis", "(1-[1]*(1-[0])*x*x)**(1/(1-[0]))", 0, 10)
6454 // (1-b(1-q)x*x)**(1/(1-q))
6456 // combination of two tsallis functions
6457 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());
6458 //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());
6459 // 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
6460 total->SetParLimits(0, 0, 10000);
6461 total->SetParLimits(1, 0, 10000);
6462 total->SetParLimits(4, 0, 10000);
6464 total->SetParLimits(2, 1.0000001, 5);
6465 total->SetParLimits(5, 1.0000001, 5);
6467 total->SetParLimits(3, 0.1, 1000);
6468 total->SetParLimits(6, 0.1, 1000);
6470 total->SetParameters(1, 1, 1.5, 3, 1, 1.5, 1.1);
6473 hist->Fit(total, "0RI");
6474 fitResult = hist->Fit(total, "0RSI");
6476 if (0 && fitResult->CovMatrixStatus() > 0)
6478 TMatrixDSym cov(fitResult->GetCovarianceMatrix());
6481 Double_t nearSideYield, nearSideError;
6482 TsallisYieldUncertainty(total->GetParameter(1), total->GetParameter(2), total->GetParameter(3), cov, 0, nearSideYield, nearSideError);
6484 Double_t awaySideYield2, awaySideError;
6485 TsallisYieldUncertainty(total->GetParameter(4), total->GetParameter(5), total->GetParameter(6), cov, 3, awaySideYield2, awaySideError);
6487 FillYield(trigId, centralityId, ptACenter, ptAWidth, 14 + caseOffset + 1, nearSideYield, nearSideError, awaySideYield2, awaySideError);
6489 Printf("Chi2 %f / ndf %d = %f", total->GetChisquare(), total->GetNDF(), (total->GetNDF() > 0) ? total->GetChisquare() / total->GetNDF() : -1);
6491 total->SetLineColor(hist->GetLineColor());
6492 total->SetLineWidth(1);
6493 if (caseOffset == 2)
6496 total->DrawCopy("SAME");
6497 //total->SetParameter(5, total->GetParameter(5) - TMath::Sqrt(cov[5][5]));
6498 //total->DrawCopy("SAME");
6499 //total->SetParameter(5, total->GetParameter(5) + 2 * TMath::Sqrt(cov[5][5]));
6500 //Printf("%f", total->Integral(-0.7,0.7));
6501 //total->DrawCopy("SAME");
6504 if (caseOffset == 0)
6506 // store fit parameters
6509 FillYield(trigId, centralityId, ptACenter, ptAWidth, 28, total->GetParameter(2), total->GetParError(2), total->GetParameter(5), total->GetParError(5));
6511 FillYield(trigId, centralityId, ptACenter, ptAWidth, 29, total->GetParameter(3), total->GetParError(3), total->GetParameter(6), total->GetParError(6));
6516 gausFit = new TF1("gausFit", "[0] + gaus(1) + gaus(4)", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
6517 gausFit->SetParameters(1, 1, 0, 1, 1, TMath::Pi(), 0);
6518 gausFit->SetParLimits(0, 0, 10000);
6519 gausFit->SetParLimits(1, 0, 10000);
6520 gausFit->FixParameter(2, 0);
6521 gausFit->SetParLimits(3, 0.01, 10);
6522 gausFit->SetParLimits(4, 0, 10000);
6523 gausFit->FixParameter(5, TMath::Pi());
6524 gausFit->SetParLimits(6, 0.01, 10);
6526 hist->Fit(gausFit, "0RI");
6527 gausFit->SetLineWidth(1);
6528 gausFit->DrawCopy("SAME");
6530 FillYield(trigId, centralityId, ptACenter, ptAWidth, 30, gausFit->GetParameter(3), total->GetParError(3), total->GetParameter(6), total->GetParError(6));
6534 if (0 && cov[0][0] > 0)
6536 for (Int_t i=0; i<cov.GetNcols(); i++)
6537 for (Int_t j=0; j<cov.GetNrows(); j++)
6538 cov[j][i] /= TMath::Sqrt(cov[i][i]) * TMath::Sqrt(cov[j][j]);
6544 Float_t norm = func->GetParameter(0) / (1 - 2 * v2);
6545 Double_t normUnc = func->GetParError(0) / (1 - 2 * v2);
6548 else if (baseLineDetermination <= 2)
6553 if (baseLineDetermination == 1)
6555 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4, 1.5 * TMath::Pi() - 0.4 };
6556 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4, TMath::Pi() / 2 + 0.4, 1.5 * TMath::Pi() };
6558 else if (baseLineDetermination == 2)
6560 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4 - 0.2, 1.5 * TMath::Pi() - 0.4 - 0.2};
6561 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4 - 0.2, TMath::Pi() / 2 + 0.4 - 0.2, 1.5 * TMath::Pi() };
6567 for (Int_t i=0; i<3; i++)
6569 hist->Fit("pol0", "0Q", "", regionBegin[i], regionEnd[i]);
6570 func = hist->GetFunction("pol0");
6573 sum += func->GetParameter(0) / func->GetParError(0) / func->GetParError(0);
6574 weight += 1. / func->GetParError(0) / func->GetParError(0);
6581 weight = TMath::Sqrt(1. / weight);
6583 Float_t norm = sum / (1 - 2 * v2);
6584 Double_t normUnc = weight / (1 - 2 * v2);
6589 if (baseLineDetermination == 4)
6591 if (baseLineDetermination == 5)
6593 Float_t norm = NLowestBinAverage(*hist, bins);
6594 Double_t normUnc = 0;
6596 Printf("NLowestBinAverage %d --> %f", bins, norm);
6598 norm /= (1 - 2 * v2);
6601 Printf("Baseline: %f +- %f", norm, normUnc);
6604 if (caseOffset == 0)
6606 Float_t awaySideYieldNoBaseline = awaySideYield - norm * (1 - 2 * v2);
6607 Float_t v2YieldNoBaseline = norm * 2 * v2 * (1 + 1.4) / 1.4;
6608 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);
6611 //flowFunc->SetParameters(hist->GetBinContent(hist->FindBin(1.4)) / (1.0 - 2.0 * v2), v2);
6612 flowFunc->SetParameters(norm, v2, 0, 0, 0);
6614 flowFunc->SetParameters(norm, vn[1], vn[2], vn[3], vn[4]);
6615 flowFunc->SetLineWidth(2);
6616 if (caseOffset >= 4 && caseOffset <= 9 && caseOffset != 6 && caseOffset != 7)
6618 if (caseOffset != 4 && caseOffset != 9)
6619 flowFunc->SetLineStyle(2);
6620 flowFunc->DrawCopy("SAME"); //->SetLineColor(caseOffset - 3);
6623 flowFuncTmp = (TF1*) flowFunc->Clone("flowFuncTmp");
6624 for (Int_t i=1; i<=4; i++)
6626 flowFuncTmp->SetParameters(flowFuncTmp->GetParameter(0), 0, 0, 0, 0);
6627 flowFuncTmp->SetParameter(i, vn[i]);
6628 flowFuncTmp->SetLineStyle(2);
6629 flowFuncTmp->Print();
6630 flowFuncTmp->DrawCopy("SAME");
6635 hist->Add(flowFunc, -1);
6636 if (caseOffset == 0)
6638 file = TFile::Open("dphi_corr.root", "UPDATE");
6639 hist->SetName(TString(hist->GetName()) + "_tsallis_v2");
6642 // hist->DrawCopy("SAME");
6644 if (caseOffset == 2 && flatBaseLine)
6646 file = TFile::Open("dphi_corr.root", "UPDATE");
6647 hist->SetName(TString(hist->GetName()) + "_tsallis_flat");
6650 // hist->DrawCopy("SAME");
6652 if (caseOffset == 4 && flatBaseLine)
6654 file = TFile::Open("dphi_corr.root", "UPDATE");
6655 hist->SetName(TString(hist->GetName()) + "_fit_flat");
6658 // hist->DrawCopy("SAME");
6660 if (caseOffset == 9)
6662 file = TFile::Open("dphi_corr.root", "UPDATE");
6663 hist->SetName(TString(hist->GetName()) + "_fit_v2");
6666 // hist->DrawCopy("SAME");
6669 ExtractYields(hist, trigId, centralityId, ptACenter, ptAWidth, 14 + caseOffset, normUnc);
6673 Printf("%f", histMixed->Integral() / histMixed->GetNbinsX());
6674 flowFunc->SetParameters(histMixed->Integral() / histMixed->GetNbinsX(), v2);
6675 flowFunc->SetLineColor(2);
6676 //if (caseOffset == 0)
6677 // flowFunc->DrawCopy("SAME");
6681 void RemoveBaseLine(TH1* hist)
6689 hist->Fit("pol0", "0", "", 1.07, 2.07);
6691 if (!hist->GetFunction("pol0"))
6694 Float_t zyam = hist->GetFunction("pol0")->GetParameter(0);
6701 for (Int_t i=1; i<=hist->GetNbinsX(); i++)
6702 hist->SetBinContent(i, hist->GetBinContent(i) - zyam);
6706 TH2* cacheMixed[10];
6708 Int_t gHistCount = 0;
6709 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, Int_t stepMixed = -1, Bool_t useCentralityBinsDirectly = kFALSE)
6711 h = (AliUEHistograms*) hVoid;
6712 hMixed = (AliUEHistograms*) hMixedVoid;
6717 Int_t centralityBeginBin = 0;
6718 Int_t centralityEndBin = -1;
6720 if (!useCentralityBinsDirectly && centralityEnd >= centralityBegin)
6722 centralityBeginBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityBegin);
6723 centralityEndBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityEnd);
6725 else if (useCentralityBinsDirectly)
6727 centralityBeginBin = centralityBegin;
6728 centralityEndBin = centralityEnd;
6731 // 2d same and mixed event
6732 TH2* sameTwoD = h->GetUEHist(2)->GetUEHist(step, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, 1, kFALSE);
6738 // No centrality, nor pT associated dep of the mixed event observed. Use a larger range to get more statistics
6742 for (Int_t i=0; i<10; i++)
6743 if (cacheIds[i] == hMixed)
6751 for (Int_t i=0; i<10; i++)
6752 if (cacheIds[i] == 0)
6758 if (!cacheIds[cacheId])
6760 hMixed->SetPtRange(3.0, 10);
6761 cacheMixed[cacheId] = (TH2*) hMixed->GetUEHist(2)->GetUEHist(stepMixed, 0, 3.0, 10.0, centralityBeginBin, centralityEndBin, 1, kFALSE);
6762 cacheIds[cacheId] = hMixed;
6763 Printf("GetDistAndFlow: Cached for %p on slot %d", hMixed, cacheId);
6766 TH2* mixedTwoD = cacheMixed[cacheId];
6770 // use same bin for mixing
6772 TH2* mixedTwoD = (TH2*) hMixed->GetUEHist(2)->GetUEHist(stepMixed, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, 1, kFALSE);
6777 // asssume flat in dphi, gain in statistics
6778 Printf("NOTE: Assuming flat acceptance in phi!");
6780 TH1* histMixedproj = mixedTwoD->ProjectionY();
6781 histMixedproj->Scale(1.0 / mixedTwoD->GetNbinsX());
6783 for (Int_t x=1; x<=mixedTwoD->GetNbinsX(); x++)
6784 for (Int_t y=1; y<=mixedTwoD->GetNbinsY(); y++)
6785 mixedTwoD->SetBinContent(x, y, histMixedproj->GetBinContent(y));
6788 // get mixed event normalization by assuming full acceptance at deta of 0 (only works for flat dphi)
6791 Double_t mixedNorm = mixedTwoD->Integral(1, mixedTwoD->GetNbinsX(), mixedTwoD->GetYaxis()->FindBin(-0.01), mixedTwoD->GetYaxis()->FindBin(0.01));
6792 mixedNorm /= mixedTwoD->GetNbinsX() * (mixedTwoD->GetYaxis()->FindBin(0.01) - mixedTwoD->GetYaxis()->FindBin(-0.01) + 1);
6795 Double_t mixedNorm = mixedTwoD->Integral() / sameTwoD->Integral();
6798 sameTwoD->Divide(mixedTwoD);
6799 sameTwoD->Scale(mixedNorm);
6802 sameTwoD->Draw("SURF1");
6807 histName.Form("GetDistAndFlow%d", gHistCount++);
6809 // extract dphi distribution if requested
6815 // Float_t etaLimit = 0.8;
6816 Float_t etaLimit = 1.0;
6818 // 20: return corr in |delta eta| < 1 from which 1 < |delta eta| < 2 is subtracted
6819 if (twoD == 0 || twoD == 10 || twoD == 20)
6822 Int_t etaEnd = sameTwoD->GetNbinsY();
6824 if (twoD == 10 || twoD == 20)
6826 etaBegin = sameTwoD->GetYaxis()->FindBin(-etaLimit + 0.01);
6827 etaEnd = sameTwoD->GetYaxis()->FindBin(etaLimit - 0.01);
6830 *hist = sameTwoD->ProjectionX(histName, etaBegin, etaEnd);
6833 (*hist)->Scale(1.0 / (etaEnd - etaBegin + 1));
6836 if (twoD == 11 || twoD == 20)
6838 // errors --> are ok
6840 // Float_t outerLimit = 2.0;
6841 Float_t outerLimit = 1.8;
6842 Printf("Phi dist: Using outer limit %.2f", outerLimit);
6843 // Float_t outerLimit = etaLimit * 2;
6845 histTmp = sameTwoD->ProjectionX(histName + "1", TMath::Max(1, sameTwoD->GetYaxis()->FindBin(-outerLimit + 0.01)), sameTwoD->GetYaxis()->FindBin(-etaLimit - 0.01));
6846 Int_t etaBins = sameTwoD->GetYaxis()->FindBin(-etaLimit - 0.01) - TMath::Max(1, sameTwoD->GetYaxis()->FindBin(-outerLimit + 0.01)) + 1;
6848 TH1D* tracksTmp = sameTwoD->ProjectionX(histName + "2", sameTwoD->GetYaxis()->FindBin(etaLimit + 0.01), TMath::Min(sameTwoD->GetYaxis()->GetNbins(), sameTwoD->GetYaxis()->FindBin(outerLimit - 0.01)));
6849 etaBins += TMath::Min(sameTwoD->GetYaxis()->GetNbins(), sameTwoD->GetYaxis()->FindBin(outerLimit - 0.01)) - sameTwoD->GetYaxis()->FindBin(etaLimit + 0.01) + 1;
6851 // printf("%f +- %f %f +- %f ", (*hist)->GetBinContent(1), (*hist)->GetBinError(1), tracksTmp->GetBinContent(1), tracksTmp->GetBinError(1));
6852 histTmp->Add(tracksTmp);
6853 // Printf(" --> %f +- %f", (*hist)->GetBinContent(1), (*hist)->GetBinError(1));
6856 histTmp->Scale(1.0 / etaBins);
6860 else if (twoD == 20)
6862 // calculate acc with 2 * (deta - 0.5 * deta*deta / 1.6)
6864 histTmp->Scale(0.75 / 0.25);
6866 histTmp->Scale(1.0 / 0.8);
6868 (*hist)->Add(histTmp, -1);
6872 // (*hist)->Rebin(2); (*hist)->Scale(0.5);
6874 //*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);
6877 str.Form("%.1f < p_{T,trig} < %.1f", ptBegin - 0.01, ptEnd + 0.01);
6880 str2.Form("%.2f < p_{T,assoc} < %.2f", gpTMin - 0.01, gpTMax + 0.01);
6883 newTitle.Form("%s - %s - %d-%d", str.Data(), str2.Data(), centralityBegin, centralityEnd);
6884 if (!useCentralityBinsDirectly)
6886 (*hist)->SetTitle(newTitle);
6890 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));
6892 //new TCanvas; (*hist)->DrawCopy(); histMixed->DrawCopy("SAME")->SetLineColor(2);
6894 Float_t totalPairs = (*hist)->Integral();
6896 (*hist)->Divide(histMixed);
6897 (*hist)->Scale(totalPairs / (*hist)->Integral());
6899 //(*hist)->DrawCopy("SAME")->SetLineColor(4);
6904 // calculate v2trigger
6905 h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
6906 ptDist = h->GetUEHist(2)->GetEventHist()->Project(step, 0);
6908 for (Int_t i=2; i<=((vn) ? 5 : 2); i++)
6909 vTrig[i-1] = CalculateFlow(ptDist, ptBegin, ptEnd, i, centralityBegin, centralityEnd);
6912 // calculate v2 assoc
6913 cont = h->GetUEHist(2)->GetTrackHist(0);
6914 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(step)->GetGrid()->GetAxis(3)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
6915 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(step)->GetGrid()->GetAxis(2)->SetRangeUser(ptBegin, ptEnd);
6916 ptDist = h->GetUEHist(2)->GetTrackHist(0)->Project(step, 1);
6918 for (Int_t i=2; i<=((vn) ? 5 : 2); i++)
6919 vAssoc[i-1] = CalculateFlow(ptDist, gpTMin, gpTMax, i, centralityBegin, centralityEnd);
6923 *v2 = vTrig[2-1] * vAssoc[2-1];
6925 for (Int_t i=2; i<=5; i++)
6926 vn[i-1] = vTrig[i-1] * vAssoc[i-1];
6930 void CompareNtrDist(const char* fileName1, const char* fileNameCentrality1)
6935 TCanvas *c1 = new TCanvas("c1", "", 1400, 1100);
6936 TCanvas *c2 = new TCanvas("c2", "", 1400, 1100);
6938 dndpt_central = ReadHepdata("/home/mkofarag/work/Project/2010/raa_dndpt_central.txt", kFALSE, 3);
6939 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
6940 AliUEHistograms* hc1 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality1);
6942 h1->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 5);
6943 ptDist1 = h1->GetUEHist(2)->GetEventHist()->Project(step, 0);
6944 ptDist1->Scale(1.0/1.8/TMath::TwoPi()/hc1->GetCentralityDistribution()->Integral(hc1->GetCentralityDistribution()->FindBin(0.01), hc1->GetCentralityDistribution()->FindBin(4.99)));
6945 for (Int_t i=1; i<=ptDist1->GetNbinsX(); i++)
6947 ptDist1->SetBinContent(i, ptDist1->GetBinContent(i)/ptDist1->GetBinWidth(i));
6949 for (Int_t i=0; i<dndpt_central->GetN();i++)
6951 Double_t x = dndpt_central->GetX()[i];
6952 Double_t y = dndpt_central->GetY()[i]*x;
6953 dndpt_central->SetPoint(i,x,y);
6955 ptDist2 = (TH1*) ptDist1->Clone("ptDist2");
6957 for (Int_t i=0; i<dndpt_central->GetN(); i++)
6961 width += (dndpt_central->GetX()[i] - dndpt_central->GetX()[i-1]) / 2;
6962 if (i < dndpt_central->GetN()-1)
6963 width += (dndpt_central->GetX()[i+1] - dndpt_central->GetX()[i]) / 2;
6964 if (i == 0 || i == dndpt_central->GetN() - 1)
6966 ptDist2->Fill(dndpt_central->GetX()[i],dndpt_central->GetY()[i]*width);
6968 for (Int_t i=1; i<=ptDist2->GetNbinsX(); i++)
6970 ptDist2->SetBinContent(i, ptDist2->GetBinContent(i)/ptDist2->GetBinWidth(i));
6971 ptDist2->SetBinError(i,0);
6973 /* for (Int_t i=1; i<=ptDist1->GetNbinsX(); i++)
6975 ptDist1->SetBinError(i,0);
6980 ptDist1->SetMarkerStyle(3);
6981 ptDist2->SetMarkerStyle(2);
6982 ptDist1->SetMarkerColor(2);
6983 ptDist2->SetMarkerColor(3);
6984 ptDist1->SetLineColor(2);
6985 ptDist2->SetLineColor(3);
6986 ptDist1->DrawCopy("EP");
6987 ptDist2->Draw("EPSAME");
6988 ptDist1->Divide(ptDist1,ptDist2);
6990 ptDist1->Draw("EP");
6994 void FitNtrDist(const char* fileName1, const char* fileNameCentrality1)
6999 TCanvas *c1 = new TCanvas("c1", "", 1400, 1100);
7000 TCanvas *c2 = new TCanvas("c2", "", 1400, 1100);
7001 TCanvas *c3 = new TCanvas("c3", "", 1400, 1100);
7003 dndpt_central = ReadHepdata("/home/mkofarag/work/Project/2010/raa_dndpt_central.txt", kFALSE, 3);
7004 TF1* func1 = new TF1("func1", "[0]*x/TMath::Sqrt(0.1396*0.1396+x*x)*TMath::Power(1+x/[1],-1*[2])",0.5,5);
7005 TF1* func2 = new TF1("func2", "[0]*TMath::Power(x,-1*[1])",5,20);
7007 func1->SetParLimits(0, 2000, 5000);
7008 func1->SetParLimits(1, 1, 6);
7009 func1->SetParLimits(2, 7, 20);
7010 dndpt_central->Fit(func1,"RB","",0.5,5);
7012 func2->SetParLimits(0, 0, 1000);
7013 func2->SetParLimits(1, 4, 8);
7014 dndpt_central->Fit(func2,"RB","",5,20);
7019 dndpt_central->Draw("AP");
7020 func1->Draw("SAME");
7021 func2->Draw("SAME");
7023 TF1* func3 = new TF1("func3", "[0]*x*x/TMath::Sqrt(0.1396*0.1396+x*x)*TMath::Power(1+x/[1],-1*[2])",0.5,5);
7024 TF1* func4 = new TF1("func4", "[0]*x*TMath::Power(x,-1*[1])",5,20);
7026 func3->FixParameter(0,func1->GetParameter(0));
7027 func3->FixParameter(1,func1->GetParameter(1));
7028 func3->FixParameter(2,func1->GetParameter(2));
7029 func4->FixParameter(0,func2->GetParameter(0));
7030 func4->FixParameter(1,func2->GetParameter(1));
7032 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
7033 AliUEHistograms* hc1 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality1);
7035 h1->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 5);
7036 ptDist1 = h1->GetUEHist(2)->GetEventHist()->Project(step, 0);
7037 ptDist1->Scale(1.0/1.8/TMath::TwoPi()/hc1->GetCentralityDistribution()->Integral(hc1->GetCentralityDistribution()->FindBin(0.01), hc1->GetCentralityDistribution()->FindBin(4.99)));
7038 ptDist2 = (TH1*) ptDist1->Clone("ptDist2");
7040 for (Int_t i=1; i<=ptDist1->GetNbinsX(); i++)
7042 ptDist1->SetBinContent(i, ptDist1->GetBinContent(i)/ptDist1->GetBinWidth(i));
7043 if (ptDist1->GetBinLowEdge(i)<5) ptDist2->SetBinContent(i, func3->Integral(ptDist1->GetBinLowEdge(i),ptDist1->GetBinLowEdge(i+1)));
7044 else ptDist2->SetBinContent(i, func4->Integral(ptDist1->GetBinLowEdge(i),ptDist1->GetBinLowEdge(i+1)));
7047 for (Int_t i=1; i<=ptDist2->GetNbinsX(); i++)
7049 ptDist2->SetBinContent(i, ptDist2->GetBinContent(i)/ptDist2->GetBinWidth(i));
7053 ptDist1->SetMarkerStyle(3);
7054 ptDist2->SetMarkerStyle(2);
7055 ptDist1->SetMarkerColor(2);
7056 ptDist2->SetMarkerColor(3);
7057 ptDist1->SetLineColor(2);
7058 ptDist2->SetLineColor(3);
7059 ptDist1->DrawCopy("EP");
7060 ptDist2->Draw("EPSAME");
7062 ptDist1->Divide(ptDist1,ptDist2);
7064 ptDist1->Draw("EP");
7067 void DrawNtrDist(const char* fileName1, const char* fileName2, const char* fileNameCentrality1, const char* fileNameCentrality2)
7073 new TCanvas("c", "", 1400, 1100);
7074 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
7075 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
7076 AliUEHistograms* hc1 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality1);
7077 AliUEHistograms* hc2 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality2);
7078 h1->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 10);
7079 h2->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 10);
7080 ptDist1 = h1->GetUEHist(2)->GetEventHist()->Project(step, 0);
7081 ptDist2 = h2->GetUEHist(2)->GetEventHist()->Project(step, 0);
7082 ptDist1->Scale(1/hc1->GetCentralityDistribution()->Integral(hc1->GetCentralityDistribution()->FindBin(0.01), hc1->GetCentralityDistribution()->FindBin(9.99)));
7083 ptDist2->Scale(1/hc2->GetCentralityDistribution()->Integral(hc2->GetCentralityDistribution()->FindBin(0.01), hc2->GetCentralityDistribution()->FindBin(9.99)));
7084 ptDist1->Divide(ptDist1,ptDist2);
7085 ptDist1->SetMarkerStyle(3);
7089 void GetSumOfRatios(void* hVoid, void* hMixedVoid, TH1** hist, Int_t step, Int_t centralityBegin, Int_t centralityEnd, Float_t ptBegin, Float_t ptEnd, Bool_t normalizePerTrigger = kTRUE, Bool_t useCentralityBinsDirectly = kFALSE)
7091 Printf("GetSumOfRatios | step %d | %d-%d%% | %.1f - %.1f GeV/c | %.1f - %.1f GeV/c", step, centralityBegin, centralityEnd, gpTMin, gpTMax, ptBegin, ptEnd);
7093 h = (AliUEHistograms*) hVoid;
7094 hMixed = (AliUEHistograms*) hMixedVoid;
7096 Int_t centralityBeginBin = 0;
7097 Int_t centralityEndBin = -1;
7099 if (!useCentralityBinsDirectly && centralityEnd >= centralityBegin)
7101 centralityBeginBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityBegin);
7102 centralityEndBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityEnd);
7104 else if (useCentralityBinsDirectly)
7106 centralityBeginBin = centralityBegin;
7107 centralityEndBin = centralityEnd;
7110 *hist = h->GetUEHist(2)->GetSumOfRatios2(hMixed->GetUEHist(2), step, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, normalizePerTrigger);
7113 str.Form("%.1f < %s < %.1f", ptBegin - 0.001,(gIsTrkletsTrklets)?"Dphi_{trig}":"p_{T,trig}", ptEnd + 0.01);
7116 str2.Form("%.1f < %s < %.1f", gpTMin - 0.001, (gIsTrkletsTrklets || gIsMuTrklets)?"Dphi_{ass}":"p_{T,ass}",gpTMax + 0.01);
7119 newTitle.Form("%s - %s - %d-%d", str.Data(), str2.Data(), centralityBegin, centralityEnd);
7120 if (!useCentralityBinsDirectly)
7123 (*hist)->SetTitle(newTitle);
7124 //Printf("\n\n\n\n %s\n\n\n",newTitle.Data());
7127 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)
7131 Bool_t veryCentral = 0;
7132 Bool_t flowComparison = 0;
7133 Bool_t rhicOverlay = 0;
7134 Bool_t highStatBinning = 0;
7136 file = TFile::Open("dphi_corr.root", "RECREATE");
7139 Int_t leadingPtOffset = 1;
7141 if (veryCentral || flowComparison)
7143 Int_t maxLeadingPt = 2;
7144 Int_t maxAssocPt = 2;
7145 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
7146 //Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 4.0, 6.0, 10.0, 20.0, 40.0 };
7147 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
7149 else if (rhicOverlay) // RHIC binning
7151 Int_t maxLeadingPt = 4;
7152 Int_t maxAssocPt = 5;
7153 Float_t leadingPtArr[] = { 4.0, 5.0, 7.0, 9.0, 12.0 };
7154 Float_t assocPtArr[] = { 0.5, 1.0, 2.0, 3.0, 5.0, 7.0 };
7156 else if (highStatBinning)
7158 Int_t maxLeadingPt = 3;
7159 Int_t maxAssocPt = 2;
7160 Float_t leadingPtArr[] = { 4.0, 6.0, 8.0, 15.0 };
7161 Float_t assocPtArr[] = { 1.0, 4.0, 10.0 };
7163 else // ALICE binning
7165 if (1) // binning from preliminaries
7167 Int_t maxLeadingPt = 2;
7168 Int_t maxAssocPt = 7;
7169 // Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 10.0, 15.0 };
7170 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
7171 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7172 leadingPtOffset = 2;
7176 Int_t maxLeadingPt = 1;
7177 Int_t maxAssocPt = 4;
7178 Float_t leadingPtArr[] = { 8.0, 10.0, 15.0, 15.0 };
7179 Float_t assocPtArr[] = { 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7180 leadingPtOffset = 2;
7184 Int_t maxLeadingPt = 3;
7185 Int_t maxAssocPt = 3;
7186 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 20.0 };
7187 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7188 leadingPtOffset = 2;
7192 Int_t nCentralityBins = 5;
7193 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
7194 //Int_t centralityBins[] = { 1, 3, 5, 7, 9, 13 };
7196 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
7198 // h->SetZVtxRange(-0.5, 0.5);
7199 // h->SetZVtxRange(1.5, 2.5);
7201 AliUEHistograms* hMixed = 0;
7202 AliUEHistograms* hMixed2 = 0; // GetUEHistogram(fileName2, 0, kTRUE);
7206 hMixed = (AliUEHistograms*) GetUEHistogram(fileName1, 0, kTRUE);
7207 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileName2, 0, kTRUE);
7213 Printf("WARNING: Reading mixed event from preliminaries/corrected_110317.root");
7214 hMixed = (AliUEHistograms*) GetUEHistogram("preliminaries/corrected_110317.root", 0, kTRUE);
7217 AliUEHistograms* h2 = 0;
7219 h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
7222 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
7223 canvas->Divide(maxAssocPt, maxLeadingPt);
7225 TCanvas* canvas2 = new TCanvas("Centrality", "Centrality", 800, 600);
7226 centralityHist = (TH1*) h->GetCentralityDistribution();
7227 NormalizeToBinWidth(centralityHist);
7228 centralityHist->Draw();
7231 TLegend* legend = new TLegend(0.2, 0.5, 0.95, 0.90);
7232 TLegend* legend2 = new TLegend(0.5, 0.63, 0.95, 0.90);
7233 legend2->SetFillColor(0);
7234 legend2->SetTextSize(0.04);
7236 for (Int_t i=0; i<maxLeadingPt; i++)
7237 for (Int_t j=0; j<maxAssocPt; j++)
7240 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+leadingPtOffset]);
7245 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->SetRangeUser(0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7246 centralityHist = h->GetUEHist(2)->GetEventHist()->ShowProjection(1, 6);
7247 centralityHist->SetLineColor(i+2);
7248 NormalizeToBinWidth(centralityHist);
7249 centralityHist->DrawCopy("SAME");
7250 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->SetRangeUser(0, 0, -1);
7251 legend2->AddEntry(centralityHist, str);
7254 canvas->cd(j+1 + i * maxAssocPt);
7255 gPad->SetLeftMargin(0.15);
7256 gPad->SetBottomMargin(0.2);
7257 gPad->SetTopMargin(0.01);
7258 gPad->SetRightMargin(0.01);
7260 if (i == 0 && j == 3)
7263 gpTMin = assocPtArr[j] + 0.01;
7264 gpTMax = assocPtArr[j+1] - 0.01;
7267 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
7273 SetupRanges(h2); // SetEtaRange(0, 0) does not need to be called for the leading track result
7278 SetupRanges(hMixed);
7284 if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
7291 // 40-80% --> 11, 14
7294 TString hist1Str, hist2Str, hist2bStr;
7297 for (Int_t k=0; k<3; k++)
7309 GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist1Str = "0-2%";
7310 // GetDistAndFlow(h, hMixed, &hist2, v2, step, 1, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2Str = "1-3%";
7311 GetDistAndFlow(h, hMixed, &hist2b, v2+2, step, 30, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2bStr = "30-40%";
7313 //TH1* hist1 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 2); hist1Str = "0-2%";
7314 //TH1* hist2 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 2, 3); hist2Str = "2-3%";
7315 //TH1* hist2b = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, 10); hist2bStr = "30-40%";
7317 else if (flowComparison)
7319 TH1* hist1 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 5); hist1Str = "0-5%";
7320 TH1* hist2 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 10); hist2Str = "20-40%";
7321 TH1* hist2b = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, 10); hist2bStr = "30-40%";
7322 TH1* hist3 = 0; // h2->GetUEHist(2)->GetUEHist(0, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7324 else if (rhicOverlay)
7326 TH1* hist1 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 8); hist1Str = "0-20%";
7327 TH1* hist2 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 12); hist2Str = "20-60%";
7328 TH1* hist2b = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15);hist2bStr = "60-90%";
7329 TH1* hist3 = h2->GetUEHist(2)->GetUEHist(0, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7338 Bool_t equivMixedBin = 1;
7340 // histType = 20; Printf("WARNING: Using histogram type 20");
7342 // GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, vn[0]); hist1Str = "0-2%";
7343 // GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, vn[0]); hist1Str = "0-5%";
7344 GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin); hist1Str = "0-5%";
7351 GetDistAndFlow(h, hMixed, &histTmp1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, equivMixedBin); hist1Str = "0-5%";
7352 histTmp1->SetLineColor(2);
7353 histTmp1->Draw("SAME");
7354 histTmp1->Scale(1 / 0.75);
7357 GetDistAndFlow(h, hMixed, &histTmp1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 20, equivMixedBin); hist1Str = "0-5%";
7358 histTmp1->SetLineColor(4);
7359 histTmp1->Draw("SAME");
7360 histTmp1->Scale(1 / 0.75);
7363 GetDistAndFlow(h, hMixed, &histTmp1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 11, equivMixedBin); hist1Str = "0-5%";
7364 histTmp1->SetLineColor(3);
7365 histTmp1->Draw("SAME");
7366 histTmp1->Scale(1 / 0.25);
7371 GetDistAndFlow(h, hMixed, &hist2, v2+1, step, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin); hist2Str = "0-20%";
7372 // GetDistAndFlow(h, hMixed, &hist2b, v2[2], step, 60, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 0, equivMixedBin); hist2bStr = "60-80%";
7373 GetDistAndFlow(h, hMixed, &hist2b, v2+2, step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin); hist2bStr = "60-90%";
7375 Printf("%f %f %f", v2[0], v2[1], v2[2]);
7376 // Printf("%f %f %f", vn[0][1], vn[0][2], vn[0][3]);
7378 // TH1* hist1 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 8); hist1Str = "0-20%";
7379 // TH1* hist2 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 12); hist2Str = "20-60%";
7380 // TH1* hist2b = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15); hist2bStr = "60-90%";
7383 // TH1* hist3Old = h2->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7385 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin);
7386 // hist3->Rebin(2); hist3->Scale(0.5);
7390 hist3Old->DrawCopy("SAME")->SetLineColor(2); */
7394 RemoveBaseLine(hist1);
7395 RemoveBaseLine(hist2);
7396 RemoveBaseLine(hist2b);
7397 RemoveBaseLine(hist3);
7401 newTitle.Form("%s - %s", str.Data(), str2.Data());
7404 hist1->SetName(Form("dphi_%d_%d_%d", i, j, 0));
7405 hist1->SetTitle(newTitle + " - " + hist1Str);
7409 hist2->SetName(Form("dphi_%d_%d_%d", i, j, 1));
7410 hist2->SetTitle(newTitle + " - " + hist2Str);
7414 hist2b->SetName(Form("dphi_%d_%d_%d", i, j, 2));
7415 hist2b->SetTitle(newTitle + " - " + hist2bStr);
7419 hist3->SetName(Form("dphi_%d_%d_%d", i, j, 3));
7420 hist3->SetTitle(newTitle + " - pp");
7425 hist1->Scale(1.0 / hist1->Integral());
7426 hist2->Scale(1.0 / hist2->Integral());
7427 hist3->Scale(1.0 / hist3->Integral());
7430 if (i == 0 && j == 0)
7432 legend->SetFillColor(0);
7433 legend->AddEntry(hist1, "Pb+Pb 0-5%");
7435 legend->AddEntry(hist2, "Pb+Pb 20-40%");
7437 legend->AddEntry(hist2b, "Pb+Pb 60-90%");
7439 legend->AddEntry(hist3, "p+p 7 TeV");
7440 legend->SetTextSize(0.08);
7443 Prepare1DPlot(hist1);
7444 Prepare1DPlot(hist2);
7445 Prepare1DPlot(hist2b);
7446 Prepare1DPlot(hist3);
7448 Double_t yMin = 0.01;
7449 Double_t yMax2 = yMax;
7453 yMin = -0.01; //TMath::Min(hist1->GetMinimum(), hist2->GetMinimum()) * 0.97;
7454 yMax2 = TMath::Max((hist3) ? hist3->GetMaximum() : 0.0, TMath::Max(hist1->GetMaximum(), (hist2) ? hist2->GetMaximum() : 0.0)) * 1.03;
7459 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);
7460 dummy->SetStats(kFALSE);
7461 dummy->SetXTitle(hist1->GetXaxis()->GetTitle());
7462 dummy->SetYTitle(hist1->GetYaxis()->GetTitle());
7463 dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
7464 Prepare1DPlot(dummy);
7466 dummy->GetYaxis()->SetTitleOffset(0.8);
7468 dummy->GetXaxis()->SetLabelSize(0.08);
7469 dummy->GetYaxis()->SetLabelSize(0.08);
7470 dummy->GetXaxis()->SetTitleSize(0.08);
7471 dummy->GetYaxis()->SetTitleSize(0.08);
7473 dummy->GetYaxis()->SetTitleOffset(0.8);
7476 dummyTmp = dummy->DrawCopy();
7478 hist1->DrawCopy("SAME");
7482 SetupRanges(hMixed);
7483 // for HI file do not set range in eta anymore after it was changed to delta eta axis
7484 hMixed->SetEtaRange(0, 0);
7486 TH1* hist1Mixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 5);
7487 //DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], hist1Mixed, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2, kFALSE, 0, vn[0]);
7488 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], hist1Mixed, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2, kFALSE, 0);
7490 //hist1Mixed->Draw("SAME");
7493 hist2->SetLineColor(2);
7494 hist2->DrawCopy("SAME");
7496 TH1* hist2Mixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 10);
7497 //hist2Mixed->SetLineColor(2);
7498 //hist2Mixed->Draw("SAME");
7500 DrawFlow(v2[1], hist2, leadingPtArr[i], assocPtArr[j], hist2Mixed, i, 1, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
7501 //DrawFlow(GetFlow05(), hist2, leadingPtArr[i], assocPtArr[j], hist2Mixed);
7505 hist2b->SetLineColor(3);
7506 hist2b->DrawCopy("SAME");
7508 TH1* hist2bMixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15);
7509 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], hist2bMixed, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
7510 //DrawFlow(GetFlow05(), hist2b, leadingPtArr[i], assocPtArr[j], hist2bMixed);
7514 hist3->SetLineColor(4);
7515 hist3->DrawCopy("SAME");
7517 DrawFlow(0, hist3, leadingPtArr[i], assocPtArr[j], 0, i, 3, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
7519 //dummyTmp->GetYaxis()->SetRangeUser(0, 1.1 * TMath::Max(TMath::Max(hist1->GetMaximum(), hist2->GetMaximum()), hist2b->GetMaximum()));
7521 else // delta eta delta phi
7525 if (assocPtArr[j] > leadingPtArr[i])
7532 if (assocPtArr[jRef] > leadingPtArr[i])
7536 gpTMin = assocPtArr[jRef] + 0.01;
7537 gpTMax = assocPtArr[jRef+1] - 0.01;
7539 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
7541 // use j for centrality
7542 if (j >= nCentralityBins)
7545 centrBegin = centralityBins[j];
7546 centrEnd = centralityBins[j+1] - 1;
7550 // for HI file do not set range in eta anymore after it was changed to delta eta axis
7551 h->SetEtaRange(0, 0);
7553 SetupRanges(hMixed);
7554 // for HI file do not set range in eta anymore after it was changed to delta eta axis
7555 hMixed->SetEtaRange(0, 0);
7557 TH2* histSame = (TH2*) h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centrBegin, centrEnd, kTRUE);
7558 TH2* histMixed = (TH2*) hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centrBegin, centrEnd, kTRUE);
7561 histSame->Rebin2D(2, 2);
7562 histMixed->Rebin2D(2, 2);
7566 // fit delta eta, assuming no dependence on dphi
7568 //new TCanvas; histMixed->DrawCopy("SURF1");
7570 histMixedproj = histMixed->ProjectionY();
7571 histMixedproj->Scale(1.0 / histMixed->GetNbinsX());
7573 for (Int_t x=1; x<=histMixed->GetNbinsX(); x++)
7574 for (Int_t y=1; y<=histMixed->GetNbinsY(); y++)
7575 histMixed->SetBinContent(x, y, histMixedproj->GetBinContent(y));
7577 //new TCanvas; histMixed->DrawCopy("SURF1");
7580 histSame->SetStats(0);
7581 histSame->GetYaxis()->SetRangeUser(-1.5, 1.5);
7582 histSame->SetTitle("");
7583 histSame->Divide(histMixed);
7584 histSame->DrawCopy("SURF1");
7587 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
7588 latex = new TLatex(0.15, 0.95, str3);
7590 latex->SetTextSize(0.08);
7594 latex = new TLatex(0.55, 0.8, str);
7596 latex->SetTextSize(0.06);
7599 latex = new TLatex(0.55, 0.88, str2);
7601 latex->SetTextSize(0.06);
7604 // if (i == 0) return;
7607 canvas->SaveAs(Form("DeltaPhi_%.2f.png", yMax));
7613 //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]);
7616 void ExamplePhiEtaGap(const char* fileNamePbPb, const char* fileNamePbPbMix)
7620 if (!fileNamePbPbMix)
7621 fileNamePbPbMix = fileNamePbPb;
7623 Int_t leadingPtOffset = 1;
7625 Int_t maxLeadingPt = 4;
7626 Int_t maxAssocPt = 5;
7627 Float_t leadingPtArr[] = { 2.0, 3.0, 6.0, 6.0, 8.0, 10.0, 15.0, 20.0 };
7628 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7629 leadingPtOffset = 1;
7631 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb);
7632 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
7637 gpTMin = assocPtArr[j] + 0.01;
7638 gpTMax = assocPtArr[j+1] - 0.01;
7641 SetupRanges(hMixed);
7643 if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
7646 TString hist1Str, hist2Str, hist2bStr;
7655 Bool_t equivMixedBin = kTRUE;
7657 Int_t centralityBegin = 20;
7658 Int_t centralityEnd = 30;
7660 GetDistAndFlow(h, hMixed, &hist1, 0, step, centralityBegin, centralityEnd, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 20, equivMixedBin);
7662 GetDistAndFlow(h, hMixed, &hist2, 0, step, centralityBegin, centralityEnd, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, equivMixedBin);
7663 // hist2->Scale(1.0 / 0.8);
7665 GetDistAndFlow(h, hMixed, &hist3, 0, step, centralityBegin, centralityEnd, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 11, equivMixedBin);
7666 hist3->Scale(1.0 / 0.8);
7669 hist2->SetLineColor(2);
7670 hist2->Draw("SAME");
7671 hist3->SetLineColor(4);
7672 hist3->Draw("SAME");
7675 void ExampleDEtaDPhi(const char* fileNamePbPb, const char* fileNamePbPbMix)
7679 if (!fileNamePbPbMix)
7680 fileNamePbPbMix = fileNamePbPb;
7682 Int_t leadingPtOffset = 1;
7684 Int_t maxLeadingPt = 4;
7685 Int_t maxAssocPt = 5;
7686 Float_t leadingPtArr[] = { 1.0, 2.0, 3.0, 6.0, 6.0, 8.0, 10.0, 15.0, 20.0 };
7687 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7688 leadingPtOffset = 1;
7690 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb);
7691 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
7696 gpTMin = assocPtArr[j] + 0.01;
7697 gpTMax = assocPtArr[j+1] - 0.01;
7700 SetupRanges(hMixed);
7705 GetSumOfRatios(h, hMixed, &hist1, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
7707 hist1->Draw("SURF1");
7710 Double_t GetEtaCut(TTree* analysisSettings)
7712 Double_t etaCut = 0;
7713 if (analysisSettings)
7715 analysisSettings->GetBranch("fTrackEtaCut")->SetAddress(&etaCut);
7716 analysisSettings->GetEntry(0);
7721 void PlotDeltaPhiEtaGap(const char* fileNamePbPb, const char* fileNamePbPbMix = 0, const char* fileNamepp = 0, const char* fileNamepp2 = 0, const char* outputFile = "dphi_corr.root")
7725 if (!fileNamePbPbMix)
7726 fileNamePbPbMix = fileNamePbPb;
7728 file = TFile::Open(outputFile, "RECREATE");
7731 Int_t leadingPtOffset = 1;
7733 Bool_t symmetrizePt = kFALSE;
7734 Int_t maxLeadingPt = 4;
7735 Int_t maxAssocPt = 6;
7738 //PbPb, NS peak shapes
7739 Float_t leadingPtArr[] = { 1.0, 2.0, 3.0, 4.0, 8.0, 15.0, 20.0 };
7740 // Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 8.0, 15.0, 20.0 };
7741 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 10.0, 12.0 };
7745 //Example for the Hadrons_Example wagon
7748 Float_t leadingPtArr[] = { 3.0, 5.0, 8.0, 16.0 };
7749 Float_t assocPtArr[] = {0.15, 0.3, 50.0, 0.5, 50.0, 1.0, 50.0 };
7751 else if (gIsMuTrklets)
7756 Float_t leadingPtArr[] = {., 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0};
7757 Float_t assocPtArr[] = {0.0,0.0,0.0, 1.0, 2.0,5.0,10. };
7760 else if (gIsTrkletsTrklets)
7765 Float_t leadingPtArr[] = {0.0, 1.0,2.0,5.0,10.0};
7766 Float_t assocPtArr[] = {0.0,0.0,0.0, 1.0, 2.0,5.0,10.0};
7767 gIsTrkletsTrklets=kTRUE;
7771 //pA, trigger from all pT
7774 Float_t leadingPtArr[] = { 0.3, 4.0 };
7775 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 0.5, 4.0 };
7776 // symmetrizePt = kTRUE;
7780 //pA, associated from all pT
7783 Float_t leadingPtArr[] = { 0.5, 1.0, 2.0, 3.0, 4.0, 0.5, 4.0 };
7784 Float_t assocPtArr[] = { 0.15, 0.5, 4.0 };
7785 // symmetrizePt = kTRUE;
7792 Float_t leadingPtArr[] = { 0.5, 1.0, 1.5, 2.0, 2.5, 4.0, 8.0, 15.0, 20.0 };
7793 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 1.5, 2.0, 2.5, 4.0, 8.0, 10.0, 12.0 };
7800 Float_t leadingPtArr[] = { 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 20. };
7801 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 20. };
7808 Float_t leadingPtArr[] = { 0.5, 1.0, 2.0, 4.0 };
7809 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 4.0 };
7813 //pPb and PbPb with PID, with low pt points TPC only
7816 Float_t leadingPtArr[] = { 0.2, 0.3, 0.5 , 0.75, 1.0, 1.25, 1.5, 2.0, 2.5, 3., 4.0};
7817 Float_t assocPtArr[] = { 0.15, 0.2, 0.3, 0.5 , 0.75, 1.0, 1.25, 1.5, 2.0, 2.5, 3., 4.0 };
7821 //PbPb for comaprison with You
7824 Float_t leadingPtArr[] = { 0.2, 0.3, 0.5 , 1.0, 1.5, 2.0, 2.5, 3., 4.0};
7825 Float_t assocPtArr[] = { 0.15, 0.2, 0.3, 0.5 , 1.0, 1.5, 2.0, 2.5, 3., 4.0 };
7832 Float_t leadingPtArr[] = { 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 0.5, 4.0, 20.0 };
7833 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 0.5, 4.0, 12.0 };
7840 Float_t leadingPtArr[] = { 0.5, 1.5, 2.5, 4.0, 5.0, 8.0, 15.0, 20.0 };
7841 Float_t assocPtArr[] = { 0.15, 0.5, 1.5, 2.5, 4.0, 5.0, 8.0, 10.0, 12.0 };
7845 //pA 2012; MC validation (also PbPb)
7848 Float_t leadingPtArr[] = { 0.5, 1.0, 2.0, 4.0, 8.0, 15.0, 20.0 };
7849 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 4.0, 8.0, 10.0, 12.0 };
7853 // pA, CMS ridge comparison
7856 Float_t leadingPtArr[] = { 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 15.0, 20.0 };
7857 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7863 Float_t leadingPtArr[] = { 2.0, 3.0};
7864 Float_t assocPtArr[] = {0.15, 0.5, 1.0, 2.0};
7866 else if (0) //Comparison to STAR (p_T,t)
7870 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 5.0, 6.0};
7871 Float_t assocPtArr[] = {0.15, 0.5, 1.5, 6.0};
7873 else if (0) //Comparison to STAR (p_T,a)
7877 Float_t leadingPtArr[] = { 3.0, 6.0};
7878 Float_t assocPtArr[] = {0.15, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0};
7884 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 8.0, 15.0 };
7885 Float_t assocPtArr[] = {0.15, 0.5, 1.0, 1.5, 2.0};
7889 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb, &list);
7890 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
7891 // hMixed3 = (AliUEHistograms*) hMixed->Clone();
7895 h->GetUEHist(2)->SymmetrizepTBins();
7896 hMixed->GetUEHist(2)->SymmetrizepTBins();
7899 h->GetUEHist(2)->SetSkipScaleMixedEvent(1);
7900 hMixed->GetUEHist(2)->SetSkipScaleMixedEvent(1);
7904 AliUEHistograms* h2 = 0;
7905 AliUEHistograms* hMixed2 = 0;
7908 h2 = (AliUEHistograms*) GetUEHistogram(fileNamepp, &list2);
7909 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileNamepp, 0, kTRUE);
7913 AliUEHistograms* h3 = 0;
7914 AliUEHistograms* hMixed3 = 0;
7917 h3 = (AliUEHistograms*) GetUEHistogram(fileNamepp2, &list3);
7918 hMixed3 = (AliUEHistograms*) GetUEHistogram(fileNamepp2, 0, kTRUE);
7921 // h->GetUEHist(2)->SetGetMultCache();
7922 // hMixed->GetUEHist(2)->SetGetMultCache();
7924 TH2* refMultRaw = (TH2*) list->FindObject("referenceMultiplicity");
7927 // new TCanvas; refMultRaw->Draw("COLZ");
7928 //Int_t nCentrBins = 4;
7929 Int_t nCentrBins = 5;
7930 Double_t centrBins[] = { 0., 20., 40., 60., 80., 100. };
7931 Double_t centrBins[] = { 0., 20., 40., 60., 100. };
7933 // Double_t centrBins[] = { 0., 3., 10., 50., 100. };
7934 TH1* refMult = new TH1F("refMult", ";centrality;<Nch>", nCentrBins, centrBins);
7935 for (Int_t i=0; i<nCentrBins; i++)
7937 TH1* proj = refMultRaw->ProjectionY(Form("proj%d", i), refMultRaw->GetXaxis()->FindBin(centrBins[i] + 0.1), refMultRaw->GetXaxis()->FindBin(centrBins[i+1] - 0.1));
7938 // new TCanvas; proj->DrawClone();
7939 refMult->SetBinContent(refMult->GetXaxis()->FindBin(centrBins[i] + 0.1), proj->GetMean());
7940 refMult->SetBinError(refMult->GetXaxis()->FindBin(centrBins[i] + 0.1), proj->GetMeanError());
7941 Printf("Ref multiplicity for centrality %f to %f: %f", centrBins[i], centrBins[i+1], proj->GetMean());
7943 // new TCanvas; refMult->Draw();
7944 file = TFile::Open(outputFile, "UPDATE");
7950 tree = (TTree*) list->FindObject("UEAnalysisSettings");
7951 Double_t etaCut = GetEtaCut(tree);
7952 Printf("Setting eta cut to %f", etaCut);
7953 h->SetTrackEtaCut(etaCut);
7957 tree = (TTree*) list2->FindObject("UEAnalysisSettings");
7960 Double_t etaCut = GetEtaCut(tree);
7961 Printf("Setting eta cut to %f", etaCut);
7962 h2->SetTrackEtaCut(etaCut);
7966 Double_t etaCut = 0.9;
7967 Printf("WARNING: Setting eta cut to %f without checking", etaCut);
7968 h2->SetTrackEtaCut(etaCut);
7974 tree = (TTree*) list3->FindObject("UEAnalysisSettings");
7977 Double_t etaCut = GetEtaCut(tree);
7978 Printf("Setting eta cut to %f", etaCut);
7979 h3->SetTrackEtaCut(etaCut);
7983 Double_t etaCut = 0.9;
7984 Printf("WARNING: Setting eta cut to %f without checking", etaCut);
7985 h3->SetTrackEtaCut(etaCut);
7989 for (Int_t i=0; i<maxLeadingPt; i++)
7991 for (Int_t j=1; j<maxAssocPt; j++)
7994 if(j!=(i+1))continue;
7995 Printf("\nOnly symmetric pt bins selected, leading pt: %f - %f associated pt: %f - %f",leadingPtArr[i],leadingPtArr[i+leadingPtOffset],assocPtArr[j],assocPtArr[j+1]);
7998 gpTMin = assocPtArr[j] + 0.01;
7999 gpTMax = assocPtArr[j+1] - 0.01;
8001 if(gIsTrkletsTrklets || gIsMuTrklets)=gpTMin=0.01;
8003 if(gpTMin >= gpTMax)continue;
8006 SetupRanges(hMixed);
8008 SetupRanges(hMixed2);
8010 SetupRanges(hMixed3);
8011 // SetupRanges(hMixed3);
8013 if(0) if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
8028 Bool_t equivMixedBin = 1; //kFALSE; // TODO ?
8029 Bool_t scaleToPairs = kTRUE;
8037 Bool_t normalizePerTrigger = kFALSE; // don't do if histograms are to be merged -> Use MergeDPhiFiles below
8039 GetSumOfRatios(h, hMixed, &hist1, step, 0, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
8040 GetSumOfRatios(h, hMixed, &hist5, step, 10, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
8041 GetSumOfRatios(h, hMixed, &hist4, step, 20, 30, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
8042 GetSumOfRatios(h, hMixed, &hist6, step, 30, 50, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
8043 GetSumOfRatios(h, hMixed, &hist2, step, 50, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
8046 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8050 // pp vs Mult for Ilya
8054 GetSumOfRatios(h, hMixed, &hist0, step, 0, 1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8055 GetSumOfRatios(h, hMixed, &hist1, step, 0, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8056 GetSumOfRatios(h, hMixed, &hist2, step, 10, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8057 GetSumOfRatios(h, hMixed, &hist3, step, 20, 30, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8058 GetSumOfRatios(h, hMixed, &hist4, step, 30, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8059 GetSumOfRatios(h, hMixed, &hist5, step, 40, 50, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8060 GetSumOfRatios(h, hMixed, &hist6, step, 50, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8061 GetSumOfRatios(h, hMixed, &hist7, step, 60, 70, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8062 GetSumOfRatios(h, hMixed, &hist8, step, 70, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8063 GetSumOfRatios(h, hMixed, &hist9, step, 80, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8064 GetSumOfRatios(h, hMixed, &hist10,step, 90,100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8072 GetSumOfRatios(h, hMixed, &hist1, step, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8073 GetSumOfRatios(h, hMixed, &hist2, step, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8074 GetSumOfRatios(h, hMixed, &hist4, step, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8075 GetSumOfRatios(h, hMixed, &hist5, step, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8076 // GetSumOfRatios(h, hMixed, &hist7, step, 70, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8077 // GetSumOfRatios(h, hMixed, &hist8, step, 80, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8080 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8083 GetSumOfRatios(h3, hMixed3, &hist6, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8090 GetSumOfRatios(h, hMixed, &hist1, step, 0, 20, (gIsTrkletsTrklets)?0.01:leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8091 GetSumOfRatios(h, hMixed, &hist2, step, 20, 40, (gIsTrkletsTrklets)?0.01:leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8092 GetSumOfRatios(h, hMixed, &hist4, step, 40, 60, (gIsTrkletsTrklets)?0.01:leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8093 GetSumOfRatios(h, hMixed, &hist5, step, 60, 100, (gIsTrkletsTrklets)?0.01:leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8094 // GetSumOfRatios(h, hMixed, &hist2, step, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8095 // GetSumOfRatios(h, hMixed, &hist4, step, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8096 // GetSumOfRatios(h, hMixed, &hist5, step, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8100 // pA, V0 as trigger particle detector
8103 h->GetUEHist(2)->SetSkipScaleMixedEvent(kTRUE);
8104 GetSumOfRatios(h, hMixed, &hist1, step, 0, 20, 1.01, 1.99, kTRUE);
8105 GetSumOfRatios(h, hMixed, &hist2, step, 20, 40, 1.01, 1.99, kTRUE);
8106 GetSumOfRatios(h, hMixed, &hist4, step, 40, 60, 1.01, 1.99, kTRUE);
8107 GetSumOfRatios(h, hMixed, &hist5, step, 60, 100, 1.01, 1.99, kTRUE);
8110 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8113 GetSumOfRatios(h3, hMixed3, &hist6, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8119 GetSumOfRatios(h, hMixed, &hist1, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8126 GetSumOfRatios(h, hMixed, &hist1, step, 4, 4, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8127 GetSumOfRatios(h, hMixed, &hist2, step, 3, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8128 GetSumOfRatios(h, hMixed, &hist4, step, 2, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8129 GetSumOfRatios(h, hMixed, &hist5, step, 1, 1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8133 // pA, course binning
8136 GetSumOfRatios(h, hMixed, &hist1, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8137 GetSumOfRatios(h, hMixed, &hist2, step, 0, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8138 GetSumOfRatios(h, hMixed, &hist4, step, 40, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8140 GetDistAndFlow(h, hMixed, &hist5, 0, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8142 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8146 // pA, CMS ridge paper comparison
8149 GetSumOfRatios(h, hMixed, &hist1, step, 0, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8150 GetSumOfRatios(h, hMixed, &hist2, step, 3, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8151 GetSumOfRatios(h, hMixed, &hist4, step, 10, 50, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8152 GetSumOfRatios(h, hMixed, &hist5, step, 50, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8153 GetSumOfRatios(h, hMixed, &hist7, step, 80, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8157 // pA, MC, validation binning
8158 GetSumOfRatios(h, hMixed, &hist1, 0, 0, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8159 GetSumOfRatios(h, hMixed, &hist5, 10, 0, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8163 // pA, MC, validation binning
8164 GetSumOfRatios(h, hMixed, &hist1, 0, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8165 GetSumOfRatios(h, hMixed, &hist2, 0, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8166 GetSumOfRatios(h, hMixed, &hist3, 0, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8167 GetSumOfRatios(h, hMixed, &hist4, 0, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8168 GetSumOfRatios(h, hMixed, &hist5, 10, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8169 GetSumOfRatios(h, hMixed, &hist6, 10, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8170 GetSumOfRatios(h, hMixed, &hist7, 10, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8171 GetSumOfRatios(h, hMixed, &hist8, 10, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8178 GetSumOfRatios(h, hMixed, &hist1, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8182 // pA, MC, validation binning, without vertex axis
8183 GetDistAndFlow(h, hMixed, &hist1, 0, 0, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8184 GetDistAndFlow(h, hMixed, &hist2, 0, 0, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8185 GetDistAndFlow(h, hMixed, &hist3, 0, 0, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8186 GetDistAndFlow(h, hMixed, &hist4, 0, 0, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8187 GetDistAndFlow(h, hMixed, &hist5, 0, 10, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8188 GetDistAndFlow(h, hMixed, &hist6, 0, 10, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8189 GetDistAndFlow(h, hMixed, &hist7, 0, 10, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8190 GetDistAndFlow(h, hMixed, &hist8, 0, 10, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8194 // PbPb, MC, impact parameter binning
8197 Printf(">>>>>>>> Not using GetSumOfRatios!!!");
8199 GetDistAndFlow(h, hMixed, &hist1, 0, step, 1, 6, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8200 GetDistAndFlow(h, hMixed, &hist5, 0, step, 7, 7, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8201 GetDistAndFlow(h, hMixed, &hist4, 0, step, 8, 8, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8202 GetDistAndFlow(h, hMixed, &hist6, 0, step, 9, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8203 GetDistAndFlow(h, hMixed, &hist2, 0, step, 11, 13, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8206 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8213 Printf(">>>>>>>> Not using GetSumOfRatios!!!");
8214 GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8215 // Printf("integral: %f", ((TH2*) hist1)->Integral(1, 36, 5, 36));
8218 GetDistAndFlow(h, hMixed, &hist5, 0, step, 10, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8219 GetDistAndFlow(h, hMixed, &hist4, 0, step, 20, 30, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8220 GetDistAndFlow(h, hMixed, &hist6, 0, step, 30, 50, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8221 GetDistAndFlow(h, hMixed, &hist2, 0, step, 50, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8224 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8225 // new TCanvas; hist3->DrawClone("SURF1");
8226 // GetDistAndFlow(hMixed2, 0, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8227 // new TCanvas; hist3->DrawClone("SURF1");
8228 // Printf("integral: %f", ((TH2*) hist3)->Integral(1, 36, 5, 36));
8231 //MC closure test in pA and PbPb with PID
8232 // GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8233 // GetDistAndFlow(h, hMixed, &hist2, 0, step, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8234 // GetDistAndFlow(h, hMixed, &hist4, 0, step, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8235 // GetDistAndFlow(h, hMixed, &hist5, 0, step, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8236 // GetDistAndFlow(h, hMixed, &hist7, 0, step, 80, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8237 // GetDistAndFlow(h, hMixed, &hist8, 0, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8243 GetSumOfRatios(h, hMixed, &hist1, step, 60, 70, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8244 GetSumOfRatios(h, hMixed, &hist2, step, 70, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8245 GetSumOfRatios(h, hMixed, &hist3, step, 80, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8251 GetSumOfRatios(h, hMixed, &hist1, step, 0, 1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8252 GetSumOfRatios(h, hMixed, &hist2, step, 1, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8253 GetSumOfRatios(h, hMixed, &hist4, step, 3, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8254 GetSumOfRatios(h, hMixed, &hist5, step, 5, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8255 GetSumOfRatios(h, hMixed, &hist6, step, 10, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8258 file = TFile::Open(outputFile, "UPDATE");
8262 hist0->SetName(Form("dphi_%d_%d_%d", i, j, 0));
8267 hist1->SetName(Form("dphi_%d_%d_%d", i, j, 1));
8272 hist2->SetName(Form("dphi_%d_%d_%d", i, j, 2));
8277 hist3->SetName(Form("dphi_%d_%d_%d", i, j, 3));
8282 hist4->SetName(Form("dphi_%d_%d_%d", i, j, 4));
8287 hist5->SetName(Form("dphi_%d_%d_%d", i, j, 5));
8292 hist6->SetName(Form("dphi_%d_%d_%d", i, j, 6));
8297 hist7->SetName(Form("dphi_%d_%d_%d", i, j, 7));
8302 hist8->SetName(Form("dphi_%d_%d_%d", i, j, 8));
8307 hist9->SetName(Form("dphi_%d_%d_%d", i, j, 9));
8312 hist10->SetName(Form("dphi_%d_%d_%d", i, j, 10));
8318 // hist1->SetName(Form("dphi_%d_%d_%d", i, j, 0));
8324 // hist2->SetName(Form("dphi_%d_%d_%d", i, j, 1));
8330 // hist4->SetName(Form("dphi_%d_%d_%d", i, j, 3));
8336 // hist5->SetName(Form("dphi_%d_%d_%d", i, j, 4));
8342 // hist7->SetName(Form("dphi_%d_%d_%d", i, j, 6));
8348 // hist8->SetName(Form("dphi_%d_%d_%d", i, j, 7));
8354 // hist6->SetName(Form("dphi_%d_%d_%d", i, j, 5));
8355 // TString title(hist6->GetTitle());
8356 // title.ReplaceAll("0--1%", "pp");
8357 // hist6->SetTitle(title);
8363 // hist3->SetName(Form("dphi_%d_%d_%d", i, j, 2));
8364 // TString title(hist3->GetTitle());
8365 // title.ReplaceAll("0--1%", "pp");
8366 // hist3->SetTitle(title);
8387 TH1* triggers = h->GetUEHist(2)->GetTriggersAsFunctionOfMultiplicity(step, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
8388 triggers->SetName(Form("triggers_%d", i));
8390 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+leadingPtOffset]);
8391 triggers->SetTitle(str);
8393 file = TFile::Open(outputFile, "UPDATE");
8402 Int_t gMCBinning = -1;
8403 void ExtractNSPeakShapesMC(const char* fileNamePbPb, const char* fileNamepp = 0, const char* outputFile = "dphi_corr.root")
8407 file = TFile::Open(outputFile, "RECREATE");
8410 Int_t leadingPtOffset = 1;
8412 Int_t maxLeadingPt = 4;
8413 Int_t maxAssocPt = 6;
8415 //PbPb, NS peak shapes
8416 Float_t leadingPtArr[] = { 1.0, 2.0, 3.0, 4.0, 8.0, 15.0, 20.0 };
8417 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 10.0, 12.0 };
8420 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb, &list);
8421 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPb, 0, kTRUE);
8424 AliUEHistograms* h2 = 0;
8425 AliUEHistograms* hMixed2 = 0;
8428 h2 = (AliUEHistograms*) GetUEHistogram(fileNamepp, &list2);
8429 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileNamepp, 0, kTRUE);
8432 for (Int_t i=0; i<maxLeadingPt; i++)
8434 for (Int_t j=2; j<maxAssocPt; j++)
8436 gpTMin = assocPtArr[j] + 0.01;
8437 gpTMax = assocPtArr[j+1] - 0.01;
8439 if(gpTMin >= gpTMax)continue;
8442 SetupRanges(hMixed);
8444 SetupRanges(hMixed2);
8446 if(1) if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
8456 Bool_t equivMixedBin = 1;
8457 Bool_t scaleToPairs = kTRUE;
8460 if (gMCBinning == 1) // HIJING
8462 // PbPb, MC, impact parameter binning
8465 GetDistAndFlow(h, hMixed, &hist1, 0, step, 1, 6, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8466 GetDistAndFlow(h, hMixed, &hist5, 0, step, 7, 7, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8467 GetDistAndFlow(h, hMixed, &hist4, 0, step, 8, 8, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8468 GetDistAndFlow(h, hMixed, &hist6, 0, step, 9, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8469 GetDistAndFlow(h, hMixed, &hist2, 0, step, 11, 13, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8472 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8474 else if (gMCBinning == 2) // AMPT
8476 // PbPb, MC, impact parameter binning
8479 GetDistAndFlow(h, hMixed, &hist1, 0, step, 1, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8480 GetDistAndFlow(h, hMixed, &hist5, 0, step, 3, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8481 GetDistAndFlow(h, hMixed, &hist4, 0, step, 4, 4, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8482 GetDistAndFlow(h, hMixed, &hist6, 0, step, 5, 6, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8483 GetDistAndFlow(h, hMixed, &hist2, 0, step, 7, 9, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8486 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8489 file = TFile::Open(outputFile, "UPDATE");
8493 hist1->SetName(Form("dphi_%d_%d_%d", i, j, 0));
8499 hist2->SetName(Form("dphi_%d_%d_%d", i, j, 1));
8505 hist4->SetName(Form("dphi_%d_%d_%d", i, j, 3));
8511 hist5->SetName(Form("dphi_%d_%d_%d", i, j, 4));
8517 hist6->SetName(Form("dphi_%d_%d_%d", i, j, 5));
8523 hist3->SetName(Form("dphi_%d_%d_%d", i, j, 2));
8524 TString title(hist3->GetTitle());
8525 title.ReplaceAll("0--1%", "pp");
8526 hist3->SetTitle(title);
8545 void MergeDPhiFiles(const char* fileName, const char* fileName2, const char* target)
8547 // merges the dphi histograms (except the pp histogram at index "2") as well as the triggers
8548 // then divides the dphi histograms by the respective number of triggers
8550 file = TFile::Open(fileName);
8551 file2 = TFile::Open(fileName2);
8553 fileTarget = TFile::Open(target, "RECREATE");
8554 fileTarget->Close();
8556 Int_t maxLeadingPt = 10;
8557 Int_t maxAssocPt = 11;
8560 for (Int_t i=0; i<maxLeadingPt; i++)
8562 TH1* triggers = (TH1*) file->Get(Form("triggers_%d", i));
8566 TH1* triggers2 = (TH1*) ((file2) ? file2->Get(Form("triggers_%d", i)) : 0);
8568 Printf("WARNING: trigger %d missing", i);
8570 for (Int_t j=0; j<maxAssocPt; j++)
8572 for (Int_t histId = 0; histId < nHists; histId++)
8574 TH2* hist = (TH2*) file->Get(Form("dphi_%d_%d_%d", i, j, histId));
8577 TH2* hist2 = (TH2*) ((file2) ? file2->Get(Form("dphi_%d_%d_%d", i, j, histId)) : 0);
8579 Printf("WARNING: %d %d %d exists only in file2, not copied!");
8583 if (histId != 2) // don't merge pp
8585 TString title(hist->GetTitle());
8586 title.ReplaceAll("%", "");
8587 tokens = title.Tokenize("-");
8589 Float_t centralityBegin = ((TObjString*) tokens->At(2))->String().Atoi();
8590 Float_t centralityEnd = ((TObjString*) tokens->At(3))->String().Atoi();
8592 Double_t nTriggers = triggers->Integral(triggers->FindBin(centralityBegin + 0.001), triggers->FindBin(centralityEnd - 0.001));
8593 Double_t nTriggers2 = 0;
8595 TH2* hist2 = (TH2*) ((file2) ? file2->Get(Form("dphi_%d_%d_%d", i, j, histId)) : 0);
8596 if (hist2 && triggers2)
8598 if (histId != 1 && histId != 5) // don't merge 60-80% and 40-60%
8601 nTriggers2 = triggers2->Integral(triggers2->FindBin(centralityBegin + 0.001), triggers2->FindBin(centralityEnd - 0.001));
8605 Printf("WARNING: %d %d %d missing", i, j, histId);
8607 if (nTriggers + nTriggers2 > 0)
8608 hist->Scale(1.0 / (nTriggers + nTriggers2));
8610 Printf("%s %f %f %f %f", hist->GetTitle(), centralityBegin, centralityEnd, nTriggers, nTriggers2);
8613 fileTarget = TFile::Open(target, "UPDATE");
8615 fileTarget->Close();
8621 void ExtractMiniJetHistograms(const char* fileNamePbPb, Bool_t useMixed = kTRUE, const char* outputFile = "dphi_corr.root")
8625 file = TFile::Open(outputFile, "RECREATE");
8628 Int_t leadingPtOffset = 1;
8633 Int_t maxLeadingPt = 1;
8634 Int_t maxAssocPt = 1;
8635 Float_t leadingPtArr[] = { 0.7, 5.0 };
8636 Float_t assocPtArr[] = { 0.7, 5.0 };
8639 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb);
8640 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPb, 0, kTRUE);
8644 for (Int_t i=0; i<maxLeadingPt; i++)
8646 for (Int_t j=0; j<maxAssocPt; j++)
8650 gpTMin = assocPtArr[j] + 0.01;
8651 gpTMax = assocPtArr[j+1] - 0.01;
8654 SetupRanges(hMixed);
8656 if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
8661 // pA, minijets, very fine binning
8663 for (Int_t centr=0; centr<20; centr++)
8667 GetSumOfRatios(h, hMixed, &hist1, step, 5*centr, 5*centr+5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kFALSE);
8669 GetDistAndFlow(h, 0, &hist1, 0, step, 5*centr, 5*centr+5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 1, 0, kTRUE);
8674 file = TFile::Open(outputFile, "UPDATE");
8675 hist1->SetName(Form("dphi_%d_%d_%d", i, j, centr));
8684 TH1* triggers = h->GetUEHist(2)->GetTriggersAsFunctionOfMultiplicity(step, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
8685 triggers->SetName(Form("triggers_%d", i));
8687 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+leadingPtOffset]);
8688 triggers->SetTitle(str);
8690 file = TFile::Open(outputFile, "UPDATE");
8695 TH1* events = h->GetEventCount()->ProjectionY("events", h->GetEventCount()->GetXaxis()->FindBin(step), h->GetEventCount()->GetXaxis()->FindBin(step));
8696 file = TFile::Open(outputFile, "UPDATE");
8697 events->Write("events");
8701 TLatex* DrawLatex(Float_t x, Float_t y, Int_t color, const char* text, Float_t fontSize = 0.06)
8703 latex = new TLatex(x, y, text);
8705 latex->SetTextSize(fontSize);
8706 latex->SetTextColor(color);
8711 void DrawChi2NDF(TF1* func, TH1* hist, Float_t x, Float_t y, Int_t color = 1)
8715 for (Int_t i=hist->GetXaxis()->FindBin(-0.8); i<=hist->GetXaxis()->FindBin(0.8); i++)
8717 chi2 += TMath::Power((hist->GetBinContent(i) - func->Integral(hist->GetXaxis()->GetBinLowEdge(i), hist->GetXaxis()->GetBinUpEdge(i)) / (hist->GetXaxis()->GetBinUpEdge(i) - hist->GetXaxis()->GetBinLowEdge(i))) / hist->GetBinError(i), 2);
8720 ndf -= func->GetNumberFreeParameters();
8722 printf("#chi^{2}/ndf = %.1f/%d = %.1f ", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF());
8723 Printf("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf);
8725 DrawLatex(x, y, color, Form("#chi^{2}/ndf = %.1f/%d = %.1f", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF()));
8726 DrawLatex(x, y - 0.05, color, Form("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf));
8729 void FitDeltaPhiEtaGap(TH1* hist, Int_t color, TGraphErrors* graph, Float_t x, Float_t yPosChi2)
8731 hist->SetLineColor(color);
8732 hist->DrawCopy("SAME");
8734 Bool_t twoGauss = kFALSE;
8737 func = new TF1("func", "[0]+gaus(1)");
8740 func = new TF1("func", "[0]+gaus(1)+gaus(4)");
8741 func->FixParameter(5, 0);
8742 func->SetParLimits(3, 0.1, 10);
8743 func->SetParLimits(6, 0.1, 10);
8744 func->SetParLimits(1, 0, 10);
8745 func->SetParLimits(4, 0, 10);
8748 func->SetParameters(0, 1, 0, 0.3, 1, 0, 1);
8749 func->FixParameter(2, 0);
8750 func->SetLineColor(color);
8752 hist->Fit(func, "", "SAME");
8753 // hist->Fit(func, "IM", "SAME");
8757 func2 = new TF1("func2", "[0]+gaus(1)", -1.5, 4.5);
8758 func2->SetParameters(func->GetParameter(0), func->GetParameter(1), func->GetParameter(2), func->GetParameter(3));
8759 func2->SetLineColor(color);
8760 func2->SetLineWidth(1);
8761 func2->SetLineStyle(2);
8762 func2->Draw("SAME");
8764 func2 = new TF1("func2", "[0]+gaus(1)", -1.5, 4.5);
8765 func2->SetParameters(func->GetParameter(0), func->GetParameter(4), func->GetParameter(5), func->GetParameter(6));
8766 func2->SetLineColor(color);
8767 func2->SetLineWidth(1);
8768 func2->SetLineStyle(2);
8769 func2->Draw("SAME");
8774 Bool_t firstIsMin = func->GetParameter(3) < func->GetParameter(6);
8776 Bool_t onlyOne = kFALSE;
8777 if (func->GetParameter(1) / func->GetParameter(4) < 0.1)
8779 firstIsMin = kFALSE;
8782 if (func->GetParameter(1) / func->GetParameter(4) > 10)
8788 graph->SetPoint(graph->GetN(), x - 0.1, func->GetParameter((firstIsMin) ? 3 : 6));
8789 graph->SetPointError(graph->GetN()-1, 0, func->GetParError((firstIsMin) ? 3 : 6));
8793 graph->SetPoint(graph->GetN(), x + 0.1, TMath::Abs(func->GetParameter((!firstIsMin) ? 3 : 6)));
8794 graph->SetPointError(graph->GetN()-1, 0, func->GetParError((!firstIsMin) ? 3 : 6));
8799 graph->SetPoint(graph->GetN(), x, TMath::Abs(func->GetParameter(3)));
8800 graph->SetPointError(graph->GetN()-1, 0, func->GetParError(3));
8803 DrawChi2NDF(func, hist, 0.5, yPosChi2, color);
8806 void AnalyzeDeltaPhiEtaGap(const char* fileName)
8808 TFile::Open(fileName);
8810 Int_t maxLeadingPt = 5;
8811 Int_t maxAssocPt = 6;
8813 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
8814 canvas->Divide(maxAssocPt, maxLeadingPt);
8816 TGraphErrors* width1 = new TGraphErrors;
8817 TGraphErrors* width2 = new TGraphErrors;
8818 TGraphErrors* width3 = new TGraphErrors;
8820 for (Int_t i=0; i<maxLeadingPt; i++)
8821 for (Int_t j=0; j<maxAssocPt; j++)
8823 canvas->cd(j+1 + i * maxAssocPt);
8824 gPad->SetLeftMargin(0.15);
8825 gPad->SetBottomMargin(0.2);
8826 gPad->SetTopMargin(0.01);
8827 gPad->SetRightMargin(0.01);
8829 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 0));
8830 hist2 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 1));
8831 hist3 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 2));
8836 TString tmpStr(hist1->GetTitle());
8837 tmpStr.ReplaceAll(" - ", "#");
8838 tokens = tmpStr.Tokenize("#");
8839 TString str(tokens->At(0)->GetName());
8840 TString str2(tokens->At(1)->GetName());
8842 Prepare1DPlot(hist1);
8843 Prepare1DPlot(hist2);
8844 Prepare1DPlot(hist3);
8847 hist1->Fit("pol0", "0", "", 1, 4);
8848 if (!hist1->GetFunction("pol0"))
8850 hist1->GetFunction("pol0")->SetRange(-10, 10);
8851 hist1->Add(hist1->GetFunction("pol0"), -1);
8853 hist3->Fit("pol0", "0", "", 1, 4);
8854 hist3->GetFunction("pol0")->SetRange(-10, 10);
8855 hist3->Add(hist3->GetFunction("pol0"), -1);
8857 Double_t yMin = 0.01;
8862 yMin = TMath::Min(hist1->GetMinimum(), hist2->GetMinimum()) * 0.97;
8863 yMax = TMath::Max(hist1->GetMaximum(), (hist2) ? hist2->GetMaximum() : 0.0) * 1.1;
8866 // yMin = hist1->GetMinimum() * 0.9;
8869 TH2F* dummy = new TH2F("dummy", "", 100, hist1->GetXaxis()->GetBinLowEdge(1), hist1->GetXaxis()->GetBinUpEdge(hist1->GetNbinsX()), 1000, yMin, yMax);
8870 dummy->SetStats(kFALSE);
8871 dummy->SetXTitle(hist1->GetXaxis()->GetTitle());
8872 dummy->SetYTitle(hist1->GetYaxis()->GetTitle());
8873 dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
8874 Prepare1DPlot(dummy);
8876 dummy->GetYaxis()->SetTitleOffset(0.8);
8878 dummy->GetXaxis()->SetLabelSize(0.08);
8879 dummy->GetYaxis()->SetLabelSize(0.08);
8880 dummy->GetXaxis()->SetTitleSize(0.08);
8881 dummy->GetYaxis()->SetTitleSize(0.08);
8883 dummy->GetYaxis()->SetTitleOffset(0.8);
8886 dummyTmp = dummy->DrawCopy();
8888 // TODO plot yield? baseline problematic?
8890 Float_t xPos = width1->GetN();
8893 FitDeltaPhiEtaGap(hist1, 1, width1, xPos, 0.7);
8894 FitDeltaPhiEtaGap(hist2, 4, width2, xPos, 0.5);
8895 FitDeltaPhiEtaGap(hist3, 2, width3, xPos, 0.6);
8897 latex = new TLatex(0.3, 0.8, str);
8899 latex->SetTextSize(0.06);
8902 latex = new TLatex(0.3, 0.88, str2);
8904 latex->SetTextSize(0.06);
8907 DrawLatex(0.8, 0.9, 1, "0-5%");
8908 DrawLatex(0.8, 0.85, 2, "60-90%");
8909 DrawLatex(0.8, 0.8, 4, "pp");
8916 width1->SetMarkerStyle(20);
8919 width2->SetMarkerStyle(24);
8920 width2->SetMarkerColor(4);
8921 width2->Draw("P SAME");
8923 width3->SetMarkerStyle(25);
8924 width3->SetMarkerColor(2);
8925 width3->Draw("P SAME");
8928 void CheckWing(const char* fileName)
8930 TFile::Open(fileName);
8932 Int_t maxLeadingPt = 4;
8933 Int_t maxAssocPt = 5;
8935 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
8936 canvas->Divide(maxAssocPt-1, maxLeadingPt);
8938 for (Int_t i=0; i<maxLeadingPt; i++)
8939 for (Int_t j=1; j<maxAssocPt; j++)
8941 canvas->cd(j + i * (maxAssocPt - 1));
8942 gPad->SetLeftMargin(0.15);
8943 gPad->SetBottomMargin(0.2);
8944 // gPad->SetTopMargin(0.01);
8945 gPad->SetRightMargin(0.01);
8947 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j+1, 0));
8952 // hist1->Draw("COLZ");
8954 Float_t width = 0.25;
8956 proj = ((TH2*) hist1)->ProjectionY(Form("%s_projx", hist1->GetName()), hist1->GetXaxis()->FindBin(TMath::Pi() - width),hist1->GetXaxis()->FindBin(TMath::Pi() + width));
8958 proj->GetXaxis()->SetRangeUser(-1.79, 1.79);
8959 proj->SetStats(kFALSE);
8962 proj2 = ((TH2*) hist1)->ProjectionY(Form("%s_proj2x", hist1->GetName()), hist1->GetXaxis()->FindBin(TMath::Pi() / 2 - width),hist1->GetXaxis()->FindBin(TMath::Pi() / 2 + width));
8964 proj2->GetXaxis()->SetRangeUser(-1.79, 1.79);
8965 proj2->SetLineColor(2);
8966 proj2->Draw("SAME");
8968 proj->SetMinimum(0.999 * proj2->GetMinimum());
8974 Int_t maxLeadingPt = 3;
8975 Int_t maxAssocPt = 3;
8977 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
8978 canvas->Divide(maxAssocPt, maxLeadingPt);
8980 // const char* fileNames[] = { "dphi_corr_allpt_zcentral_01.root", "dphi_corr_allpt_01.root" };
8981 // const char* fileNames[] = { "dphi_corr_allpt_zcentral.root", "dphi_corr_allpt.root" };
8982 // const char* fileNames[] = { "dphi_corr_allpt_zcentral.root", "dphi_corr.root" };
8983 // const char* fileNames[] = { "dphi_corr_allpt_01_zcentral.root", "dphi_corr_allpt_01_zsumofratios.root" };
8984 // const char* fileNames[] = { "dphi_corr_allpt_cfct_01_zcentral.root", "dphi_corr_allpt_cfct_01_zsumofratios.root" };
8985 // const char* fileNames[] = { "dphi_corr_2d.root", "dphi_corr.root" };
8986 // const char* fileNames[] = { "dphi_corr_2d_01.root", "dphi_corr.root" };
8987 // const char* fileNames[] = { "dphi_corr_2d.root", "dphi_corr_2d_vtxzcentral.root" };
8988 // const char* fileNames[] = { "dphi_corr_2d_01.root", , "dphi_corr_2d_01centr_zvtxcentral.root" };
8989 // const char* fileNames[] = { "dphi_corr_10k.root", "dphi_corr_50k.root" };
8990 // const char* fileNames[] = { "wing1.root", "wing2.root" };
8991 const char* fileNames[] = { "dphi_corr_2d_120112.root", "dphi_corr_2d_p2_111105.root" };
8993 for (Int_t i=0; i<maxLeadingPt; i++)
8994 for (Int_t j=0; j<maxAssocPt; j++)
8996 canvas->cd(j+1 + i * maxAssocPt);
8997 gPad->SetLeftMargin(0.15);
8998 gPad->SetBottomMargin(0.2);
8999 // gPad->SetTopMargin(0.01);
9000 gPad->SetRightMargin(0.01);
9003 for (Int_t fileId = 0; fileId < 2; fileId++)
9005 TFile::Open(fileNames[fileId]);
9007 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 3));
9012 // hist1->Draw("COLZ");
9014 Float_t width = 0.5;
9016 for (Int_t areaId = 0; areaId < 3; areaId++)
9018 Float_t center = TMath::Pi() / 2 * areaId;
9019 proj = ((TH2*) hist1)->ProjectionY(Form("%s_%d_%d_projx", hist1->GetName(), fileId, areaId), hist1->GetXaxis()->FindBin(center - width), hist1->GetXaxis()->FindBin(center + width));
9020 // proj->Rebin(2); proj->Scale(0.5);
9022 proj->GetXaxis()->SetRangeUser(-1.79, 1.79);
9023 proj->SetStats(kFALSE);
9024 proj->SetLineColor(fileId + 1 + areaId * 2);
9025 proj->Draw((fileId == 0 && areaId == 0) ? "" : "SAME");
9029 proj->Scale(1. / 12);
9031 first->SetMinimum(0.999 * TMath::Min(first->GetMinimum() / 0.999, proj->GetMinimum()));
9032 first->SetMaximum(1.001 * TMath::Max(first->GetMaximum() / 1.001, proj->GetMaximum()));
9038 void FitDeltaPhiEtaGap2D(TH2* hist, Bool_t scale, TVirtualPad* pad1, TVirtualPad* pad2, TVirtualPad* pad3, TGraphErrors* width1, TGraphErrors* width2, Float_t x, Float_t yPosChi2)
9040 Float_t etaLimit = 1.0;
9041 Float_t outerLimit = 1.8;
9043 TString histName(hist->GetName());
9045 TH1D* etaGap = hist->ProjectionX(histName + "_1", TMath::Max(1, hist->GetYaxis()->FindBin(-outerLimit + 0.01)), hist->GetYaxis()->FindBin(-etaLimit - 0.01));
9046 Int_t etaBins = hist->GetYaxis()->FindBin(-etaLimit - 0.01) - TMath::Max(1, hist->GetYaxis()->FindBin(-outerLimit + 0.01)) + 1;
9048 TH1D* tracksTmp = hist->ProjectionX(histName + "_2", hist->GetYaxis()->FindBin(etaLimit + 0.01), TMath::Min(hist->GetYaxis()->GetNbins(), hist->GetYaxis()->FindBin(outerLimit - 0.01)));
9049 etaBins += TMath::Min(hist->GetYaxis()->GetNbins(), hist->GetYaxis()->FindBin(outerLimit - 0.01)) - hist->GetYaxis()->FindBin(etaLimit + 0.01) + 1;
9051 etaGap->Add(tracksTmp);
9053 // get per bin result
9054 etaGap->Scale(1.0 / etaBins);
9056 // new TCanvas; etaGap->DrawCopy();
9058 histTmp2D = (TH2*) hist->Clone("histTmp2D");
9061 for (Int_t xbin=1; xbin<=histTmp2D->GetNbinsX(); xbin++)
9062 for (Int_t y=1; y<=histTmp2D->GetNbinsY(); y++)
9063 histTmp2D->SetBinContent(xbin, y, etaGap->GetBinContent(xbin));
9067 // mixed event does not reproduce away-side perfectly
9068 // --> extract scaling factor on the away-side from ratios of eta gap and central region
9069 TH1D* centralRegion = hist->ProjectionX(histName + "_3", hist->GetYaxis()->FindBin(-etaLimit + 0.01), hist->GetYaxis()->FindBin(etaLimit - 0.01));
9070 etaBins = hist->GetYaxis()->FindBin(etaLimit - 0.01) - hist->GetYaxis()->FindBin(-etaLimit + 0.01) + 1;
9071 centralRegion->Scale(1.0 / etaBins);
9073 // new TCanvas; centralRegion->DrawCopy(); etaGap->SetLineColor(2); etaGap->DrawCopy("SAME");
9074 centralRegion->Divide(etaGap);
9075 // new TCanvas; centralRegion->Draw();
9076 centralRegion->Fit("pol0", "0", "", TMath::Pi() - 1, TMath::Pi() + 1);
9077 Float_t scalingFactor = centralRegion->GetFunction("pol0")->GetParameter(0);
9078 Printf(" scalingFactor = %f", scalingFactor);
9079 histTmp2D->Scale(scalingFactor);
9082 // new TCanvas; hist->DrawCopy("SURF1");
9084 hist->Add(histTmp2D, -1);
9086 // new TCanvas; hist->DrawCopy("SURF1");
9088 hist->GetYaxis()->SetRangeUser(-1.59, 1.59);
9092 hist->DrawCopy("SURF1");
9094 Float_t min = hist->GetMinimum();
9095 Float_t max = hist->GetMaximum();
9097 // ranges are to exclude eta gap region from fit
9098 func = new TF2("func", "[0]+[1]*exp(-0.5*((x/[2])**2+(y/[3])**2))", -5, 5, -1, 1);
9099 func->SetParameters(0, 1, 0.3, 0.3);
9100 func->SetParLimits(1, 0, 10);
9101 func->SetParLimits(2, 0.1, 10);
9102 func->SetParLimits(3, 0.1, 10);
9104 hist->Fit(func, "0R", "");
9105 // hist->Fit(func, "IM", "SAME");
9108 funcHist = (TH2*) hist->Clone("funcHist");
9110 funcHist->Add(func);
9111 funcHist->SetMinimum(min);
9112 funcHist->SetMaximum(max);
9113 funcHist->Draw("SURF1");
9116 hist->Add(func, -1);
9117 hist->SetMinimum(min);
9118 hist->SetMaximum(max);
9119 hist->DrawCopy("SURF1");
9121 width1->SetPoint(width1->GetN(), x, TMath::Abs(func->GetParameter(2)));
9122 width1->SetPointError(width1->GetN()-1, 0, func->GetParError(2));
9124 width2->SetPoint(width2->GetN(), x, TMath::Abs(func->GetParameter(3)));
9125 width2->SetPointError(width2->GetN()-1, 0, func->GetParError(3));
9129 for (Int_t i=hist->GetXaxis()->FindBin(-0.8); i<=hist->GetXaxis()->FindBin(0.8); i++)
9130 for (Int_t j=hist->GetYaxis()->FindBin(-0.8); j<=hist->GetYaxis()->FindBin(0.8); j++)
9132 if (hist->GetBinError(i, j) > 0)
9134 chi2 += TMath::Power(hist->GetBinContent(i, j) / hist->GetBinError(i, j), 2);
9138 ndf -= func->GetNumberFreeParameters();
9140 printf("#chi^{2}/ndf = %.1f/%d = %.1f ", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF());
9141 Printf("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf);
9143 DrawLatex(0.5, yPosChi2, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF()));
9144 DrawLatex(0.5, yPosChi2 - 0.05, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf));
9147 Double_t DeltaPhiWidth2DFitFunction(Double_t *x, Double_t *par)
9149 // params: 0: gaussian amplitude, 1: phi width, 2: eta width
9150 // 3..bins+2 constants as fct of eta
9152 Int_t etaBin = (Int_t) ((x[1] + 2.0) / 0.1);
9154 return par[3+etaBin]+par[0]*TMath::Exp(-0.5*((x[0]/par[1])**2+(x[1]/par[2])**2));
9157 void FitDeltaPhi2DOneFunction(TH2* hist, TVirtualPad* pad1, TVirtualPad* pad2, TVirtualPad* pad3, TGraphErrors* width1, TGraphErrors* width2, Float_t x, Float_t yPosChi2)
9159 Float_t outerLimit = 1.8;
9161 hist->GetYaxis()->SetRangeUser(-1.59, 1.59);
9165 hist->DrawCopy("SURF1");
9167 Float_t min = hist->GetMinimum();
9168 Float_t max = hist->GetMaximum();
9170 Int_t bins = hist->GetNbinsX();
9172 // ranges are to exclude eta gap region from fit
9173 func = new TF2("func", DeltaPhiWidth2DFitFunction, -5, 5, -outerLimit, outerLimit, bins+3);
9174 func->SetParameters(1, 0.3, 0.3);
9175 for (Int_t i=3; i<bins+3; i++)
9176 func->SetParameter(i, 0);
9178 func->SetParLimits(0, 0, 10);
9179 func->SetParLimits(1, 0.1, 10);
9180 func->SetParLimits(2, 0.1, 10);
9182 hist->Fit(func, "0R", "");
9183 // hist->Fit(func, "IM", "SAME");
9186 funcHist = (TH2*) hist->Clone("funcHist");
9188 funcHist->Add(func);
9189 funcHist->SetMinimum(min);
9190 funcHist->SetMaximum(max);
9191 funcHist->Draw("SURF1");
9194 hist->Add(func, -1);
9195 hist->SetMinimum(min);
9196 hist->SetMaximum(max);
9197 hist->DrawCopy("SURF1");
9199 width1->SetPoint(width1->GetN(), x, TMath::Abs(func->GetParameter(1)));
9200 width1->SetPointError(width1->GetN()-1, 0, func->GetParError(1));
9202 width2->SetPoint(width2->GetN(), x, TMath::Abs(func->GetParameter(2)));
9203 width2->SetPointError(width2->GetN()-1, 0, func->GetParError(2));
9207 for (Int_t i=hist->GetXaxis()->FindBin(-0.8); i<=hist->GetXaxis()->FindBin(0.8); i++)
9208 for (Int_t j=hist->GetYaxis()->FindBin(-0.8); j<=hist->GetYaxis()->FindBin(0.8); j++)
9210 if (hist->GetBinError(i, j) > 0)
9212 chi2 += TMath::Power(hist->GetBinContent(i, j) / hist->GetBinError(i, j), 2);
9216 ndf -= func->GetNumberFreeParameters();
9218 printf("#chi^{2}/ndf = %.1f/%d = %.1f ", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF());
9219 Printf("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf);
9221 DrawLatex(0.5, yPosChi2, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF()));
9222 DrawLatex(0.5, yPosChi2 - 0.05, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf));
9225 void AnalyzeDeltaPhiEtaGap2D(const char* fileName, Int_t method)
9227 TFile::Open(fileName);
9229 Int_t maxLeadingPt = 5;
9230 Int_t maxAssocPt = 6;
9232 TGraphErrors* width1[4];
9233 TGraphErrors* width2[4];
9236 for (Int_t histId = 0; histId < nHists; histId++)
9238 width1[histId] = new TGraphErrors;
9239 width2[histId] = new TGraphErrors;
9240 for (Int_t i=0; i<maxLeadingPt; i++)
9242 TCanvas* canvas = new TCanvas(Form("DeltaPhi_%d_%d", histId, i), Form("DeltaPhi_%d_%d", histId, i), 1000, 1000);
9243 canvas->Divide(3, maxAssocPt);
9245 for (Int_t j=0; j<maxAssocPt; j++)
9247 for (Int_t k=1; k<=3; k++)
9249 canvas->cd(3 * j + k);
9250 gPad->SetLeftMargin(0.15);
9251 gPad->SetBottomMargin(0.2);
9252 gPad->SetTopMargin(0.01);
9253 gPad->SetRightMargin(0.01);
9256 // if (i != 1 || j != 2)
9259 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, histId));
9263 Float_t xPos = j*8+i;
9266 FitDeltaPhiEtaGap2D((TH2*) hist1, kFALSE, canvas->cd(3 * j + 1), canvas->cd(3 * j + 2), canvas->cd(3 * j + 3), width1[histId], width2[histId], xPos, 0.9);
9268 FitDeltaPhi2DOneFunction((TH2*) hist1, canvas->cd(3 * j + 1), canvas->cd(3 * j + 2), canvas->cd(3 * j + 3), width1[histId], width2[histId], xPos, 0.9);
9281 Int_t marker[] = { 20, 24, 25, 26 };
9282 Int_t colors[] = { 2, 2, 4, 6 };
9283 const char* labels[] = { "0-5%", "60-90%", "pp", "30-40%" };
9285 Bool_t found = kTRUE;
9286 c1 = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("width_phi");
9289 c1 = new TCanvas("width_phi", "width_phi", 800, 600);
9295 for (Int_t histId = 0; histId < nHists; histId++)
9297 width1[histId]->SetMarkerStyle(marker[histId]);
9298 width1[histId]->SetMarkerColor(colors[histId]);
9299 width1[histId]->Draw((histId == 0 && !found) ? "AP" : "PSAME");
9300 DrawLatex(0.7, 0.8 - 0.05 * histId, colors[histId], labels[histId]);
9304 c1 = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("width_eta");
9307 c1 = new TCanvas("width_eta", "width_eta", 800, 600);
9312 for (Int_t histId = 0; histId < nHists; histId++)
9314 width2[histId]->SetMarkerStyle(marker[histId]);
9315 width2[histId]->SetMarkerColor(colors[histId]);
9316 width2[histId]->Draw((histId == 0 && !found) ? "AP" : "PSAME");
9317 DrawLatex(0.7, 0.8 - 0.05 * histId, colors[histId], labels[histId]);
9322 void RemoveWing(const char* fileName, const char* outputFile)
9324 // remove wing by flattening using the ratio of a flat line to the corr fct at phi = pi +- 1.5 as fct of delta eta
9326 file = TFile::Open(fileName);
9327 file2 = TFile::Open(outputFile, "RECREATE");
9330 Int_t maxLeadingPt = 10;
9331 Int_t maxAssocPt = 11;
9334 for (Int_t i=0; i<maxLeadingPt; i++)
9336 triggers = (TH1*) file->Get(Form("triggers_%d", i));
9339 file2 = TFile::Open(outputFile, "UPDATE");
9343 for (Int_t j=0; j<maxAssocPt; j++)
9345 for (Int_t histId = 0; histId < nHists; histId++)
9347 hist = (TH2*) file->Get(Form("dphi_%d_%d_%d", i, j, histId));
9351 Float_t width = 1.5;
9352 TH1* proj = hist->ProjectionY(Form("projx", hist->GetName()), hist->GetXaxis()->FindBin(TMath::Pi() - width), hist->GetXaxis()->FindBin(TMath::Pi()+ width));
9353 proj->Fit("pol0", "0");
9354 //new TCanvas; proj->DrawCopy();
9355 proj->Divide(proj->GetFunction("pol0"));
9356 //new TCanvas; proj->DrawCopy();
9357 //new TCanvas; hist->DrawCopy("SURF1");
9358 for (Int_t x=1; x<=hist->GetNbinsX(); x++)
9359 for (Int_t y=1; y<=hist->GetNbinsY(); y++)
9361 if (proj->GetBinContent(y) <= 0)
9363 hist->SetBinContent(x, y, hist->GetBinContent(x, y) / proj->GetBinContent(y));
9364 hist->SetBinError(x, y, hist->GetBinError(x, y) / proj->GetBinContent(y));
9366 //new TCanvas; hist->DrawCopy("SURF1");
9368 file2 = TFile::Open(outputFile, "UPDATE");
9376 void RemoveWingAllSpecies()
9378 const char* suffix[] = { "Hadrons", "Pions", "Kaons", "Protons" };
9379 TString baseName = "dphi_corr_LHC13bc_20130604_";
9381 for (Int_t i=0; i<4; i++)
9382 RemoveWing(baseName + suffix[i] + ".root", baseName + suffix[i] + "_wingremoved.root");
9385 void PlotPtDistributions(const char* fileName1, Int_t centrBegin = 1, Int_t centrEnd = 2)
9389 Int_t maxLeadingPt = 3;
9390 Float_t leadingPtArr[] = { 1.0, 10.0, 20.0, 40.0 };
9392 Int_t nCentralityBins = 5;
9393 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
9395 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
9397 TCanvas* canvas = new TCanvas("Pt", "Pt", 1000, 1000);
9398 canvas->Divide(2, maxLeadingPt+2);
9400 TLegend* legend = new TLegend(0.2, 0.2, 0.95, 0.90);
9401 legend->SetFillColor(0);
9402 legend->SetTextSize(0.08);
9404 TLegend* legendB = new TLegend(0.2, 0.2, 0.95, 0.90);
9405 legendB->SetFillColor(0);
9406 legendB->SetTextSize(0.08);
9408 TLegend* legend2 = new TLegend(0.2, 0.2, 0.95, 0.90);
9409 legend2->SetFillColor(0);
9410 legend2->SetTextSize(0.08);
9412 Int_t colors[] = { 1, 2, 4, 6 };
9413 Int_t markers[] = { 20, 21, 22, 23, 24, 25 };
9415 for (Int_t i=0; i<maxLeadingPt; i++)
9417 Double_t ptMin = leadingPtArr[i] + 0.01;
9418 //Double_t ptMax = leadingPtArr[i+1] - 0.01;
9419 Double_t ptMax = 39.99;
9422 str.Form("%.1f < p_{T,trig} < %.1f", ptMin - 0.01, ptMax + 0.01);
9424 canvas->cd(2*i+1+2);
9425 gPad->SetLeftMargin(0.15);
9426 gPad->SetBottomMargin(0.2);
9427 gPad->SetTopMargin(0.01);
9428 gPad->SetRightMargin(0.01);
9434 TH2F* dummy = new TH2F("dummy", "", 100, 1, 40, 100, 1e-5, 1e3);
9435 dummy->SetStats(kFALSE);
9436 dummy->SetXTitle("p_{T,assoc}");
9437 dummy->SetYTitle("");
9438 dummy->GetYaxis()->SetTitleOffset(1);
9439 Prepare1DPlot(dummy);
9441 dummy->GetXaxis()->SetLabelSize(0.06);
9442 dummy->GetYaxis()->SetLabelSize(0.06);
9443 dummy->GetXaxis()->SetTitleSize(0.06);
9444 dummy->GetYaxis()->SetTitleSize(0.06);
9447 Float_t phiRange[] = { 0, TMath::Pi() / 2, TMath::Pi() };
9448 const char* phiLabels[] = { "Towards", "Transverse", "Away" };
9450 for (Int_t j=0; j<3; j++)
9452 TH1* centralEta = 0;
9457 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);
9458 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);
9459 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);
9460 sideEta1->Add(sideEta2); // TODO can be done smarter? what about the errors?
9462 Prepare1DPlot(sideEta1);
9463 Prepare1DPlot(centralEta);
9465 centralEta->SetLineColor(colors[j]);
9466 sideEta1->SetLineColor(colors[j+1]);
9470 legend->AddEntry(centralEta->Clone(), Form("Jet, %s: |#eta| < 0.7, #phi ~ %.1f", phiLabels[j], phiRange[j]));
9471 legend->AddEntry(sideEta1->Clone(), Form("Ridge, %s: 0.7 < |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]));
9476 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);
9477 centralEta->Scale(0.5);
9478 centralEta->SetLineColor(colors[j+1]);
9480 Prepare1DPlot(centralEta);
9483 legend->AddEntry(centralEta->Clone(), Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]));
9486 canvas->cd(2*i+1+2);
9487 centralEta->DrawCopy("SAME");
9489 sideEta1->DrawCopy("SAME");
9491 centralEta->SetLineColor(colors[i]);
9492 centralEta->Scale(100.0 / centralEta->Integral());
9495 sideEta1->SetLineColor(colors[i]);
9496 sideEta1->Scale(100.0 / sideEta1->Integral());
9505 gPad->SetLeftMargin(0.15);
9506 gPad->SetBottomMargin(0.2);
9507 gPad->SetTopMargin(0.01);
9508 gPad->SetRightMargin(0.01);
9519 str3.Form("Jet, %s: |#eta| < 0.7, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9521 str3.Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9522 latex = new TLatex(0.2, 0.3, str3);
9524 latex->SetTextSize(0.08);
9529 legend2->AddEntry(centralEta->Clone(), str);
9531 centralEta->DrawCopy("SAME");
9535 canvas->cd(j*4+4+2);
9538 gPad->SetLeftMargin(0.15);
9539 gPad->SetBottomMargin(0.2);
9540 gPad->SetTopMargin(0.01);
9541 gPad->SetRightMargin(0.01);
9552 str3.Form("Ridge, %s: 0.7 < |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9554 str3.Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9555 latex = new TLatex(0.2, 0.3, str3);
9557 latex->SetTextSize(0.08);
9561 sideEta1->DrawCopy("SAME");
9566 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
9567 latex = new TLatex(0.2, 0.3, str3);
9569 latex->SetTextSize(0.08);
9571 latex2 = new TLatex(0.55, 0.8, str);
9573 latex2->SetTextSize(0.06);
9575 canvas->cd(2*i+1+2);
9589 TH1* GetNonSubtractedRHICYield(Int_t ptT, Int_t ptA, Int_t centrality)
9591 rhicFile = TFile::Open("rhic/postcorr_AuAu_iter6_ppg106final.root");
9593 corrFunc = (TH1*) rhicFile->Get(Form("pi0hdphi_%d_%d_%d_2", ptT, ptA, centrality));
9597 corrFunc->Scale(1.0 / corrFunc->Integral());
9599 corrFunc->Scale(TMath::TwoPi() / corrFunc->GetBinWidth(1));
9601 same = (TH1*) rhicFile->Get(Form("pi0hdphi_%d_%d_%d_0", ptT, ptA, centrality));
9602 Float_t nPairs = same->Integral();
9604 triggers = (TH1*) rhicFile->Get(Form("pi0pt_%d_%d", ptT, centrality));
9605 Float_t nTrigs = triggers->Integral();
9607 graph = (TGraph*) rhicFile->Get(Form("gS_%d_%d", ptT, centrality));
9609 Printf("%f %f %f %f", nPairs, nTrigs, nPairs / nTrigs, graph->GetY()[ptA]);
9611 corrFunc->Scale(nPairs / nTrigs);
9613 //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))));
9618 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4, 1.5 * TMath::Pi() - 0.4 };
9619 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4, TMath::Pi() / 2 + 0.4, 1.5 * TMath::Pi() };
9624 for (Int_t i=0; i<3; i++)
9626 corrFunc->Fit("pol0", "0Q", "", regionBegin[i], regionEnd[i]);
9627 func = corrFunc->GetFunction("pol0");
9630 sum += func->GetParameter(0) / func->GetParError(0) / func->GetParError(0);
9631 weight += 1. / func->GetParError(0) / func->GetParError(0);
9638 weight = TMath::Sqrt(1. / weight);
9640 corrFunc->Add(new TF1("func", "1", -5, 5), -sum);
9646 compHist = (TH1*) rhicFile->Get(Form("ptyMSMP_0_%d%d%d", ptT, ptA, centrality));
9647 compHist->DrawCopy("SAME");
9649 //compHist->Add((TF1*) compHist->GetListOfFunctions()->First());
9650 //compHist->DrawCopy("SAME");
9653 void DeltaPhiVsRHIC(Int_t rhicCentrality = 0, Int_t aliceCentrality = 0, Bool_t reduced = kFALSE)
9655 aliceFile = TFile::Open("alice_dphi_corr_rhicbinning.root");
9656 rhicFile = TFile::Open("rhic/postcorr_AuAu_iter6_ppg106final.root");
9658 Int_t maxLeadingPt = 4;
9659 Int_t maxAssocPt = 5;
9663 Int_t maxSelected = 4;
9664 Int_t selectedLead[] = { 0, 0, 2, 2 };
9665 Int_t selectedAssoc[] = { 1, 2, 3, 4 };
9667 maxLeadingPt = TMath::Sqrt(maxSelected);
9668 maxAssocPt = TMath::Sqrt(maxSelected);
9671 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
9672 canvas->Divide(maxAssocPt, maxLeadingPt);
9674 for (Int_t i=0; i<maxLeadingPt; i++)
9675 for (Int_t j=0; j<maxAssocPt; j++)
9677 Printf("%d %d", i, j);
9679 canvas->cd(j+1 + i * maxAssocPt);
9680 gPad->SetLeftMargin(0.15);
9681 gPad->SetBottomMargin(0.2);
9682 //gPad->SetTopMargin(0.01);
9683 gPad->SetRightMargin(0.01);
9690 iSel = selectedLead[j + i * maxAssocPt];
9691 jSel = selectedAssoc[j + i * maxAssocPt];
9694 //rhic = (TH1*) rhicFile->Get(Form("VptyMSMP_0_%d%d%d", iSel, jSel, rhicCentrality));
9695 rhic = GetNonSubtractedRHICYield(iSel, jSel, rhicCentrality);
9698 rhic->SetLineColor(2);
9699 rhic->SetMarkerStyle(1);
9701 alice = (TH1*) aliceFile->Get(Form("dphi_%d_%d_%d_fit_flat", iSel, jSel, aliceCentrality));
9705 // match near side yield
9708 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));
9710 Printf("%f", factor);
9711 rhic->Scale(factor);
9714 alice->SetLineColor(1);
9716 //alice->Rebin(36); rhic->Rebin(30);
9718 clone = alice->DrawCopy("");
9719 rhic->DrawCopy("SAME");
9721 //Printf("chi2 test: chi2/ndf = %f", alice->Chi2Test(rhic, "WW CHI2/NDF"));
9724 for (Int_t k=1; k<=rhic->GetNbinsX(); k++)
9726 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));
9731 Printf("chi2 test: chi2/ndf = %f", chi2);
9733 clone->GetYaxis()->SetRangeUser(TMath::Min(alice->GetMinimum(), rhic->GetMinimum()) * 1.1, TMath::Max(alice->GetMaximum(), rhic->GetMaximum()) * 1.1);
9735 for (Int_t bin=1; bin<=rhic->GetNbinsX(); bin++)
9737 Double_t aliceValue = alice->GetBinContent(alice->FindBin(rhic->GetXaxis()->GetBinCenter(bin)));
9738 if (aliceValue == 0)
9740 rhic->SetBinContent(bin, rhic->GetBinContent(bin) / aliceValue);
9741 rhic->SetBinError(bin, 0);
9747 rhic->SetLineColor(3);
9748 //rhic->DrawCopy("SAME");
9753 canvas->SaveAs("yield_comparison.png");
9756 void DeltaPhi(const char* fileName, const char* fileName2 = 0, Bool_t reduced = kFALSE, Bool_t ppComparison = kFALSE, Int_t mode = 0, const char* dataTag = "", const char* histName = "_fit_flat")
9758 // DeltaPhi("high_stat_binning_pp7_pt8.root", "high_stat_binning_pp7_pythia_pt8.root", 0, 1, 0, "pp 7 TeV uncorrected")
9759 // DeltaPhi("high_stat_binning_pp900_pt8.root", "high_stat_binning_pp900_pythia_pt8.root", 0, 1, 0, "pp 0.9 TeV uncorrected")
9763 aliceFile = TFile::Open(fileName);
9765 secondFile = TFile::Open(fileName2);
9769 Int_t maxLeadingPt = 3;
9770 Int_t maxAssocPt = 3;
9774 Int_t maxLeadingPt = 3;
9775 Int_t maxAssocPt = 7;
9780 Int_t maxSelected = 4;
9781 Int_t selectedLead[] = { 1, 1, 1, 1 };
9782 Int_t selectedAssoc[] = { 2, 3, 4, 5 };
9784 maxLeadingPt = TMath::Sqrt(maxSelected);
9785 maxAssocPt = TMath::Sqrt(maxSelected);
9788 factorGraph = new TGraphErrors;
9790 // TCanvas* canvas = new TCanvas(Form("%s_%s", fileName, fileName2 ? fileName2 : ""), Form("%s_%s", fileName, fileName2 ? fileName2 : ""), 600, 900);
9791 TCanvas* canvas = new TCanvas(Form("%s_%s", fileName, fileName2 ? fileName2 : ""), Form("%s_%s", fileName, fileName2 ? fileName2 : ""), 1000, 1000);
9792 canvas->Divide(maxAssocPt, maxLeadingPt);
9794 for (Int_t i=0; i<maxLeadingPt; i++)
9795 for (Int_t j=0; j<maxAssocPt; j++)
9798 TH1* peripheral = 0;
9799 for (Int_t aliceCentrality=0; aliceCentrality<4; aliceCentrality++)
9801 Printf("%d %d %d", i, j, aliceCentrality);
9803 if (aliceCentrality == 1)
9806 canvas->cd(j+1 + i * maxAssocPt);
9810 Int_t centralitySel = aliceCentrality;
9811 currentFile = aliceFile;
9815 iSel = selectedLead[j + i * maxAssocPt];
9816 jSel = selectedAssoc[j + i * maxAssocPt];
9824 if (aliceCentrality == 1)
9825 currentFile = secondFile;
9826 else if (aliceCentrality == 2)
9830 if (aliceCentrality == 3)
9831 currentFile = secondFile;
9834 //alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", iSel, jSel, centralitySel, (centralitySel < 3) ? "_tsallis_flat" : ((flatOrTsallis) ? "" : "_fit_flat")));
9835 alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", iSel, jSel, centralitySel, histName));
9841 Printf("WARNING: Applying some scaling and rebinning! Only for 2.76 data-MC comparison!");
9842 if (aliceCentrality == 0)
9844 alice->Rebin(2); alice->Scale(0.5);
9845 alice->Scale(1.0 / 1.6);
9848 // alice->Scale(1.6);
9851 alice->Rebin(2); alice->Scale(0.5);
9852 // alice->Scale(1.0 / 1.6);
9854 // match near side yield to peripheral
9855 if (1 && centralitySel == 3 && peripheral)
9857 if (mode == 0 || mode == 1)
9859 Double_t width = 0.5;
9860 Double_t error1, error2;
9861 Double_t integral1 = peripheral->IntegralAndError(peripheral->FindBin(-width), peripheral->FindBin(width), error1);
9862 Double_t integral2 = alice->IntegralAndError(alice->FindBin(-width), alice->FindBin(width), error2);
9865 Double_t tmpErr = 0;
9866 integral1 += peripheral->IntegralAndError(peripheral->FindBin(TMath::Pi() - width), peripheral->FindBin(TMath::Pi() + width), tmpErr);
9867 error1 = TMath::Sqrt(error1 * error1 + tmpErr * tmpErr);
9869 integral2 += alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), tmpErr);
9870 error2 = TMath::Sqrt(error2 * error2 + tmpErr * tmpErr);
9875 Double_t error1, error2;
9876 Double_t integral1 = peripheral->IntegralAndError(1, peripheral->GetNbinsX(), error1);
9877 Double_t integral2 = alice->IntegralAndError(1, alice->GetNbinsX(), error2);
9881 Double_t width = 1.0;
9882 Double_t error1, error2;
9883 Double_t integral1 = peripheral->IntegralAndError(peripheral->FindBin(TMath::Pi() - width), peripheral->FindBin(TMath::Pi() + width), error1);
9884 Double_t integral2 = alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), error2);
9887 Double_t factor = integral1 / integral2;
9889 //factor = 0.804 * 0.9;
9890 Printf("%f", factor);
9891 // alice->Scale(factor);
9892 factorGraph->SetPoint(factorGraph->GetN(), factorGraph->GetN(), factor);
9893 factorGraph->SetPointError(factorGraph->GetN() - 1, 0, factor * TMath::Sqrt(TMath::Power(error1 / integral1, 2) + TMath::Power(error2 / integral2, 2)));
9896 if (ppComparison && aliceCentrality == 0)
9898 else if (aliceCentrality == 2)
9901 // alice->SetYTitle("1/(N_{trig} #Delta#eta) dN_{assoc}/d#Delta#phi (1/rad)");
9902 alice->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi (1/rad)");
9903 alice->SetXTitle("#Delta#phi (rad)");
9904 alice->SetLineColor(aliceCentrality+1);
9905 alice->SetLineWidth(2);
9906 alice->SetMarkerColor(aliceCentrality+1);
9907 alice->GetYaxis()->SetTitleOffset(1.7);
9908 clone = alice->DrawCopy((aliceCentrality > 0) ? "SAME" : "");
9909 clone->SetTitle("");
9911 TString str(alice->GetTitle());
9912 str.ReplaceAll(" - ", "#");
9913 tokens = str.Tokenize("#");
9915 if (aliceCentrality == 0)
9917 for (Int_t k=0; k<2; k++)
9919 TString str(tokens->At(k)->GetName());
9920 str.ReplaceAll(".0", "");
9921 str.ReplaceAll("< p", "GeV/c < p");
9923 latex = new TLatex(0.48, 0.92-k*0.06, str);
9925 latex->SetTextSize(0.04);
9934 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), clone->GetMinimum()), TMath::Max(first->GetMaximum(), clone->GetMaximum()));
9941 //first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.2);
9942 first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.5);
9947 for (Int_t i=1; i<=6; i++)
9951 latex = new TLatex(0.58, 0.8, "ALICE preliminary");
9952 latex->SetTextSize(0.04);
9956 latex = new TLatex(0.58, 0.74, Form("%s", dataTag));
9957 latex->SetTextSize(0.04);
9961 latex = new TLatex(0.58, 0.68, "Stat. uncertainties only");
9962 latex->SetTextSize(0.04);
9966 latex = new TLatex(0.58, 0.62, "|#eta| < 0.8");
9967 latex->SetTextSize(0.04);
9973 legend = new TLegend(0.3, 0.8, 0.47, 0.95);
9974 legend->SetFillColor(0);
9975 legend->SetTextSize(0.04);
9976 legend->AddEntry(peripheral, "Data");
9977 legend->AddEntry(alice, "Pythia");
9981 DrawALICELogo(0.75, 0.47, 0.95, 0.6);
9985 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
9986 canvas->SaveAs(Form("%s.png", canvas->GetName()));
9989 peripheral->Divide(alice);
9990 peripheral->DrawCopy();
9991 //alice->DrawCopy("SAME");
9994 graphCanvas = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("graphCanvas");
9995 factorGraph->SetMarkerStyle(20);
9998 graphCanvas = new TCanvas("graphCanvas", "graphCanvas", 800, 600);
9999 factorGraph->Draw("AP");
10004 factorGraph->SetLineColor(2);
10005 factorGraph->SetMarkerColor(2);
10006 factorGraph->Draw("SAMEP");
10008 factorGraph->GetYaxis()->SetRangeUser(0.6, 1.4);
10010 factorGraph->Print();
10013 void ComparePPYields(const char* histName = "_fit_flat")
10015 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" };
10016 const char* titles[] = { "0.9 data", "0.9 Pythia", "2.76 Pythia", "7 Pythia", "7 data" };
10018 Int_t colors[] = { 1, 2, 3, 4, 6 };
10020 Int_t maxLeadingPt = 3;
10021 Int_t maxAssocPt = 2;
10023 TCanvas* canvas = new TCanvas("ComparePPYields", "ComparePPYields", 600, 900);
10024 canvas->Divide(maxAssocPt, maxLeadingPt);
10026 legend = new TLegend(0.5, 0.5, 0.8, 0.8);
10027 legend->SetFillColor(0);
10029 TGraphErrors** graphs = new TGraphErrors*[5];
10030 TGraphErrors** graphs2 = new TGraphErrors*[5];
10032 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
10034 graphs[nFiles] = new TGraphErrors;
10035 graphs2[nFiles] = new TGraphErrors;
10038 for (Int_t i=0; i<maxLeadingPt; i++)
10039 for (Int_t j=0; j<maxAssocPt; j++)
10041 canvas->cd(j+1 + i * maxAssocPt);
10042 gPad->SetLeftMargin(0.18);
10043 gPad->SetBottomMargin(0.1);
10044 gPad->SetTopMargin(0.01);
10045 gPad->SetRightMargin(0.01);
10049 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
10051 currentFile = TFile::Open(files[nFiles]);
10053 Int_t aliceCentrality = 3;
10055 Printf("%d %d %d", i, j, nFiles);
10057 alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, histName));
10061 alice->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
10062 alice->SetLineColor(colors[nFiles]);
10063 alice->SetMarkerColor(colors[nFiles]);
10064 alice->GetYaxis()->SetTitleOffset(1.7);
10065 clone = alice->DrawCopy((nFiles > 0) ? "SAME" : "");
10066 clone->SetTitle("");
10068 Double_t width = 0.7;
10069 Double_t error, error2;
10070 Double_t integral = alice->IntegralAndError(alice->FindBin(-width), alice->FindBin(width), error);
10071 Double_t integral2 = alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), error2);
10073 graphs[nFiles]->SetPoint(graphs[nFiles]->GetN(), j + i * maxAssocPt - 0.2, integral);
10074 graphs[nFiles]->SetPointError(graphs[nFiles]->GetN()-1, 0, error);
10076 graphs2[nFiles]->SetPoint(graphs2[nFiles]->GetN(), j + i * maxAssocPt + 0.2, integral2);
10077 graphs2[nFiles]->SetPointError(graphs2[nFiles]->GetN()-1, 0, error2);
10082 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), clone->GetMinimum()), TMath::Max(first->GetMaximum(), clone->GetMaximum()));
10086 TString str(alice->GetTitle());
10087 str.ReplaceAll(" - ", "#");
10088 tokens = str.Tokenize("#");
10090 for (Int_t k=0; k<2; k++)
10092 latex = new TLatex(0.6, 0.88-k*0.07, tokens->At(k)->GetName());
10094 latex->SetTextSize(0.04);
10099 if (i == 0 && j == 0)
10100 legend->AddEntry(clone, titles[nFiles]);
10103 first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.1);
10111 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
10113 graphs[nFiles]->SetMarkerStyle(25);
10114 graphs[nFiles]->SetLineColor(colors[nFiles]);
10115 graphs[nFiles]->SetMarkerColor(colors[nFiles]);
10116 clone2 = (TGraphErrors*) graphs[nFiles]->DrawClone((nFiles == 0) ? "AP" : "PSAME");
10117 clone2->GetYaxis()->SetRangeUser(0, 5);
10119 graphs2[nFiles]->SetMarkerStyle(26);
10120 graphs2[nFiles]->SetLineColor(colors[nFiles]);
10121 graphs2[nFiles]->SetMarkerColor(colors[nFiles]);
10122 graphs2[nFiles]->DrawClone("PSAME");
10126 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
10128 DivideGraphs(graphs[nFiles], graphs[4]);
10129 DivideGraphs(graphs2[nFiles], graphs2[4]);
10131 graphs[nFiles]->SetMarkerStyle(25);
10132 graphs[nFiles]->SetLineColor(colors[nFiles]);
10133 graphs[nFiles]->SetMarkerColor(colors[nFiles]);
10134 clone2 = (TGraphErrors*) graphs[nFiles]->DrawClone((nFiles == 0) ? "AP" : "PSAME");
10135 clone2->GetYaxis()->SetRangeUser(0, 1.5);
10137 graphs2[nFiles]->SetMarkerStyle(26);
10138 graphs2[nFiles]->SetLineColor(colors[nFiles]);
10139 graphs2[nFiles]->SetMarkerColor(colors[nFiles]);
10140 graphs2[nFiles]->DrawClone("PSAME");
10144 void DeltaPhiPreliminary(const char* fileName, const char* histName)
10148 currentFile = TFile::Open(fileName);
10150 TCanvas* canvas = new TCanvas(Form("dphi%s", histName), "dphi", 800, 800);
10151 canvas->Divide(2, 2);
10153 TLegend* legend = new TLegend(0.55, 0.47, 0.85, 0.65);
10154 legend->SetFillColor(0);
10155 legend->SetTextSize(0.04);
10157 Int_t colors[] = { 1, 2, 4, 6 };
10160 for (Int_t i=1; i<2; i++)
10161 for (Int_t j=2; j<6; j++)
10165 for (Int_t aliceCentrality=0; aliceCentrality<3; aliceCentrality+=2)
10167 Printf("%d %d %d", i, j, aliceCentrality);
10169 hist = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, histName));
10173 if (aliceCentrality == 3)
10174 hist->Scale(kPythiaScalingFactor);
10176 hist->GetYaxis()->SetTitleOffset(1.9);
10177 hist->SetLineColor(colors[aliceCentrality]);
10178 hist->SetMarkerColor(colors[aliceCentrality]);
10179 hist->SetLineWidth(2);
10180 hist->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
10181 hist->SetXTitle("#Delta#phi (rad)");
10183 clone = hist->DrawCopy((aliceCentrality > 0) ? "SAME" : "");
10184 clone->SetTitle("");
10186 TString str(hist->GetTitle());
10187 str.ReplaceAll(" - ", "#");
10188 tokens = str.Tokenize("#");
10189 hist->SetTitle("");
10191 if (aliceCentrality == 0)
10193 for (Int_t k=0; k<2; k++)
10195 TString str(tokens->At(k)->GetName());
10196 str.ReplaceAll(".0", "");
10197 str.ReplaceAll("< p", "GeV/c < p");
10200 latex = new TLatex(0.5, 0.88-k*0.06, str);
10202 latex->SetTextSize(0.04);
10206 latex = new TLatex(0.5, 0.76, "ALICE preliminary");
10207 latex->SetTextSize(0.04);
10211 latex = new TLatex(0.5, 0.70, "Stat. uncertainties only");
10212 latex->SetTextSize(0.04);
10216 clone->GetYaxis()->SetRangeUser(0, clone->GetMaximum() * 1.2);
10221 if (aliceCentrality == 3)
10222 legend->AddEntry(hist, "Pythia");
10224 legend->AddEntry(hist, tokens->At(2)->GetName());
10234 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10235 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10238 void DeltaPhiBaseLinePreliminary(const char* fileName)
10244 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
10245 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
10246 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
10252 gpTMin = assocPtArr[j] + 0.01;
10253 gpTMax = assocPtArr[j+1] - 0.01;
10257 str.Form("%.0f GeV/c < p_{T,trig} < %.0f GeV/c", leadingPtArr[i], leadingPtArr[i+2]);
10260 str2.Form("%.0f GeV/c < p_{T,assoc} < %.0f GeV/c", gpTMin - 0.01, gpTMax + 0.01);
10266 GetDistAndFlow(h, 0, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10267 GetDistAndFlow(h, 0, &hist2b, v2+2, step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10269 hist1->SetLineWidth(2);
10270 hist2b->SetLineWidth(2);
10272 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 1200, 1200);
10273 canvas->Divide(2, 2);
10276 // gPad->SetLeftMargin(0.20);
10278 hist1->GetYaxis()->SetTitleOffset(1.9);
10279 hist1->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
10280 hist1->SetXTitle("#Delta#phi (rad)");
10281 hist1->SetTitle("");
10282 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0, 0.59);
10284 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);
10286 latex = new TLatex(0.5, 0.78, "0-5%");
10288 latex->SetTextSize(0.04);
10294 // gPad->SetLeftMargin(0.20);
10296 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.18, 0.295);
10297 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10302 // gPad->SetLeftMargin(0.20);
10304 hist2b->GetYaxis()->SetTitleOffset(1.9);
10305 hist2b->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
10306 hist2b->SetXTitle("#Delta#phi (rad)");
10307 hist2b->SetTitle("");
10308 hist2b->DrawCopy();
10310 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);
10312 latex = new TLatex(0.5, 0.78, "60-90%");
10314 latex->SetTextSize(0.04);
10318 // gPad->SetLeftMargin(0.20);
10320 hist2b->DrawCopy()->GetYaxis()->SetRangeUser(0.01, 0.13);
10321 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10326 for (Int_t i=1; i<=4; i++)
10330 latex = new TLatex(0.5, 0.84, str);
10332 latex->SetTextSize(0.04);
10335 latex = new TLatex(0.5, 0.90, str2);
10337 latex->SetTextSize(0.04);
10340 latex = new TLatex(0.5, 0.72, "ALICE preliminary");
10341 latex->SetTextSize(0.04);
10345 latex = new TLatex(0.5, 0.66, "Stat. uncertainties only");
10346 latex->SetTextSize(0.04);
10351 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10352 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10356 void DeltaPhiBaseLinePaperPlot(const char* fileName, const char* yieldFile)
10360 Float_t fontSize = 0.08;
10361 Float_t titleOffset = 0.85;
10363 gStyle->SetTextSize(fontSize);
10364 gStyle->SetLabelSize(fontSize, "xy");
10365 gStyle->SetTitleSize(fontSize, "xy");
10366 gStyle->SetTitleOffset(titleOffset, "y");
10367 gStyle->SetHistLineWidth(2);
10368 gROOT->ForceStyle();
10372 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
10373 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
10374 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
10380 gpTMin = assocPtArr[j] + 0.01;
10381 gpTMax = assocPtArr[j+1] - 0.01;
10385 str.Form("%.0f GeV/#font[12]{c} < p_{t,trig} < %.0f GeV/#font[12]{c}", leadingPtArr[i], leadingPtArr[i+2]);
10388 str2.Form("%.0f GeV/#font[12]{c} < p_{t,assoc} < %.0f GeV/#font[12]{c}", gpTMin - 0.01, gpTMax + 0.01);
10394 GetDistAndFlow(h, 0, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10396 hist1->SetLineWidth(2);
10398 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 600, 840);
10399 canvas->Range(0, 0, 1, 1);
10401 pad1 = new TPad("pad1", "pad1", 0, 0.69, 1, 1);
10404 pad2 = new TPad("pad2", "pad2", 0, 0.38, 1, 0.69);
10407 pad3 = new TPad("pad3", "pad3", 0, 0 , 1, 0.38);
10411 gPad->SetMargin(0.15, 0.02, 0, 0.01);
10413 // hist1->GetYaxis()->SetTitleOffset(0.85);
10414 hist1->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#varphi");
10415 hist1->SetXTitle("#Delta#varphi (rad)");
10416 hist1->SetTitle("");
10418 hist1->SetLabelSize(fontSize * 0.38 / 0.31, "xy");
10419 hist1->SetTitleSize(fontSize * 0.38 / 0.31, "xy");
10420 hist1->SetTitleOffset(titleOffset / 0.38 * 0.31, "y");
10422 hist1->DrawCopy(); //->GetYaxis()->SetRangeUser(0, 0.59);
10424 //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);
10427 gPad->SetMargin(0.15, 0.02, 0, 0);
10429 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.381, 0.457);
10430 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10433 gPad->SetMargin(0.15, 0.02, 0.2, 0);
10435 // get zero subtracted plots
10436 TFile::Open(yieldFile);
10437 hist1sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 0));
10438 hist1sub->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#varphi");
10439 hist1sub->SetXTitle("#Delta#varphi (rad)");
10440 hist1sub->SetTitle("");
10441 hist1sub->DrawCopy();
10443 hist2sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 2));
10444 hist2sub->SetMarkerStyle(24);
10445 hist2sub->SetLineColor(2);
10446 hist2sub->SetMarkerColor(2);
10447 // hist2sub->SetMarkerSize(0.8);
10448 hist2sub->DrawCopy("SAMEP E X0");
10450 hist3sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 3));
10451 hist3sub->SetMarkerStyle(25);
10452 hist3sub->SetLineColor(4);
10453 hist3sub->SetMarkerColor(4);
10454 // hist3sub->SetMarkerSize(0.8);
10455 hist3sub->DrawCopy("SAMEP E X0");
10457 legend = new TLegend(0.4, 0.55, 0.9, 0.9);
10458 legend->SetFillColor(0);
10459 legend->SetBorderSize(0);
10460 legend->SetTextSize(0.08);
10461 legend->AddEntry(hist1sub, "Pb-Pb 0-5% centrality", "L");
10462 legend->AddEntry(hist2sub, "Pb-Pb 60-90% centrality", "P");
10463 legend->AddEntry(hist3sub, "pp", "P");
10468 latex = new TLatex(0.47, 0.85, str);
10469 latex->SetTextSize(fontSize * 0.38 / 0.31);
10473 latex = new TLatex(0.47, 0.73, str2);
10474 latex->SetTextSize(fontSize * 0.38 / 0.31);
10478 latex = new TLatex(0.5, 0.42, "0-5% centrality");
10482 latex = new TLatex(0.45, 0.62, "Stat. uncertainties only");
10486 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10487 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10491 void DeltaPhiBaseLinePaperPlot(const char* fileName, const char* yieldFile)
10495 Float_t fontSize = 0.08;
10496 Float_t titleOffset = 0.85;
10498 gStyle->SetTextSize(fontSize);
10499 gStyle->SetLabelSize(fontSize, "xy");
10500 gStyle->SetTitleSize(fontSize, "xy");
10501 gStyle->SetTitleOffset(titleOffset, "y");
10502 gStyle->SetHistLineWidth(2);
10503 gROOT->ForceStyle();
10507 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
10508 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
10509 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
10515 gpTMin = assocPtArr[j] + 0.01;
10516 gpTMax = assocPtArr[j+1] - 0.01;
10520 str.Form("%.0f < #font[12]{p}_{T,trig} < %.0f GeV/#font[12]{c}", leadingPtArr[i], leadingPtArr[i+2]);
10523 str2.Form("%.0f < #font[12]{p}_{T,assoc} < %.0f GeV/#font[12]{c}", gpTMin - 0.01, gpTMax + 0.01);
10529 GetDistAndFlow(h, 0, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10531 hist1->SetLineWidth(2);
10533 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 600, 840);
10534 canvas->Range(0, 0, 1, 1);
10536 pad1 = new TPad("pad1", "pad1", 0, 0.69, 1, 1);
10539 pad2 = new TPad("pad2", "pad2", 0, 0.38, 1, 0.69);
10542 pad3 = new TPad("pad3", "pad3", 0, 0 , 1, 0.38);
10546 gPad->SetMargin(0.15, 0.02, 0, 0.01);
10548 // hist1->GetYaxis()->SetTitleOffset(0.85);
10549 hist1->SetYTitle("");
10550 hist1->SetXTitle("#Delta#font[12]{#varphi} (rad)");
10551 hist1->SetTitle("");
10553 hist1->SetLabelSize(fontSize * 0.38 / 0.31, "xy");
10554 hist1->SetTitleSize(fontSize * 0.38 / 0.31, "xy");
10555 hist1->SetTitleOffset(titleOffset / 0.38 * 0.31, "y");
10557 hist1->DrawCopy("HISTE"); //->GetYaxis()->SetRangeUser(0, 0.59);
10559 //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);
10562 gPad->SetMargin(0.15, 0.02, 0, 0);
10564 hist1->SetYTitle("1/#font[12]{N}_{trig} d#font[12]{N}_{assoc}/d#Delta#font[12]{#varphi} (rad^{-1})");
10565 hist1->DrawCopy("HISTE")->GetYaxis()->SetRangeUser(0.381, 0.457);
10566 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10569 gPad->SetMargin(0.15, 0.02, 0.2, 0);
10571 // get zero subtracted plots
10572 TFile::Open(yieldFile);
10574 hist1sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 0));
10575 hist1sub->SetYTitle("");
10576 hist1sub->SetXTitle("#Delta#varphi (rad)");
10577 hist1sub->SetTitle("");
10578 // hist1sub->SetMarkerStyle(25);
10579 // hist1sub->SetLineColor(4);
10580 // hist1sub->SetMarkerColor(4);
10581 hist1sub->SetMaximum(0.79);
10582 hist1sub->DrawCopy("HIST E");
10584 hist3sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 3));
10585 // hist3sub->SetFillColor(4);
10586 // hist3sub->SetFillStyle(3354);
10587 // hist3sub->SetLineWidth(0);
10588 // hist3sub->SetLineColor(0);
10589 hist3sub->SetMarkerStyle(25);
10590 hist3sub->SetLineColor(4);
10591 hist3sub->SetMarkerColor(4);
10592 hist3sub->DrawCopy("SAME E X0");
10594 hist1sub->DrawCopy("SAME HIST E");
10596 hist2sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 2));
10597 hist2sub->SetMarkerStyle(24);
10598 hist2sub->SetLineColor(2);
10599 hist2sub->SetMarkerColor(2);
10600 hist2sub->DrawCopy("SAMEP E X0");
10602 legend = new TLegend(0.4, 0.45, 0.9, 0.8);
10603 legend->SetFillColor(0);
10604 legend->SetBorderSize(0);
10605 legend->SetTextSize(fontSize);
10606 legend->AddEntry(hist1sub, "Pb-Pb 0-5% centrality", "L");
10607 legend->AddEntry(hist2sub, "Pb-Pb 60-90% centrality", "P");
10608 legend->AddEntry(hist3sub, "pp", "P");
10613 latex = new TLatex(0.59, 0.70, str);
10614 latex->SetTextSize(fontSize * 0.38 / 0.31);
10618 latex = new TLatex(0.59, 0.58, str2);
10619 latex->SetTextSize(fontSize * 0.38 / 0.31);
10623 latex = new TLatex(0.59, 0.46, "#sqrt{#font[12]{s}_{NN}} = 2.76 TeV");
10624 latex->SetTextSize(fontSize * 0.38 / 0.31);
10628 latex = new TLatex(0.43, 0.90, "a) not background subtracted");
10629 latex->SetTextSize(fontSize * 0.38 / 0.31);
10633 latex = new TLatex(0.5, 0.42, "0-5% centrality");
10637 latex = new TLatex(0.45, 0.62, "Stat. uncertainties only");
10643 latex = new TLatex(0.43, 0.90, "b) zoomed");
10644 latex->SetTextSize(fontSize * 0.38 / 0.31);
10650 latex = new TLatex(0.43, 0.90, "c) background subtracted");
10655 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10656 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10660 void DeltaPhiRidgePreliminary(const char* fileName)
10666 Float_t leadingPtArr[] = { 2.0, 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
10667 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
10668 // Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
10669 // Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
10670 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE);
10671 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
10679 gpTMin = assocPtArr[j] + 0.01;
10680 gpTMax = assocPtArr[j+1] - 0.01;
10682 SetupRanges(hMixed);
10685 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+2]);
10688 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
10693 TH1* hist1Peak = 0;
10694 TH1* hist2bPeak = 0;
10695 TH1* hist1Ridge = 0;
10696 TH1* hist2bRidge = 0;
10699 TH1* hist2dMixed = 0;
10701 // GetDistAndFlow(h, 0, &hist2d, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 1);
10702 // GetDistAndFlow(hMixed, 0, &hist2dMixed, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 1);
10704 // //hist2d->Divide(hist2dMixed);
10705 // hist2dMixed->Draw("SURF1");
10707 GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10708 // GetDistAndFlow(h, 0, &hist2b, v2[2], step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10709 GetDistAndFlow(h, hMixed, &hist1Peak, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 10);
10711 GetDistAndFlow(h, hMixed, &hist1Ridge, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 11);
10715 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 800, 800);
10716 canvas->Divide(2, 2);
10719 gPad->SetLeftMargin(0.20);
10721 hist1->GetYaxis()->SetTitleOffset(1.9);
10722 hist1->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
10723 hist1->SetTitle("");
10726 hist1Peak->SetLineColor(2);
10727 hist1Peak->DrawCopy("SAME");
10729 hist1Ridge->SetLineColor(4);
10730 hist1Ridge->DrawCopy("SAME");
10732 // hist1Peak->Add(hist1Ridge);
10733 // hist1Peak->DrawCopy("SAME")->SetLineColor(3);
10737 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);
10739 latex = new TLatex(0.65, 0.84, str);
10741 latex->SetTextSize(0.04);
10744 latex = new TLatex(0.65, 0.90, str2);
10746 latex->SetTextSize(0.04);
10749 latex = new TLatex(0.84, 0.78, "0-5%");
10751 latex->SetTextSize(0.04);
10755 gPad->SetLeftMargin(0.20);
10757 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.18, 0.28);
10758 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10762 latex = new TLatex(0.5, 0.90, "ALICE preliminary");
10763 latex->SetTextSize(0.04);
10767 latex = new TLatex(0.5, 0.84, "Statistical uncertainties only");
10768 latex->SetTextSize(0.04);
10773 gPad->SetLeftMargin(0.20);
10775 hist2b->GetYaxis()->SetTitleOffset(1.9);
10776 hist2b->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
10777 hist2b->SetTitle("");
10778 hist2b->DrawCopy();
10780 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);
10782 latex = new TLatex(0.84, 0.78, "60-90%");
10784 latex->SetTextSize(0.04);
10788 gPad->SetLeftMargin(0.20);
10790 hist2b->DrawCopy()->GetYaxis()->SetRangeUser(0.01, 0.1);
10791 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10795 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10796 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10799 void MCScalingFactor(Int_t caseId)
10802 // x[5]=5, y[5]=0.813743, ex[5]=0, ey[5]=0.158446
10803 // x[5]=5, y[5]=1.09804, ex[5]=0, ey[5]=0.265434
10805 // x[5]=5, y[5]=1.02276, ex[5]=0, ey[5]=0.0199991
10806 // x[5]=5, y[5]=0.870247, ex[5]=0, ey[5]=0.0294444
10808 Float_t factors[] = { 0.814, 1.098, 1.022, 0.870 };
10809 Float_t errors[] = { 0.158, 0.265, 0.020, 0.029 };
10813 for (Int_t i=0; i<2; i++)
10818 avgs[i] = factors[2*i] / errors[2*i] / errors[2*i] + factors[2*i+1] / errors[2*i+1] / errors[2*i+1];
10819 avgs[i] /= 1. / errors[2*i] / errors[2*i] + 1. / errors[2*i+1] / errors[2*i+1];
10823 avgs[i] = factors[2*i];
10827 avgs[i] = factors[2*i+1];
10831 avgs[0] = factors[0];
10832 avgs[1] = factors[3];
10836 avgs[0] = factors[1];
10837 avgs[1] = factors[2];
10842 Float_t a = avgs[0];
10843 Float_t b = avgs[1];
10845 Printf("%f %f", a, b);
10847 Float_t linEx = a + (b-a)/(7.-0.9) * (2.76-0.9);
10848 Float_t logEx = a + (b-a)/(log(7.)-log(0.9)) * (log(2.76)-log(0.9));
10850 Printf("%f %f", linEx, logEx);
10853 void CompareDeltaPhi(const char* fileName1, const char* fileName2, Int_t centralityID, const char* dist = "_fit_flat", Bool_t reduced = kFALSE)
10855 firstFile = TFile::Open(fileName1);
10856 secondFile = TFile::Open(fileName2);
10858 Int_t maxLeadingPt = 2;
10859 Int_t maxAssocPt = 7;
10860 Int_t minLeadingPt = 0;
10861 Int_t minAssocPt = 0;
10871 TCanvas* canvas = new TCanvas(Form("%s %s", fileName1, fileName2 ? fileName2 : ""), Form("%s %s", fileName1, fileName2 ? fileName2 : ""), 1000, 700);
10872 canvas->Divide(maxAssocPt-minAssocPt, maxLeadingPt-minLeadingPt);
10874 for (Int_t i=minLeadingPt; i<maxLeadingPt; i++)
10875 for (Int_t j=minAssocPt; j<maxAssocPt; j++)
10877 Printf("%d %d", i, j);
10879 canvas->cd(j+1-minAssocPt + (i-minLeadingPt) * maxAssocPt);
10880 gPad->SetLeftMargin(0.15);
10881 gPad->SetBottomMargin(0.2);
10882 //gPad->SetTopMargin(0.01);
10883 gPad->SetRightMargin(0.01);
10885 hist1 = (TH1*) firstFile->Get(Form("dphi_%d_%d_%d%s", i, j, centralityID, dist));
10886 hist2 = (TH1*) secondFile->Get(Form("dphi_%d_%d_%d%s", i, j, centralityID, dist));
10891 /* hist1->Rebin(2); hist1->Scale(0.5);
10892 hist2->Rebin(2); hist2->Scale(0.5); */
10893 // hist1->Scale(1.6);
10895 hist1->SetLineColor(1);
10896 hist2->SetLineColor(2);
10898 hist1->DrawCopy()->GetYaxis()->SetRangeUser(hist1->GetMinimum(), hist1->GetMaximum() * 1.2);
10899 hist2->DrawCopy("SAME");
10901 /* if (strlen(dist) == 0)
10902 Printf("chi2 test: %f", hist1->Chi2Test(hist2, "UU NORM CHI2/NDF"));*/
10904 //DrawRatio(hist1, hist2, hist1->GetTitle());
10910 TH1* MACHCone(const char* fileName, Int_t centrality, const char* drawingOption, Bool_t plotContributions, Int_t twoD, TF1** flowFuncP = 0)
10914 TFile::Open("machcone_input.root");
10916 switch (centrality)
10919 hist = (TH1*) gFile->Get("dphi_0_0_0");
10923 hist = (TH1*) gFile->Get("dphi_1_1_0");
10927 hist = (TH1*) gFile->Get("dphi_0_0_2");
10931 hist = (TH1*) gFile->Get("dphi_1_1_2");
10939 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
10940 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
10942 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
10943 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
10944 // Float_t assocPtArr[] = { 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
10946 Int_t i = centrality % 2;
10951 gpTMin = assocPtArr[i] + 0.01;
10952 gpTMax = assocPtArr[i+1] - 0.01;
10954 Int_t centralityBegin = 0;
10955 Int_t centralityEnd = 1;
10957 if (centrality >= 2)
10959 centralityBegin = 30;
10960 centralityEnd = 40;
10964 SetupRanges(hMixed);
10974 Bool_t scaleToPairs = 0;
10976 GetDistAndFlow(h, hMixed, &hist, 0, step, centralityBegin, centralityEnd, leadingPtArr[j] + 0.01, leadingPtArr[j+1] - 0.01, twoD, kTRUE, vn, scaleToPairs);
10977 if (scaleToPairs && twoD == 11)
10980 Printf("%f %f %f", vn[2], vn[3], vn[4]);
10982 // mirror delta phi to improve stats
10985 for (Int_t bin=1; bin<=hist->GetNbinsX(); bin++)
10987 if (hist->GetBinCenter(bin) < 0 || hist->GetBinCenter(bin) > TMath::Pi())
10989 if (hist->GetBinCenter(bin) < 0)
10990 Int_t bin2 = hist->FindBin(-1.0 * hist->GetBinCenter(bin));
10992 Int_t bin2 = hist->FindBin(TMath::TwoPi() - hist->GetBinCenter(bin));
10994 Float_t combValue = hist->GetBinContent(bin) / hist->GetBinError(bin) / hist->GetBinError(bin) + hist->GetBinContent(bin2) / hist->GetBinError(bin2) / hist->GetBinError(bin2);
10996 Float_t weight = 1. / hist->GetBinError(bin) / hist->GetBinError(bin) + 1. / hist->GetBinError(bin2) / hist->GetBinError(bin2);
10997 combValue /= weight;
10999 Float_t combError = TMath::Sqrt(1.0 / weight);
11001 hist->SetBinContent(bin2, combValue);
11002 hist->SetBinError(bin2, combError);
11004 hist->SetBinContent(bin, combValue);
11005 hist->SetBinError(bin, combError);
11007 Printf("%d %d %f %f", bin, bin2, combValue, combError);
11013 TString str(hist->GetTitle());
11014 str.ReplaceAll(" - ", "#");
11015 tokens = str.Tokenize("#");
11016 hist->SetTitle("");
11018 hist->SetLineColor(1);
11019 hist->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
11020 hist->SetXTitle("#Delta#phi (rad)");
11021 hist = (TH1*) hist->Clone();
11022 if (!drawingOption)
11025 hist = hist->DrawCopy(drawingOption);
11027 for (Int_t i=0; i<tokens->GetEntries()-1; i++)
11029 if (centrality == 1)
11030 latex = new TLatex(0.6, 0.9 - i*0.05 - gPad->GetTopMargin(), tokens->At(i)->GetName());
11032 latex = new TLatex(0.6, 0.12 - i*0.05, tokens->At(i)->GetName());
11035 latex->SetTextSize(0.04);
11039 TF1* flowFunc = new TF1("flowFunc", "[0] * (1+2*[1]*cos(2*x)+2*[2]*cos(3*x)+2*[3]*cos(4*x)+2*[4]*cos(5*x))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
11040 //flowFunc->SetLineWidth(1);
11041 flowFunc->SetLineColor(2);
11042 flowFunc->SetLineStyle(2);
11043 for (Int_t i=0; i<4; i++)
11044 flowFunc->FixParameter(i+1, vn[i+1]);
11045 //flowFunc->SetParameter(0, 84.95); flowFunc->DrawClone("SAME");
11047 //flowFunc->SetParameter(0, 85.4); flowFunc->DrawClone("SAME");
11048 //flowFunc->SetParameter(0, 85.6); flowFunc->DrawClone("SAME");
11050 // hist->Fit(flowFunc, "", "SAME", 1.8, 4.5);
11051 hist->Fit(flowFunc, "N", "", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
11052 hist->GetYaxis()->SetRangeUser(hist->GetMinimum() * 0.95, hist->GetMaximum() * 1.05);
11053 flowFunc->SetRange(-0.5 * TMath::Pi(), 1.5 * TMath::Pi());
11054 flowFunc->Draw("SAME");
11057 *flowFuncP = flowFunc;
11059 //hist->GetYaxis()->SetRangeUser(84, 89);
11060 //flowFunc->SetParameter(4, 1);
11064 for (Int_t bin=hist->FindBin(1.8); bin<=hist->FindBin(4.5); bin++)
11066 chi2 += TMath::Power((hist->GetBinContent(bin) - flowFunc->Eval(hist->GetBinCenter(bin))) / hist->GetBinError(bin), 2);
11068 //Printf("%f", TMath::Power((hist->GetBinContent(bin) - flowFunc->Eval(hist->GetBinCenter(bin))) / hist->GetBinError(bin), 2));
11073 Printf("chi2/ndf = %f", chi2);
11075 if (!plotContributions)
11078 for (Int_t n=1; n<=5; n++)
11080 flowFuncPart = new TF1("flowFuncPart", "[0] * (1+2*[1]*cos([2]*x))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
11081 flowFuncPart->SetParameters(flowFunc->GetParameter(0), vn[n-1], n);
11082 flowFuncPart->SetLineWidth(1);
11083 flowFuncPart->SetLineStyle(n);
11084 flowFuncPart->Draw("SAME");
11090 void MACHConeAll(const char* fileName)
11096 c = new TCanvas("c", "c", 300, 800);
11097 c->SetTopMargin(0);
11098 c->SetLeftMargin(0);
11099 c->SetRightMargin(0);
11100 c->SetBottomMargin(0);
11101 c->Divide(1, 2, 0, 0);
11103 Float_t rangesMin[] = { 136.1, 17.45, 18, 2.4 };
11104 Float_t rangesMax[] = { 139.4, 18.95, 23.5, 3.6 };
11106 for (Int_t i=0; i<2; i++)
11110 gPad->SetRightMargin(0.05);
11111 gPad->SetLeftMargin(0.20);
11112 gPad->SetTopMargin(0.15);
11113 gPad->SetBottomMargin(0.15);
11117 gPad->SetBottomMargin(0.01);
11121 gPad->SetTopMargin(0.01);
11122 gPad->SetBottomMargin(0.7);
11131 // hist = MACHCone(fileName, i, "", kTRUE, 0, &flowFunc);
11132 hist = (TH1*) MACHCone(fileName, i, 0, kFALSE, 0)->Clone("hist");
11133 hist->GetYaxis()->SetRangeUser(rangesMin[i], rangesMax[i]);
11134 hist->GetYaxis()->SetTitleOffset(1.7);
11140 // hist2 = MACHCone(fileName, i, 0, kFALSE, 11);
11141 hist2 = MACHCone(fileName, i, "SAME", kTRUE, 11, &flowFunc);
11142 //hist2->GetYaxis()->SetRangeUser(rangesMin[i], rangesMax[i]);
11143 // hist2->Scale(2);
11144 hist2->SetLineColor(4);
11145 //hist2->Draw("SAME");
11148 // sample flowFunc with same binning
11149 flowFuncHist = (TH1*) hist->Clone("flowFuncHist");
11150 flowFuncHist->Reset();
11152 for (Int_t i=1; i<=flowFuncHist->GetNbinsX(); i++)
11154 flowFuncHist->SetBinContent(i, flowFunc->Integral(flowFuncHist->GetXaxis()->GetBinLowEdge(i), flowFuncHist->GetXaxis()->GetBinUpEdge(i)));
11155 flowFuncHist->SetBinError(i, 0);
11160 flowFuncHist->Scale(1.0 / flowFuncHist->GetBinWidth(1));
11163 // flowFuncHist->Draw();
11164 // flowFunc->Draw("SAME");
11168 residuals = (TH1*) hist->Clone("res1");
11169 residuals->SetYTitle("Residuals");
11170 residuals->Divide(flowFuncHist);
11173 residuals->GetYaxis()->SetNdivisions(505);
11174 residuals->GetYaxis()->SetRangeUser(0.995, 1.005);
11176 residuals = (TH1*) hist2->Clone("res2");
11177 residuals->Divide(flowFuncHist);
11179 residuals->SetLineColor(4);
11180 residuals->Draw("SAME");
11186 legend = new TLegend(0.43, 0.66, 0.91, 0.82);
11187 legend->SetFillColor(0);
11188 legend->SetTextSize(0.034);
11189 legend->SetTextAlign(22);
11191 legend->SetHeader("Centrality 0-1%");
11192 legend->AddEntry(hist, "|#eta| < 0.8 & All #Delta#eta", "L");
11193 legend->AddEntry(hist2, "|#eta| < 0.8 & |#Delta#eta| > 0.8 (2x)", "L");
11199 c->SaveAs(Form("machcone_%d.png", 0));
11200 c->SaveAs(Form("machcone_%d.eps", 0));
11201 c->SaveAs(Form("machcone_%d.C", 0));
11206 MACHCone(3, "", kTRUE)->SetTitle("");
11209 hist1 = MACHCone(0, "", kFALSE);
11210 hist2 = MACHCone(1, "SAME", kFALSE);
11211 hist3 = MACHCone(2, "SAME", kFALSE);
11213 hist1->SetTitle("");
11214 hist1->GetYaxis()->SetRangeUser(1, 7);
11217 void SetFlowStyle()
11219 // Set style which will affect all plots.
11222 // gStyle->SetOptitle(0);
11223 // gStyle->SetOptStat(0);
11224 //gStyle->SetOptDate(1);
11225 // gStyle->SetPalette(8,0); // (1,0)
11226 gStyle->SetPalette(1); // (1,0)
11227 gStyle->SetDrawBorder(0);
11228 // gStyle->SetFillColor(0); // kills palete ???
11229 gStyle->SetCanvasColor(0);
11230 gStyle->SetPadColor(0);
11231 // gStyle->SetFillColor(0); // otherwize it affects Fill colors later
11232 gStyle->SetFrameFillColor(0);
11233 gStyle->SetCanvasBorderMode(0);
11234 gStyle->SetFrameLineWidth(2);
11235 // gStyle->SetFrameFillStyle(4000);
11236 gStyle->SetPadBorderMode(0);
11237 gStyle->SetPadTickX(1);
11238 gStyle->SetPadTickY(1);
11239 gStyle->SetPadBottomMargin(0.15);
11240 gStyle->SetPadLeftMargin(0.15);
11241 gStyle->SetHistLineWidth(2);
11242 gStyle->SetFuncWidth(2);
11243 gStyle->SetLineWidth(2);
11244 gStyle->SetLabelSize(0.05,"xyz");
11245 gStyle->SetLabelOffset(0.01,"y");
11246 gStyle->SetLabelColor(kBlack,"xyz");
11247 gStyle->SetTitleSize(0.06,"xyz");
11248 gStyle->SetTitleOffset(1.3,"y");
11249 gStyle->SetTitleFillColor(0);
11250 gStyle->SetLineWidth(2);
11251 gStyle->SetHistLineColor(1);
11252 gStyle->SetTextColor(1);
11253 gStyle->SetTitleTextColor(1);
11254 TGaxis::SetMaxDigits(4);
11255 gStyle->SetOptStat(0); // removes stat. box from all histos
11256 gROOT->ForceStyle();
11258 } // end of void SetFlowStyle()
11260 void PlotPtDistributionsSubtracted(const char* fileName1, Int_t centrBegin = 1, Int_t centrEnd = 6, Int_t fit = 0)
11264 Int_t nCentralityBins = 5;
11265 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
11267 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
11269 TCanvas* canvas = new TCanvas("Pt", "Pt", 1000, 1000);
11270 canvas->Divide(2, 2);
11272 TLegend* legend = new TLegend(0.3, 0.8, 0.99, 0.99);
11273 legend->SetFillColor(0);
11275 Int_t colors[] = { 1, 2, 4, 6, 3, 5 };
11276 Int_t markers[] = { 20, 21, 22, 23, 24, 25 };
11278 Double_t ptMin = 10.01;
11279 Double_t ptMax = 39.99;
11282 str.Form("%.1f < p_{T,trig} < %.1f", ptMin - 0.01, ptMax + 0.01);
11285 gPad->SetLeftMargin(0.15);
11286 gPad->SetBottomMargin(0.2);
11287 gPad->SetTopMargin(0.01);
11288 gPad->SetRightMargin(0.01);
11294 TH2F* dummy = new TH2F("dummy", "", 100, 1, 40, 100, 1e-5, 1e3);
11295 dummy->SetStats(kFALSE);
11296 dummy->SetXTitle("p_{T,assoc}");
11297 dummy->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
11298 dummy->GetYaxis()->SetTitleOffset(1);
11299 Prepare1DPlot(dummy);
11301 dummy->GetXaxis()->SetLabelSize(0.05);
11302 dummy->GetYaxis()->SetLabelSize(0.05);
11303 dummy->GetXaxis()->SetTitleSize(0.05);
11304 dummy->GetYaxis()->SetTitleSize(0.05);
11308 gPad->SetLeftMargin(0.15);
11309 gPad->SetBottomMargin(0.2);
11310 gPad->SetTopMargin(0.01);
11311 gPad->SetRightMargin(0.01);
11319 gPad->SetLeftMargin(0.15);
11320 gPad->SetBottomMargin(0.2);
11321 gPad->SetTopMargin(0.01);
11322 gPad->SetRightMargin(0.01);
11327 dummy = new TH2F("dummy2", "", 100, 1, 40, 100, 0, 100);
11328 dummy->SetStats(kFALSE);
11329 dummy->SetXTitle("p_{T,assoc}");
11330 dummy->SetYTitle("Ratio: Distribution / Inclusive");
11331 dummy->GetYaxis()->SetTitleOffset(1);
11332 Prepare1DPlot(dummy);
11333 dummy->GetXaxis()->SetLabelSize(0.05);
11334 dummy->GetYaxis()->SetLabelSize(0.05);
11335 dummy->GetXaxis()->SetTitleSize(0.05);
11336 dummy->GetYaxis()->SetTitleSize(0.05);
11340 gPad->SetLeftMargin(0.15);
11341 gPad->SetBottomMargin(0.2);
11342 gPad->SetTopMargin(0.01);
11343 gPad->SetRightMargin(0.01);
11350 // see GetAcceptanceScalingFactor
11351 Float_t scalingFactor = 0.328396; // 0.8
11352 //Float_t scalingFactor = 0.433268; // 0.7
11353 //Float_t scalingFactor = 0.895593; // 0.5 --> 1.6
11355 Float_t phiRange[] = { 0, TMath::Pi() / 2, TMath::Pi() };
11356 const char* phiLabels[] = { "Towards", "Transverse", "Away" };
11358 //Float_t phiSizeTowards = TMath::Pi() / 3;
11359 Float_t phiSizeTowards = 0.75;
11360 //Float_t etaLimit = 0.5;
11361 Float_t etaLimit = 0.8;
11363 towardsCentralEta = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, -etaLimit + 0.01, etaLimit - 0.01);
11364 towardsSideEta1 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, -1.59, -etaLimit - 0.01);
11365 TH1* towardsSideEta2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, etaLimit + 0.01, 1.59);
11366 towardsSideEta1->Add(towardsSideEta2); // TODO can be done smarter? what about the errors?
11368 Prepare1DPlot(towardsSideEta1);
11369 Prepare1DPlot(towardsCentralEta);
11371 towardsCentralEta->SetLineColor(colors[0]);
11372 towardsSideEta1->SetLineColor(colors[3]);
11373 //towardsSideEta1->SetLineStyle(2);
11375 legend->AddEntry(towardsCentralEta->Clone(), Form("Jet, %s: |#Delta#eta| < 0.8, #phi ~ %.1f", phiLabels[0], phiRange[0]));
11376 legend->AddEntry(towardsSideEta1->Clone(), Form("Ridge, %s: 0.8 < |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[0], phiRange[0]));
11378 // TODO update when data with new phi binning is available
11379 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);
11381 transverse2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, -0.5 * TMath::Pi(), -TMath::Pi() / 3, -1.59, 1.59, kTRUE);
11382 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);
11383 transverse->Add(transverse2);
11384 transverse->Add(transverse3);
11385 transverse->Scale(1.0 / (2.0 / 3 * TMath::Pi()));
11388 //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);
11389 //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);
11390 //transverseSideEta1->Add(transverseSideEta2); // TODO can be done smarter? what about the errors?
11392 transverse->SetLineColor(colors[2]);
11393 //transverseSideEta1->SetLineColor(colors[2]);
11394 //transverseSideEta1->SetLineStyle(2);
11396 Prepare1DPlot(transverse);
11397 //Prepare1DPlot(transverseSideEta1);
11398 legend->AddEntry(transverse->Clone(), Form("%s: |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[1], phiRange[1]));
11399 //legend->AddEntry(transverseSideEta1->Clone(), Form("%s: 0.8 < |#Delta #eta| < 1.6, #phi ~ %.1f", phiLabels[1], phiRange[1]));
11401 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);
11404 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);
11405 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);
11406 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);
11410 away->SetLineColor(colors[1]);
11411 //away3->SetLineColor(colors[1]);
11412 //away3->SetLineStyle(2);
11414 Prepare1DPlot(away);
11415 legend->AddEntry(away->Clone(), Form("%s: |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[2], phiRange[2]));
11417 //inclusive = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), -1.59, 1.59);
11420 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1)->SetRange(centrBegin, centrEnd);
11421 inclusive = h->GetUEHist(2)->GetEventHist()->ShowProjection(0, 6);
11422 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1)->SetRange(0, -1);
11425 axis = h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1);
11427 inclusiveTmp = h->GetCorrelationpT()->ProjectionY("inclusiveTmp", h->GetCorrelationpT()->GetXaxis()->FindBin(axis->GetBinLowEdge(centrBegin) + 0.01), h->GetCorrelationpT()->GetXaxis()->FindBin(axis->GetBinUpEdge(centrEnd) - 0.01));
11429 //rebin to match other histograms
11430 //inclusive2 = inclusive->Rebin(away->GetNbinsX(), "inclusive2", away->GetXaxis()->GetXbins()->GetArray());
11432 // manually, as usual the ROOT function makes a SEGV
11433 inclusive = (TH1*) away->Clone("inclusive");
11434 inclusive->Reset();
11435 inclusive->Sumw2();
11436 for (Int_t bin=1; bin<=inclusiveTmp->GetNbinsX(); bin++)
11437 inclusive->Fill(inclusiveTmp->GetBinCenter(bin), inclusiveTmp->GetBinContent(bin));
11439 for (Int_t bin=1; bin<=inclusive->GetNbinsX(); bin++)
11440 inclusive->SetBinError(bin, TMath::Sqrt(inclusive->GetBinContent(bin)));
11442 // normalization: events, phase space
11443 inclusive->Scale(1.0 / h->GetCentralityDistribution()->Integral(centrBegin, centrEnd));
11444 inclusive->Scale(1.0 / (TMath::TwoPi() * 0.8 * 2));
11447 for (Int_t i=1; i<=inclusive->GetNbinsX(); i++)
11449 inclusive->SetBinContent(i, inclusive->GetBinContent(i) / inclusive->GetXaxis()->GetBinWidth(i));
11450 inclusive->SetBinError (i, inclusive->GetBinError(i) / inclusive->GetXaxis()->GetBinWidth(i));
11453 Prepare1DPlot(inclusive);
11454 inclusive->SetLineColor(colors[4]);
11455 legend->AddEntry(inclusive->Clone(), "Inclusive");
11457 //Prepare1DPlot(away3);
11458 //legend->AddEntry(away3->Clone(), Form("%s: 0.8 < |#Delta #eta| < 1.6, #phi ~ %.1f", phiLabels[2], phiRange[2]));
11460 // scale for acceptance to match acceptance of towardsCentralEta
11461 towardsSideEta1->Scale(1.0 / scalingFactor); // contains only "side-eta"
11462 transverse->Scale(1.0 / (1.0 + scalingFactor)); // full eta
11463 away->Scale(1.0 / (1.0 + scalingFactor)); // full eta
11464 inclusive->Scale(1.0 / (1.0 + scalingFactor)); // full eta (phi scaling implicit)
11467 towardsCentralEtaClone = towardsCentralEta->DrawCopy("SAME");
11468 towardsSideEta1Clone = towardsSideEta1->DrawCopy("SAME");
11469 transverseClone = transverse->DrawCopy("SAME");
11470 //transverseSideEta1->DrawCopy("SAME");
11471 awayClone = away->DrawCopy("SAME");
11472 inclusiveClone = inclusive->DrawCopy("SAME");
11473 //inclusive2->DrawCopy("SAME");
11474 //away3->DrawCopy("SAME");
11478 towardsCentralEtaR = (TH1*) towardsCentralEta->Clone("towardsCentralEtaR");
11479 towardsSideEta1R = (TH1*) towardsSideEta1->Clone("towardsSideEta1R");
11480 transverseR = (TH1*) transverse->Clone("transverseR");
11481 awayR = (TH1*) away->Clone("awayR");
11483 towardsCentralEtaR->Divide(inclusive);
11484 towardsSideEta1R->Divide(inclusive);
11485 transverseR->Divide(inclusive);
11486 awayR->Divide(inclusive);
11488 towardsCentralEtaR->DrawCopy("SAME");
11489 towardsSideEta1R->DrawCopy("SAME");
11490 transverseR->DrawCopy("SAME");
11491 awayR->DrawCopy("SAME");
11497 awayClone->Fit("expo", "", "SAME", 1.1, 2.9);
11498 awayClone->GetFunction("expo")->SetRange(1, 10);
11505 func = new TF1("func", "[0] * x**[1]");
11506 func->SetParameters(1, 1);
11508 Float_t limitLow = 2.1;
11509 Float_t limitHigh = 4.9;
11511 func2 = (TF1*) func->Clone();
11512 towardsCentralEtaClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11513 towardsCentralEtaClone->GetFunction("func")->SetRange(1, 10);
11514 towardsCentralEtaClone->GetFunction("func")->SetLineColor(towardsCentralEtaClone->GetLineColor());
11516 func2 = (TF1*) func->Clone();
11517 towardsSideEta1Clone->Fit(func2, "", "SAME", limitLow, limitHigh);
11518 towardsSideEta1Clone->GetFunction("func")->SetRange(1, 10);
11519 towardsSideEta1Clone->GetFunction("func")->SetLineColor(towardsSideEta1Clone->GetLineColor());
11521 func2 = (TF1*) func->Clone();
11522 transverseClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11523 transverseClone->GetFunction("func")->SetRange(1, 10);
11524 transverseClone->GetFunction("func")->SetLineColor(transverseClone->GetLineColor());
11526 func2 = (TF1*) func->Clone();
11527 awayClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11528 awayClone->GetFunction("func")->SetRange(1, 10);
11529 awayClone->GetFunction("func")->SetLineColor(awayClone->GetLineColor());
11531 func2 = (TF1*) func->Clone();
11532 inclusiveClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11533 inclusiveClone->GetFunction("func")->SetRange(1, 10);
11534 inclusiveClone->GetFunction("func")->SetLineColor(inclusiveClone->GetLineColor());
11537 // subtract transverse part
11538 away->Add(transverse, -1);
11539 //away3->Add(transverseSideEta1, -1);
11540 towardsCentralEta->Add(transverse, -1);
11541 towardsSideEta1->Add(transverse, -1);
11542 //inclusive->Add(transverse, -1);
11545 towardsCentralEta->DrawCopy("SAME");
11546 towardsSideEta1->DrawCopy("SAME");
11547 away->DrawCopy("SAME");
11548 inclusive->DrawCopy("SAME");
11549 //away3->DrawCopy("SAME");
11553 towardsCentralEtaR = (TH1*) towardsCentralEta->Clone("towardsCentralEtaR2");
11554 towardsSideEta1R = (TH1*) towardsSideEta1->Clone("towardsSideEta1R2");
11555 awayR = (TH1*) away->Clone("awayR2");
11557 towardsCentralEtaR->Divide(inclusive);
11558 towardsSideEta1R->Divide(inclusive);
11559 awayR->Divide(inclusive);
11561 towardsCentralEtaR->DrawCopy("SAME");
11562 towardsSideEta1R->DrawCopy("SAME");
11563 awayR->DrawCopy("SAME");
11569 away->Fit("expo", "", "SAME", 1.1, 2.9);
11570 away->GetFunction("expo")->SetRange(1, 10);
11577 func = new TF1("func", "[0] * x**[1]");
11578 func->SetParameters(1, 1);
11580 func2 = (TF1*) func->Clone();
11581 towardsCentralEta->Fit(func2, "", "SAME", limitLow, limitHigh);
11582 func2->SetRange(1, 10);
11584 func2 = (TF1*) func->Clone();
11585 towardsSideEta1->Fit(func2, "", "SAME", limitLow, limitHigh);
11586 func2->SetRange(1, 10);
11588 func2 = (TF1*) func->Clone();
11589 away->Fit(func2, "", "SAME", limitLow, limitHigh);
11590 func2->SetRange(1, 10);
11592 func2 = (TF1*) func->Clone();
11593 inclusive->Fit(func2, "", "SAME", limitLow, limitHigh);
11594 func2->SetRange(1, 10);
11597 for (Int_t i=1; i<=2; i++)
11602 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
11603 latex = new TLatex(0.2, 0.3, str3);
11605 latex->SetTextSize(0.06);
11607 latex2 = new TLatex(0.55, 0.6, str);
11609 latex2->SetTextSize(0.06);
11618 void CombineDeltaPhiWithWeighting()
11622 // xsection: 11.879829, ntrials: 8132994.000000
11625 // xsection: 0.623421, ntrials: 2293420.000000
11628 // xsection: 0.043815, ntrials: 1314525.375000
11630 // TODO is merging only same event distribution at present
11635 const char* inputList[] = { "mergejob/LHC11a2a_110124.root", "mergejob/LHC11a2b_110131.root", "mergejob/LHC11a2c_110131.root" };
11637 Float_t xSections[] = { 11.879829 * 1e6 / 8132994, 0.623421 * 1e6 / 2293420, 0.043815 * 1e6 / 1314525 };
11638 xSections[2] /= xSections[0];
11639 xSections[1] /= xSections[0];
11640 xSections[0] /= xSections[0];
11642 AliUEHistograms* files[3];
11643 TList* finalList = 0;
11644 for (Int_t i=0; i<nInput; i++)
11646 files[i] = (AliUEHistograms*) GetUEHistogram(inputList[i], (i == 0) ? &finalList : 0);
11649 files[i]->Scale(xSections[i]);
11651 TList* list2 = new TList;
11652 list2->Add(files[i]);
11653 files[0]->Merge(list2);
11657 TFile* file3 = TFile::Open("out.root", "RECREATE");
11658 file3->mkdir("PWG4_PhiCorrelations");
11659 file3->cd("PWG4_PhiCorrelations");
11660 finalList->Write(0, TObject::kSingleKey);
11664 void NormalizeToBinWidth(TH1* hist)
11667 // normalizes a 1-d histogram to its bin width
11670 if (hist->GetDimension() == 1)
11672 for (Int_t i=1; i<=hist->GetNbinsX(); ++i)
11674 hist->SetBinContent(i, hist->GetBinContent(i) / hist->GetBinWidth(i));
11675 hist->SetBinError(i, hist->GetBinError(i) / hist->GetBinWidth(i));
11678 else if (hist->GetDimension() == 2)
11680 for (Int_t i=1; i<=hist->GetNbinsX(); ++i)
11682 for (Int_t j=1; j<=hist->GetNbinsY(); ++j)
11684 hist->SetBinContent(i, j, hist->GetBinContent(i, j) / hist->GetXaxis()->GetBinWidth(i) / hist->GetYaxis()->GetBinWidth(j));
11685 hist->SetBinError(i, j, hist->GetBinError(i) / hist->GetXaxis()->GetBinWidth(i) / hist->GetYaxis()->GetBinWidth(j));
11691 void GetAcceptanceScalingFactor(const char* fileName1, Float_t eta1 = 0.8, Float_t eta2 = 1.6)
11695 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1, 0, kTRUE);
11696 h->SetPtRange(1.01, 39.99);
11699 mixed = ((TH2*)h->GetUEHist(2)->GetUEHist(6, 0, 1.01, 39.99, 0, 16, kTRUE))->ProjectionY();
11702 Float_t left = mixed->Integral(mixed->FindBin(-eta2 + 0.01), mixed->FindBin(-eta1 - 0.01));
11703 Float_t center = mixed->Integral(mixed->FindBin(-eta1 + 0.01), mixed->FindBin(eta1 - 0.01));
11704 Float_t right = mixed->Integral(mixed->FindBin(eta1 + 0.01), mixed->FindBin(eta2 - 0.01));
11706 Printf("%f %f %f", left, center, right);
11707 Printf("%f", (left + right) / center);
11710 void TrackingEfficiencyCentralityDependence(const char* fileName, Int_t step1 = 2, Int_t step2 = 4)
11712 Int_t nCentralityBins = 3;
11713 Float_t centralityBins[] = { 0, 20, 40, 90 };
11715 Int_t colors[] = { 1, 2, 4, 6 };
11719 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
11722 dummy = new TH2F("dummy", ";p_{T};tracking efficiency", 100, 0, 20, 100, 0.7, 1.3);
11723 dummy->SetStats(0);
11726 legend = new TLegend(0.13, 0.67, 0.31, 0.87);
11727 legend->SetTextSize(0.04);
11728 legend->SetFillColor(0);
11730 for (Int_t i=0; i<nCentralityBins; i++)
11732 eventHist = h->GetUEHist(2)->GetEventHist();
11734 eventHist->GetGrid(step1)->SetRangeUser(1, centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
11735 eventHist->GetGrid(step2)->SetRangeUser(1, centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
11737 TH1* hist1 = eventHist->ShowProjection(0, step1);
11738 TH1* hist2 = eventHist->ShowProjection(0, step2);
11740 hist2->Divide(hist1);
11742 hist2->SetLineColor(colors[i]);
11743 hist2->GetYaxis()->SetTitle("tracking efficiency");
11744 hist2->Draw("SAME");
11746 legend->AddEntry(hist2, Form("%.0f-%.0f%%", centralityBins[i], centralityBins[i+1]));
11753 TGraphErrors* ReadHepdata(const char* fileName, Bool_t errorsAreAdded = kFALSE, Int_t skipYErrors = 0, Int_t skipXerrors = 1)
11755 // expected format: x [x2] [x3] y [ye] [ye2] [xe]
11757 // skipYErrors: 0 --> ye present
11758 // 1 --> no errors ye
11759 // 2 --> y and ye are lower and upper error, i.e. y' = (y + ye) / 2 and ye = (ye - y) / 2
11760 // 3 --> ye and ye2 are stat and syst error, will be added in quadrature
11762 // skipXerrors: 0 --> xe present
11763 // 1 --> no errors xe
11764 // 2 --> x2 present, xe not present and is calculated from x2 - x
11765 // 3 --> x2 and x3 present, ignored
11767 ifstream fin(fileName);
11769 graph = new TGraphErrors(0);
11776 if (fin.peek() == '#')
11778 fin.getline(buffer, 2000);
11790 if (skipXerrors == 2)
11793 xe = (x2 - x + 1) / 2;
11794 x = x + (x2 - x) / 2;
11797 if (skipXerrors == 3)
11808 if (skipYErrors == 0)
11815 else if (skipYErrors == 2)
11822 Double_t newy = (y + ye) / 2;
11826 else if (skipYErrors == 3)
11838 ye = TMath::Sqrt(ye*ye + ye2*ye2);
11841 if (skipXerrors == 0)
11849 //Printf("%f %f %f %f", x, y, xe, ye);
11851 if (errorsAreAdded)
11854 graph->SetPoint(graph->GetN(), x, y);
11855 graph->SetPointError(graph->GetN()-1, xe, ye);
11859 // read rest until end of line...
11860 fin.getline(buffer, 2000);
11864 Printf("%s: %f", fileName, sum);
11869 void EvaluateParticleEfficiency(const char* fileName)
11871 Int_t centralityBegin = 1;
11872 Int_t centralityEnd = 15;
11885 Float_t ptTriggerBegin = 4.01;
11886 Float_t ptTriggerEnd = 19.99;
11888 Bool_t verbose = 1;
11892 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
11893 AliUEHist* cont = h->GetUEHist(2);
11895 cont->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
11896 cont->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
11898 Int_t stepEff1 = step1 - (Int_t) AliUEHist::kCFStepAnaTopology;
11899 if (stepEff1 == -1)
11901 Int_t stepEff2 = step2 - (Int_t) AliUEHist::kCFStepAnaTopology;
11902 if (stepEff2 == -1)
11905 cont->GetTrackHistEfficiency()->GetGrid(stepEff1)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
11906 cont->GetTrackHistEfficiency()->GetGrid(stepEff2)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
11908 TH1* triggerParticle = cont->GetEventHist()->Project(step2, 0);
11909 triggerParticle->Divide(cont->GetEventHist()->Project(step1, 0));
11911 TH1* singleParticle = cont->GetTrackHistEfficiency()->Project(stepEff2, 1);
11912 singleParticle->Divide(cont->GetTrackHistEfficiency()->Project(stepEff1, 1));
11914 //singleParticle = singleParticle->Rebin(triggerParticle->GetNbinsX(), "singleRebin", triggerParticle->GetXaxis()->GetXbins()->GetArray());
11916 TGraphErrors* effectiveEffect = new TGraphErrors;
11917 TGraphErrors* triggerCorrelatedEffect = new TGraphErrors;
11918 TGraphErrors* afterBaseLine = new TGraphErrors;
11919 TGraphErrors* triggerCorrelatedEffect2D = new TGraphErrors;
11921 //TVirtualFitter::SetDefaultFitter("Linear");
11923 for (Int_t bin=3; bin<=triggerParticle->GetNbinsX(); bin++)
11925 if (triggerParticle->GetBinCenter(bin) > 10)
11928 cont->SetPtRange(triggerParticle->GetXaxis()->GetBinLowEdge(bin) + 0.01, triggerParticle->GetXaxis()->GetBinUpEdge(bin) - 0.01);
11930 TH1* hist1 = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd);
11931 TH1* hist2 = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd);
11933 // TODO the uncertainties on the ratios should be properly calculated! (if that helps ;))
11934 clone = (TH1*) hist2->Clone("clone");
11935 clone->Divide(hist1);
11937 //func = new TF1("func", "[0]", -10, 10);
11939 if ((Int_t) clone->Fit("pol0", "0", "", -10, 10) == 0)
11941 func = clone->GetFunction("pol0");
11942 effectiveEffect->SetPoint(effectiveEffect->GetN(), triggerParticle->GetBinCenter(bin) - 0.2, func->GetParameter(0));
11943 effectiveEffect->SetPointError(effectiveEffect->GetN()-1, 0, func->GetParError(0));
11948 clone->GetYaxis()->SetRangeUser(0.9, 1.3);
11950 func->DrawClone("SAME");
11954 if ((Int_t) clone->Fit("pol0", "0", "", -0.3, 0.3) == 0)
11956 func = clone->GetFunction("pol0");
11957 triggerCorrelatedEffect->SetPoint(triggerCorrelatedEffect->GetN(), triggerParticle->GetBinCenter(bin) - 0.1, func->GetParameter(0));
11958 triggerCorrelatedEffect->SetPointError(triggerCorrelatedEffect->GetN()-1, 0, func->GetParError(0));
11962 func->SetLineColor(2);
11963 func->DrawClone("SAME");
11967 if ((Int_t) hist2->Fit("pol0", "0", "", 1, 2) == 0)
11969 func = hist2->GetFunction("pol0");
11970 func->SetRange(-10, 10);
11971 hist2->Add(func, -1);
11973 if ((Int_t) hist1->Fit("pol0", "0", "", 1, 2) == 0)
11975 func = hist1->GetFunction("pol0");
11976 func->SetRange(-10, 10);
11977 hist1->Add(func, -1);
11979 //new TCanvas; hist1->DrawCopy();
11981 hist2->Divide(hist1);
11983 if ((Int_t) hist2->Fit("pol0", "0", "", -0.3, 0.3) == 0)
11985 func = hist2->GetFunction("pol0");
11986 afterBaseLine->SetPoint(afterBaseLine->GetN(), triggerParticle->GetBinCenter(bin) + 0.2, func->GetParameter(0));
11987 afterBaseLine->SetPointError(afterBaseLine->GetN()-1, 0, func->GetParError(0));
11992 hist2->GetYaxis()->SetRangeUser(0.9, 1.3);
11994 func->SetLineColor(4);
11995 func->DrawClone("SAME");
12002 TH2* hist1_2D = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
12003 TH2* hist2_2D = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
12005 //((TH2*)hist1)->Rebin2D(2, 2); ((TH2*)hist2)->Rebin2D(2, 2);
12007 hist2_2D->Divide(hist1_2D);
12012 hist2_2D->Draw("COLZ");
12015 //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));
12018 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);
12020 integral /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
12021 integral /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
12023 error /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
12024 error /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
12026 triggerCorrelatedEffect2D->SetPoint(triggerCorrelatedEffect2D->GetN(), triggerParticle->GetBinCenter(bin) + 0.1, integral);
12027 triggerCorrelatedEffect2D->SetPointError(triggerCorrelatedEffect2D->GetN()-1, 0, error);
12034 triggerParticle->Draw();
12035 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
12037 singleParticle->SetLineColor(2);
12038 //singleParticle->Draw("SAME");
12040 effectiveEffect->SetMarkerStyle(24);
12041 effectiveEffect->Draw("PSAME");
12043 triggerCorrelatedEffect->SetMarkerStyle(25);
12044 triggerCorrelatedEffect->SetMarkerColor(2);
12045 triggerCorrelatedEffect->SetLineColor(2);
12046 triggerCorrelatedEffect->Draw("PSAME");
12048 triggerCorrelatedEffect2D->SetMarkerStyle(27);
12049 triggerCorrelatedEffect2D->SetMarkerColor(3);
12050 triggerCorrelatedEffect2D->SetLineColor(3);
12051 triggerCorrelatedEffect2D->Draw("PSAME");
12053 afterBaseLine->SetMarkerStyle(26);
12054 afterBaseLine->SetMarkerColor(4);
12055 afterBaseLine->SetLineColor(4);
12056 afterBaseLine->Draw("PSAME");
12058 legend = new TLegend(0.66, 0.15, 0.88, 0.38);
12059 legend->SetFillColor(0);
12060 legend->SetTextSize(0.04);
12061 legend->AddEntry(triggerParticle, "trigger", "L");
12062 //legend->AddEntry(singleParticle, "single", "L");
12063 legend->AddEntry(effectiveEffect, "effective", "P");
12064 legend->AddEntry(triggerCorrelatedEffect, "at 0", "P");
12065 legend->AddEntry(triggerCorrelatedEffect2D, "at 0 (2d)", "P");
12066 legend->AddEntry(afterBaseLine, "baseline", "P");
12070 void EvaluateParticleEfficiency2D(const char* fileName)
12072 Int_t centralityBegin = 1;
12073 Int_t centralityEnd = 15;
12086 Bool_t verbose = 0;
12090 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12091 AliUEHist* cont = h->GetUEHist(2);
12093 cont->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
12094 cont->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
12096 Int_t stepEff1 = step1 - (Int_t) AliUEHist::kCFStepAnaTopology;
12097 if (stepEff1 == -1)
12099 Int_t stepEff2 = step2 - (Int_t) AliUEHist::kCFStepAnaTopology;
12100 if (stepEff2 == -1)
12103 cont->GetTrackHistEfficiency()->GetGrid(stepEff1)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
12104 cont->GetTrackHistEfficiency()->GetGrid(stepEff2)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
12106 TH1* triggerParticle = cont->GetEventHist()->Project(step2, 0);
12107 triggerParticle->Divide(cont->GetEventHist()->Project(step1, 0));
12109 TH1* singleParticle = cont->GetTrackHistEfficiency()->Project(stepEff2, 1);
12110 singleParticle->Divide(cont->GetTrackHistEfficiency()->Project(stepEff1, 1));
12112 cont->GetTrackHist(0)->GetGrid(step1)->SetRangeUser(0, -0.01, 0.01); // delta eta
12113 cont->GetTrackHist(0)->GetGrid(step1)->SetRangeUser(4, -0.01, 0.01); // delta phi
12114 TH2* tracksStep1 = (TH2*) cont->GetTrackHist(0)->Project(step1, 1, 2);
12116 cont->GetTrackHist(0)->GetGrid(step2)->SetRangeUser(0, -0.01, 0.01); // delta eta
12117 cont->GetTrackHist(0)->GetGrid(step2)->SetRangeUser(4, -0.01, 0.01); // delta phi
12118 TH2* tracksStep2 = (TH2*) cont->GetTrackHist(0)->Project(step2, 1, 2);
12120 tracksStep2->Divide(tracksStep1);
12122 TH1* triggersStep1 = cont->GetEventHist()->Project(step1, 0);
12123 TH1* triggersStep2 = cont->GetEventHist()->Project(step2, 0);
12125 for (Int_t x=1; x<=tracksStep2->GetNbinsX(); x++)
12126 for (Int_t y=1; y<=tracksStep2->GetNbinsY(); y++)
12127 if (singleParticle->GetBinContent(x) > 0)
12128 tracksStep2->SetBinContent(x, y, tracksStep2->GetBinContent(x, y) / triggersStep2->GetBinContent(y) * triggersStep1->GetBinContent(y) / singleParticle->GetBinContent(x));
12130 tracksStep2->SetBinContent(x, y, 0);
12133 tracksStep2->Draw("COLZ");
12135 TGraphErrors** triggerCorrelatedEffect2D = new TGraphErrors*[triggerParticle->GetNbinsX()+1];
12136 TGraphErrors** triggerCorrelatedEffect2DSub = new TGraphErrors*[triggerParticle->GetNbinsX()+1];
12138 for (Int_t bin1=0; bin1<=triggerParticle->GetNbinsX(); bin1++)
12140 triggerCorrelatedEffect2D[bin1] = 0;
12141 triggerCorrelatedEffect2DSub[bin1] = 0;
12144 for (Int_t bin1=5; bin1<=triggerParticle->GetNbinsX(); bin1++)
12146 if (triggerParticle->GetBinCenter(bin1) > 10)
12149 Float_t ptTriggerBegin = triggerParticle->GetXaxis()->GetBinLowEdge(bin1) + 0.01;
12150 Float_t ptTriggerEnd = triggerParticle->GetXaxis()->GetBinUpEdge(bin1) - 0.01;
12152 for (Int_t bin2=3; bin2<=triggerParticle->GetNbinsX(); bin2++)
12154 if (triggerParticle->GetBinCenter(bin2) > 8)
12160 cont->SetPtRange(triggerParticle->GetXaxis()->GetBinLowEdge(bin2) + 0.01, triggerParticle->GetXaxis()->GetBinUpEdge(bin2) - 0.01);
12163 TH2* hist1_2D = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
12164 TH2* hist2_2D = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
12166 //((TH2*)hist1)->Rebin2D(2, 2); ((TH2*)hist2)->Rebin2D(2, 2);
12168 hist2_2D->Divide(hist1_2D);
12173 hist2_2D->Draw("COLZ");
12176 //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));
12179 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);
12181 integral /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
12182 integral /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
12184 error /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
12185 error /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
12190 if (!triggerCorrelatedEffect2D[bin1])
12191 triggerCorrelatedEffect2D[bin1] = new TGraphErrors;
12193 triggerCorrelatedEffect2D[bin1]->SetPoint(triggerCorrelatedEffect2D[bin1]->GetN(), triggerParticle->GetBinCenter(bin2) - 0.5 + 0.1 * bin1, integral);
12194 triggerCorrelatedEffect2D[bin1]->SetPointError(triggerCorrelatedEffect2D[bin1]->GetN()-1, 0, error);
12196 if (!triggerCorrelatedEffect2DSub[bin1])
12197 triggerCorrelatedEffect2DSub[bin1] = new TGraphErrors;
12199 triggerCorrelatedEffect2DSub[bin1]->SetPoint(triggerCorrelatedEffect2DSub[bin1]->GetN(), triggerParticle->GetBinCenter(bin2) - 0.5 + 0.1 * bin1, integral / triggerParticle->GetBinContent(bin2));
12200 triggerCorrelatedEffect2DSub[bin1]->SetPointError(triggerCorrelatedEffect2DSub[bin1]->GetN()-1, 0, error / triggerParticle->GetBinContent(bin2));
12211 triggerParticle->Draw();
12212 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
12214 legend = new TLegend(0.66, 0.15, 0.88, 0.38);
12215 legend->SetFillColor(0);
12216 legend->SetTextSize(0.04);
12217 legend->AddEntry(triggerParticle, "trigger", "L");
12222 for (Int_t bin1=3; bin1<=triggerParticle->GetNbinsX(); bin1++)
12223 if (triggerCorrelatedEffect2D[bin1])
12225 triggerCorrelatedEffect2D[bin1]->SetMarkerStyle(marker++);
12226 triggerCorrelatedEffect2D[bin1]->SetMarkerColor(color);
12227 triggerCorrelatedEffect2D[bin1]->SetLineColor(color++);
12228 triggerCorrelatedEffect2D[bin1]->Draw("PSAME");
12229 legend->AddEntry(triggerCorrelatedEffect2D[bin1], Form("pt %.2f", triggerParticle->GetBinCenter(bin1)), "P");
12235 triggerParticle->Draw();
12236 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
12241 for (Int_t bin1=3; bin1<=triggerParticle->GetNbinsX(); bin1++)
12242 if (triggerCorrelatedEffect2DSub[bin1])
12244 triggerCorrelatedEffect2DSub[bin1]->SetMarkerStyle(marker++);
12245 triggerCorrelatedEffect2DSub[bin1]->SetMarkerColor(color);
12246 triggerCorrelatedEffect2DSub[bin1]->SetLineColor(color++);
12247 triggerCorrelatedEffect2DSub[bin1]->Draw("PSAME");
12253 void DrawEventCount(const char* fileName, Int_t step = 8)
12257 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12258 h->GetEventCount()->Draw("TEXT");
12260 eventCount = h->GetEventCount();
12261 Float_t events = eventCount->Integral(eventCount->GetXaxis()->FindBin(step), eventCount->GetXaxis()->FindBin(step), eventCount->GetYaxis()->FindBin(0.01 + 1), eventCount->GetYaxis()->FindBin(-0.01 + 10));
12262 Printf("Events: %f", events);
12265 void FitDCADistributions(const char* fileName1)
12269 TFile::Open(fileName1);
12270 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
12271 prim = (TH2*) list->FindObject("fDCAPrimaries");
12272 sec = (TH2*) list->FindObject("fDCASecondaries");
12274 Float_t zCut = 0.5;
12276 TH2* histList[] = { prim, sec };
12281 for (Int_t i=0; i<2; i++)
12288 // hist = histList[i]->ProjectionX("proj", prim->GetYaxis()->FindBin(-zCut), prim->GetYaxis()->FindBin(zCut))->DrawCopy("");
12289 hist = histList[i]->ProjectionY("proj", prim->GetXaxis()->FindBin(-zCut), prim->GetXaxis()->FindBin(zCut))->DrawCopy("");
12292 func = new TF1("func", "gaus(0)+gaus(3)");
12293 func->SetParameters(1e6, 0, 0.02, 1e3, 0, 2);
12294 func->FixParameter(1, 0);
12295 func->FixParameter(4, 0);
12296 func->SetParLimits(2, 0, 0.1);
12297 func->SetParLimits(5, 1, 3);
12299 hist->Fit(func, "", "", -2, 2);
12301 func2 = new TF1("func2", "gaus(0)");
12302 func2->SetParameters(1e3, 0, 2);
12303 func2->FixParameter(1, 0);
12304 func2->SetParLimits(2, 0.5, 5);
12306 hist->Fit(func2, "+", "", -2, -1);
12307 func2->SetRange(-3, 3);
12308 func2->Draw("SAME");
12314 void CompareDCADistributions(const char* fileName1, const char* fileName2)
12316 TFile::Open(fileName1);
12317 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
12318 prim = (TH2*) list->FindObject("fDCAPrimaries");
12319 sec = (TH2*) list->FindObject("fDCASecondaries");
12321 TFile::Open(fileName2);
12322 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
12323 all = (TH2*) list->FindObject("fDCAPrimaries");
12325 Float_t zCut = 3.2;
12327 TH2* histList[] = { prim, sec, all };
12338 for (Int_t i=0; i<3; i++)
12340 hist = histList[i]->ProjectionX("proj", prim->GetYaxis()->FindBin(-zCut), prim->GetYaxis()->FindBin(zCut))->DrawCopy(i>0?"SAME":"");
12342 //hist = histList[i]->ProjectionY("proj", prim->GetXaxis()->FindBin(-zCut), prim->GetXaxis()->FindBin(zCut))->DrawCopy(i>0?"SAME":"");
12343 hist->SetLineColor(i+1);
12349 hist->Scale(1.0 / hist->Integral(hist->GetXaxis()->FindBin(-0.5), hist->GetXaxis()->FindBin(0.5)) * count);
12351 count += hist->Integral(hist->GetXaxis()->FindBin(-0.5), hist->GetXaxis()->FindBin(0.5));
12356 ratio = (TH1*) hist->Clone("ratio");
12357 ratio->Add(primProj, -1);
12359 /* for (Int_t i=hist->GetXaxis()->FindBin(-0.1); i<=hist->GetXaxis()->FindBin(0.1); i++)
12360 ratio->SetBinContent(i, 0);*/
12362 for (Int_t i=1; i<=hist->GetNbinsX(); i++)
12363 ratio->SetBinError(i, 0);
12365 ratio->SetLineColor(4);
12366 ratio->DrawCopy("SAME E");
12373 secProj = (TH1*) secProj->Clone();
12376 ratio->Divide(secProj);
12378 /* for (Int_t i=1; i<=hist->GetNbinsX(); i++)
12379 ratio->SetBinError(i, 0);*/
12381 ratio->Draw("HIST");
12382 ratio->GetYaxis()->SetRangeUser(0.7, 1.3);
12384 ratio->Fit("pol0", "0+", "", -5, -1);
12385 ratio->Fit("pol0", "0+", "", 1, 5);
12388 void TrackCuts_CompareParameters(const char* fileName1, const char* fileName2, const char* histName, const char* cutFolder = "cuts_quality_only")
12390 // plotWhich: 0 = only before
12394 // mirror: kTRUE --> project negative values on the positive side
12396 Int_t plotWhich = 0;
12397 Bool_t mirror = kFALSE;
12400 files[0] = TFile::Open(fileName1);
12401 files[1] = TFile::Open(fileName2);
12404 Int_t colors[] = { 1, 2, 3, 4, 5, 6 };
12406 TLegend* legend = new TLegend(0.7, 0.85, 0.93, 0.98);
12407 legend->SetTextSize(0.04);
12408 legend->SetFillColor(0);
12410 TCanvas* c1 = new TCanvas(histName, histName, 1200, 600);
12412 //TCanvas* c2 = new TCanvas("c2", "c2", 800, 600);
12413 //TCanvas* c3 = new TCanvas("c3", "c3", 800, 600);
12415 const char* folders2[] = { "before_cuts", "after_cuts" };
12416 const char* names[] = { "MC", "Data" };
12417 Bool_t first = kTRUE;
12418 for (Int_t j = ((plotWhich < 2) ? 0 : 1); j < ((plotWhich > 0) ? 2 : 1); j++)
12422 for (Int_t i = 0; i < 2; i++)
12424 Printf("%d %d", j, i);
12426 folder.Form("%s/%s/%s", cutFolder, folders2[j], histName);
12427 TH1* hist = (TH1*) files[i]->Get(folder);
12431 for (Int_t bin=1; bin<=hist->GetXaxis()->FindBin(-0.0001); bin++)
12433 Int_t newBin = hist->GetXaxis()->FindBin(-hist->GetXaxis()->GetBinCenter(bin));
12436 hist->Fill(-hist->GetXaxis()->GetBinCenter(bin), hist->GetBinContent(bin));
12437 hist->SetBinContent(bin, 0);
12442 legend->AddEntry(hist, Form("%s %s", names[i], (plotWhich == 1) ? folders2[j] : " "));
12445 hist->SetLineColor(colors[count]);
12446 hist->Scale(1.0 / hist->Integral());
12448 hist->DrawCopy((count == 0) ? "" : "SAME");
12452 case 0: base = hist; break;
12453 case 1: base2 = hist; break;
12460 ratio->Divide(base2);
12462 ratio->GetYaxis()->SetRangeUser(0, 2);
12465 ratio->DrawCopy((first) ? "" : "SAME");
12469 c1->cd(1)->SetLogy();
12470 c1->cd(1)->SetGridx();
12471 c1->cd(1)->SetGridy();
12474 c1->cd(2)->SetGridx();
12475 c1->cd(2)->SetGridy();
12477 c1->SaveAs(Form("%s.png", histName));
12480 void PlotQA(const char* fileName, const char* tag = "")
12484 if (!gGrid && TString(fileName).BeginsWith("alien://"))
12485 TGrid::Connect("alien://");
12487 TFile::Open(fileName);
12490 Int_t runNumber = 0;
12491 list = (TList*) gFile->Get("PhysSel");
12494 physSel = (AliPhysicsSelection*) list->FindObject("AliPhysicsSelection");
12495 // runNumber = physSel->GetCurrentRun();
12498 TString tmp(fileName);
12499 tmp.ReplaceAll("alien:///alice/cern.ch/user/j/jgrosseo/gridjob/dir_", "");
12500 tmp.ReplaceAll(".root", ".png");
12501 tmp.ReplaceAll("/", "-");
12503 title.Form("QA_%d_%s", runNumber, tmp.Data());
12504 c = new TCanvas(title, title, 1200, 800);
12508 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
12511 prim = (TH2*) list->FindObject("fDCAPrimaries");
12512 dcaxy = prim->ProjectionX("dcaxy", prim->GetYaxis()->FindBin(-3.2), prim->GetYaxis()->FindBin(3.2));
12513 dcaz = prim->ProjectionY("dcaz", prim->GetXaxis()->FindBin(-2.4), prim->GetXaxis()->FindBin(2.4));
12514 centrCorr = (TH2*) list->FindObject("fCentralityCorrelation");
12516 c->cd(1); dcaxy->Draw(); dcaz->SetLineColor(2); dcaz->Draw("SAME"); gPad->SetLogy();
12517 c->cd(6); centrCorr->Draw("COLZ"); gPad->SetLogz();
12519 cuts = (AliESDtrackCuts*) list->FindObject("cuts_quality_dca");
12522 cluster = cuts->GetNClustersTPC(1);
12523 c->cd(3); cluster->Draw();
12525 ptall = (TH1F*) cuts->GetPtHist(1)->Clone("ptall");
12526 if (ptall->Integral() > 0)
12527 ptall->Scale(1.0 / ptall->Integral());
12533 check_its = (AliESDtrackCuts*) list->FindObject("check_its");
12536 ptIts = (TH1F*) check_its->GetPtHist(1)->Clone("ptIts");
12537 if (ptIts->Integral() > 0)
12538 ptIts->Scale(1.0 / ptIts->Integral());
12542 global_cuts = (AliESDtrackCuts*) list->FindObject("global_cuts");
12545 ptItsAcc = (TH1*) global_cuts->GetPtHist(1)->Clone("ptItsAcc");
12546 if (ptItsAcc->Integral() > 0)
12547 ptItsAcc->Scale(1.0 / ptItsAcc->Integral());
12552 ptIts->SetLineColor(2);
12553 ptIts->Draw("SAME");
12558 ptItsAcc->SetLineColor(4);
12559 ptItsAcc->Draw("SAME");
12567 list = (TList*) gFile->Get("CentralityStat");
12568 TH1* centrQuality = 0;
12571 centrQuality = (TH1*) list->FindObject("fHOutQuality");
12573 c->cd(4); if (centrQuality) centrQuality->Draw();
12577 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE, tag);
12579 if (h->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetNbins() == 0)
12581 Printf("We have %d axes", ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0)->GetNVar()));
12583 // ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
12584 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->FillParent();
12585 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
12587 centr = h->GetCentralityDistribution();
12588 NormalizeToBinWidth(centr);
12589 Int_t events = (Int_t) h->GetEventCount()->ProjectionX()->GetBinContent(3);
12590 Int_t mergeCount = h->GetMergeCount();
12592 h->SetPtRange(1.01, 3.99);
12593 dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, 1.01, 14.99, 1, 8);
12594 if (dphi_corr->GetEntries() == 0)
12595 dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed+2, 0, 1.01, 14.99, 1, 8);
12596 if (dphi_corr->GetEntries() == 0)
12597 dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepAll, 0, 1.01, 14.99, 1, 8);
12599 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE, tag);
12600 if (hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetNbins() == 0)
12602 // ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
12603 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->FillParent();
12606 Float_t ptMin = 0.51;
12607 hMixed->SetPtRange(ptMin, 3.99);
12608 dphi_corr_mixed = hMixed->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, ptMin, 14.99, 1, 8);
12609 if (dphi_corr_mixed->GetEntries() == 0)
12610 dphi_corr_mixed = hMixed->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed+2, 0, ptMin, 14.99, 1, 8);
12611 if (dphi_corr_mixed->GetEntries() == 0)
12612 dphi_corr_mixed = hMixed->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepAll, 0, ptMin, 14.99, 1, 8);
12614 if (runNumber != 0 && runNumber != h->GetRunNumber())
12615 AliFatal("Run numbers inconsistent");
12617 Printf("%d", h->GetRunNumber());
12618 if (runNumber == 0)
12619 runNumber = h->GetRunNumber();
12621 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");
12622 c->cd(5); centr->Draw("HIST");
12625 latex = new TLatex(0.15, 0.8, Form("%d events, %d merged objects", events, mergeCount));
12626 latex->SetTextSize(0.075);
12631 h->GetEventCount()->Draw("TEXT");
12633 title.Form("QA_%d_%s", runNumber, tmp.Data());
12634 c->SetTitle(title);
12638 h->SetPtRange(gpTMin, gpTMax);
12639 hMixed->SetPtRange(gpTMin, gpTMax);
12643 //h->GetUEHist(2)->SetSkipScaleMixedEvent(kTRUE);
12645 if (h->GetUEHist(2)->GetTrackHist(0)->GetNVar() > 5)
12650 GetDistAndFlow(h, 0, &hist1, 0, step, 0, 20, 2.01, 2.99, 1);
12651 hist1->DrawCopy("SURF1");
12654 GetDistAndFlow(hMixed, 0, &hist1, 0, step, 0, 20, 2.01, 2.99, 1);
12655 hist1->DrawCopy("SURF1");
12658 GetSumOfRatios(h, hMixed, &hist1, step, 0, 20, 2.01, 2.99, kTRUE);
12660 hist1->DrawCopy("SURF1");
12663 c->SaveAs(Form("qa/%s", c->GetTitle()));
12666 void GetEventNumber(const char* fileName)
12670 new TCanvas("c1", "", 800, 600);
12674 TFile::Open(fileName);
12675 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12676 centr = h->GetCentralityDistribution();
12677 nEvent = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(59.99));
12679 cout << "Number of events: " << nEvent << endl;
12680 centr->Draw("HIST");
12682 void CompareStepsOnePlot(const char* fileName, Int_t caseId)
12686 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12688 Int_t stepList[] = { 0, 1, 2, 4, 5, 6 };
12689 Int_t stepListNames[] = { 0, 1, 2, 3, 4, 5 };
12691 //const char* names[] = { "All", "PhysSel+Vertex", "Reco Primaries", "Reco "
12692 // //Int_t stepList[] = { 2, 4, 5, 6 };
12695 // TH1* hist1 = h->GetUEHist(2)->GetUEHist(0, 0, 6.01, 9.99, 6, 14);
12696 // TH1* hist2 = h->GetUEHist(2)->GetUEHist(0, 0, 6.01, 7.99, 6, 14);
12697 // TH1* hist3 = h->GetUEHist(2)->GetUEHist(0, 0, 8.01, 9.99, 6, 14);
12700 // hist2->SetLineColor(2);
12701 // hist2->Draw("SAME");
12702 // hist3->SetLineColor(4);
12703 // hist3->Draw("SAME");
12707 legend = new TLegend(0.65, 0.45, 0.85, 0.85);
12708 legend->SetTextSize(0.04);
12709 legend->SetFillColor(0);
12713 for (Int_t i=0; i<nSteps; i++)
12715 //TH1* hist1 = h->GetUEHist(2)->GetEventHist()->Project(stepList[i], 0);
12717 /* h->GetUEHist(2)->GetTrackHist(0)->GetGrid(stepList[i])->GetGrid()->GetAxis(1)->SetRangeUser(1.01, 3.99);
12718 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(stepList[i])->GetGrid()->GetAxis(2)->SetRangeUser(4.01, 19.99);
12719 TH1* hist1 = h->GetUEHist(2)->GetTrackHist(0)->Project(stepList[i], 4);*/
12722 TH1* hist1 = h->GetUEHist(2)->GetUEHist(stepList[i], 0, 1.01, 19.99);
12723 else if (caseId == 1)
12724 TH1* hist1 = h->GetUEHist(2)->GetEventHist()->Project(stepList[i], 0);
12728 hist1->SetMarkerStyle(24+i);
12729 hist1->SetTitle("");
12730 hist1->SetStats(0);
12731 hist1->DrawCopy((i==0)?"":"SAME");
12732 hist1->Fit("pol0", "0");
12733 //hist1->Fit("pol0");
12734 histList[i] = hist1;
12735 legend->AddEntry(hist1, Form("Step %d", stepListNames[i]), "P");
12741 legend = new TLegend(0.65, 0.45, 0.85, 0.85);
12742 legend->SetTextSize(0.04);
12743 legend->SetFillColor(0);
12745 for (Int_t i=1; i<nSteps; i++)
12747 histList[i]->DrawCopy((i==1)?"":"SAME")->Divide(histList[i-1]);
12748 legend->AddEntry(histList[i], Form("Step %d/%d", stepListNames[i], stepListNames[i-1]), "P");
12754 for (Int_t i=0; i<nSteps; i++)
12756 hist1 = histList[i];
12757 func = new TF1("func", "[0]", -10, 10);
12758 hist1->Fit(func, "0", "", 1, 2);
12759 hist1->Add(func, -1);
12760 hist1->DrawCopy((i==0)?"":"SAME");
12766 for (Int_t i=1; i<nSteps; i++)
12768 histList[i]->DrawCopy((i==1)?"":"SAME")->Divide(histList[i-1]);
12774 void PtShift(const char* fileName)
12778 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12783 ptHist3 = h->GetCorrelationpT()->ProjectionY();
12784 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12785 //ptHist3->Sumw2();
12788 func = new TF1("func", "[0]+[1]*x**[2]", 4, 20);
12789 func->SetParLimits(2, -10, -1);
12790 func->SetParameters(0, 1, -4);
12791 ptHist3->Fit(func, "", "", 4, 20);
12796 ptHist3Shifted = (TH1*) ptHist3->Clone("ptHist3Shifted");
12797 for (Int_t i=1; i<ptHist3Shifted->GetNbinsX(); i++)
12798 //ptHist3Shifted->SetBinContent(i, ptHist3Shifted->GetBinContent(i+3));
12799 ptHist3Shifted->SetBinContent(i, ptHist3Shifted->GetBinContent(1.1*i));
12803 ptHist3Shifted->SetLineColor(2);
12806 ptHist3Shifted->Rebin(2);
12808 ptHist3->DrawCopy();
12809 ptHist3Shifted->DrawCopy("SAME");
12812 ptHist3->Divide(ptHist3Shifted);
12815 //ptHist3->Rebin(2); ptHist3->Scale(1.0 / 2);
12821 void RAA(const char* fileName, const char* fileName2)
12827 for (Int_t j=0; j<2; j++)
12830 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12836 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName2);
12839 ptHist3 = h->GetCorrelationpT()->ProjectionY(Form("proj1_%d", j), 1, 5);
12840 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12842 //h->GetCentralityDistribution()->Draw(); new TCanvas;
12844 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(4.99));
12845 Printf("%d", nEvents);
12846 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12852 hist[0]->DrawCopy("");
12853 hist[1]->DrawCopy("SAME")->SetLineColor(2);
12857 hist[1]->Divide(hist[0]);
12858 hist[1]->DrawCopy();
12860 raa_central = ReadHepdata("raa_alice_central.txt", kFALSE, 3);
12861 raa_central->SetMarkerStyle(20);
12862 raa_central->Draw("PSAME");
12865 void PtComparison(const char* fileName, const char* fileName2 = 0, const char* tag = 0)
12874 for (Int_t j=0; j<2; j++)
12877 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE, tag);
12883 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName2, 0, kFALSE, tag);
12886 ptHist3 = h->GetInvYield()->ProjectionY("pt1", h->GetInvYield()->GetXaxis()->FindBin(0.01), h->GetInvYield()->GetXaxis()->FindBin(4.99));
12887 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12889 //h->GetCentralityDistribution()->Draw(); new TCanvas;
12891 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(4.99));
12892 Printf("%d", nEvents);
12893 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12896 ptHist3->SetLineStyle(j+1);
12897 ptHist3->DrawCopy((j == 0) ? "HIST" : "HISTSAME")->SetLineColor(1);
12899 centralPt = (TH1*) ptHist3->Clone();
12903 ptHist3 = h->GetInvYield()->ProjectionY("pt2", h->GetInvYield()->GetXaxis()->FindBin(70.01), h->GetInvYield()->GetXaxis()->FindBin(79.99));
12904 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12906 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(70.1), h->GetCentralityDistribution()->FindBin(79.9));
12907 Printf("%d", nEvents);
12908 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12910 ptHist3->SetLineStyle(j+1);
12911 ptHist3->DrawCopy("HISTSAME")->SetLineColor(2);
12913 peripheralPt = (TH1*) ptHist3->Clone();
12917 ptHist3 = h->GetInvYield()->ProjectionY("pt3", h->GetInvYield()->GetXaxis()->FindBin(20.01), h->GetInvYield()->GetXaxis()->FindBin(29.99));
12918 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12920 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(20.1), h->GetCentralityDistribution()->FindBin(29.9));
12921 Printf("%d", nEvents);
12922 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12924 ptHist3->SetLineStyle(j+1);
12925 ptHist3->DrawCopy("HISTSAME")->SetLineColor(4);
12931 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
12932 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
12937 dndpt_central = ReadHepdata("raa2_dndpt_05.txt", kFALSE, 1, 3);
12938 dndpt_midcentral = ReadHepdata("raa2_dndpt_2030.txt", kFALSE, 1, 3);
12939 dndpt_peripheral = ReadHepdata("raa2_dndpt_7080.txt", kFALSE, 1, 3);
12942 // RemovePointsBelowX(dndpt_central, 1);
12943 // RemovePointsBelowX(dndpt_peripheral, 1);
12945 // NormalizeTo(dndpt_central, 1);
12946 // NormalizeTo(dndpt_peripheral, 10);
12948 dndpt_central->Draw("*SAME");
12949 dndpt_peripheral->SetLineColor(2);
12950 dndpt_peripheral->SetMarkerColor(2);
12951 dndpt_peripheral->Draw("*SAME");
12952 dndpt_midcentral->SetLineColor(4);
12953 dndpt_midcentral->SetMarkerColor(4);
12954 dndpt_midcentral->Draw("*SAME");
12960 for (Int_t i=1; i<ptHist3->GetNbinsX(); i++)
12961 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / dndpt_midcentral->Eval(ptHist3->GetBinCenter(i), 0, "S"));
12963 for (Int_t i=1; i<centralPt->GetNbinsX(); i++)
12964 centralPt->SetBinContent(i, centralPt->GetBinContent(i) / dndpt_central->Eval(centralPt->GetBinCenter(i), 0, "S"));
12966 for (Int_t i=1; i<peripheralPt->GetNbinsX(); i++)
12967 peripheralPt->SetBinContent(i, peripheralPt->GetBinContent(i) / dndpt_peripheral->Eval(peripheralPt->GetBinCenter(i), 0, "S"));
12969 // ptHist3->Rebin(2); ptHist3->Scale(0.5);
12970 // centralPt->Rebin(2); centralPt->Scale(0.5);
12972 ptHist3->GetXaxis()->SetRangeUser(0.51, 19);
12973 ptHist3->GetYaxis()->SetRangeUser(0.5, 1.5);
12974 ptHist3->DrawCopy((j == 0) ? "" : "SAME")->SetLineColor(4);
12975 centralPt->DrawCopy("SAME")->SetLineColor(1);
12976 peripheralPt->DrawCopy("SAME")->SetLineColor(2);
12980 void PtComparisonOld(const char* fileName, const char* fileName2 = 0)
12982 // use GetCorrectedYields to get input file
12991 for (Int_t j=0; j<2; j++)
12995 TFile::Open(fileName);
13002 TFile::Open(fileName2);
13004 yieldCorr = (TH3F*) gFile->Get("fYieldsCorr");
13005 eventDist = (TH1*) gFile->Get("events");
13007 //new TCanvas; h->GetCorrelationpT()->Draw("COLZ");
13009 yieldCorr->GetXaxis()->SetRangeUser(0.1, 4.9);
13010 yieldCorr->GetZaxis()->SetRangeUser(-0.79, 0.79);
13012 ptHist3 = yieldCorr->Project3D(Form("y1_%d", j));
13013 ptHist3->GetXaxis()->SetRangeUser(0, 20);
13015 //h->GetCentralityDistribution()->Draw(); new TCanvas;
13017 Int_t nEvents = eventDist->Integral(eventDist->FindBin(0.1), eventDist->FindBin(4.9));
13018 Printf("%d", nEvents);
13019 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
13021 //ptHist3->Scale(1690);
13022 //ptHist3->Scale(1.0 / ptHist3->Integral(ptHist3->GetXaxis()->FindBin(1.01), ptHist3->GetNbinsX()) / 3 / 0.6);
13024 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
13025 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
13026 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
13028 //AliPWG0Helper::NormalizeToBinWidth(ptHist3);
13031 ptHist3->SetLineStyle(j+1);
13032 ptHist3->DrawCopy((j == 0) ? "HIST" : "HISTSAME")->SetLineColor(1);
13034 centralPt = (TH1*) ptHist3->Clone();
13038 yieldCorr->GetZaxis()->SetRangeUser(-0.79, 0.79);
13039 yieldCorr->GetXaxis()->SetRangeUser(70.1, 79.9);
13040 ptHist3 = yieldCorr->Project3D(Form("y2_%d", j));
13041 ptHist3->GetXaxis()->SetRangeUser(0, 20);
13043 Int_t nEvents = eventDist->Integral(eventDist->FindBin(70.1), eventDist->FindBin(79.9));
13044 Printf("%d", nEvents);
13045 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
13047 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
13048 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
13049 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
13051 ptHist3->SetLineStyle(j+1);
13052 ptHist3->DrawCopy("HISTSAME")->SetLineColor(2);
13054 peripheralPt = (TH1*) ptHist3->Clone();
13058 yieldCorr->GetZaxis()->SetRangeUser(-0.79, 0.79);
13059 yieldCorr->GetXaxis()->SetRangeUser(20.1, 29.9);
13060 ptHist3 = yieldCorr->Project3D(Form("y2_%d", j));
13061 ptHist3->GetXaxis()->SetRangeUser(0, 20);
13063 Int_t nEvents = eventDist->Integral(eventDist->FindBin(20.1), eventDist->FindBin(29.9));
13064 Printf("%d", nEvents);
13065 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
13067 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
13068 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
13069 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
13071 ptHist3->SetLineStyle(j+1);
13072 ptHist3->DrawCopy("HISTSAME")->SetLineColor(4);
13078 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
13079 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
13084 dndpt_central = ReadHepdata("raa2_dndpt_05.txt", kFALSE, 1, 3);
13085 dndpt_midcentral = ReadHepdata("raa2_dndpt_2030.txt", kFALSE, 1, 3);
13086 dndpt_peripheral = ReadHepdata("raa2_dndpt_7080.txt", kFALSE, 1, 3);
13089 // RemovePointsBelowX(dndpt_central, 1);
13090 // RemovePointsBelowX(dndpt_peripheral, 1);
13092 // NormalizeTo(dndpt_central, 1);
13093 // NormalizeTo(dndpt_peripheral, 10);
13095 dndpt_central->Draw("*SAME");
13096 dndpt_peripheral->SetLineColor(2);
13097 dndpt_peripheral->SetMarkerColor(2);
13098 dndpt_peripheral->Draw("*SAME");
13099 dndpt_midcentral->SetLineColor(4);
13100 dndpt_midcentral->SetMarkerColor(4);
13101 dndpt_midcentral->Draw("*SAME");
13107 for (Int_t i=1; i<ptHist3->GetNbinsX(); i++)
13108 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / dndpt_midcentral->Eval(ptHist3->GetBinCenter(i), 0, "S"));
13110 for (Int_t i=1; i<centralPt->GetNbinsX(); i++)
13111 centralPt->SetBinContent(i, centralPt->GetBinContent(i) / dndpt_central->Eval(centralPt->GetBinCenter(i), 0, "S"));
13113 for (Int_t i=1; i<peripheralPt->GetNbinsX(); i++)
13114 peripheralPt->SetBinContent(i, peripheralPt->GetBinContent(i) / dndpt_peripheral->Eval(peripheralPt->GetBinCenter(i), 0, "S"));
13116 // ptHist3->Rebin(2); ptHist3->Scale(0.5);
13117 // centralPt->Rebin(2); centralPt->Scale(0.5);
13119 ptHist3->GetXaxis()->SetRangeUser(0.51, 19);
13120 ptHist3->GetYaxis()->SetRangeUser(0.5, 1.5);
13121 ptHist3->DrawCopy((j == 0) ? "" : "SAME")->SetLineColor(4);
13122 centralPt->DrawCopy("SAME")->SetLineColor(1);
13123 peripheralPt->DrawCopy("SAME")->SetLineColor(2);
13128 ReadYields("preliminaries/yields_110303.root");
13130 ptHist3->Scale(100);
13132 TGraphErrors** tmp = yields[0][1][0];
13133 nearSide = tmp[18];
13134 nearSide->Draw("* SAME");
13136 TGraphErrors** tmp = yields[1][1][0];
13137 awaySide = tmp[18];
13138 awaySide->SetLineColor(2);
13139 awaySide->SetMarkerColor(2);
13140 awaySide->Draw("* SAME");
13144 void style(Int_t styleId = 1)
13146 gStyle->SetPalette(1);
13147 gStyle->SetCanvasColor(10);
13148 gStyle->SetHistFillColor(10);
13149 gStyle->SetHistFillStyle(0);
13150 gStyle->SetOptStat(0);
13151 gStyle->SetPadTickX(1);
13152 gStyle->SetPadTickY(1);
13153 gStyle->SetAxisColor(1, "X");
13154 gStyle->SetAxisColor(1, "Y");
13155 gStyle->SetAxisColor(1, "Z");
13156 gStyle->SetLabelColor(1, "X");
13157 gStyle->SetLabelColor(1, "Y");
13158 gStyle->SetLabelColor(1, "Z");
13159 gStyle->SetTickLength(0.03, "X");
13160 gStyle->SetTickLength(0.03, "Y");
13161 gStyle->SetTickLength(0.03, "Z");
13162 gStyle->SetTitleXSize(0.05);
13163 gStyle->SetTitleYSize(0.05);
13164 gStyle->SetNdivisions(506, "X");
13165 gStyle->SetNdivisions(506, "Y");
13166 gStyle->SetNdivisions(506, "Z");
13168 //gStyle->SetPadGridX(1);
13169 //gStyle->SetPadGridY(1);
13171 //gStyle->SetLabelOffset(0.02, "X");
13172 //gStyle->SetLabelOffset(0.02, "Y");
13173 //gStyle->SetLabelOffset(0.02, "Z");
13174 gStyle->SetLabelSize(0.05, "X");
13175 gStyle->SetLabelSize(0.05, "Y");
13176 gStyle->SetLabelSize(0.05, "Z");
13178 gStyle->SetPadLeftMargin(0.12);
13179 gStyle->SetPadRightMargin(0.02);
13180 gStyle->SetPadBottomMargin(0.13);
13181 gStyle->SetPadTopMargin(0.02);
13183 gStyle->SetMarkerSize(1.4); // CKB
13185 const int iFont = 42; // type * 10 + prec 6: helvetica bold 13: times normal 2: times bold
13188 *-* 1 : times-medium-i-normal "Times New Roman" 1 4
13189 *-* 2 : times-bold-r-normal "Times New Roman" 0 7
13190 *-* 3 : times-bold-i-normal "Times New Roman" 1 7
13191 *-* 4 : helvetica-medium-r-normal "Arial" 0 4
13192 *-* 5 : helvetica-medium-o-normal "Arial" 1 4
13193 *-* 6 : helvetica-bold-r-normal "Arial" 0 7
13194 *-* 7 : helvetica-bold-o-normal "Arial" 1 7
13195 *-* 8 : courier-medium-r-normal "Courier New" 0 4
13196 *-* 9 : courier-medium-o-normal "Courier New" 1 4
13197 *-* 10 : courier-bold-r-normal "Courier New" 0 7
13198 *-* 11 : courier-bold-o-normal "Courier New" 1 7
13199 *-* 12 : symbol-medium-r-normal "Symbol" 0 6
13200 *-* 13 : times-medium-r-normal "Times New Roman" 0 4
13201 *-* 14 : "Wingdings" 0 4
13204 //gStyle->SetTitleXOffset(1); // 1.1
13205 //gStyle->SetTitleYOffset(1); // 1-4
13207 gStyle->SetLabelFont(iFont, "xyz");
13208 gStyle->SetStatFont(iFont);
13209 gStyle->SetTitleFont(iFont, "xyz");
13210 gStyle->SetTextFont(iFont);
13214 gStyle->SetLabelSize(0.07, "X");
13215 gStyle->SetLabelSize(0.07, "Y");
13216 gStyle->SetLabelSize(0.07, "Z");
13217 gStyle->SetTitleXSize(0.07);
13218 gStyle->SetTitleYSize(0.07);
13220 gStyle->SetPadLeftMargin(0.26);
13221 gStyle->SetPadRightMargin(0.01);
13222 gStyle->SetPadBottomMargin(0.15);
13223 gStyle->SetPadTopMargin(0.01);
13226 //gStyle->SetEndErrorSize(0.0);
13228 gROOT->ForceStyle();
13232 void NormalizeTo(TGraphErrors* graph, Float_t normalizeTo)
13235 for (Int_t i=0; i<graph->GetN(); i++)
13236 sum += graph->GetY()[i];
13238 if (normalizeTo > 0 && sum > 0)
13240 sum /= normalizeTo;
13241 for (Int_t i=0; i<graph->GetN(); i++)
13243 graph->SetPoint(i, graph->GetX()[i], graph->GetY()[i] / sum);
13244 graph->SetPointError(i, graph->GetEX()[i], graph->GetEY()[i] / sum);
13249 void CompareMixedEvent(const char* fileName)
13253 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
13254 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
13255 Int_t leadingPtOffset = 2;
13256 Int_t centralityBins[] = { 0, 0, 1, 6, 9, 16 };
13258 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
13261 for (Int_t j=2; j<5; j++)
13263 gpTMin = assocPtArr[j] + 0.01;
13264 gpTMax = assocPtArr[j+1] - 0.01;
13269 SetupRanges(hMixed);
13271 TH2* mixed = hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centralityBins[j], centralityBins[j+1]-1, 1);
13275 TH1* histMixedproj = mixed->ProjectionY();
13276 histMixedproj->Scale(1.0 / mixed->GetNbinsX());
13278 for (Int_t x=1; x<=mixed->GetNbinsX(); x++)
13279 for (Int_t y=1; y<=mixed->GetNbinsY(); y++)
13280 mixed->SetBinContent(x, y, histMixedproj->GetBinContent(y));
13282 histMixedproj->Scale(1.0 / (0.5 * (histMixedproj->GetBinContent(histMixedproj->GetXaxis()->FindBin(-0.01)) + histMixedproj->GetBinContent(histMixedproj->GetXaxis()->FindBin(0.01)))));
13284 histMixedproj->DrawCopy((j == 2) ? "" : "SAME")->SetLineColor(j-1);
13288 void FillParentTHnSparse(const char* fileName, Bool_t reduce = kFALSE, const char* tag = "")
13290 TString fileNameStr(fileName);
13292 if (fileNameStr.BeginsWith("/alice"))
13294 fileNameStr = Form("alien://%s", fileNameStr.Data());
13295 if (fileNameStr.EndsWith("merge"))
13296 fileNameStr += "/AnalysisResults.root";
13299 if (fileNameStr.BeginsWith("alien:"))
13300 TGrid::Connect("alien:");
13306 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNameStr, &list, kFALSE, tag);
13307 Printf("We have %d axes", ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0)->GetNVar()));
13310 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
13311 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->FillParent();
13312 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
13314 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileNameStr, 0, kTRUE, tag);
13316 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
13317 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->FillParent();
13318 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
13320 TString newFileName(fileNameStr);
13322 if (fileNameStr.BeginsWith("alien:"))
13323 newFileName = gSystem->BaseName(newFileName);
13325 newFileName.ReplaceAll(".root", "");
13327 newFileName += "_.root";
13329 newFileName += "_zvtx.root";
13331 TFile *file3 = TFile::Open(newFileName, "RECREATE");
13332 file3->mkdir("PWG4_PhiCorrelations");
13333 file3->cd("PWG4_PhiCorrelations");
13334 list->Write("histosPhiCorrelations", TObject::kSingleKey);
13339 void CompareZVertex(const char* fileName)
13343 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13344 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
13346 axis = h->GetUEHist(2)->GetEventHist()->GetAxis(2, 6);
13352 SetupRanges(hMixed);
13354 TFile::Open("test.root", "RECREATE");
13356 for (Int_t i=0; i<=axis->GetNbins(); i++)
13361 Printf("%d %f %f", i, axis->GetBinLowEdge(i) + 0.01, axis->GetBinUpEdge(i) - 0.01);
13362 h->SetZVtxRange(axis->GetBinLowEdge(i) + 0.01, axis->GetBinUpEdge(i) - 0.01);
13363 hMixed->SetZVtxRange(axis->GetBinLowEdge(i) + 0.01, axis->GetBinUpEdge(i) - 0.01);
13366 GetDistAndFlow(h, hMixed, &hist, 0, 6, 0, 10, 2.01, 14.99, 1, kTRUE, 0, kFALSE);
13369 hist->DrawCopy("SURF1");
13371 hist->Write(Form("detadphi_%d", i));
13373 // if (i == 0) break;
13377 hist->SetLineColor(i+1);
13378 hist->Scale(1.0 / hist->Integral() / hist->GetBinWidth(1));
13379 hist->Draw((i == 0) ? "" : "SAME");
13385 void DrawZRanges(Float_t min, Float_t max)
13387 legend = new TLegend(0.5, 0.5, 0.8, 0.8);
13389 TFile::Open("test.root");
13391 for (Int_t i=0; i<8; i++)
13393 if (i == 1 || i == 7)
13396 hist = (TH2*) gFile->Get(Form("detadphi_%d", i));
13397 hist->Rebin2D(2, 2);
13400 proj = hist->ProjectionY("proj", hist->GetXaxis()->FindBin(min), hist->GetXaxis()->FindBin(max));
13401 proj->Scale(1.0 / (hist->GetXaxis()->FindBin(max) - hist->GetXaxis()->FindBin(min) + 1));
13403 proj->SetLineColor(i+1);
13404 proj->DrawCopy((i == 0) ? "" : "SAME HIST");
13406 legend->AddEntry(proj->Clone(), Form("%d", i));
13412 void PlotTrackingEfficiency(const char* fileName)
13416 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13418 c = new TCanvas("c", "c", 600, 600);
13419 gPad->SetLeftMargin(0.15);
13421 h->SetEtaRange(-0.89, 0.89);
13423 Float_t centralityBins[] = { 0, 10, 20, 40, 60, 100 };
13424 Int_t nCentralityBins = 5;
13426 legend = new TLegend(0.2, 0.15, 0.46, 0.42);
13427 legend->SetFillColor(0);
13429 Int_t colors[] = { 1, 2, 3, 4, 6 };
13431 for (Int_t i=0; i<nCentralityBins; i++)
13433 h->GetUEHist(2)->SetCentralityRange(centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
13434 proj = h->GetUEHist(2)->GetTrackingEfficiency(1);
13435 proj->GetYaxis()->SetRangeUser(0.7, 0.9);
13436 proj->GetXaxis()->SetRangeUser(0.5, 9.9);
13437 proj->GetYaxis()->SetTitleOffset(1.5);
13438 proj->SetTitle("");
13439 proj->GetYaxis()->SetTitle("Tracking efficiency");
13440 proj->SetMarkerColor(colors[i]);
13441 proj->SetLineColor(colors[i]);
13443 projClone = proj->DrawClone((i == 0) ? "" : "SAME");
13445 legend->AddEntry(projClone, Form("%.0f-%.0f%%", centralityBins[i], centralityBins[i+1]));
13449 // DrawLatex(0.58, 0.85, 1, "HIJING Pb-Pb 2.76 TeV", 0.03);
13450 // DrawLatex(0.58, 0.81, 1, "|#eta| < 0.9", 0.03);
13452 // DrawALICELogo(kFALSE, 0.7, 0.2, 0.9, 0.4);
13454 c->SaveAs("correction_tracking.eps");
13456 c = new TCanvas("c2", "c2", 600, 600);
13457 gPad->SetLeftMargin(0.15);
13459 proj = (TH1D*) h->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepTracked, AliUEHist::kCFStepTrackedOnlyPrim, 1);
13460 proj->GetYaxis()->SetRangeUser(0.8, 1.0);
13461 proj->GetXaxis()->SetRangeUser(0.5, 9.9);
13462 proj->GetYaxis()->SetTitleOffset(1.5);
13463 proj->SetTitle("");
13464 proj->GetYaxis()->SetTitle("contamination correction");
13466 projClone = proj->DrawClone("");
13468 // DrawLatex(0.58, 0.85, 1, "HIJING Pb-Pb 2.76 TeV", 0.03);
13469 // DrawLatex(0.58, 0.81, 1, "|#eta| < 0.9", 0.03);
13470 // DrawALICELogo(kFALSE, 0.7, 0.2, 0.9, 0.4);
13472 c->SaveAs("correction_contamination.eps");
13474 c = new TCanvas("c3", "c3", 600, 600);
13475 gPad->SetLeftMargin(0.15);
13477 proj = (TH1D*) h->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepTrackedOnlyPrim, AliUEHist::kCFStepTracked, 1);
13478 proj->GetYaxis()->SetRangeUser(0.95, 1.15);
13479 proj->GetXaxis()->SetRangeUser(0.5, 9.9);
13480 proj->GetYaxis()->SetTitleOffset(1.5);
13481 proj->SetTitle("");
13482 proj->GetYaxis()->SetTitle("contamination");
13484 projClone = proj->DrawClone("");
13486 // DrawLatex(0.58, 0.85, 1, "HIJING Pb-Pb 2.76 TeV", 0.03);
13487 // DrawLatex(0.58, 0.81, 1, "|#eta| < 0.9", 0.03);
13488 // DrawALICELogo(kFALSE, 0.7, 0.2, 0.9, 0.4);
13490 c->SaveAs("contamination.eps");
13493 void PlotCorrections(const char* fileName, const char* tag = "")
13497 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE, tag);
13499 c = new TCanvas("c", "c", 1200, 800);
13502 c2 = new TCanvas("c2", "c2", 800, 900);
13505 h->SetEtaRange(-0.89, 0.89);
13506 // h->SetEtaRange(-1.19, 1.19);
13508 Float_t centrBins[] = { 0, 20, 40, 60, 100.1 };
13510 for (Int_t i=0; i<4; i++)
13512 h->GetUEHist(2)->SetCentralityRange(centrBins[i] + 0.1, centrBins[i+1] - 0.1);
13514 h->GetUEHist(2)->GetTrackingEfficiency()->DrawClone("COLZ");
13517 proj = h->GetUEHist(2)->GetTrackingEfficiency(1);
13518 proj->SetTitle(""); proj->SetStats(0);
13519 proj->GetYaxis()->SetTitle("tracking efficiency");
13520 proj->SetLineColor(i+1);
13521 proj->DrawClone((i == 0) ? "" : "SAME");
13524 proj = h->GetUEHist(2)->GetTrackingEfficiency(0);
13525 proj->GetYaxis()->SetTitle("tracking efficiency");
13526 proj->SetTitle(""); proj->SetStats(0);
13527 proj->GetXaxis()->SetTitle("#eta");
13528 proj->SetLineColor(i+1);
13529 proj->DrawClone((i == 0) ? "" : "SAME");
13532 proj = h->GetUEHist(2)->GetTrackingContamination(1);
13533 proj->GetYaxis()->SetTitle("contamination correction");
13534 proj->SetTitle(""); proj->SetStats(0);
13535 proj->SetLineColor(i+1);
13536 proj->DrawClone((i == 0) ? "" : "SAME");
13540 h->GetUEHist(2)->SetCentralityRange(0, -1);
13541 for (Int_t i=0; i<10; i++)
13544 h->SetZVtxRange(-10.0 + 2 * i, -8.0 + 2 * i);
13545 proj = h->GetUEHist(2)->GetTrackingEfficiency(0);
13546 proj->GetYaxis()->SetTitle("tracking efficiency");
13547 proj->SetTitle(""); proj->SetStats(0);
13548 proj->GetXaxis()->SetTitle("#eta");
13549 proj->SetLineColor(i+1);
13550 proj->DrawClone((i == 0) ? "" : "SAME");
13553 h->SetZVtxRange(0, -1);
13555 for (Int_t i=0; i<4; i++)
13558 h->SetPartSpecies(i);
13559 proj = h->GetUEHist(2)->GetTrackingEfficiency(1);
13560 proj->GetYaxis()->SetTitle("tracking efficiency");
13561 proj->SetTitle(""); proj->SetStats(0);
13562 // proj->GetXaxis()->SetTitle("#eta");
13563 proj->SetLineColor(i+1);
13564 proj->DrawClone((i == 0) ? "" : "SAME");
13570 h->GetUEHist(2)->GetTrackingContamination()->Draw("COLZ");*/
13572 proj2 = h->GetUEHist(2)->GetTrackingEfficiency(1);
13573 // proj2 = h->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepAnaTopology, (AliUEHist::CFStep) (AliUEHist::kCFStepTrackedOnlyPrim+2), 1);
13578 hist = h->GetUEHist(2)->GetCorrelatedContamination();
13579 // if (hist->GetEntries() > 0)
13580 // hist->Draw("COLZ");
13583 void SaveEfficiencyCorrection(const char* fileName, const char* tag = "", Bool_t condenseCentrality = kTRUE, Bool_t extrapolateHighpT = kFALSE, Int_t partSpecies=-1, Int_t icharge=0, Bool_t ApplyGFCorrection=0, Int_t year=2013)
13585 // partSpecies= -1 No PID, 0: Pions, 1: Kaons, 2: Protons
13586 // icharge is needed because GF correction applies only to negative particles, 0:Positive 1:negative
13587 // ApplyGFCorrection, for Geant3 version >= v1.14 this correction is not needed anymore for antiprotons
13588 // the number of TRD modules installed depends on the year
13590 Printf("condenseCentrality: %d; extrapolateHighpT: %d", condenseCentrality, extrapolateHighpT);
13594 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE, tag);
13596 if(partSpecies!=-1){
13597 Double_t epsilon=0.001;
13598 h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
13599 h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(4)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
13602 Int_t dimensions[] = { 0, 1, 3, 4 }; // eta, pT, centrality, vertex
13603 THnBase* generated = h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->ProjectionND(4, dimensions);
13604 THnBase* measured = h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid((partSpecies==-1)?2:4)->GetGrid()->ProjectionND(4, dimensions); //for ID particle the matched+identified are taken
13606 // new TCanvas; measured->Projection(0, 1, 3)->Draw();
13608 Printf("%f %f", generated->GetEntries(), measured->GetEntries());
13610 Int_t nBins[] = { generated->GetAxis(0)->GetNbins(), generated->GetAxis(1)->GetNbins(), 1, generated->GetAxis(3)->GetNbins() };
13612 if (condenseCentrality)
13614 Double_t centrAxis[] = { 0, 101 };
13618 Double_t centrAxis[] = { 0, 10, 20, 40, 60, 101 };
13622 generated_new = new THnF("generated_new", "", 4, nBins, 0, 0);
13624 generated_new->SetBinEdges(0, generated->GetAxis(0)->GetXbins()->GetArray()); //eta
13625 generated_new->SetBinEdges(1, generated->GetAxis(1)->GetXbins()->GetArray()); //pT
13626 generated_new->SetBinEdges(2, centrAxis); //centrality
13627 generated_new->SetBinEdges(3, generated->GetAxis(3)->GetXbins()->GetArray()); //vertex
13629 for (Int_t i=0; i<4; i++)
13630 generated_new->GetAxis(i)->SetTitle(generated->GetAxis(i)->GetTitle());
13632 measured_new = (THnF*) generated_new->Clone("measured_new");
13633 effCorr = (THnF*) generated_new->Clone("correction");
13635 generated_new->RebinnedAdd(generated);
13636 measured_new->RebinnedAdd(measured);
13638 // new TCanvas; measured_new->Projection(0, 1, 3)->Draw();
13642 Printf("%f %f", generated_new->GetEntries(), measured_new->GetEntries());
13644 effCorr->Divide(generated_new, measured_new, 1, 1, "B");
13645 // effCorr->Divide(measured_new);
13647 if(ApplyGFCorrection && partSpecies!=-1){//define the functions for the GF correction
13651 if(year==2011)ntrd=10;
13652 if(year>=2012)ntrd=13;
13653 Printf("Number of TRD module in %d : %d",year,ntrd);
13654 Printf("Applying GF correction for particle specie %d %s",partSpecies,Sign[icharge].Data());
13655 Int_t partSpeciesAliPID=partSpecies+2; //in AliPID 2: Pions 3:Kaons 4:protons
13656 fGFTracking = TrackingEff_geantflukaCorrection(partSpeciesAliPID,(icharge==0)?kPositive:kNegative);
13657 fGFMatching = TOFmatchMC_geantflukaCorrection(partSpeciesAliPID,(icharge==0)?kPositive:kNegative,ntrd);
13658 TCanvas *cGF=new TCanvas("cGF","cGF");
13659 fGFTracking->SetLineColor(1);
13660 fGFTracking->DrawClone();
13661 fGFMatching->DrawClone("same");
13662 gPad->BuildLegend();
13665 Double_t maxEffValue=5;
13666 for (Int_t bin0 = 1; bin0<=effCorr->GetAxis(0)->GetNbins(); bin0++)
13667 for (Int_t bin1 = 1; bin1<=effCorr->GetAxis(1)->GetNbins(); bin1++)
13668 for (Int_t bin2 = 1; bin2<=effCorr->GetAxis(2)->GetNbins(); bin2++)
13669 for (Int_t bin3 = 1; bin3<=effCorr->GetAxis(3)->GetNbins(); bin3++)
13676 // Printf("%d %d %d %d %.2f %.2f %.2f %.2f is %f", bin0, bin1, bin2, bin3, effCorr->GetAxis(0)->GetBinCenter(bin0), effCorr->GetAxis(1)->GetBinCenter(bin1), effCorr->GetAxis(2)->GetBinCenter(bin2), effCorr->GetAxis(3)->GetBinCenter(bin3), effCorr->GetBinContent(nBins));
13677 if(ApplyGFCorrection && partSpecies!=-1)
13679 if(effCorr->GetBinContent(nBins) > 0)
13681 Double_t pt=effCorr->GetAxis(1)->GetBinCenter(bin1);
13682 Double_t GFTracking=fGFTracking->Eval(pt);
13683 Double_t GFMatching=fGFMatching->Eval(pt);
13684 //printf("pt: %.3f GFCorrectionTracking: %f GFCorrectionMatching: %f",pt,GFTracking,GFMatching);
13685 //printf(" Eff before: %f",effCorr->GetBinContent(nBins));
13686 effCorr->SetBinContent(nBins,effCorr->GetBinContent(nBins)*GFTracking*GFMatching);
13687 //Printf(" Eff after: %f",effCorr->GetBinContent(nBins));
13691 if (effCorr->GetBinContent(nBins) > maxEffValue)
13693 Printf("Nulling %d %d %d %d %.2f %.2f %.2f %.2f which was %f", bin0, bin1, bin2, bin3, effCorr->GetAxis(0)->GetBinCenter(bin0), effCorr->GetAxis(1)->GetBinCenter(bin1), effCorr->GetAxis(2)->GetBinCenter(bin2), effCorr->GetAxis(3)->GetBinCenter(bin3), effCorr->GetBinContent(nBins));
13694 effCorr->SetBinContent(nBins, 0);
13700 const Float_t fitRangeBegin = 5.01;
13701 const Float_t fitRangeEnd = 14.99;
13702 const Float_t extendRangeBegin = 8.01;
13703 Bool_t verbose = kTRUE;
13705 if (extrapolateHighpT)
13707 Printf("Extrapolating high pT...");
13709 for (Int_t bin0 = 1; bin0<=effCorr->GetAxis(0)->GetNbins(); bin0++)
13710 for (Int_t bin2 = 1; bin2<=effCorr->GetAxis(2)->GetNbins(); bin2++)
13711 for (Int_t bin3 = 1; bin3<=effCorr->GetAxis(3)->GetNbins(); bin3++)
13713 effCorr->GetAxis(0)->SetRange(bin0, bin0);
13714 effCorr->GetAxis(2)->SetRange(bin2, bin2);
13715 effCorr->GetAxis(3)->SetRange(bin3, bin3);
13717 if (gRandom->Uniform() < 0.02) verbose = kTRUE;
13719 proj = effCorr->Projection(1);
13721 if (proj->Integral(proj->FindBin(fitRangeBegin), proj->FindBin(fitRangeEnd)) <= 0)
13724 // Printf("%d %d %d %d %f", bin0, bin1, bin2, bin3, proj->Integral(proj->FindBin(fitRangeBegin), proj->FindBin(fitRangeEnd)));
13732 proj->Fit("pol0", (verbose) ? "+" : "Q0+", "SAME", fitRangeBegin, fitRangeEnd);
13734 if (!proj->GetFunction("pol0"))
13737 Float_t trackingEff = proj->GetFunction("pol0")->GetParameter(0);
13739 for (Int_t bin1 = 1; bin1<=effCorr->GetAxis(1)->GetNbins(); bin1++)
13741 if (effCorr->GetAxis(1)->GetBinCenter(bin1) < extendRangeBegin)
13749 // Printf("Setting %d %d %d %d %.2f %.2f %.2f %.2f to %f which was %f", bin0, bin1, bin2, bin3, effCorr->GetAxis(0)->GetBinCenter(bin0), effCorr->GetAxis(1)->GetBinCenter(bin1), effCorr->GetAxis(2)->GetBinCenter(bin2), effCorr->GetAxis(3)->GetBinCenter(bin3), trackingEff, effCorr->GetBinContent(nBins));
13750 effCorr->SetBinContent(nBins, trackingEff);
13757 effCorr->GetAxis(0)->UnZoom();
13758 effCorr->GetAxis(1)->UnZoom();
13759 effCorr->GetAxis(2)->UnZoom();
13760 effCorr->GetAxis(3)->UnZoom();
13763 Printf("%f", effCorr->GetEntries());
13765 TObjString tag2(Form("corrections from file %s with tag %s", fileName, tag));
13767 file = TFile::Open("correction.root", "RECREATE");
13773 effCorr->GetAxis(0)->SetRangeUser(-0.49, 0.49);
13774 effCorr->GetAxis(2)->SetRangeUser(65, 65);
13775 effCorr->GetAxis(3)->SetRangeUser(0.01, 0.01);
13776 effCorr->Projection(1)->Draw();
13779 void CompareEfficiencyCorrection(const char* fileName1, const char* fileName2, Int_t axis1, Int_t axis2)
13781 if (TString(fileName1).BeginsWith("alien") || TString(fileName2).BeginsWith("alien"))
13782 TGrid::Connect("alien:");
13784 file1 = TFile::Open(fileName1);
13785 corr1 = (THnBase*) file1->Get("correction");
13787 file2 = TFile::Open(fileName2);
13788 corr2 = (THnBase*) file2->Get("correction");
13790 corr1->GetAxis(0)->SetRangeUser(-1.19, 1.19);
13791 corr2->GetAxis(0)->SetRangeUser(-1.19, 1.19);
13792 corr1->GetAxis(1)->SetRangeUser(0.51, 3.99);
13793 corr2->GetAxis(1)->SetRangeUser(0.51, 3.99);
13794 corr1->GetAxis(3)->SetRangeUser(0.01, 0.01);
13795 corr2->GetAxis(3)->SetRangeUser(0.01, 0.01);
13797 proj1 = (TH1*) corr1->Projection(axis1, axis2)->Clone("proj1");
13798 new TCanvas; proj1->DrawCopy("COLZ");
13800 proj2 = (TH1*) corr2->Projection(axis1, axis2)->Clone("proj2");
13801 new TCanvas; proj2->DrawCopy("COLZ");
13803 proj1->Divide(proj2);
13804 new TCanvas; proj1->DrawCopy("COLZ");
13806 corr1->GetAxis(0)->SetRangeUser(-0.49, 0.49);
13807 corr2->GetAxis(0)->SetRangeUser(-0.49, 0.49);
13809 proj1 = (TH1*) corr1->Projection(axis2)->Clone("proj3");
13810 new TCanvas; proj1->DrawCopy();
13812 proj2 = (TH1*) corr2->Projection(axis2)->Clone("proj4");
13813 proj2->SetLineColor(2);
13814 proj2->DrawCopy("SAME");
13816 proj1->Divide(proj2);
13817 new TCanvas; proj1->DrawCopy();
13822 void PlotFake(const char* fileName, const char* fileName2 = 0)
13826 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13827 if (fileName2) AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
13829 TLegend* legend = new TLegend(0.7, 0.8, 0.95, 0.95);
13830 legend->SetFillColor(0);
13831 legend->SetTextSize(0.03);
13832 const char* title[] = {"0-20%", "20-40%", "40-60%", "60-80%", "80-100%"};
13833 TLegend* legend2 = new TLegend(0.7, 0.8, 0.95, 0.95);
13834 legend2->SetFillColor(0);
13835 legend2->SetTextSize(0.03);
13837 c1 = new TCanvas("c1", "Ratio of fakes", 1200, 800);
13839 c2 = new TCanvas("c2", "pTrec vs pT", 1200, 800);
13841 c3 = new TCanvas("c3", "pTrec pT ratio", 1200, 800);
13844 h->SetEtaRange(-0.79, 0.79);
13846 for (Int_t i=0; i<5; i++)
13848 // h->GetUEHist(2)->SetCentralityRange(100.0/5*i + 0.1, 100.0/5*(i+1) - 0.1);
13849 h->GetUEHist(2)->SetCentralityRange(0, 100);
13851 h->GetUEHist(2)->GetFakeRate()->DrawClone("COLZ");
13853 proj = h->GetUEHist(2)->GetFakeRate(1);
13854 proj->GetYaxis()->SetRangeUser(0,150);
13855 proj->SetLineColor((i==4) ? 6 : i+1);
13856 proj->DrawClone((i == 0) ? "" : "SAME");
13857 legend->AddEntry(proj, title[i] , "PL");
13863 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetXaxis()->SetTitle("p_{T,rec}");
13864 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetYaxis()->SetTitle("p_{T}");
13865 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetZaxis()->SetTitle("Centrality");
13866 h->GetUEHist(2)->GetMCRecoPtCorrelation()->DrawCopy();
13868 Float_t difference = 0.05;
13870 for (Int_t i=0; i<5; i++)
13873 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetZaxis()->SetRangeUser(100.0/5*i + 0.1,100.0/5*(i+1) - 0.1);
13874 hist = h->GetUEHist(2)->GetMCRecoPtCorrelation()->Project3D("yx");
13875 hist->DrawClone("COLZ");
13876 c2->cd(i+2)->SetLogz();
13878 TH1* MisreconstructedPtRate = h->GetUEHist(2)->GetMCRecoPtCorrelation()->ProjectionX("MisreconstructedPtRate");
13879 MisreconstructedPtRate->Reset();
13880 MisreconstructedPtRate->GetYaxis()->SetRangeUser(0,1);
13882 for (Int_t x=0; x<=hist->GetNbinsX(); x++)
13884 Float_t ptRec = hist->GetXaxis()->GetBinCenter(x);
13885 Float_t Misreconstructed = 0;
13886 Float_t Reconstructed = 0;
13887 for (Int_t y=0; y<=hist->GetNbinsY(); y++)
13889 Float_t pt = hist->GetYaxis()->GetBinCenter(y);
13890 Reconstructed += hist->GetBinContent(x,y);
13891 if (TMath::Abs(ptRec-pt)/pt > difference)
13892 Misreconstructed += hist->GetBinContent(x,y);
13894 if (Reconstructed!=0) MisreconstructedPtRate->Fill(ptRec,Misreconstructed/Reconstructed);
13896 MisreconstructedPtRate->SetLineColor((i==4) ? 6 : i+1);
13897 MisreconstructedPtRate->DrawClone();
13898 if (i==0) legend2->AddEntry(MisreconstructedPtRate, "2010" , "L");
13900 MisreconstructedPtRate->DrawClone((i == 0) ? "" : "SAME");
13903 h2->GetUEHist(2)->GetMCRecoPtCorrelation()->GetZaxis()->SetRangeUser(100.0/5*i + 0.1,100.0/5*(i+1) - 0.1);
13904 hist = h2->GetUEHist(2)->GetMCRecoPtCorrelation()->Project3D("yx");
13905 TH1* MisreconstructedPtRate2 = h2->GetUEHist(2)->GetMCRecoPtCorrelation()->ProjectionX("MisreconstructedPtRate2");
13906 MisreconstructedPtRate2->Reset();
13907 MisreconstructedPtRate2->GetYaxis()->SetRangeUser(0,1);
13908 for (Int_t x=0; x<=hist->GetNbinsX(); x++)
13910 Float_t ptRec = hist->GetXaxis()->GetBinCenter(x);
13911 Float_t Misreconstructed = 0;
13912 Float_t Reconstructed = 0;
13913 for (Int_t y=0; y<=hist->GetNbinsY(); y++)
13915 Float_t pt = hist->GetYaxis()->GetBinCenter(y);
13916 Reconstructed += hist->GetBinContent(x,y);
13917 if (TMath::Abs(ptRec-pt)/pt > difference)
13918 Misreconstructed += hist->GetBinContent(x,y);
13920 if (Reconstructed!=0) MisreconstructedPtRate2->Fill(ptRec,Misreconstructed/Reconstructed);
13923 MisreconstructedPtRate2->SetLineColor((i==2) ? 12 : i+8);
13924 MisreconstructedPtRate2->DrawClone("SAME");
13925 if (i==0) legend2->AddEntry(MisreconstructedPtRate2, "2011" , "L");
13926 legend2->DrawClone();
13933 void CompareCorrections(const char* fileName1, const char* fileName2)
13937 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
13938 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
13940 c = new TCanvas("c", "c", 1200, 800);
13942 TLegend* legend = new TLegend(0.7, 0.8, 0.95, 0.95);
13943 legend->SetFillColor(0);
13944 legend->SetTextSize(0.03);
13946 h1->SetEtaRange(-0.89, 0.89);
13947 h2->SetEtaRange(-0.89, 0.89);
13950 // const char* title1[] = {"2010, 0-10%", "2010, 10-20%", "2010, 20-30%", "2010, 30-40%", "2010, 40-50%"};
13951 const char* title1[] = {"FullTPC, 0-10%", "FullTPC, 10-20%", "FullTPC, 20-30%", "FullTPC, 30-40%", "FullTPC, 40-50%"};
13952 const char* title1[] = {"FullTPC, 0-10%", "FullTPC, 10-20%", "FullTPC, 20-30%", "FullTPC, 30-40%", "FullTPC, 40-50%"};
13953 // const char* title2[] = {"2011, 0-10%", "2011, 10-20%", "2011, 20-30%", "2011, 30-40%", "2011, 40-50%"};
13954 const char* title2[] = {"NotFullTPC, 0-10%", "NotFullTPC, 10-20%", "NotFullTPC, 20-30%", "NotFullTPC, 30-40%", "NotFullTPC, 40-50%"};
13956 Int_t colors[16] = { 1, 3, 2, 6, 4, 7, 8, 9, 11, 12, 28, 30, 36, 40, 46 };
13957 Int_t markers[16] = { 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 2, 5};
13959 for (Int_t i=0; i<5; i++)
13961 h1->GetUEHist(2)->SetCentralityRange(100.0/10*i + 0.1, 100.0/10*(i+1) - 0.1);
13962 h2->GetUEHist(2)->SetCentralityRange(100.0/10*i + 0.1, 100.0/10*(i+1) - 0.1);
13965 proj = h1->GetUEHist(2)->GetTrackingEfficiency(1);
13966 proj->SetLineColor(colors[6]);
13967 proj->SetMarkerColor(colors[6]);
13968 proj->SetMarkerStyle(markers[i]);
13969 proj->DrawClone((i == 0) ? "" : "SAME");
13970 legend->AddEntry(proj, title1[i] , "PL");
13972 proj = h2->GetUEHist(2)->GetTrackingEfficiency(1);
13973 proj->SetLineColor(colors[2]);
13974 proj->SetMarkerColor(colors[2]);
13975 proj->SetMarkerStyle(markers[i+5]);
13976 proj->SetMarkerStyle(markers[i]);
13977 proj->DrawClone("SAME");
13978 legend->AddEntry(proj, title2[i] , "PL");
13984 void ComparePPHIMixedEvent(const char* ppFile, const char* pbpbFile)
13988 AliUEHistograms* hpp = (AliUEHistograms*) GetUEHistogram(ppFile);
13989 AliUEHistograms* hpbpb = (AliUEHistograms*) GetUEHistogram(pbpbFile);
13992 hpp->SetPtRange(2, 10);
13993 ppEff = hpp->GetUEHist(2)->GetTrackingEfficiency(0);
13996 hpbpb->SetPtRange(2, 10);
13997 pbpbEff = hpbpb->GetUEHist(2)->GetTrackingEfficiency(0);
13998 pbpbEff->DrawCopy("SAME")->SetLineColor(2);
14001 ppEff2 = hpp->GetUEHist(2)->GetTrackingEfficiency(1);
14004 pbpbEff2 = hpbpb->GetUEHist(2)->GetTrackingEfficiency(1);
14005 pbpbEff2->DrawCopy("SAME")->SetLineColor(2);
14007 mixed = ComparePPHIMixedEventGetMixed(ppEff);
14008 mixed2 = ComparePPHIMixedEventGetMixed(pbpbEff);
14012 mixed2->DrawCopy("SAME")->SetLineColor(2);
14015 mixed->Divide(mixed2);
14019 TH1* ComparePPHIMixedEventGetMixed(TH1* eff)
14021 eff->Fit("pol0", "0W");
14022 Float_t avgEff = eff->GetFunction("pol0")->GetParameter(0);
14024 eff->Fit("pol0", "0W", "", -0.89, 0.89);
14025 Float_t avgEffCenter = eff->GetFunction("pol0")->GetParameter(0);
14026 Printf("Avg is %f and avg in center is %f", avgEff, avgEffCenter);
14028 TH1* mixed = new TH1F("mixed", "", 100, -2, 2);
14030 Float_t etaLimit = 1.0;
14034 for (Int_t i=0; i<n; i++)
14036 Float_t etaTrig = gRandom->Uniform(-etaLimit, etaLimit);
14038 for (Int_t j=0; j<n2; j++)
14040 Float_t etaAssoc = gRandom->Uniform(-etaLimit, etaLimit);
14042 if (gRandom->Uniform(0, 1) > eff->GetBinContent(eff->FindBin(etaAssoc)))
14045 mixed->Fill(etaTrig - etaAssoc);
14049 // mixed->Scale(1.0 / avgEffCenter);
14050 mixed->Scale(1.0 / avgEff);
14052 Printf("We have %f pairs and put in %d", mixed->Integral(), n*n2);
14057 void MACHConeEvolution(const char* fileName, const char* fileNameMixed = 0)
14061 if (!fileNameMixed)
14062 fileNameMixed = fileName;
14064 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14065 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileNameMixed, 0, kTRUE);
14067 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
14068 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
14074 gpTMin = assocPtArr[i] + 0.01;
14075 gpTMax = assocPtArr[i+1] - 0.01;
14077 for (Int_t centrBin = 0; centrBin < 5; centrBin++)
14079 Int_t centralityBegin = centrBin;
14080 Int_t centralityEnd = centrBin+1;
14083 SetupRanges(hMixed);
14087 Bool_t scaleToPairs = 0;
14089 GetDistAndFlow(h, hMixed, &hist, 0, step, centralityBegin, centralityEnd, leadingPtArr[j] + 0.01, leadingPtArr[j+1] - 0.01, 11, kTRUE, 0, scaleToPairs);
14090 hist->Rebin(2); hist->Scale(0.5);
14092 copy = hist->DrawCopy((centrBin == 0) ? "" : "SAME");
14093 copy->SetLineColor(centrBin+1);
14097 void PlotTwoTrackEfficiencyControlPlots(const char* fileName)
14100 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14102 Float_t ptRange[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0 };
14104 graph = new TGraphErrors;
14106 for (Int_t ptID = 0; ptID < 7; ptID++)
14108 c = new TCanvas(Form("c%d", ptID), Form("%.0f < pT < %.0f", ptRange[ptID], ptRange[ptID+1]), 800, 400);
14111 for (Int_t i=0; i<2; i++)
14114 h->GetTwoTrackDistance(i)->GetZaxis()->SetRangeUser(ptRange[ptID] + 0.01, ptRange[ptID+1] - 0.01);
14115 p = h->GetTwoTrackDistance(i)->Project3D(Form("yx_%d_%d", i, ptID));
14119 pc = (TH2*) p->Clone("pc");
14122 p->DrawCopy("COLZ");
14126 // reduce to one quadrant
14127 for (Int_t x=1; x<=p->GetNbinsX(); x++)
14128 for (Int_t y=1; y<=p->GetNbinsY(); y++)
14129 pc->Fill(TMath::Abs(p->GetXaxis()->GetBinCenter(x)), TMath::Abs(p->GetYaxis()->GetBinCenter(y)), p->GetBinContent(x, y));
14132 copy = pc->DrawCopy("COLZ");
14133 copy->GetXaxis()->SetRangeUser(0, 10);
14134 copy->GetYaxis()->SetRangeUser(0.00101, 10);
14139 Float_t center = pc->Integral(pc->GetXaxis()->FindBin(0), pc->GetXaxis()->FindBin(0.009999), 1, pc->GetNbinsY());
14140 Float_t outside = pc->Integral(pc->GetXaxis()->FindBin(0.01001), pc->GetXaxis()->FindBin(0.04999), 1, pc->GetNbinsY());
14142 Float_t excess1 = center - outside / 4;
14144 Float_t center = pc->Integral(pc->GetXaxis()->FindBin(0), pc->GetXaxis()->FindBin(0.001999), 1, pc->GetNbinsY());
14145 Float_t outside = pc->Integral(pc->GetXaxis()->FindBin(0.002001), pc->GetXaxis()->FindBin(0.00999), 1, pc->GetNbinsY());
14147 Float_t excess2 = center - outside / 4;
14149 Printf("%d %f %f", ptID, excess1, excess2);
14155 p2 = ((TH2*)pc)->ProjectionX("p2", 52, 52+4);
14156 // p3 = ((TH2*)p)->ProjectionX("p3", 49-4, 49);
14158 //new TCanvas; p2->Draw();
14160 p2->Fit("pol0", "0");
14161 Float_t avg = p2->GetFunction("pol0")->GetParameter(0);
14162 p2->Fit("pol0", "0", "", -0.002, 0.002);
14163 Float_t min = p2->GetFunction("pol0")->GetParameter(0);
14164 Float_t mine = p2->GetFunction("pol0")->GetParError(0);
14168 graph->SetPoint(graph->GetN(), ptRange[ptID], min / avg);
14169 graph->SetPointError(graph->GetN()-1, 0, mine / avg);
14175 c->SaveAs(Form("twotrack_pt_%d_%d.png", (Int_t) ptRange[ptID], (Int_t) ptRange[ptID+1]));
14176 c->SaveAs(Form("twotrack_pt_%d_%d.eps", (Int_t) ptRange[ptID], (Int_t) ptRange[ptID+1]));
14184 void PlotTwoTrackEfficiencyControlPlots2(const char* fileName)
14187 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14189 Float_t ptRange[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0 };
14191 graph = new TGraphErrors;
14193 for (Int_t ptID = 0; ptID < 5; ptID++)
14195 c = new TCanvas(Form("c%d", ptID), Form("%.0f < pT < %.0f", ptRange[ptID], ptRange[ptID+1]), 1200, 400);
14200 for (Int_t i=0; i<3; i++)
14203 gPad->SetRightMargin(0.2);
14207 h->GetTwoTrackDistance(i)->GetZaxis()->SetRangeUser(ptRange[ptID] + 0.01, ptRange[ptID+1] - 0.01);
14208 p = (TH2*) h->GetTwoTrackDistance(i)->Project3D(Form("yx_%d_%d", i, ptID));
14212 // reduce to one quadrant
14213 pc = (TH2*) p->Clone(Form("%s_pc", p->GetName()));
14216 for (Int_t x=1; x<=p->GetNbinsX(); x++)
14217 for (Int_t y=1; y<=p->GetNbinsY(); y++)
14218 pc->Fill(TMath::Abs(p->GetXaxis()->GetBinCenter(x)), TMath::Abs(p->GetYaxis()->GetBinCenter(y)), p->GetBinContent(x, y));
14219 pc->GetXaxis()->SetRangeUser(0, 100);
14220 pc->GetYaxis()->SetRangeUser(0, 100);
14227 p->DrawCopy("COLZ");
14233 proj[0]->Divide(proj[1]);
14234 proj[0]->SetStats(0);
14236 // Float_t scale = proj[1]->Integral(0, proj[1]->GetNbinsX()+1, 0, proj[1]->GetNbinsY()+1) / proj[0]->Integral(0, proj[1]->GetNbinsX()+1, 0, proj[1]->GetNbinsY()+1);
14237 Float_t scale = proj[0]->Integral(1, proj[1]->GetNbinsX(), 1, proj[1]->GetNbinsY()) / proj[1]->GetNbinsX() / proj[1]->GetNbinsY();
14238 proj[0]->Scale(1./ scale / 4);
14239 proj[0]->DrawCopy("COLZ");
14245 void PlotTwoTrackEfficiencyControlPlots3(const char* fileName, Int_t histID = 0)
14248 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14249 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14251 Float_t ptRange[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0 };
14253 graph = new TGraphErrors;
14255 for (Int_t ptID = 0; ptID < 5; ptID++)
14257 c = new TCanvas(Form("c%d", ptID), Form("%.0f < pT < %.0f", ptRange[ptID], ptRange[ptID+1]), 1200, 400);
14262 for (Int_t i=0; i<3; i++)
14265 gPad->SetRightMargin(0.2);
14269 AliUEHistograms* input = ((i == 0) ? h : hMixed);
14270 input->GetTwoTrackDistance(histID)->GetZaxis()->SetRangeUser(ptRange[ptID] + 0.01, ptRange[ptID+1] - 0.01);
14271 p = (TH2*) input->GetTwoTrackDistance(histID)->Project3D(Form("yx_%d_%d", i, ptID));
14275 // reduce to one quadrant
14276 pc = (TH2*) p->Clone(Form("%s_pc", p->GetName()));
14278 // pc->Rebin2D(2, 2);
14279 for (Int_t x=1; x<=p->GetNbinsX(); x++)
14280 for (Int_t y=1; y<=p->GetNbinsY(); y++)
14281 pc->Fill(TMath::Abs(p->GetXaxis()->GetBinCenter(x)), TMath::Abs(p->GetYaxis()->GetBinCenter(y)), p->GetBinContent(x, y));
14282 pc->GetXaxis()->SetRangeUser(0, 100);
14283 pc->GetYaxis()->SetRangeUser(0, 100);
14290 p->DrawCopy("COLZ");
14296 Float_t scale = proj[0]->Integral() / proj[1]->Integral();
14297 proj[0]->Divide(proj[1]);
14298 proj[0]->SetStats(0);
14300 // Float_t scale = proj[1]->Integral(0, proj[1]->GetNbinsX()+1, 0, proj[1]->GetNbinsY()+1) / proj[0]->Integral(0, proj[1]->GetNbinsX()+1, 0, proj[1]->GetNbinsY()+1);
14301 // Float_t scale = proj[0]->Integral(1, proj[1]->GetNbinsX(), 1, proj[1]->GetNbinsY()) / proj[1]->GetNbinsX() / proj[1]->GetNbinsY();
14302 proj[0]->Scale(1./ scale);
14303 // proj[0]->Scale(1./ scale / 4);
14304 proj[0]->DrawCopy("COLZ");
14312 void SystematicpTResolution(const char* inputYield, Int_t caseId = 18, Int_t triggerId = 1)
14314 // Study by Jacek comparing TPC only tracks with global tracks for new cuts (crossed rows) (Fwd by Andrew, 07.07.11)
14315 // Resolution from tpc only tracks twice as worse than global tracks
14316 // Parameterization for tpc-only tracks:
14317 // f(pT) = a * pT * sqrt(1+b/(pT^abs(c)))
14318 // a = 0.003; b = 2.08; c = 7.07e-7
14319 Float_t a = 0.003; Float_t b = 2.08; Float_t c = 7.07e-7;
14320 res = new TF1("res", "[0] * x * sqrt(1+[1]/(x**abs([2])))", 0, 15);
14321 res->SetParameters(a, b, c);
14322 // res->Draw(); return;
14324 ReadYields(inputYield);
14326 for (Int_t side = 0; side < 2; side++)
14328 for (Int_t centrality = 0; centrality < 4; centrality++)
14330 TGraphErrors** tmp = yields[side][triggerId][centrality];
14331 graph = tmp[caseId];
14333 // graph->DrawClone("A*");
14335 Float_t axisLimits[20];
14336 for (Int_t i=0; i<graph->GetN(); i++)
14338 axisLimits[i] = graph->GetX()[i] - graph->GetEX()[i];
14339 axisLimits[i+1] = graph->GetX()[i] + graph->GetEX()[i];
14342 hist = new TH1F("hist", "", graph->GetN(), axisLimits);
14344 for (Int_t i=0; i<graph->GetN(); i++)
14346 gaus = new TF1("gaus", "gaus(0)", 0, 15);
14347 Float_t sigma = graph->GetX()[i] * res->Eval(graph->GetX()[i]);
14348 Float_t norm = graph->GetY()[i] / TMath::Sqrt(2 * TMath::Pi()) / sigma;
14349 gaus->SetParameters(norm, graph->GetX()[i], sigma);
14350 // gaus->Draw("SAME");
14351 // Printf("%f %f", graph->GetY()[i], gaus->Integral(0, 20));
14354 for (Int_t j=1; j<=hist->GetNbinsX(); j++)
14355 hist->SetBinContent(j, hist->GetBinContent(j) + gaus->Integral(hist->GetBinLowEdge(j), hist->GetXaxis()->GetBinUpEdge(j)));
14358 // hist->Draw("SAME"); return;
14360 for (Int_t i=0; i<graph->GetN(); i++)
14361 graph->GetY()[i] = hist->GetBinContent(i+1);
14363 // graph->SetMarkerColor(2); graph->DrawClone("*SAME");
14368 void DrawProcessIDPlot(const char* fileName)
14372 TFile::Open(fileName);
14373 list = (TList*) gFile->Get("PWG4_PhiCorrelations/histosPhiCorrelations");
14374 ((TH1*) list->FindObject("processIDs"))->Draw();
14377 void GetExampleDphi(const char* fileName)
14381 Int_t leadingPtOffset = 1;
14383 Int_t maxLeadingPt = 5;
14384 Int_t maxAssocPt = 6;
14387 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 15.0, 20.0 };
14388 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
14392 Float_t leadingPtArr[] = { 0.15, 10.0 };
14393 Float_t assocPtArr[] = { 0.15, 10.0 };
14395 leadingPtOffset = 1;
14397 // AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14398 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14402 // h->SetZVtxRange(-0.99, 0.99);
14403 hMixed->SetZVtxRange(-0.99, 0.99);
14409 gpTMin = assocPtArr[j] + 0.01;
14410 gpTMax = assocPtArr[j+1] - 0.01;
14413 SetupRanges(hMixed);
14416 bin[0] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(0)->FindBin(0.01);
14417 bin[1] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(1)->FindBin(1.1);
14418 bin[2] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(2)->FindBin(2.1);
14419 bin[3] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(3)->FindBin(5.5);
14420 bin[4] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(4)->FindBin(0);
14421 if (hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5))
14422 bin[5] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5)->FindBin(0);
14423 Printf("tracks: %f +- %f", hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetBinContent(bin), hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetBinError(bin));
14425 bin[0] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(2)->FindBin(2.1);
14426 bin[1] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(3)->FindBin(5.5);
14427 if (hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5))
14428 bin[2] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5)->FindBin(0);
14429 Printf("events: %f +- %f", hMixed->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetBinContent(bin), hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetBinError(bin));
14433 Int_t stepMixed = 6;
14434 TH2* mixedTwoD = (TH2*) hMixed->GetUEHist(2)->GetUEHist(stepMixed, 0, leadingPtArr[i+leadingPtOffset], leadingPtArr[i+1+leadingPtOffset], 12, 13, 1, kFALSE);
14436 TH1* proj = mixedTwoD->ProjectionX("px", 11, 30);
14442 func = new TF1("func", "gaus(0)", -2, 2);
14443 func->SetParameters(1, 0, 0.5);
14445 hist = new TH1F("hist", "", 100, -2, 2);
14446 hist->FillRandom("func", 10000);
14448 func = new TF1("func", "gaus(0)", -2, 2);
14449 func->SetParLimits(2, 0, 10);
14450 func->FixParameter(1, 0);
14451 func->SetParameters(2, 0, 0.1);
14452 hist->Fit(func, "", "", -1, 1);
14455 func2 = new TF1("func2", "gaus(0)+[3]", -2, 2);
14456 func2->SetParLimits(2, 0, 10);
14457 func2->FixParameter(1, 0);
14458 func2->SetParameters(2, 0, 0.1, 0);
14459 func2->SetLineColor(2);
14460 hist->Fit(func2, "+", "", -1, 1);
14465 constant = new TF1("constant", "1", -2, 2);
14466 hist->Add(constant, -30);
14467 func->SetParameters(2, 0, 0.1);
14468 hist->Fit(func, "", "", -1, 1);
14471 void GaussToyFit2()
14473 func = new TF2("func", "[0]*exp(-0.5*((x/[1])**2+(y/[2])**2))", -2, 2, -2, 2);
14474 func->SetParameters(1, 0.4, 0.6);
14476 hist = new TH2F("hist", "", 100, -2, 2, 100, -2, 2);
14477 hist->FillRandom("func", 100000);
14479 func = new TF2("func", "[0]*exp(-0.5*((x/[1])**2+(y/[2])**2))", -2, 2, -2, 2);
14480 func->SetParameters(1, 0.2, 0.2);
14481 hist->Fit(func, "", "");
14485 hist->ProjectionX()->Fit("gaus");
14488 hist->ProjectionY()->Fit("gaus");
14491 void AcceptanceToy()
14493 // study a la Jan Rak presented in Corr PAG on 06.03.12
14495 hist = new TH1F("hist", "", 200, -1.5, 1.5);
14497 Float_t sigma = 0.3;
14498 for (Int_t i=0; i<1000000; i++)
14501 Float_t mean = gRandom->Uniform(-5, 5);
14503 Float_t trig = gRandom->Gaus(mean, sigma);
14504 Float_t assoc = gRandom->Gaus(mean, sigma);
14506 // Float_t trig = gRandom->Uniform(-5, 5);
14507 // Float_t assoc = gRandom->Uniform(-5, 5);
14509 /* if (trig < 0 && assoc < trig)
14511 if (trig > 0 && assoc > trig)
14514 if (TMath::Abs(trig) < 1 && TMath::Abs(assoc) < 1)
14515 // hist->Fill(trig - assoc);
14516 hist->Fill(trig - assoc, 1.0 / (1.0 - TMath::Abs(trig-assoc) / 2));
14520 hist->Fit("gaus", "", "", -1.5, 1.5);
14521 Printf("%f %f %f", sigma, hist->GetFunction("gaus")->GetParameter(2), hist->GetFunction("gaus")->GetParameter(2) / TMath::Sqrt(2));
14522 hist->GetFunction("gaus")->SetLineColor(2);
14525 void DrawEfficiency(const char* fileName, Int_t step1, Int_t step2)
14532 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14533 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14536 SetupRanges(hMixed);
14541 GetDistAndFlow(h, hMixed, &hist1, 0, step1, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
14542 GetDistAndFlow(h, hMixed, &hist2, 0, step2, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
14544 ((TH2*)hist1)->Rebin2D(2, 2);
14545 ((TH2*)hist2)->Rebin2D(2, 2);
14547 new TCanvas("c", "c", 800, 800);
14548 gPad->SetLeftMargin(0.15);
14549 hist1->SetTitle("");
14550 hist1->GetYaxis()->SetRangeUser(-1.39, 1.39);
14551 hist1->GetXaxis()->SetTitleOffset(1.5);
14552 hist1->GetYaxis()->SetTitleOffset(2);
14553 hist1->SetStats(kFALSE);
14554 hist1->DrawCopy("SURF1");
14556 new TCanvas("c2", "c2", 800, 800);
14557 gPad->SetLeftMargin(0.15);
14558 hist2->SetTitle("");
14559 hist2->GetYaxis()->SetRangeUser(-1.39, 1.39);
14560 hist2->GetXaxis()->SetTitleOffset(1.5);
14561 hist2->GetYaxis()->SetTitleOffset(2);
14562 hist2->SetStats(kFALSE);
14563 hist2->DrawCopy("SURF1");
14565 hist2->Divide(hist1);
14567 new TCanvas("c3", "c3", 800, 800);
14568 gPad->SetLeftMargin(0.15);
14569 hist2->SetTitle("");
14570 hist2->GetYaxis()->SetRangeUser(-1.39, 1.39);
14571 hist2->GetXaxis()->SetTitleOffset(1.5);
14572 hist2->GetYaxis()->SetTitleOffset(2);
14573 hist2->SetStats(kFALSE);
14574 hist2->Draw("SURF1");
14577 void RewriteObjects(const char* fileName)
14581 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14582 Int_t nAxes = ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0)->GetNVar());
14583 Printf("We have %d axes", nAxes);
14585 TString histId; histId.Form("%dRC", nAxes-1);
14586 Printf("%s", histId.Data());
14588 AliUEHistograms* hNew = new AliUEHistograms(h->GetName(), histId);
14592 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14593 AliUEHistograms* hMixedNew = new AliUEHistograms(hMixed->GetName(), histId);
14594 hMixedNew->DeepCopy(hMixed);
14597 TString newFileName(fileName);
14598 newFileName.ReplaceAll(".root", "");
14599 newFileName += "_rebinned.root";
14603 list->Add(hMixedNew);
14605 file3 = TFile::Open(newFileName, "RECREATE");
14606 file3->mkdir("PWG4_PhiCorrelations");
14607 file3->cd("PWG4_PhiCorrelations");
14608 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14612 void CondenseCentrality(const char* fileName, Float_t targetValue, Int_t step = 0, Float_t from = 0, Float_t to = -1)
14616 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14617 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14619 h->GetUEHist(2)->CondenseBin(step, 3, 1, targetValue, from, to);
14620 hMixed->GetUEHist(2)->CondenseBin(step, 3, 1, targetValue, from, to);
14622 Float_t events = h->GetCentralityDistribution()->Integral();
14623 h->GetCentralityDistribution()->Reset();
14624 h->GetCentralityDistribution()->Fill(targetValue, events);
14626 events = hMixed->GetCentralityDistribution()->Integral();
14627 hMixed->GetCentralityDistribution()->Reset();
14628 hMixed->GetCentralityDistribution()->Fill(targetValue, events);
14630 TString newFileName(fileName);
14631 newFileName.ReplaceAll(".root", "");
14632 newFileName += "_condensed.root";
14638 file3 = TFile::Open(newFileName, "RECREATE");
14639 file3->mkdir("PWG4_PhiCorrelations");
14640 file3->cd("PWG4_PhiCorrelations");
14641 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14645 void SymmetrizepTBins(const char* fileName)
14647 // copy pt,a < pt,t bins to pt,a > pt,t
14652 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, &list);
14653 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14655 h->GetUEHist(2)->SymmetrizepTBins();
14656 hMixed->GetUEHist(2)->SymmetrizepTBins();
14658 TString newFileName(fileName);
14659 newFileName.ReplaceAll(".root", "");
14660 newFileName += "_symmetrized.root";
14662 file3 = TFile::Open(newFileName, "RECREATE");
14663 file3->mkdir("PWG4_PhiCorrelations");
14664 file3->cd("PWG4_PhiCorrelations");
14665 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14669 void PtDistributions(Int_t step = 8, Float_t centralityBegin = 1, Float_t centralityEnd = 10)
14673 // const char* fileNames[] = { "LHC10h_AOD086_120411_zvtx_rebinned_corrected.root", "LHC10h_AOD086_120411_hybrid_zvtx_rebinned_corrected.root", "LHC10h_AOD086_120430_raacuts_zvtx_rebinned_corrected.root" };
14675 // const char* fileNames[] = { "LHC10h_AOD086_120411_zvtx_rebinned.root", "LHC10h_AOD086_120411_hybrid_zvtx_rebinned.root", "LHC10h_AOD086_120430_raacuts_zvtx_rebinned.root" };
14676 const char* fileNames[] = { "pt_pos.root", "pt_neg.root" };
14677 // const char* fileNames[] = { "LHC11a10a_bis_AOD090_120406_zvtx.root" };
14679 // Float_t eventCount[] = { 1098234., 1034306., 1369707. };
14680 // Float_t eventCount[] = { 987360.000000, 930278.000000, 1231806.000000 };
14681 Float_t eventCount[] = { 1., 1. };
14686 for (Int_t i=0; i<2; i++)
14688 /* AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNames[i]);
14690 h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
14691 ptDist = h->GetUEHist(2)->GetEventHist()->Project(step, 0);*/
14693 /* eventCount = h->GetEventCount();
14694 Float_t events = eventCount->Integral(eventCount->GetXaxis()->FindBin(step), eventCount->GetXaxis()->FindBin(step), eventCount->GetYaxis()->FindBin(0.01 + centralityBegin), eventCount->GetYaxis()->FindBin(-0.01 + centralityEnd));*/
14695 Float_t events = eventCount[i];
14697 TFile::Open(fileNames[i]);
14698 ptDist = (TH2*) gFile->Get("ptDist");
14700 ptDistProj = ptDist->ProjectionX(Form("ptDistProj_%d", i), ptDist->GetYaxis()->FindBin(0.01 + centralityBegin), ptDist->GetYaxis()->FindBin(-0.01 + centralityEnd));
14702 // new TCanvas; ptDistProj->Draw(); gPad->SetLogy();
14705 ptDistProj->Scale(1.0 / events);
14707 ptDistProj->SetLineColor(i+1);
14708 ptDistProj->DrawCopy((i == 0) ? "" : "SAME");
14710 pt[i] = (TH1*) ptDistProj->Clone(Form("clone_%d", i));
14715 for (Int_t i=1; i<2; i++)
14717 pt[i]->Divide(pt[0]);
14718 pt[i]->DrawCopy((i == 1) ? "" : "SAME");
14722 void test(const char* fileNameESD)
14727 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD);
14731 ptDist = (TH2*) esd->GetUEHist(2)->GetEventHist()->Project(step, 0, 1);
14733 Printf("%f", ptDist->Integral());
14736 void CorrectPtDistribution(const char* fileNameCorrections, const char* fileNameESD, const char* outputFile)
14742 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
14745 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD, &list);
14750 corr->SetEtaRange(-0.89, 0.89);
14751 corr->ExtendTrackingEfficiency(0);
14753 eff = corr->GetUEHist(2)->GetTrackingEfficiencyCorrectionCentrality();
14754 new TCanvas; eff->Draw("COLZ");
14756 cont = corr->GetUEHist(2)->GetTrackingContaminationCentrality();
14757 new TCanvas; cont->Draw("COLZ");
14759 ptDist = (TH2*) esd->GetUEHist(2)->GetEventHist()->Project(step, 0, 1);
14760 ptDist->SetStats(0);
14761 new TCanvas; ptDist->DrawCopy("COLZ");
14763 for (Int_t x=1; x<=ptDist->GetNbinsX(); x++)
14764 for (Int_t y=1; y<=ptDist->GetNbinsY(); y++)
14766 Float_t factor = eff->GetBinContent(eff->GetXaxis()->FindBin(ptDist->GetXaxis()->GetBinCenter(x)), eff->GetYaxis()->FindBin(ptDist->GetYaxis()->GetBinCenter(y)));
14767 Float_t contFactor = cont->GetBinContent(cont->GetXaxis()->FindBin(ptDist->GetXaxis()->GetBinCenter(x)), cont->GetYaxis()->FindBin(ptDist->GetYaxis()->GetBinCenter(y)));
14769 printf("%f", contFactor);
14770 if (contFactor > 0)
14771 contFactor = 1.0 + 1.1 * (contFactor - 1.0);
14772 printf(" --> %f\n", contFactor);
14774 factor *= contFactor;
14776 ptDist->SetBinContent(x, y, ptDist->GetBinContent(x, y) * factor);
14777 ptDist->SetBinError(x, y, ptDist->GetBinError(x, y) * factor);
14780 new TCanvas; ptDist->DrawCopy("COLZ");
14782 file3 = TFile::Open(outputFile, "RECREATE");
14783 ptDist->Write("ptDist");
14791 void CorrectPtDistributionAll()
14793 CorrectPtDistribution("LHC11a10a_bis_AOD090_120406.root", "LHC10h_AOD086_120411_zvtx_rebinned.root", "ptdist1.root");
14794 CorrectPtDistribution("LHC11a10a_bis_AOD090_120505_zvtx_hybrid.root", "LHC10h_AOD086_120411_hybrid_zvtx_rebinned.root", "ptdist2.root");
14795 CorrectPtDistribution("LHC11a10a_bis_AOD090_120505_zvtx_raa.root", "LHC10h_AOD086_120430_raacuts_zvtx_rebinned.root", "ptdist3.root");
14798 void CreateNormalizationTestObject(Bool_t addRidge = kFALSE)
14801 gSystem->Load("libPWGCFCorrelationsDPhi");
14803 AliUEHistograms* hNew = new AliUEHistograms("AliUEHistogramsSame", "5RC");
14805 // fill 1000 particles in one bin
14806 TObjArray* particles = new TObjArray;
14807 particles->Add(new AliDPhiBasicParticle(0, 0, 3.5, 1));
14808 for (Int_t i=0; i<2000; i++)
14809 particles->Add(new AliDPhiBasicParticle(gRandom->Gaus(0, 0.3), gRandom->Gaus(0, 0.3), 1.75, 1));
14811 hNew->FillCorrelations(61, 0, 8, particles);
14815 for (Int_t i=0; i<10000; i++)
14816 particles->Add(new AliDPhiBasicParticle(gRandom->Uniform(-2, 2), gRandom->Gaus(0, 0.5), 1.75, 1));
14819 hNew->FillCorrelations(0.5, 0, 8, particles);
14821 // fill flat mixed event
14822 AliUEHistograms* hMixedNew = new AliUEHistograms("AliUEHistogramsMixed", "5RC");
14823 THnSparse* sparse = hMixedNew->GetUEHist(2)->GetTrackHist(0)->GetGrid(8)->GetGrid();
14824 for (Int_t x=1; x<=sparse->GetAxis(0)->GetNbins(); x++)
14825 for (Int_t y=1; y<=sparse->GetAxis(4)->GetNbins(); y++)
14828 bin[0] = sparse->GetAxis(0)->GetBinCenter(x);
14829 bin[4] = sparse->GetAxis(4)->GetBinCenter(y);
14851 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14854 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14858 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14861 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14863 ((AliTHn*) hNew->GetUEHist(2)->GetTrackHist(0))->FillParent();
14864 ((AliTHn*) hNew->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
14866 ((AliTHn*) hMixedNew->GetUEHist(2)->GetTrackHist(0))->FillParent();
14867 ((AliTHn*) hMixedNew->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
14871 list->Add(hMixedNew);
14873 file3 = TFile::Open("norm.root", "RECREATE");
14874 file3->mkdir("PWG4_PhiCorrelations");
14875 file3->cd("PWG4_PhiCorrelations");
14876 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14880 void CompareSumOfRatiosAndDefault(const char* fileName, Int_t bin, Int_t step)
14884 Int_t centralityFrom = 0;
14885 Int_t centralityTo = 20;
14890 Float_t ptTrigBegin = 2.01;
14891 Float_t ptTrigEnd = 3.99;
14895 ptTrigBegin = 1.01;
14902 ptTrigBegin = 0.49;
14906 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14907 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14910 SetupRanges(hMixed);
14914 GetSumOfRatios(h, hMixed, &hist1, step, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, kTRUE);
14915 GetDistAndFlow(h, hMixed, &hist2, 0, step, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE);
14917 hist1->Rebin2D(2, 2); hist1->Scale(0.25);
14918 hist2->Rebin2D(2, 2); hist2->Scale(0.25);
14920 c = new TCanvas("c", "c", 1000, 1000);
14924 hist1->DrawCopy("SURF1");
14927 hist2->DrawCopy("SURF1");
14930 proj1 = ((TH2*) hist1)->ProjectionY("proj1", hist1->GetXaxis()->FindBin(-0.99), hist1->GetXaxis()->FindBin(0.99));
14932 proj2 = ((TH2*) hist2)->ProjectionY("proj2", hist2->GetXaxis()->FindBin(-0.99), hist2->GetXaxis()->FindBin(0.99));
14933 proj2->SetLineColor(2);
14934 proj2->DrawCopy("SAME");
14937 proj1->Divide(proj1, proj2, 1, 1, "B");
14941 hist1->Divide(hist2);
14942 hist1->DrawCopy("SURF1");
14945 void PtDistribution(const char* fileName, Int_t step, Int_t bin = 0)
14947 Int_t centralityFrom = 0;
14948 Int_t centralityTo = 80;
14950 Float_t ptTrigBegin = 2.01;
14951 Float_t ptTrigEnd = 3.99;
14955 ptTrigBegin = 1.01;
14960 ptTrigBegin = 0.51;
14966 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14968 Int_t centralityBeginBin = 0;
14969 Int_t centralityEndBin = -1;
14971 if (centralityTo >= centralityFrom)
14973 centralityBeginBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityFrom);
14974 centralityEndBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityTo);
14977 pt1 = h->GetUEHist(2)->GetPtHist(step, 0, ptTrigBegin, ptTrigEnd, centralityBeginBin, centralityEndBin, TMath::Pi()/2 - 0.2, TMath::Pi()/2 + 0.2, -1.99, 1.99);
14978 pt2 = h->GetUEHist(2)->GetPtHist(step, 0, ptTrigBegin, ptTrigEnd, centralityBeginBin, centralityEndBin, -0.5, 0.5, -1.99, 1.99);
14982 pt2->SetLineColor(2);
14983 pt2->DrawCopy("SAME");
14986 // TODO proper subtraction, to get the pT distribution in the peak
14989 void GetRefMultiplicity(const char* fileNameESD, const char* tag = "")
14995 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD, 0, kFALSE, tag);
14997 Float_t centrBins[] = { 0, 20, 40, 60, 100 };
14998 // Float_t centrBins[] = { 0, 100 };
15000 // NOTE Run it on data with limited zvtx range so that there are no empty bins in the corrections!
15002 for (Int_t i=0; i<4; i++)
15004 Float_t centrBegin = centrBins[i] + 0.1;
15005 Float_t centrEnd = centrBins[i+1] - 0.1;
15006 esd->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(centrBegin, centrEnd);
15008 ptDist = (TH2*) esd->GetUEHist(2)->GetEventHist()->Project(step, 0);
15010 centrDist = esd->GetCentralityDistribution();
15014 // add syst from R_pA
15015 for (Int_t j=1; j<=ptDist->GetNbinsX(); j++)
15016 ptDist->SetBinError(j, TMath::Sqrt(ptDist->GetBinError(j) * ptDist->GetBinError(j) + 0.052 * 0.052 * ptDist->GetBinContent(j) * ptDist->GetBinContent(j)));
15019 Float_t events = centrDist->Integral(centrDist->FindBin(centrBegin), centrDist->FindBin(centrEnd));
15020 Double_t error = 0;
15021 // Float_t integral = ptDist->IntegralAndError(ptDist->FindBin(0.51), ptDist->FindBin(3.99), error);
15022 Float_t integral = ptDist->IntegralAndError(ptDist->FindBin(0.51), ptDist->FindBin(7.99), error);
15023 Printf("%d: %f +- %f %f --> %f +- %F", i, integral, error, events, integral / events, error / events);
15025 ptDist->Scale(1.0 / events);
15026 // ptDist->Scale(1.0 / integral);
15028 // ptDist->Rebin(2);
15030 NormalizeToBinWidth(ptDist);
15031 ptDist->SetLineColor(i + 1);
15032 ptDist->DrawCopy((i == 0) ? "" : "SAME");
15036 TFile::Open("dNdPt_pPb_lab_MinBias_NEW.root");
15037 comparison = (TH1*) gFile->Get("dNdPt_pPb_eta08_stat");
15038 comparison->Scale(1.6); // normalize to my eta range
15039 comparison->SetLineColor(2);
15040 comparison->DrawCopy("SAME");
15043 for (Int_t i=1; i<=comparison->GetNbinsX(); i++)
15045 // multiply by bin width
15046 comparison->SetBinContent(i, comparison->GetBinContent(i) * comparison->GetBinWidth(i));
15047 comparison->SetBinError(i, comparison->GetBinError(i) * comparison->GetBinWidth(i));
15050 Float_t integral = comparison->IntegralAndError(comparison->FindBin(0.51), comparison->FindBin(7.99), error);
15051 Float_t integral2 = comparison->IntegralAndError(comparison->FindBin(0.51), comparison->FindBin(19.99), error);
15052 Printf("%f %f", integral, integral2);
15054 Float_t integral = comparison->IntegralAndError(comparison->FindBin(0.51), comparison->FindBin(7.99), error);
15055 Float_t integral2 = comparison->IntegralAndError(comparison->FindBin(0.61), comparison->FindBin(7.99), error);
15056 Printf("%f %f", integral, integral2);
15058 rebinned = comparison->Rebin(ptDist->GetNbinsX(), "rebinned", ptDist->GetXaxis()->GetXbins()->GetArray());
15061 NormalizeToBinWidth(rebinned);
15062 rebinned->Draw("SAME");
15065 ptDist->Divide(rebinned);
15071 syst = (TH1*) gFile->Get("dNdPt_pPb_eta08_syst");
15075 for (Int_t i=1; i<=syst->GetNbinsX(); i++)
15077 if (syst->GetBinContent(i) > 0)
15078 syst->SetBinContent(i, syst->GetBinError(i) / syst->GetBinContent(i));
15079 syst->SetBinError(i, 0);
15084 void CheckBin(const char* fileName)
15088 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
15089 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
15091 sparse = h->GetUEHist(2)->GetTrackHist(0)->GetGrid(8)->GetGrid();
15092 sparse->GetAxis(1)->SetRangeUser(5, 5.1);
15093 sparse->GetAxis(2)->SetRangeUser(7, 7.1);
15094 sparse->GetAxis(3)->SetRangeUser(90, 91);
15095 sparse->GetAxis(4)->SetRangeUser(9, 9.1);
15098 sparse->Projection(0, 4)->Draw("colz");
15100 sparse = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(8)->GetGrid();
15101 sparse->GetAxis(1)->SetRangeUser(5, 5.1);
15102 sparse->GetAxis(2)->SetRangeUser(7, 7.1);
15103 sparse->GetAxis(3)->SetRangeUser(90, 91);
15104 sparse->GetAxis(4)->SetRangeUser(9, 9.1);
15107 sparse->Projection(0, 4)->Draw("colz");
15110 void GetCorrectedYields(const char* fileName, const char* correctionFile, const char* tagCorrections = "", Int_t partSpecies=-1 )
15114 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
15116 // centrality, pT, eta
15117 yieldsUncorr = h->GetYield();
15118 new TCanvas; yieldsUncorr->DrawCopy();
15119 // new TCanvas; yieldsUncorr->ProjectionX("x1")->DrawCopy();
15121 AliUEHistograms* hCorr = (AliUEHistograms*) GetUEHistogram(correctionFile, 0, kFALSE, tagCorrections);
15122 if(partSpecies!=-1){
15123 Double_t epsilon=0.001;
15124 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
15125 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(4)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
15128 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->GetAxis(4)->SetRangeUser(-1.9, 1.9);
15129 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(2)->GetGrid()->GetAxis(4)->SetRangeUser(-1.9, 1.9);
15130 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(4)->GetGrid()->GetAxis(4)->SetRangeUser(-1.9, 1.9);
15133 TH2* generated = hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->Projection(1, 0);
15134 TH2* measured = hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid((partSpecies==-1)?2:4)->GetGrid()->Projection(1, 0);
15136 Printf("%f %f", generated->GetEntries(), measured->GetEntries());
15138 new TCanvas; generated->Draw("COLZ");
15139 new TCanvas; measured->Draw("COLZ");
15141 effCorr = (TH2*) generated->Clone("correction");
15142 effCorr->Divide(generated, measured, 1, 1, "B");
15144 new TCanvas; effCorr->Draw("COLZ");
15148 yieldsCorr = (TH3F*) yieldsUncorr->Clone("fYieldsCorr");
15149 yieldsCorr->Reset();
15151 for (Int_t x=1; x<=yieldsUncorr->GetNbinsX(); x++)
15152 for (Int_t y=1; y<=yieldsUncorr->GetNbinsY(); y++)
15153 for (Int_t z=1; z<=yieldsUncorr->GetNbinsZ(); z++)
15155 Double_t factor = effCorr->GetBinContent(effCorr->GetXaxis()->FindBin(yieldsUncorr->GetZaxis()->GetBinCenter(z)), effCorr->GetYaxis()->FindBin(yieldsUncorr->GetYaxis()->GetBinCenter(y)));
15156 yieldsCorr->SetBinContent(x, y, z, yieldsUncorr->GetBinContent(x, y, z) * factor);
15157 yieldsCorr->SetBinError(x, y, z, yieldsUncorr->GetBinError(x, y, z) * factor);
15160 new TCanvas; yieldsCorr->DrawCopy();
15162 TFile::Open("corr_yield.root", "RECREATE");
15163 yieldsCorr->Write();
15166 // normalize per event
15167 centrDist = h->GetCentralityCorrelation()->ProjectionX();
15168 new TCanvas; centrDist->Draw();
15170 for (Int_t x=1; x<=yieldsCorr->GetNbinsX(); x++)
15172 Double_t factor = centrDist->Integral(centrDist->FindBin(yieldsCorr->GetXaxis()->GetBinLowEdge(x)+0.0001), centrDist->FindBin(yieldsCorr->GetXaxis()->GetBinUpEdge(x)-0.0001));
15173 // Printf("%d %f %f %d %d %f", x, yieldsCorr->GetXaxis()->GetBinLowEdge(x), yieldsCorr->GetXaxis()->GetBinUpEdge(x), centrDist->FindBin(yieldsCorr->GetXaxis()->GetBinLowEdge(x)+0.0001), centrDist->FindBin(yieldsCorr->GetXaxis()->GetBinUpEdge(x)-0.0001), factor);
15177 for (Int_t y=0; y<=yieldsCorr->GetNbinsY()+1; y++)
15178 for (Int_t z=0; z<=yieldsCorr->GetNbinsZ()+1; z++)
15180 if (yieldsCorr->GetBinContent(x, y, z) > 0)
15182 yieldsCorr->SetBinContent(x, y, z, yieldsCorr->GetBinContent(x, y, z) / factor);
15183 yieldsCorr->SetBinError(x, y, z, yieldsCorr->GetBinError(x, y, z) / factor);
15185 if (yieldsUncorr->GetBinContent(x, y, z) > 0)
15187 yieldsUncorr->SetBinContent(x, y, z, yieldsUncorr->GetBinContent(x, y, z) / factor);
15188 yieldsUncorr->SetBinError(x, y, z, yieldsUncorr->GetBinError(x, y, z) / factor);
15193 TFile::Open("corr_yield.root", "UPDATE");
15194 yieldsCorr->Write("fYieldsCorr_per_event");
15195 centrDist->Write("events");
15198 // new TCanvas; yieldsUncorr->ProjectionX("x2")->DrawCopy(); return;
15200 yieldsUncorr->GetXaxis()->SetRangeUser(1, yieldsUncorr->GetNbinsX());
15202 new TCanvas; yieldsUncorr->Project3D("z1")->DrawCopy()->SetLineColor(1); yieldsCorr->Project3D("z2")->DrawCopy("SAME")->SetLineColor(2);
15204 yieldsUncorr->GetXaxis()->SetRangeUser(0.1, 9.9);
15205 yieldsCorr->GetXaxis()->SetRangeUser(0.1, 9.9);
15206 new TCanvas; yieldsUncorr->Project3D("z3")->DrawCopy()->SetLineColor(1); yieldsCorr->Project3D("z4")->DrawCopy("SAME")->SetLineColor(2);
15207 yieldsUncorr->GetXaxis()->SetRangeUser(60.1, 99.9);
15208 yieldsCorr->GetXaxis()->SetRangeUser(60.1, 99.9);
15209 yieldsUncorr->Project3D("z5")->DrawCopy("SAME")->SetLineColor(3); yieldsCorr->Project3D("z6")->DrawCopy("SAME")->SetLineColor(4);
15212 void PlotPtCentrality()
15214 TFile::Open("corr_yield.root");
15215 yieldsCorr = (TH3F*) gFile->Get("fYieldsCorr");
15217 yieldsCorr->GetZaxis()->SetRangeUser(-0.4999, 0.4999);
15218 yieldsProj = (TH2*) yieldsCorr->Project3D("yx");
15219 Printf("%f", yieldsProj->Integral());
15221 Float_t ptMin[] = { 0.5001, 1.0001, 2.0001 };
15222 Float_t ptMax = 10;
15224 for (Int_t i=0; i<3; i++)
15226 profile = yieldsProj->ProjectionX(Form("x%d", i), yieldsProj->GetYaxis()->FindBin(ptMin[i]), yieldsProj->GetYaxis()->FindBin(ptMax));
15227 profile->SetLineColor(i+1);
15228 profile->Draw((i > 0) ? "SAME" : "");
15232 void ExtractForAllSpecies()
15234 TString baseName = "LHC13b2_fix_1_Train";
15235 const char* suffix[] = { "55_Hadrons_symmetrized", "63_Pions", "63_Kaons", "63_Protons" };
15236 TString baseNameOutput = "dphi_corr_mc_130531_allpt_";
15238 for (Int_t i=0; i<4; i++)
15239 PlotDeltaPhiEtaGap(baseName + suffix[i] + ".root", 0, 0, 0, baseNameOutput + suffix[i] + ".root");
15242 void Compare2D(const char* fileName, const char* fileName2)
15251 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
15252 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
15254 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
15255 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileName2, 0, kTRUE);
15258 SetupRanges(hMixed);
15260 SetupRanges(hMixed2);
15262 // h->SetZVtxRange(0.1, 0.5);
15263 // hMixed->SetZVtxRange(0.1, 0.5);
15264 // h2->SetZVtxRange(0.1, 0.5);
15265 // hMixed2->SetZVtxRange(0.1, 0.5);
15268 GetDistAndFlow(h, 0, &hist1, 0, step, 0, 20, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
15271 GetDistAndFlow(h2, 0, &hist2, 0, step, 0, 20, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
15273 c = new TCanvas("c", "c", 1600, 800);
15276 gPad->SetLeftMargin(0.15);
15278 hist1->DrawCopy("SURF1");
15281 gPad->SetLeftMargin(0.15);
15283 hist2->DrawCopy("SURF1");
15285 Printf("%f %f", hist1->Integral(), hist2->Integral());
15287 new TCanvas("c3", "c3", 800, 800);
15288 gPad->SetLeftMargin(0.15);
15289 hist2->Divide(hist1);
15290 hist2->DrawCopy("COLZ");
15293 //Geant3/Fluka correction for tracking from the spectra analysis
15295 TrackingEff_geantflukaCorrection(Int_t ipart, Int_t icharge)
15298 if (ipart == 3 && icharge == kNegative) {
15299 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "TrackingPtGeantFlukaCorrectionKaMinus(x);p_{T};GF correction", 0., 5.);
15302 else if (ipart == 4 && icharge == kNegative) {
15303 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "TrackingPtGeantFlukaCorrectionPrMinus(x);p_{T};GF correction", 0., 5.);
15306 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "TrackingPtGeantFlukaCorrectionNull(x);p_{T};GF correction", 0., 5.);
15312 TrackingPtGeantFlukaCorrectionNull(Double_t pTmc)
15318 TrackingPtGeantFlukaCorrectionPrMinus(Double_t pTmc)
15320 return (1 - 0.129758 *TMath::Exp(-pTmc*0.679612));
15324 TrackingPtGeantFlukaCorrectionKaMinus(Double_t pTmc)
15326 return TMath::Min((0.972865 + 0.0117093*pTmc), 1.);
15329 //Geant3/Fluka correction for matching from the spectra analysis
15331 TOFmatchMC_geantflukaCorrection(Int_t ipart, Int_t icharge,Int_t ntrd)
15333 if (ipart == 3 && icharge == kNegative) {
15334 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]),Form("MatchingPtGeantFlukaCorrectionKaMinus(x,%d);p_{T};GF correction",ntrd), 0., 5.);
15337 else if (ipart == 4 && icharge == kNegative) {
15338 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]),Form("MatchingPtGeantFlukaCorrectionPrMinus(x,%d);p_{T};GF correction",ntrd), 0., 5.);
15341 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "MatchingPtGeantFlukaCorrectionNull(x);p_{T};GF correction", 0., 5.);
15348 MatchingPtGeantFlukaCorrectionNull(Double_t pTmc)
15353 MatchingPtGeantFlukaCorrectionKaMinus(Double_t pTmc, Int_t ntrd = 7)//ntrd is 7 in 2010, 10 in 2011, 13 in 2012+2013
15355 Float_t ptTPCoutK=pTmc*(1- 3.37297e-03/pTmc/pTmc - 3.26544e-03/pTmc);
15356 Float_t scale = (ntrd * 0.14638485 + (18 - ntrd) * 0.02406) / 18.;
15357 return TMath::Min((TMath::Power(0.972865 + 0.0117093*ptTPCoutK,scale/0.03471)), 1.);
15360 MatchingPtGeantFlukaCorrectionPrMinus(Double_t pTmc, Int_t ntrd = 7)//ntrd is 7 in 2010, 10 in 2011, 13 in 2012+2013
15362 Float_t ptTPCoutP =pTmc*(1-6.81059e-01*TMath::Exp(-pTmc*4.20094));
15363 Float_t scale = (ntrd * 0.14638485 + (18 - ntrd) * 0.02406) / 18.;
15364 return (TMath::Power(1 - 0.129758*TMath::Exp(-ptTPCoutP*0.679612),scale/0.03471));
15367 void Browse(const char* fileName)
15371 if (!gGrid && TString(fileName).BeginsWith("alien://"))
15372 TGrid::Connect("alien://");
15374 TFile::Open(fileName);
15379 void CalculateCentralityWeights(const char* fileName)
15383 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
15386 // Bool_t bins = kFALSE;
15388 // Int_t binning[] = { 0, 10, 20, 30, 50, 80 };
15389 // TH1* centralityDist = h->GetCentralityCorrelation()->ProjectionX();
15392 Bool_t bins = kTRUE;
15394 Int_t binning[] = { 1, 3, 4, 5, 7, 10 };
15395 TH1* centralityDist = h->GetCentralityDistribution();
15398 centralityDist->DrawCopy();
15400 for (Int_t i=0; i<n; i++)
15404 Int_t minBin = binning[i];
15405 Int_t maxBin = binning[i+1]-1;
15409 Int_t minBin = centralityDist->FindBin(binning[i]+0.01);
15410 Int_t maxBin = centralityDist->FindBin(binning[i+1]-0.01);
15413 Float_t min = centralityDist->GetBinContent(minBin);
15414 for (Int_t bin=minBin; bin<=maxBin; bin++)
15415 min = TMath::Min(min, centralityDist->GetBinContent(bin));
15417 for (Int_t bin=minBin; bin<=maxBin; bin++)
15418 centralityDist->SetBinContent(bin, min / centralityDist->GetBinContent(bin));
15421 for (Int_t bin=centralityDist->FindBin(binning[n]+0.01); bin<=centralityDist->GetNbinsX(); bin++)
15422 centralityDist->SetBinContent(bin, 1);
15425 centralityDist->DrawCopy();
15427 file = TFile::Open("centralityWeights.root", "RECREATE");
15428 centralityDist->Write("weights");
15432 Double_t gIntegral = 0;
15433 Double_t FitFunctionGauss(Double_t *x, Double_t *par)
15435 Double_t integralGaussian = TMath::Erf(1.8/TMath::Sqrt(2)/par[2]);
15436 Double_t par0 = gIntegral / integralGaussian;
15438 return par0/TMath::Sqrt(TMath::TwoPi())/par[2] * TMath::Exp(-0.5*x[0]*x[0]/par[2]/par[2]);
15441 void correction_gauss_one(Float_t begin, Float_t end, Bool_t silent = kTRUE)
15443 graph = new TGraph;
15444 graph2 = new TGraph;
15445 for (Float_t f=0.1; f<1.0; f+=0.01)
15447 TH1* hist = new TH1F("hist", "", 60, -3, 3);
15448 TF1* func = new TF1("func", "gaus(0)", -5, 5);
15451 func->SetParameters(1, 0, f);
15452 hist->FillRandom("func", 1000000);
15454 hist->Scale(1.0 / hist->GetMaximum());
15455 // hist->GetXaxis()->SetRangeUser(-1.39, 1.39);
15456 hist->SetLineWidth(2);
15458 clone = (TH1*) hist->Clone("clone");
15462 for (Int_t i=hist->FindBin(-0.29); i<=hist->FindBin(0.29); i++)
15463 hist->SetBinError(i, 1e4);
15472 func = new TF1("func", &FitFunctionGauss, -end, end, 3);
15473 func->FixParameter(0, 0);
15474 func->FixParameter(1, 0);
15475 func->SetParLimits(2, 0, 2);
15476 func->SetParameters(1, 0, 0.5);
15478 // hist->Fit("gaus", (silent) ? "0" : "", "", -end+0.01, end-0.01);
15479 gIntegral = hist->Integral(hist->FindBin(-1.79), hist->FindBin(1.79), "width");
15480 hist->Fit(func, (silent) ? "0" : "", "", -end+0.01, end-0.01);
15481 Float_t first = ((TF1*) hist->GetListOfFunctions()->First())->GetParameter(2);
15482 hist->GetYaxis()->SetRangeUser(-0.2, 1.05);
15484 Float_t offset = hist->Integral(hist->FindBin(begin+0.01), hist->FindBin(end-0.01)) / (hist->FindBin(end-0.01) - hist->FindBin(begin+0.01) + 1);
15485 Printf("%f", offset);
15487 TF1* constant = new TF1("constant", "1", -5, 5);
15488 clone->Add(constant, -offset);
15489 clone->SetLineColor(2);
15491 clone->Draw("same");
15492 // clone->Fit("gaus", (silent) ? "0" : "", "SAME", -end+0.01, end-0.01);
15493 gIntegral = clone->Integral(clone->FindBin(-1.79), clone->FindBin(1.79), "width");
15494 clone->Fit(func, (silent) ? "0" : "", "SAME", -end+0.01, end-0.01);
15495 Float_t second = ((TF1*) clone->GetListOfFunctions()->First())->GetParameter(2);
15497 Printf("%f %f", first, second);
15498 graph->SetPoint(graph->GetN(), second, first);
15499 graph2->SetPoint(graph2->GetN(), second, first / second);
15509 graph2->Draw("A*");
15510 // Printf("%f %f", hist->GetRMS(), clone->GetRMS());
15512 graph2->Write(Form("corr_%.1f_%.1f", begin, end));
15515 void correction_gauss()
15519 TFile::Open("sigma_correction.root", "RECREATE");
15521 gauss_one(1.4, 1.8);
15522 gauss_one(1.2, 1.8);
15523 gauss_one(0.5, 1.0);