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"};
19 void SetRanges(TAxis* axis)
21 if (strcmp(axis->GetTitle(), "leading p_{T} (GeV/c)") == 0)
22 axis->SetRangeUser(0, (gEnergy == 900) ? 10 : 25);
24 if (strcmp(axis->GetTitle(), "multiplicity") == 0)
25 axis->SetRangeUser(0, 10);
28 void SetRanges(TH1* hist)
30 SetRanges(hist->GetXaxis());
31 SetRanges(hist->GetYaxis());
32 SetRanges(hist->GetZaxis());
35 void Prepare1DPlot(TH1* hist)
40 hist->SetLineWidth(2);
41 hist->SetStats(kFALSE);
43 hist->GetXaxis()->SetLabelOffset(0.02);
44 hist->GetXaxis()->SetTitleOffset(1.3);
45 hist->GetYaxis()->SetTitleOffset(1.3);
50 TH1* GetSystematicUncertainty(TH1* corr, TH1* trackHist)
54 systError = (TH1*) corr->Clone("systError");
57 else // for dphi evaluation
58 systError = new TH1F("systError", "", 100, 0, 50);
60 Float_t constantUnc = 0;
62 // particle composition
63 constantUnc += 0.8 ** 2;
66 if (gEnergy == 900 && gpTMin < 1.0)
67 constantUnc += 1.0 ** 2;
68 else if (gEnergy == 900 && gpTMin < 1.5)
69 constantUnc += 0.5 ** 2;
70 if (gEnergy == 7000 && gpTMin < 1.0)
71 constantUnc += 1.0 ** 2;
72 else if (gEnergy == 7000 && gpTMin < 1.5)
73 constantUnc += 0.6 ** 2;
76 if (gEnergy == 900 && gpTMin < 1.0)
77 constantUnc += 2.5 ** 2;
78 else if (gEnergy == 900 && gpTMin < 1.5)
79 constantUnc += 2.0 ** 2;
81 constantUnc += 3.0 ** 2;
83 // difference corrected with pythia and phojet
84 if (gEnergy == 900 && gpTMin < 1.0)
85 constantUnc += 0.6 ** 2;
86 else if (gEnergy == 900 && gpTMin < 1.5)
87 constantUnc += 0.8 ** 2;
89 if (gEnergy == 7000 && gpTMin < 1.0)
92 constantUnc += 0.6 ** 2;
94 constantUnc += 0.8 ** 2;
96 constantUnc += 1.0 ** 2;
98 else if (gEnergy == 7000 && gpTMin < 1.5)
99 constantUnc += 1.0 ** 2;
101 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
102 systError->SetBinContent(bin, constantUnc);
105 if (gUEHist == 0 || gUEHist == 2)
106 systError->Fill(0.75, 4.0 ** 2);
108 systError->Fill(0.75, 5.0 ** 2);
113 systError->Fill(1.25, 1.0 ** 2);
114 else if (gpTMin < 1.5)
115 systError->Fill(1.25, 2.0 ** 2);
120 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
121 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 1.0 ** 2);
125 if (gUEHist == 0 && gUEHist == 1)
126 systError->Fill(0.75, 2.0 ** 2);
128 systError->Fill(0.75, 1.2 ** 2);
132 systError->Fill(0.75, 1.0 ** 2);
135 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
138 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 0.5 ** 2);
139 if (gEnergy == 7000 && systError->GetXaxis()->GetBinCenter(bin) < 1.5)
140 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 2.0 ** 2);
141 else if (gEnergy == 7000)
142 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 1.0 ** 2);
145 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
146 systError->SetBinContent(bin, TMath::Sqrt(systError->GetBinContent(bin)));
150 //new TCanvas; trackHist->Draw();
151 //new TCanvas; systError->DrawCopy("");
154 for (Int_t i=1; i<=trackHist->GetNbinsX(); i++)
155 uncFlat += trackHist->GetBinContent(i) * systError->GetBinContent(systError->FindBin(trackHist->GetBinCenter(i)));
156 if (trackHist->Integral() > 0)
157 uncFlat /= trackHist->Integral();
159 systError = (TH1F*) corr->Clone("systError");
162 for (Int_t i=1; i<=systError->GetNbinsX(); i++)
163 systError->SetBinContent(i, uncFlat);
165 //new TCanvas; systError->DrawCopy("");
168 systError->SetFillColor(kGray);
169 systError->SetFillStyle(1001);
170 systError->SetMarkerStyle(0);
171 systError->SetLineColor(0);
176 void DrawRatio(TH1* corr, TH1* mc, const char* name, TH1* syst = 0)
180 TCanvas* canvas3 = new TCanvas(name, name, 600, 600);
181 canvas3->Range(0, 0, 1, 1);
183 TPad* pad1 = new TPad(Form("%s_1", name), "", 0, 0.5, 0.98, 0.98);
186 TPad* pad2 = new TPad(Form("%s_2", name), "", 0, 0.02, 0.98, 0.5);
189 pad1->SetRightMargin(0.01);
190 pad2->SetRightMargin(0.01);
191 pad1->SetTopMargin(0.05);
192 pad1->SetLeftMargin(0.13);
193 pad2->SetLeftMargin(0.13);
194 pad2->SetBottomMargin(0.22);
196 // no border between them
197 pad1->SetBottomMargin(0);
198 pad2->SetTopMargin(0);
205 TLegend* legend = new TLegend(0.15, 0.65, 0.55, 0.90);
207 TLegend* legend = new TLegend(0.55, 0.65, 0.95, 0.90);
209 legend->SetFillColor(0);
210 legend->AddEntry(corr, "Corrected");
211 legend->AddEntry(mc, "MC prediction");
212 legend->SetTextSize(0.08);
216 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);
217 dummy->SetYTitle(corr->GetYaxis()->GetTitle());
219 //dummy = new TH2F("dummy", "", 100, corr->GetXaxis()->GetBinLowEdge(1), corr->GetXaxis()->GetBinUpEdge(corr->GetNbinsX()), 1000, 13.5, 20.5);
220 //dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
222 dummy->SetStats(kFALSE);
223 dummy->SetXTitle(corr->GetXaxis()->GetTitle());
224 dummy->GetYaxis()->SetTitleOffset(1);
225 Prepare1DPlot(dummy);
227 dummy->GetXaxis()->SetLabelSize(0.08);
228 dummy->GetYaxis()->SetLabelSize(0.08);
229 dummy->GetXaxis()->SetTitleSize(0.08);
230 dummy->GetYaxis()->SetTitleSize(0.08);
231 dummy->GetYaxis()->SetTitleOffset(0.8);
234 dummy->GetYaxis()->SetRangeUser(0, gForceRange);
238 if (0 && gUEHist != 2)
240 const char* regionStr[] = { "Toward Region", "Away Region", "Transverse Region" };
241 latex = new TLatex(0.65, 0.1, regionStr[gRegion]);
242 latex->SetTextSize(0.075);
249 systError = (TH1*) syst->Clone("corrSystError");
250 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
252 systError->SetBinError(bin, corr->GetBinContent(bin) * syst->GetBinContent(bin) / 100);
253 systError->SetBinContent(bin, corr->GetBinContent(bin));
256 systError->Draw("E2 ][ SAME");
262 if (strlen(gText) > 0)
264 latex = new TLatex(0.2, 0.2, gText);
266 latex->SetTextSize(0.06);
273 //pad2->SetBottomMargin(0.15);
277 TH1* ratio = (TH1*) mc->Clone("ratio");
280 Float_t minR = TMath::Min(0.91, ratio->GetMinimum() * 0.95);
281 Float_t maxR = TMath::Max(1.09, ratio->GetMaximum() * 1.05);
286 TH1F dummy3("dummy3", ";;Ratio: MC / corr", 100, corr->GetXaxis()->GetBinLowEdge(1), corr->GetXaxis()->GetBinUpEdge(corr->GetNbinsX()));
287 dummy3.SetXTitle(corr->GetXaxis()->GetTitle());
288 Prepare1DPlot(&dummy3);
289 dummy3.SetStats(kFALSE);
290 for (Int_t i=1; i<=100; ++i)
291 dummy3.SetBinContent(i, 1);
292 dummy3.GetYaxis()->SetRangeUser(minR, maxR);
293 dummy3.SetLineWidth(2);
294 dummy3.GetXaxis()->SetLabelSize(0.08);
295 dummy3.GetYaxis()->SetLabelSize(0.08);
296 dummy3.GetXaxis()->SetTitleSize(0.08);
297 dummy3.GetYaxis()->SetTitleSize(0.08);
298 dummy3.GetYaxis()->SetTitleOffset(0.8);
303 // for the ratio add in quadrature
304 for (Int_t bin=1; bin<=syst->GetNbinsX(); bin++)
306 if (corr->GetBinError(bin) > 0)
307 syst->SetBinError(bin, TMath::Sqrt(TMath::Power(syst->GetBinContent(bin) / 100, 2) + TMath::Power(corr->GetBinError(bin) / corr->GetBinContent(bin), 2)));
309 syst->SetBinError(bin, 0);
310 syst->SetBinContent(bin, 1);
313 syst->Draw("E2 ][ SAME");
314 dummy3.DrawCopy("SAME");
319 ratio->Fit("pol0", "N");
322 //canvas3->SaveAs(Form("%s.eps", canvas3->GetTitle()));
327 gSystem->Load("libANALYSIS");
328 gSystem->Load("libANALYSISalice");
329 gSystem->Load("libCORRFW");
330 gSystem->Load("libPWGTools");
331 gSystem->Load("libPWGCFCorrelationsBase");
334 const char* lastFileName = 0;
335 void* cacheSameEvent = 0;
336 void* cacheMixedEvent = 0;
338 void* GetUEHistogram(const char* fileName, TList** listRef = 0, Bool_t mixed = kFALSE, const char* tag = "")
340 if (!lastFileName || strcmp(lastFileName, fileName) != 0)
342 lastFileName = fileName;
343 file = TFile::Open(fileName);
347 list = (TList*) gFile->Get("PWG4_LeadingTrackUE/histosLeadingTrackUE");
349 list = (TList*) gFile->Get(Form("PWG4_PhiCorrelations/histosPhiCorrelations%s", tag));
351 list = (TList*) gFile->Get("PWG4_PhiCorrelations/histosPhiCorrelations_Syst");
359 cacheMixedEvent = list->FindObject("AliUEHistogramsMixed");
360 cacheSameEvent = list->FindObject("AliUEHistogramsSame");
363 return cacheMixedEvent;
365 if (list->FindObject("AliUEHistograms"))
366 return list->FindObject("AliUEHistograms");
368 return cacheSameEvent;
372 Printf("GetUEHistogram --> Using cache for %s", fileName);
375 return cacheMixedEvent;
377 return cacheSameEvent;
381 void CompareBias(const char* mcFile = "PWG4_JetTasksOutput.root", Int_t region, Int_t ueHist)
385 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(mcFile);
388 const char* axis = "z";
389 Float_t ptLeadMin = 0;
390 Float_t ptLeadMax = -1;
394 ptLeadMin = 0.51 + 0;
395 ptLeadMax = 1.99 + 0;
399 biasFromData = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepBiasStudy, AliUEHist::kCFStepReconstructed, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromData");
400 biasFromData2 = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepBiasStudy2, AliUEHist::kCFStepReconstructed, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromData2");
401 //biasFromData = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepRealLeading, region, axis)->Clone("biasFromData");
402 biasFromMC = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepTracked, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromMC");
403 //biasFromMC = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepRealLeading, region, axis)->Clone("biasFromMC");
405 /* biasFromData->Draw();
406 biasFromMC->SetLineColor(2);
407 biasFromMC->Draw("SAME");
410 DrawRatio(biasFromData, biasFromMC, "bias: data vs MC");
411 DrawRatio(biasFromData, biasFromData2, "bias: data vs data two step");
414 void CompareBiasWithData(const char* mcFile = "PWG4_JetTasksOutput.root", const char* dataFile = "esd.root", Int_t region = 2)
418 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(mcFile);
421 biasFromMC = (TH1*) h->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepTracked, region, "z")->Clone("biasFromMC");
423 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(dataFile);
426 biasFromData = (TH1*) h2->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepBiasStudy, AliUEHist::kCFStepReconstructed, region, "z")->Clone("biasFromData");
427 biasFromData2 = (TH1*) h2->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepBiasStudy2, AliUEHist::kCFStepReconstructed, region, "z")->Clone("biasFromData2");
429 DrawRatio(biasFromData, biasFromMC, "bias: data vs MC");
430 DrawRatio(biasFromData, biasFromData2, "bias: data vs data two step");
435 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)
439 if (!gCache || !gFirst)
441 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
442 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
454 AliUEHistograms* h = (AliUEHistograms*) gFirst;
455 AliUEHistograms* h2 = (AliUEHistograms*) gSecond;
462 TH1* hist1 = h->GetUEHist(id)->GetUEHist(step1, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
463 //TH1* hist1 = h->GetUEHist(id)->GetUEHist(step1, region, ptLeadMin, ptLeadMax);
464 TH1* hist2 = h2->GetUEHist(id)->GetUEHist(step2, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
466 //hist1->Scale(1.0 / hist1->Integral());
467 //hist2->Scale(1.0 / hist2->Integral());
472 trackHist = h->GetUEHist(id)->GetTrackHist(region)->ShowProjection(2, 0);
473 // only keep bins under consideration
474 for (Int_t bin=1; bin<=trackHist->GetNbinsX(); bin++)
475 if (bin < trackHist->FindBin(ptLeadMin) || bin > trackHist->FindBin(ptLeadMax))
476 trackHist->SetBinContent(bin, 0);
479 // systematic uncertainty
480 TH1* syst = 0; //GetSystematicUncertainty(hist1, trackHist);
482 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);
485 void CompareEventHist(const char* fileName1, const char* fileName2, Int_t id, Int_t step, Int_t var)
489 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
492 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
495 TH1* hist1 = h->GetUEHist(id)->GetEventHist()->ShowProjection(var, step);
496 TH1* hist2 = h2->GetUEHist(id)->GetEventHist()->ShowProjection(var, step);
498 // hist1 = hist1->Rebin(hist2->GetNbinsX(), "new", hist2->GetXaxis()->GetXbins()->GetArray());
500 // hist2 = hist2->Rebin(hist1->GetNbinsX(), "new", hist1->GetXaxis()->GetXbins()->GetArray());
502 DrawRatio(hist1, hist2, "compare");
505 void CompareEventHist(const char* fileName1, const char* fileName2, Int_t id, Int_t step1, Int_t step2, Int_t var)
509 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
512 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
515 // h->GetUEHist(id)->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(1, 5);
516 // h2->GetUEHist(id)->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(1, 5);
518 TH1* hist1 = h->GetUEHist(id)->GetEventHist()->ShowProjection(var, step1);
519 TH1* hist2 = h2->GetUEHist(id)->GetEventHist()->ShowProjection(var, step2);
521 DrawRatio(hist1, hist2, "compare");
524 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)
526 // fileName1 is labelled Corrected in the plot
532 Compare(fileName1, fileName2, id, step, step, region, ptLeadMin, ptLeadMax);
535 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)
537 // fileName1 is labelled Corrected in the plot
543 Compare(fileName1, fileName2, id, step1, step2, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
546 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)
550 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, mixed);
554 return h->GetUEHist(id)->GetUEHist(step, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd, twoD)->DrawCopy();
557 void DrawProjectionsRidge(const char* fileName, const char* fileNamePbPbMix = 0)
559 if (!fileNamePbPbMix)
560 fileNamePbPbMix = fileName;
567 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
568 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
574 GetDistAndFlow(h, hMixed, &hist1, 0, 8, 0, 100, 3.01, 3.99, 1, kTRUE, 0, kTRUE);
576 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
578 // NormalizeToBinWidth(hist1);
580 proj1y = ((TH2*) hist1)->ProjectionY("proj1y", hist1->GetXaxis()->FindBin(-0.5), hist1->GetXaxis()->FindBin(0.5));
581 proj1x = ((TH2*) hist1)->ProjectionX("proj1x", hist1->GetYaxis()->FindBin(-1.79), hist1->GetYaxis()->FindBin(1.79));
583 proj1y->Scale(1.0 / (hist1->GetXaxis()->FindBin(0.5) - hist1->GetXaxis()->FindBin(-0.5) + 1));
584 proj1x->Scale(1.0 / (hist1->GetYaxis()->FindBin(1.79) - hist1->GetYaxis()->FindBin(-1.79) + 1));
586 proj1y->GetXaxis()->SetTitleOffset(1);
587 proj1x->GetXaxis()->SetTitleOffset(1);
589 Float_t zyam = proj1x->GetBinContent(proj1x->GetXaxis()->FindBin(TMath::Pi()/2));
590 proj1x->Add(new TF1("func", "-1", -100, 100), zyam);
591 proj1y->Add(new TF1("func", "-1", -100, 100), zyam);
593 new TCanvas("c", "c", 800, 800);
594 gPad->SetLeftMargin(0.15);
596 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
597 hist1->GetXaxis()->SetTitleOffset(1.5);
598 hist1->GetYaxis()->SetTitleOffset(2);
599 hist1->SetStats(kFALSE);
600 hist1->DrawCopy("SURF1");
602 // new TCanvas; proj1y->Draw(); new TCanvas; proj1x->Draw(); return;
605 GetDistAndFlow(h, hMixed, &hist2, 0, 8, 40, 100, 4.01, 5.99, 1, kTRUE, 0, kTRUE);
607 // ((TH2*) hist2)->Rebin2D(2, 2); hist2->Scale(0.25);
608 // NormalizeToBinWidth(hist2);
610 proj2y = ((TH2*) hist2)->ProjectionY("proj2y", hist1->GetXaxis()->FindBin(-0.5), hist1->GetXaxis()->FindBin(0.5));
611 proj2x = ((TH2*) hist2)->ProjectionX("proj2x", hist1->GetYaxis()->FindBin(-1.79), hist1->GetYaxis()->FindBin(1.79));
613 proj2y->Scale(1.0 / (hist1->GetXaxis()->FindBin(0.5) - hist1->GetXaxis()->FindBin(-0.5) + 1));
614 proj2x->Scale(1.0 / (hist1->GetYaxis()->FindBin(1.79) - hist1->GetYaxis()->FindBin(-1.79) + 1));
616 zyam = proj2x->GetBinContent(proj2x->GetXaxis()->FindBin(TMath::Pi()/2));
617 proj2x->Add(new TF1("func", "-1", -100, 100), zyam);
618 proj2y->Add(new TF1("func", "-1", -100, 100), zyam);
620 proj2y->SetLineColor(2); proj2x->SetLineColor(2);
622 new TCanvas; proj1y->Draw(); proj2y->Draw("SAME");
623 new TCanvas; proj1x->Draw(); proj2x->Draw("SAME");
625 new TCanvas("c2", "c2", 800, 800);
626 gPad->SetLeftMargin(0.15);
628 hist2->GetYaxis()->SetRangeUser(-1.79, 1.79);
629 hist2->GetXaxis()->SetTitleOffset(1.5);
630 hist2->GetYaxis()->SetTitleOffset(2);
631 hist2->SetStats(kFALSE);
632 hist2->DrawCopy("SURF1");
635 void DrawExample(const char* fileName, const char* fileNamePbPbMix = 0)
637 if (!fileNamePbPbMix)
638 fileNamePbPbMix = fileName;
645 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
646 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
652 GetDistAndFlow(h, hMixed, &hist1, 0, 8, 0, 40, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
654 ((TH2*) hist1)->Rebin2D(2, 2);
657 // NormalizeToBinWidth(hist1);
659 new TCanvas("c", "c", 800, 800);
660 gPad->SetLeftMargin(0.15);
662 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
663 hist1->GetXaxis()->SetTitleOffset(1.5);
664 hist1->GetYaxis()->SetTitleOffset(2);
665 hist1->SetStats(kFALSE);
666 hist1->DrawCopy("SURF1");
669 GetDistAndFlow(h, hMixed, &hist2, 0, 8, 40, 100, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
671 ((TH2*) hist2)->Rebin2D(2, 2); hist2->Scale(0.25);
673 // NormalizeToBinWidth(hist1);
675 new TCanvas("c2", "c2", 800, 800);
676 gPad->SetLeftMargin(0.15);
678 hist2->GetYaxis()->SetRangeUser(-1.79, 1.79);
679 hist2->GetXaxis()->SetTitleOffset(1.5);
680 hist2->GetYaxis()->SetTitleOffset(2);
681 hist2->SetStats(kFALSE);
682 hist2->DrawCopy("SURF1");
690 GetDistAndFlow(h, hMixed, &hist1, 0, 0, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
692 ((TH2*) hist1)->Rebin2D(2, 2);
693 // NormalizeToBinWidth(hist1);
695 new TCanvas("c2", "c2", 800, 800);
696 gPad->SetLeftMargin(0.15);
698 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
699 hist1->GetXaxis()->SetTitleOffset(1.5);
700 hist1->GetYaxis()->SetTitleOffset(2);
701 hist1->SetStats(kFALSE);
702 hist1->DrawCopy("SURF1");
704 hist1->Divide(hist2);
706 new TCanvas("c5", "c5", 800, 800);
707 gPad->SetLeftMargin(0.15);
709 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
710 hist1->GetXaxis()->SetTitleOffset(1.5);
711 hist1->GetYaxis()->SetTitleOffset(2);
712 hist1->SetStats(kFALSE);
713 hist1->DrawCopy("SURF1");
717 GetDistAndFlow(h, hMixed, &hist1, 0, 6, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE, 6);
719 ((TH2*) hist1)->Rebin2D(2, 2);
720 // NormalizeToBinWidth(hist1);
722 new TCanvas("c3", "c3", 800, 800);
723 gPad->SetLeftMargin(0.15);
725 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
726 hist1->GetXaxis()->SetTitleOffset(1.5);
727 hist1->GetYaxis()->SetTitleOffset(2);
728 hist1->SetStats(kFALSE);
729 hist1->DrawCopy("SURF1");
734 // GetDistAndFlow(h, hMixed, &hist1, 0, 4, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE, 6);
736 // ((TH2*) hist1)->Rebin2D(2, 2);
737 // // hist1->Scale(0.25);
739 // // NormalizeToBinWidth(hist1);
741 // new TCanvas("c1b", "c1b", 800, 800);
742 // gPad->SetLeftMargin(0.15);
743 // hist1->SetTitle("");
744 // hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
745 // hist1->GetXaxis()->SetTitleOffset(1.5);
746 // hist1->GetYaxis()->SetTitleOffset(2);
747 // hist1->SetStats(kFALSE);
748 // hist1->DrawCopy("SURF1");
753 // GetDistAndFlow(h, 0, &hist1, 0, 8, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
755 // NormalizeToBinWidth(hist1);
757 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
759 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
761 // Float_t factor = 1.0 / (2.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j)));
762 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
763 // hist1->SetBinError(i, j, hist1->GetBinError(i, j) * factor);
767 /* new TCanvas("c4", "c4", 800, 800);
768 gPad->SetLeftMargin(0.15);
770 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
771 hist1->GetXaxis()->SetTitleOffset(1.5);
772 hist1->GetYaxis()->SetTitleOffset(2);
773 hist1->SetStats(kFALSE);
774 hist1->DrawCopy("SURF1"); */
776 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram("corrected.root");
777 AliUEHistograms* h2Mixed = (AliUEHistograms*) GetUEHistogram("corrected.root", 0, kTRUE);
779 SetupRanges(h2Mixed);
781 GetDistAndFlow(h2, h2Mixed, &hist1, 0, 8, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
782 ((TH2*) hist1)->Rebin2D(2, 2);
784 new TCanvas("c4", "c4", 800, 800);
785 gPad->SetLeftMargin(0.15);
787 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
788 hist1->GetXaxis()->SetTitleOffset(1.5);
789 hist1->GetYaxis()->SetTitleOffset(2);
790 hist1->SetStats(kFALSE);
791 hist1->DrawCopy("SURF1");
793 hist1->Divide(hist2);
795 new TCanvas("c5", "c5", 800, 800);
796 gPad->SetLeftMargin(0.15);
798 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
799 hist1->GetXaxis()->SetTitleOffset(1.5);
800 hist1->GetYaxis()->SetTitleOffset(2);
801 hist1->SetStats(kFALSE);
802 hist1->DrawCopy("SURF1");
804 // hist1->Divide(histMixed);
806 // NormalizeToBinWidth(hist1);
808 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
810 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
812 // Float_t factor = 1.0 / (2.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j)));
813 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
814 // hist1->SetBinError(i, j
815 // }, hist1->GetBinError(i, j) * factor);
818 // new TCanvas("c6", "c6", 800, 800);
819 // gPad->SetLeftMargin(0.15);
820 // hist1->SetTitle("");
821 // hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
822 // hist1->GetXaxis()->SetTitleOffset(1.5);
823 // hist1->GetYaxis()->SetTitleOffset(2);
824 // hist1->SetStats(kFALSE);
825 // hist1->DrawCopy("SURF1");
829 GetSumOfRatios(h, hMixed, &hist1, 6, 60, 90, 8.01, 9.99, kTRUE);
830 new TCanvas("c2", "c2", 800, 800);
831 gPad->SetLeftMargin(0.15);
833 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
834 hist1->GetXaxis()->SetTitleOffset(1.5);
835 hist1->GetYaxis()->SetTitleOffset(2);
836 hist1->SetStats(kFALSE);
837 hist1->Draw("SURF1");
841 latex = new TLatex(0.82, 0.74, "ALICE performance");
842 latex->SetTextSize(0.02);
843 latex->SetTextAlign(22);
846 latex = new TLatex(0.82, 0.72, "Pb-Pb 2.76 TeV");
847 latex->SetTextSize(0.02);
848 latex->SetTextAlign(22);
851 latex = new TLatex(0.82, 0.70, "28.09.11");
852 latex->SetTextSize(0.02);
853 latex->SetTextAlign(22);
857 DrawALICELogo(0.75, 0.75, 0.9, 0.9);
860 void DrawExample2(const char* fileName)
864 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
865 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
873 GetSumOfRatios(h, hMixed, &hist1, 8, 0, 5, 0.51, 0.99);
875 new TCanvas("c", "c", 800, 800);
876 gPad->SetLeftMargin(0.15);
877 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
878 hist1->GetXaxis()->SetTitleOffset(1.5);
879 hist1->GetYaxis()->SetTitleOffset(2);
880 hist1->SetStats(kFALSE);
881 hist1->DrawCopy("SURF1");
884 void CompareZVtxWeighting(const char* fileName, Int_t step = 8)
891 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
892 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
898 GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 10, 5.01, 9.99, 1, kTRUE, 0, kTRUE);
899 hist1->Scale(1.0 / 0.972222);
902 GetSumOfRatios(h, hMixed, &hist2, step, 0, 10, 5.01, 9.99, kTRUE);
904 c = new TCanvas("c", "c", 1200, 400);
907 c->cd(1); hist1->DrawCopy("SURF1");
908 c->cd(2); hist2->DrawCopy("SURF1");
911 hist1->Divide(hist2);
913 c->cd(3); hist1->DrawCopy("COLZ");
916 void DrawSameMixed(const char* fileName, const char* fileNamePbPbMix = 0, Int_t step = 6)
918 if (!fileNamePbPbMix)
919 fileNamePbPbMix = fileName;
926 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
927 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
933 GetDistAndFlow(h, 0, &hist1, 0, step, 0, 80, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
935 // ((TH2*) hist1)->Rebin2D(2, 2);
936 // hist1->Scale(0.25);
938 NormalizeToBinWidth(hist1);
940 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
942 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
944 // Float_t factor = 1.0 / (2.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j) / 0.9));
945 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
946 // hist1->SetBinError(i, j, hist1->GetBinError(i, j) * factor);
950 c = new TCanvas("c", "c", 1600, 800);
953 gPad->SetLeftMargin(0.15);
955 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
956 hist1->GetZaxis()->SetTitleOffset(1.8);
957 hist1->GetXaxis()->SetTitleOffset(1.5);
958 hist1->GetYaxis()->SetTitleOffset(2);
959 hist1->GetZaxis()->SetTitle("same event pairs (a.u.)");
960 hist1->SetStats(kFALSE);
961 hist1->DrawCopy("SURF1");
963 DrawALICELogo(kFALSE, 0.2, 0.7, 0.4, 0.9);
967 GetDistAndFlow(hMixed, 0, &hist1, 0, step, 0, 80, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
969 // ((TH2*) hist1)->Rebin2D(2, 2);
970 NormalizeToBinWidth(hist1);
972 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
974 // Float_t factor = 1.0 / (1.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j)) / 6.0);
975 // Printf("%d %f", j, factor);
976 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
978 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
979 // hist1->SetBinError(i, j, hist1->GetBinError(i, j) * factor);
984 gPad->SetLeftMargin(0.15);
986 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
987 hist1->GetZaxis()->SetTitleOffset(1.8);
988 hist1->GetXaxis()->SetTitleOffset(1.5);
989 hist1->GetYaxis()->SetTitleOffset(2);
990 hist1->GetZaxis()->SetTitle("mixed event pairs (a.u.)");
991 hist1->SetStats(kFALSE);
992 hist1->DrawCopy("SURF1");
994 DrawALICELogo(kFALSE, 0.2, 0.7, 0.4, 0.9);
996 c->SaveAs(Form("samemixed_%d.eps", step));
997 c->SaveAs(Form("samemixed_%d.png", step));
999 new TCanvas("c3", "c3", 800, 800);
1000 gPad->SetLeftMargin(0.15);
1001 hist2->Divide(hist1);
1002 hist2->DrawCopy("SURF1");
1005 void Validation2DAllStepsNew(const char* fileName, Int_t bin = 0)
1007 Int_t centralityFrom = 0;
1008 Int_t centralityTo = 80;
1013 Float_t ptTrigBegin = 2.01;
1014 Float_t ptTrigEnd = 3.99;
1045 centralityFrom = 60;
1058 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1059 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1062 SetupRanges(hMixed);
1066 GetSumOfRatios(h, hMixed, &hist[0], 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1067 GetSumOfRatios(h, hMixed, &hist[1], 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1068 GetSumOfRatios(h, hMixed, &hist[2], 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1069 GetSumOfRatios(h, hMixed, &hist[3], 6, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1070 GetSumOfRatios(h, hMixed, &hist[4], 8, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1071 GetSumOfRatios(h, hMixed, &hist[5], 10, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1073 c = new TCanvas("c", "c", 1600, 1000);
1076 Float_t peakYield1[6];
1077 Float_t baselineValues1[6];
1079 for (Int_t i=0; i<6; i++)
1084 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1085 hist[i]->Scale(1.0 / hist[i]->GetYaxis()->GetBinWidth(1));
1087 ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1090 for (Int_t i=0; i<6; i++)
1096 hist[i]->GetYaxis()->SetRangeUser(-1.99, 1.99);
1097 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1098 hist[i]->GetYaxis()->SetTitleOffset(2);
1099 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1100 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1101 hist[i]->SetStats(kFALSE);
1102 hist[i]->DrawCopy("SURF1");
1107 TH2* clone = (TH2*) hist[i]->Clone();
1108 clone->Divide(hist[5]);
1109 clone->DrawCopy("COLZ");
1110 gPad->SetRightMargin(0.15);
1114 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj1_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1117 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);
1118 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];
1119 Printf("%d: %f %f", i, peakYield1[i], baselineValues1[i]);
1123 proj2 = ((TH2*) hist[5])->ProjectionX(Form("proj2_%d", i), hist[5]->GetYaxis()->FindBin(-0.99), hist[5]->GetYaxis()->FindBin(0.99));
1124 proj2->SetLineColor(2);
1125 proj2->DrawCopy("SAME");
1128 proj1->Divide(proj1, proj2, 1, 1, "B");
1133 c = new TCanvas("c2", "c2", 1600, 1000);
1136 for (Int_t i=0; i<6; i++)
1142 hist[i]->GetYaxis()->SetRangeUser(-1.99, 1.99);
1143 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1144 hist[i]->GetYaxis()->SetTitleOffset(2);
1145 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1146 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1147 hist[i]->SetStats(kFALSE);
1148 hist[i]->DrawCopy("SURF1");
1151 TH2* clone = (TH2*) hist[i]->Clone();
1152 clone->Divide(hist[0]);
1153 clone->DrawCopy("COLZ");
1154 gPad->SetRightMargin(0.15);
1157 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj3_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1160 proj2 = ((TH2*) hist[0])->ProjectionX(Form("proj4_%d", i), hist[0]->GetYaxis()->FindBin(-0.99), hist[0]->GetYaxis()->FindBin(0.99));
1161 proj2->SetLineColor(2);
1162 proj2->DrawCopy("SAME");
1165 proj1->Divide(proj1, proj2, 1, 1, "B");
1169 c = new TCanvas("c3", "c3", 1600, 1000);
1172 for (Int_t i=3; i<4; i++)
1178 hist[i]->GetYaxis()->SetRangeUser(-1.99, 1.99);
1179 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1180 hist[i]->GetYaxis()->SetTitleOffset(2);
1181 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1182 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1183 hist[i]->SetStats(kFALSE);
1184 hist[i]->DrawCopy("SURF1");
1187 TH2* clone = (TH2*) hist[i]->Clone();
1188 clone->Divide(hist[4]);
1189 clone->DrawCopy("COLZ");
1190 gPad->SetRightMargin(0.15);
1193 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj4_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1196 proj2 = ((TH2*) hist[4])->ProjectionX(Form("proj5_%d", i), hist[4]->GetYaxis()->FindBin(-0.99), hist[4]->GetYaxis()->FindBin(0.99));
1197 proj2->SetLineColor(2);
1198 proj2->DrawCopy("SAME");
1201 proj1->Divide(proj1, proj2, 1, 1, "B");
1205 c = new TCanvas("c4", "c4", 1200, 400);
1208 for (Int_t i=0; i<1; i++)
1216 TH2* clone = (TH2*) hist[i]->Clone();
1217 clone->Divide(hist[5]);
1218 clone->DrawCopy("COLZ");
1219 gPad->SetRightMargin(0.15);
1223 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj1_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1226 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);
1227 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];
1228 Printf("%d: %f %f", i, peakYield1[i], baselineValues1[i]);
1232 proj2 = ((TH2*) hist[5])->ProjectionX(Form("proj2_%d", i), hist[5]->GetYaxis()->FindBin(-0.99), hist[5]->GetYaxis()->FindBin(0.99));
1233 proj2->SetLineColor(2);
1234 proj2->DrawCopy("SAME");
1237 proj1->Divide(proj1, proj2, 1, 1, "B");
1242 for (Int_t i=0; i<6; i++)
1243 Printf("%d/%d: %f %f", i, 0, peakYield1[i] / peakYield1[0] - 1, baselineValues1[i] / baselineValues1[0] - 1);
1247 for (Int_t i=0; i<6; i++)
1248 Printf("%d/%d: %f %f", i, 5, peakYield1[i] / peakYield1[5] - 1, baselineValues1[i] / baselineValues1[5] - 1);
1252 void Validation2DAllBins(const char* fileName, const char *fileName2)
1254 /* Int_t is[] = { 0, 1, 2, 3, 4, 5};
1255 Int_t js[] = { 1, 2, 3, 4, 5, 6 };
1257 /* Int_t is[] = { 0, 1, 1, 2, 2, 2, 3, 3, 3 };
1258 Int_t js[] = { 1, 1, 2, 1, 2, 3, 1, 2, 3 };*/
1259 Int_t is[] = { 0, 1, 1, 2, 2, 2, 3 };
1260 Int_t js[] = { 1, 1, 2, 1, 2, 3, 3 };
1263 file1 = TFile::Open(fileName);
1266 file2 = TFile::Open(fileName2);
1268 file3 = TFile::Open("non_closure.root", "RECREATE");
1271 Float_t baselineValues1, baselineValues2, peakYield1, peakYield2;
1275 for (Int_t centr=0; centr<4; centr++)
1277 for (Int_t i=0; i<n; i++)
1281 c = new TCanvas(Form("c%d", padID), Form("c%d", padID), 1100, 750);
1287 TH2* hist1 = (TH2*) file1->Get(Form("dphi_%d_%d_%d", is[i], js[i], centr));
1292 hist2 = (TH2*) file2->Get(Form("dphi_%d_%d_%d", is[i], js[i], centr));
1294 hist2 = (TH2*) file1->Get(Form("dphi_%d_%d_%d", is[i], js[i], centr+4));
1296 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1297 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1298 hist2->Scale(1.0 / hist2->GetYaxis()->GetBinWidth(1));
1300 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1301 ((TH2*) hist2)->Rebin2D(2, 2); hist2->Scale(0.25);
1303 const Float_t outerEta = 1.8;
1304 const Float_t exclusion = 0.5;
1307 proj1 = ((TH2*) hist1)->ProjectionX(Form("proj1a_%d_%d", centr, i), hist1->GetYaxis()->FindBin(-outerEta + 0.01), hist1->GetYaxis()->FindBin(-exclusion - 0.01));
1308 proj1b = ((TH2*) hist1)->ProjectionX(Form("proj1b_%d_%d", centr, i), hist1->GetYaxis()->FindBin(exclusion + 0.01), hist1->GetYaxis()->FindBin(outerEta - 0.01));
1310 copy = proj1->DrawCopy();
1311 copy->GetYaxis()->SetRangeUser(proj1->GetMinimum() * 0.9, proj1->GetMaximum() * 1.2);
1312 proj1c = ((TH2*) hist1)->ProjectionX(Form("proj1c_%d_%d", centr, i), hist1->GetYaxis()->FindBin(-outerEta + 0.01), hist1->GetYaxis()->FindBin(outerEta - 0.01));
1313 proj1c->SetLineColor(2);
1314 proj1c->DrawCopy("SAME");
1315 copy->SetMinimum(TMath::Min(copy->GetMinimum(), proj1c->GetMinimum()));
1316 copy->SetMaximum(1.2 * TMath::Max(copy->GetMaximum(), proj1c->GetMaximum()));
1318 Double_t baselineValues1E, peakYield1E;
1319 baselineValues1 = proj1->IntegralAndError(proj1->FindBin(TMath::Pi()/2 - 0.2), proj1->FindBin(TMath::Pi()/2 + 0.2), baselineValues1E);
1320 baselineValues1 /= (proj1->FindBin(TMath::Pi()/2 + 0.2) - proj1->FindBin(TMath::Pi()/2 - 0.2) + 1);
1321 baselineValues1E /= (proj1->FindBin(TMath::Pi()/2 + 0.2) - proj1->FindBin(TMath::Pi()/2 - 0.2) + 1);
1322 peakYield1 = proj1->IntegralAndError(proj1->GetXaxis()->FindBin(-1), proj1->GetXaxis()->FindBin(1), peakYield1E);
1323 peakYield1 /= (proj1->GetXaxis()->FindBin(0.99) - proj1->GetXaxis()->FindBin(-0.99) + 1);
1324 peakYield1E /= (proj1->GetXaxis()->FindBin(0.99) - proj1->GetXaxis()->FindBin(-0.99) + 1);
1325 peakYield1 -= baselineValues1;
1326 peakYield1E = TMath::Sqrt(peakYield1E * peakYield1E + baselineValues1E * baselineValues1E);
1328 proj2 = ((TH2*) hist2)->ProjectionX(Form("proj2a_%d_%d", centr, i), hist2->GetYaxis()->FindBin(-outerEta + 0.01), hist2->GetYaxis()->FindBin(-exclusion - 0.01));
1329 proj2b = ((TH2*) hist2)->ProjectionX(Form("proj2b_%d_%d", centr, i), hist2->GetYaxis()->FindBin(exclusion + 0.01), hist2->GetYaxis()->FindBin(outerEta - 0.01));
1331 proj2->SetLineColor(3);
1332 proj2->DrawCopy("SAME");
1333 proj2c = ((TH2*) hist2)->ProjectionX(Form("proj2c_%d_%d", centr, i), hist2->GetYaxis()->FindBin(-outerEta + 0.01), hist2->GetYaxis()->FindBin(outerEta - 0.01));
1334 proj2c->SetLineColor(4);
1335 proj2c->DrawCopy("SAME");
1337 Double_t baselineValues2E, peakYield2E;
1338 baselineValues2 = proj2->IntegralAndError(proj1->FindBin(TMath::Pi()/2 - 0.2), proj2->FindBin(TMath::Pi()/2 + 0.2), baselineValues2E);
1339 baselineValues2 /= (proj2->FindBin(TMath::Pi()/2 + 0.2) - proj2->FindBin(TMath::Pi()/2 - 0.2) + 1);
1340 baselineValues2E /= (proj2->FindBin(TMath::Pi()/2 + 0.2) - proj2->FindBin(TMath::Pi()/2 - 0.2) + 1);
1341 peakYield2 = proj2->IntegralAndError(proj2->GetXaxis()->FindBin(-1), proj2->GetXaxis()->FindBin(1), peakYield2E);
1342 peakYield2 /= (proj2->GetXaxis()->FindBin(0.99) - proj2->GetXaxis()->FindBin(-0.99) + 1);
1343 peakYield2E /= (proj2->GetXaxis()->FindBin(0.99) - proj2->GetXaxis()->FindBin(-0.99) + 1);
1344 peakYield2 -= baselineValues2;
1345 peakYield2E = TMath::Sqrt(peakYield2E * peakYield2E + baselineValues2E * baselineValues2E);
1347 // Printf("%d: %f %f %f %f %.2f%% %.2f%%", i, peakYield1, baselineValues1, peakYield2, baselineValues2, 100.0 * peakYield1 / peakYield2 - 100, 100.0 * baselineValues1 / baselineValues2 - 100);
1348 Printf("%s: %.2f%% +- %.2f%% %.2f%% +- %.2f%%",
1350 100.0 * peakYield1 / peakYield2 - 100,
1351 100.0 * peakYield1 / peakYield2 * TMath::Sqrt(TMath::Power(peakYield1E / peakYield1, 2) + TMath::Power(peakYield2E / peakYield2, 2)),
1352 100.0 * baselineValues1 / baselineValues2 - 100,
1353 100.0 * baselineValues1 / baselineValues2 * TMath::Sqrt(TMath::Power(baselineValues1E / baselineValues1, 2) + TMath::Power(baselineValues2E / baselineValues2, 2))
1357 proj1->Divide(proj1, proj2, 1, 1, "B");
1358 proj1c->Divide(proj1c, proj2c, 1, 1, "B");
1359 // proj1->Add(proj2, -1);
1361 proj1c->SetLineColor(2);
1362 proj1c->Draw("SAME");
1365 hist1->Divide(hist2);
1366 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
1367 hist1->Draw("COLZ");
1369 file3 = TFile::Open("non_closure.root", "UPDATE");
1370 proj1->Write(Form("non_closure_%d_%d_%d", is[i], js[i], centr));
1371 proj1c->Write(Form("non_closure_all_%d_%d_%d", is[i], js[i], centr));
1372 hist1->Write(Form("non_closure_2d_%d_%d_%d", is[i], js[i], centr));
1380 void Validation2DAllSteps(const char* fileName, const char* fileNameCorrected = "corrected.root", Int_t startStep = 8)
1382 Int_t centralityFrom = 0;
1383 Int_t centralityTo = 80;
1388 Float_t ptTrigBegin = 2.01;
1389 Float_t ptTrigEnd = 2.99;
1393 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1394 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1396 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected);
1397 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected, 0, kTRUE);
1400 SetupRanges(hMixed);
1402 SetupRanges(hMixed2);
1407 // GetSumOfRatios(h, hMixed, &hist[0], 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, kTRUE);
1409 GetDistAndFlow(h, hMixed, &hist[0], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 0);
1410 GetDistAndFlow(h, hMixed, &hist[1], 0, 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1411 GetDistAndFlow(h, hMixed, &hist[2], 0, 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1412 GetDistAndFlow(h, hMixed, &hist[3], 0, startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1413 GetDistAndFlow(h2, hMixed2, &hist2[0], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1414 GetDistAndFlow(h2, hMixed2, &hist2[1], 0, 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1415 GetDistAndFlow(h2, hMixed2, &hist2[2], 0, 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1416 GetDistAndFlow(h2, hMixed2, &hist2[3], 0, startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1418 c = new TCanvas("c", "c", 1600, 1000);
1421 Float_t peakYield1[4];
1422 Float_t baselineValues1[4];
1423 Float_t peakYield2[4];
1424 Float_t baselineValues2[4];
1425 for (Int_t i=0; i<4; i++)
1427 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1428 hist[i]->Scale(1.0 / hist[i]->GetYaxis()->GetBinWidth(1));
1429 hist2[i]->Scale(1.0 / hist2[i]->GetYaxis()->GetBinWidth(1));
1431 ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1432 // ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1435 hist[i]->GetYaxis()->SetRangeUser(-1.59, 1.59);
1436 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1437 hist[i]->GetYaxis()->SetTitleOffset(2);
1438 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1439 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1440 hist[i]->SetStats(kFALSE);
1441 hist[i]->DrawCopy("SURF1");
1443 ((TH2*) hist2[i])->Rebin2D(2, 2); hist2[i]->Scale(0.25);
1444 // ((TH2*) hist2[i])->Rebin2D(2, 2); hist2[i]->Scale(0.25);
1446 // TF2* func2 = new TF2("func2", "[0]+[1]*exp(-0.5*((x/[2])**2+(y/[3])**2))", -1, 1, -0.99, 0.99);
1447 // func2->SetParameters(0, 1, 0.5, 0.5);
1448 // hist[i]->Fit(func2, "0R");
1449 // hist[i]->Fit(func2, "0R");
1452 // func2->DrawClone("SURF1");
1454 // baselineValues1[i] = func2->GetParameter(0);
1455 // func2->SetParameter(0, 0);
1456 // peakYield1[i] = func2->Integral(-0.5 * TMath::Pi(), 0.5 * TMath::Pi(), -1.4, 1.4);
1457 // Printf("%f %f", peakYield1[i], baselineValues1[i]);
1460 hist2[i]->GetYaxis()->SetRangeUser(-1.59, 1.59);
1461 hist2[i]->GetXaxis()->SetTitleOffset(1.5);
1462 hist2[i]->GetYaxis()->SetTitleOffset(2);
1463 hist2[i]->GetZaxis()->SetTitleOffset(1.8);
1464 hist2[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1465 hist2[i]->SetStats(kFALSE);
1466 hist2[i]->DrawCopy("SURF1");
1469 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj1_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1472 baselineValues1[i] = proj1->GetMinimum();
1473 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];
1474 Printf("%f %f", peakYield1[i], baselineValues1[i]);
1476 proj2 = ((TH2*) hist2[i])->ProjectionX(Form("proj2_%d", i), hist2[i]->GetYaxis()->FindBin(-0.99), hist2[i]->GetYaxis()->FindBin(0.99));
1477 proj2->SetLineColor(2);
1478 proj2->DrawCopy("SAME");
1480 baselineValues2[i] = proj2->GetMinimum();
1481 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];
1482 Printf("%f %f", peakYield2[i], baselineValues2[i]);
1485 proj1->Divide(proj2);
1488 // func2 = new TF2("func2", "[0]+[1]*exp(-0.5*((x/[2])**2+(y/[3])**2))", -1, 1, -0.99, 0.99);
1489 // func2->SetParameters(0, 1, 0.5, 0.5);
1490 // hist2[i]->Fit(func2, "0R");
1491 // hist2[i]->Fit(func2, "0R");
1494 // func2->DrawClone("SURF1");
1496 // baselineValues2[i] = func2->GetParameter(0);
1497 // func2->SetParameter(0, 0);
1498 // peakYield2[i] = func2->Integral(-0.5 * TMath::Pi(), 0.5 * TMath::Pi(), -1.4, 1.4);
1499 // Printf("%f %f", peakYield2[i], baselineValues2[i]);
1502 TH2* clone = (TH2*) hist[i]->Clone();
1503 clone->Divide(hist2[i]);
1504 // clone->Add(hist2[i], -1);
1505 clone->DrawCopy("COLZ");
1506 gPad->SetRightMargin(0.15);
1508 /* 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);
1509 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);*/
1514 for (Int_t i=0; i<4; i++)
1516 Printf("%d: %f %f", i, peakYield1[i] / peakYield2[i] - 1, baselineValues1[i] / baselineValues2[i] - 1);
1517 // Printf("%d: %f %f", i, peakYield1[i] - 1, baselineValues1[i] - 1);
1521 void CorrelatedContaminationEffect(const char* fileName, const char* fileNameCorrected = "corrected.root", Int_t bin = 0, Int_t startStep = 8)
1523 Int_t centralityFrom = 0;
1524 Int_t centralityTo = 80;
1529 Float_t ptTrigBegin = 2.01;
1530 Float_t ptTrigEnd = 3.99;
1552 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1553 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1555 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected);
1556 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected, 0, kTRUE);
1559 SetupRanges(hMixed);
1561 SetupRanges(hMixed2);
1565 Int_t maxFilled = 5;
1566 GetSumOfRatios(h, hMixed, &hist[0], 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1567 GetSumOfRatios(h, hMixed, &hist[1], 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1568 GetSumOfRatios(h, hMixed, &hist[2], 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1569 GetSumOfRatios(h, hMixed, &hist[3], 6, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1570 GetSumOfRatios(h, hMixed, &hist[4], startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1571 // GetSumOfRatios(h2, hMixed2, &hist[5], startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1573 // GetDistAndFlow(h, hMixed, &hist[0], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 0);
1574 // GetDistAndFlow(h, hMixed, &hist[1], 0, 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1575 // GetDistAndFlow(h, hMixed, &hist[2], 0, 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1576 // GetDistAndFlow(h, hMixed, &hist[3], 0, 6, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1577 // GetDistAndFlow(h, hMixed, &hist[4], 0, startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1578 // GetDistAndFlow(h2, hMixed2, &hist[5], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1580 c = new TCanvas("c", "c", 1600, 1000);
1583 for (Int_t i=0; i<maxFilled; i++)
1585 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1586 hist[i]->Scale(1.0 / hist[i]->GetYaxis()->GetBinWidth(1));
1588 ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1589 // ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1592 hist[i]->GetYaxis()->SetRangeUser(-1.59, 1.59);
1593 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1594 hist[i]->GetYaxis()->SetTitleOffset(2);
1595 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1596 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1597 hist[i]->SetStats(kFALSE);
1598 hist[i]->DrawCopy("SURF1");
1601 for (Int_t i=1; i<maxFilled; i++)
1603 TH2* clone = (TH2*) hist[i]->Clone();
1605 clone->Divide(hist[i-1]);
1607 clone->Divide(hist[2]);
1609 clone->Divide(hist[0]);
1612 gPad->SetRightMargin(0.15);
1613 // hist1->SetTitle("");
1614 // clone->GetZaxis()->SetRangeUser(0.8, 1.2);
1615 clone->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1616 clone->SetStats(kFALSE);
1617 clone->DrawCopy("COLZ");
1620 Float_t peakYield[6];
1621 Float_t baselineValues[6];
1622 for (Int_t i=0; i<maxFilled; i++)
1624 Int_t phi1 = hist[i]->GetXaxis()->FindBin(-1);
1625 Int_t phi2 = hist[i]->GetXaxis()->FindBin(1);
1626 Int_t eta1 = hist[i]->GetYaxis()->FindBin(-1.59);
1627 Int_t eta2 = hist[i]->GetYaxis()->FindBin(1.01);
1628 Int_t eta3 = hist[i]->GetYaxis()->FindBin(1.59);
1629 Float_t baseline = ((TH2*) hist[i])->Integral(phi1, phi2, eta2, eta3, "width") / (phi2 - phi1 + 1) / (eta3 - eta2 + 1);
1630 Float_t peak = ((TH2*) hist[i])->Integral(phi1, phi2, eta1, eta3, "width");
1631 Printf("%f %f", baseline, peak);
1632 peak -= baseline * (eta3 - eta1 + 1) * (phi2 - phi1 + 1);
1634 peakYield[i] = peak;
1635 baselineValues[i] = baseline;
1638 for (Int_t i=1; i<maxFilled; i++)
1641 Printf("%d/%d: %f %f", i, i-1, peakYield[i] / peakYield[i-1] - 1, baselineValues[i] / baselineValues[i-1] - 1);
1643 Printf("%d/%d: %f %f", i, 2, peakYield[i] / peakYield[2] - 1, baselineValues[i] / baselineValues[2] - 1);
1645 Printf("%d/%d: %f %f", 0, i, peakYield[0] / peakYield[i] - 1, baselineValues[0] / baselineValues[i] - 1);
1648 c = new TCanvas("c2", "c2", 1600, 1000);
1650 for (Int_t i=0; i<maxFilled; i++)
1653 hist[i]->DrawCopy("SURF1");
1655 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);
1656 func2->SetParameters(0, 1, 0.5, 0.5);
1657 // func2->SetParLimits(1, 0, 10);
1658 // func2->SetParLimits(2, sigmaFitLimit, 1);
1659 // func2->SetParLimits(3, sigmaFitLimit, 1);
1660 hist[i]->Fit(func2, "0R");
1663 func2->DrawClone("SURF1");
1665 baselineValues[i] = func2->GetParameter(0);
1666 func2->SetParameter(0, 0);
1667 peakYield[i] = func2->Integral(-0.5 * TMath::Pi(), 0.5 * TMath::Pi(), -1.4, 1.4);
1668 Printf("%f %f", peakYield[i], baselineValues[i]);
1671 for (Int_t i=1; i<maxFilled; i++)
1674 Printf("%d/%d: %f %f", i, i-1, peakYield[i] / peakYield[i-1] - 1, baselineValues[i] / baselineValues[i-1] - 1);
1676 Printf("%d/%d: %f %f", i, 2, peakYield[i] / peakYield[2] - 1, baselineValues[i] / baselineValues[2] - 1);
1678 Printf("%d/%d: %f %f", 0, i, peakYield[0] / peakYield[i] - 1, baselineValues[0] / baselineValues[i] - 1);
1681 for (Int_t i=1; i<maxFilled; i++)
1683 Printf("%d/%d: %f %f", 0, i, peakYield[0] / peakYield[i] - 1, baselineValues[0] / baselineValues[i] - 1);
1687 void DrawValidation2D(const char* fileName, const char* fileNameCorrected = "corrected.root", Int_t startStep = 8)
1689 Int_t centralityTo = 80;
1696 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1697 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1700 SetupRanges(hMixed);
1703 GetDistAndFlow(h, hMixed, &hist1, 0, 0, 0, centralityTo, 2.01, 3.99, 1, kTRUE, 0, kTRUE, 0);
1704 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1705 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1707 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1708 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1710 // NormalizeToBinWidth(hist1);
1712 c = new TCanvas("c", "c", 1000, 1000);
1716 gPad->SetLeftMargin(0.15);
1717 // hist1->SetTitle("");
1718 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1719 hist1->GetXaxis()->SetTitleOffset(1.5);
1720 hist1->GetYaxis()->SetTitleOffset(2);
1721 hist1->GetZaxis()->SetTitleOffset(1.8);
1722 hist1->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1723 hist1->SetStats(kFALSE);
1724 hist1->DrawCopy("SURF1");
1725 DrawLatex(0.1, 0.85, 1, "MC", 0.04);
1726 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1730 GetDistAndFlow(h, hMixed, &hist1, 0, startStep, 0, centralityTo, 2.01, 3.99, 1, kTRUE, 0, kTRUE, startStep);
1731 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1732 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1734 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1735 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1736 // NormalizeToBinWidth(hist1);
1739 gPad->SetLeftMargin(0.15);
1740 hist1->SetTitle("");
1741 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1742 hist1->GetXaxis()->SetTitleOffset(1.5);
1743 hist1->GetYaxis()->SetTitleOffset(2);
1744 hist1->GetZaxis()->SetTitleOffset(1.8);
1745 hist1->SetStats(kFALSE);
1746 hist1->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1747 hist1->DrawCopy("SURF1");
1748 DrawLatex(0.1, 0.85, 1, "Uncorrected", 0.04);
1749 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1751 c2 = new TCanvas("c3", "c3", 800, 800);
1752 // hist2->Scale(1.09);
1753 hist1->Divide(hist2);
1754 // hist1->Add(hist2, -1);
1755 hist1->DrawCopy("SURF1");
1759 // AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram("LHC11a10a_bis_AOD090_120406_zvtx_rebinned_corrected.root");
1760 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected);
1763 GetDistAndFlow(h2, hMixed, &hist1, 0, 0, 0, centralityTo, 2.01, 3.99, 1, kTRUE, 0, kTRUE, startStep);
1764 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1765 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1767 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1768 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1771 gPad->SetLeftMargin(0.15);
1772 hist1->SetTitle("");
1773 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1774 hist1->GetXaxis()->SetTitleOffset(1.5);
1775 hist1->GetZaxis()->SetTitleOffset(1.8);
1776 hist1->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1777 hist1->GetYaxis()->SetTitleOffset(2);
1778 hist1->SetStats(kFALSE);
1779 hist1->DrawCopy("SURF1");
1780 DrawLatex(0.1, 0.85, 1, "Corrected", 0.04);
1781 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1783 hist1->Divide(hist2);
1786 gPad->SetRightMargin(0.15);
1787 hist1->SetTitle("");
1788 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1789 hist1->GetXaxis()->SetTitleOffset(1.2);
1790 hist1->GetYaxis()->SetTitleOffset(1.2);
1791 hist1->GetZaxis()->SetTitle("Ratio: Corrected / MC");
1792 hist1->SetStats(kFALSE);
1793 hist1->GetZaxis()->SetRangeUser(0.99, 1.01);
1794 hist1->DrawCopy("COLZ");
1796 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1798 c->SaveAs("validation.eps");
1799 c->SaveAs("validation.gif");
1802 void DrawValidation(const char* fileName1, const char* fileName2)
1807 CompareStep(fileName1, fileName2, 2, 6, 4, 0, 4.01, 19.99);
1808 CompareStep(fileName1, fileName2, 2, 4, 4, 0, 4.01, 19.99);
1810 CompareStep(fileName1, fileName2, 2, 4, 2, 0, 4.01, 19.99);
1811 CompareStep(fileName1, fileName2, 2, 2, 2, 0, 4.01, 19.99);
1814 void ProfileMultiplicity(const char* fileName = "PWG4_JetTasksOutput.root")
1818 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1821 h->GetCorrelationMultiplicity()->Draw("colz");
1825 h->GetCorrelationMultiplicity()->ProfileX()->DrawCopy()->Fit("pol1", "", "", 1, 10);
1828 void SetupRanges(void* obj)
1832 ((AliUEHistograms*) obj)->SetEtaRange(0, 0);
1833 // ((AliUEHistograms*) obj)->SetEtaRange(-0.99, 0.99); Printf("WARNING: Setting eta Range!");
1834 ((AliUEHistograms*) obj)->SetPtRange(gpTMin, gpTMax);
1835 ((AliUEHistograms*) obj)->SetCombineMinMax(kTRUE);
1837 ((AliUEHistograms*) obj)->SetZVtxRange(-gZVtxRange+0.01, gZVtxRange-0.01);
1840 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)
1842 AliUEHist* corrected = (AliUEHist*) correctedVoid;
1843 AliUEHist* comparison = (AliUEHist*) comparisonVoid;
1845 Int_t beginStep = AliUEHist::kCFStepAll;
1846 Int_t endStep = AliUEHist::kCFStepReconstructed;
1848 if (compareStep != -1)
1850 beginStep = compareStep;
1851 endStep = compareStep;
1854 Int_t beginRegion = 0;
1855 Int_t endRegion = 2;
1857 if (compareRegion != -1)
1859 beginRegion = compareRegion;
1860 endRegion = compareRegion;
1863 for (Int_t step=beginStep; step<=endStep; step++)
1865 if (compareStep == -1 && (step == AliUEHist::kCFStepAnaTopology || step == AliUEHist::kCFStepTriggered))
1868 for (Int_t region=beginRegion; region <= endRegion; region++)
1870 Printf("%f %f", ptLeadMin, ptLeadMax);
1871 TH1* corrHist = corrected->GetUEHist(step, region, ptLeadMin, ptLeadMax);
1872 TH1* mcHist = comparison->GetUEHist(step, region, ptLeadMin, ptLeadMax);
1874 DrawRatio(corrHist, mcHist, TString(Form("%s: step %d %s %s", name, step, corrected->GetStepTitle(step), corrected->GetRegionTitle(region))));
1879 void DrawRatios(void* correctedVoid, void* comparisonVoid, Int_t compareStep = -1, Int_t compareRegion = 2, Int_t compareUEHist = 0)
1881 AliUEHistograms* corrected = (AliUEHistograms*) correctedVoid;
1882 AliUEHistograms* comparison = (AliUEHistograms*) comparisonVoid;
1884 if (1 && compareUEHist == 2)
1886 for (Float_t ptMin = 2.01; ptMin < 8; ptMin += 2)
1888 ((AliUEHistograms*) corrected)->SetPtRange(ptMin, ptMin + 1.98);
1889 ((AliUEHistograms*) comparison)->SetPtRange(ptMin, ptMin + 1.98);
1891 DrawRatios(TString(Form("Dphi %d pT %f", compareUEHist, ptMin)), corrected->GetUEHist(compareUEHist), comparison->GetUEHist(compareUEHist), compareStep, compareRegion, 8.01, 19.99);
1896 if (compareUEHist == -1)
1898 for (Int_t i=0; i<2; i++)
1899 DrawRatios(TString(Form("UE %d", i)), corrected->GetUEHist(i), comparison->GetUEHist(i), compareStep, compareRegion);
1902 DrawRatios(TString(Form("UE %d", compareUEHist)), corrected->GetUEHist(compareUEHist), comparison->GetUEHist(compareUEHist), compareStep, compareRegion);
1905 void CompareEventsTracks(void* corrVoid, void* mcVoid, Int_t compareStep, Int_t compareRegion, Int_t compareUEHist = 0)
1907 AliUEHist* corr = ((AliUEHistograms*) corrVoid)->GetUEHist(compareUEHist);
1908 AliUEHist* mc = ((AliUEHistograms*) mcVoid)->GetUEHist(compareUEHist);
1910 Float_t ptLeadMin = 0;
1911 Float_t ptLeadMax = -1;
1914 if (compareUEHist == 2)
1921 TH1* corrHist = corr->GetUEHist(compareStep, compareRegion, ptLeadMin, ptLeadMax);
1922 TH1* mcHist = mc ->GetUEHist(compareStep, compareRegion, ptLeadMin, ptLeadMax);
1924 DrawRatio(corrHist, mcHist, Form("check"));
1926 corr->SetBinLimits(corr->GetTrackHist(compareRegion)->GetGrid(compareStep));
1927 mc->SetBinLimits(corr->GetTrackHist(compareRegion)->GetGrid(compareStep));
1929 corrHist = corr->GetTrackHist(compareRegion)->GetGrid(compareStep)->Project(axis);
1930 mcHist = mc ->GetTrackHist(compareRegion)->GetGrid(compareStep)->Project(axis);
1931 DrawRatio(corrHist, mcHist, Form("check2"));
1933 corrHist = corr->GetEventHist()->GetGrid(compareStep)->Project(0);
1934 mcHist = mc ->GetEventHist()->GetGrid(compareStep)->Project(0);
1935 DrawRatio(corrHist, mcHist, Form("check3"));
1938 void CopyReconstructedData(const char* fileName)
1942 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1943 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1946 AliUEHistograms* onlyRec = (AliUEHistograms*) h->Clone();
1948 onlyRec->CopyReconstructedData(h);
1950 AliUEHistograms* onlyRecMixed = (AliUEHistograms*) hMixed->Clone();
1951 onlyRecMixed->Reset();
1952 onlyRecMixed->CopyReconstructedData(hMixed);
1954 TString newFileName(fileName);
1955 newFileName.ReplaceAll(".root", "");
1956 newFileName += "_onlyreco.root";
1960 list->Add(onlyRecMixed);
1962 file3 = TFile::Open(newFileName, "RECREATE");
1963 file3->mkdir("PWG4_PhiCorrelations");
1964 file3->cd("PWG4_PhiCorrelations");
1965 list->Write("histosPhiCorrelations", TObject::kSingleKey);
1969 void correctMC(const char* fileNameCorrections, const char* fileNameESD = 0, Int_t compareStep = -1, Int_t compareRegion = 2, Int_t compareUEHist = 0)
1971 // corrects the reconstructed step in fileNameESD with fileNameCorr
1972 // if fileNameESD is 0 data from fileNameCorr is taken
1973 // afterwards the corrected distributions are compared with the MC stored in fileNameESD
1977 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
1980 corr->ExtendTrackingEfficiency();
1982 AliUEHistograms* testSample = corr;
1984 testSample = (AliUEHistograms*) GetUEHistogram(fileNameESD);
1986 // copy to esd object
1987 AliUEHistograms* esd = (AliUEHistograms*) corr->Clone();
1989 esd->CopyReconstructedData(testSample);
1992 SetupRanges(testSample);
2000 file3 = TFile::Open("correctedMC.root", "RECREATE");
2001 file3->mkdir("PWG4_PhiCorrelations");
2002 file3->cd("PWG4_PhiCorrelations");
2003 list->Write("histosPhiCorrelations", TObject::kSingleKey);
2007 DrawRatios(esd, testSample, compareStep, compareRegion, compareUEHist);
2011 esd->SetPtRange(2.01, 3.99);
2012 corrected = esd->GetUEHist(2)->GetUEHist(0, 0, 4.01, 7.99, 0, -1, 1);
2013 testSample->SetPtRange(2.01, 3.99);
2014 mc = testSample->GetUEHist(2)->GetUEHist(0, 0, 4.01, 7.99, 0, -1, 1);
2015 new TCanvas; corrected->DrawCopy("SURF1");
2016 new TCanvas; mc->DrawCopy("SURF1");
2017 new TCanvas; mc->DrawCopy("SURF1")->Divide(corrected);
2020 //CompareEventsTracks(esd, testSample, compareStep, compareRegion, compareUEHist);
2023 // function to compare only final step for all regions and distributions
2025 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)
2027 // corrects fileNameESD with fileNameCorrections and compares the two
2031 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
2034 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD, &list);
2039 Float_t etaRange = 1.2;
2040 Printf(">>>>> Using eta range: |eta| < %f", etaRange);
2041 corr->SetEtaRange(-etaRange+0.01, etaRange-0.01);
2042 corr->ExtendTrackingEfficiency(0);
2044 // corr->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepTracked, AliUEHist::kCFStepTrackedOnlyPrim, 1, -1, 2);
2047 if (contEnhancement)
2049 TFile::Open(contEnhancement);
2050 contEncHist = (TH1*) gFile->Get("histo");
2051 contEncHistFullRange = (TH1*) corr->GetUEHist(0)->GetTrackingEfficiency(1)->Clone("contEncHistFullRange");
2053 contEncHistFullRange->Reset();
2054 for (Int_t i=1; i<=contEncHistFullRange->GetNbinsX(); i++)
2056 contEncHistFullRange->SetBinContent(i, 1);
2057 if (i <= contEncHist->GetNbinsX() && contEncHist->GetXaxis()->GetBinCenter(i) < contEncUpTo && contEncHist->GetBinContent(i) > 0)
2058 contEncHistFullRange->SetBinContent(i, contEncHist->GetBinContent(i));
2060 corr->SetContaminationEnhancement((TH1F*) contEncHistFullRange);
2064 //esd->GetUEHist(2)->AdditionalDPhiCorrection(0);
2066 file3 = TFile::Open("corrected.root", "RECREATE");
2067 file3->mkdir("PWG4_PhiCorrelations");
2068 file3->cd("PWG4_PhiCorrelations");
2069 list->Write("histosPhiCorrelations", TObject::kSingleKey);
2072 // DrawRatios(esd, corr, compareStep, compareRegion, compareUEHist);
2075 void ITSTPCEfficiency(const char* fileNameData, Int_t id, Int_t itsTPC = 0)
2079 // uncertainty from dN/dpT paper
2080 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};
2081 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
2082 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
2084 TH1F* effHist = new TH1F("effHist", "effHist", 39, pTBins);
2085 for (Int_t i=0; i<39; i++)
2090 effHist->SetBinContent(i+1, (itsTPC == 0) ? effITS[bin] : effTPC[bin]);
2093 new TCanvas; effHist->Draw();
2095 EffectOfModifiedTrackingEfficiency(fileNameData, id, 2, effHist, 1, -1, (itsTPC == 0) ? "ITS" : "TPC");
2099 void EffectOfModifiedTrackingEfficiency(const char* fileNameData, Int_t id, Int_t region, TH1* trackingEff, Int_t axis1, Int_t axis2 = -1, const char* name = "EffectOfModifiedTrackingEfficiency")
2101 // trackingEff should contain the change in tracking efficiency, i.e. between before and after in the eta-pT plane
2105 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
2106 SetupRanges(corrected);
2108 AliUEHist* ueHist = corrected->GetUEHist(id);
2110 Float_t ptLeadMin = -1;
2111 Float_t ptLeadMax = -1;
2114 // the uncertainty is flat in delta phi, so use this trick to get directly the uncertainty as function of leading pT
2120 TH1* before = ueHist->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2123 // the CFStepTriggered step is overwritten here and cannot be used for comparison afterwards anymore
2124 ueHist->CorrectTracks(AliUEHist::kCFStepAll, AliUEHist::kCFStepTriggered, (TH1*) 0, 0, -1);
2126 // reapply tracking efficiency
2127 ueHist->CorrectTracks(AliUEHist::kCFStepTriggered, AliUEHist::kCFStepAll, trackingEff, axis1, axis2);
2130 TH1* after = ueHist->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2132 DrawRatio(before, after, name);
2133 gPad->GetCanvas()->SaveAs(Form("%s.png", name));
2136 void EffectOfTrackCuts(const char* fileNameData, Int_t id, const char* systFile)
2140 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
2141 effHist = (TH2D*) corrected->GetUEHist(0)->GetTrackingEfficiency()->Clone("effHist");
2143 file = TFile::Open(systFile);
2146 const char* systNames[] = { "NClusTPC", "Chi2TPC", "SigmaDCA" };
2148 for (Int_t i=0; i<maxSyst; i++)
2150 for (Int_t j=0; j<2; j++)
2153 histName.Form("%s_syst_%s", systNames[i], (j == 0) ? "up" : "down");
2154 systEffect = (TH2*) file->Get(histName);
2158 for (Int_t x=1; x <= effHist->GetNbinsX(); x++)
2159 for (Int_t y=1; y <= effHist->GetNbinsY(); y++)
2160 effHist->SetBinContent(x, y, 1);
2162 for (Int_t x=1; x <= systEffect->GetNbinsX(); x++)
2163 for (Int_t y=1; y <= systEffect->GetNbinsY(); y++)
2164 if (systEffect->GetBinContent(x, y) != 0)
2165 effHist->SetBinContent(effHist->GetXaxis()->FindBin(systEffect->GetYaxis()->GetBinCenter(y)), effHist->GetYaxis()->FindBin(systEffect->GetXaxis()->GetBinCenter(x)), systEffect->GetBinContent(x, y));
2168 //new TCanvas; systEffect->Draw("COLZ"); new TCanvas; effHist->Draw("COLZ");
2170 EffectOfModifiedTrackingEfficiency(fileNameData, id, (id == 2) ? 0 : 2, effHist, 0, 1, histName);
2177 void ModifyComposition(const char* fileNameData, const char* fileNameCorrections, Int_t id, Bool_t verbose = kFALSE)
2181 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
2182 SetupRanges(corrected);
2184 AliUEHistograms* corrections = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
2185 SetupRanges(corrections);
2187 ueHistData = (AliUEHist*) corrected->GetUEHist(id);
2188 ueHistCorrections = (AliUEHist*) corrections->GetUEHist(id);
2191 // the CFStepTriggered step is overwritten here and cannot be used for comparison afterwards anymore
2192 ueHistData->CorrectTracks(AliUEHist::kCFStepAll, AliUEHist::kCFStepTriggered, (TH1*) 0, 0);
2194 Int_t maxRegion = 3;
2195 Float_t ptLeadMin = -1;
2196 Float_t ptLeadMax = -1;
2200 // the uncertainty is flat in delta phi, so use this trick to get directly the uncertainty as function of leading pT
2207 for (Int_t region=0; region<maxRegion; region++)
2208 before[region] = ueHistData->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2210 //defaultEff = ueHistCorrections->GetTrackingEfficiency();
2211 defaultEff = ueHistCorrections->GetTrackingCorrection();
2212 //defaultEffpT = ueHistCorrections->GetTrackingEfficiency(1);
2213 defaultEffpT = ueHistCorrections->GetTrackingCorrection(1);
2214 defaultContainer = ueHistCorrections->GetTrackHistEfficiency();
2217 defaultEffpT->Draw("");
2219 Float_t largestDeviation[3];
2220 for (Int_t i=0; i<maxRegion; i++)
2221 largestDeviation[i] = 0;
2223 for (Int_t i=0; i<7; i++)
2225 // case 0: // default
2226 // case 1: // + 30% kaons
2227 // case 2: // - 30% kaons
2228 // case 3: // + 30% protons
2229 // case 4: // - 30% protons
2230 // case 5: // + 30% others
2231 // case 6: // - 30% others
2232 Int_t correctionIndex = (i+1) / 2 + 1; // bin 1 == protons, bin 2 == kaons, ...
2233 Double_t scaleFactor = (i % 2 == 1) ? 1.3 : 0.7;
2237 newContainer = (AliCFContainer*) defaultContainer->Clone();
2239 // modify, change all steps
2240 for (Int_t j=0; j<newContainer->GetNStep(); j++)
2242 THnSparse* grid = newContainer->GetGrid(j)->GetGrid();
2244 for (Int_t binIdx = 0; binIdx < grid->GetNbins(); binIdx++)
2247 Double_t value = grid->GetBinContent(binIdx, bins);
2248 Double_t error = grid->GetBinError(binIdx);
2250 if (bins[2] != correctionIndex)
2253 value *= scaleFactor;
2254 error *= scaleFactor;
2256 grid->SetBinContent(bins, value);
2257 grid->SetBinError(bins, error);
2261 // put in corrections
2262 ueHistCorrections->SetTrackHistEfficiency(newContainer);
2265 //modifiedEff = ueHistCorrections->GetTrackingEfficiency();
2266 modifiedEff = ueHistCorrections->GetTrackingCorrection();
2267 modifiedEff->Divide(modifiedEff, defaultEff);
2268 //modifiedEff->Draw("COLZ");
2271 //modifiedEffpT = ueHistCorrections->GetTrackingEfficiency(1);
2272 modifiedEffpT = ueHistCorrections->GetTrackingCorrection(1);
2273 modifiedEffpT->SetLineColor(i+1);
2274 modifiedEffpT->Draw("SAME");
2276 // apply change in tracking efficiency
2277 ueHistData->CorrectTracks(AliUEHist::kCFStepTriggered, AliUEHist::kCFStepAll, modifiedEff, 0, 1);
2279 for (Int_t region=0; region<maxRegion; region++)
2282 TH1* after = ueHistData->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2285 DrawRatio(before[region], (TH1*) after->Clone(), Form("Region %d Composition %d", region, i));
2287 // ratio is flat, extract deviation
2288 after->Divide(before[region]);
2289 after->Fit("pol0", "0");
2290 Float_t deviation = 100.0 - 100.0 * after->GetFunction("pol0")->GetParameter(0);
2291 Printf("Deviation for region %d case %d is %.2f %%", region, i, deviation);
2293 if (TMath::Abs(deviation) > largestDeviation[region])
2294 largestDeviation[region] = TMath::Abs(deviation);
2299 for (Int_t i=0; i<maxRegion; i++)
2300 Printf("Largest deviation in region %d is %f", i, largestDeviation[i]);
2303 void MergeList(const char* prefix = "", const char* suffix = "", Bool_t copy = kFALSE)
2306 gSystem->Load("libPWGflowBase");
2307 gSystem->Load("libPWGflowTasks");
2312 TFileMerger m(copy);
2319 if (line.Length() == 0)
2323 fileName.Form("%s%s%s", prefix, line.Data(), suffix);
2324 // fileName.Form("alien://%s", line.Data());
2325 Printf("%s", fileName.Data());
2327 m.AddFile(fileName);
2331 m.OutputFile("merged.root");
2335 void Merge2(const char* file1, const char* file2)
2344 m.OutputFile("merged.root");
2348 void Merge3(const char* file1, const char* file2, const char* file3)
2358 m.OutputFile("merged.root");
2362 void MergeList2(const char* listFile, const char* dir, Bool_t onlyPrintEvents = kFALSE, const char* targetDir = "PWG4_LeadingTrackUE")
2369 AliUEHistograms* final = 0;
2370 TList* finalList = 0;
2377 if (line.Length() == 0)
2381 fileName.Form("%s/%s/PWG4_JetTasksOutput.root", dir, line.Data());
2382 Printf("%s", fileName.Data());
2385 AliUEHistograms* obj = (AliUEHistograms*) GetUEHistogram(fileName, &list);
2391 final = (AliUEHistograms*) obj;
2392 //final->GetEventCount()->Draw(); return;
2393 Printf("Events: %d", (Int_t) final->GetEventCount()->ProjectionX()->GetBinContent(4));
2398 additional = (AliUEHistograms*) obj;
2399 Printf("Events: %d", (Int_t) additional->GetEventCount()->ProjectionX()->GetBinContent(4));
2401 if (!onlyPrintEvents)
2404 list2.Add(additional);
2405 final->Merge(&list2);
2412 if (onlyPrintEvents)
2415 Printf("Total events (at step 0): %d", (Int_t) final->GetEventCount()->ProjectionX()->GetBinContent(4));
2417 file3 = TFile::Open("merged.root", "RECREATE");
2418 file3->mkdir(targetDir);
2419 file3->cd(targetDir);
2420 finalList->Write(0, TObject::kSingleKey);
2424 void PlotAll(const char* correctedFile, const char* mcFile)
2430 Float_t range[] = { 1.5, 2 };
2434 Float_t range[] = { 3, 10 };
2437 for (Int_t id=0; id<3; id++)
2440 gForceRange = range[id];
2446 for (Int_t region=0; region<3; region++)
2448 CompareStep(correctedFile, mcFile, id, 0, region);
2449 gPad->GetCanvas()->SaveAs(Form("%s_%s_%d_%d.png", TString(correctedFile).Tokenize(".")->First()->GetName(), TString(mcFile).Tokenize(".")->First()->GetName(), id, region));
2454 Float_t leadingPtArr[] = { 0.50, 2.0, 4.0, 6.0, 10.0, 20.0, 50.0 };
2455 for (Int_t leadingPtID=0; leadingPtID<6; leadingPtID++)
2457 CompareStep(correctedFile, mcFile, id, 0, 0, leadingPtArr[leadingPtID] + 0.01, leadingPtArr[leadingPtID+1] - 0.01);
2458 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]));
2465 TGraph* GetFlow2040()
2467 // from first ALICE flow paper (provided by Raimond)
2468 // http://www-library.desy.de/spires/find/hep/www?eprint=arXiv:1011.3914
2470 // centrality 20-30%
2471 Double_t xCumulant4th2030ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2472 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
2473 5.500000,7.000000,9.000000};
2474 Double_t yCumulant4th2030ALICE[] = {0.000000,0.000000,0.030926,0.041076,0.052063,0.059429,0.070500,0.084461,0.086745,0.099254,
2475 0.109691,0.116398,0.130831,0.141959,0.158932,0.169680,0.171387,0.178858,0.171475,0.140358,
2476 0.000000,0.000000,0.000000};
2477 Double_t xErrCumulant4th2030ALICE[23] = {0.};
2478 Double_t yErrCumulant4th2030ALICE[] = {0.000000,0.000000,0.002857,0.003451,0.003567,0.003859,0.004609,0.004976,0.005412,0.006277,
2479 0.004748,0.005808,0.006896,0.007987,0.008683,0.008080,0.013278,0.018413,0.024873,0.026057,
2480 0.000000,0.000000,0.000000};
2481 Int_t nPointsCumulant4th2030ALICE = sizeof(xCumulant4th2030ALICE)/sizeof(Double_t);
2482 TGraphErrors *Cumulant4th2030ALICE = new TGraphErrors(nPointsCumulant4th2030ALICE,xCumulant4th2030ALICE,yCumulant4th2030ALICE,
2483 xErrCumulant4th2030ALICE,yErrCumulant4th2030ALICE);
2484 Cumulant4th2030ALICE->SetMarkerStyle(kFullSquare);
2485 Cumulant4th2030ALICE->SetMarkerColor(kRed);
2486 Cumulant4th2030ALICE->SetMarkerSize(1.2);
2487 Cumulant4th2030ALICE->SetFillStyle(1001);
2488 Cumulant4th2030ALICE->SetFillColor(kRed-10);
2490 //===================================================================================================================
2491 // centrality 30-40%
2492 Double_t xCumulant4th3040ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2493 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
2494 5.500000,7.000000,9.000000};
2495 Double_t yCumulant4th3040ALICE[] = {0.000000,0.000000,0.037071,0.048566,0.061083,0.070910,0.078831,0.091396,0.102026,0.109691,
2496 0.124449,0.139819,0.155561,0.165701,0.173678,0.191149,0.202015,0.204540,0.212560,0.195885,
2497 0.000000,0.000000,0.000000};
2498 Double_t xErrCumulant4th3040ALICE[23] = {0.};
2499 Double_t yErrCumulant4th3040ALICE[] = {0.000000,0.000000,0.002992,0.003364,0.003669,0.003931,0.004698,0.005261,0.005446,0.006151,
2500 0.004980,0.005741,0.007198,0.008576,0.010868,0.009926,0.015269,0.020691,0.027601,0.031834,
2501 0.000000,0.000000,0.000000};
2502 Int_t nPointsCumulant4th3040ALICE = sizeof(xCumulant4th3040ALICE)/sizeof(Double_t);
2503 TGraphErrors *Cumulant4th3040ALICE = new TGraphErrors(nPointsCumulant4th3040ALICE,xCumulant4th3040ALICE,yCumulant4th3040ALICE,
2504 xErrCumulant4th3040ALICE,yErrCumulant4th3040ALICE);
2505 Cumulant4th3040ALICE->SetMarkerStyle(kFullTriangleUp);
2506 Cumulant4th3040ALICE->SetMarkerColor(kGreen+2);
2507 Cumulant4th3040ALICE->SetMarkerSize(1.2);
2508 Cumulant4th3040ALICE->SetFillStyle(1001);
2509 Cumulant4th3040ALICE->SetFillColor(kGreen+2);
2511 // build average between the two (for class 20-40%)
2512 Double_t* yAverage = new Double_t[nPointsCumulant4th3040ALICE];
2513 for (Int_t i=0; i<nPointsCumulant4th3040ALICE; i++)
2514 yAverage[i] = (yCumulant4th2030ALICE[i] + yCumulant4th3040ALICE[i]) / 2;
2516 // assume flow constant above highest pT; not neccessarily physically sound ;)
2519 yAverage[20] = yAverage[19];
2520 xCumulant4th3040ALICE[20] = 100;
2521 nPointsCumulant4th3040ALICE -= 2;
2524 TGraph *flow2040 = new TGraph(nPointsCumulant4th3040ALICE,xCumulant4th3040ALICE,yAverage);
2528 flow2040->Draw("*A");
2529 Cumulant4th2030ALICE->Draw("PSAME");
2530 Cumulant4th3040ALICE->Draw("PSAME");
2538 TGraph* GetFlow1020()
2540 // from first ALICE flow paper (provided by Raimond)
2541 // http://www-library.desy.de/spires/find/hep/www?eprint=arXiv:1011.3914
2543 //===================================================================================================================
2544 // centrality 10-20%
2545 Double_t xCumulant4th1020ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2546 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
2547 5.500000,7.000000,9.000000};
2548 Double_t yCumulant4th1020ALICE[] = {0.000000,0.000000,0.024075,0.031505,0.040413,0.044981,0.055358,0.060563,0.063378,0.070030,
2549 0.082692,0.091611,0.099641,0.107223,0.122376,0.131240,0.137425,0.146050,0.131365,0.124708,
2550 0.000000,0.000000,0.000000};
2551 Double_t xErrCumulant4th1020ALICE[23] = {0.};
2552 Double_t yErrCumulant4th1020ALICE[] = {0.000000,0.000000,0.002413,0.002931,0.003444,0.003950,0.004338,0.004835,0.005059,0.005586,
2553 0.004521,0.005278,0.005999,0.007072,0.008260,0.007279,0.011897,0.017409,0.023995,0.025701,
2554 0.000000,0.000000,0.000000};
2555 Int_t nPointsCumulant4th1020ALICE = sizeof(xCumulant4th1020ALICE)/sizeof(Double_t);
2557 // assume flow constant above highest pT; not neccessarily physically sound ;)
2560 yCumulant4th1020ALICE[20] = yCumulant4th1020ALICE[19];
2561 xCumulant4th1020ALICE[20] = 100;
2562 nPointsCumulant4th1020ALICE -= 2;
2565 TGraphErrors *Cumulant4th1020ALICE = new TGraphErrors(nPointsCumulant4th1020ALICE,xCumulant4th1020ALICE,yCumulant4th1020ALICE,
2566 xErrCumulant4th1020ALICE,yErrCumulant4th1020ALICE);
2568 Cumulant4th1020ALICE->SetMarkerStyle(kFullCircle);
2569 Cumulant4th1020ALICE->SetMarkerColor(kBlue);
2570 Cumulant4th1020ALICE->SetMarkerSize(1.2);
2571 Cumulant4th1020ALICE->SetFillStyle(1001);
2572 Cumulant4th1020ALICE->SetFillColor(kBlue-10);
2574 TGraph *flow1020 = new TGraph(nPointsCumulant4th1020ALICE,xCumulant4th1020ALICE,yCumulant4th1020ALICE);
2578 flow1020->Draw("*A");
2579 Cumulant4th1020ALICE->Draw("PSAME");
2589 // takes flow measurement from 10-20% and scales by a factor extracted from Fig.3 in the ALICE flow paper
2590 // factor = integrated flow in 0-5% / integrated flow in 10-20%
2592 graph = GetFlow1020();
2593 for (Int_t i=0; i<graph->GetN(); i++)
2594 graph->GetY()[i] *= 0.016 / 0.055;
2599 TGraphErrors* GetFlow01_Rap02(Int_t n)
2601 // private communication 19.04.11, Raimond / Ante
2605 // v2{SP}(pt) for 0-1%, rapidity gap = 0.2:
2606 const Int_t nPointsSP_0001ALICE_v2_etaGap02 = 18;
2607 Double_t xSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2608 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};
2609 Double_t ySP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.009235,0.014105,0.017274,0.018245,0.023190,
2610 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};
2611 Double_t xErrSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.};
2612 Double_t yErrSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.000515,0.000504,0.000532,0.000585,0.000641,
2613 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};
2614 TGraphErrors *SP_0001ALICE_v2_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v2_etaGap02,xSP_0001ALICE_v2_etaGap02,
2615 ySP_0001ALICE_v2_etaGap02,xErrSP_0001ALICE_v2_etaGap02,yErrSP_0001ALICE_v2_etaGap02);
2616 SP_0001ALICE_v2_etaGap02->SetMarkerStyle(kFullCircle);
2617 SP_0001ALICE_v2_etaGap02->SetMarkerColor(kBlue);
2618 SP_0001ALICE_v2_etaGap02->SetFillStyle(1001);
2619 SP_0001ALICE_v2_etaGap02->SetFillColor(kBlue-10);
2621 return SP_0001ALICE_v2_etaGap02;
2626 // v3{SP}(pt) for 0-1%, rapidity gap = 0.2:
2627 const Int_t nPointsSP_0001ALICE_v3_etaGap02 = 18;
2628 Double_t xSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2629 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};
2630 Double_t ySP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.005688,0.007222,0.010305,0.013795,0.016077,
2631 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};
2632 Double_t xErrSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.};
2633 Double_t yErrSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.000585,0.000582,0.000614,0.000667,0.000734,
2634 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};
2635 TGraphErrors *SP_0001ALICE_v3_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v3_etaGap02,xSP_0001ALICE_v3_etaGap02,ySP_0001ALICE_v3_etaGap02,
2636 xErrSP_0001ALICE_v3_etaGap02,yErrSP_0001ALICE_v3_etaGap02);
2637 SP_0001ALICE_v3_etaGap02->SetMarkerStyle(kFullTriangleUp);
2638 SP_0001ALICE_v3_etaGap02->SetMarkerSize(1.4);
2639 SP_0001ALICE_v3_etaGap02->SetMarkerColor(kGreen+2);
2640 SP_0001ALICE_v3_etaGap02->SetFillStyle(1001);
2641 SP_0001ALICE_v3_etaGap02->SetFillColor(kGreen-10);
2643 return SP_0001ALICE_v3_etaGap02;
2648 // v4{SP}(pt) for 0-1%, rapidity gap = 0.2:
2649 const Int_t nPointsSP_0001ALICE_v4_etaGap02 = 18;
2650 Double_t xSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2651 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};
2652 Double_t ySP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.001189,0.003540,0.004682,0.004210,0.007032,
2653 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};
2654 Double_t xErrSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.};
2655 Double_t yErrSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.001035,0.001017,0.001081,0.001187,0.001299,
2656 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};
2657 TGraphErrors *SP_0001ALICE_v4_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v4_etaGap02,xSP_0001ALICE_v4_etaGap02,ySP_0001ALICE_v4_etaGap02,
2658 xErrSP_0001ALICE_v4_etaGap02,yErrSP_0001ALICE_v4_etaGap02);
2659 SP_0001ALICE_v4_etaGap02->SetMarkerStyle(kFullSquare);
2660 SP_0001ALICE_v4_etaGap02->SetMarkerColor(kRed);
2661 SP_0001ALICE_v4_etaGap02->SetFillStyle(1001);
2662 SP_0001ALICE_v4_etaGap02->SetFillColor(kRed-10);
2664 return SP_0001ALICE_v4_etaGap02;
2670 TGraphErrors* GetFlow01_Rap10(Int_t n)
2674 // v2{SP}(pt) for 0-1%, rapidity gap = 1.0:
2675 const Int_t nPointsSP_0001ALICE_v2_etaGap10 = 21;
2676 Double_t xSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2677 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,
2678 3.250000,3.750000,4.500000};
2679 Double_t ySP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.009129,0.013461,0.017567,0.018041,0.020384,
2680 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,
2681 0.036905,0.054836,0.030527};
2682 Double_t xErrSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.};
2683 Double_t yErrSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.001179,0.001152,0.001219,0.001339,0.001480,
2684 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,
2685 0.009145,0.014749,0.018698};
2686 TGraphErrors *SP_0001ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v2_etaGap10,xSP_0001ALICE_v2_etaGap10,
2687 ySP_0001ALICE_v2_etaGap10,xErrSP_0001ALICE_v2_etaGap10,yErrSP_0001ALICE_v2_etaGap10);
2688 SP_0001ALICE_v2_etaGap10->SetMarkerStyle(kOpenCircle);
2689 SP_0001ALICE_v2_etaGap10->SetMarkerColor(kBlue);
2690 SP_0001ALICE_v2_etaGap10->SetFillStyle(1001);
2691 SP_0001ALICE_v2_etaGap10->SetFillColor(kBlue-10);
2693 return SP_0001ALICE_v2_etaGap10;
2698 // v3{SP}(pt) for 0-1%, rapidity gap = 1.0:
2699 const Int_t nPointsSP_0001ALICE_v3_etaGap10 = 18;
2700 Double_t xSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2701 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};
2702 Double_t ySP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.006373,0.008403,0.010848,0.011505,0.016728,
2703 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};
2704 Double_t xErrSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.};
2705 Double_t yErrSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.001286,0.001269,0.001346,0.001474,0.001620,
2706 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};
2707 TGraphErrors *SP_0001ALICE_v3_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v3_etaGap10,xSP_0001ALICE_v3_etaGap10,ySP_0001ALICE_v3_etaGap10,
2708 xErrSP_0001ALICE_v3_etaGap10,yErrSP_0001ALICE_v3_etaGap10);
2709 SP_0001ALICE_v3_etaGap10->SetMarkerStyle(kOpenTriangleUp);
2710 SP_0001ALICE_v3_etaGap10->SetMarkerSize(1.2);
2711 SP_0001ALICE_v3_etaGap10->SetMarkerColor(kGreen+2);
2712 SP_0001ALICE_v3_etaGap10->SetFillStyle(1001);
2713 SP_0001ALICE_v3_etaGap10->SetFillColor(kGreen-10);
2715 return SP_0001ALICE_v3_etaGap10;
2720 // v4{SP}(pt) for 0-1%, rapidity gap = 1.0:
2721 const Int_t nPointsSP_0001ALICE_v4_etaGap10 = 11;
2722 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};
2723 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};
2724 Double_t xErrSP_0001ALICE_v4_etaGap10[nPointsSP_0001ALICE_v4_etaGap10] = {0.};
2725 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};
2726 TGraphErrors *SP_0001ALICE_v4_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v4_etaGap10,xSP_0001ALICE_v4_etaGap10,ySP_0001ALICE_v4_etaGap10,
2727 xErrSP_0001ALICE_v4_etaGap10,yErrSP_0001ALICE_v4_etaGap10);
2728 SP_0001ALICE_v4_etaGap10->SetMarkerStyle(kOpenSquare);
2729 SP_0001ALICE_v4_etaGap10->SetMarkerColor(kRed);
2730 SP_0001ALICE_v4_etaGap10->SetFillStyle(1001);
2731 SP_0001ALICE_v4_etaGap10->SetFillColor(kRed-10);
2733 return SP_0001ALICE_v4_etaGap10;
2738 // v5{SP}(pt) for 0-1%, rapidity gap = 1.0:
2739 const Int_t nPointsSP_0001ALICE_v5_etaGap10 = 11;
2740 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};
2741 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};
2742 Double_t xErrSP_0001ALICE_v5_etaGap10[nPointsSP_0001ALICE_v5_etaGap10] = {0.};
2743 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};
2744 TGraphErrors *SP_0001ALICE_v5_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v5_etaGap10,xSP_0001ALICE_v5_etaGap10,ySP_0001ALICE_v5_etaGap10,
2745 xErrSP_0001ALICE_v5_etaGap10,yErrSP_0001ALICE_v5_etaGap10);
2746 return SP_0001ALICE_v5_etaGap10;
2750 TGraphErrors* GetFlow02_Rap10(Int_t n)
2752 // private communication 20.04.11, Ante B. / Raimond
2756 // v2{SP}(pt) for 00-02%, eta gap = 1.0:
2757 const Int_t nPointsSP_0002_v2_etaGap10 = 15;
2758 Double_t xSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
2759 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
2760 Double_t ySP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.010171,0.013190,0.017342,0.020629,0.022617,0.026549,
2761 0.027423,0.032261,0.037467,0.041001,0.045763,0.049327,0.049688,0.051480,0.038527};
2762 Double_t xErrSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.};
2763 Double_t yErrSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.000600,0.000590,0.000625,0.000683,0.000757,0.000839,
2764 0.000692,0.000848,0.000888,0.001209,0.001653,0.002252,0.002465,0.003968,0.009391};
2765 TGraphErrors *SP_0002_v2_etaGap10 = new TGraphErrors(nPointsSP_0002_v2_etaGap10,xSP_0002_v2_etaGap10,ySP_0002_v2_etaGap10,
2766 xErrSP_0002_v2_etaGap10,yErrSP_0002_v2_etaGap10);
2768 return SP_0002_v2_etaGap10;
2773 const Int_t nPointsSP_0002_v3_etaGap10 = 15;
2774 Double_t xSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
2775 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
2776 Double_t ySP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.006592,0.007286,0.012180,0.012242,0.017416,0.018393,
2777 0.024716,0.030980,0.037703,0.046558,0.051285,0.064613,0.074831,0.077093,0.082442};
2778 Double_t xErrSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.};
2779 Double_t yErrSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.000682,0.000676,0.000713,0.000782,0.000860,0.000953,
2780 0.000782,0.000957,0.001002,0.001361,0.001862,0.002541,0.002767,0.004466,0.010586};
2781 TGraphErrors *SP_0002_v3_etaGap10 = new TGraphErrors(nPointsSP_0002_v3_etaGap10,xSP_0002_v3_etaGap10,ySP_0002_v3_etaGap10,
2782 xErrSP_0002_v3_etaGap10,yErrSP_0002_v3_etaGap10);
2784 return SP_0002_v3_etaGap10;
2789 const Int_t nPointsSP_0002_v4_etaGap10 = 15;
2790 Double_t xSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
2791 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
2792 Double_t ySP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {-0.000533,0.001167,0.002081,0.005218,0.006826,0.008440,
2793 0.013009,0.014812,0.017125,0.030106,0.038279,0.050488,0.067640,0.071637,0.084239};
2794 Double_t xErrSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.};
2795 Double_t yErrSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.001427,0.001398,0.001482,0.001594,0.001758,0.001945,
2796 0.001593,0.001951,0.002046,0.002787,0.003802,0.005182,0.005663,0.009064,0.021449};
2797 TGraphErrors *SP_0002_v4_etaGap10 = new TGraphErrors(nPointsSP_0002_v4_etaGap10,xSP_0002_v4_etaGap10,ySP_0002_v4_etaGap10,
2798 xErrSP_0002_v4_etaGap10,yErrSP_0002_v4_etaGap10);
2799 return SP_0002_v4_etaGap10;
2804 // v5{SP}(pt) for 00-02%, eta gap = 0.2:
2805 const Int_t nPointsSP_0002_v5_etaGap02 = 13;
2806 Double_t xSP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.300000,0.500000,0.700000,0.900000,1.100000,1.300000,1.500000,
2807 1.700000,2.000000,2.550000,3.250000,3.950000,4.650000};
2808 Double_t ySP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.000570,0.002922,0.002151,0.005256,0.006287,0.005849,0.009399,
2809 0.011420,0.012455,0.032134,0.057009,0.020607,0.013551};
2810 Double_t xErrSP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.};
2811 Double_t yErrSP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.001074,0.001155,0.001433,0.001725,0.002123,0.002608,0.003196,
2812 0.003930,0.003755,0.004869,0.009719,0.018353,0.031814};
2813 TGraphErrors *SP_0002_v5_etaGap02 = new TGraphErrors(nPointsSP_0002_v5_etaGap02,xSP_0002_v5_etaGap02,ySP_0002_v5_etaGap02,
2814 xErrSP_0002_v5_etaGap02,yErrSP_0002_v5_etaGap02);
2815 return SP_0002_v5_etaGap02;
2819 TGraphErrors* GetFlow02(Int_t n)
2821 // private communication 28.01.11, Ante B. / Raimond
2826 Double_t xCumulant2nd0002ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2827 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2828 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
2830 Double_t yCumulant2nd0002ALICE_v2[] = {0.000000,0.000000,0.012173,0.015186,0.018580,0.021114,0.024646,0.027040,0.030269,0.032677,
2831 0.035332,0.037382,0.039228,0.040614,0.042460,0.044658,0.046246,0.050392,0.051436,0.054669,
2832 0.057330,0.063439,0.067425,0.060144,0.071260,0.070206,0.000000,0.000000,0.000000,0.000000,
2834 Double_t xErrCumulant2nd0002ALICE_v2[31] = {0.};
2835 Double_t yErrCumulant2nd0002ALICE_v2[] = {0.000000,0.000000,0.000256,0.000259,0.000271,0.000296,0.000322,0.000357,0.000397,0.000438,
2836 0.000483,0.000529,0.000590,0.000639,0.000713,0.000793,0.000877,0.000976,0.001070,0.001197,
2837 0.000725,0.001265,0.002069,0.003156,0.004605,0.006543,0.000000,0.000000,0.000000,0.000000,
2839 Int_t nPointsCumulant2nd0002ALICE_v2 = sizeof(xCumulant2nd0002ALICE_v2)/sizeof(Double_t);
2840 TGraphErrors *Cumulant2nd0002ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v2,xCumulant2nd0002ALICE_v2,yCumulant2nd0002ALICE_v2,
2841 xErrCumulant2nd0002ALICE_v2,yErrCumulant2nd0002ALICE_v2);
2842 Cumulant2nd0002ALICE_v2->SetMarkerStyle(kFullCircle);
2843 Cumulant2nd0002ALICE_v2->SetMarkerColor(kBlue);
2845 return Cumulant2nd0002ALICE_v2;
2851 Double_t xCumulant2nd0002ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2852 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2853 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
2855 Double_t yCumulant2nd0002ALICE_v3[] = {0.000000,0.000000,0.007696,0.008994,0.010544,0.013269,0.016330,0.019234,0.023465,0.026803,
2856 0.029906,0.032211,0.035300,0.038158,0.041861,0.046002,0.049382,0.053574,0.055773,0.059420,
2857 0.069373,0.079922,0.090265,0.103583,0.111358,0.090740,0.000000,0.000000,0.000000,0.000000,
2859 Double_t xErrCumulant2nd0002ALICE_v3[31] = {0.};
2860 Double_t yErrCumulant2nd0002ALICE_v3[] = {0.000000,0.000000,0.000318,0.000317,0.000333,0.000360,0.000392,0.000431,0.000476,0.000523,
2861 0.000575,0.000637,0.000707,0.000785,0.000878,0.000964,0.001064,0.001175,0.001320,0.001459,
2862 0.000889,0.001539,0.002530,0.003826,0.005614,0.007892,0.000000,0.000000,0.000000,0.000000,
2864 Int_t nPointsCumulant2nd0002ALICE_v3 = sizeof(xCumulant2nd0002ALICE_v3)/sizeof(Double_t);
2865 TGraphErrors *Cumulant2nd0002ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v3,xCumulant2nd0002ALICE_v3,yCumulant2nd0002ALICE_v3,
2866 xErrCumulant2nd0002ALICE_v3,yErrCumulant2nd0002ALICE_v3);
2867 Cumulant2nd0002ALICE_v3->SetMarkerStyle(kFullTriangleUp);
2868 Cumulant2nd0002ALICE_v3->SetMarkerSize(1.2);
2869 Cumulant2nd0002ALICE_v3->SetMarkerColor(kGreen+2);
2871 return Cumulant2nd0002ALICE_v3;
2877 Double_t xCumulant2nd0002ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2878 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2879 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
2881 Double_t yCumulant2nd0002ALICE_v4[] = {0.000000,0.000000,0.005710,0.006014,0.004483,0.005453,0.007714,0.006837,0.009721,0.011288,
2882 0.012531,0.016461,0.016606,0.018587,0.022722,0.025497,0.025832,0.030994,0.030349,0.034730,
2883 0.045529,0.061153,0.074238,0.079307,0.088885,0.085218,0.000000,0.000000,0.000000,0.000000,
2885 Double_t xErrCumulant2nd0002ALICE_v4[31] = {0.};
2886 Double_t yErrCumulant2nd0002ALICE_v4[] = {0.000000,0.000000,0.000488,0.000493,0.000523,0.000571,0.000609,0.000678,0.000742,0.000805,
2887 0.000903,0.000985,0.001100,0.001219,0.001352,0.001503,0.001682,0.001847,0.002060,0.002303,
2888 0.001400,0.002431,0.003974,0.006040,0.008901,0.012343,0.000000,0.000000,0.000000,0.000000,
2890 Int_t nPointsCumulant2nd0002ALICE_v4 = sizeof(xCumulant2nd0002ALICE_v4)/sizeof(Double_t);
2891 TGraphErrors *Cumulant2nd0002ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v4,xCumulant2nd0002ALICE_v4,yCumulant2nd0002ALICE_v4,
2892 xErrCumulant2nd0002ALICE_v4,yErrCumulant2nd0002ALICE_v4);
2893 Cumulant2nd0002ALICE_v4->SetMarkerStyle(kFullSquare);
2894 Cumulant2nd0002ALICE_v4->SetMarkerColor(kRed);
2896 return Cumulant2nd0002ALICE_v4;
2902 /* results up to 5 GeV/c
2904 TGraphErrors* GetFlow05(Int_t n)
2906 // private communication 02.02.11, Ante B. / Raimond
2910 // v2{2}(pt) for 0-5%:
2911 Double_t xCumulant2nd0005ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2912 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2913 Double_t yCumulant2nd0005ALICE_v2[] = {0.000000,0.000000,0.013891,0.017693,0.021693,0.025323,0.029131,0.032443,0.035781,0.038256,
2914 0.042801,0.047705,0.053229,0.057387,0.062677,0.068815,0.077695,0.082058,0.082511,0.079791};
2915 Double_t xErrCumulant2nd0005ALICE_v2[20] = {0.};
2916 Double_t yErrCumulant2nd0005ALICE_v2[] = {0.000000,0.000000,0.000149,0.000150,0.000160,0.000174,0.000191,0.000211,0.000233,0.000257,
2917 0.000208,0.000254,0.000311,0.000377,0.000464,0.000419,0.000726,0.001180,0.001791,0.002131};
2918 Int_t nPointsCumulant2nd0005ALICE_v2 = sizeof(xCumulant2nd0005ALICE_v2)/sizeof(Double_t);
2919 TGraphErrors *Cumulant2nd0005ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v2,xCumulant2nd0005ALICE_v2,yCumulant2nd0005ALICE_v2,
2920 xErrCumulant2nd0005ALICE_v2,yErrCumulant2nd0005ALICE_v2);
2921 Cumulant2nd0005ALICE_v2->SetMarkerStyle(kFullCircle);
2922 Cumulant2nd0005ALICE_v2->SetMarkerColor(kBlue);
2924 return Cumulant2nd0005ALICE_v2;
2929 // v3{2}(pt) for 0-5%:
2930 Double_t xCumulant2nd0005ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2931 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2932 Double_t yCumulant2nd0005ALICE_v3[] = {0.000000,0.000000,0.007788,0.009472,0.011596,0.014618,0.017540,0.021020,0.024946,0.028004,
2933 0.032330,0.039491,0.046368,0.053620,0.060662,0.071750,0.086746,0.097857,0.103111,0.104796};
2934 Double_t xErrCumulant2nd0005ALICE_v3[20] = {0.};
2935 Double_t yErrCumulant2nd0005ALICE_v3[] = {0.000000,0.000000,0.000194,0.000192,0.000204,0.000221,0.000241,0.000265,0.000293,0.000323,
2936 0.000266,0.000323,0.000397,0.000486,0.000601,0.000545,0.000947,0.001541,0.002328,0.002777};
2937 Int_t nPointsCumulant2nd0005ALICE_v3 = sizeof(xCumulant2nd0005ALICE_v3)/sizeof(Double_t);
2938 TGraphErrors *Cumulant2nd0005ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v3,xCumulant2nd0005ALICE_v3,yCumulant2nd0005ALICE_v3,
2939 xErrCumulant2nd0005ALICE_v3,yErrCumulant2nd0005ALICE_v3);
2940 Cumulant2nd0005ALICE_v3->SetMarkerStyle(kFullCircle);
2941 Cumulant2nd0005ALICE_v3->SetMarkerColor(kBlue);
2943 return Cumulant2nd0005ALICE_v3;
2948 // v4{2}(pt) for 0-5%:
2949 Double_t xCumulant2nd0005ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2950 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2951 Double_t yCumulant2nd0005ALICE_v4[] = {0.000000,0.000000,0.006121,0.006137,0.005598,0.005956,0.007262,0.007991,0.009159,0.012062,
2952 0.015085,0.019225,0.024782,0.030092,0.035708,0.046542,0.060077,0.076088,0.082964,0.085405};
2953 Double_t xErrCumulant2nd0005ALICE_v4[20] = {0.};
2954 Double_t yErrCumulant2nd0005ALICE_v4[] = {0.000000,0.000000,0.000275,0.000278,0.000294,0.000319,0.000346,0.000380,0.000419,0.000459,
2955 0.000378,0.000460,0.000570,0.000700,0.000865,0.000789,0.001370,0.002227,0.003370,0.004018};
2956 Int_t nPointsCumulant2nd0005ALICE_v4 = sizeof(xCumulant2nd0005ALICE_v4)/sizeof(Double_t);
2957 TGraphErrors *Cumulant2nd0005ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v4,xCumulant2nd0005ALICE_v4,yCumulant2nd0005ALICE_v4,
2958 xErrCumulant2nd0005ALICE_v4,yErrCumulant2nd0005ALICE_v4);
2959 Cumulant2nd0005ALICE_v4->SetMarkerStyle(kFullCircle);
2960 Cumulant2nd0005ALICE_v4->SetMarkerColor(kBlue);
2962 return Cumulant2nd0005ALICE_v4;
2968 TGraphErrors* GetFlow510(Int_t n)
2970 // private communication 02.02.11, Ante B. / Raimond
2974 // v2{2}(pt) for 5-10%:
2975 Double_t xCumulant2nd0510ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2976 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2977 Double_t yCumulant2nd0510ALICE_v2[] = {0.000000,0.000000,0.019872,0.026451,0.032901,0.039085,0.044930,0.050200,0.054887,0.060253,
2978 0.066587,0.075080,0.083303,0.090298,0.098782,0.109632,0.124486,0.129621,0.132076,0.120697};
2979 Double_t xErrCumulant2nd0510ALICE_v2[20] = {0.};
2980 Double_t yErrCumulant2nd0510ALICE_v2[] = {0.000000,0.000000,0.000150,0.000152,0.000163,0.000178,0.000196,0.000215,0.000237,0.000261,
2981 0.000213,0.000256,0.000313,0.000381,0.000468,0.000423,0.000727,0.001157,0.001741,0.002064};
2982 Int_t nPointsCumulant2nd0510ALICE_v2 = sizeof(xCumulant2nd0510ALICE_v2)/sizeof(Double_t);
2983 TGraphErrors *Cumulant2nd0510ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v2,xCumulant2nd0510ALICE_v2,yCumulant2nd0510ALICE_v2,
2984 xErrCumulant2nd0510ALICE_v2,yErrCumulant2nd0510ALICE_v2);
2985 Cumulant2nd0510ALICE_v2->SetMarkerStyle(kOpenCircle);
2986 Cumulant2nd0510ALICE_v2->SetMarkerColor(kBlue);
2988 return Cumulant2nd0510ALICE_v2;
2993 // v3{2}(pt) for 5-10%:
2994 Double_t xCumulant2nd0510ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2995 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2996 Double_t yCumulant2nd0510ALICE_v3[] = {0.000000,0.000000,0.008596,0.010700,0.013820,0.017524,0.021507,0.024316,0.028491,0.032880,
2997 0.038741,0.045830,0.052486,0.059560,0.067990,0.081006,0.097402,0.107050,0.111743,0.116434};
2998 Double_t xErrCumulant2nd0510ALICE_v3[20] = {0.};
2999 Double_t yErrCumulant2nd0510ALICE_v3[] = {0.000000,0.000000,0.000208,0.000207,0.000218,0.000235,0.000258,0.000284,0.000314,0.000347,
3000 0.000285,0.000345,0.000426,0.000521,0.000642,0.000586,0.001008,0.001611,0.002421,0.002853};
3001 Int_t nPointsCumulant2nd0510ALICE_v3 = sizeof(xCumulant2nd0510ALICE_v3)/sizeof(Double_t);
3002 TGraphErrors *Cumulant2nd0510ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v3,xCumulant2nd0510ALICE_v3,yCumulant2nd0510ALICE_v3,
3003 xErrCumulant2nd0510ALICE_v3,yErrCumulant2nd0510ALICE_v3);
3004 Cumulant2nd0510ALICE_v3->SetMarkerStyle(kOpenCircle);
3005 Cumulant2nd0510ALICE_v3->SetMarkerColor(kBlue);
3007 return Cumulant2nd0510ALICE_v3;
3012 // v4{2}(pt) for 5-10%:
3013 Double_t xCumulant2nd0510ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3014 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3015 Double_t yCumulant2nd0510ALICE_v4[] = {0.000000,0.000000,0.006466,0.006731,0.006344,0.007374,0.008775,0.010324,0.012323,0.014533,
3016 0.017261,0.022507,0.028776,0.035403,0.041936,0.051491,0.070340,0.080081,0.095077,0.088526};
3017 Double_t xErrCumulant2nd0510ALICE_v4[20] = {0.};
3018 Double_t yErrCumulant2nd0510ALICE_v4[] = {0.000000,0.000000,0.000292,0.000295,0.000312,0.000336,0.000366,0.000403,0.000443,0.000485,
3019 0.000399,0.000486,0.000603,0.000738,0.000914,0.000836,0.001443,0.002303,0.003448,0.004078};
3020 Int_t nPointsCumulant2nd0510ALICE_v4 = sizeof(xCumulant2nd0510ALICE_v4)/sizeof(Double_t);
3021 TGraphErrors *Cumulant2nd0510ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v4,xCumulant2nd0510ALICE_v4,yCumulant2nd0510ALICE_v4,
3022 xErrCumulant2nd0510ALICE_v4,yErrCumulant2nd0510ALICE_v4);
3023 Cumulant2nd0510ALICE_v4->SetMarkerStyle(kOpenCircle);
3024 Cumulant2nd0510ALICE_v4->SetMarkerColor(kBlue);
3026 return Cumulant2nd0510ALICE_v4;
3032 TGraphErrors* GetFlow1020(Int_t n)
3034 // private communication 02.02.11, Ante B. / Raimond
3038 // v2{2}(pt) for 10-20%:
3039 Double_t xCumulant2nd1020ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3040 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3041 Double_t yCumulant2nd1020ALICE_v2[] = {0.000000,0.000000,0.027683,0.037083,0.046511,0.055519,0.063979,0.071626,0.078537,0.085975,
3042 0.095001,0.106979,0.118456,0.129721,0.140641,0.155161,0.173402,0.179870,0.180616,0.168921};
3043 Double_t xErrCumulant2nd1020ALICE_v2[20] = {0.};
3044 Double_t yErrCumulant2nd1020ALICE_v2[] = {0.000000,0.000000,0.000121,0.000124,0.000134,0.000147,0.000163,0.000179,0.000198,0.000217,
3045 0.000177,0.000212,0.000257,0.000311,0.000380,0.000341,0.000569,0.000882,0.001309,0.001537};
3046 Int_t nPointsCumulant2nd1020ALICE_v2 = sizeof(xCumulant2nd1020ALICE_v2)/sizeof(Double_t);
3047 TGraphErrors *Cumulant2nd1020ALICE_v2 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v2,xCumulant2nd1020ALICE_v2,yCumulant2nd1020ALICE_v2,
3048 xErrCumulant2nd1020ALICE_v2,yErrCumulant2nd1020ALICE_v2);
3049 Cumulant2nd1020ALICE_v2->SetMarkerStyle(kFullSquare);
3050 Cumulant2nd1020ALICE_v2->SetMarkerColor(kRed);
3052 return Cumulant2nd1020ALICE_v2;
3057 // v3{2}(pt) for 10-20%:
3058 Double_t xCumulant2nd1020ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3059 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3060 Double_t yCumulant2nd1020ALICE_v3[] = {0.000000,0.000000,0.009830,0.012858,0.016111,0.020120,0.023948,0.028349,0.032741,0.037244,
3061 0.043385,0.051803,0.059374,0.068686,0.076763,0.090151,0.106530,0.117448,0.121383,0.118247};
3062 Double_t xErrCumulant2nd1020ALICE_v3[20] = {0.};
3063 Double_t yErrCumulant2nd1020ALICE_v3[] = {0.000000,0.000000,0.000171,0.000170,0.000180,0.000195,0.000215,0.000236,0.000261,0.000287,
3064 0.000236,0.000288,0.000353,0.000434,0.000536,0.000488,0.000823,0.001277,0.001892,0.002224};
3065 Int_t nPointsCumulant2nd1020ALICE_v3 = sizeof(xCumulant2nd1020ALICE_v3)/sizeof(Double_t);
3066 TGraphErrors *Cumulant2nd1020ALICE_v3 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v3,xCumulant2nd1020ALICE_v3,yCumulant2nd1020ALICE_v3,
3067 xErrCumulant2nd1020ALICE_v3,yErrCumulant2nd1020ALICE_v3);
3068 Cumulant2nd1020ALICE_v3->SetMarkerStyle(kFullSquare);
3069 Cumulant2nd1020ALICE_v3->SetMarkerColor(kRed);
3071 return Cumulant2nd1020ALICE_v3;
3076 // v4{2}(pt) for 10-20%:
3077 Double_t xCumulant2nd1020ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3078 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3079 Double_t yCumulant2nd1020ALICE_v4[] = {0.000000,0.000000,0.007423,0.007647,0.008189,0.008592,0.009489,0.011671,0.013739,0.017199,
3080 0.020084,0.026004,0.031843,0.038388,0.047357,0.057251,0.072433,0.086326,0.094282,0.097432};
3081 Double_t xErrCumulant2nd1020ALICE_v4[20] = {0.};
3082 Double_t yErrCumulant2nd1020ALICE_v4[] = {0.000000,0.000000,0.000243,0.000244,0.000257,0.000279,0.000306,0.000335,0.000368,0.000405,
3083 0.000333,0.000406,0.000502,0.000618,0.000770,0.000701,0.001185,0.001845,0.002730,0.003193};
3084 Int_t nPointsCumulant2nd1020ALICE_v4 = sizeof(xCumulant2nd1020ALICE_v4)/sizeof(Double_t);
3085 TGraphErrors *Cumulant2nd1020ALICE_v4 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v4,xCumulant2nd1020ALICE_v4,yCumulant2nd1020ALICE_v4,
3086 xErrCumulant2nd1020ALICE_v4,yErrCumulant2nd1020ALICE_v4);
3087 Cumulant2nd1020ALICE_v4->SetMarkerStyle(kFullSquare);
3088 Cumulant2nd1020ALICE_v4->SetMarkerColor(kRed);
3090 return Cumulant2nd1020ALICE_v4;
3096 TGraphErrors* GetFlow2030(Int_t n)
3098 // private communication 02.02.11, Ante B. / Raimond
3102 Double_t xCumulant2nd2030ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3103 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3104 Double_t yCumulant2nd2030ALICE_v2[] = {0.000000,0.000000,0.035557,0.048064,0.060768,0.072585,0.083808,0.093772,0.103310,0.112602,
3105 0.124846,0.140603,0.155345,0.169450,0.183077,0.200173,0.219693,0.225741,0.223318,0.207356};
3106 Double_t xErrCumulant2nd2030ALICE_v2[20] = {0.};
3107 Double_t yErrCumulant2nd2030ALICE_v2[] = {0.000000,0.000000,0.000144,0.000147,0.000159,0.000175,0.000194,0.000214,0.000235,0.000259,
3108 0.000211,0.000254,0.000310,0.000377,0.000464,0.000418,0.000677,0.001027,0.001513,0.001761};
3109 Int_t nPointsCumulant2nd2030ALICE_v2 = sizeof(xCumulant2nd2030ALICE_v2)/sizeof(Double_t);
3110 TGraphErrors *Cumulant2nd2030ALICE_v2 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v2,xCumulant2nd2030ALICE_v2,yCumulant2nd2030ALICE_v2,
3111 xErrCumulant2nd2030ALICE_v2,yErrCumulant2nd2030ALICE_v2);
3112 Cumulant2nd2030ALICE_v2->SetMarkerStyle(kOpenSquare);
3113 Cumulant2nd2030ALICE_v2->SetMarkerColor(kRed);
3115 return Cumulant2nd2030ALICE_v2;
3120 // v3{2}(pt) for 20-30%:
3121 Double_t xCumulant2nd2030ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3122 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3123 Double_t yCumulant2nd2030ALICE_v3[] = {0.000000,0.000000,0.011287,0.014937,0.018479,0.022962,0.027854,0.031938,0.037038,0.041443,
3124 0.049872,0.058720,0.068353,0.077692,0.087859,0.099863,0.116141,0.124486,0.124786,0.119520};
3125 Double_t xErrCumulant2nd2030ALICE_v3[20] = {0.};
3126 Double_t yErrCumulant2nd2030ALICE_v3[] = {0.000000,0.000000,0.000215,0.000216,0.000228,0.000248,0.000272,0.000300,0.000332,0.000366,
3127 0.000301,0.000369,0.000456,0.000561,0.000700,0.000636,0.001038,0.001574,0.002307,0.002676};
3128 Int_t nPointsCumulant2nd2030ALICE_v3 = sizeof(xCumulant2nd2030ALICE_v3)/sizeof(Double_t);
3129 TGraphErrors *Cumulant2nd2030ALICE_v3 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v3,xCumulant2nd2030ALICE_v3,yCumulant2nd2030ALICE_v3,
3130 xErrCumulant2nd2030ALICE_v3,yErrCumulant2nd2030ALICE_v3);
3131 Cumulant2nd2030ALICE_v3->SetMarkerStyle(kOpenSquare);
3132 Cumulant2nd2030ALICE_v3->SetMarkerColor(kRed);
3134 return Cumulant2nd2030ALICE_v3;
3139 // v4{2}(pt) for 20-30%:
3140 Double_t xCumulant2nd2030ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3141 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3142 Double_t yCumulant2nd2030ALICE_v4[] = {0.000000,0.000000,0.008435,0.009824,0.009387,0.010408,0.011458,0.013770,0.016335,0.019165,
3143 0.023770,0.030071,0.036231,0.043950,0.051803,0.065222,0.082155,0.091864,0.105061,0.105167};
3144 Double_t xErrCumulant2nd2030ALICE_v4[20] = {0.};
3145 Double_t yErrCumulant2nd2030ALICE_v4[] = {0.000000,0.000000,0.000308,0.000308,0.000328,0.000355,0.000391,0.000430,0.000473,0.000524,
3146 0.000430,0.000524,0.000652,0.000807,0.001006,0.000919,0.001502,0.002277,0.003339,0.003871};
3147 Int_t nPointsCumulant2nd2030ALICE_v4 = sizeof(xCumulant2nd2030ALICE_v4)/sizeof(Double_t);
3148 TGraphErrors *Cumulant2nd2030ALICE_v4 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v4,xCumulant2nd2030ALICE_v4,yCumulant2nd2030ALICE_v4,
3149 xErrCumulant2nd2030ALICE_v4,yErrCumulant2nd2030ALICE_v4);
3150 Cumulant2nd2030ALICE_v4->SetMarkerStyle(kOpenSquare);
3151 Cumulant2nd2030ALICE_v4->SetMarkerColor(kRed);
3153 return Cumulant2nd2030ALICE_v4;
3159 TGraphErrors* GetFlow3040(Int_t n)
3161 // private communication 02.02.11, Ante B. / Raimond
3165 // v2{2}(pt) for 30-40%:
3166 Double_t xCumulant2nd3040ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3167 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3168 Double_t yCumulant2nd3040ALICE_v2[] = {0.000000,0.000000,0.040797,0.055427,0.070543,0.084024,0.096562,0.109411,0.119853,0.130964,
3169 0.145377,0.163806,0.179825,0.196178,0.210377,0.226556,0.245686,0.247898,0.240058,0.225011};
3170 Double_t xErrCumulant2nd3040ALICE_v2[20] = {0.};
3171 Double_t yErrCumulant2nd3040ALICE_v2[] = {0.000000,0.000000,0.000177,0.000182,0.000197,0.000216,0.000239,0.000265,0.000293,0.000325,
3172 0.000266,0.000321,0.000395,0.000486,0.000603,0.000536,0.000840,0.001258,0.001843,0.002118};
3173 Int_t nPointsCumulant2nd3040ALICE_v2 = sizeof(xCumulant2nd3040ALICE_v2)/sizeof(Double_t);
3174 TGraphErrors *Cumulant2nd3040ALICE_v2 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v2,xCumulant2nd3040ALICE_v2,yCumulant2nd3040ALICE_v2,
3175 xErrCumulant2nd3040ALICE_v2,yErrCumulant2nd3040ALICE_v2);
3176 Cumulant2nd3040ALICE_v2->SetMarkerStyle(kFullTriangleUp);
3177 Cumulant2nd3040ALICE_v2->SetMarkerSize(1.2);
3178 Cumulant2nd3040ALICE_v2->SetMarkerColor(kGreen+2);
3180 return Cumulant2nd3040ALICE_v2;
3185 // v3{2}(pt) for 30-40%:
3186 Double_t xCumulant2nd3040ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3187 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3188 Double_t yCumulant2nd3040ALICE_v3[] = {0.000000,0.000000,0.012226,0.016391,0.020792,0.026208,0.030380,0.035710,0.041025,0.047062,
3189 0.053075,0.064201,0.074116,0.085314,0.094391,0.106819,0.124012,0.129388,0.134315,0.132330};
3190 Double_t xErrCumulant2nd3040ALICE_v3[20] = {0.};
3191 Double_t yErrCumulant2nd3040ALICE_v3[] = {0.000000,0.000000,0.000284,0.000286,0.000303,0.000329,0.000364,0.000403,0.000443,0.000492,
3192 0.000408,0.000500,0.000627,0.000778,0.000973,0.000874,0.001375,0.002050,0.002992,0.003438};
3193 Int_t nPointsCumulant2nd3040ALICE_v3 = sizeof(xCumulant2nd3040ALICE_v3)/sizeof(Double_t);
3194 TGraphErrors *Cumulant2nd3040ALICE_v3 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v3,xCumulant2nd3040ALICE_v3,yCumulant2nd3040ALICE_v3,
3195 xErrCumulant2nd3040ALICE_v3,yErrCumulant2nd3040ALICE_v3);
3196 Cumulant2nd3040ALICE_v3->SetMarkerStyle(kFullTriangleUp);
3197 Cumulant2nd3040ALICE_v3->SetMarkerSize(1.2);
3198 Cumulant2nd3040ALICE_v3->SetMarkerColor(kGreen+2);
3200 return Cumulant2nd3040ALICE_v3;
3205 // v4{2}(pt) for 30-40%:
3206 Double_t xCumulant2nd3040ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3207 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3208 Double_t yCumulant2nd3040ALICE_v4[] = {0.000000,0.000000,0.010718,0.011490,0.010994,0.012527,0.013748,0.016425,0.018857,0.021622,
3209 0.026853,0.034636,0.042651,0.049892,0.057795,0.070865,0.088486,0.101656,0.113886,0.118202};
3210 Double_t xErrCumulant2nd3040ALICE_v4[20] = {0.};
3211 Double_t yErrCumulant2nd3040ALICE_v4[] = {0.000000,0.000000,0.000401,0.000406,0.000433,0.000472,0.000521,0.000575,0.000634,0.000704,
3212 0.000580,0.000714,0.000890,0.001114,0.001398,0.001253,0.001974,0.002945,0.004290,0.004909};
3213 Int_t nPointsCumulant2nd3040ALICE_v4 = sizeof(xCumulant2nd3040ALICE_v4)/sizeof(Double_t);
3214 TGraphErrors *Cumulant2nd3040ALICE_v4 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v4,xCumulant2nd3040ALICE_v4,yCumulant2nd3040ALICE_v4,
3215 xErrCumulant2nd3040ALICE_v4,yErrCumulant2nd3040ALICE_v4);
3216 Cumulant2nd3040ALICE_v4->SetMarkerStyle(kFullTriangleUp);
3217 Cumulant2nd3040ALICE_v4->SetMarkerSize(1.2);
3218 Cumulant2nd3040ALICE_v4->SetMarkerColor(kGreen+2);
3220 return Cumulant2nd3040ALICE_v4;
3226 TGraphErrors* GetFlow4050(Int_t n)
3228 // private communication 02.02.11, Ante B. / Raimond
3232 // v2{2}(pt) for 40-50%:
3233 Double_t xCumulant2nd4050ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3234 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3235 Double_t yCumulant2nd4050ALICE_v2[] = {0.000000,0.000000,0.043593,0.059522,0.075558,0.090681,0.104453,0.117913,0.129349,0.141743,
3236 0.157076,0.176121,0.193651,0.208844,0.222402,0.238407,0.252512,0.253592,0.243571,0.233018};
3237 Double_t xErrCumulant2nd4050ALICE_v2[20] = {0.};
3238 Double_t yErrCumulant2nd4050ALICE_v2[] = {0.000000,0.000000,0.000234,0.000241,0.000261,0.000288,0.000322,0.000357,0.000395,0.000438,
3239 0.000362,0.000447,0.000555,0.000685,0.000846,0.000733,0.001121,0.001665,0.002433,0.002768};
3240 Int_t nPointsCumulant2nd4050ALICE_v2 = sizeof(xCumulant2nd4050ALICE_v2)/sizeof(Double_t);
3241 TGraphErrors *Cumulant2nd4050ALICE_v2 = new TGraphErrors(nPointsCumulant2nd4050ALICE_v2,xCumulant2nd4050ALICE_v2,yCumulant2nd4050ALICE_v2,
3242 xErrCumulant2nd4050ALICE_v2,yErrCumulant2nd4050ALICE_v2);
3243 Cumulant2nd4050ALICE_v2->SetMarkerStyle(kOpenTriangleUp);
3244 Cumulant2nd4050ALICE_v2->SetMarkerSize(1.2);
3245 Cumulant2nd4050ALICE_v2->SetMarkerColor(kGreen+2);
3247 return Cumulant2nd4050ALICE_v2;
3254 // results up to high pT
3256 TGraphErrors* GetFlow05(Int_t n)
3258 // private communication 09.03.11, Ante B. / Raimond
3262 // v2{2}(pt) for 0-5%:
3263 Double_t xCumulant2nd0005ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3264 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3265 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3266 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3267 Double_t yCumulant2nd0005ALICE[] = {0.000000,0.000000,0.018169,0.020988,0.024899,0.028309,0.031974,0.035188,0.038218,0.041202,
3268 0.043910,0.046560,0.048183,0.050640,0.052874,0.055334,0.056948,0.059427,0.061540,0.063218,
3269 0.065452,0.069222,0.072578,0.074723,0.077749,0.077178,0.080514,0.075325,0.077692,0.079710,
3270 0.073280,0.063849,0.068274,0.066045,0.071496,0.104352,0.091646,0.050220,0.124185,0.088535};
3271 Double_t xErrCumulant2nd0005ALICE[40] = {0.};
3272 Double_t yErrCumulant2nd0005ALICE[] = {0.000000,0.000000,0.000190,0.000191,0.000199,0.000212,0.000230,0.000248,0.000268,0.000293,
3273 0.000319,0.000346,0.000379,0.000418,0.000459,0.000502,0.000554,0.000614,0.000674,0.000749,
3274 0.000620,0.000769,0.000958,0.001182,0.001446,0.001331,0.001858,0.002552,0.003453,0.004606,
3275 0.004289,0.007006,0.010046,0.013853,0.017709,0.016630,0.025728,0.036763,0.045056,0.029011};
3276 Int_t nPointsCumulant2nd0005ALICE = sizeof(xCumulant2nd0005ALICE)/sizeof(Double_t);
3277 TGraphErrors *Cumulant2nd0005ALICE = new TGraphErrors(nPointsCumulant2nd0005ALICE,xCumulant2nd0005ALICE,yCumulant2nd0005ALICE,
3278 xErrCumulant2nd0005ALICE,yErrCumulant2nd0005ALICE);
3279 Cumulant2nd0005ALICE->SetMarkerStyle(kFullCircle);
3280 Cumulant2nd0005ALICE->SetMarkerColor(kBlue);
3282 return Cumulant2nd0005ALICE;
3296 TGraphErrors* GetFlow05_Rap10(Int_t n)
3298 // private communication 17.05.11, Ante B. / should correspond to machcone paper draft
3302 // v2{SP}(pt) for 00-05%:
3303 const Int_t nPointsSP_0005ALICE_v2_etaGap10 = 17;
3304 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,
3305 1.300000,1.500000,1.700000,1.900000,2.200000,2.600000,3.000000,3.650000,4.550000};
3306 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,
3307 0.043103,0.046626,0.052386,0.057132,0.060070,0.068419,0.061459,0.056816,0.050311};
3308 Double_t xErrSP_0005ALICE_v2_etaGap10[nPointsSP_0005ALICE_v2_etaGap10] = {0.};
3309 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,
3310 0.001410,0.001736,0.002131,0.002620,0.002502,0.003759,0.005615,0.006617,0.014242};
3311 TGraphErrors *GrSP_0005ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v2_etaGap10,xSP_0005ALICE_v2_etaGap10,ySP_0005ALICE_v2_etaGap10,
3312 xErrSP_0005ALICE_v2_etaGap10,yErrSP_0005ALICE_v2_etaGap10);
3314 return GrSP_0005ALICE_v2_etaGap10;
3319 // v3{SP}(pt) for 00-05%:
3320 const Int_t nPointsSP_0005ALICE_v3_etaGap10 = 16;
3321 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,
3322 1.300000,1.500000,1.700000,1.900000,2.300000,2.900000,3.650000,4.550000};
3323 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,
3324 0.038730,0.045653,0.052469,0.062303,0.071522,0.082223,0.083373,0.076951};
3325 Double_t xErrSP_0005ALICE_v3_etaGap10[nPointsSP_0005ALICE_v3_etaGap10] = {0.};
3326 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,
3327 0.001734,0.002124,0.002610,0.003206,0.002724,0.004977,0.008123,0.017180};
3328 TGraphErrors *GrSP_0005ALICE_v3_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v3_etaGap10,xSP_0005ALICE_v3_etaGap10,ySP_0005ALICE_v3_etaGap10,
3329 xErrSP_0005ALICE_v3_etaGap10,yErrSP_0005ALICE_v3_etaGap10);
3332 return GrSP_0005ALICE_v3_etaGap10;
3337 // v4{SP}(pt) for 00-05%:
3338 const Int_t nPointsSP_0005ALICE_v4_etaGap10 = 11;
3339 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};
3340 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,
3342 Double_t xErrSP_0005ALICE_v4_etaGap10[nPointsSP_0005ALICE_v4_etaGap10] = {0.};
3343 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,
3345 TGraphErrors *GrSP_0005ALICE_v4_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v4_etaGap10,xSP_0005ALICE_v4_etaGap10,ySP_0005ALICE_v4_etaGap10,
3346 xErrSP_0005ALICE_v4_etaGap10,yErrSP_0005ALICE_v4_etaGap10);
3348 return GrSP_0005ALICE_v4_etaGap10;
3353 // v5{SP}(pt) for 00-05%:
3354 const Int_t nPointsSP_0005ALICE_v5_etaGap10 = 12;
3355 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,
3356 2.800000,3.500000,4.500000};
3357 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,
3358 0.031373,0.068504,0.017964};
3359 Double_t xErrSP_0005ALICE_v5_etaGap10[nPointsSP_0005ALICE_v5_etaGap10] = {0.};
3360 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,
3361 0.010073,0.011899,0.027756};
3362 TGraphErrors *GrSP_0005ALICE_v5_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v5_etaGap10,xSP_0005ALICE_v5_etaGap10,ySP_0005ALICE_v5_etaGap10,
3363 xErrSP_0005ALICE_v5_etaGap10,yErrSP_0005ALICE_v5_etaGap10);
3365 return GrSP_0005ALICE_v5_etaGap10;
3371 TGraphErrors* GetFlow510(Int_t n)
3373 // private communication 09.03.11, Ante B. / Raimond
3377 // v2{2}(pt) for 5-10%:
3378 Double_t xCumulant2nd0510ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3379 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3380 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3381 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3382 Double_t yCumulant2nd0510ALICE[] = {0.000000,0.000000,0.022354,0.028064,0.034341,0.040769,0.046265,0.051160,0.056712,0.061354,
3383 0.066290,0.070340,0.074453,0.078444,0.082367,0.085785,0.088086,0.092676,0.096169,0.100366,
3384 0.104227,0.109710,0.117032,0.121784,0.122227,0.126537,0.127966,0.117790,0.117884,0.111436,
3385 0.104945,0.097640,0.086481,0.091663,0.091404,0.080132,0.015864,0.101500,0.033347,0.205130};
3386 Double_t xErrCumulant2nd0510ALICE[40] = {0.};
3387 Double_t yErrCumulant2nd0510ALICE[] = {0.000000,0.000000,0.000173,0.000176,0.000186,0.000199,0.000219,0.000236,0.000260,0.000283,
3388 0.000312,0.000340,0.000373,0.000410,0.000454,0.000501,0.000552,0.000610,0.000675,0.000753,
3389 0.000620,0.000774,0.000961,0.001183,0.001431,0.001309,0.001814,0.002481,0.003342,0.004379,
3390 0.004122,0.006716,0.009851,0.013626,0.017517,0.015790,0.025680,0.038041,0.054144,0.038987};
3391 Int_t nPointsCumulant2nd0510ALICE = sizeof(xCumulant2nd0510ALICE)/sizeof(Double_t);
3392 TGraphErrors *Cumulant2nd0510ALICE = new TGraphErrors(nPointsCumulant2nd0510ALICE,xCumulant2nd0510ALICE,yCumulant2nd0510ALICE,
3393 xErrCumulant2nd0510ALICE,yErrCumulant2nd0510ALICE);
3394 Cumulant2nd0510ALICE->SetMarkerStyle(kOpenCircle);
3395 Cumulant2nd0510ALICE->SetMarkerColor(kBlue);
3397 return Cumulant2nd0510ALICE;
3411 TGraphErrors* GetFlow510_Rap10(Int_t n)
3413 // private communication 18.05.11, Ante B.
3417 // v2{SP}(pt) for 05-10%, rapidity gap = 1.0:
3418 const Int_t nPointsSP_0510ALICE_v2_etaGap10 = 19;
3419 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,
3420 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.250000,
3422 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,
3423 0.066516,0.073891,0.080945,0.090386,0.094505,0.106393,0.120303,0.122586,0.121731,0.107343,
3425 Double_t xErrSP_0510ALICE_v2_etaGap10[nPointsSP_0510ALICE_v2_etaGap10] = {0.};
3426 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,
3427 0.000586,0.000717,0.000880,0.001082,0.001333,0.001189,0.001969,0.003199,0.005011,0.007602,
3429 TGraphErrors *GrSP_0510ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_0510ALICE_v2_etaGap10,xSP_0510ALICE_v2_etaGap10,
3430 ySP_0510ALICE_v2_etaGap10,xErrSP_0510ALICE_v2_etaGap10,
3431 yErrSP_0510ALICE_v2_etaGap10);
3433 return GrSP_0510ALICE_v2_etaGap10;
3439 TGraphErrors* GetFlow1020(Int_t n)
3441 // private communication 09.03.11, Ante B. / Raimond
3445 // v2{2}(pt) for 10-20%:
3446 Double_t xCumulant2nd1020ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3447 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3448 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3449 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3450 Double_t yCumulant2nd1020ALICE[] = {0.000000,0.000000,0.028508,0.037698,0.046914,0.055750,0.063948,0.072298,0.079396,0.086829,
3451 0.093382,0.099676,0.105412,0.110792,0.116715,0.122327,0.127079,0.132302,0.137183,0.142346,
3452 0.149059,0.156729,0.164672,0.171840,0.175346,0.176824,0.178878,0.174979,0.169229,0.153109,
3453 0.139676,0.125686,0.120554,0.096537,0.084736,0.118152,0.116079,0.060032,0.093764,0.206506};
3454 Double_t xErrCumulant2nd1020ALICE[40] = {0.};
3455 Double_t yErrCumulant2nd1020ALICE[] = {0.000000,0.000000,0.000134,0.000136,0.000145,0.000158,0.000173,0.000190,0.000209,0.000229,
3456 0.000252,0.000275,0.000301,0.000331,0.000365,0.000401,0.000442,0.000488,0.000541,0.000599,
3457 0.000496,0.000614,0.000757,0.000915,0.001095,0.000989,0.001360,0.001847,0.002477,0.003234,
3458 0.003012,0.004867,0.007123,0.009774,0.012740,0.011682,0.019629,0.028568,0.039931,0.024776};
3459 Int_t nPointsCumulant2nd1020ALICE = sizeof(xCumulant2nd1020ALICE)/sizeof(Double_t);
3460 TGraphErrors *Cumulant2nd1020ALICE = new TGraphErrors(nPointsCumulant2nd1020ALICE,xCumulant2nd1020ALICE,yCumulant2nd1020ALICE,
3461 xErrCumulant2nd1020ALICE,yErrCumulant2nd1020ALICE);
3462 Cumulant2nd1020ALICE->SetMarkerStyle(kFullSquare);
3463 Cumulant2nd1020ALICE->SetMarkerColor(kRed);
3465 return Cumulant2nd1020ALICE;
3479 TGraphErrors* GetFlow1020_Rap10(Int_t n)
3481 // private communication 18.05.11, Ante B.
3485 // v2{SP}(pt) for 10-20%, rapidity gap = 1.0:
3486 const Int_t nPointsSP_1020ALICE_v2_etaGap10 = 19;
3487 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,
3488 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.250000,
3490 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,
3491 0.094701,0.105631,0.117906,0.128147,0.138505,0.153494,0.166651,0.172691,0.177337,0.155068,
3493 Double_t xErrSP_1020ALICE_v2_etaGap10[nPointsSP_1020ALICE_v2_etaGap10] = {0.};
3494 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,
3495 0.000423,0.000517,0.000634,0.000779,0.000959,0.000856,0.001406,0.002266,0.003528,0.005281,
3497 TGraphErrors *GrSP_1020ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_1020ALICE_v2_etaGap10,xSP_1020ALICE_v2_etaGap10,
3498 ySP_1020ALICE_v2_etaGap10,xErrSP_1020ALICE_v2_etaGap10,
3499 yErrSP_1020ALICE_v2_etaGap10);
3501 return GrSP_1020ALICE_v2_etaGap10;
3507 TGraphErrors* GetFlow2030(Int_t n)
3509 // private communication 09.03.11, Ante B. / Raimond
3513 // v2{2}(pt) for 20-30%:
3514 Double_t xCumulant2nd2030ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3515 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3516 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3517 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3518 Double_t yCumulant2nd2030ALICE[] = {0.000000,0.000000,0.035366,0.047465,0.060083,0.072090,0.083418,0.093576,0.103842,0.113110,
3519 0.122193,0.130168,0.138158,0.145627,0.152851,0.159129,0.166073,0.173144,0.178698,0.186188,
3520 0.192045,0.202199,0.210535,0.215004,0.220457,0.223339,0.224050,0.211567,0.203955,0.189716,
3521 0.165994,0.147185,0.131953,0.139331,0.151293,0.127406,0.153764,0.089628,0.161247,0.511418};
3522 Double_t xErrCumulant2nd2030ALICE[40] = {0.};
3523 Double_t yErrCumulant2nd2030ALICE[] = {0.000000,0.000000,0.000155,0.000157,0.000169,0.000184,0.000202,0.000222,0.000244,0.000269,
3524 0.000296,0.000325,0.000357,0.000394,0.000435,0.000481,0.000532,0.000589,0.000655,0.000731,
3525 0.000605,0.000743,0.000904,0.001081,0.001277,0.001145,0.001568,0.002119,0.002806,0.003635,
3526 0.003383,0.005346,0.007935,0.010739,0.014682,0.013434,0.021531,0.032352,0.040396,0.028472};
3527 Int_t nPointsCumulant2nd2030ALICE = sizeof(xCumulant2nd2030ALICE)/sizeof(Double_t);
3528 TGraphErrors *Cumulant2nd2030ALICE = new TGraphErrors(nPointsCumulant2nd2030ALICE,xCumulant2nd2030ALICE,yCumulant2nd2030ALICE,
3529 xErrCumulant2nd2030ALICE,yErrCumulant2nd2030ALICE);
3530 Cumulant2nd2030ALICE->SetMarkerStyle(kOpenSquare);
3531 Cumulant2nd2030ALICE->SetMarkerColor(kRed);
3533 return Cumulant2nd2030ALICE;
3547 TGraphErrors* GetFlow3040(Int_t n)
3549 // private communication 09.03.11, Ante B. / Raimond
3553 // v2{2}(pt) for 30-40%:
3554 Double_t xCumulant2nd3040ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3555 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3556 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3557 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3558 Double_t yCumulant2nd3040ALICE[] = {0.000000,0.000000,0.039584,0.054196,0.069291,0.082976,0.095622,0.108940,0.119830,0.131587,
3559 0.141091,0.150899,0.160573,0.168676,0.176301,0.183823,0.191672,0.199506,0.206854,0.212830,
3560 0.219526,0.229376,0.236513,0.240863,0.245961,0.245891,0.242608,0.234302,0.219580,0.212848,
3561 0.194666,0.190184,0.171036,0.159173,0.156932,0.141324,0.132809,0.182683,0.023272,0.032825};
3562 Double_t xErrCumulant2nd3040ALICE[40] = {0.};
3563 Double_t yErrCumulant2nd3040ALICE[] = {0.000000,0.000000,0.000189,0.000192,0.000205,0.000224,0.000247,0.000273,0.000302,0.000334,
3564 0.000369,0.000407,0.000448,0.000496,0.000552,0.000612,0.000682,0.000758,0.000844,0.000941,
3565 0.000774,0.000937,0.001123,0.001329,0.001565,0.001397,0.001911,0.002549,0.003378,0.004306,
3566 0.003987,0.006353,0.009128,0.013032,0.016891,0.015806,0.025150,0.035119,0.044487,0.050083};
3567 Int_t nPointsCumulant2nd3040ALICE = sizeof(xCumulant2nd3040ALICE)/sizeof(Double_t);
3568 TGraphErrors *Cumulant2nd3040ALICE = new TGraphErrors(nPointsCumulant2nd3040ALICE,xCumulant2nd3040ALICE,yCumulant2nd3040ALICE,
3569 xErrCumulant2nd3040ALICE,yErrCumulant2nd3040ALICE);
3570 Cumulant2nd3040ALICE->SetMarkerStyle(kFullTriangleUp);
3571 Cumulant2nd3040ALICE->SetMarkerColor(kGreen+2);
3573 return Cumulant2nd3040ALICE;
3587 TGraphErrors* GetFlow4050(Int_t n)
3589 // private communication 09.03.11, Ante B. / Raimond
3593 // v2{2}(pt) for 40-50%:
3594 Double_t xCumulant2nd4050ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3595 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3596 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3597 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3598 Double_t yCumulant2nd4050ALICE[] = {0.000000,0.000000,0.041872,0.058090,0.074444,0.089181,0.103780,0.117279,0.129769,0.142051,
3599 0.153185,0.163147,0.173309,0.181668,0.190998,0.197703,0.205011,0.211063,0.219587,0.223287,
3600 0.231163,0.239606,0.246533,0.251457,0.250034,0.252989,0.240823,0.236489,0.230268,0.204321,
3601 0.213476,0.200247,0.167065,0.190655,0.173573,0.166173,0.153232,0.173112,-0.123540,0.211999};
3602 Double_t xErrCumulant2nd4050ALICE[40] = {0.};
3603 Double_t yErrCumulant2nd4050ALICE[] = {0.000000,0.000000,0.000248,0.000251,0.000270,0.000296,0.000328,0.000363,0.000403,0.000447,
3604 0.000500,0.000556,0.000617,0.000687,0.000770,0.000857,0.000952,0.001057,0.001176,0.001297,
3605 0.001054,0.001265,0.001498,0.001767,0.002076,0.001849,0.002527,0.003358,0.004372,0.005573,
3606 0.005091,0.007981,0.011746,0.015732,0.021883,0.019866,0.032443,0.046521,0.051631,0.083717};
3607 Int_t nPointsCumulant2nd4050ALICE = sizeof(xCumulant2nd4050ALICE)/sizeof(Double_t);
3608 TGraphErrors *Cumulant2nd4050ALICE = new TGraphErrors(nPointsCumulant2nd4050ALICE,xCumulant2nd4050ALICE,yCumulant2nd4050ALICE,
3609 xErrCumulant2nd4050ALICE,yErrCumulant2nd4050ALICE);
3610 Cumulant2nd4050ALICE->SetMarkerStyle(kOpenTriangleUp);
3611 Cumulant2nd4050ALICE->SetMarkerColor(kGreen+2);
3613 return Cumulant2nd4050ALICE;
3619 TGraphErrors* GetFlow6070_Rap10(Int_t n)
3621 // private communication 18.05.11, Ante B.
3625 // v2{SP}(pt) for 60-70%, rapidity gap = 1.0:
3626 const Int_t nPointsSP_6070ALICE_v2_etaGap10 = 9;
3627 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};
3628 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};
3629 Double_t xErrSP_6070ALICE_v2_etaGap10[nPointsSP_6070ALICE_v2_etaGap10] = {0.};
3630 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};
3631 TGraphErrors *GrSP_6070ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_6070ALICE_v2_etaGap10,xSP_6070ALICE_v2_etaGap10,
3632 ySP_6070ALICE_v2_etaGap10,xErrSP_6070ALICE_v2_etaGap10,
3633 yErrSP_6070ALICE_v2_etaGap10);
3635 return GrSP_6070ALICE_v2_etaGap10;
3641 Float_t CalculateFlow(TH1* ptDist, Float_t ptMin, Float_t ptMax, Int_t n, Int_t centralityBegin, Int_t centralityEnd)
3643 if (centralityBegin == 0 && centralityEnd == 1)
3644 flow = GetFlow01_Rap10(n);
3645 else if (centralityBegin == 0 && centralityEnd == 2)
3646 flow = GetFlow02_Rap10(n);
3647 else if (centralityBegin == 0 && centralityEnd == 5)
3648 flow = GetFlow05_Rap10(n);
3649 else if (centralityBegin == 5 && centralityEnd == 10)
3650 flow = GetFlow510_Rap10(n);
3651 else if (centralityBegin == 20 && centralityEnd == 30)
3652 flow = GetFlow2030(n);
3653 else if (centralityBegin == 30 && centralityEnd == 40)
3654 flow = GetFlow3040(n);
3655 else if (centralityBegin == 40 && centralityEnd == 50)
3656 flow = GetFlow4050(n);
3657 else if (centralityBegin > 50)
3658 flow = GetFlow6070_Rap10(n);
3659 else if (centralityBegin == 0 && centralityEnd == 20)
3661 flow1 = GetFlow05_Rap10(n);
3662 flow2 = GetFlow510_Rap10(n);
3663 flow3 = GetFlow1020_Rap10(n);
3665 flow = (TGraphErrors*) flow2->Clone();
3667 // centrality width * dn/deta from http://arxiv.org/PS_cache/arxiv/pdf/1012/1012.1657v2.pdf
3668 Float_t mult[] = { 5 * 1601, 5 * 1294, 10 * 966 };
3670 for (Int_t i=0; i<flow->GetN(); i++)
3672 Float_t x= flow->GetX()[i];
3674 // Printf("%f: %f %f %f", x, flow1->Eval(x), flow2->Eval(x), flow3->Eval(x));
3675 flow->GetY()[i] = flow1->Eval(x) * mult[0] + flow2->Eval(x) * mult[1] + flow3->Eval(x) * mult[2];
3676 flow->GetY()[i] /= mult[0] + mult[1] + mult[2];
3677 // Printf(" --> %f", flow->GetY()[i]);
3680 else if (centralityBegin == 20 && centralityEnd == 60)
3682 flow = GetFlow2030(n);
3683 flow2 = GetFlow3040(n);
3684 flow3 = GetFlow4050(n);
3686 // centrality width * dn/deta from http://arxiv.org/PS_cache/arxiv/pdf/1012/1012.1657v2.pdf
3687 Float_t mult[] = { 10 * 649, 10 * 426, 10 * (261+149) };
3689 if (flow->GetN() != flow2->GetN() || flow2->GetN() != flow3->GetN())
3690 AliFatal("Incompatible graphs");
3692 for (Int_t i=0; i<flow->GetN(); i++)
3694 // Printf("%f %f %f", flow->GetY()[i], flow2->GetY()[i], flow3->GetY()[i]);
3695 flow->GetY()[i] = flow->GetY()[i] * mult[0] + flow2->GetY()[i] * mult[1] + flow3->GetY()[i] * mult[2];
3696 flow->GetY()[i] /= mult[0] + mult[1] + mult[2];
3697 // Printf(" --> %f", flow->GetY()[i]);
3702 Printf("Flow range %d %d not available", centralityBegin, centralityEnd);
3708 for (Int_t bin = ptDist->FindBin(ptMin + 0.01); bin <= ptDist->FindBin(ptMax - 0.01); bin++)
3710 if (ptDist->GetBinCenter(bin) > flow->GetX()[flow->GetN()-1])
3711 vn += ptDist->GetBinContent(bin) * flow->GetY()[flow->GetN()-1];
3713 vn += ptDist->GetBinContent(bin) * flow->Eval(ptDist->GetBinCenter(bin));
3714 sum += ptDist->GetBinContent(bin);
3720 Printf("v_{%d} = %f for %f < pT < %f", n, vn, ptMin, ptMax);
3725 void CalculateFlow(const char* fileName, Int_t centralityBegin, Int_t centralityEnd)
3727 Float_t ptTrigMin = 2;
3728 Float_t ptTrigMax = 3;
3735 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
3737 cont = h->GetUEHist(2)->GetTrackHist(0);
3738 cont->GetGrid(6)->GetGrid()->GetAxis(3)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
3739 cont->GetGrid(6)->GetGrid()->GetAxis(2)->SetRangeUser(ptTrigMin + 0.01, ptTrigMax - 0.01);
3741 ptDist = cont->ShowProjection(1, 6);
3742 ptDist->Scale(1.0 / ptDist->Integral());
3744 cont = h->GetUEHist(2)->GetEventHist();
3745 cont->GetGrid(6)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
3747 ptDist2 = cont->ShowProjection(0, 6);
3748 ptDist2->Scale(1.0 / ptDist2->Integral());
3752 for (Int_t n=2; n<=4; n++)
3754 Float_t v2A = CalculateFlow(ptDist, ptMin, ptMax, n, centralityBegin, centralityEnd);
3755 Float_t v2T = CalculateFlow(ptDist2, ptTrigMin, ptTrigMax, n, centralityBegin, centralityEnd);
3757 str += Form("%f * %f, ", v2A, v2T);
3761 ptDist2->SetLineColor(2);
3762 ptDist2->Draw("SAME");
3764 Printf("%s", str.Data());
3767 // 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...)
3768 TGraphErrors***** yields = 0;
3769 TString currentYieldFile;
3773 TFile::Open("yields.root", "RECREATE");
3774 for (Int_t i=0; i<3; i++)
3776 for (Int_t j=0; j<6; j++)
3778 for (Int_t k=0; k<4; k++)
3780 // CINT limitation here
3781 TGraphErrors** tmp = yields[i][j][k];
3782 for (Int_t l=0; l<31; l++)
3784 //Printf("%d %d %d %d", i, j, k, l);
3785 tmp[l]->Write(Form("yield_%d_%d_%d_%d", i, j, k, l));
3793 void ReadYields(const char* fileName = "yields.root")
3795 if (currentYieldFile == fileName)
3798 currentYieldFile = fileName;
3800 CreateYieldStructure();
3801 TFile::Open(fileName);
3802 for (Int_t i=0; i<3; i++)
3804 for (Int_t j=0; j<6; j++)
3806 for (Int_t k=0; k<4; k++)
3808 // CINT limitation here
3809 TGraphErrors** tmp = yields[i][j][k];
3810 for (Int_t l=0; l<31; l++)
3812 //Printf("%d %d %d %d", i, j, k, l);
3813 tmp[l] = gFile->Get(Form("yield_%d_%d_%d_%d", i, j, k, l));
3820 void CreateYieldStructure()
3824 yields = new TGraphErrors****[3];
3825 for (Int_t i=0; i<3; i++)
3827 yields[i] = new TGraphErrors***[6];
3828 for (Int_t j=0; j<6; j++)
3830 yields[i][j] = new TGraphErrors**[4];
3831 for (Int_t k=0; k<4; k++)
3833 yields[i][j][k] = new TGraphErrors*[31];
3834 // CINT limitation here
3835 TGraphErrors** tmp = yields[i][j][k];
3836 for (Int_t l=0; l<31; l++)
3838 //Printf("%d %d %d %d", i, j, k, l);
3839 TGraphErrors* graph = new TGraphErrors;
3848 void GraphShiftX(TGraphErrors* graph, Float_t offset)
3850 for (Int_t i=0; i<graph->GetN(); i++)
3851 graph->GetX()[i] += offset;
3854 // Float_t kPythiaScalingFactor = 0.935;
3855 Float_t kPythiaScalingFactor = 1;
3857 void DrawYields(const char* fileName = "yields.root")
3859 ReadYields(fileName);
3861 c = new TCanvas("c", "c", 1800, 1200);
3864 Int_t markers1[] = { 24, 25, 26, 30 };
3865 Int_t markers2[] = { 20, 21, 22, 29 };
3866 Int_t colors[] = { 1, 2, 3, 4 };
3867 //Int_t caseList[] = { 0, 10+1, 10+1, 8, 10, 11, 12, 13, 1, 9 };
3868 Int_t caseList[] = { 0, 18, 18, 23, 18, 19, 20, 21, 22, 9 };
3869 const char* caseString[] = { "", "baseline sub", "baseline vs v2 sub comp", 0, "baseline sub comp", "Same/Mixed", "Same/Mixed - v2 subtr" };
3874 Int_t centralityList[] = { 0, 1, 2, 0, 0, 1 };
3875 Int_t centralityList2[] = { -1, -1, -1, 1, 2, 2 };
3876 Float_t factors[] = { 1, 1, 1, 1, 1, 1 };
3877 const char* centralityString[] = { "0-5%", "20-40%", "60-90%", "0-5% vs 20-40%", "0-5% vs 60-90%", "20-40% vs 60-90%" };
3881 Int_t centralityList[] = { 0, 2, 3, 0, 0, 2 };
3882 Int_t centralityList2[] = { -1, -1, -1, 2, 3, 3 };
3883 //Float_t factors[] = { 1, 1, 1, 1, 1.0/0.9, 1.0/0.9 };
3884 //Float_t factors[] = { 1, 1, 1, 1, 1.0/0.804, 1.0/0.804 };
3885 Float_t factors[] = { 1, 1, 1, 1, 1.0/kPythiaScalingFactor, 1.0/kPythiaScalingFactor };
3886 //Float_t factors[] = { 1, 1, 1, 1, 1.0, 1.0 };
3887 const char* centralityString[] = { "0-5%", "60-90%", "pp", "0-5% vs 60-90%", "0-5% vs pp", "60-90% vs pp" };
3890 l = new TLegend(0.5, 0.5, 0.9, 0.9);
3893 Float_t max[] = { 0.4, 2, 2, 2, 2, 10, 10 };
3894 Float_t max2[] = { 5, 2, 2, 2, 2, 2, 2, 2, 2 };
3896 dummy = new TH2F("dummy", ";p_{T,assoc};yield", 100, 0, 20, 20000, 0, 10);
3899 TGraphErrors* prevNear[6];
3900 TGraphErrors* prevAway[6];
3901 for (Int_t caseId=0; caseId<9; caseId++) // case 0->9
3903 for (Int_t k=0; k<6; k++) // centrality
3905 if (caseId != 3 && caseId < 5)
3908 c->cd(1 + k + caseId*6);
3910 c->cd(1 + k + (caseId-1)*6);
3911 currentDummy = dummy->DrawCopy();
3912 currentDummy->GetYaxis()->SetRangeUser(0, max[caseId]);
3916 latex = new TLatex(0.15, 0.95, Form("%s - %s", caseString[caseId], centralityString[k]));
3918 latex->SetTextSize(0.05);
3921 else if (caseId == 3)
3926 for (Int_t j=0; j<3; j++) // trigger pt
3928 if (caseId >= 2 && j != 1)
3930 Printf("%d %d %d %d", caseId, k, j, caseList[caseId]);
3934 // CINT limitation here
3935 TGraphErrors** tmp = yields[0][j][centralityList[k]];
3936 nearSide = tmp[caseList[caseId]];
3937 //new TCanvas; nearSide->Draw("AP"); return;
3939 nearSide->SetMarkerStyle(markers1[j]);
3940 nearSide->SetMarkerColor(colors[j]);
3941 nearSide->SetLineColor(colors[j]);
3943 if (caseId == 0 && k == 0)
3944 l->AddEntry(nearSide, Form("trig pt bin %d", j), "P");
3946 TGraphErrors** tmp = yields[1][j][centralityList[k]];
3947 awaySide = tmp[caseList[caseId]];
3948 awaySide->SetMarkerStyle(markers2[j]);
3949 awaySide->SetMarkerColor(colors[j]);
3950 awaySide->SetLineColor(colors[j]);
3952 GraphShiftX(nearSide, -0.1 + j*0.1);
3953 GraphShiftX(awaySide, -0.1 + j*0.1);
3957 nearSide->SetLineColor(caseId - 2);
3958 nearSide->SetMarkerColor(caseId - 2);
3959 awaySide->SetLineColor(caseId - 2);
3960 awaySide->SetMarkerColor(caseId - 2);
3965 nearSide->SetLineColor(caseId - 3);
3966 nearSide->SetMarkerColor(caseId - 3);
3967 awaySide->SetLineColor(caseId - 3);
3968 awaySide->SetMarkerColor(caseId - 3);
3973 prevNear[k] = (TGraphErrors*) nearSide->DrawClone("PSAME");
3974 prevAway[k] = (TGraphErrors*) awaySide->DrawClone("PSAME");
3979 for (Int_t i=0; i<nearSide->GetN(); i++)
3981 Printf("%f: %.0f%%", nearSide->GetX()[i], 100.0 * nearSide->GetEY()[i] / nearSide->GetY()[i]);
3982 Printf("%f: %.0f%%", awaySide->GetX()[i], 100.0 * awaySide->GetEY()[i] / awaySide->GetY()[i]);
3988 // CINT limitation here
3989 tmp = yields[0][j][centralityList[k]]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
3990 tmp = yields[1][j][centralityList[k]]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
3992 tmp = yields[0][j][centralityList2[k]];
3993 nearSidePeripheral = tmp[caseList[caseId]];
3994 if (iaa && caseId == 3 && k >= 4)
3995 nearSidePeripheral = tmp[caseList[caseId-1]];
3997 tmp = yields[1][j][centralityList2[k]];
3998 awaySidePeripheral = tmp[caseList[caseId]];
3999 if (iaa && caseId == 3 && k >= 4)
4000 awaySidePeripheral = tmp[caseList[caseId-1]];
4002 // nearSideCentral->Print();
4003 // nearSidePeripheral->Print();
4006 currentDummy->GetYaxis()->SetTitle("I_{CP}");
4008 currentDummy->GetYaxis()->SetTitle("I_{AA}");
4009 currentDummy->GetYaxis()->SetRangeUser(0, max2[caseId]);
4011 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4013 if (i >= nearSidePeripheral->GetN())
4015 nearSideCentral->RemovePoint(i);
4020 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4021 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4023 nearSideCentral->RemovePoint(i);
4024 nearSidePeripheral->RemovePoint(i);
4029 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4030 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4031 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4033 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4034 nearSideCentral->GetY()[i] *= factors[k];
4036 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4040 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4042 if (i >= awaySidePeripheral->GetN())
4044 awaySideCentral->RemovePoint(i);
4049 //Printf("away %d", i);
4050 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
4052 awaySideCentral->RemovePoint(i);
4053 awaySidePeripheral->RemovePoint(i);
4058 awaySideCentral->GetEY()[i] = TMath::Sqrt(
4059 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
4060 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
4062 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
4063 awaySideCentral->GetY()[i] *= factors[k];
4065 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
4070 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4071 nearSideCentral->SetLineColor(1);
4072 nearSideCentral->SetMarkerColor(1);
4074 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4075 awaySideCentral->SetLineColor(1);
4076 awaySideCentral->SetMarkerColor(1);
4081 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4082 nearSideCentral->SetLineColor(caseId - 3);
4083 nearSideCentral->SetMarkerColor(caseId - 3);
4085 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4086 awaySideCentral->SetLineColor(caseId - 3);
4087 awaySideCentral->SetMarkerColor(caseId - 3);
4090 //Printf("%d", caseList[caseId]);
4092 // nearSideCentral->Print();
4094 nearSideCentral->Draw("PSAME");
4095 awaySideCentral->Draw("PSAME");
4099 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4100 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]));
4101 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4102 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]));
4105 prevNear[k] = nearSideCentral;
4106 prevAway[k] = awaySideCentral;
4109 if (caseId == 0 && k == 0)
4114 c->SaveAs("yields.png");
4117 void FitGaussians(const char* fileName, Bool_t flat)
4119 CreateYieldStructure();
4121 aliceFile = TFile::Open(fileName);
4123 Int_t maxLeadingPt = 3;
4124 Int_t maxAssocPt = 3;
4126 TCanvas* canvas = new TCanvas("FitGaussians", "FitGaussians", 1000, 700);
4127 canvas->Divide(maxAssocPt, maxLeadingPt);
4129 for (Int_t i=0; i<maxLeadingPt; i++)
4130 for (Int_t j=0; j<maxAssocPt; j++)
4133 for (Int_t aliceCentrality=0; aliceCentrality<4; aliceCentrality++)
4135 Printf("%d %d %d", i, j, aliceCentrality);
4137 canvas->cd(j+1 + (i) * maxAssocPt);
4138 gPad->SetLeftMargin(0.15);
4139 gPad->SetBottomMargin(0.2);
4140 //gPad->SetTopMargin(0.01);
4141 gPad->SetRightMargin(0.01);
4143 hist = (TH1*) aliceFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, (flat) ? "_fit_flat" : ""));
4150 gausFit = new TF1("gausFit", "[0] + gaus(1) + gaus(4)", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
4151 gausFit->SetParameters(0, 1, 0, 1, 1, TMath::Pi(), 1);
4152 gausFit->SetParLimits(0, -1, 10000);
4153 gausFit->SetParLimits(1, 0.001, 10000);
4154 gausFit->FixParameter(2, 0);
4155 gausFit->SetParLimits(3, 0.05, 10);
4156 gausFit->SetParLimits(4, 0.001, 10000);
4157 gausFit->FixParameter(5, TMath::Pi());
4158 gausFit->SetParLimits(6, 0.1, 10);
4160 gausFit->SetLineWidth(1);
4161 gausFit->SetLineColor(hist->GetLineColor());
4163 hist->Fit(gausFit, "0RIQ");
4164 gausFit->FixParameter(0, gausFit->GetParameter(0));
4165 hist->Fit(gausFit, "RI", (aliceCentrality == 0) ? "" : "SAME");
4166 //gausFit->DrawCopy("SAME");
4169 TPRegexp reg("(\\d+\\.\\d+) \\< p_\\{T,assoc\\} \\< (\\d+\\.\\d+)");
4170 arr = reg.MatchS(hist->GetTitle(), "", 0, 10);
4171 if (arr->GetEntries() != 3)
4174 Float_t pt1 = atof(arr->At(1)->GetName());
4175 Float_t pt2 = atof(arr->At(2)->GetName());
4177 FillYield(i, aliceCentrality, (pt1 + pt2) / 2, (pt2 - pt1) / 2, 18, gausFit->GetParameter(3), gausFit->GetParError(3), gausFit->GetParameter(6), gausFit->GetParError(6));
4182 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), hist->GetMinimum()), TMath::Max(first->GetMaximum(), hist->GetMaximum()));
4184 first->GetYaxis()->SetRangeUser(first->GetMinimum(), 2 * first->GetMaximum());
4192 for (Int_t j=0; j<maxLeadingPt; j++)
4196 Int_t markers1[] = { 24, 25, 26, 30 };
4197 Int_t markers2[] = { 20, 21, 22, 29 };
4198 Int_t colors[] = { 1, 2, 3, 4 };
4200 dummy = new TH2F("dummy", ";p_{T,assoc};", 100, 0, 10, 1000, 0, 1);
4204 for (Int_t k=0; k<4; k++) // centrality
4206 // CINT limitation here
4207 TGraphErrors** tmp = yields[0][j][k];
4209 nearSide->SetMarkerStyle(markers1[k]);
4210 nearSide->SetMarkerColor(colors[k]);
4211 nearSide->SetLineColor(colors[k]);
4213 TGraphErrors** tmp = yields[1][j][k];
4215 awaySide->SetMarkerStyle(markers2[k]);
4216 awaySide->SetMarkerColor(colors[k]);
4217 awaySide->SetLineColor(colors[k]);
4219 nearSide->DrawClone("PSAME");
4220 awaySide->DrawClone("PSAME");
4225 void TsallisExamples()
4227 tsallis = new TF1("tsallis", "[0] * (1-[2]*(1-[1])*x*x)**(1/(1-[1]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
4229 Float_t q[] = { 1.0000001, 1.5, 2 };
4230 Float_t beta[] = { 0.1, 1, 10, 100 };
4232 dummy = new TH2F("dummy", "", 100, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), 100, 0, 1.2);
4236 legend = new TLegend(0.65, 0.5, 1, 1);
4237 legend->SetFillColor(0);
4239 for (Int_t i=0; i<3; i++)
4240 for (Int_t j=0; j<4; j++)
4242 tsallis->SetParameters(1, q[i], beta[j]);
4243 tsallis->SetLineColor(i+1);
4244 tsallis->SetLineStyle(j+1);
4246 legend->AddEntry(tsallis->DrawCopy("SAME"), Form("q = %.1f, #beta = %.1f", q[i], beta[j]), "L");
4252 void DrawTsallisParams()
4256 c = new TCanvas("c", "c", 900, 600);
4259 Int_t markers1[] = { 24, 25, 26, 30 };
4260 Int_t markers2[] = { 20, 21, 22, 29 };
4261 Int_t colors[] = { 1, 2, 3, 4 };
4262 Int_t caseList[] = { 12, 13, 8, 6, 8, 9, 10, 11, 1, 7 };
4263 const char* caseString[] = { "q", "beta" };
4264 const char* centralityString[] = { "0-5%", "20-40%", "60-90%", "0-5% vs 20-40%", "0-5% vs 60-90%", "20-40% vs 60-90%" };
4266 l = new TLegend(0.5, 0.5, 0.9, 0.9);
4269 Float_t max[] = { 3, 1000 };
4270 Float_t max2[] = { 5, 2 };
4272 dummy = new TH2F("dummy", ";p_{T,assoc};", 100, 0, 20, 1000, 0, 1000);
4275 for (Int_t caseId=0; caseId<2; caseId++) // case
4277 for (Int_t k=0; k<3; k++) // centrality
4279 c->cd(1 + k + caseId*3);
4281 currentDummy = dummy->DrawCopy();
4282 currentDummy->GetYaxis()->SetRangeUser(0, max[caseId]);
4283 if (caseId == 1 && k < 3)
4286 latex = new TLatex(0.15, 0.95, Form("%s - %s", caseString[caseId], centralityString[k]));
4288 latex->SetTextSize(0.05);
4291 for (Int_t j=0; j<2; j++) // trigger pt
4295 // CINT limitation here
4296 TGraphErrors** tmp = yields[0][j][k];
4297 nearSide = tmp[caseList[caseId]];
4298 nearSide->SetMarkerStyle(markers1[j]);
4299 nearSide->SetMarkerColor(colors[j]);
4300 nearSide->SetLineColor(colors[j]);
4302 if (caseId == 0 && k == 0)
4303 l->AddEntry(nearSide, Form("trig pt bin %d", j), "P");
4305 TGraphErrors** tmp = yields[1][j][k];
4306 awaySide = tmp[caseList[caseId]];
4307 awaySide->SetMarkerStyle(markers2[j]);
4308 awaySide->SetMarkerColor(colors[j]);
4309 awaySide->SetLineColor(colors[j]);
4311 GraphShiftX(nearSide, -0.1 + j*0.1);
4312 GraphShiftX(awaySide, -0.1 + j*0.1);
4314 Printf("%d %d %d", caseId, j, k);
4318 nearSide->DrawClone("PSAME");
4319 awaySide->DrawClone("PSAME");
4323 // CINT limitation here
4326 tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4327 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4328 tmp = yields[0][j][1]; nearSidePeripheral = tmp[caseList[caseId]];
4329 tmp = yields[1][j][1]; awaySidePeripheral = tmp[caseList[caseId]];
4333 tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4334 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4335 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
4336 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
4340 tmp = yields[0][j][1]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4341 tmp = yields[1][j][1]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4342 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
4343 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
4346 currentDummy->GetYaxis()->SetTitle("I_{CP}");
4347 currentDummy->GetYaxis()->SetRangeUser(0, max2[caseId]);
4349 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4351 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4352 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4354 nearSideCentral->RemovePoint(i);
4355 nearSidePeripheral->RemovePoint(i);
4360 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4361 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4362 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4364 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4366 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4370 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4372 //Printf("away %d", i);
4373 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
4375 awaySideCentral->RemovePoint(i);
4376 awaySidePeripheral->RemovePoint(i);
4381 awaySideCentral->GetEY()[i] = TMath::Sqrt(
4382 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
4383 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
4385 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
4387 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
4392 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4393 nearSideCentral->SetLineColor(1);
4394 nearSideCentral->SetMarkerColor(1);
4396 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4397 awaySideCentral->SetLineColor(1);
4398 awaySideCentral->SetMarkerColor(1);
4403 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4404 nearSideCentral->SetLineColor(caseId - 3);
4405 nearSideCentral->SetMarkerColor(caseId - 3);
4407 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4408 awaySideCentral->SetLineColor(caseId - 3);
4409 awaySideCentral->SetMarkerColor(caseId - 3);
4412 //Printf("%d", caseList[caseId]);
4414 nearSideCentral->Draw("PSAME");
4415 awaySideCentral->Draw("PSAME");
4418 if (caseId == 0 && k == 0)
4423 c->SaveAs("tsallisparams.png");
4426 void DrawYieldLHCRHIC_ICP(const char* fileName = "yields.root")
4429 Int_t caseList[] = { 18 };
4432 ReadYields(fileName);
4434 c = new TCanvas("lhc_rhic", "lhc_rhic", 800, 600);
4438 dummy = new TH2F("dummy", ";p_{T,assoc};I_{CP}", 100, 0, 12, 1000, 0, 10);
4440 currentDummy = dummy->DrawCopy();
4441 currentDummy->GetYaxis()->SetRangeUser(0, 2);
4443 TGraphErrors** tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4444 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4445 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
4446 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
4448 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4450 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4451 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4453 nearSideCentral->RemovePoint(i);
4454 nearSidePeripheral->RemovePoint(i);
4459 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4460 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4461 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4463 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4465 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4469 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4471 //Printf("away %d", i);
4472 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
4474 awaySideCentral->RemovePoint(i);
4475 awaySidePeripheral->RemovePoint(i);
4480 awaySideCentral->GetEY()[i] = TMath::Sqrt(
4481 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
4482 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
4484 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
4486 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
4489 nearSideCentral->SetMarkerStyle(21);
4490 nearSideCentral->SetLineColor(1);
4491 nearSideCentral->SetMarkerColor(1);
4493 awaySideCentral->SetMarkerStyle(25);
4494 awaySideCentral->SetLineColor(1);
4495 awaySideCentral->SetMarkerColor(1);
4497 nearSideCentral->Draw("PSAME");
4498 awaySideCentral->Draw("PSAME");
4500 legend = new TLegend(0.4, 0.8, 0.99, 0.99);
4501 legend->SetFillColor(0);
4502 legend->AddEntry(nearSideCentral, "ALICE I_{CP} Near 8-15 GeV 0-5%/60-90%", "P");
4503 legend->AddEntry(awaySideCentral, "ALICE I_{CP} Away 8-15 GeV 0-5%/60-90%", "P");
4507 nearSideCentral->Fit("pol1", "", "SAME", 4.5, 11.5);
4508 awaySideCentral->Fit("pol1", "", "SAME", 4.5, 11.5);
4509 nearSideCentral->GetFunction("pol1")->SetLineWidth(1);
4510 awaySideCentral->GetFunction("pol1")->SetLineWidth(1);
4516 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
4517 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
4519 //dndpt_central->Print();
4520 //dndpt_peripheral->Print();
4522 // ratio of Ncoll (from paper)
4523 // TODO there is also an uncertainty on that
4524 Double_t scale = 1690. / 15.7;
4525 Double_t scaleUnc = TMath::Sqrt(TMath::Power(131. / 1690., 2) + TMath::Power(0.7 / 15.7, 2));
4527 for (Int_t i=0; i<dndpt_central->GetN(); i++)
4529 dndpt_central->GetEY()[i] = TMath::Sqrt(TMath::Power(dndpt_central->GetEY()[i] / dndpt_central->GetY()[i], 2) +
4530 TMath::Power(dndpt_peripheral->GetEY()[i] / dndpt_peripheral->GetY()[i], 2));
4531 dndpt_central->GetY()[i] /= dndpt_peripheral->GetY()[i] * scale;
4532 dndpt_central->GetEY()[i] *= dndpt_central->GetY()[i];
4536 //dndpt_central->Print();
4537 //dndpt_central->Draw("AP");
4539 dndpt_central->Draw("*SAME");
4541 latex = new TLatex(0.34, 0.09, "9% N_{coll} scale uncertainty on R_{CP}");
4542 latex->SetTextSize(0.03);
4546 raa_central = ReadHepdata("raa_alice_central.txt", kFALSE, 3);
4547 raa_central->SetMarkerStyle(20);
4548 //raa_central->Draw("PSAME");
4550 legend->AddEntry(dndpt_central, "ALICE R_{CP} 0-5%/70-80%", "P");
4556 // calculate ICP from IAA(0-20) / IAA (20-60)
4557 // TODO only using uncertainties from IAA(0-20)
4558 // TODO systematic uncertainty stored in graph with _sys appended
4559 TFile::Open("rhic/pi0h_graphs.root");
4561 for (Int_t i=0; i<3; i+=2)
4563 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
4564 central = (TGraphErrors*) gFile->Get(Form("gIAA_3_0_%d", i));
4565 peripheral = (TGraphErrors*) gFile->Get(Form("gIAA_3_1_%d", i));
4567 for (Int_t j=0; j<central->GetN(); j++)
4569 central->GetY()[j] /= peripheral->GetY()[j];
4570 central->GetEY()[j] /= peripheral->GetY()[j];
4573 central->SetMarkerStyle((i == 0) ? 29 : 30);
4574 central->SetMarkerColor(2);
4575 central->SetLineColor(2);
4576 central->Draw("PSAME");
4577 legend->AddEntry(central, Form("PHENIX I_{CP} %s 9-12 GeV 0-20%/20-60%", (i == 0) ? "Near" : "Away"), "P");
4583 c->SaveAs("icp.png");
4586 TGraphErrors* GetRatio(const char* fileName, Int_t centrality1, Int_t centrality2, Int_t triggerId, Int_t caseId, Int_t side, const char* fileName2 = 0)
4588 // 0 = near side; 1 = away side
4590 ReadYields(fileName);
4592 TGraphErrors** tmp = yields[side][triggerId][centrality1];
4593 nearSideCentral = (TGraphErrors*) tmp[caseId]->Clone();
4596 ReadYields(fileName2);
4598 tmp = yields[side][triggerId][centrality2];
4599 nearSidePeripheral = (TGraphErrors*) tmp[caseId]->Clone();
4601 // Printf("%d %d", nearSideCentral->GetN(), nearSidePeripheral->GetN());
4603 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4605 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4607 nearSideCentral->RemovePoint(i);
4608 nearSidePeripheral->RemovePoint(i);
4613 if (nearSideCentral->GetX()[i] != nearSidePeripheral->GetX()[i])
4615 Printf("Inconsistent x values %f %f", nearSideCentral->GetX()[i], nearSidePeripheral->GetX()[i]);
4619 // printf("%f %f %f", nearSideCentral->GetX()[i], nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4621 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4622 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4623 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4625 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4627 if (centrality2 == 3)
4628 nearSideCentral->GetY()[i] /= kPythiaScalingFactor;
4630 // Printf(" %f", nearSideCentral->GetY()[i]);
4632 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4635 //nearSideCentral->GetXaxis()->SetTitle("p_{T, assoc}");
4636 //nearSideCentral->GetYaxis()->SetTitle((centrality2 == 3) ? "I_{AA}" : "I_{CP}");
4638 if (0 && side == 1 && centrality2 == 3)
4640 Printf("\n\n\nWARNING !!! Fudging different away side acceptance (only for second file)\n\n\n");
4641 ScaleGraph(nearSideCentral, 1.56);
4644 return nearSideCentral;
4647 TGraphErrors* GetIAA(const char* fileName, Int_t centrality, Int_t triggerId, Int_t caseId, Int_t side)
4649 return GetRatio(fileName, centrality, 3, triggerId, caseId, side);
4652 TGraphErrors* GetICP(const char* fileName, Int_t triggerId, Int_t caseId, Int_t side)
4654 return GetRatio(fileName, 1, 2, triggerId, caseId, side);
4657 void DrawYieldLHCRHIC_IAA(const char* fileName, Bool_t central, Bool_t rhic)
4660 Int_t caseList[] = { 18 };
4663 ReadYields(fileName);
4665 c = new TCanvas("lhc_rhic", "lhc_rhic", 800, 600);
4669 dummy = new TH2F("dummy", ";p_{T,assoc};I_{AA}", 100, 0, 12, 1000, 0, 10);
4671 currentDummy = dummy->DrawCopy();
4672 currentDummy->GetYaxis()->SetRangeUser(0, 3);
4674 Int_t nominatorBin = 0;
4678 nearSideCentral = GetIAA(fileName, nominatorBin, j, caseList[caseId], 0);
4679 awaySideCentral = GetIAA(fileName, nominatorBin, j, caseList[caseId], 1);
4681 nearSideCentral->SetMarkerStyle(21);
4682 nearSideCentral->SetLineColor(1);
4683 nearSideCentral->SetMarkerColor(1);
4685 awaySideCentral->SetMarkerStyle(25);
4686 awaySideCentral->SetLineColor(1);
4687 awaySideCentral->SetMarkerColor(1);
4689 nearSideCentral->Draw("PSAME");
4690 awaySideCentral->Draw("PSAME");
4692 legend = new TLegend(0.4, 0.8, 0.99, 0.99);
4693 legend->SetFillColor(0);
4694 legend->AddEntry(nearSideCentral, Form("ALICE I_{AA} Near 8-15 GeV %s%%/Pythia6", (central) ? "0-5" : "60-90"), "P");
4695 legend->AddEntry(awaySideCentral, Form("ALICE I_{AA} Away 8-15 GeV %s%%/Pythia6", (central) ? "0-5" : "60-90"), "P");
4700 // systematic uncertainty stored in graph with _sys appended
4701 TFile::Open("rhic/pi0h_graphs.root");
4703 for (Int_t i=0; i<3; i+=2)
4705 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
4706 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_2_%d_%d", (central) ? 0 : 1, i));
4707 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_2_%d_%d_sys", (central) ? 0 : 1, i));
4709 rhic_iaa->SetMarkerStyle((i == 0) ? 29 : 30);
4710 rhic_iaa->SetMarkerColor(2);
4711 rhic_iaa->SetLineColor(2);
4712 rhic_iaa->Draw("PSAME");
4713 rhic_iaa_sys->SetLineColor(2);
4714 rhic_iaa_sys->SetMarkerColor(2);
4715 rhic_iaa_sys->Draw("PSAME");
4716 legend->AddEntry(rhic_iaa, Form("PHENIX I_{AA} %s 7-9 GeV %s%%/pp", (i == 0) ? "Near" : "Away", (central) ? "0-20" : "20-60"), "P");
4718 for (Int_t i=0; i<3; i+=2)
4720 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
4721 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_3_%d_%d", (central) ? 0 : 1, i));
4722 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_3_%d_%d_sys", (central) ? 0 : 1, i));
4724 rhic_iaa->SetMarkerStyle((i == 0) ? 20 : 24);
4725 rhic_iaa->SetMarkerColor(4);
4726 rhic_iaa->SetLineColor(4);
4727 rhic_iaa->Draw("PSAME");
4728 rhic_iaa_sys->SetLineColor(4);
4729 rhic_iaa_sys->SetMarkerColor(4);
4730 rhic_iaa_sys->Draw("PSAME");
4731 legend->AddEntry(rhic_iaa, Form("PHENIX I_{AA} %s 9-12 GeV %s%%/pp", (i == 0) ? "Near" : "Away", (central) ? "0-20" : "20-60"), "P");
4737 c->SaveAs("iaa.png");
4740 void CompareIAAICP(const char* fileName1, const char* fileName2, Int_t nominatorBin, Int_t denominatorBin, Bool_t skipAway = kFALSE)
4744 // caseId = 23; Printf("WARNING: Comparing case 23");
4745 //Int_t caseId = 12;
4747 nearSide1 = GetRatio(fileName1, nominatorBin, denominatorBin, j, caseId, 0);
4749 awaySide1 = GetRatio(fileName1, nominatorBin, denominatorBin, j, caseId, 1);
4751 awaySide1 = new TGraphErrors;
4753 kPythiaScalingFactor = 1;
4754 nearSide2 = GetRatio(fileName2, nominatorBin, denominatorBin, j, caseId, 0);
4756 awaySide2 = GetRatio(fileName2, nominatorBin, denominatorBin, j, caseId, 1);
4758 awaySide2 = new TGraphErrors;
4760 // Printf("\n\n\nWARNING !!! Fudging different away side acceptance (only for second file)\n\n\n");
4761 // ScaleGraph(awaySide2, 1.56);
4763 /* ScaleGraph(nearSide2, 1.33);
4764 ScaleGraph(awaySide2, 1.33);*/
4767 dummy = new TH2F("dummy", Form(";p_{T,assoc};%s", (denominatorBin == 3) ? "I_{AA}" : "I_{CP}"), 100, 2, 12, 1000, 0, 10);
4769 currentDummy = dummy->DrawCopy();
4770 currentDummy->GetYaxis()->SetRangeUser(0, 2.5);
4772 nearSide1->SetMarkerStyle(21);
4773 nearSide1->SetLineColor(1);
4774 nearSide1->SetMarkerColor(1);
4776 nearSide2->SetMarkerStyle(21);
4777 nearSide2->SetLineColor(2);
4778 nearSide2->SetMarkerColor(2);
4780 awaySide1->SetMarkerStyle(25);
4781 awaySide1->SetLineColor(1);
4782 awaySide1->SetMarkerColor(1);
4784 awaySide2->SetMarkerStyle(25);
4785 awaySide2->SetLineColor(2);
4786 awaySide2->SetMarkerColor(2);
4788 RemovePointsBelowX(nearSide1, 3);
4789 RemovePointsBelowX(nearSide2, 3);
4790 RemovePointsBelowX(awaySide1, 3);
4791 RemovePointsBelowX(awaySide2, 3);
4796 nearSide1->DrawClone("PSAME");
4797 awaySide1->DrawClone("PSAME");
4798 nearSide2->DrawClone("PSAME");
4799 awaySide2->DrawClone("PSAME");
4802 currentDummy = dummy->DrawCopy();
4803 currentDummy->GetYaxis()->SetRangeUser(0.5, 1.5);
4807 DivideGraphs(nearSide1, nearSide2);
4808 DivideGraphs(awaySide1, awaySide2);
4810 nearSide1->Draw("PSAME");
4811 awaySide1->Draw("PSAME");
4813 nearSide1->Fit("pol0", "", "SAME", 3.01, 9.99);
4814 awaySide1->Fit("pol0", "", "SAME", 3.01, 9.99);
4817 void ScaleGraph(TGraphErrors* graph, Float_t factor)
4819 for (Int_t i=0; i<graph->GetN(); i++)
4821 graph->GetY()[i] *= factor;
4822 graph->GetEY()[i] *= factor;
4826 TGraphErrors* DrawBaselines(const char* fileName, Int_t numeratorBin, Int_t denominatorBin, Int_t side, Bool_t verbose = kTRUE)
4830 TGraphErrors* first = 0;
4831 TGraphErrors* max = 0;
4836 dummy = new TH2F("dummy", Form(";p_{T,assoc};%s", (denominatorBin == 3) ? "I_{AA}" : "I_{CP}"), 100, 0, 12, 1000, 0, 10);
4838 currentDummy = dummy->DrawCopy();
4839 currentDummy->GetYaxis()->SetRangeUser(0, 3);
4842 currentDummy = dummy->DrawCopy();
4843 currentDummy->GetYaxis()->SetRangeUser(0, 2);
4846 // Int_t caseList[] = { 18, 19, 21, 22 };
4847 //Int_t caseList[] = { 23, 24, 26, 27 };
4848 Int_t caseList[] = { 18, 19, 22 };
4850 for (Int_t caseId = 0; caseId < 3; caseId++)
4852 graph = GetRatio(fileName, numeratorBin, denominatorBin, j, caseList[caseId], side);
4854 graph->SetLineColor(caseId + 1);
4855 graph->SetMarkerColor(caseId + 1);
4857 RemovePointsBelowX(graph, 3);
4862 graph->DrawClone("*SAME");
4868 max = (TGraphErrors*) graph->Clone();
4869 for (Int_t i=0; i<max->GetN(); i++)
4872 max->GetEY()[i] = 0;
4877 DivideGraphs(graph, first);
4882 graph->DrawClone("*SAME");
4885 for (Int_t i=0; i<graph->GetN(); i++)
4887 if (max->GetY()[i] < TMath::Abs(graph->GetY()[i] - 1))
4888 max->GetY()[i] = TMath::Abs(graph->GetY()[i] - 1);
4899 max->GetXaxis()->SetTitle("p_{T, assoc}");
4900 max->GetYaxis()->SetTitle((denominatorBin == 3) ? "Effect on I_{AA}" : "Effect on I_{CP}");
4901 max->GetYaxis()->SetRangeUser(0, 0.4);
4906 void DrawBaselinesAll(const char* fileName)
4908 c = new TCanvas("c", "c", 1000, 600);
4911 for (Int_t i=0; i<2; i++)
4913 c->cd(1+i*4); DrawBaselines(fileName, 0, 3, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4914 c->cd(2+i*4); DrawBaselines(fileName, 1, 3, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4915 c->cd(3+i*4); DrawBaselines(fileName, 2, 3, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4916 c->cd(4+i*4); DrawBaselines(fileName, 0, 2, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4920 TGraphErrors* DrawSystUncIAAPYTHIA(TGraphErrors* graph, Int_t iaa_icp, Int_t awaySide)
4924 Float_t baseline = 1;
4927 else if (awaySide == 1)
4931 Float_t reference = 0;
4936 Float_t efficiency = 0.08;
4938 Float_t centrality = 1;
4940 centrality = (awaySide == 0) ? 0.02 : 0.06;
4941 else if (iaa_icp == 1)
4942 centrality = (awaySide == 0) ? 0.04 : 0.08;
4944 Float_t ptResolution = 0;
4946 Float_t total = TMath::Sqrt(baseline * baseline + efficiency * efficiency + centrality * centrality + ptResolution * ptResolution);
4948 Printf("Total syst: %f", total);
4950 systUnc = (TGraphErrors*) graph->Clone();
4951 for (Int_t i=0; i<systUnc->GetN(); i++)
4953 systUnc->GetEY()[i] = systUnc->GetY()[i] * total;
4954 systUnc->GetEX()[i] = 0;
4959 systUnc->SetLineColor(kGray + 1);
4960 systUnc->SetLineWidth(6);
4962 systUnc->Draw("PSAME");
4967 TGraphErrors* DrawSystUncPreliminaries(TGraphErrors* graph, Int_t iaa_icp, Int_t awaySide, Int_t iaa, Bool_t central)
4971 Float_t baseline = 1;
4974 else if (awaySide == 1)
4976 if (iaa == 0 && central || iaa == 1)
4978 else if (iaa == 0 && !central)
4980 else if (iaa == 2 && central)
4985 Float_t reference = 0;
4990 Float_t efficiency = 0.08;
4994 Float_t centrality = 1;
4997 else if (iaa_icp == 1)
5000 Float_t ptResolution = 0.03;
5002 Float_t integrationWindow = 0;
5004 integrationWindow = 0.03;
5006 Float_t total = TMath::Sqrt(baseline * baseline + efficiency * efficiency + centrality * centrality + ptResolution * ptResolution + integrationWindow * integrationWindow);
5008 Printf("Total syst: %f", total);
5010 systUnc = (TGraphErrors*) graph->Clone();
5011 for (Int_t i=0; i<systUnc->GetN(); i++)
5013 systUnc->GetEY()[i] = systUnc->GetY()[i] * total;
5014 systUnc->GetEX()[i] = 0;
5019 systUnc->SetLineColor(kGray + 1);
5020 systUnc->SetLineWidth(6);
5022 systUnc->Draw("PSAME");
5027 TGraphErrors* DrawSystUnc(TGraphErrors* graph, Int_t iaa_icp, Int_t awaySide, Int_t iaa, Bool_t central, Float_t shift = 0.0)
5029 // iaa_icp: iaa = 0, icp = 1
5031 Float_t baseline = 1;
5034 else if (awaySide == 1)
5036 if (iaa == 0 && central || iaa == 1)
5038 else if (iaa == 0 && !central)
5040 else if (iaa == 2 && central)
5045 Float_t reference = 0;
5050 Float_t efficiency = 0.04;
5052 Float_t centrality = 1;
5055 else if (iaa_icp == 1)
5058 Float_t ptResolution = 0;
5060 Float_t integrationWindow = 0;
5062 integrationWindow = 0.03;
5064 Float_t corrections = 1;
5067 else if (iaa_icp == 1)
5070 Float_t twoTrack = 0.01;
5072 Float_t total = TMath::Sqrt(baseline * baseline + efficiency * efficiency + centrality * centrality + ptResolution * ptResolution + integrationWindow * integrationWindow + corrections * corrections + twoTrack * twoTrack);
5074 Printf("%f %f %f %f %f %f %f --> Total syst: %f", baseline, efficiency, centrality, ptResolution, integrationWindow, corrections, twoTrack, total);
5076 systUnc = (TGraphErrors*) graph->Clone();
5077 for (Int_t i=0; i<systUnc->GetN(); i++)
5079 systUnc->GetEY()[i] = systUnc->GetY()[i] * total;
5080 systUnc->GetEX()[i] = 0;
5081 Printf("pt = %.2f y = %.2f +- %.2f (stat.) +- %.2f (syst.)", graph->GetX()[i] - shift, graph->GetY()[i], graph->GetEY()[i], systUnc->GetEY()[i]);
5086 systUnc->SetLineColor(kGray + 1);
5087 systUnc->SetLineWidth(4);
5089 systUnc->Draw("PSAME e2");
5094 void IAA(const char* fileName, Int_t iaa, const char* fileNameEtaGap = 0)
5100 // 3 = IAA LHC with theory
5102 Bool_t showTheory = 0;
5103 Bool_t showSTAR = 0;
5117 if (kPythiaScalingFactor != 1)
5118 Printf("Using reference data scaling factor: %f", kPythiaScalingFactor);
5123 Int_t caseId[] = { 18, 23 };
5125 c = new TCanvas((iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", (iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", 900, 450);
5126 c->Range(0, 0, 1, 1);
5128 TPad* pad1 = new TPad(Form("%s_2", fileName), "", 0, 0, 0.5, 1);
5131 TPad* pad2 = new TPad(Form("%s_1", fileName), "", 0.5, 0, 1, 1);
5135 gPad->SetRightMargin(0);
5136 gPad->SetTopMargin(0.05);
5137 gPad->SetLeftMargin(0.13);
5139 // gPad->SetGridy();
5142 gPad->SetLeftMargin(0);
5143 gPad->SetTopMargin(0.05);
5144 gPad->SetRightMargin(0.13);
5146 // gPad->SetGridy();
5149 // 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);
5150 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);
5152 // dummy->GetYaxis()->SetTitleOffset(1.3);
5153 dummy->GetXaxis()->SetTitleOffset(1.1);
5154 currentDummy = dummy->DrawCopy();
5156 gStyle->SetTextAlign(13);
5158 latex = new TLatex(0.17, 0.90, "Near-side_{ }");
5159 latex->SetTextSize(0.04);
5165 // box = new TBox(2, 0.87, 2.5, 1.13);
5166 // box->SetFillColor(kGray + 1);
5167 // box->SetLineColor(kGray + 1);
5170 // box2 = new TBox(2, 0.87 * 1.5, 2.5, 1.13 * 1.5);
5171 // box2->SetFillColor(kGray + 1);
5172 // box2->SetLineColor(kGray + 1);
5177 currentDummy = dummy->DrawCopy();
5182 latex = new TLatex(0.05, 0.90, "Away-side");
5183 latex->SetTextSize(0.04);
5187 legend = new TLegend(0.27, (showTheory) ? 0.60 : 0.62, (iaa != 2 && !showSTAR) ? 0.63 : 0.95, 0.77);
5188 legend->SetFillColor(0);
5189 legend->SetBorderSize(0);
5190 legend->SetTextSize((iaa != 2) ? 0.04 : 0.035);
5192 for (Int_t i=0; i<2; i++)
5194 nearSideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 0);
5196 nearSidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 0);
5197 awaySideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 1);
5199 awaySidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 1);
5201 RemovePointsBelowX(nearSideCentral, 3);
5202 RemovePointsBelowX(awaySideCentral, 3);
5203 RemovePointsAboveX(nearSideCentral, 10);
5204 RemovePointsAboveX(awaySideCentral, 10);
5206 RemoveXErrors(nearSideCentral); RemoveXErrors(awaySideCentral);
5210 RemovePointsBelowX(nearSidePeripheral, 3);
5211 RemovePointsBelowX(awaySidePeripheral, 3);
5212 RemovePointsAboveX(nearSidePeripheral, 10);
5213 RemovePointsAboveX(awaySidePeripheral, 10);
5214 ShiftPoints(nearSidePeripheral, 0.2);
5215 ShiftPoints(awaySidePeripheral, 0.2);
5216 RemoveXErrors(nearSidePeripheral); RemoveXErrors(awaySidePeripheral);
5219 nearSideCentral->SetMarkerStyle(21);
5220 nearSideCentral->SetLineColor(1);
5221 nearSideCentral->SetMarkerColor(1);
5223 awaySideCentral->SetMarkerStyle(21);
5224 awaySideCentral->SetLineColor(1);
5225 awaySideCentral->SetMarkerColor(1);
5229 nearSideCentral->SetLineColor(2);
5230 nearSideCentral->SetMarkerColor(2);
5231 awaySideCentral->SetLineColor(2);
5232 awaySideCentral->SetMarkerColor(2);
5237 nearSidePeripheral->SetMarkerStyle(22);
5238 nearSidePeripheral->SetLineColor(2);
5239 nearSidePeripheral->SetMarkerColor(2);
5241 awaySidePeripheral->SetMarkerStyle(22);
5242 awaySidePeripheral->SetLineColor(2);
5243 awaySidePeripheral->SetMarkerColor(2);
5248 // TString denominatorStr("Pythia");
5249 TString denominatorStr("pp");
5252 legend->AddEntry(nearSideCentral, Form("%s0-5% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5254 legend->AddEntry(nearSidePeripheral, Form("%s60-90% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5258 // legend->AddEntry(nearSideCentral, Form("0-20% / %s", denominatorStr.Data()), "P");
5259 legend->AddEntry(nearSideCentral, Form("ALICE 8 GeV/#font[12]{c} < p_{T,trig} < 15 GeV/#font[12]{c}", denominatorStr.Data()), "P");
5264 const char* style = "PSAME";
5268 awaySideCentral->Print();
5272 DrawSystUnc(nearSideCentral, (iaa == 1), 0, iaa, kTRUE);
5273 nearSideCentral->DrawClone(style);
5274 if (iaa == 0 && !showTheory)
5277 DrawSystUnc(nearSidePeripheral, (iaa == 1), 0, iaa, kFALSE);
5278 nearSidePeripheral->DrawClone(style);
5283 DrawSystUnc(awaySideCentral, (iaa == 1), 1, iaa, kTRUE);
5284 awaySideCentral->DrawClone(style);
5285 if (iaa == 0 && !showTheory)
5288 DrawSystUnc(awaySidePeripheral, (iaa == 1), 1, iaa, kFALSE);
5289 awaySidePeripheral->DrawClone(style);
5297 nearSideEtaGapCentral = GetRatio(fileNameEtaGap, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[0], 0);
5298 RemovePointsBelowX(nearSideEtaGapCentral, 3);
5299 RemovePointsAboveX(nearSideEtaGapCentral, 10);
5300 RemoveXErrors(nearSideEtaGapCentral);
5301 nearSideEtaGapCentral->SetMarkerStyle(25);
5302 nearSideEtaGapCentral->SetLineColor(1);
5303 nearSideEtaGapCentral->SetMarkerColor(1);
5304 nearSideEtaGapCentral->Draw("PSAME");
5308 nearSideEtaGapPeripheral = GetRatio(fileNameEtaGap, 2, 3, j, caseId[0], 0);
5309 RemovePointsBelowX(nearSideEtaGapPeripheral, 3);
5310 RemovePointsAboveX(nearSideEtaGapPeripheral, 10);
5311 RemoveXErrors(nearSideEtaGapPeripheral);
5312 ShiftPoints(nearSideEtaGapPeripheral, 0.2);
5313 nearSideEtaGapPeripheral->SetMarkerStyle(26);
5314 nearSideEtaGapPeripheral->SetLineColor(2);
5315 nearSideEtaGapPeripheral->SetMarkerColor(2);
5316 nearSideEtaGapPeripheral->Draw("PSAME");
5322 // IAA, RHIC, PHENIX
5323 // systematic uncertainty stored in graph with _sys appended
5324 TFile::Open("rhic/pi0h_graphs.root");
5326 legend2 = new TLegend(0.5, 0.16, 0.96, 0.27);
5327 legend2->SetFillColor(0);
5329 for (Int_t ptTrigBin=2; ptTrigBin<4; ptTrigBin++)
5331 Bool_t central = kTRUE;
5332 for (Int_t i=0; i<3; i+=2)
5334 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
5335 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d", ptTrigBin, (central) ? 0 : 1, i));
5336 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d_sys", ptTrigBin, (central) ? 0 : 1, i));
5338 rhic_iaa->SetMarkerStyle((ptTrigBin == 2) ? 20 : 33);
5339 rhic_iaa->SetMarkerColor(2);
5340 rhic_iaa->SetLineColor(2);
5341 rhic_iaa_sys->SetLineColor(2);
5342 rhic_iaa_sys->SetMarkerColor(2);
5344 RemovePointsBelowX(rhic_iaa, 2);
5345 RemovePointsBelowX(rhic_iaa_sys, 2);
5349 rhic_iaa_sys->Print();
5351 ShiftPoints(rhic_iaa, -0.05 + 0.05 * (ptTrigBin*2-4));
5352 ShiftPoints(rhic_iaa_sys, -0.05 + 0.05 * (ptTrigBin*2-4));
5358 rhic_iaa->Draw("PSAME");
5359 rhic_iaa_sys->Draw("PSAME");
5362 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");
5363 // 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");
5371 if (iaa == 0 && showSTAR)
5373 for (Int_t i=0; i<2; i++)
5375 const char* centralityStr = "05";
5377 centralityStr = "4080";
5380 // systematic uncertainty stored in graph with _sys appended
5381 nearSide = ReadHepdata(Form("rhic/star_iaa_%s_near.txt", centralityStr));
5382 awaySide = ReadHepdata(Form("rhic/star_iaa_%s_away.txt", centralityStr));
5384 nearSide->SetMarkerStyle(20 + i * 13);
5385 nearSide->SetMarkerColor(4);
5386 nearSide->SetLineColor(4);
5388 awaySide->SetMarkerStyle(20 + i * 13);
5389 awaySide->SetMarkerColor(4);
5390 awaySide->SetLineColor(4);
5392 ShiftPoints(nearSide, -0.1 + 0.2 * i);
5393 ShiftPoints(awaySide, -0.1 + 0.2 * i);
5396 nearSide->Draw("PSAME");
5398 awaySide->Draw("PSAME");
5400 legend->AddEntry(nearSide, Form("STAR Au-Au 0.2 TeV %s / dAu", (i == 0) ? "0-5%" : "40-80%"), "P");
5404 // Theory predictions
5405 if (showTheory && iaa == 0)
5407 const char* theoryList[] = { "AdS", "ASW", "YaJEM", "YaJEM-D", "XinNian" };
5409 Int_t markers[] = { 27, 28, 29, 30, 34 };
5411 for (Int_t i=0; i<nTheory; i++)
5413 nearSide = ReadHepdata(Form("theory/IAA_near_%s.dat", theoryList[i]));
5414 awaySide = ReadHepdata(Form("theory/IAA_away_%s.dat", theoryList[i]));
5416 nearSide->SetMarkerStyle(markers[i]);
5417 awaySide->SetMarkerStyle(markers[i]);
5419 RemovePointsBelowX(nearSide, 3);
5420 RemovePointsBelowX(awaySide, 3);
5422 Float_t shiftBy = (i % 2 == 0) ? -0.2 : 0.2;
5423 ShiftPoints(nearSide, shiftBy);
5424 ShiftPoints(awaySide, shiftBy);
5427 nearSide->Draw("PSAME");
5430 awaySide->Draw("PSAME");
5433 theoryList[i] = "AdS/CFT";
5435 theoryList[i] = "X-N Wang";
5436 legend->AddEntry(nearSide, theoryList[i], "P");
5440 for (Int_t i=0; i<2; i++)
5452 latex = new TLatex(xC, 0.84, "0-20% / pp");
5454 latex = new TLatex(0.35+xC, 0.9, "8 GeV/#font[12]{c} < p_{T,trig} < 15 GeV/#font[12]{c}");
5455 latex->SetTextSize(0.04);
5460 line = new TLine(1.5, 1, 10.5, 1);
5461 line->SetLineStyle(2);
5466 latex = new TLatex(xC, 0.84, "0-5% / 60-90%");
5467 latex->SetTextSize(0.04);
5472 latex = new TLatex(0.65+xC, 0.90, "ALICE");
5473 // latex = new TLatex(0.5+xC, 0.90, "-- work in progress --");
5474 latex->SetTextSize(0.04);
5479 latex = new TLatex(0.35+xC, 0.84, "p_{T,assoc} < p_{T,trig}");
5480 latex->SetTextSize(0.04);
5485 if (iaa == 1 || iaa == 0)
5487 if (iaa == 0 && showSTAR)
5488 latex = new TLatex(0.3+xC, 0.90, "|#eta| < 1.0");
5490 latex = new TLatex(xC + 0.65, 0.20, "|#eta| < 1.0");
5491 latex->SetTextSize(0.04);
5497 if (iaa == 1 || (iaa == 0 && !showSTAR))
5499 latex = new TLatex(0.5+xC, 0.72, "Pb-Pb 2.76 TeV");
5500 latex->SetTextSize(0.04);
5508 latex = new TLatex(0.5, 0.24, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
5510 latex = new TLatex(xC, 0.6, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
5511 latex->SetTextSize(0.035);
5516 latex = new TLatex(0.5, 0.18, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
5518 latex = new TLatex(xC, 0.54, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
5519 latex->SetTextSize(0.035);
5524 if (showTheory && iaa == 0 && i == 1)
5525 latex = new TLatex(xC, 0.18, "Points: flat pedestal");
5527 latex = new TLatex(xC + 0.5 * i, 0.26, "Points: flat pedestal");
5528 latex->SetTextSize(0.04);
5533 latex = new TLatex(xC + 0.5 * i, 0.20, "Line: v_{2} subtracted");
5534 latex->SetTextSize(0.04);
5539 if (iaa != 1 && i == 1)
5541 legendClone = (TLegend*) legend->DrawClone();
5542 if (showTheory && iaa == 0 && i == 0)
5543 legendClone->GetListOfPrimitives()->RemoveLast();
5545 // legendClone->SetY1(legendClone->GetY1()-0.05);
5547 legend->SetX1(legend->GetX1()-0.12);
5548 legend->SetX2(legend->GetX2()-0.12);
5551 /* if (i == 0 && iaa != 2)
5552 DrawALICELogo(0.83,0.15,0.98,0.30);
5554 DrawALICELogo(0.62 + xC,0.48,0.77 + xC,0.63);*/
5557 c->SaveAs(Form("%s.eps", c->GetTitle()));
5558 c->SaveAs(Form("%s.png", c->GetTitle()));
5561 void IAAPaper(const char* fileName, Int_t iaa, const char* fileNameEtaGap = 0)
5567 Bool_t showTheory = 0;
5568 Bool_t showSTAR = 0;
5582 if (kPythiaScalingFactor != 1)
5583 Printf("Using reference data scaling factor: %f", kPythiaScalingFactor);
5588 Int_t caseId[] = { 18, 23 };
5590 c = new TCanvas((iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", (iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", 900, 450);
5591 c->Range(0, 0, 1, 1);
5593 TPad* pad1 = new TPad(Form("%s_2", fileName), "", 0, 0, 0.5, 1);
5596 TPad* pad2 = new TPad(Form("%s_1", fileName), "", 0.5, 0, 1, 1);
5600 gPad->SetRightMargin(0);
5601 gPad->SetTopMargin(0.05);
5602 gPad->SetLeftMargin(0.13);
5604 // gPad->SetGridy();
5607 gPad->SetLeftMargin(0);
5608 gPad->SetTopMargin(0.05);
5609 gPad->SetRightMargin(0.13);
5611 // gPad->SetGridy();
5614 // 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);
5615 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);
5617 // dummy->GetYaxis()->SetTitleOffset(1.3);
5618 dummy->GetXaxis()->SetTitleOffset(1.1);
5619 currentDummy = dummy->DrawCopy();
5621 gStyle->SetTextAlign(13);
5623 latex = new TLatex(0.17, 0.90, "Near-side_{ }");
5624 latex->SetTextSize(0.04);
5628 latex = new TLatex(0.17, /*(iaa == 1) ? 0.78 :*/ 0.84, "#sqrt{#font[12]{s}_{NN}} = 2.76 TeV");
5629 latex->SetTextSize(0.04);
5633 latex = new TLatex(0.17, 0.2, (iaa == 1) ? "b)" : "a)");
5634 latex->SetTextSize(0.04);
5640 // box = new TBox(2, 0.87, 2.5, 1.13);
5641 // box->SetFillColor(kGray + 1);
5642 // box->SetLineColor(kGray + 1);
5645 // box2 = new TBox(2, 0.87 * 1.5, 2.5, 1.13 * 1.5);
5646 // box2->SetFillColor(kGray + 1);
5647 // box2->SetLineColor(kGray + 1);
5652 currentDummy = dummy->DrawCopy();
5657 latex = new TLatex(0.05, 0.90, "Away-side");
5658 latex->SetTextSize(0.04);
5663 legend = new TLegend(0.22, 0.60, 0.67, 0.73);
5665 legend = new TLegend(0.12, 0.60, 0.76, 0.79);
5666 legend->SetFillColor(0);
5667 legend->SetBorderSize(0);
5668 legend->SetTextSize((iaa != 2) ? 0.04 : 0.035);
5670 for (Int_t i=0; i<2; i++)
5672 nearSideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 0);
5674 nearSidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 0);
5675 awaySideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 1);
5677 awaySidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 1);
5679 RemovePointsBelowX(nearSideCentral, 3);
5680 RemovePointsBelowX(awaySideCentral, 3);
5681 RemovePointsAboveX(nearSideCentral, 10);
5682 RemovePointsAboveX(awaySideCentral, 10);
5684 ShiftPoints(nearSideCentral, -0.05);
5685 ShiftPoints(awaySideCentral, -0.05);
5689 ShiftPoints(nearSideCentral, -0.2);
5690 ShiftPoints(awaySideCentral, -0.2);
5694 ShiftPoints(nearSidePeripheral, 0.2);
5695 ShiftPoints(awaySidePeripheral, 0.2);
5699 RemoveXErrors(nearSideCentral); RemoveXErrors(awaySideCentral);
5703 RemovePointsBelowX(nearSidePeripheral, 3);
5704 RemovePointsBelowX(awaySidePeripheral, 3);
5705 RemovePointsAboveX(nearSidePeripheral, 10);
5706 RemovePointsAboveX(awaySidePeripheral, 10);
5707 ShiftPoints(nearSidePeripheral, 0.05);
5708 ShiftPoints(awaySidePeripheral, 0.05);
5709 RemoveXErrors(nearSidePeripheral); RemoveXErrors(awaySidePeripheral);
5712 nearSideCentral->SetMarkerStyle((i == 0) ? 25 : 27);
5713 nearSideCentral->SetLineColor(1);
5714 nearSideCentral->SetMarkerColor(1);
5716 awaySideCentral->SetMarkerStyle((i == 0) ? 25 : 27);
5717 awaySideCentral->SetLineColor(1);
5718 awaySideCentral->SetMarkerColor(1);
5722 nearSideCentral->SetLineColor(2);
5723 nearSideCentral->SetMarkerColor(2);
5724 awaySideCentral->SetLineColor(2);
5725 awaySideCentral->SetMarkerColor(2);
5730 nearSidePeripheral->SetMarkerStyle((i == 0) ? 21 : 33);
5731 nearSidePeripheral->SetLineColor(2);
5732 nearSidePeripheral->SetMarkerColor(2);
5734 awaySidePeripheral->SetMarkerStyle((i == 0) ? 21 : 33);
5735 awaySidePeripheral->SetLineColor(2);
5736 awaySidePeripheral->SetMarkerColor(2);
5741 // TString denominatorStr("Pythia");
5742 TString denominatorStr("pp");
5745 legend->SetHeader("0-5% Pb-Pb/pp 60-90% Pb-Pb/pp");
5746 legend->SetNColumns(2);
5748 legend->AddEntry(nearSideCentral, (i == 0) ? "Flat bkg" : "#font[12]{v}_{2} bkg", "P");
5750 legend->AddEntry(nearSidePeripheral, (i == 0) ? "Flat bkg" : "#font[12]{v}_{2} bkg", "P");
5752 // legend->AddEntry(nearSideCentral, Form("%s0-5% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5754 // legend->AddEntry(nearSidePeripheral, Form("%s60-90% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5757 // legend->AddEntry(nearSideCentral, Form("0-20% / %s", denominatorStr.Data()), "P");
5758 legend->AddEntry(nearSideCentral, Form("ALICE 8 GeV/#font[12]{c} < p_{T,trig} < 15 GeV/#font[12]{c}", denominatorStr.Data()), "P");
5763 const char* style = "PSAME";
5765 // style = "LSAMEX";
5769 DrawSystUnc(nearSideCentral, (iaa == 1), 0, iaa, kTRUE, -0.05 - 0.2 * i);
5770 nearSideCentral->DrawClone(style);
5771 if (iaa == 0 && !showTheory)
5774 DrawSystUnc(nearSidePeripheral, (iaa == 1), 0, iaa, kFALSE, 0.05 + ((iaa == 0) ? i * 0.2 : 0));
5775 nearSidePeripheral->DrawClone(style);
5780 DrawSystUnc(awaySideCentral, (iaa == 1), 1, iaa, kTRUE, -0.05 - 0.2 * i);
5781 awaySideCentral->DrawClone(style);
5782 if (iaa == 0 && !showTheory)
5785 DrawSystUnc(awaySidePeripheral, (iaa == 1), 1, iaa, kFALSE, 0.05 + ((iaa == 0) ? i * 0.2 : 0));
5786 awaySidePeripheral->DrawClone(style);
5794 nearSideEtaGapCentral = GetRatio(fileNameEtaGap, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[0], 0);
5795 RemovePointsBelowX(nearSideEtaGapCentral, 3);
5796 RemovePointsAboveX(nearSideEtaGapCentral, 10);
5797 RemoveXErrors(nearSideEtaGapCentral);
5798 nearSideEtaGapCentral->SetMarkerStyle(24);
5799 nearSideEtaGapCentral->SetLineColor(1);
5800 nearSideEtaGapCentral->SetMarkerColor(1);
5801 ShiftPoints(nearSideEtaGapCentral, -0.45);
5802 DrawSystUnc(nearSideEtaGapCentral, (iaa == 1), 0, iaa, kTRUE, -0.45);
5803 nearSideEtaGapCentral->Draw("PSAME");
5805 legend->AddEntry(nearSideEtaGapCentral, "#font[12]{#eta}-gap", "P");
5810 nearSideEtaGapPeripheral = GetRatio(fileNameEtaGap, 2, 3, j, caseId[0], 0);
5811 RemovePointsBelowX(nearSideEtaGapPeripheral, 3);
5812 RemovePointsAboveX(nearSideEtaGapPeripheral, 10);
5813 RemoveXErrors(nearSideEtaGapPeripheral);
5814 nearSideEtaGapPeripheral->SetMarkerStyle(20);
5815 nearSideEtaGapPeripheral->SetLineColor(2);
5816 nearSideEtaGapPeripheral->SetMarkerColor(2);
5817 ShiftPoints(nearSideEtaGapPeripheral, 0.45);
5818 DrawSystUnc(nearSideEtaGapPeripheral, (iaa == 1), 0, iaa, kFALSE, 0.45);
5819 nearSideEtaGapPeripheral->Draw("PSAME");
5821 legend->AddEntry(nearSideEtaGapPeripheral, "#font[12]{#eta}-gap", "P");
5827 // add pythia line showing gluon filtering
5828 // from Jan Rak, by mail, 22.09.11
5829 // pp CF calculated without any adjustment
5830 // AA CF also no adjustment. Particles (h+-) in acceptance are identified with their parent string parton (status 71)
5831 // and the flavor of parent hard outgoing parton (status 23) which is the parent of string parton 71 is checked.
5832 // If it is a gluon the particle is ignored.
5834 Float_t xVal[] = { 3.5, 4.5, 5.5, 7, 9};
5835 Float_t yVal[] = { 0.779418, 0.794234, 0.82759, 0.856457, 0.880526 };
5836 gluonfiltering = new TGraph(5, xVal, yVal);
5838 gluonfiltering->Draw("L");
5840 legend3 = new TLegend(0.38, 0.15, 0.58, 0.25);
5841 legend3->SetFillColor(0);
5842 legend3->SetBorderSize(0);
5843 legend3->SetTextSize(0.04);
5844 legend3->AddEntry(gluonfiltering, "PYTHIA quark-only fragmentation", "L");
5850 // IAA, RHIC, PHENIX
5851 // systematic uncertainty stored in graph with _sys appended
5852 TFile::Open("rhic/pi0h_graphs.root");
5854 legend2 = new TLegend(0.5, 0.16, 0.96, 0.27);
5855 legend2->SetFillColor(0);
5857 for (Int_t ptTrigBin=2; ptTrigBin<4; ptTrigBin++)
5859 Bool_t central = kTRUE;
5860 for (Int_t i=0; i<3; i+=2)
5862 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
5863 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d", ptTrigBin, (central) ? 0 : 1, i));
5864 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d_sys", ptTrigBin, (central) ? 0 : 1, i));
5866 rhic_iaa->SetMarkerStyle((ptTrigBin == 2) ? 20 : 33);
5867 rhic_iaa->SetMarkerColor(2);
5868 rhic_iaa->SetLineColor(2);
5869 rhic_iaa_sys->SetLineColor(2);
5870 rhic_iaa_sys->SetMarkerColor(2);
5872 ShiftPoints(rhic_iaa, -0.05 + 0.05 * (ptTrigBin*2-4));
5873 ShiftPoints(rhic_iaa_sys, -0.05 + 0.05 * (ptTrigBin*2-4));
5879 rhic_iaa->Draw("PSAME");
5880 rhic_iaa_sys->Draw("PSAME");
5883 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");
5884 // 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");
5892 if (iaa == 0 && showSTAR)
5894 for (Int_t i=0; i<2; i++)
5896 const char* centralityStr = "05";
5898 centralityStr = "4080";
5901 // systematic uncertainty stored in graph with _sys appended
5902 nearSide = ReadHepdata(Form("rhic/star_iaa_%s_near.txt", centralityStr));
5903 awaySide = ReadHepdata(Form("rhic/star_iaa_%s_away.txt", centralityStr));
5905 nearSide->SetMarkerStyle(20 + i * 13);
5906 nearSide->SetMarkerColor(4);
5907 nearSide->SetLineColor(4);
5909 awaySide->SetMarkerStyle(20 + i * 13);
5910 awaySide->SetMarkerColor(4);
5911 awaySide->SetLineColor(4);
5913 ShiftPoints(nearSide, -0.1 + 0.2 * i);
5914 ShiftPoints(awaySide, -0.1 + 0.2 * i);
5917 nearSide->Draw("PSAME");
5919 awaySide->Draw("PSAME");
5921 legend->AddEntry(nearSide, Form("STAR Au-Au 0.2 TeV %s / dAu", (i == 0) ? "0-5%" : "40-80%"), "P");
5925 // Theory predictions
5926 if (showTheory && iaa == 0)
5928 const char* theoryList[] = { "AdS", "ASW", "YaJEM", "YaJEM-D", "XinNian" };
5930 Int_t markers[] = { 27, 28, 29, 30, 34 };
5932 for (Int_t i=0; i<nTheory; i++)
5934 nearSide = ReadHepdata(Form("theory/IAA_near_%s.dat", theoryList[i]));
5935 awaySide = ReadHepdata(Form("theory/IAA_away_%s.dat", theoryList[i]));
5937 nearSide->SetMarkerStyle(markers[i]);
5938 awaySide->SetMarkerStyle(markers[i]);
5940 RemovePointsBelowX(nearSide, 3);
5941 RemovePointsBelowX(awaySide, 3);
5943 Float_t shiftBy = (i % 2 == 0) ? -0.2 : 0.2;
5944 ShiftPoints(nearSide, shiftBy);
5945 ShiftPoints(awaySide, shiftBy);
5948 nearSide->Draw("PSAME");
5951 awaySide->Draw("PSAME");
5954 theoryList[i] = "AdS/CFT";
5956 theoryList[i] = "X-N Wang";
5957 legend->AddEntry(nearSide, theoryList[i], "P");
5961 for (Int_t i=0; i<2; i++)
5973 latex = new TLatex(xC, 0.84, "0-20% / pp");
5975 latex = new TLatex(0.35+xC, 0.9, "8 GeV/#font[12]{c} < #font[12]{p}_{t,trig} < 15 GeV/#font[12]{c}");
5976 latex->SetTextSize(0.04);
5981 line = new TLine(1.5, 1, 10.5, 1);
5982 line->SetLineStyle(2);
5985 // if (iaa == 1 && i == 0)
5987 // latex = new TLatex(xC, 0.84, "0-5% / 60-90%");
5988 // latex->SetTextSize(0.04);
5993 latex = new TLatex(0.65+xC, 0.90, "ALICE");
5994 // latex = new TLatex(0.5+xC, 0.90, "-- work in progress --");
5995 latex->SetTextSize(0.04);
6000 latex = new TLatex(0.35+xC, 0.84, "#font[12]{p}_{t,assoc} < #font[12]{p}_{t,trig}");
6001 latex->SetTextSize(0.04);
6006 if (iaa == 1 || iaa == 0)
6008 if (iaa == 0 && showSTAR)
6009 latex = new TLatex(0.3+xC, 0.90, "|#font[12]{#eta}| < 1.0");
6011 latex = new TLatex(0.82, 0.84, "|#font[12]{#eta}| < 1.0");
6012 latex->SetTextSize(0.04);
6018 if (iaa == 1 || (iaa == 0 && !showSTAR))
6020 latex = new TLatex(0.5+xC, 0.72, "Pb-Pb 2.76 TeV");
6021 latex->SetTextSize(0.04);
6029 latex = new TLatex(0.5, 0.24, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
6031 latex = new TLatex(xC, 0.6, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
6032 latex->SetTextSize(0.035);
6037 latex = new TLatex(0.5, 0.18, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
6039 latex = new TLatex(xC, 0.54, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
6040 latex->SetTextSize(0.035);
6047 legendClone = (TLegend*) legend->DrawClone();
6048 if (showTheory && iaa == 0 && i == 0)
6049 legendClone->GetListOfPrimitives()->RemoveLast();
6051 // legendClone->SetY1(legendClone->GetY1()-0.05);
6053 legend->SetX1(legend->GetX1()-0.12);
6054 legend->SetX2(legend->GetX2()-0.12);
6059 /* if (i == 0 && iaa != 2)
6060 DrawALICELogo(0.83,0.15,0.98,0.30);
6062 DrawALICELogo(0.62 + xC,0.48,0.77 + xC,0.63);*/
6065 c->SaveAs(Form("%s.eps", c->GetTitle()));
6066 c->SaveAs(Form("%s.png", c->GetTitle()));
6070 void DrawALICELogo(Float_t x1, Float_t y1, Float_t x2, Float_t y2, Bool_t debug = kFALSE)
6072 DrawALICELogo(kTRUE, x1, y1, x2, y2, debug);
6075 void DrawALICELogo(Bool_t prel, Float_t x1, Float_t y1, Float_t x2, Float_t y2, Bool_t debug = kFALSE)
6077 // correct for aspect ratio of figure plus aspect ratio of pad (coordinates are NDC!)
6078 // Printf("%d %f %d %f", gPad->GetCanvas()->GetWindowHeight(), gPad->GetHNDC(), gPad->GetCanvas()->GetWindowWidth(), gPad->GetWNDC());
6079 //x2 = x1 + (y2 - y1) * 0.891 * gPad->GetCanvas()->GetWindowHeight() * gPad->GetHNDC() / (gPad->GetWNDC() * gPad->GetCanvas()->GetWindowWidth());
6080 x2 = x1 + (y2 - y1) * (466. / 523) * gPad->GetWh() * gPad->GetHNDC() / (gPad->GetWNDC() * gPad->GetWw());
6081 // Printf("%f %f %f %f", x1, x2, y1, y2);
6084 DrawLatex((x1+x2)/2, y1, 1, "09.05.12", 0.03)->SetTextAlign(23);
6085 TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo", x1, y1, x2, y2);
6087 myPadLogo->SetFillColor(2); // color to first figure out where is the pad then comment !
6088 myPadLogo->SetLeftMargin(0);
6089 myPadLogo->SetTopMargin(0);
6090 myPadLogo->SetRightMargin(0);
6091 myPadLogo->SetBottomMargin(0);
6094 // TASImage *myAliceLogo = new TASImage("~/alice_logo_transparent.png");
6095 TASImage *myAliceLogo = new TASImage((prel) ? "~/alice_logo_preliminary.eps" : "~/alice_logo_performance.eps");
6096 myAliceLogo->Draw();
6099 void RemoveXErrors(TGraphErrors* graph)
6101 for (Int_t i=0; i<graph->GetN(); i++)
6102 graph->GetEX()[i] = 0;
6105 void RemovePointsBelowX(TGraphErrors* graph, Float_t minX)
6108 while (i<graph->GetN())
6110 if (graph->GetX()[i] < minX)
6111 graph->RemovePoint(i);
6117 void RemovePointsAboveX(TGraphErrors* graph, Float_t maxX)
6120 while (i<graph->GetN())
6122 if (graph->GetX()[i] > maxX)
6123 graph->RemovePoint(i);
6129 void ShiftPoints(TGraphErrors* graph, Float_t dx)
6132 while (i<graph->GetN())
6134 graph->GetX()[i] += dx;
6139 void DivideGraphs(TGraphErrors* graph1, TGraphErrors* graph2)
6144 for (Int_t bin1 = 0; bin1 < graph1->GetN(); bin1++)
6146 Float_t x = graph1->GetX()[bin1];
6149 for (bin2 = 0; bin2<graph2->GetN(); bin2++)
6150 if (graph2->GetX()[bin2] >= x)
6153 if (bin2 == graph2->GetN())
6157 if (TMath::Abs(graph2->GetX()[bin2-1] - x) < TMath::Abs(graph2->GetX()[bin2] - x))
6160 if (graph1->GetY()[bin1] == 0 || graph2->GetY()[bin2] == 0 || bin2 == graph2->GetN())
6162 Printf("%d %d removed", bin1, bin2);
6163 graph1->RemovePoint(bin1--);
6167 Float_t graph2Extrapolated = graph2->GetY()[bin2];
6168 if (TMath::Abs(x - graph2->GetX()[bin2]) > 0.0001)
6170 Printf("%f %f %d %d not found", x, graph2->GetX()[bin2], bin1, bin2);
6171 graph1->RemovePoint(bin1--);
6175 Float_t value = graph1->GetY()[bin1] / graph2Extrapolated;
6176 Float_t error = value * TMath::Sqrt(TMath::Power(graph1->GetEY()[bin1] / graph1->GetY()[bin1], 2) + TMath::Power(graph2->GetEY()[bin2] / graph2->GetY()[bin2], 2));
6178 graph1->GetY()[bin1] = value;
6179 graph1->GetEY()[bin1] = error;
6181 Printf("%d %d %f %f %f %f", bin1, bin2, x, graph2Extrapolated, value, error);
6185 Float_t ExtractYields(TH1* hist, Int_t trigId, Int_t centralityId, Float_t ptA, Float_t ptW, Int_t caseId, Double_t normUnc)
6187 CreateYieldStructure();
6189 Float_t width = 0.69;
6190 // Float_t width = 0.5; Printf("WARNING. Using integration width 0.5");
6191 // Float_t width = 0.85; Printf("WARNING. Using integration width 0.85");
6193 //new TCanvas; hist->DrawCopy();
6195 Int_t binBegin = hist->FindBin(-width);
6196 Int_t binEnd = hist->FindBin(width);
6197 Double_t nearSideError = 0;
6198 Float_t nearSideYield = hist->IntegralAndError(binBegin, binEnd, nearSideError);
6199 nearSideYield *= hist->GetXaxis()->GetBinWidth(1);
6200 nearSideError *= hist->GetXaxis()->GetBinWidth(1);
6202 Int_t binBegin = hist->FindBin(TMath::Pi() - width);
6203 Int_t binEnd = hist->FindBin(TMath::Pi() + width);
6204 Double_t awaySideError = 0;
6205 Float_t awaySideYield = hist->IntegralAndError(binBegin, binEnd, awaySideError);
6206 awaySideYield *= hist->GetXaxis()->GetBinWidth(1);
6207 awaySideError *= hist->GetXaxis()->GetBinWidth(1);
6209 Printf("%d %d %f %d: %f+-%f %f+-%f (%f)", trigId, centralityId, ptA, caseId, nearSideYield, nearSideError, awaySideYield, awaySideError, normUnc);
6211 FillYield(trigId, centralityId, ptA, ptW, caseId, nearSideYield, TMath::Sqrt(nearSideError * nearSideError + normUnc * normUnc), awaySideYield, TMath::Sqrt(awaySideError * awaySideError + normUnc * normUnc));
6213 // store normUnc for error propagation later
6214 TGraphErrors** tmp = yields[2][trigId][centralityId];
6215 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, normUnc);
6217 return awaySideYield;
6220 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)
6222 // CINT limitation here
6223 TGraphErrors** tmp = yields[0][trigId][centralityId];
6224 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, nearSideYield);
6225 tmp[caseId]->SetPointError(tmp[caseId]->GetN()-1, ptW, nearSideError);
6226 //tmp[caseId]->Print();
6228 tmp = yields[1][trigId][centralityId];
6229 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, awaySideYield);
6230 tmp[caseId]->SetPointError(tmp[caseId]->GetN()-1, ptW, awaySideError);
6233 Double_t hypgeo(Double_t a, Double_t b, Double_t c, Double_t z)
6235 // ROOT::Math::hyperg is only defined for |z| < 1
6237 return ROOT::Math::hyperg(a, b, c, z);
6239 // for z < -1 we can use an identity from http://en.wikipedia.org/wiki/Hypergeometric_function
6240 return TMath::Power(1-z, -b) * ROOT::Math::hyperg(c-a, b, c, z / (z-1));
6243 Double_t hypgeoder2(Double_t a, Double_t b, Double_t c, Double_t z)
6245 // derivate of hypgeo with parameter b: d/db hypgeo
6247 static TF1* func = 0;
6249 func = new TF1("hypgeoder2_func", "hypgeo([0], x, [1], [2])");
6251 func->SetParameters(a, c, z);
6252 return func->Derivative(b);
6255 void TsallisYieldUncertainty(Double_t n, Double_t q, Double_t beta, TMatrixDSym covMatrix, Int_t offset, Double_t& yield, Double_t& unc)
6257 gSystem->Load("libMathMore");
6259 TF1 tsallis("tsallis", "[0] * (1-[2]*(1-[1])*x*x)**(1/(1-[1]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
6261 // 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]
6262 // [0] = n, [1] = q, [2] = beta
6263 TF1 tsallisIntegral("tsallisIntegral", "[0]*x*hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x)");
6264 TF1 tsallisIntegralDerN("tsallisIntegralDerN", "x*hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x)");
6266 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)");
6268 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]");
6270 const Float_t width = 0.7;
6273 derivates[0] = new TF1("const", "1");
6274 derivates[1] = &tsallisIntegralDerN;
6275 derivates[2] = &tsallisIntegralDerq;
6276 derivates[3] = &tsallisIntegralDerbeta;
6278 Printf("%f %f %f", n, q, beta);
6280 tsallis.SetParameters(n, q, beta);
6281 tsallisIntegral.SetParameters(n, q, beta);
6282 for (Int_t i=1; i<4; i++)
6283 derivates[i]->SetParameters(n, q, beta);
6285 yield = tsallisIntegral.Eval(width) - tsallisIntegral.Eval(-width);
6286 Double_t yield2 = tsallis.Integral(-width, width);
6289 for (Int_t i=0; i<4; i++)
6290 for (Int_t j=0; j<4; j++)
6299 Double_t der1 = (derivates[i]->Eval(width) - derivates[i]->Eval(-width));
6300 Double_t der2 = (derivates[j]->Eval(width) - derivates[j]->Eval(-width));
6302 unc += der1 * der2 * covMatrix(covI, covJ);
6304 Printf("%d %d % .3e % .3e % .3e % .3e", i, j, der1, der2, covMatrix(covI, covJ), unc);
6307 unc = TMath::Sqrt(unc);
6310 yield2 /= width * 2;
6313 Printf("%f (%f) +- %f", yield, yield2, unc);
6316 double NLowestBinAverage(TH1 &h, int N)
6318 // Returns mean content of N lowest bins in h.
6322 std::list<double> content;
6323 std::list<double>::iterator i;
6325 for (int jbin=1; jbin<=h.GetNbinsX(); jbin++) {
6326 content.push_back(h.GetBinContent(jbin));
6330 for (i = content.begin(); i != content.end(); ++i) {
6340 Warning("NLowestBinAverage()",
6341 "Avg. of %d bins requested, %d used", N, counter);
6346 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)
6349 // 0 same with v2 (14 tsallis for baseline [28/29 tsallis params]; 15 yield from tsallis function)
6350 // [disabled] 1 same/mixed with v2 (15 tsallis for baseline)
6351 // 2 same no v2 (16 tsallis for baseline; 17 yield from tsallis function)
6352 // 4 same no v2 (18 flat fit 1)
6353 // 5 same no v2 (19 flat fit 2)
6354 // 6 same no v2 (20 flat avg over 4)
6355 // 7 same no v2 (21 flat avg over 8)
6356 // 8 same no v2 (22 flat avg over 16)
6357 // 9 same with v2 (23 flat fit 1)
6358 // 10 same with v2 (24 flat fit 2)
6359 // 11 same with v2 (25 flat avg over 4)
6360 // 12 same with v2 (26 flat avg over 8)
6361 // 13 same with v2 (27 flat avg over 16)
6363 // 30 gaussian fit width
6365 // same stuff for same/mixed
6366 if (0 && caseOffset == 0 && histMixed)
6368 TH1* clone = (TH1*) hist->Clone();
6369 clone->Divide(histMixed);
6370 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 1, ptACenter, ptAWidth, kFALSE, 0, vn);
6373 // same for other baseline subtractions
6374 if (caseOffset == 0)
6376 file = TFile::Open("dphi_corr.root", "UPDATE");
6380 TH1* clone = (TH1*) hist->Clone();
6381 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 2, ptACenter, ptAWidth, kTRUE, 0, vn);
6383 clone = (TH1*) hist->Clone();
6384 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 4, ptACenter, ptAWidth, kTRUE, 1, vn);
6386 clone = (TH1*) hist->Clone();
6387 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 5, ptACenter, ptAWidth, kTRUE, 2, vn);
6389 clone = (TH1*) hist->Clone();
6390 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 6, ptACenter, ptAWidth, kTRUE, 3, vn);
6392 clone = (TH1*) hist->Clone();
6393 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 7, ptACenter, ptAWidth, kTRUE, 4, vn);
6395 clone = (TH1*) hist->Clone();
6396 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 8, ptACenter, ptAWidth, kTRUE, 5, vn);
6398 clone = (TH1*) hist->Clone();
6399 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 9, ptACenter, ptAWidth, kFALSE, 1, vn);
6401 clone = (TH1*) hist->Clone();
6402 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 10, ptACenter, ptAWidth, kFALSE, 2, vn);
6404 clone = (TH1*) hist->Clone();
6405 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 11, ptACenter, ptAWidth, kFALSE, 3, vn);
6407 clone = (TH1*) hist->Clone();
6408 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 12, ptACenter, ptAWidth, kFALSE, 4, vn);
6410 clone = (TH1*) hist->Clone();
6411 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 13, ptACenter, ptAWidth, kFALSE, 5, vn);
6414 Float_t awaySideYield = ExtractYields(hist, trigId, centralityId, ptACenter, ptAWidth, 0 + caseOffset, 0);
6422 /* Float_t v2Trig = flowGraph->Eval(ptT);
6423 Float_t v2Assoc = flowGraph->Eval(ptA);
6424 Float_t v2 = v2Trig * v2Assoc;
6425 Printf("%f %f: %.2f %.2f --> %.4f", ptT, ptA, v2Trig, v2Assoc, v2);*/
6427 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());
6432 Float_t minBin = hist->FindBin(0.6);
6433 for (Int_t bin=hist->FindBin(0.6); bin<=hist->FindBin(1.8); bin++)
6434 if (hist->GetBinContent(bin) < hist->GetBinContent(minBin))
6437 Float_t norm = hist->GetBinContent(minBin) / (1 + 2 * v2 * cos(2 * hist->GetBinCenter(minBin)));
6438 Double_t normUnc = 0;
6442 if (baseLineDetermination == 0)
6446 if (centralityId == 0)
6447 hist->Fit("pol0", "0", "", 0.8., 1.2);
6449 hist->Fit("pol0", "0", "", 1.2, 1.6);
6451 //tsallis = new TF1("tsallis", "(1-[1]*(1-[0])*x*x)**(1/(1-[0]))", 0, 10)
6452 // (1-b(1-q)x*x)**(1/(1-q))
6454 // combination of two tsallis functions
6455 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());
6456 //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());
6457 // 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
6458 total->SetParLimits(0, 0, 10000);
6459 total->SetParLimits(1, 0, 10000);
6460 total->SetParLimits(4, 0, 10000);
6462 total->SetParLimits(2, 1.0000001, 5);
6463 total->SetParLimits(5, 1.0000001, 5);
6465 total->SetParLimits(3, 0.1, 1000);
6466 total->SetParLimits(6, 0.1, 1000);
6468 total->SetParameters(1, 1, 1.5, 3, 1, 1.5, 1.1);
6471 hist->Fit(total, "0RI");
6472 fitResult = hist->Fit(total, "0RSI");
6474 if (0 && fitResult->CovMatrixStatus() > 0)
6476 TMatrixDSym cov(fitResult->GetCovarianceMatrix());
6479 Double_t nearSideYield, nearSideError;
6480 TsallisYieldUncertainty(total->GetParameter(1), total->GetParameter(2), total->GetParameter(3), cov, 0, nearSideYield, nearSideError);
6482 Double_t awaySideYield2, awaySideError;
6483 TsallisYieldUncertainty(total->GetParameter(4), total->GetParameter(5), total->GetParameter(6), cov, 3, awaySideYield2, awaySideError);
6485 FillYield(trigId, centralityId, ptACenter, ptAWidth, 14 + caseOffset + 1, nearSideYield, nearSideError, awaySideYield2, awaySideError);
6487 Printf("Chi2 %f / ndf %d = %f", total->GetChisquare(), total->GetNDF(), (total->GetNDF() > 0) ? total->GetChisquare() / total->GetNDF() : -1);
6489 total->SetLineColor(hist->GetLineColor());
6490 total->SetLineWidth(1);
6491 if (caseOffset == 2)
6494 total->DrawCopy("SAME");
6495 //total->SetParameter(5, total->GetParameter(5) - TMath::Sqrt(cov[5][5]));
6496 //total->DrawCopy("SAME");
6497 //total->SetParameter(5, total->GetParameter(5) + 2 * TMath::Sqrt(cov[5][5]));
6498 //Printf("%f", total->Integral(-0.7,0.7));
6499 //total->DrawCopy("SAME");
6502 if (caseOffset == 0)
6504 // store fit parameters
6507 FillYield(trigId, centralityId, ptACenter, ptAWidth, 28, total->GetParameter(2), total->GetParError(2), total->GetParameter(5), total->GetParError(5));
6509 FillYield(trigId, centralityId, ptACenter, ptAWidth, 29, total->GetParameter(3), total->GetParError(3), total->GetParameter(6), total->GetParError(6));
6514 gausFit = new TF1("gausFit", "[0] + gaus(1) + gaus(4)", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
6515 gausFit->SetParameters(1, 1, 0, 1, 1, TMath::Pi(), 0);
6516 gausFit->SetParLimits(0, 0, 10000);
6517 gausFit->SetParLimits(1, 0, 10000);
6518 gausFit->FixParameter(2, 0);
6519 gausFit->SetParLimits(3, 0.01, 10);
6520 gausFit->SetParLimits(4, 0, 10000);
6521 gausFit->FixParameter(5, TMath::Pi());
6522 gausFit->SetParLimits(6, 0.01, 10);
6524 hist->Fit(gausFit, "0RI");
6525 gausFit->SetLineWidth(1);
6526 gausFit->DrawCopy("SAME");
6528 FillYield(trigId, centralityId, ptACenter, ptAWidth, 30, gausFit->GetParameter(3), total->GetParError(3), total->GetParameter(6), total->GetParError(6));
6532 if (0 && cov[0][0] > 0)
6534 for (Int_t i=0; i<cov.GetNcols(); i++)
6535 for (Int_t j=0; j<cov.GetNrows(); j++)
6536 cov[j][i] /= TMath::Sqrt(cov[i][i]) * TMath::Sqrt(cov[j][j]);
6542 Float_t norm = func->GetParameter(0) / (1 - 2 * v2);
6543 Double_t normUnc = func->GetParError(0) / (1 - 2 * v2);
6546 else if (baseLineDetermination <= 2)
6551 if (baseLineDetermination == 1)
6553 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4, 1.5 * TMath::Pi() - 0.4 };
6554 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4, TMath::Pi() / 2 + 0.4, 1.5 * TMath::Pi() };
6556 else if (baseLineDetermination == 2)
6558 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4 - 0.2, 1.5 * TMath::Pi() - 0.4 - 0.2};
6559 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4 - 0.2, TMath::Pi() / 2 + 0.4 - 0.2, 1.5 * TMath::Pi() };
6565 for (Int_t i=0; i<3; i++)
6567 hist->Fit("pol0", "0Q", "", regionBegin[i], regionEnd[i]);
6568 func = hist->GetFunction("pol0");
6571 sum += func->GetParameter(0) / func->GetParError(0) / func->GetParError(0);
6572 weight += 1. / func->GetParError(0) / func->GetParError(0);
6579 weight = TMath::Sqrt(1. / weight);
6581 Float_t norm = sum / (1 - 2 * v2);
6582 Double_t normUnc = weight / (1 - 2 * v2);
6587 if (baseLineDetermination == 4)
6589 if (baseLineDetermination == 5)
6591 Float_t norm = NLowestBinAverage(*hist, bins);
6592 Double_t normUnc = 0;
6594 Printf("NLowestBinAverage %d --> %f", bins, norm);
6596 norm /= (1 - 2 * v2);
6599 Printf("Baseline: %f +- %f", norm, normUnc);
6602 if (caseOffset == 0)
6604 Float_t awaySideYieldNoBaseline = awaySideYield - norm * (1 - 2 * v2);
6605 Float_t v2YieldNoBaseline = norm * 2 * v2 * (1 + 1.4) / 1.4;
6606 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);
6609 //flowFunc->SetParameters(hist->GetBinContent(hist->FindBin(1.4)) / (1.0 - 2.0 * v2), v2);
6610 flowFunc->SetParameters(norm, v2, 0, 0, 0);
6612 flowFunc->SetParameters(norm, vn[1], vn[2], vn[3], vn[4]);
6613 flowFunc->SetLineWidth(2);
6614 if (caseOffset >= 4 && caseOffset <= 9 && caseOffset != 6 && caseOffset != 7)
6616 if (caseOffset != 4 && caseOffset != 9)
6617 flowFunc->SetLineStyle(2);
6618 flowFunc->DrawCopy("SAME"); //->SetLineColor(caseOffset - 3);
6621 flowFuncTmp = (TF1*) flowFunc->Clone("flowFuncTmp");
6622 for (Int_t i=1; i<=4; i++)
6624 flowFuncTmp->SetParameters(flowFuncTmp->GetParameter(0), 0, 0, 0, 0);
6625 flowFuncTmp->SetParameter(i, vn[i]);
6626 flowFuncTmp->SetLineStyle(2);
6627 flowFuncTmp->Print();
6628 flowFuncTmp->DrawCopy("SAME");
6633 hist->Add(flowFunc, -1);
6634 if (caseOffset == 0)
6636 file = TFile::Open("dphi_corr.root", "UPDATE");
6637 hist->SetName(TString(hist->GetName()) + "_tsallis_v2");
6640 // hist->DrawCopy("SAME");
6642 if (caseOffset == 2 && flatBaseLine)
6644 file = TFile::Open("dphi_corr.root", "UPDATE");
6645 hist->SetName(TString(hist->GetName()) + "_tsallis_flat");
6648 // hist->DrawCopy("SAME");
6650 if (caseOffset == 4 && flatBaseLine)
6652 file = TFile::Open("dphi_corr.root", "UPDATE");
6653 hist->SetName(TString(hist->GetName()) + "_fit_flat");
6656 // hist->DrawCopy("SAME");
6658 if (caseOffset == 9)
6660 file = TFile::Open("dphi_corr.root", "UPDATE");
6661 hist->SetName(TString(hist->GetName()) + "_fit_v2");
6664 // hist->DrawCopy("SAME");
6667 ExtractYields(hist, trigId, centralityId, ptACenter, ptAWidth, 14 + caseOffset, normUnc);
6671 Printf("%f", histMixed->Integral() / histMixed->GetNbinsX());
6672 flowFunc->SetParameters(histMixed->Integral() / histMixed->GetNbinsX(), v2);
6673 flowFunc->SetLineColor(2);
6674 //if (caseOffset == 0)
6675 // flowFunc->DrawCopy("SAME");
6679 void RemoveBaseLine(TH1* hist)
6687 hist->Fit("pol0", "0", "", 1.07, 2.07);
6689 if (!hist->GetFunction("pol0"))
6692 Float_t zyam = hist->GetFunction("pol0")->GetParameter(0);
6699 for (Int_t i=1; i<=hist->GetNbinsX(); i++)
6700 hist->SetBinContent(i, hist->GetBinContent(i) - zyam);
6704 TH2* cacheMixed[10];
6706 Int_t gHistCount = 0;
6707 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)
6709 h = (AliUEHistograms*) hVoid;
6710 hMixed = (AliUEHistograms*) hMixedVoid;
6715 Int_t centralityBeginBin = 0;
6716 Int_t centralityEndBin = -1;
6718 if (!useCentralityBinsDirectly && centralityEnd >= centralityBegin)
6720 centralityBeginBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityBegin);
6721 centralityEndBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityEnd);
6723 else if (useCentralityBinsDirectly)
6725 centralityBeginBin = centralityBegin;
6726 centralityEndBin = centralityEnd;
6729 // 2d same and mixed event
6730 TH2* sameTwoD = h->GetUEHist(2)->GetUEHist(step, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, 1, kFALSE);
6736 // No centrality, nor pT associated dep of the mixed event observed. Use a larger range to get more statistics
6740 for (Int_t i=0; i<10; i++)
6741 if (cacheIds[i] == hMixed)
6749 for (Int_t i=0; i<10; i++)
6750 if (cacheIds[i] == 0)
6756 if (!cacheIds[cacheId])
6758 hMixed->SetPtRange(3.0, 10);
6759 cacheMixed[cacheId] = (TH2*) hMixed->GetUEHist(2)->GetUEHist(stepMixed, 0, 3.0, 10.0, centralityBeginBin, centralityEndBin, 1, kFALSE);
6760 cacheIds[cacheId] = hMixed;
6761 Printf("GetDistAndFlow: Cached for %p on slot %d", hMixed, cacheId);
6764 TH2* mixedTwoD = cacheMixed[cacheId];
6768 // use same bin for mixing
6770 TH2* mixedTwoD = (TH2*) hMixed->GetUEHist(2)->GetUEHist(stepMixed, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, 1, kFALSE);
6775 // asssume flat in dphi, gain in statistics
6776 Printf("NOTE: Assuming flat acceptance in phi!");
6778 TH1* histMixedproj = mixedTwoD->ProjectionY();
6779 histMixedproj->Scale(1.0 / mixedTwoD->GetNbinsX());
6781 for (Int_t x=1; x<=mixedTwoD->GetNbinsX(); x++)
6782 for (Int_t y=1; y<=mixedTwoD->GetNbinsY(); y++)
6783 mixedTwoD->SetBinContent(x, y, histMixedproj->GetBinContent(y));
6786 // get mixed event normalization by assuming full acceptance at deta of 0 (only works for flat dphi)
6789 Double_t mixedNorm = mixedTwoD->Integral(1, mixedTwoD->GetNbinsX(), mixedTwoD->GetYaxis()->FindBin(-0.01), mixedTwoD->GetYaxis()->FindBin(0.01));
6790 mixedNorm /= mixedTwoD->GetNbinsX() * (mixedTwoD->GetYaxis()->FindBin(0.01) - mixedTwoD->GetYaxis()->FindBin(-0.01) + 1);
6793 Double_t mixedNorm = mixedTwoD->Integral() / sameTwoD->Integral();
6796 sameTwoD->Divide(mixedTwoD);
6797 sameTwoD->Scale(mixedNorm);
6800 sameTwoD->Draw("SURF1");
6805 histName.Form("GetDistAndFlow%d", gHistCount++);
6807 // extract dphi distribution if requested
6813 // Float_t etaLimit = 0.8;
6814 Float_t etaLimit = 1.0;
6816 // 20: return corr in |delta eta| < 1 from which 1 < |delta eta| < 2 is subtracted
6817 if (twoD == 0 || twoD == 10 || twoD == 20)
6820 Int_t etaEnd = sameTwoD->GetNbinsY();
6822 if (twoD == 10 || twoD == 20)
6824 etaBegin = sameTwoD->GetYaxis()->FindBin(-etaLimit + 0.01);
6825 etaEnd = sameTwoD->GetYaxis()->FindBin(etaLimit - 0.01);
6828 *hist = sameTwoD->ProjectionX(histName, etaBegin, etaEnd);
6831 (*hist)->Scale(1.0 / (etaEnd - etaBegin + 1));
6834 if (twoD == 11 || twoD == 20)
6836 // errors --> are ok
6838 // Float_t outerLimit = 2.0;
6839 Float_t outerLimit = 1.8;
6840 Printf("Phi dist: Using outer limit %.2f", outerLimit);
6841 // Float_t outerLimit = etaLimit * 2;
6843 histTmp = sameTwoD->ProjectionX(histName + "1", TMath::Max(1, sameTwoD->GetYaxis()->FindBin(-outerLimit + 0.01)), sameTwoD->GetYaxis()->FindBin(-etaLimit - 0.01));
6844 Int_t etaBins = sameTwoD->GetYaxis()->FindBin(-etaLimit - 0.01) - TMath::Max(1, sameTwoD->GetYaxis()->FindBin(-outerLimit + 0.01)) + 1;
6846 TH1D* tracksTmp = sameTwoD->ProjectionX(histName + "2", sameTwoD->GetYaxis()->FindBin(etaLimit + 0.01), TMath::Min(sameTwoD->GetYaxis()->GetNbins(), sameTwoD->GetYaxis()->FindBin(outerLimit - 0.01)));
6847 etaBins += TMath::Min(sameTwoD->GetYaxis()->GetNbins(), sameTwoD->GetYaxis()->FindBin(outerLimit - 0.01)) - sameTwoD->GetYaxis()->FindBin(etaLimit + 0.01) + 1;
6849 // printf("%f +- %f %f +- %f ", (*hist)->GetBinContent(1), (*hist)->GetBinError(1), tracksTmp->GetBinContent(1), tracksTmp->GetBinError(1));
6850 histTmp->Add(tracksTmp);
6851 // Printf(" --> %f +- %f", (*hist)->GetBinContent(1), (*hist)->GetBinError(1));
6854 histTmp->Scale(1.0 / etaBins);
6858 else if (twoD == 20)
6860 // calculate acc with 2 * (deta - 0.5 * deta*deta / 1.6)
6862 histTmp->Scale(0.75 / 0.25);
6864 histTmp->Scale(1.0 / 0.8);
6866 (*hist)->Add(histTmp, -1);
6870 // (*hist)->Rebin(2); (*hist)->Scale(0.5);
6872 //*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);
6875 str.Form("%.1f < p_{T,trig} < %.1f", ptBegin - 0.01, ptEnd + 0.01);
6878 str2.Form("%.2f < p_{T,assoc} < %.2f", gpTMin - 0.01, gpTMax + 0.01);
6881 newTitle.Form("%s - %s - %d-%d", str.Data(), str2.Data(), centralityBegin, centralityEnd);
6882 if (!useCentralityBinsDirectly)
6884 (*hist)->SetTitle(newTitle);
6888 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));
6890 //new TCanvas; (*hist)->DrawCopy(); histMixed->DrawCopy("SAME")->SetLineColor(2);
6892 Float_t totalPairs = (*hist)->Integral();
6894 (*hist)->Divide(histMixed);
6895 (*hist)->Scale(totalPairs / (*hist)->Integral());
6897 //(*hist)->DrawCopy("SAME")->SetLineColor(4);
6902 // calculate v2trigger
6903 h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
6904 ptDist = h->GetUEHist(2)->GetEventHist()->Project(step, 0);
6906 for (Int_t i=2; i<=((vn) ? 5 : 2); i++)
6907 vTrig[i-1] = CalculateFlow(ptDist, ptBegin, ptEnd, i, centralityBegin, centralityEnd);
6910 // calculate v2 assoc
6911 cont = h->GetUEHist(2)->GetTrackHist(0);
6912 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(step)->GetGrid()->GetAxis(3)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
6913 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(step)->GetGrid()->GetAxis(2)->SetRangeUser(ptBegin, ptEnd);
6914 ptDist = h->GetUEHist(2)->GetTrackHist(0)->Project(step, 1);
6916 for (Int_t i=2; i<=((vn) ? 5 : 2); i++)
6917 vAssoc[i-1] = CalculateFlow(ptDist, gpTMin, gpTMax, i, centralityBegin, centralityEnd);
6921 *v2 = vTrig[2-1] * vAssoc[2-1];
6923 for (Int_t i=2; i<=5; i++)
6924 vn[i-1] = vTrig[i-1] * vAssoc[i-1];
6928 void CompareNtrDist(const char* fileName1, const char* fileNameCentrality1)
6933 TCanvas *c1 = new TCanvas("c1", "", 1400, 1100);
6934 TCanvas *c2 = new TCanvas("c2", "", 1400, 1100);
6936 dndpt_central = ReadHepdata("/home/mkofarag/work/Project/2010/raa_dndpt_central.txt", kFALSE, 3);
6937 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
6938 AliUEHistograms* hc1 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality1);
6940 h1->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 5);
6941 ptDist1 = h1->GetUEHist(2)->GetEventHist()->Project(step, 0);
6942 ptDist1->Scale(1.0/1.8/TMath::TwoPi()/hc1->GetCentralityDistribution()->Integral(hc1->GetCentralityDistribution()->FindBin(0.01), hc1->GetCentralityDistribution()->FindBin(4.99)));
6943 for (Int_t i=1; i<=ptDist1->GetNbinsX(); i++)
6945 ptDist1->SetBinContent(i, ptDist1->GetBinContent(i)/ptDist1->GetBinWidth(i));
6947 for (Int_t i=0; i<dndpt_central->GetN();i++)
6949 Double_t x = dndpt_central->GetX()[i];
6950 Double_t y = dndpt_central->GetY()[i]*x;
6951 dndpt_central->SetPoint(i,x,y);
6953 ptDist2 = (TH1*) ptDist1->Clone("ptDist2");
6955 for (Int_t i=0; i<dndpt_central->GetN(); i++)
6959 width += (dndpt_central->GetX()[i] - dndpt_central->GetX()[i-1]) / 2;
6960 if (i < dndpt_central->GetN()-1)
6961 width += (dndpt_central->GetX()[i+1] - dndpt_central->GetX()[i]) / 2;
6962 if (i == 0 || i == dndpt_central->GetN() - 1)
6964 ptDist2->Fill(dndpt_central->GetX()[i],dndpt_central->GetY()[i]*width);
6966 for (Int_t i=1; i<=ptDist2->GetNbinsX(); i++)
6968 ptDist2->SetBinContent(i, ptDist2->GetBinContent(i)/ptDist2->GetBinWidth(i));
6969 ptDist2->SetBinError(i,0);
6971 /* for (Int_t i=1; i<=ptDist1->GetNbinsX(); i++)
6973 ptDist1->SetBinError(i,0);
6978 ptDist1->SetMarkerStyle(3);
6979 ptDist2->SetMarkerStyle(2);
6980 ptDist1->SetMarkerColor(2);
6981 ptDist2->SetMarkerColor(3);
6982 ptDist1->SetLineColor(2);
6983 ptDist2->SetLineColor(3);
6984 ptDist1->DrawCopy("EP");
6985 ptDist2->Draw("EPSAME");
6986 ptDist1->Divide(ptDist1,ptDist2);
6988 ptDist1->Draw("EP");
6992 void FitNtrDist(const char* fileName1, const char* fileNameCentrality1)
6997 TCanvas *c1 = new TCanvas("c1", "", 1400, 1100);
6998 TCanvas *c2 = new TCanvas("c2", "", 1400, 1100);
6999 TCanvas *c3 = new TCanvas("c3", "", 1400, 1100);
7001 dndpt_central = ReadHepdata("/home/mkofarag/work/Project/2010/raa_dndpt_central.txt", kFALSE, 3);
7002 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);
7003 TF1* func2 = new TF1("func2", "[0]*TMath::Power(x,-1*[1])",5,20);
7005 func1->SetParLimits(0, 2000, 5000);
7006 func1->SetParLimits(1, 1, 6);
7007 func1->SetParLimits(2, 7, 20);
7008 dndpt_central->Fit(func1,"RB","",0.5,5);
7010 func2->SetParLimits(0, 0, 1000);
7011 func2->SetParLimits(1, 4, 8);
7012 dndpt_central->Fit(func2,"RB","",5,20);
7017 dndpt_central->Draw("AP");
7018 func1->Draw("SAME");
7019 func2->Draw("SAME");
7021 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);
7022 TF1* func4 = new TF1("func4", "[0]*x*TMath::Power(x,-1*[1])",5,20);
7024 func3->FixParameter(0,func1->GetParameter(0));
7025 func3->FixParameter(1,func1->GetParameter(1));
7026 func3->FixParameter(2,func1->GetParameter(2));
7027 func4->FixParameter(0,func2->GetParameter(0));
7028 func4->FixParameter(1,func2->GetParameter(1));
7030 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
7031 AliUEHistograms* hc1 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality1);
7033 h1->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 5);
7034 ptDist1 = h1->GetUEHist(2)->GetEventHist()->Project(step, 0);
7035 ptDist1->Scale(1.0/1.8/TMath::TwoPi()/hc1->GetCentralityDistribution()->Integral(hc1->GetCentralityDistribution()->FindBin(0.01), hc1->GetCentralityDistribution()->FindBin(4.99)));
7036 ptDist2 = (TH1*) ptDist1->Clone("ptDist2");
7038 for (Int_t i=1; i<=ptDist1->GetNbinsX(); i++)
7040 ptDist1->SetBinContent(i, ptDist1->GetBinContent(i)/ptDist1->GetBinWidth(i));
7041 if (ptDist1->GetBinLowEdge(i)<5) ptDist2->SetBinContent(i, func3->Integral(ptDist1->GetBinLowEdge(i),ptDist1->GetBinLowEdge(i+1)));
7042 else ptDist2->SetBinContent(i, func4->Integral(ptDist1->GetBinLowEdge(i),ptDist1->GetBinLowEdge(i+1)));
7045 for (Int_t i=1; i<=ptDist2->GetNbinsX(); i++)
7047 ptDist2->SetBinContent(i, ptDist2->GetBinContent(i)/ptDist2->GetBinWidth(i));
7051 ptDist1->SetMarkerStyle(3);
7052 ptDist2->SetMarkerStyle(2);
7053 ptDist1->SetMarkerColor(2);
7054 ptDist2->SetMarkerColor(3);
7055 ptDist1->SetLineColor(2);
7056 ptDist2->SetLineColor(3);
7057 ptDist1->DrawCopy("EP");
7058 ptDist2->Draw("EPSAME");
7060 ptDist1->Divide(ptDist1,ptDist2);
7062 ptDist1->Draw("EP");
7065 void DrawNtrDist(const char* fileName1, const char* fileName2, const char* fileNameCentrality1, const char* fileNameCentrality2)
7071 new TCanvas("c", "", 1400, 1100);
7072 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
7073 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
7074 AliUEHistograms* hc1 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality1);
7075 AliUEHistograms* hc2 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality2);
7076 h1->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 10);
7077 h2->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 10);
7078 ptDist1 = h1->GetUEHist(2)->GetEventHist()->Project(step, 0);
7079 ptDist2 = h2->GetUEHist(2)->GetEventHist()->Project(step, 0);
7080 ptDist1->Scale(1/hc1->GetCentralityDistribution()->Integral(hc1->GetCentralityDistribution()->FindBin(0.01), hc1->GetCentralityDistribution()->FindBin(9.99)));
7081 ptDist2->Scale(1/hc2->GetCentralityDistribution()->Integral(hc2->GetCentralityDistribution()->FindBin(0.01), hc2->GetCentralityDistribution()->FindBin(9.99)));
7082 ptDist1->Divide(ptDist1,ptDist2);
7083 ptDist1->SetMarkerStyle(3);
7087 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)
7089 Printf("GetSumOfRatios | step %d | %d-%d%% | %.1f - %.1f GeV/c | %.1f - %.1f GeV/c", step, centralityBegin, centralityEnd, gpTMin, gpTMax, ptBegin, ptEnd);
7091 h = (AliUEHistograms*) hVoid;
7092 hMixed = (AliUEHistograms*) hMixedVoid;
7094 Int_t centralityBeginBin = 0;
7095 Int_t centralityEndBin = -1;
7097 if (!useCentralityBinsDirectly && centralityEnd >= centralityBegin)
7099 centralityBeginBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityBegin);
7100 centralityEndBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityEnd);
7102 else if (useCentralityBinsDirectly)
7104 centralityBeginBin = centralityBegin;
7105 centralityEndBin = centralityEnd;
7108 *hist = h->GetUEHist(2)->GetSumOfRatios2(hMixed->GetUEHist(2), step, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, normalizePerTrigger);
7111 str.Form("%.1f < p_{T,trig} < %.1f", ptBegin - 0.01, ptEnd + 0.01);
7114 str2.Form("%.2f < p_{T,assoc} < %.2f", gpTMin - 0.01, gpTMax + 0.01);
7117 newTitle.Form("%s - %s - %d-%d", str.Data(), str2.Data(), centralityBegin, centralityEnd);
7118 if (!useCentralityBinsDirectly)
7121 (*hist)->SetTitle(newTitle);
7124 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)
7128 Bool_t veryCentral = 0;
7129 Bool_t flowComparison = 0;
7130 Bool_t rhicOverlay = 0;
7131 Bool_t highStatBinning = 0;
7133 file = TFile::Open("dphi_corr.root", "RECREATE");
7136 Int_t leadingPtOffset = 1;
7138 if (veryCentral || flowComparison)
7140 Int_t maxLeadingPt = 2;
7141 Int_t maxAssocPt = 2;
7142 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
7143 //Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 4.0, 6.0, 10.0, 20.0, 40.0 };
7144 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
7146 else if (rhicOverlay) // RHIC binning
7148 Int_t maxLeadingPt = 4;
7149 Int_t maxAssocPt = 5;
7150 Float_t leadingPtArr[] = { 4.0, 5.0, 7.0, 9.0, 12.0 };
7151 Float_t assocPtArr[] = { 0.5, 1.0, 2.0, 3.0, 5.0, 7.0 };
7153 else if (highStatBinning)
7155 Int_t maxLeadingPt = 3;
7156 Int_t maxAssocPt = 2;
7157 Float_t leadingPtArr[] = { 4.0, 6.0, 8.0, 15.0 };
7158 Float_t assocPtArr[] = { 1.0, 4.0, 10.0 };
7160 else // ALICE binning
7162 if (1) // binning from preliminaries
7164 Int_t maxLeadingPt = 2;
7165 Int_t maxAssocPt = 7;
7166 // Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 10.0, 15.0 };
7167 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
7168 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7169 leadingPtOffset = 2;
7173 Int_t maxLeadingPt = 1;
7174 Int_t maxAssocPt = 4;
7175 Float_t leadingPtArr[] = { 8.0, 10.0, 15.0, 15.0 };
7176 Float_t assocPtArr[] = { 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7177 leadingPtOffset = 2;
7181 Int_t maxLeadingPt = 3;
7182 Int_t maxAssocPt = 3;
7183 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 20.0 };
7184 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7185 leadingPtOffset = 2;
7189 Int_t nCentralityBins = 5;
7190 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
7191 //Int_t centralityBins[] = { 1, 3, 5, 7, 9, 13 };
7193 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
7195 // h->SetZVtxRange(-0.5, 0.5);
7196 // h->SetZVtxRange(1.5, 2.5);
7198 AliUEHistograms* hMixed = 0;
7199 AliUEHistograms* hMixed2 = 0; // GetUEHistogram(fileName2, 0, kTRUE);
7203 hMixed = (AliUEHistograms*) GetUEHistogram(fileName1, 0, kTRUE);
7204 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileName2, 0, kTRUE);
7210 Printf("WARNING: Reading mixed event from preliminaries/corrected_110317.root");
7211 hMixed = (AliUEHistograms*) GetUEHistogram("preliminaries/corrected_110317.root", 0, kTRUE);
7214 AliUEHistograms* h2 = 0;
7216 h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
7219 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
7220 canvas->Divide(maxAssocPt, maxLeadingPt);
7222 TCanvas* canvas2 = new TCanvas("Centrality", "Centrality", 800, 600);
7223 centralityHist = (TH1*) h->GetCentralityDistribution();
7224 NormalizeToBinWidth(centralityHist);
7225 centralityHist->Draw();
7228 TLegend* legend = new TLegend(0.2, 0.5, 0.95, 0.90);
7229 TLegend* legend2 = new TLegend(0.5, 0.63, 0.95, 0.90);
7230 legend2->SetFillColor(0);
7231 legend2->SetTextSize(0.04);
7233 for (Int_t i=0; i<maxLeadingPt; i++)
7234 for (Int_t j=0; j<maxAssocPt; j++)
7237 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+leadingPtOffset]);
7242 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->SetRangeUser(0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7243 centralityHist = h->GetUEHist(2)->GetEventHist()->ShowProjection(1, 6);
7244 centralityHist->SetLineColor(i+2);
7245 NormalizeToBinWidth(centralityHist);
7246 centralityHist->DrawCopy("SAME");
7247 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->SetRangeUser(0, 0, -1);
7248 legend2->AddEntry(centralityHist, str);
7251 canvas->cd(j+1 + i * maxAssocPt);
7252 gPad->SetLeftMargin(0.15);
7253 gPad->SetBottomMargin(0.2);
7254 gPad->SetTopMargin(0.01);
7255 gPad->SetRightMargin(0.01);
7257 if (i == 0 && j == 3)
7260 gpTMin = assocPtArr[j] + 0.01;
7261 gpTMax = assocPtArr[j+1] - 0.01;
7264 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
7270 SetupRanges(h2); // SetEtaRange(0, 0) does not need to be called for the leading track result
7275 SetupRanges(hMixed);
7281 if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
7288 // 40-80% --> 11, 14
7291 TString hist1Str, hist2Str, hist2bStr;
7294 for (Int_t k=0; k<3; k++)
7306 GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist1Str = "0-2%";
7307 // GetDistAndFlow(h, hMixed, &hist2, v2, step, 1, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2Str = "1-3%";
7308 GetDistAndFlow(h, hMixed, &hist2b, v2+2, step, 30, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2bStr = "30-40%";
7310 //TH1* hist1 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 2); hist1Str = "0-2%";
7311 //TH1* hist2 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 2, 3); hist2Str = "2-3%";
7312 //TH1* hist2b = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, 10); hist2bStr = "30-40%";
7314 else if (flowComparison)
7316 TH1* hist1 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 5); hist1Str = "0-5%";
7317 TH1* hist2 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 10); hist2Str = "20-40%";
7318 TH1* hist2b = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, 10); hist2bStr = "30-40%";
7319 TH1* hist3 = 0; // h2->GetUEHist(2)->GetUEHist(0, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7321 else if (rhicOverlay)
7323 TH1* hist1 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 8); hist1Str = "0-20%";
7324 TH1* hist2 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 12); hist2Str = "20-60%";
7325 TH1* hist2b = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15);hist2bStr = "60-90%";
7326 TH1* hist3 = h2->GetUEHist(2)->GetUEHist(0, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7335 Bool_t equivMixedBin = 1;
7337 // histType = 20; Printf("WARNING: Using histogram type 20");
7339 // GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, vn[0]); hist1Str = "0-2%";
7340 // GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, vn[0]); hist1Str = "0-5%";
7341 GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin); hist1Str = "0-5%";
7348 GetDistAndFlow(h, hMixed, &histTmp1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, equivMixedBin); hist1Str = "0-5%";
7349 histTmp1->SetLineColor(2);
7350 histTmp1->Draw("SAME");
7351 histTmp1->Scale(1 / 0.75);
7354 GetDistAndFlow(h, hMixed, &histTmp1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 20, equivMixedBin); hist1Str = "0-5%";
7355 histTmp1->SetLineColor(4);
7356 histTmp1->Draw("SAME");
7357 histTmp1->Scale(1 / 0.75);
7360 GetDistAndFlow(h, hMixed, &histTmp1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 11, equivMixedBin); hist1Str = "0-5%";
7361 histTmp1->SetLineColor(3);
7362 histTmp1->Draw("SAME");
7363 histTmp1->Scale(1 / 0.25);
7368 GetDistAndFlow(h, hMixed, &hist2, v2+1, step, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin); hist2Str = "0-20%";
7369 // GetDistAndFlow(h, hMixed, &hist2b, v2[2], step, 60, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 0, equivMixedBin); hist2bStr = "60-80%";
7370 GetDistAndFlow(h, hMixed, &hist2b, v2+2, step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin); hist2bStr = "60-90%";
7372 Printf("%f %f %f", v2[0], v2[1], v2[2]);
7373 // Printf("%f %f %f", vn[0][1], vn[0][2], vn[0][3]);
7375 // TH1* hist1 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 8); hist1Str = "0-20%";
7376 // TH1* hist2 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 12); hist2Str = "20-60%";
7377 // TH1* hist2b = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15); hist2bStr = "60-90%";
7380 // TH1* hist3Old = h2->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7382 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin);
7383 // hist3->Rebin(2); hist3->Scale(0.5);
7387 hist3Old->DrawCopy("SAME")->SetLineColor(2); */
7391 RemoveBaseLine(hist1);
7392 RemoveBaseLine(hist2);
7393 RemoveBaseLine(hist2b);
7394 RemoveBaseLine(hist3);
7398 newTitle.Form("%s - %s", str.Data(), str2.Data());
7401 hist1->SetName(Form("dphi_%d_%d_%d", i, j, 0));
7402 hist1->SetTitle(newTitle + " - " + hist1Str);
7406 hist2->SetName(Form("dphi_%d_%d_%d", i, j, 1));
7407 hist2->SetTitle(newTitle + " - " + hist2Str);
7411 hist2b->SetName(Form("dphi_%d_%d_%d", i, j, 2));
7412 hist2b->SetTitle(newTitle + " - " + hist2bStr);
7416 hist3->SetName(Form("dphi_%d_%d_%d", i, j, 3));
7417 hist3->SetTitle(newTitle + " - pp");
7422 hist1->Scale(1.0 / hist1->Integral());
7423 hist2->Scale(1.0 / hist2->Integral());
7424 hist3->Scale(1.0 / hist3->Integral());
7427 if (i == 0 && j == 0)
7429 legend->SetFillColor(0);
7430 legend->AddEntry(hist1, "Pb+Pb 0-5%");
7432 legend->AddEntry(hist2, "Pb+Pb 20-40%");
7434 legend->AddEntry(hist2b, "Pb+Pb 60-90%");
7436 legend->AddEntry(hist3, "p+p 7 TeV");
7437 legend->SetTextSize(0.08);
7440 Prepare1DPlot(hist1);
7441 Prepare1DPlot(hist2);
7442 Prepare1DPlot(hist2b);
7443 Prepare1DPlot(hist3);
7445 Double_t yMin = 0.01;
7446 Double_t yMax2 = yMax;
7450 yMin = -0.01; //TMath::Min(hist1->GetMinimum(), hist2->GetMinimum()) * 0.97;
7451 yMax2 = TMath::Max((hist3) ? hist3->GetMaximum() : 0.0, TMath::Max(hist1->GetMaximum(), (hist2) ? hist2->GetMaximum() : 0.0)) * 1.03;
7456 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);
7457 dummy->SetStats(kFALSE);
7458 dummy->SetXTitle(hist1->GetXaxis()->GetTitle());
7459 dummy->SetYTitle(hist1->GetYaxis()->GetTitle());
7460 dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
7461 Prepare1DPlot(dummy);
7463 dummy->GetYaxis()->SetTitleOffset(0.8);
7465 dummy->GetXaxis()->SetLabelSize(0.08);
7466 dummy->GetYaxis()->SetLabelSize(0.08);
7467 dummy->GetXaxis()->SetTitleSize(0.08);
7468 dummy->GetYaxis()->SetTitleSize(0.08);
7470 dummy->GetYaxis()->SetTitleOffset(0.8);
7473 dummyTmp = dummy->DrawCopy();
7475 hist1->DrawCopy("SAME");
7479 SetupRanges(hMixed);
7480 // for HI file do not set range in eta anymore after it was changed to delta eta axis
7481 hMixed->SetEtaRange(0, 0);
7483 TH1* hist1Mixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 5);
7484 //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]);
7485 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);
7487 //hist1Mixed->Draw("SAME");
7490 hist2->SetLineColor(2);
7491 hist2->DrawCopy("SAME");
7493 TH1* hist2Mixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 10);
7494 //hist2Mixed->SetLineColor(2);
7495 //hist2Mixed->Draw("SAME");
7497 DrawFlow(v2[1], hist2, leadingPtArr[i], assocPtArr[j], hist2Mixed, i, 1, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
7498 //DrawFlow(GetFlow05(), hist2, leadingPtArr[i], assocPtArr[j], hist2Mixed);
7502 hist2b->SetLineColor(3);
7503 hist2b->DrawCopy("SAME");
7505 TH1* hist2bMixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15);
7506 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], hist2bMixed, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
7507 //DrawFlow(GetFlow05(), hist2b, leadingPtArr[i], assocPtArr[j], hist2bMixed);
7511 hist3->SetLineColor(4);
7512 hist3->DrawCopy("SAME");
7514 DrawFlow(0, hist3, leadingPtArr[i], assocPtArr[j], 0, i, 3, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
7516 //dummyTmp->GetYaxis()->SetRangeUser(0, 1.1 * TMath::Max(TMath::Max(hist1->GetMaximum(), hist2->GetMaximum()), hist2b->GetMaximum()));
7518 else // delta eta delta phi
7522 if (assocPtArr[j] > leadingPtArr[i])
7529 if (assocPtArr[jRef] > leadingPtArr[i])
7533 gpTMin = assocPtArr[jRef] + 0.01;
7534 gpTMax = assocPtArr[jRef+1] - 0.01;
7536 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
7538 // use j for centrality
7539 if (j >= nCentralityBins)
7542 centrBegin = centralityBins[j];
7543 centrEnd = centralityBins[j+1] - 1;
7547 // for HI file do not set range in eta anymore after it was changed to delta eta axis
7548 h->SetEtaRange(0, 0);
7550 SetupRanges(hMixed);
7551 // for HI file do not set range in eta anymore after it was changed to delta eta axis
7552 hMixed->SetEtaRange(0, 0);
7554 TH2* histSame = (TH2*) h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centrBegin, centrEnd, kTRUE);
7555 TH2* histMixed = (TH2*) hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centrBegin, centrEnd, kTRUE);
7558 histSame->Rebin2D(2, 2);
7559 histMixed->Rebin2D(2, 2);
7563 // fit delta eta, assuming no dependence on dphi
7565 //new TCanvas; histMixed->DrawCopy("SURF1");
7567 histMixedproj = histMixed->ProjectionY();
7568 histMixedproj->Scale(1.0 / histMixed->GetNbinsX());
7570 for (Int_t x=1; x<=histMixed->GetNbinsX(); x++)
7571 for (Int_t y=1; y<=histMixed->GetNbinsY(); y++)
7572 histMixed->SetBinContent(x, y, histMixedproj->GetBinContent(y));
7574 //new TCanvas; histMixed->DrawCopy("SURF1");
7577 histSame->SetStats(0);
7578 histSame->GetYaxis()->SetRangeUser(-1.5, 1.5);
7579 histSame->SetTitle("");
7580 histSame->Divide(histMixed);
7581 histSame->DrawCopy("SURF1");
7584 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
7585 latex = new TLatex(0.15, 0.95, str3);
7587 latex->SetTextSize(0.08);
7591 latex = new TLatex(0.55, 0.8, str);
7593 latex->SetTextSize(0.06);
7596 latex = new TLatex(0.55, 0.88, str2);
7598 latex->SetTextSize(0.06);
7601 // if (i == 0) return;
7604 canvas->SaveAs(Form("DeltaPhi_%.2f.png", yMax));
7610 //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]);
7613 void ExamplePhiEtaGap(const char* fileNamePbPb, const char* fileNamePbPbMix)
7617 if (!fileNamePbPbMix)
7618 fileNamePbPbMix = fileNamePbPb;
7620 Int_t leadingPtOffset = 1;
7622 Int_t maxLeadingPt = 4;
7623 Int_t maxAssocPt = 5;
7624 Float_t leadingPtArr[] = { 2.0, 3.0, 6.0, 6.0, 8.0, 10.0, 15.0, 20.0 };
7625 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7626 leadingPtOffset = 1;
7628 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb);
7629 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
7634 gpTMin = assocPtArr[j] + 0.01;
7635 gpTMax = assocPtArr[j+1] - 0.01;
7638 SetupRanges(hMixed);
7640 if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
7643 TString hist1Str, hist2Str, hist2bStr;
7652 Bool_t equivMixedBin = kTRUE;
7654 Int_t centralityBegin = 20;
7655 Int_t centralityEnd = 30;
7657 GetDistAndFlow(h, hMixed, &hist1, 0, step, centralityBegin, centralityEnd, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 20, equivMixedBin);
7659 GetDistAndFlow(h, hMixed, &hist2, 0, step, centralityBegin, centralityEnd, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, equivMixedBin);
7660 // hist2->Scale(1.0 / 0.8);
7662 GetDistAndFlow(h, hMixed, &hist3, 0, step, centralityBegin, centralityEnd, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 11, equivMixedBin);
7663 hist3->Scale(1.0 / 0.8);
7666 hist2->SetLineColor(2);
7667 hist2->Draw("SAME");
7668 hist3->SetLineColor(4);
7669 hist3->Draw("SAME");
7672 void ExampleDEtaDPhi(const char* fileNamePbPb, const char* fileNamePbPbMix)
7676 if (!fileNamePbPbMix)
7677 fileNamePbPbMix = fileNamePbPb;
7679 Int_t leadingPtOffset = 1;
7681 Int_t maxLeadingPt = 4;
7682 Int_t maxAssocPt = 5;
7683 Float_t leadingPtArr[] = { 1.0, 2.0, 3.0, 6.0, 6.0, 8.0, 10.0, 15.0, 20.0 };
7684 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 };
7685 leadingPtOffset = 1;
7687 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb);
7688 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
7693 gpTMin = assocPtArr[j] + 0.01;
7694 gpTMax = assocPtArr[j+1] - 0.01;
7697 SetupRanges(hMixed);
7702 GetSumOfRatios(h, hMixed, &hist1, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
7704 hist1->Draw("SURF1");
7707 Double_t GetEtaCut(TTree* analysisSettings)
7709 Double_t etaCut = 0;
7710 if (analysisSettings)
7712 analysisSettings->GetBranch("fTrackEtaCut")->SetAddress(&etaCut);
7713 analysisSettings->GetEntry(0);
7718 void PlotDeltaPhiEtaGap(const char* fileNamePbPb, const char* fileNamePbPbMix = 0, const char* fileNamepp = 0, const char* fileNamepp2 = 0, const char* outputFile = "dphi_corr.root")
7722 if (!fileNamePbPbMix)
7723 fileNamePbPbMix = fileNamePbPb;
7725 file = TFile::Open(outputFile, "RECREATE");
7728 Int_t leadingPtOffset = 1;
7730 Bool_t symmetrizePt = kFALSE;
7731 Int_t maxLeadingPt = 4;
7732 Int_t maxAssocPt = 6;
7735 //PbPb, NS peak shapes
7736 Float_t leadingPtArr[] = { 1.0, 2.0, 3.0, 4.0, 8.0, 15.0, 20.0 };
7737 // Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 8.0, 15.0, 20.0 };
7738 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 10.0, 12.0 };
7742 //Example for the Hadrons_Example wagon
7745 Float_t leadingPtArr[] = { 3.0, 5.0, 8.0, 16.0 };
7746 Float_t assocPtArr[] = {0.15, 0.3, 50.0, 0.5, 50.0, 1.0, 50.0 };
7750 //pA, trigger from all pT
7753 Float_t leadingPtArr[] = { 0.3, 4.0 };
7754 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 };
7755 // symmetrizePt = kTRUE;
7759 //pA, associated from all pT
7762 Float_t leadingPtArr[] = { 0.5, 1.0, 2.0, 3.0, 4.0, 0.5, 4.0 };
7763 Float_t assocPtArr[] = { 0.15, 0.5, 4.0 };
7764 // symmetrizePt = kTRUE;
7771 Float_t leadingPtArr[] = { 0.5, 1.0, 1.5, 2.0, 2.5, 4.0, 8.0, 15.0, 20.0 };
7772 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 1.5, 2.0, 2.5, 4.0, 8.0, 10.0, 12.0 };
7776 //pPb and PbPb with PID, with low pt points TPC only
7779 Float_t leadingPtArr[] = { 0.2, 0.3, 0.5 , 0.75, 1.0, 1.25, 1.5, 2.0, 2.5, 3., 4.0};
7780 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 };
7784 //PbPb for comaprison with You
7787 Float_t leadingPtArr[] = { 0.2, 0.3, 0.5 , 1.0, 1.5, 2.0, 2.5, 3., 4.0};
7788 Float_t assocPtArr[] = { 0.15, 0.2, 0.3, 0.5 , 1.0, 1.5, 2.0, 2.5, 3., 4.0 };
7795 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 };
7796 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 };
7803 Float_t leadingPtArr[] = { 0.5, 1.5, 2.5, 4.0, 5.0, 8.0, 15.0, 20.0 };
7804 Float_t assocPtArr[] = { 0.15, 0.5, 1.5, 2.5, 4.0, 5.0, 8.0, 10.0, 12.0 };
7808 //pA 2012; MC validation (also PbPb)
7811 Float_t leadingPtArr[] = { 0.5, 1.0, 2.0, 4.0, 8.0, 15.0, 20.0 };
7812 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 4.0, 8.0, 10.0, 12.0 };
7816 // pA, CMS ridge comparison
7819 Float_t leadingPtArr[] = { 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 15.0, 20.0 };
7820 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7826 Float_t leadingPtArr[] = { 2.0, 3.0};
7827 Float_t assocPtArr[] = {0.15, 0.5, 1.0, 2.0};
7829 else if (0) //Comparison to STAR (p_T,t)
7833 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 5.0, 6.0};
7834 Float_t assocPtArr[] = {0.15, 0.5, 1.5, 6.0};
7836 else if (0) //Comparison to STAR (p_T,a)
7840 Float_t leadingPtArr[] = { 3.0, 6.0};
7841 Float_t assocPtArr[] = {0.15, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0};
7847 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 8.0, 15.0 };
7848 Float_t assocPtArr[] = {0.15, 0.5, 1.0, 1.5, 2.0};
7852 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb, &list);
7853 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
7854 // hMixed3 = (AliUEHistograms*) hMixed->Clone();
7858 h->GetUEHist(2)->SymmetrizepTBins();
7859 hMixed->GetUEHist(2)->SymmetrizepTBins();
7863 AliUEHistograms* h2 = 0;
7864 AliUEHistograms* hMixed2 = 0;
7867 h2 = (AliUEHistograms*) GetUEHistogram(fileNamepp, &list2);
7868 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileNamepp, 0, kTRUE);
7872 AliUEHistograms* h3 = 0;
7873 AliUEHistograms* hMixed3 = 0;
7876 h3 = (AliUEHistograms*) GetUEHistogram(fileNamepp2, &list3);
7877 hMixed3 = (AliUEHistograms*) GetUEHistogram(fileNamepp2, 0, kTRUE);
7880 // h->GetUEHist(2)->SetGetMultCache();
7881 // hMixed->GetUEHist(2)->SetGetMultCache();
7883 TH2* refMultRaw = (TH2*) list->FindObject("referenceMultiplicity");
7886 // new TCanvas; refMultRaw->Draw("COLZ");
7887 Int_t nCentrBins = 4;
7888 Double_t centrBins[] = { 0., 20., 40., 60., 100. };
7889 // Double_t centrBins[] = { 0., 3., 10., 50., 100. };
7890 TH1* refMult = new TH1F("refMult", ";centrality;<Nch>", nCentrBins, centrBins);
7891 for (Int_t i=0; i<nCentrBins; i++)
7893 TH1* proj = refMultRaw->ProjectionY(Form("proj%d", i), refMultRaw->GetXaxis()->FindBin(centrBins[i] + 0.1), refMultRaw->GetXaxis()->FindBin(centrBins[i+1] - 0.1));
7894 // new TCanvas; proj->DrawClone();
7895 refMult->SetBinContent(refMult->GetXaxis()->FindBin(centrBins[i] + 0.1), proj->GetMean());
7896 refMult->SetBinError(refMult->GetXaxis()->FindBin(centrBins[i] + 0.1), proj->GetMeanError());
7897 Printf("Ref multiplicity for centrality %f to %f: %f", centrBins[i], centrBins[i+1], proj->GetMean());
7899 // new TCanvas; refMult->Draw();
7900 file = TFile::Open(outputFile, "UPDATE");
7906 tree = (TTree*) list->FindObject("UEAnalysisSettings");
7907 Double_t etaCut = GetEtaCut(tree);
7908 Printf("Setting eta cut to %f", etaCut);
7909 h->SetTrackEtaCut(etaCut);
7913 tree = (TTree*) list2->FindObject("UEAnalysisSettings");
7916 Double_t etaCut = GetEtaCut(tree);
7917 Printf("Setting eta cut to %f", etaCut);
7918 h2->SetTrackEtaCut(etaCut);
7922 Double_t etaCut = 0.9;
7923 Printf("WARNING: Setting eta cut to %f without checking", etaCut);
7924 h2->SetTrackEtaCut(etaCut);
7930 tree = (TTree*) list3->FindObject("UEAnalysisSettings");
7933 Double_t etaCut = GetEtaCut(tree);
7934 Printf("Setting eta cut to %f", etaCut);
7935 h3->SetTrackEtaCut(etaCut);
7939 Double_t etaCut = 0.9;
7940 Printf("WARNING: Setting eta cut to %f without checking", etaCut);
7941 h3->SetTrackEtaCut(etaCut);
7945 for (Int_t i=0; i<maxLeadingPt; i++)
7947 for (Int_t j=2; j<maxAssocPt; j++)
7950 if(j!=(i+1))continue;
7951 Printf("\nOnly symmetric pt bins selected, leading pt: %f - %f associated pt: %f - %f",leadingPtArr[i],leadingPtArr[i+leadingPtOffset],assocPtArr[j],assocPtArr[j+1]);
7954 gpTMin = assocPtArr[j] + 0.01;
7955 gpTMax = assocPtArr[j+1] - 0.01;
7957 if(gpTMin >= gpTMax)continue;
7960 SetupRanges(hMixed);
7962 SetupRanges(hMixed2);
7964 SetupRanges(hMixed3);
7965 // SetupRanges(hMixed3);
7967 if(1) if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
7979 Bool_t equivMixedBin = 1; //kFALSE; // TODO ?
7980 Bool_t scaleToPairs = kTRUE;
7988 Bool_t normalizePerTrigger = kFALSE; // don't do if histograms are to be merged -> Use MergeDPhiFiles below
7990 GetSumOfRatios(h, hMixed, &hist1, step, 0, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
7991 GetSumOfRatios(h, hMixed, &hist5, step, 10, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
7992 GetSumOfRatios(h, hMixed, &hist4, step, 20, 30, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
7993 GetSumOfRatios(h, hMixed, &hist6, step, 30, 50, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
7994 GetSumOfRatios(h, hMixed, &hist2, step, 50, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
7997 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8005 GetSumOfRatios(h, hMixed, &hist1, step, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8006 GetSumOfRatios(h, hMixed, &hist2, step, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8007 GetSumOfRatios(h, hMixed, &hist4, step, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8008 GetSumOfRatios(h, hMixed, &hist5, step, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8009 // GetSumOfRatios(h, hMixed, &hist7, step, 70, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8010 // GetSumOfRatios(h, hMixed, &hist8, step, 80, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8013 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8016 GetSumOfRatios(h3, hMixed3, &hist6, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8020 // pA, V0 as trigger particle detector
8023 h->GetUEHist(2)->SetSkipScaleMixedEvent(kTRUE);
8024 GetSumOfRatios(h, hMixed, &hist1, step, 0, 20, 1.01, 1.99, kTRUE);
8025 GetSumOfRatios(h, hMixed, &hist2, step, 20, 40, 1.01, 1.99, kTRUE);
8026 GetSumOfRatios(h, hMixed, &hist4, step, 40, 60, 1.01, 1.99, kTRUE);
8027 GetSumOfRatios(h, hMixed, &hist5, step, 60, 100, 1.01, 1.99, kTRUE);
8030 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8033 GetSumOfRatios(h3, hMixed3, &hist6, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8039 GetSumOfRatios(h, hMixed, &hist1, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8046 GetSumOfRatios(h, hMixed, &hist1, step, 4, 4, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8047 GetSumOfRatios(h, hMixed, &hist2, step, 3, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8048 GetSumOfRatios(h, hMixed, &hist4, step, 2, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8049 GetSumOfRatios(h, hMixed, &hist5, step, 1, 1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8053 // pA, course binning
8056 GetSumOfRatios(h, hMixed, &hist1, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8057 GetSumOfRatios(h, hMixed, &hist2, step, 0, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8058 GetSumOfRatios(h, hMixed, &hist4, step, 40, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8060 GetDistAndFlow(h, hMixed, &hist5, 0, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8062 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8066 // pA, CMS ridge paper comparison
8069 GetSumOfRatios(h, hMixed, &hist1, step, 0, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8070 GetSumOfRatios(h, hMixed, &hist2, step, 3, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8071 GetSumOfRatios(h, hMixed, &hist4, step, 10, 50, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8072 GetSumOfRatios(h, hMixed, &hist5, step, 50, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8073 GetSumOfRatios(h, hMixed, &hist7, step, 80, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8077 // pA, MC, validation binning
8078 GetSumOfRatios(h, hMixed, &hist1, 0, 0, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8079 GetSumOfRatios(h, hMixed, &hist5, 10, 0, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8083 // pA, MC, validation binning
8084 GetSumOfRatios(h, hMixed, &hist1, 0, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8085 GetSumOfRatios(h, hMixed, &hist2, 0, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8086 GetSumOfRatios(h, hMixed, &hist3, 0, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8087 GetSumOfRatios(h, hMixed, &hist4, 0, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8088 GetSumOfRatios(h, hMixed, &hist5, 10, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8089 GetSumOfRatios(h, hMixed, &hist6, 10, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8090 GetSumOfRatios(h, hMixed, &hist7, 10, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8091 GetSumOfRatios(h, hMixed, &hist8, 10, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8098 GetSumOfRatios(h, hMixed, &hist1, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8102 // pA, MC, validation binning, without vertex axis
8103 GetDistAndFlow(h, hMixed, &hist1, 0, 0, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8104 GetDistAndFlow(h, hMixed, &hist2, 0, 0, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8105 GetDistAndFlow(h, hMixed, &hist3, 0, 0, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8106 GetDistAndFlow(h, hMixed, &hist4, 0, 0, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8107 GetDistAndFlow(h, hMixed, &hist5, 0, 10, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8108 GetDistAndFlow(h, hMixed, &hist6, 0, 10, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8109 GetDistAndFlow(h, hMixed, &hist7, 0, 10, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8110 GetDistAndFlow(h, hMixed, &hist8, 0, 10, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8114 // PbPb, MC, impact parameter binning
8117 Printf(">>>>>>>> Not using GetSumOfRatios!!!");
8119 GetDistAndFlow(h, hMixed, &hist1, 0, step, 1, 6, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8120 GetDistAndFlow(h, hMixed, &hist5, 0, step, 7, 7, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8121 GetDistAndFlow(h, hMixed, &hist4, 0, step, 8, 8, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8122 GetDistAndFlow(h, hMixed, &hist6, 0, step, 9, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8123 GetDistAndFlow(h, hMixed, &hist2, 0, step, 11, 13, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8126 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8133 Printf(">>>>>>>> Not using GetSumOfRatios!!!");
8134 GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8135 // Printf("integral: %f", ((TH2*) hist1)->Integral(1, 36, 5, 36));
8138 GetDistAndFlow(h, hMixed, &hist5, 0, step, 10, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8139 GetDistAndFlow(h, hMixed, &hist4, 0, step, 20, 30, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8140 GetDistAndFlow(h, hMixed, &hist6, 0, step, 30, 50, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8141 GetDistAndFlow(h, hMixed, &hist2, 0, step, 50, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8144 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8145 // new TCanvas; hist3->DrawClone("SURF1");
8146 // GetDistAndFlow(hMixed2, 0, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8147 // new TCanvas; hist3->DrawClone("SURF1");
8148 // Printf("integral: %f", ((TH2*) hist3)->Integral(1, 36, 5, 36));
8151 //MC closure test in pA and PbPb with PID
8152 // GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8153 // GetDistAndFlow(h, hMixed, &hist2, 0, step, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8154 // GetDistAndFlow(h, hMixed, &hist4, 0, step, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8155 // GetDistAndFlow(h, hMixed, &hist5, 0, step, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8156 // GetDistAndFlow(h, hMixed, &hist7, 0, step, 80, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8157 // GetDistAndFlow(h, hMixed, &hist8, 0, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8163 GetSumOfRatios(h, hMixed, &hist1, step, 60, 70, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8164 GetSumOfRatios(h, hMixed, &hist2, step, 70, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8165 GetSumOfRatios(h, hMixed, &hist3, step, 80, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8171 GetSumOfRatios(h, hMixed, &hist1, step, 0, 1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8172 GetSumOfRatios(h, hMixed, &hist2, step, 1, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8173 GetSumOfRatios(h, hMixed, &hist4, step, 3, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8174 GetSumOfRatios(h, hMixed, &hist5, step, 5, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8175 GetSumOfRatios(h, hMixed, &hist6, step, 10, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8178 file = TFile::Open(outputFile, "UPDATE");
8182 hist1->SetName(Form("dphi_%d_%d_%d", i, j, 0));
8188 hist2->SetName(Form("dphi_%d_%d_%d", i, j, 1));
8194 hist4->SetName(Form("dphi_%d_%d_%d", i, j, 3));
8200 hist5->SetName(Form("dphi_%d_%d_%d", i, j, 4));
8206 hist7->SetName(Form("dphi_%d_%d_%d", i, j, 6));
8212 hist8->SetName(Form("dphi_%d_%d_%d", i, j, 7));
8218 hist6->SetName(Form("dphi_%d_%d_%d", i, j, 5));
8219 TString title(hist6->GetTitle());
8220 title.ReplaceAll("0--1%", "pp");
8221 hist6->SetTitle(title);
8227 hist3->SetName(Form("dphi_%d_%d_%d", i, j, 2));
8228 TString title(hist3->GetTitle());
8229 title.ReplaceAll("0--1%", "pp");
8230 hist3->SetTitle(title);
8248 TH1* triggers = h->GetUEHist(2)->GetTriggersAsFunctionOfMultiplicity(step, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
8249 triggers->SetName(Form("triggers_%d", i));
8251 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+leadingPtOffset]);
8252 triggers->SetTitle(str);
8254 file = TFile::Open(outputFile, "UPDATE");
8263 Int_t gMCBinning = -1;
8264 void ExtractNSPeakShapesMC(const char* fileNamePbPb, const char* fileNamepp = 0, const char* outputFile = "dphi_corr.root")
8268 file = TFile::Open(outputFile, "RECREATE");
8271 Int_t leadingPtOffset = 1;
8273 Int_t maxLeadingPt = 4;
8274 Int_t maxAssocPt = 6;
8276 //PbPb, NS peak shapes
8277 Float_t leadingPtArr[] = { 1.0, 2.0, 3.0, 4.0, 8.0, 15.0, 20.0 };
8278 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 10.0, 12.0 };
8281 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb, &list);
8282 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPb, 0, kTRUE);
8285 AliUEHistograms* h2 = 0;
8286 AliUEHistograms* hMixed2 = 0;
8289 h2 = (AliUEHistograms*) GetUEHistogram(fileNamepp, &list2);
8290 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileNamepp, 0, kTRUE);
8293 for (Int_t i=0; i<maxLeadingPt; i++)
8295 for (Int_t j=2; j<maxAssocPt; j++)
8297 gpTMin = assocPtArr[j] + 0.01;
8298 gpTMax = assocPtArr[j+1] - 0.01;
8300 if(gpTMin >= gpTMax)continue;
8303 SetupRanges(hMixed);
8305 SetupRanges(hMixed2);
8307 if(1) if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
8317 Bool_t equivMixedBin = 1;
8318 Bool_t scaleToPairs = kTRUE;
8321 if (gMCBinning == 1) // HIJING
8323 // PbPb, MC, impact parameter binning
8326 GetDistAndFlow(h, hMixed, &hist1, 0, step, 1, 6, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8327 GetDistAndFlow(h, hMixed, &hist5, 0, step, 7, 7, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8328 GetDistAndFlow(h, hMixed, &hist4, 0, step, 8, 8, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8329 GetDistAndFlow(h, hMixed, &hist6, 0, step, 9, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8330 GetDistAndFlow(h, hMixed, &hist2, 0, step, 11, 13, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8333 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8335 else if (gMCBinning == 2) // AMPT
8337 // PbPb, MC, impact parameter binning
8340 GetDistAndFlow(h, hMixed, &hist1, 0, step, 1, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8341 GetDistAndFlow(h, hMixed, &hist5, 0, step, 3, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8342 GetDistAndFlow(h, hMixed, &hist4, 0, step, 4, 4, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8343 GetDistAndFlow(h, hMixed, &hist6, 0, step, 5, 6, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8344 GetDistAndFlow(h, hMixed, &hist2, 0, step, 7, 9, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8347 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8350 file = TFile::Open(outputFile, "UPDATE");
8354 hist1->SetName(Form("dphi_%d_%d_%d", i, j, 0));
8360 hist2->SetName(Form("dphi_%d_%d_%d", i, j, 1));
8366 hist4->SetName(Form("dphi_%d_%d_%d", i, j, 3));
8372 hist5->SetName(Form("dphi_%d_%d_%d", i, j, 4));
8378 hist6->SetName(Form("dphi_%d_%d_%d", i, j, 5));
8384 hist3->SetName(Form("dphi_%d_%d_%d", i, j, 2));
8385 TString title(hist3->GetTitle());
8386 title.ReplaceAll("0--1%", "pp");
8387 hist3->SetTitle(title);
8406 void MergeDPhiFiles(const char* fileName, const char* fileName2, const char* target)
8408 // merges the dphi histograms (except the pp histogram at index "2") as well as the triggers
8409 // then divides the dphi histograms by the respective number of triggers
8411 file = TFile::Open(fileName);
8412 file2 = TFile::Open(fileName2);
8414 fileTarget = TFile::Open(target, "RECREATE");
8415 fileTarget->Close();
8417 Int_t maxLeadingPt = 10;
8418 Int_t maxAssocPt = 11;
8421 for (Int_t i=0; i<maxLeadingPt; i++)
8423 TH1* triggers = (TH1*) file->Get(Form("triggers_%d", i));
8427 TH1* triggers2 = (TH1*) ((file2) ? file2->Get(Form("triggers_%d", i)) : 0);
8429 Printf("WARNING: trigger %d missing", i);
8431 for (Int_t j=0; j<maxAssocPt; j++)
8433 for (Int_t histId = 0; histId < nHists; histId++)
8435 TH2* hist = (TH2*) file->Get(Form("dphi_%d_%d_%d", i, j, histId));
8438 TH2* hist2 = (TH2*) ((file2) ? file2->Get(Form("dphi_%d_%d_%d", i, j, histId)) : 0);
8440 Printf("WARNING: %d %d %d exists only in file2, not copied!");
8444 if (histId != 2) // don't merge pp
8446 TString title(hist->GetTitle());
8447 title.ReplaceAll("%", "");
8448 tokens = title.Tokenize("-");
8450 Float_t centralityBegin = ((TObjString*) tokens->At(2))->String().Atoi();
8451 Float_t centralityEnd = ((TObjString*) tokens->At(3))->String().Atoi();
8453 Double_t nTriggers = triggers->Integral(triggers->FindBin(centralityBegin + 0.001), triggers->FindBin(centralityEnd - 0.001));
8454 Double_t nTriggers2 = 0;
8456 TH2* hist2 = (TH2*) ((file2) ? file2->Get(Form("dphi_%d_%d_%d", i, j, histId)) : 0);
8457 if (hist2 && triggers2)
8459 if (histId != 1 && histId != 5) // don't merge 60-80% and 40-60%
8462 nTriggers2 = triggers2->Integral(triggers2->FindBin(centralityBegin + 0.001), triggers2->FindBin(centralityEnd - 0.001));
8466 Printf("WARNING: %d %d %d missing", i, j, histId);
8468 if (nTriggers + nTriggers2 > 0)
8469 hist->Scale(1.0 / (nTriggers + nTriggers2));
8471 Printf("%s %f %f %f %f", hist->GetTitle(), centralityBegin, centralityEnd, nTriggers, nTriggers2);
8474 fileTarget = TFile::Open(target, "UPDATE");
8476 fileTarget->Close();
8482 void ExtractMiniJetHistograms(const char* fileNamePbPb, Bool_t useMixed = kTRUE, const char* outputFile = "dphi_corr.root")
8486 file = TFile::Open(outputFile, "RECREATE");
8489 Int_t leadingPtOffset = 1;
8494 Int_t maxLeadingPt = 1;
8495 Int_t maxAssocPt = 1;
8496 Float_t leadingPtArr[] = { 0.7, 5.0 };
8497 Float_t assocPtArr[] = { 0.7, 5.0 };
8500 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb);
8501 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPb, 0, kTRUE);
8505 for (Int_t i=0; i<maxLeadingPt; i++)
8507 for (Int_t j=0; j<maxAssocPt; j++)
8511 gpTMin = assocPtArr[j] + 0.01;
8512 gpTMax = assocPtArr[j+1] - 0.01;
8515 SetupRanges(hMixed);
8517 if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
8522 // pA, minijets, very fine binning
8524 for (Int_t centr=0; centr<20; centr++)
8528 GetSumOfRatios(h, hMixed, &hist1, step, 5*centr, 5*centr+5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kFALSE);
8530 GetDistAndFlow(h, 0, &hist1, 0, step, 5*centr, 5*centr+5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 1, 0, kTRUE);
8535 file = TFile::Open(outputFile, "UPDATE");
8536 hist1->SetName(Form("dphi_%d_%d_%d", i, j, centr));
8545 TH1* triggers = h->GetUEHist(2)->GetTriggersAsFunctionOfMultiplicity(step, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
8546 triggers->SetName(Form("triggers_%d", i));
8548 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+leadingPtOffset]);
8549 triggers->SetTitle(str);
8551 file = TFile::Open(outputFile, "UPDATE");
8556 TH1* events = h->GetEventCount()->ProjectionY("events", h->GetEventCount()->GetXaxis()->FindBin(step), h->GetEventCount()->GetXaxis()->FindBin(step));
8557 file = TFile::Open(outputFile, "UPDATE");
8558 events->Write("events");
8562 TLatex* DrawLatex(Float_t x, Float_t y, Int_t color, const char* text, Float_t fontSize = 0.06)
8564 latex = new TLatex(x, y, text);
8566 latex->SetTextSize(fontSize);
8567 latex->SetTextColor(color);
8572 void DrawChi2NDF(TF1* func, TH1* hist, Float_t x, Float_t y, Int_t color = 1)
8576 for (Int_t i=hist->GetXaxis()->FindBin(-0.8); i<=hist->GetXaxis()->FindBin(0.8); i++)
8578 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);
8581 ndf -= func->GetNumberFreeParameters();
8583 printf("#chi^{2}/ndf = %.1f/%d = %.1f ", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF());
8584 Printf("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf);
8586 DrawLatex(x, y, color, Form("#chi^{2}/ndf = %.1f/%d = %.1f", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF()));
8587 DrawLatex(x, y - 0.05, color, Form("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf));
8590 void FitDeltaPhiEtaGap(TH1* hist, Int_t color, TGraphErrors* graph, Float_t x, Float_t yPosChi2)
8592 hist->SetLineColor(color);
8593 hist->DrawCopy("SAME");
8595 Bool_t twoGauss = kFALSE;
8598 func = new TF1("func", "[0]+gaus(1)");
8601 func = new TF1("func", "[0]+gaus(1)+gaus(4)");
8602 func->FixParameter(5, 0);
8603 func->SetParLimits(3, 0.1, 10);
8604 func->SetParLimits(6, 0.1, 10);
8605 func->SetParLimits(1, 0, 10);
8606 func->SetParLimits(4, 0, 10);
8609 func->SetParameters(0, 1, 0, 0.3, 1, 0, 1);
8610 func->FixParameter(2, 0);
8611 func->SetLineColor(color);
8613 hist->Fit(func, "", "SAME");
8614 // hist->Fit(func, "IM", "SAME");
8618 func2 = new TF1("func2", "[0]+gaus(1)", -1.5, 4.5);
8619 func2->SetParameters(func->GetParameter(0), func->GetParameter(1), func->GetParameter(2), func->GetParameter(3));
8620 func2->SetLineColor(color);
8621 func2->SetLineWidth(1);
8622 func2->SetLineStyle(2);
8623 func2->Draw("SAME");
8625 func2 = new TF1("func2", "[0]+gaus(1)", -1.5, 4.5);
8626 func2->SetParameters(func->GetParameter(0), func->GetParameter(4), func->GetParameter(5), func->GetParameter(6));
8627 func2->SetLineColor(color);
8628 func2->SetLineWidth(1);
8629 func2->SetLineStyle(2);
8630 func2->Draw("SAME");
8635 Bool_t firstIsMin = func->GetParameter(3) < func->GetParameter(6);
8637 Bool_t onlyOne = kFALSE;
8638 if (func->GetParameter(1) / func->GetParameter(4) < 0.1)
8640 firstIsMin = kFALSE;
8643 if (func->GetParameter(1) / func->GetParameter(4) > 10)
8649 graph->SetPoint(graph->GetN(), x - 0.1, func->GetParameter((firstIsMin) ? 3 : 6));
8650 graph->SetPointError(graph->GetN()-1, 0, func->GetParError((firstIsMin) ? 3 : 6));
8654 graph->SetPoint(graph->GetN(), x + 0.1, TMath::Abs(func->GetParameter((!firstIsMin) ? 3 : 6)));
8655 graph->SetPointError(graph->GetN()-1, 0, func->GetParError((!firstIsMin) ? 3 : 6));
8660 graph->SetPoint(graph->GetN(), x, TMath::Abs(func->GetParameter(3)));
8661 graph->SetPointError(graph->GetN()-1, 0, func->GetParError(3));
8664 DrawChi2NDF(func, hist, 0.5, yPosChi2, color);
8667 void AnalyzeDeltaPhiEtaGap(const char* fileName)
8669 TFile::Open(fileName);
8671 Int_t maxLeadingPt = 5;
8672 Int_t maxAssocPt = 6;
8674 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
8675 canvas->Divide(maxAssocPt, maxLeadingPt);
8677 TGraphErrors* width1 = new TGraphErrors;
8678 TGraphErrors* width2 = new TGraphErrors;
8679 TGraphErrors* width3 = new TGraphErrors;
8681 for (Int_t i=0; i<maxLeadingPt; i++)
8682 for (Int_t j=0; j<maxAssocPt; j++)
8684 canvas->cd(j+1 + i * maxAssocPt);
8685 gPad->SetLeftMargin(0.15);
8686 gPad->SetBottomMargin(0.2);
8687 gPad->SetTopMargin(0.01);
8688 gPad->SetRightMargin(0.01);
8690 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 0));
8691 hist2 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 1));
8692 hist3 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 2));
8697 TString tmpStr(hist1->GetTitle());
8698 tmpStr.ReplaceAll(" - ", "#");
8699 tokens = tmpStr.Tokenize("#");
8700 TString str(tokens->At(0)->GetName());
8701 TString str2(tokens->At(1)->GetName());
8703 Prepare1DPlot(hist1);
8704 Prepare1DPlot(hist2);
8705 Prepare1DPlot(hist3);
8708 hist1->Fit("pol0", "0", "", 1, 4);
8709 if (!hist1->GetFunction("pol0"))
8711 hist1->GetFunction("pol0")->SetRange(-10, 10);
8712 hist1->Add(hist1->GetFunction("pol0"), -1);
8714 hist3->Fit("pol0", "0", "", 1, 4);
8715 hist3->GetFunction("pol0")->SetRange(-10, 10);
8716 hist3->Add(hist3->GetFunction("pol0"), -1);
8718 Double_t yMin = 0.01;
8723 yMin = TMath::Min(hist1->GetMinimum(), hist2->GetMinimum()) * 0.97;
8724 yMax = TMath::Max(hist1->GetMaximum(), (hist2) ? hist2->GetMaximum() : 0.0) * 1.1;
8727 // yMin = hist1->GetMinimum() * 0.9;
8730 TH2F* dummy = new TH2F("dummy", "", 100, hist1->GetXaxis()->GetBinLowEdge(1), hist1->GetXaxis()->GetBinUpEdge(hist1->GetNbinsX()), 1000, yMin, yMax);
8731 dummy->SetStats(kFALSE);
8732 dummy->SetXTitle(hist1->GetXaxis()->GetTitle());
8733 dummy->SetYTitle(hist1->GetYaxis()->GetTitle());
8734 dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
8735 Prepare1DPlot(dummy);
8737 dummy->GetYaxis()->SetTitleOffset(0.8);
8739 dummy->GetXaxis()->SetLabelSize(0.08);
8740 dummy->GetYaxis()->SetLabelSize(0.08);
8741 dummy->GetXaxis()->SetTitleSize(0.08);
8742 dummy->GetYaxis()->SetTitleSize(0.08);
8744 dummy->GetYaxis()->SetTitleOffset(0.8);
8747 dummyTmp = dummy->DrawCopy();
8749 // TODO plot yield? baseline problematic?
8751 Float_t xPos = width1->GetN();
8754 FitDeltaPhiEtaGap(hist1, 1, width1, xPos, 0.7);
8755 FitDeltaPhiEtaGap(hist2, 4, width2, xPos, 0.5);
8756 FitDeltaPhiEtaGap(hist3, 2, width3, xPos, 0.6);
8758 latex = new TLatex(0.3, 0.8, str);
8760 latex->SetTextSize(0.06);
8763 latex = new TLatex(0.3, 0.88, str2);
8765 latex->SetTextSize(0.06);
8768 DrawLatex(0.8, 0.9, 1, "0-5%");
8769 DrawLatex(0.8, 0.85, 2, "60-90%");
8770 DrawLatex(0.8, 0.8, 4, "pp");
8777 width1->SetMarkerStyle(20);
8780 width2->SetMarkerStyle(24);
8781 width2->SetMarkerColor(4);
8782 width2->Draw("P SAME");
8784 width3->SetMarkerStyle(25);
8785 width3->SetMarkerColor(2);
8786 width3->Draw("P SAME");
8789 void CheckWing(const char* fileName)
8791 TFile::Open(fileName);
8793 Int_t maxLeadingPt = 4;
8794 Int_t maxAssocPt = 5;
8796 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
8797 canvas->Divide(maxAssocPt-1, maxLeadingPt);
8799 for (Int_t i=0; i<maxLeadingPt; i++)
8800 for (Int_t j=1; j<maxAssocPt; j++)
8802 canvas->cd(j + i * (maxAssocPt - 1));
8803 gPad->SetLeftMargin(0.15);
8804 gPad->SetBottomMargin(0.2);
8805 // gPad->SetTopMargin(0.01);
8806 gPad->SetRightMargin(0.01);
8808 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j+1, 0));
8813 // hist1->Draw("COLZ");
8815 Float_t width = 0.25;
8817 proj = ((TH2*) hist1)->ProjectionY(Form("%s_projx", hist1->GetName()), hist1->GetXaxis()->FindBin(TMath::Pi() - width),hist1->GetXaxis()->FindBin(TMath::Pi() + width));
8819 proj->GetXaxis()->SetRangeUser(-1.79, 1.79);
8820 proj->SetStats(kFALSE);
8823 proj2 = ((TH2*) hist1)->ProjectionY(Form("%s_proj2x", hist1->GetName()), hist1->GetXaxis()->FindBin(TMath::Pi() / 2 - width),hist1->GetXaxis()->FindBin(TMath::Pi() / 2 + width));
8825 proj2->GetXaxis()->SetRangeUser(-1.79, 1.79);
8826 proj2->SetLineColor(2);
8827 proj2->Draw("SAME");
8829 proj->SetMinimum(0.999 * proj2->GetMinimum());
8835 Int_t maxLeadingPt = 3;
8836 Int_t maxAssocPt = 3;
8838 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
8839 canvas->Divide(maxAssocPt, maxLeadingPt);
8841 // const char* fileNames[] = { "dphi_corr_allpt_zcentral_01.root", "dphi_corr_allpt_01.root" };
8842 // const char* fileNames[] = { "dphi_corr_allpt_zcentral.root", "dphi_corr_allpt.root" };
8843 // const char* fileNames[] = { "dphi_corr_allpt_zcentral.root", "dphi_corr.root" };
8844 // const char* fileNames[] = { "dphi_corr_allpt_01_zcentral.root", "dphi_corr_allpt_01_zsumofratios.root" };
8845 // const char* fileNames[] = { "dphi_corr_allpt_cfct_01_zcentral.root", "dphi_corr_allpt_cfct_01_zsumofratios.root" };
8846 // const char* fileNames[] = { "dphi_corr_2d.root", "dphi_corr.root" };
8847 // const char* fileNames[] = { "dphi_corr_2d_01.root", "dphi_corr.root" };
8848 // const char* fileNames[] = { "dphi_corr_2d.root", "dphi_corr_2d_vtxzcentral.root" };
8849 // const char* fileNames[] = { "dphi_corr_2d_01.root", , "dphi_corr_2d_01centr_zvtxcentral.root" };
8850 // const char* fileNames[] = { "dphi_corr_10k.root", "dphi_corr_50k.root" };
8851 // const char* fileNames[] = { "wing1.root", "wing2.root" };
8852 const char* fileNames[] = { "dphi_corr_2d_120112.root", "dphi_corr_2d_p2_111105.root" };
8854 for (Int_t i=0; i<maxLeadingPt; i++)
8855 for (Int_t j=0; j<maxAssocPt; j++)
8857 canvas->cd(j+1 + i * maxAssocPt);
8858 gPad->SetLeftMargin(0.15);
8859 gPad->SetBottomMargin(0.2);
8860 // gPad->SetTopMargin(0.01);
8861 gPad->SetRightMargin(0.01);
8864 for (Int_t fileId = 0; fileId < 2; fileId++)
8866 TFile::Open(fileNames[fileId]);
8868 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 3));
8873 // hist1->Draw("COLZ");
8875 Float_t width = 0.5;
8877 for (Int_t areaId = 0; areaId < 3; areaId++)
8879 Float_t center = TMath::Pi() / 2 * areaId;
8880 proj = ((TH2*) hist1)->ProjectionY(Form("%s_%d_%d_projx", hist1->GetName(), fileId, areaId), hist1->GetXaxis()->FindBin(center - width), hist1->GetXaxis()->FindBin(center + width));
8881 // proj->Rebin(2); proj->Scale(0.5);
8883 proj->GetXaxis()->SetRangeUser(-1.79, 1.79);
8884 proj->SetStats(kFALSE);
8885 proj->SetLineColor(fileId + 1 + areaId * 2);
8886 proj->Draw((fileId == 0 && areaId == 0) ? "" : "SAME");
8890 proj->Scale(1. / 12);
8892 first->SetMinimum(0.999 * TMath::Min(first->GetMinimum() / 0.999, proj->GetMinimum()));
8893 first->SetMaximum(1.001 * TMath::Max(first->GetMaximum() / 1.001, proj->GetMaximum()));
8899 void FitDeltaPhiEtaGap2D(TH2* hist, Bool_t scale, TVirtualPad* pad1, TVirtualPad* pad2, TVirtualPad* pad3, TGraphErrors* width1, TGraphErrors* width2, Float_t x, Float_t yPosChi2)
8901 Float_t etaLimit = 1.0;
8902 Float_t outerLimit = 1.8;
8904 TString histName(hist->GetName());
8906 TH1D* etaGap = hist->ProjectionX(histName + "_1", TMath::Max(1, hist->GetYaxis()->FindBin(-outerLimit + 0.01)), hist->GetYaxis()->FindBin(-etaLimit - 0.01));
8907 Int_t etaBins = hist->GetYaxis()->FindBin(-etaLimit - 0.01) - TMath::Max(1, hist->GetYaxis()->FindBin(-outerLimit + 0.01)) + 1;
8909 TH1D* tracksTmp = hist->ProjectionX(histName + "_2", hist->GetYaxis()->FindBin(etaLimit + 0.01), TMath::Min(hist->GetYaxis()->GetNbins(), hist->GetYaxis()->FindBin(outerLimit - 0.01)));
8910 etaBins += TMath::Min(hist->GetYaxis()->GetNbins(), hist->GetYaxis()->FindBin(outerLimit - 0.01)) - hist->GetYaxis()->FindBin(etaLimit + 0.01) + 1;
8912 etaGap->Add(tracksTmp);
8914 // get per bin result
8915 etaGap->Scale(1.0 / etaBins);
8917 // new TCanvas; etaGap->DrawCopy();
8919 histTmp2D = (TH2*) hist->Clone("histTmp2D");
8922 for (Int_t xbin=1; xbin<=histTmp2D->GetNbinsX(); xbin++)
8923 for (Int_t y=1; y<=histTmp2D->GetNbinsY(); y++)
8924 histTmp2D->SetBinContent(xbin, y, etaGap->GetBinContent(xbin));
8928 // mixed event does not reproduce away-side perfectly
8929 // --> extract scaling factor on the away-side from ratios of eta gap and central region
8930 TH1D* centralRegion = hist->ProjectionX(histName + "_3", hist->GetYaxis()->FindBin(-etaLimit + 0.01), hist->GetYaxis()->FindBin(etaLimit - 0.01));
8931 etaBins = hist->GetYaxis()->FindBin(etaLimit - 0.01) - hist->GetYaxis()->FindBin(-etaLimit + 0.01) + 1;
8932 centralRegion->Scale(1.0 / etaBins);
8934 // new TCanvas; centralRegion->DrawCopy(); etaGap->SetLineColor(2); etaGap->DrawCopy("SAME");
8935 centralRegion->Divide(etaGap);
8936 // new TCanvas; centralRegion->Draw();
8937 centralRegion->Fit("pol0", "0", "", TMath::Pi() - 1, TMath::Pi() + 1);
8938 Float_t scalingFactor = centralRegion->GetFunction("pol0")->GetParameter(0);
8939 Printf(" scalingFactor = %f", scalingFactor);
8940 histTmp2D->Scale(scalingFactor);
8943 // new TCanvas; hist->DrawCopy("SURF1");
8945 hist->Add(histTmp2D, -1);
8947 // new TCanvas; hist->DrawCopy("SURF1");
8949 hist->GetYaxis()->SetRangeUser(-1.59, 1.59);
8953 hist->DrawCopy("SURF1");
8955 Float_t min = hist->GetMinimum();
8956 Float_t max = hist->GetMaximum();
8958 // ranges are to exclude eta gap region from fit
8959 func = new TF2("func", "[0]+[1]*exp(-0.5*((x/[2])**2+(y/[3])**2))", -5, 5, -1, 1);
8960 func->SetParameters(0, 1, 0.3, 0.3);
8961 func->SetParLimits(1, 0, 10);
8962 func->SetParLimits(2, 0.1, 10);
8963 func->SetParLimits(3, 0.1, 10);
8965 hist->Fit(func, "0R", "");
8966 // hist->Fit(func, "IM", "SAME");
8969 funcHist = (TH2*) hist->Clone("funcHist");
8971 funcHist->Add(func);
8972 funcHist->SetMinimum(min);
8973 funcHist->SetMaximum(max);
8974 funcHist->Draw("SURF1");
8977 hist->Add(func, -1);
8978 hist->SetMinimum(min);
8979 hist->SetMaximum(max);
8980 hist->DrawCopy("SURF1");
8982 width1->SetPoint(width1->GetN(), x, TMath::Abs(func->GetParameter(2)));
8983 width1->SetPointError(width1->GetN()-1, 0, func->GetParError(2));
8985 width2->SetPoint(width2->GetN(), x, TMath::Abs(func->GetParameter(3)));
8986 width2->SetPointError(width2->GetN()-1, 0, func->GetParError(3));
8990 for (Int_t i=hist->GetXaxis()->FindBin(-0.8); i<=hist->GetXaxis()->FindBin(0.8); i++)
8991 for (Int_t j=hist->GetYaxis()->FindBin(-0.8); j<=hist->GetYaxis()->FindBin(0.8); j++)
8993 if (hist->GetBinError(i, j) > 0)
8995 chi2 += TMath::Power(hist->GetBinContent(i, j) / hist->GetBinError(i, j), 2);
8999 ndf -= func->GetNumberFreeParameters();
9001 printf("#chi^{2}/ndf = %.1f/%d = %.1f ", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF());
9002 Printf("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf);
9004 DrawLatex(0.5, yPosChi2, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF()));
9005 DrawLatex(0.5, yPosChi2 - 0.05, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf));
9008 Double_t DeltaPhiWidth2DFitFunction(Double_t *x, Double_t *par)
9010 // params: 0: gaussian amplitude, 1: phi width, 2: eta width
9011 // 3..bins+2 constants as fct of eta
9013 Int_t etaBin = (Int_t) ((x[1] + 2.0) / 0.1);
9015 return par[3+etaBin]+par[0]*TMath::Exp(-0.5*((x[0]/par[1])**2+(x[1]/par[2])**2));
9018 void FitDeltaPhi2DOneFunction(TH2* hist, TVirtualPad* pad1, TVirtualPad* pad2, TVirtualPad* pad3, TGraphErrors* width1, TGraphErrors* width2, Float_t x, Float_t yPosChi2)
9020 Float_t outerLimit = 1.8;
9022 hist->GetYaxis()->SetRangeUser(-1.59, 1.59);
9026 hist->DrawCopy("SURF1");
9028 Float_t min = hist->GetMinimum();
9029 Float_t max = hist->GetMaximum();
9031 Int_t bins = hist->GetNbinsX();
9033 // ranges are to exclude eta gap region from fit
9034 func = new TF2("func", DeltaPhiWidth2DFitFunction, -5, 5, -outerLimit, outerLimit, bins+3);
9035 func->SetParameters(1, 0.3, 0.3);
9036 for (Int_t i=3; i<bins+3; i++)
9037 func->SetParameter(i, 0);
9039 func->SetParLimits(0, 0, 10);
9040 func->SetParLimits(1, 0.1, 10);
9041 func->SetParLimits(2, 0.1, 10);
9043 hist->Fit(func, "0R", "");
9044 // hist->Fit(func, "IM", "SAME");
9047 funcHist = (TH2*) hist->Clone("funcHist");
9049 funcHist->Add(func);
9050 funcHist->SetMinimum(min);
9051 funcHist->SetMaximum(max);
9052 funcHist->Draw("SURF1");
9055 hist->Add(func, -1);
9056 hist->SetMinimum(min);
9057 hist->SetMaximum(max);
9058 hist->DrawCopy("SURF1");
9060 width1->SetPoint(width1->GetN(), x, TMath::Abs(func->GetParameter(1)));
9061 width1->SetPointError(width1->GetN()-1, 0, func->GetParError(1));
9063 width2->SetPoint(width2->GetN(), x, TMath::Abs(func->GetParameter(2)));
9064 width2->SetPointError(width2->GetN()-1, 0, func->GetParError(2));
9068 for (Int_t i=hist->GetXaxis()->FindBin(-0.8); i<=hist->GetXaxis()->FindBin(0.8); i++)
9069 for (Int_t j=hist->GetYaxis()->FindBin(-0.8); j<=hist->GetYaxis()->FindBin(0.8); j++)
9071 if (hist->GetBinError(i, j) > 0)
9073 chi2 += TMath::Power(hist->GetBinContent(i, j) / hist->GetBinError(i, j), 2);
9077 ndf -= func->GetNumberFreeParameters();
9079 printf("#chi^{2}/ndf = %.1f/%d = %.1f ", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF());
9080 Printf("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf);
9082 DrawLatex(0.5, yPosChi2, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF()));
9083 DrawLatex(0.5, yPosChi2 - 0.05, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf));
9086 void AnalyzeDeltaPhiEtaGap2D(const char* fileName, Int_t method)
9088 TFile::Open(fileName);
9090 Int_t maxLeadingPt = 5;
9091 Int_t maxAssocPt = 6;
9093 TGraphErrors* width1[4];
9094 TGraphErrors* width2[4];
9097 for (Int_t histId = 0; histId < nHists; histId++)
9099 width1[histId] = new TGraphErrors;
9100 width2[histId] = new TGraphErrors;
9101 for (Int_t i=0; i<maxLeadingPt; i++)
9103 TCanvas* canvas = new TCanvas(Form("DeltaPhi_%d_%d", histId, i), Form("DeltaPhi_%d_%d", histId, i), 1000, 1000);
9104 canvas->Divide(3, maxAssocPt);
9106 for (Int_t j=0; j<maxAssocPt; j++)
9108 for (Int_t k=1; k<=3; k++)
9110 canvas->cd(3 * j + k);
9111 gPad->SetLeftMargin(0.15);
9112 gPad->SetBottomMargin(0.2);
9113 gPad->SetTopMargin(0.01);
9114 gPad->SetRightMargin(0.01);
9117 // if (i != 1 || j != 2)
9120 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, histId));
9124 Float_t xPos = j*8+i;
9127 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);
9129 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);
9142 Int_t marker[] = { 20, 24, 25, 26 };
9143 Int_t colors[] = { 2, 2, 4, 6 };
9144 const char* labels[] = { "0-5%", "60-90%", "pp", "30-40%" };
9146 Bool_t found = kTRUE;
9147 c1 = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("width_phi");
9150 c1 = new TCanvas("width_phi", "width_phi", 800, 600);
9156 for (Int_t histId = 0; histId < nHists; histId++)
9158 width1[histId]->SetMarkerStyle(marker[histId]);
9159 width1[histId]->SetMarkerColor(colors[histId]);
9160 width1[histId]->Draw((histId == 0 && !found) ? "AP" : "PSAME");
9161 DrawLatex(0.7, 0.8 - 0.05 * histId, colors[histId], labels[histId]);
9165 c1 = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("width_eta");
9168 c1 = new TCanvas("width_eta", "width_eta", 800, 600);
9173 for (Int_t histId = 0; histId < nHists; histId++)
9175 width2[histId]->SetMarkerStyle(marker[histId]);
9176 width2[histId]->SetMarkerColor(colors[histId]);
9177 width2[histId]->Draw((histId == 0 && !found) ? "AP" : "PSAME");
9178 DrawLatex(0.7, 0.8 - 0.05 * histId, colors[histId], labels[histId]);
9183 void RemoveWing(const char* fileName, const char* outputFile)
9185 // 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
9187 file = TFile::Open(fileName);
9188 file2 = TFile::Open(outputFile, "RECREATE");
9191 Int_t maxLeadingPt = 10;
9192 Int_t maxAssocPt = 11;
9195 for (Int_t i=0; i<maxLeadingPt; i++)
9197 triggers = (TH1*) file->Get(Form("triggers_%d", i));
9200 file2 = TFile::Open(outputFile, "UPDATE");
9204 for (Int_t j=0; j<maxAssocPt; j++)
9206 for (Int_t histId = 0; histId < nHists; histId++)
9208 hist = (TH2*) file->Get(Form("dphi_%d_%d_%d", i, j, histId));
9212 Float_t width = 1.5;
9213 TH1* proj = hist->ProjectionY(Form("projx", hist->GetName()), hist->GetXaxis()->FindBin(TMath::Pi() - width), hist->GetXaxis()->FindBin(TMath::Pi()+ width));
9214 proj->Fit("pol0", "0");
9215 //new TCanvas; proj->DrawCopy();
9216 proj->Divide(proj->GetFunction("pol0"));
9217 //new TCanvas; proj->DrawCopy();
9218 //new TCanvas; hist->DrawCopy("SURF1");
9219 for (Int_t x=1; x<=hist->GetNbinsX(); x++)
9220 for (Int_t y=1; y<=hist->GetNbinsY(); y++)
9222 if (proj->GetBinContent(y) <= 0)
9224 hist->SetBinContent(x, y, hist->GetBinContent(x, y) / proj->GetBinContent(y));
9225 hist->SetBinError(x, y, hist->GetBinError(x, y) / proj->GetBinContent(y));
9227 //new TCanvas; hist->DrawCopy("SURF1");
9229 file2 = TFile::Open(outputFile, "UPDATE");
9237 void RemoveWingAllSpecies()
9239 const char* suffix[] = { "Hadrons", "Pions", "Kaons", "Protons" };
9240 TString baseName = "dphi_corr_LHC13bc_20130604_";
9242 for (Int_t i=0; i<4; i++)
9243 RemoveWing(baseName + suffix[i] + ".root", baseName + suffix[i] + "_wingremoved.root");
9246 void PlotPtDistributions(const char* fileName1, Int_t centrBegin = 1, Int_t centrEnd = 2)
9250 Int_t maxLeadingPt = 3;
9251 Float_t leadingPtArr[] = { 1.0, 10.0, 20.0, 40.0 };
9253 Int_t nCentralityBins = 5;
9254 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
9256 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
9258 TCanvas* canvas = new TCanvas("Pt", "Pt", 1000, 1000);
9259 canvas->Divide(2, maxLeadingPt+2);
9261 TLegend* legend = new TLegend(0.2, 0.2, 0.95, 0.90);
9262 legend->SetFillColor(0);
9263 legend->SetTextSize(0.08);
9265 TLegend* legendB = new TLegend(0.2, 0.2, 0.95, 0.90);
9266 legendB->SetFillColor(0);
9267 legendB->SetTextSize(0.08);
9269 TLegend* legend2 = new TLegend(0.2, 0.2, 0.95, 0.90);
9270 legend2->SetFillColor(0);
9271 legend2->SetTextSize(0.08);
9273 Int_t colors[] = { 1, 2, 4, 6 };
9274 Int_t markers[] = { 20, 21, 22, 23, 24, 25 };
9276 for (Int_t i=0; i<maxLeadingPt; i++)
9278 Double_t ptMin = leadingPtArr[i] + 0.01;
9279 //Double_t ptMax = leadingPtArr[i+1] - 0.01;
9280 Double_t ptMax = 39.99;
9283 str.Form("%.1f < p_{T,trig} < %.1f", ptMin - 0.01, ptMax + 0.01);
9285 canvas->cd(2*i+1+2);
9286 gPad->SetLeftMargin(0.15);
9287 gPad->SetBottomMargin(0.2);
9288 gPad->SetTopMargin(0.01);
9289 gPad->SetRightMargin(0.01);
9295 TH2F* dummy = new TH2F("dummy", "", 100, 1, 40, 100, 1e-5, 1e3);
9296 dummy->SetStats(kFALSE);
9297 dummy->SetXTitle("p_{T,assoc}");
9298 dummy->SetYTitle("");
9299 dummy->GetYaxis()->SetTitleOffset(1);
9300 Prepare1DPlot(dummy);
9302 dummy->GetXaxis()->SetLabelSize(0.06);
9303 dummy->GetYaxis()->SetLabelSize(0.06);
9304 dummy->GetXaxis()->SetTitleSize(0.06);
9305 dummy->GetYaxis()->SetTitleSize(0.06);
9308 Float_t phiRange[] = { 0, TMath::Pi() / 2, TMath::Pi() };
9309 const char* phiLabels[] = { "Towards", "Transverse", "Away" };
9311 for (Int_t j=0; j<3; j++)
9313 TH1* centralEta = 0;
9318 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);
9319 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);
9320 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);
9321 sideEta1->Add(sideEta2); // TODO can be done smarter? what about the errors?
9323 Prepare1DPlot(sideEta1);
9324 Prepare1DPlot(centralEta);
9326 centralEta->SetLineColor(colors[j]);
9327 sideEta1->SetLineColor(colors[j+1]);
9331 legend->AddEntry(centralEta->Clone(), Form("Jet, %s: |#eta| < 0.7, #phi ~ %.1f", phiLabels[j], phiRange[j]));
9332 legend->AddEntry(sideEta1->Clone(), Form("Ridge, %s: 0.7 < |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]));
9337 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);
9338 centralEta->Scale(0.5);
9339 centralEta->SetLineColor(colors[j+1]);
9341 Prepare1DPlot(centralEta);
9344 legend->AddEntry(centralEta->Clone(), Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]));
9347 canvas->cd(2*i+1+2);
9348 centralEta->DrawCopy("SAME");
9350 sideEta1->DrawCopy("SAME");
9352 centralEta->SetLineColor(colors[i]);
9353 centralEta->Scale(100.0 / centralEta->Integral());
9356 sideEta1->SetLineColor(colors[i]);
9357 sideEta1->Scale(100.0 / sideEta1->Integral());
9366 gPad->SetLeftMargin(0.15);
9367 gPad->SetBottomMargin(0.2);
9368 gPad->SetTopMargin(0.01);
9369 gPad->SetRightMargin(0.01);
9380 str3.Form("Jet, %s: |#eta| < 0.7, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9382 str3.Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9383 latex = new TLatex(0.2, 0.3, str3);
9385 latex->SetTextSize(0.08);
9390 legend2->AddEntry(centralEta->Clone(), str);
9392 centralEta->DrawCopy("SAME");
9396 canvas->cd(j*4+4+2);
9399 gPad->SetLeftMargin(0.15);
9400 gPad->SetBottomMargin(0.2);
9401 gPad->SetTopMargin(0.01);
9402 gPad->SetRightMargin(0.01);
9413 str3.Form("Ridge, %s: 0.7 < |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9415 str3.Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9416 latex = new TLatex(0.2, 0.3, str3);
9418 latex->SetTextSize(0.08);
9422 sideEta1->DrawCopy("SAME");
9427 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
9428 latex = new TLatex(0.2, 0.3, str3);
9430 latex->SetTextSize(0.08);
9432 latex2 = new TLatex(0.55, 0.8, str);
9434 latex2->SetTextSize(0.06);
9436 canvas->cd(2*i+1+2);
9450 TH1* GetNonSubtractedRHICYield(Int_t ptT, Int_t ptA, Int_t centrality)
9452 rhicFile = TFile::Open("rhic/postcorr_AuAu_iter6_ppg106final.root");
9454 corrFunc = (TH1*) rhicFile->Get(Form("pi0hdphi_%d_%d_%d_2", ptT, ptA, centrality));
9458 corrFunc->Scale(1.0 / corrFunc->Integral());
9460 corrFunc->Scale(TMath::TwoPi() / corrFunc->GetBinWidth(1));
9462 same = (TH1*) rhicFile->Get(Form("pi0hdphi_%d_%d_%d_0", ptT, ptA, centrality));
9463 Float_t nPairs = same->Integral();
9465 triggers = (TH1*) rhicFile->Get(Form("pi0pt_%d_%d", ptT, centrality));
9466 Float_t nTrigs = triggers->Integral();
9468 graph = (TGraph*) rhicFile->Get(Form("gS_%d_%d", ptT, centrality));
9470 Printf("%f %f %f %f", nPairs, nTrigs, nPairs / nTrigs, graph->GetY()[ptA]);
9472 corrFunc->Scale(nPairs / nTrigs);
9474 //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))));
9479 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4, 1.5 * TMath::Pi() - 0.4 };
9480 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4, TMath::Pi() / 2 + 0.4, 1.5 * TMath::Pi() };
9485 for (Int_t i=0; i<3; i++)
9487 corrFunc->Fit("pol0", "0Q", "", regionBegin[i], regionEnd[i]);
9488 func = corrFunc->GetFunction("pol0");
9491 sum += func->GetParameter(0) / func->GetParError(0) / func->GetParError(0);
9492 weight += 1. / func->GetParError(0) / func->GetParError(0);
9499 weight = TMath::Sqrt(1. / weight);
9501 corrFunc->Add(new TF1("func", "1", -5, 5), -sum);
9507 compHist = (TH1*) rhicFile->Get(Form("ptyMSMP_0_%d%d%d", ptT, ptA, centrality));
9508 compHist->DrawCopy("SAME");
9510 //compHist->Add((TF1*) compHist->GetListOfFunctions()->First());
9511 //compHist->DrawCopy("SAME");
9514 void DeltaPhiVsRHIC(Int_t rhicCentrality = 0, Int_t aliceCentrality = 0, Bool_t reduced = kFALSE)
9516 aliceFile = TFile::Open("alice_dphi_corr_rhicbinning.root");
9517 rhicFile = TFile::Open("rhic/postcorr_AuAu_iter6_ppg106final.root");
9519 Int_t maxLeadingPt = 4;
9520 Int_t maxAssocPt = 5;
9524 Int_t maxSelected = 4;
9525 Int_t selectedLead[] = { 0, 0, 2, 2 };
9526 Int_t selectedAssoc[] = { 1, 2, 3, 4 };
9528 maxLeadingPt = TMath::Sqrt(maxSelected);
9529 maxAssocPt = TMath::Sqrt(maxSelected);
9532 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
9533 canvas->Divide(maxAssocPt, maxLeadingPt);
9535 for (Int_t i=0; i<maxLeadingPt; i++)
9536 for (Int_t j=0; j<maxAssocPt; j++)
9538 Printf("%d %d", i, j);
9540 canvas->cd(j+1 + i * maxAssocPt);
9541 gPad->SetLeftMargin(0.15);
9542 gPad->SetBottomMargin(0.2);
9543 //gPad->SetTopMargin(0.01);
9544 gPad->SetRightMargin(0.01);
9551 iSel = selectedLead[j + i * maxAssocPt];
9552 jSel = selectedAssoc[j + i * maxAssocPt];
9555 //rhic = (TH1*) rhicFile->Get(Form("VptyMSMP_0_%d%d%d", iSel, jSel, rhicCentrality));
9556 rhic = GetNonSubtractedRHICYield(iSel, jSel, rhicCentrality);
9559 rhic->SetLineColor(2);
9560 rhic->SetMarkerStyle(1);
9562 alice = (TH1*) aliceFile->Get(Form("dphi_%d_%d_%d_fit_flat", iSel, jSel, aliceCentrality));
9566 // match near side yield
9569 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));
9571 Printf("%f", factor);
9572 rhic->Scale(factor);
9575 alice->SetLineColor(1);
9577 //alice->Rebin(36); rhic->Rebin(30);
9579 clone = alice->DrawCopy("");
9580 rhic->DrawCopy("SAME");
9582 //Printf("chi2 test: chi2/ndf = %f", alice->Chi2Test(rhic, "WW CHI2/NDF"));
9585 for (Int_t k=1; k<=rhic->GetNbinsX(); k++)
9587 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));
9592 Printf("chi2 test: chi2/ndf = %f", chi2);
9594 clone->GetYaxis()->SetRangeUser(TMath::Min(alice->GetMinimum(), rhic->GetMinimum()) * 1.1, TMath::Max(alice->GetMaximum(), rhic->GetMaximum()) * 1.1);
9596 for (Int_t bin=1; bin<=rhic->GetNbinsX(); bin++)
9598 Double_t aliceValue = alice->GetBinContent(alice->FindBin(rhic->GetXaxis()->GetBinCenter(bin)));
9599 if (aliceValue == 0)
9601 rhic->SetBinContent(bin, rhic->GetBinContent(bin) / aliceValue);
9602 rhic->SetBinError(bin, 0);
9608 rhic->SetLineColor(3);
9609 //rhic->DrawCopy("SAME");
9614 canvas->SaveAs("yield_comparison.png");
9617 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")
9619 // DeltaPhi("high_stat_binning_pp7_pt8.root", "high_stat_binning_pp7_pythia_pt8.root", 0, 1, 0, "pp 7 TeV uncorrected")
9620 // DeltaPhi("high_stat_binning_pp900_pt8.root", "high_stat_binning_pp900_pythia_pt8.root", 0, 1, 0, "pp 0.9 TeV uncorrected")
9624 aliceFile = TFile::Open(fileName);
9626 secondFile = TFile::Open(fileName2);
9630 Int_t maxLeadingPt = 3;
9631 Int_t maxAssocPt = 3;
9635 Int_t maxLeadingPt = 3;
9636 Int_t maxAssocPt = 7;
9641 Int_t maxSelected = 4;
9642 Int_t selectedLead[] = { 1, 1, 1, 1 };
9643 Int_t selectedAssoc[] = { 2, 3, 4, 5 };
9645 maxLeadingPt = TMath::Sqrt(maxSelected);
9646 maxAssocPt = TMath::Sqrt(maxSelected);
9649 factorGraph = new TGraphErrors;
9651 // TCanvas* canvas = new TCanvas(Form("%s_%s", fileName, fileName2 ? fileName2 : ""), Form("%s_%s", fileName, fileName2 ? fileName2 : ""), 600, 900);
9652 TCanvas* canvas = new TCanvas(Form("%s_%s", fileName, fileName2 ? fileName2 : ""), Form("%s_%s", fileName, fileName2 ? fileName2 : ""), 1000, 1000);
9653 canvas->Divide(maxAssocPt, maxLeadingPt);
9655 for (Int_t i=0; i<maxLeadingPt; i++)
9656 for (Int_t j=0; j<maxAssocPt; j++)
9659 TH1* peripheral = 0;
9660 for (Int_t aliceCentrality=0; aliceCentrality<4; aliceCentrality++)
9662 Printf("%d %d %d", i, j, aliceCentrality);
9664 if (aliceCentrality == 1)
9667 canvas->cd(j+1 + i * maxAssocPt);
9671 Int_t centralitySel = aliceCentrality;
9672 currentFile = aliceFile;
9676 iSel = selectedLead[j + i * maxAssocPt];
9677 jSel = selectedAssoc[j + i * maxAssocPt];
9685 if (aliceCentrality == 1)
9686 currentFile = secondFile;
9687 else if (aliceCentrality == 2)
9691 if (aliceCentrality == 3)
9692 currentFile = secondFile;
9695 //alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", iSel, jSel, centralitySel, (centralitySel < 3) ? "_tsallis_flat" : ((flatOrTsallis) ? "" : "_fit_flat")));
9696 alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", iSel, jSel, centralitySel, histName));
9702 Printf("WARNING: Applying some scaling and rebinning! Only for 2.76 data-MC comparison!");
9703 if (aliceCentrality == 0)
9705 alice->Rebin(2); alice->Scale(0.5);
9706 alice->Scale(1.0 / 1.6);
9709 // alice->Scale(1.6);
9712 alice->Rebin(2); alice->Scale(0.5);
9713 // alice->Scale(1.0 / 1.6);
9715 // match near side yield to peripheral
9716 if (1 && centralitySel == 3 && peripheral)
9718 if (mode == 0 || mode == 1)
9720 Double_t width = 0.5;
9721 Double_t error1, error2;
9722 Double_t integral1 = peripheral->IntegralAndError(peripheral->FindBin(-width), peripheral->FindBin(width), error1);
9723 Double_t integral2 = alice->IntegralAndError(alice->FindBin(-width), alice->FindBin(width), error2);
9726 Double_t tmpErr = 0;
9727 integral1 += peripheral->IntegralAndError(peripheral->FindBin(TMath::Pi() - width), peripheral->FindBin(TMath::Pi() + width), tmpErr);
9728 error1 = TMath::Sqrt(error1 * error1 + tmpErr * tmpErr);
9730 integral2 += alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), tmpErr);
9731 error2 = TMath::Sqrt(error2 * error2 + tmpErr * tmpErr);
9736 Double_t error1, error2;
9737 Double_t integral1 = peripheral->IntegralAndError(1, peripheral->GetNbinsX(), error1);
9738 Double_t integral2 = alice->IntegralAndError(1, alice->GetNbinsX(), error2);
9742 Double_t width = 1.0;
9743 Double_t error1, error2;
9744 Double_t integral1 = peripheral->IntegralAndError(peripheral->FindBin(TMath::Pi() - width), peripheral->FindBin(TMath::Pi() + width), error1);
9745 Double_t integral2 = alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), error2);
9748 Double_t factor = integral1 / integral2;
9750 //factor = 0.804 * 0.9;
9751 Printf("%f", factor);
9752 // alice->Scale(factor);
9753 factorGraph->SetPoint(factorGraph->GetN(), factorGraph->GetN(), factor);
9754 factorGraph->SetPointError(factorGraph->GetN() - 1, 0, factor * TMath::Sqrt(TMath::Power(error1 / integral1, 2) + TMath::Power(error2 / integral2, 2)));
9757 if (ppComparison && aliceCentrality == 0)
9759 else if (aliceCentrality == 2)
9762 // alice->SetYTitle("1/(N_{trig} #Delta#eta) dN_{assoc}/d#Delta#phi (1/rad)");
9763 alice->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi (1/rad)");
9764 alice->SetXTitle("#Delta#phi (rad)");
9765 alice->SetLineColor(aliceCentrality+1);
9766 alice->SetLineWidth(2);
9767 alice->SetMarkerColor(aliceCentrality+1);
9768 alice->GetYaxis()->SetTitleOffset(1.7);
9769 clone = alice->DrawCopy((aliceCentrality > 0) ? "SAME" : "");
9770 clone->SetTitle("");
9772 TString str(alice->GetTitle());
9773 str.ReplaceAll(" - ", "#");
9774 tokens = str.Tokenize("#");
9776 if (aliceCentrality == 0)
9778 for (Int_t k=0; k<2; k++)
9780 TString str(tokens->At(k)->GetName());
9781 str.ReplaceAll(".0", "");
9782 str.ReplaceAll("< p", "GeV/c < p");
9784 latex = new TLatex(0.48, 0.92-k*0.06, str);
9786 latex->SetTextSize(0.04);
9795 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), clone->GetMinimum()), TMath::Max(first->GetMaximum(), clone->GetMaximum()));
9802 //first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.2);
9803 first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.5);
9808 for (Int_t i=1; i<=6; i++)
9812 latex = new TLatex(0.58, 0.8, "ALICE preliminary");
9813 latex->SetTextSize(0.04);
9817 latex = new TLatex(0.58, 0.74, Form("%s", dataTag));
9818 latex->SetTextSize(0.04);
9822 latex = new TLatex(0.58, 0.68, "Stat. uncertainties only");
9823 latex->SetTextSize(0.04);
9827 latex = new TLatex(0.58, 0.62, "|#eta| < 0.8");
9828 latex->SetTextSize(0.04);
9834 legend = new TLegend(0.3, 0.8, 0.47, 0.95);
9835 legend->SetFillColor(0);
9836 legend->SetTextSize(0.04);
9837 legend->AddEntry(peripheral, "Data");
9838 legend->AddEntry(alice, "Pythia");
9842 DrawALICELogo(0.75, 0.47, 0.95, 0.6);
9846 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
9847 canvas->SaveAs(Form("%s.png", canvas->GetName()));
9850 peripheral->Divide(alice);
9851 peripheral->DrawCopy();
9852 //alice->DrawCopy("SAME");
9855 graphCanvas = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("graphCanvas");
9856 factorGraph->SetMarkerStyle(20);
9859 graphCanvas = new TCanvas("graphCanvas", "graphCanvas", 800, 600);
9860 factorGraph->Draw("AP");
9865 factorGraph->SetLineColor(2);
9866 factorGraph->SetMarkerColor(2);
9867 factorGraph->Draw("SAMEP");
9869 factorGraph->GetYaxis()->SetRangeUser(0.6, 1.4);
9871 factorGraph->Print();
9874 void ComparePPYields(const char* histName = "_fit_flat")
9876 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" };
9877 const char* titles[] = { "0.9 data", "0.9 Pythia", "2.76 Pythia", "7 Pythia", "7 data" };
9879 Int_t colors[] = { 1, 2, 3, 4, 6 };
9881 Int_t maxLeadingPt = 3;
9882 Int_t maxAssocPt = 2;
9884 TCanvas* canvas = new TCanvas("ComparePPYields", "ComparePPYields", 600, 900);
9885 canvas->Divide(maxAssocPt, maxLeadingPt);
9887 legend = new TLegend(0.5, 0.5, 0.8, 0.8);
9888 legend->SetFillColor(0);
9890 TGraphErrors** graphs = new TGraphErrors*[5];
9891 TGraphErrors** graphs2 = new TGraphErrors*[5];
9893 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
9895 graphs[nFiles] = new TGraphErrors;
9896 graphs2[nFiles] = new TGraphErrors;
9899 for (Int_t i=0; i<maxLeadingPt; i++)
9900 for (Int_t j=0; j<maxAssocPt; j++)
9902 canvas->cd(j+1 + i * maxAssocPt);
9903 gPad->SetLeftMargin(0.18);
9904 gPad->SetBottomMargin(0.1);
9905 gPad->SetTopMargin(0.01);
9906 gPad->SetRightMargin(0.01);
9910 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
9912 currentFile = TFile::Open(files[nFiles]);
9914 Int_t aliceCentrality = 3;
9916 Printf("%d %d %d", i, j, nFiles);
9918 alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, histName));
9922 alice->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
9923 alice->SetLineColor(colors[nFiles]);
9924 alice->SetMarkerColor(colors[nFiles]);
9925 alice->GetYaxis()->SetTitleOffset(1.7);
9926 clone = alice->DrawCopy((nFiles > 0) ? "SAME" : "");
9927 clone->SetTitle("");
9929 Double_t width = 0.7;
9930 Double_t error, error2;
9931 Double_t integral = alice->IntegralAndError(alice->FindBin(-width), alice->FindBin(width), error);
9932 Double_t integral2 = alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), error2);
9934 graphs[nFiles]->SetPoint(graphs[nFiles]->GetN(), j + i * maxAssocPt - 0.2, integral);
9935 graphs[nFiles]->SetPointError(graphs[nFiles]->GetN()-1, 0, error);
9937 graphs2[nFiles]->SetPoint(graphs2[nFiles]->GetN(), j + i * maxAssocPt + 0.2, integral2);
9938 graphs2[nFiles]->SetPointError(graphs2[nFiles]->GetN()-1, 0, error2);
9943 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), clone->GetMinimum()), TMath::Max(first->GetMaximum(), clone->GetMaximum()));
9947 TString str(alice->GetTitle());
9948 str.ReplaceAll(" - ", "#");
9949 tokens = str.Tokenize("#");
9951 for (Int_t k=0; k<2; k++)
9953 latex = new TLatex(0.6, 0.88-k*0.07, tokens->At(k)->GetName());
9955 latex->SetTextSize(0.04);
9960 if (i == 0 && j == 0)
9961 legend->AddEntry(clone, titles[nFiles]);
9964 first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.1);
9972 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
9974 graphs[nFiles]->SetMarkerStyle(25);
9975 graphs[nFiles]->SetLineColor(colors[nFiles]);
9976 graphs[nFiles]->SetMarkerColor(colors[nFiles]);
9977 clone2 = (TGraphErrors*) graphs[nFiles]->DrawClone((nFiles == 0) ? "AP" : "PSAME");
9978 clone2->GetYaxis()->SetRangeUser(0, 5);
9980 graphs2[nFiles]->SetMarkerStyle(26);
9981 graphs2[nFiles]->SetLineColor(colors[nFiles]);
9982 graphs2[nFiles]->SetMarkerColor(colors[nFiles]);
9983 graphs2[nFiles]->DrawClone("PSAME");
9987 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
9989 DivideGraphs(graphs[nFiles], graphs[4]);
9990 DivideGraphs(graphs2[nFiles], graphs2[4]);
9992 graphs[nFiles]->SetMarkerStyle(25);
9993 graphs[nFiles]->SetLineColor(colors[nFiles]);
9994 graphs[nFiles]->SetMarkerColor(colors[nFiles]);
9995 clone2 = (TGraphErrors*) graphs[nFiles]->DrawClone((nFiles == 0) ? "AP" : "PSAME");
9996 clone2->GetYaxis()->SetRangeUser(0, 1.5);
9998 graphs2[nFiles]->SetMarkerStyle(26);
9999 graphs2[nFiles]->SetLineColor(colors[nFiles]);
10000 graphs2[nFiles]->SetMarkerColor(colors[nFiles]);
10001 graphs2[nFiles]->DrawClone("PSAME");
10005 void DeltaPhiPreliminary(const char* fileName, const char* histName)
10009 currentFile = TFile::Open(fileName);
10011 TCanvas* canvas = new TCanvas(Form("dphi%s", histName), "dphi", 800, 800);
10012 canvas->Divide(2, 2);
10014 TLegend* legend = new TLegend(0.55, 0.47, 0.85, 0.65);
10015 legend->SetFillColor(0);
10016 legend->SetTextSize(0.04);
10018 Int_t colors[] = { 1, 2, 4, 6 };
10021 for (Int_t i=1; i<2; i++)
10022 for (Int_t j=2; j<6; j++)
10026 for (Int_t aliceCentrality=0; aliceCentrality<3; aliceCentrality+=2)
10028 Printf("%d %d %d", i, j, aliceCentrality);
10030 hist = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, histName));
10034 if (aliceCentrality == 3)
10035 hist->Scale(kPythiaScalingFactor);
10037 hist->GetYaxis()->SetTitleOffset(1.9);
10038 hist->SetLineColor(colors[aliceCentrality]);
10039 hist->SetMarkerColor(colors[aliceCentrality]);
10040 hist->SetLineWidth(2);
10041 hist->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
10042 hist->SetXTitle("#Delta#phi (rad)");
10044 clone = hist->DrawCopy((aliceCentrality > 0) ? "SAME" : "");
10045 clone->SetTitle("");
10047 TString str(hist->GetTitle());
10048 str.ReplaceAll(" - ", "#");
10049 tokens = str.Tokenize("#");
10050 hist->SetTitle("");
10052 if (aliceCentrality == 0)
10054 for (Int_t k=0; k<2; k++)
10056 TString str(tokens->At(k)->GetName());
10057 str.ReplaceAll(".0", "");
10058 str.ReplaceAll("< p", "GeV/c < p");
10061 latex = new TLatex(0.5, 0.88-k*0.06, str);
10063 latex->SetTextSize(0.04);
10067 latex = new TLatex(0.5, 0.76, "ALICE preliminary");
10068 latex->SetTextSize(0.04);
10072 latex = new TLatex(0.5, 0.70, "Stat. uncertainties only");
10073 latex->SetTextSize(0.04);
10077 clone->GetYaxis()->SetRangeUser(0, clone->GetMaximum() * 1.2);
10082 if (aliceCentrality == 3)
10083 legend->AddEntry(hist, "Pythia");
10085 legend->AddEntry(hist, tokens->At(2)->GetName());
10095 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10096 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10099 void DeltaPhiBaseLinePreliminary(const char* fileName)
10105 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
10106 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
10107 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
10113 gpTMin = assocPtArr[j] + 0.01;
10114 gpTMax = assocPtArr[j+1] - 0.01;
10118 str.Form("%.0f GeV/c < p_{T,trig} < %.0f GeV/c", leadingPtArr[i], leadingPtArr[i+2]);
10121 str2.Form("%.0f GeV/c < p_{T,assoc} < %.0f GeV/c", gpTMin - 0.01, gpTMax + 0.01);
10127 GetDistAndFlow(h, 0, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10128 GetDistAndFlow(h, 0, &hist2b, v2+2, step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10130 hist1->SetLineWidth(2);
10131 hist2b->SetLineWidth(2);
10133 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 1200, 1200);
10134 canvas->Divide(2, 2);
10137 // gPad->SetLeftMargin(0.20);
10139 hist1->GetYaxis()->SetTitleOffset(1.9);
10140 hist1->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
10141 hist1->SetXTitle("#Delta#phi (rad)");
10142 hist1->SetTitle("");
10143 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0, 0.59);
10145 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);
10147 latex = new TLatex(0.5, 0.78, "0-5%");
10149 latex->SetTextSize(0.04);
10155 // gPad->SetLeftMargin(0.20);
10157 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.18, 0.295);
10158 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10163 // gPad->SetLeftMargin(0.20);
10165 hist2b->GetYaxis()->SetTitleOffset(1.9);
10166 hist2b->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
10167 hist2b->SetXTitle("#Delta#phi (rad)");
10168 hist2b->SetTitle("");
10169 hist2b->DrawCopy();
10171 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);
10173 latex = new TLatex(0.5, 0.78, "60-90%");
10175 latex->SetTextSize(0.04);
10179 // gPad->SetLeftMargin(0.20);
10181 hist2b->DrawCopy()->GetYaxis()->SetRangeUser(0.01, 0.13);
10182 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10187 for (Int_t i=1; i<=4; i++)
10191 latex = new TLatex(0.5, 0.84, str);
10193 latex->SetTextSize(0.04);
10196 latex = new TLatex(0.5, 0.90, str2);
10198 latex->SetTextSize(0.04);
10201 latex = new TLatex(0.5, 0.72, "ALICE preliminary");
10202 latex->SetTextSize(0.04);
10206 latex = new TLatex(0.5, 0.66, "Stat. uncertainties only");
10207 latex->SetTextSize(0.04);
10212 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10213 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10217 void DeltaPhiBaseLinePaperPlot(const char* fileName, const char* yieldFile)
10221 Float_t fontSize = 0.08;
10222 Float_t titleOffset = 0.85;
10224 gStyle->SetTextSize(fontSize);
10225 gStyle->SetLabelSize(fontSize, "xy");
10226 gStyle->SetTitleSize(fontSize, "xy");
10227 gStyle->SetTitleOffset(titleOffset, "y");
10228 gStyle->SetHistLineWidth(2);
10229 gROOT->ForceStyle();
10233 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
10234 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
10235 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
10241 gpTMin = assocPtArr[j] + 0.01;
10242 gpTMax = assocPtArr[j+1] - 0.01;
10246 str.Form("%.0f GeV/#font[12]{c} < p_{t,trig} < %.0f GeV/#font[12]{c}", leadingPtArr[i], leadingPtArr[i+2]);
10249 str2.Form("%.0f GeV/#font[12]{c} < p_{t,assoc} < %.0f GeV/#font[12]{c}", gpTMin - 0.01, gpTMax + 0.01);
10255 GetDistAndFlow(h, 0, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10257 hist1->SetLineWidth(2);
10259 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 600, 840);
10260 canvas->Range(0, 0, 1, 1);
10262 pad1 = new TPad("pad1", "pad1", 0, 0.69, 1, 1);
10265 pad2 = new TPad("pad2", "pad2", 0, 0.38, 1, 0.69);
10268 pad3 = new TPad("pad3", "pad3", 0, 0 , 1, 0.38);
10272 gPad->SetMargin(0.15, 0.02, 0, 0.01);
10274 // hist1->GetYaxis()->SetTitleOffset(0.85);
10275 hist1->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#varphi");
10276 hist1->SetXTitle("#Delta#varphi (rad)");
10277 hist1->SetTitle("");
10279 hist1->SetLabelSize(fontSize * 0.38 / 0.31, "xy");
10280 hist1->SetTitleSize(fontSize * 0.38 / 0.31, "xy");
10281 hist1->SetTitleOffset(titleOffset / 0.38 * 0.31, "y");
10283 hist1->DrawCopy(); //->GetYaxis()->SetRangeUser(0, 0.59);
10285 //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);
10288 gPad->SetMargin(0.15, 0.02, 0, 0);
10290 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.381, 0.457);
10291 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10294 gPad->SetMargin(0.15, 0.02, 0.2, 0);
10296 // get zero subtracted plots
10297 TFile::Open(yieldFile);
10298 hist1sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 0));
10299 hist1sub->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#varphi");
10300 hist1sub->SetXTitle("#Delta#varphi (rad)");
10301 hist1sub->SetTitle("");
10302 hist1sub->DrawCopy();
10304 hist2sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 2));
10305 hist2sub->SetMarkerStyle(24);
10306 hist2sub->SetLineColor(2);
10307 hist2sub->SetMarkerColor(2);
10308 // hist2sub->SetMarkerSize(0.8);
10309 hist2sub->DrawCopy("SAMEP E X0");
10311 hist3sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 3));
10312 hist3sub->SetMarkerStyle(25);
10313 hist3sub->SetLineColor(4);
10314 hist3sub->SetMarkerColor(4);
10315 // hist3sub->SetMarkerSize(0.8);
10316 hist3sub->DrawCopy("SAMEP E X0");
10318 legend = new TLegend(0.4, 0.55, 0.9, 0.9);
10319 legend->SetFillColor(0);
10320 legend->SetBorderSize(0);
10321 legend->SetTextSize(0.08);
10322 legend->AddEntry(hist1sub, "Pb-Pb 0-5% centrality", "L");
10323 legend->AddEntry(hist2sub, "Pb-Pb 60-90% centrality", "P");
10324 legend->AddEntry(hist3sub, "pp", "P");
10329 latex = new TLatex(0.47, 0.85, str);
10330 latex->SetTextSize(fontSize * 0.38 / 0.31);
10334 latex = new TLatex(0.47, 0.73, str2);
10335 latex->SetTextSize(fontSize * 0.38 / 0.31);
10339 latex = new TLatex(0.5, 0.42, "0-5% centrality");
10343 latex = new TLatex(0.45, 0.62, "Stat. uncertainties only");
10347 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10348 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10352 void DeltaPhiBaseLinePaperPlot(const char* fileName, const char* yieldFile)
10356 Float_t fontSize = 0.08;
10357 Float_t titleOffset = 0.85;
10359 gStyle->SetTextSize(fontSize);
10360 gStyle->SetLabelSize(fontSize, "xy");
10361 gStyle->SetTitleSize(fontSize, "xy");
10362 gStyle->SetTitleOffset(titleOffset, "y");
10363 gStyle->SetHistLineWidth(2);
10364 gROOT->ForceStyle();
10368 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
10369 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
10370 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
10376 gpTMin = assocPtArr[j] + 0.01;
10377 gpTMax = assocPtArr[j+1] - 0.01;
10381 str.Form("%.0f < #font[12]{p}_{T,trig} < %.0f GeV/#font[12]{c}", leadingPtArr[i], leadingPtArr[i+2]);
10384 str2.Form("%.0f < #font[12]{p}_{T,assoc} < %.0f GeV/#font[12]{c}", gpTMin - 0.01, gpTMax + 0.01);
10390 GetDistAndFlow(h, 0, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10392 hist1->SetLineWidth(2);
10394 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 600, 840);
10395 canvas->Range(0, 0, 1, 1);
10397 pad1 = new TPad("pad1", "pad1", 0, 0.69, 1, 1);
10400 pad2 = new TPad("pad2", "pad2", 0, 0.38, 1, 0.69);
10403 pad3 = new TPad("pad3", "pad3", 0, 0 , 1, 0.38);
10407 gPad->SetMargin(0.15, 0.02, 0, 0.01);
10409 // hist1->GetYaxis()->SetTitleOffset(0.85);
10410 hist1->SetYTitle("");
10411 hist1->SetXTitle("#Delta#font[12]{#varphi} (rad)");
10412 hist1->SetTitle("");
10414 hist1->SetLabelSize(fontSize * 0.38 / 0.31, "xy");
10415 hist1->SetTitleSize(fontSize * 0.38 / 0.31, "xy");
10416 hist1->SetTitleOffset(titleOffset / 0.38 * 0.31, "y");
10418 hist1->DrawCopy("HISTE"); //->GetYaxis()->SetRangeUser(0, 0.59);
10420 //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);
10423 gPad->SetMargin(0.15, 0.02, 0, 0);
10425 hist1->SetYTitle("1/#font[12]{N}_{trig} d#font[12]{N}_{assoc}/d#Delta#font[12]{#varphi} (rad^{-1})");
10426 hist1->DrawCopy("HISTE")->GetYaxis()->SetRangeUser(0.381, 0.457);
10427 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10430 gPad->SetMargin(0.15, 0.02, 0.2, 0);
10432 // get zero subtracted plots
10433 TFile::Open(yieldFile);
10435 hist1sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 0));
10436 hist1sub->SetYTitle("");
10437 hist1sub->SetXTitle("#Delta#varphi (rad)");
10438 hist1sub->SetTitle("");
10439 // hist1sub->SetMarkerStyle(25);
10440 // hist1sub->SetLineColor(4);
10441 // hist1sub->SetMarkerColor(4);
10442 hist1sub->SetMaximum(0.79);
10443 hist1sub->DrawCopy("HIST E");
10445 hist3sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 3));
10446 // hist3sub->SetFillColor(4);
10447 // hist3sub->SetFillStyle(3354);
10448 // hist3sub->SetLineWidth(0);
10449 // hist3sub->SetLineColor(0);
10450 hist3sub->SetMarkerStyle(25);
10451 hist3sub->SetLineColor(4);
10452 hist3sub->SetMarkerColor(4);
10453 hist3sub->DrawCopy("SAME E X0");
10455 hist1sub->DrawCopy("SAME HIST E");
10457 hist2sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 2));
10458 hist2sub->SetMarkerStyle(24);
10459 hist2sub->SetLineColor(2);
10460 hist2sub->SetMarkerColor(2);
10461 hist2sub->DrawCopy("SAMEP E X0");
10463 legend = new TLegend(0.4, 0.45, 0.9, 0.8);
10464 legend->SetFillColor(0);
10465 legend->SetBorderSize(0);
10466 legend->SetTextSize(fontSize);
10467 legend->AddEntry(hist1sub, "Pb-Pb 0-5% centrality", "L");
10468 legend->AddEntry(hist2sub, "Pb-Pb 60-90% centrality", "P");
10469 legend->AddEntry(hist3sub, "pp", "P");
10474 latex = new TLatex(0.59, 0.70, str);
10475 latex->SetTextSize(fontSize * 0.38 / 0.31);
10479 latex = new TLatex(0.59, 0.58, str2);
10480 latex->SetTextSize(fontSize * 0.38 / 0.31);
10484 latex = new TLatex(0.59, 0.46, "#sqrt{#font[12]{s}_{NN}} = 2.76 TeV");
10485 latex->SetTextSize(fontSize * 0.38 / 0.31);
10489 latex = new TLatex(0.43, 0.90, "a) not background subtracted");
10490 latex->SetTextSize(fontSize * 0.38 / 0.31);
10494 latex = new TLatex(0.5, 0.42, "0-5% centrality");
10498 latex = new TLatex(0.45, 0.62, "Stat. uncertainties only");
10504 latex = new TLatex(0.43, 0.90, "b) zoomed");
10505 latex->SetTextSize(fontSize * 0.38 / 0.31);
10511 latex = new TLatex(0.43, 0.90, "c) background subtracted");
10516 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10517 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10521 void DeltaPhiRidgePreliminary(const char* fileName)
10527 Float_t leadingPtArr[] = { 2.0, 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
10528 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
10529 // Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
10530 // Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
10531 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE);
10532 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
10540 gpTMin = assocPtArr[j] + 0.01;
10541 gpTMax = assocPtArr[j+1] - 0.01;
10543 SetupRanges(hMixed);
10546 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+2]);
10549 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
10554 TH1* hist1Peak = 0;
10555 TH1* hist2bPeak = 0;
10556 TH1* hist1Ridge = 0;
10557 TH1* hist2bRidge = 0;
10560 TH1* hist2dMixed = 0;
10562 // GetDistAndFlow(h, 0, &hist2d, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 1);
10563 // GetDistAndFlow(hMixed, 0, &hist2dMixed, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 1);
10565 // //hist2d->Divide(hist2dMixed);
10566 // hist2dMixed->Draw("SURF1");
10568 GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10569 // GetDistAndFlow(h, 0, &hist2b, v2[2], step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10570 GetDistAndFlow(h, hMixed, &hist1Peak, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 10);
10572 GetDistAndFlow(h, hMixed, &hist1Ridge, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 11);
10576 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 800, 800);
10577 canvas->Divide(2, 2);
10580 gPad->SetLeftMargin(0.20);
10582 hist1->GetYaxis()->SetTitleOffset(1.9);
10583 hist1->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
10584 hist1->SetTitle("");
10587 hist1Peak->SetLineColor(2);
10588 hist1Peak->DrawCopy("SAME");
10590 hist1Ridge->SetLineColor(4);
10591 hist1Ridge->DrawCopy("SAME");
10593 // hist1Peak->Add(hist1Ridge);
10594 // hist1Peak->DrawCopy("SAME")->SetLineColor(3);
10598 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);
10600 latex = new TLatex(0.65, 0.84, str);
10602 latex->SetTextSize(0.04);
10605 latex = new TLatex(0.65, 0.90, str2);
10607 latex->SetTextSize(0.04);
10610 latex = new TLatex(0.84, 0.78, "0-5%");
10612 latex->SetTextSize(0.04);
10616 gPad->SetLeftMargin(0.20);
10618 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.18, 0.28);
10619 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10623 latex = new TLatex(0.5, 0.90, "ALICE preliminary");
10624 latex->SetTextSize(0.04);
10628 latex = new TLatex(0.5, 0.84, "Statistical uncertainties only");
10629 latex->SetTextSize(0.04);
10634 gPad->SetLeftMargin(0.20);
10636 hist2b->GetYaxis()->SetTitleOffset(1.9);
10637 hist2b->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
10638 hist2b->SetTitle("");
10639 hist2b->DrawCopy();
10641 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);
10643 latex = new TLatex(0.84, 0.78, "60-90%");
10645 latex->SetTextSize(0.04);
10649 gPad->SetLeftMargin(0.20);
10651 hist2b->DrawCopy()->GetYaxis()->SetRangeUser(0.01, 0.1);
10652 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10656 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10657 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10660 void MCScalingFactor(Int_t caseId)
10663 // x[5]=5, y[5]=0.813743, ex[5]=0, ey[5]=0.158446
10664 // x[5]=5, y[5]=1.09804, ex[5]=0, ey[5]=0.265434
10666 // x[5]=5, y[5]=1.02276, ex[5]=0, ey[5]=0.0199991
10667 // x[5]=5, y[5]=0.870247, ex[5]=0, ey[5]=0.0294444
10669 Float_t factors[] = { 0.814, 1.098, 1.022, 0.870 };
10670 Float_t errors[] = { 0.158, 0.265, 0.020, 0.029 };
10674 for (Int_t i=0; i<2; i++)
10679 avgs[i] = factors[2*i] / errors[2*i] / errors[2*i] + factors[2*i+1] / errors[2*i+1] / errors[2*i+1];
10680 avgs[i] /= 1. / errors[2*i] / errors[2*i] + 1. / errors[2*i+1] / errors[2*i+1];
10684 avgs[i] = factors[2*i];
10688 avgs[i] = factors[2*i+1];
10692 avgs[0] = factors[0];
10693 avgs[1] = factors[3];
10697 avgs[0] = factors[1];
10698 avgs[1] = factors[2];
10703 Float_t a = avgs[0];
10704 Float_t b = avgs[1];
10706 Printf("%f %f", a, b);
10708 Float_t linEx = a + (b-a)/(7.-0.9) * (2.76-0.9);
10709 Float_t logEx = a + (b-a)/(log(7.)-log(0.9)) * (log(2.76)-log(0.9));
10711 Printf("%f %f", linEx, logEx);
10714 void CompareDeltaPhi(const char* fileName1, const char* fileName2, Int_t centralityID, const char* dist = "_fit_flat", Bool_t reduced = kFALSE)
10716 firstFile = TFile::Open(fileName1);
10717 secondFile = TFile::Open(fileName2);
10719 Int_t maxLeadingPt = 2;
10720 Int_t maxAssocPt = 7;
10721 Int_t minLeadingPt = 0;
10722 Int_t minAssocPt = 0;
10732 TCanvas* canvas = new TCanvas(Form("%s %s", fileName1, fileName2 ? fileName2 : ""), Form("%s %s", fileName1, fileName2 ? fileName2 : ""), 1000, 700);
10733 canvas->Divide(maxAssocPt-minAssocPt, maxLeadingPt-minLeadingPt);
10735 for (Int_t i=minLeadingPt; i<maxLeadingPt; i++)
10736 for (Int_t j=minAssocPt; j<maxAssocPt; j++)
10738 Printf("%d %d", i, j);
10740 canvas->cd(j+1-minAssocPt + (i-minLeadingPt) * maxAssocPt);
10741 gPad->SetLeftMargin(0.15);
10742 gPad->SetBottomMargin(0.2);
10743 //gPad->SetTopMargin(0.01);
10744 gPad->SetRightMargin(0.01);
10746 hist1 = (TH1*) firstFile->Get(Form("dphi_%d_%d_%d%s", i, j, centralityID, dist));
10747 hist2 = (TH1*) secondFile->Get(Form("dphi_%d_%d_%d%s", i, j, centralityID, dist));
10752 /* hist1->Rebin(2); hist1->Scale(0.5);
10753 hist2->Rebin(2); hist2->Scale(0.5); */
10754 // hist1->Scale(1.6);
10756 hist1->SetLineColor(1);
10757 hist2->SetLineColor(2);
10759 hist1->DrawCopy()->GetYaxis()->SetRangeUser(hist1->GetMinimum(), hist1->GetMaximum() * 1.2);
10760 hist2->DrawCopy("SAME");
10762 /* if (strlen(dist) == 0)
10763 Printf("chi2 test: %f", hist1->Chi2Test(hist2, "UU NORM CHI2/NDF"));*/
10765 //DrawRatio(hist1, hist2, hist1->GetTitle());
10771 TH1* MACHCone(const char* fileName, Int_t centrality, const char* drawingOption, Bool_t plotContributions, Int_t twoD, TF1** flowFuncP = 0)
10775 TFile::Open("machcone_input.root");
10777 switch (centrality)
10780 hist = (TH1*) gFile->Get("dphi_0_0_0");
10784 hist = (TH1*) gFile->Get("dphi_1_1_0");
10788 hist = (TH1*) gFile->Get("dphi_0_0_2");
10792 hist = (TH1*) gFile->Get("dphi_1_1_2");
10800 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
10801 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
10803 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
10804 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
10805 // Float_t assocPtArr[] = { 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
10807 Int_t i = centrality % 2;
10812 gpTMin = assocPtArr[i] + 0.01;
10813 gpTMax = assocPtArr[i+1] - 0.01;
10815 Int_t centralityBegin = 0;
10816 Int_t centralityEnd = 1;
10818 if (centrality >= 2)
10820 centralityBegin = 30;
10821 centralityEnd = 40;
10825 SetupRanges(hMixed);
10835 Bool_t scaleToPairs = 0;
10837 GetDistAndFlow(h, hMixed, &hist, 0, step, centralityBegin, centralityEnd, leadingPtArr[j] + 0.01, leadingPtArr[j+1] - 0.01, twoD, kTRUE, vn, scaleToPairs);
10838 if (scaleToPairs && twoD == 11)
10841 Printf("%f %f %f", vn[2], vn[3], vn[4]);
10843 // mirror delta phi to improve stats
10846 for (Int_t bin=1; bin<=hist->GetNbinsX(); bin++)
10848 if (hist->GetBinCenter(bin) < 0 || hist->GetBinCenter(bin) > TMath::Pi())
10850 if (hist->GetBinCenter(bin) < 0)
10851 Int_t bin2 = hist->FindBin(-1.0 * hist->GetBinCenter(bin));
10853 Int_t bin2 = hist->FindBin(TMath::TwoPi() - hist->GetBinCenter(bin));
10855 Float_t combValue = hist->GetBinContent(bin) / hist->GetBinError(bin) / hist->GetBinError(bin) + hist->GetBinContent(bin2) / hist->GetBinError(bin2) / hist->GetBinError(bin2);
10857 Float_t weight = 1. / hist->GetBinError(bin) / hist->GetBinError(bin) + 1. / hist->GetBinError(bin2) / hist->GetBinError(bin2);
10858 combValue /= weight;
10860 Float_t combError = TMath::Sqrt(1.0 / weight);
10862 hist->SetBinContent(bin2, combValue);
10863 hist->SetBinError(bin2, combError);
10865 hist->SetBinContent(bin, combValue);
10866 hist->SetBinError(bin, combError);
10868 Printf("%d %d %f %f", bin, bin2, combValue, combError);
10874 TString str(hist->GetTitle());
10875 str.ReplaceAll(" - ", "#");
10876 tokens = str.Tokenize("#");
10877 hist->SetTitle("");
10879 hist->SetLineColor(1);
10880 hist->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
10881 hist->SetXTitle("#Delta#phi (rad)");
10882 hist = (TH1*) hist->Clone();
10883 if (!drawingOption)
10886 hist = hist->DrawCopy(drawingOption);
10888 for (Int_t i=0; i<tokens->GetEntries()-1; i++)
10890 if (centrality == 1)
10891 latex = new TLatex(0.6, 0.9 - i*0.05 - gPad->GetTopMargin(), tokens->At(i)->GetName());
10893 latex = new TLatex(0.6, 0.12 - i*0.05, tokens->At(i)->GetName());
10896 latex->SetTextSize(0.04);
10900 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());
10901 //flowFunc->SetLineWidth(1);
10902 flowFunc->SetLineColor(2);
10903 flowFunc->SetLineStyle(2);
10904 for (Int_t i=0; i<4; i++)
10905 flowFunc->FixParameter(i+1, vn[i+1]);
10906 //flowFunc->SetParameter(0, 84.95); flowFunc->DrawClone("SAME");
10908 //flowFunc->SetParameter(0, 85.4); flowFunc->DrawClone("SAME");
10909 //flowFunc->SetParameter(0, 85.6); flowFunc->DrawClone("SAME");
10911 // hist->Fit(flowFunc, "", "SAME", 1.8, 4.5);
10912 hist->Fit(flowFunc, "N", "", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
10913 hist->GetYaxis()->SetRangeUser(hist->GetMinimum() * 0.95, hist->GetMaximum() * 1.05);
10914 flowFunc->SetRange(-0.5 * TMath::Pi(), 1.5 * TMath::Pi());
10915 flowFunc->Draw("SAME");
10918 *flowFuncP = flowFunc;
10920 //hist->GetYaxis()->SetRangeUser(84, 89);
10921 //flowFunc->SetParameter(4, 1);
10925 for (Int_t bin=hist->FindBin(1.8); bin<=hist->FindBin(4.5); bin++)
10927 chi2 += TMath::Power((hist->GetBinContent(bin) - flowFunc->Eval(hist->GetBinCenter(bin))) / hist->GetBinError(bin), 2);
10929 //Printf("%f", TMath::Power((hist->GetBinContent(bin) - flowFunc->Eval(hist->GetBinCenter(bin))) / hist->GetBinError(bin), 2));
10934 Printf("chi2/ndf = %f", chi2);
10936 if (!plotContributions)
10939 for (Int_t n=1; n<=5; n++)
10941 flowFuncPart = new TF1("flowFuncPart", "[0] * (1+2*[1]*cos([2]*x))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
10942 flowFuncPart->SetParameters(flowFunc->GetParameter(0), vn[n-1], n);
10943 flowFuncPart->SetLineWidth(1);
10944 flowFuncPart->SetLineStyle(n);
10945 flowFuncPart->Draw("SAME");
10951 void MACHConeAll(const char* fileName)
10957 c = new TCanvas("c", "c", 300, 800);
10958 c->SetTopMargin(0);
10959 c->SetLeftMargin(0);
10960 c->SetRightMargin(0);
10961 c->SetBottomMargin(0);
10962 c->Divide(1, 2, 0, 0);
10964 Float_t rangesMin[] = { 136.1, 17.45, 18, 2.4 };
10965 Float_t rangesMax[] = { 139.4, 18.95, 23.5, 3.6 };
10967 for (Int_t i=0; i<2; i++)
10971 gPad->SetRightMargin(0.05);
10972 gPad->SetLeftMargin(0.20);
10973 gPad->SetTopMargin(0.15);
10974 gPad->SetBottomMargin(0.15);
10978 gPad->SetBottomMargin(0.01);
10982 gPad->SetTopMargin(0.01);
10983 gPad->SetBottomMargin(0.7);
10992 // hist = MACHCone(fileName, i, "", kTRUE, 0, &flowFunc);
10993 hist = (TH1*) MACHCone(fileName, i, 0, kFALSE, 0)->Clone("hist");
10994 hist->GetYaxis()->SetRangeUser(rangesMin[i], rangesMax[i]);
10995 hist->GetYaxis()->SetTitleOffset(1.7);
11001 // hist2 = MACHCone(fileName, i, 0, kFALSE, 11);
11002 hist2 = MACHCone(fileName, i, "SAME", kTRUE, 11, &flowFunc);
11003 //hist2->GetYaxis()->SetRangeUser(rangesMin[i], rangesMax[i]);
11004 // hist2->Scale(2);
11005 hist2->SetLineColor(4);
11006 //hist2->Draw("SAME");
11009 // sample flowFunc with same binning
11010 flowFuncHist = (TH1*) hist->Clone("flowFuncHist");
11011 flowFuncHist->Reset();
11013 for (Int_t i=1; i<=flowFuncHist->GetNbinsX(); i++)
11015 flowFuncHist->SetBinContent(i, flowFunc->Integral(flowFuncHist->GetXaxis()->GetBinLowEdge(i), flowFuncHist->GetXaxis()->GetBinUpEdge(i)));
11016 flowFuncHist->SetBinError(i, 0);
11021 flowFuncHist->Scale(1.0 / flowFuncHist->GetBinWidth(1));
11024 // flowFuncHist->Draw();
11025 // flowFunc->Draw("SAME");
11029 residuals = (TH1*) hist->Clone("res1");
11030 residuals->SetYTitle("Residuals");
11031 residuals->Divide(flowFuncHist);
11034 residuals->GetYaxis()->SetNdivisions(505);
11035 residuals->GetYaxis()->SetRangeUser(0.995, 1.005);
11037 residuals = (TH1*) hist2->Clone("res2");
11038 residuals->Divide(flowFuncHist);
11040 residuals->SetLineColor(4);
11041 residuals->Draw("SAME");
11047 legend = new TLegend(0.43, 0.66, 0.91, 0.82);
11048 legend->SetFillColor(0);
11049 legend->SetTextSize(0.034);
11050 legend->SetTextAlign(22);
11052 legend->SetHeader("Centrality 0-1%");
11053 legend->AddEntry(hist, "|#eta| < 0.8 & All #Delta#eta", "L");
11054 legend->AddEntry(hist2, "|#eta| < 0.8 & |#Delta#eta| > 0.8 (2x)", "L");
11060 c->SaveAs(Form("machcone_%d.png", 0));
11061 c->SaveAs(Form("machcone_%d.eps", 0));
11062 c->SaveAs(Form("machcone_%d.C", 0));
11067 MACHCone(3, "", kTRUE)->SetTitle("");
11070 hist1 = MACHCone(0, "", kFALSE);
11071 hist2 = MACHCone(1, "SAME", kFALSE);
11072 hist3 = MACHCone(2, "SAME", kFALSE);
11074 hist1->SetTitle("");
11075 hist1->GetYaxis()->SetRangeUser(1, 7);
11078 void SetFlowStyle()
11080 // Set style which will affect all plots.
11083 // gStyle->SetOptitle(0);
11084 // gStyle->SetOptStat(0);
11085 //gStyle->SetOptDate(1);
11086 // gStyle->SetPalette(8,0); // (1,0)
11087 gStyle->SetPalette(1); // (1,0)
11088 gStyle->SetDrawBorder(0);
11089 // gStyle->SetFillColor(0); // kills palete ???
11090 gStyle->SetCanvasColor(0);
11091 gStyle->SetPadColor(0);
11092 // gStyle->SetFillColor(0); // otherwize it affects Fill colors later
11093 gStyle->SetFrameFillColor(0);
11094 gStyle->SetCanvasBorderMode(0);
11095 gStyle->SetFrameLineWidth(2);
11096 // gStyle->SetFrameFillStyle(4000);
11097 gStyle->SetPadBorderMode(0);
11098 gStyle->SetPadTickX(1);
11099 gStyle->SetPadTickY(1);
11100 gStyle->SetPadBottomMargin(0.15);
11101 gStyle->SetPadLeftMargin(0.15);
11102 gStyle->SetHistLineWidth(2);
11103 gStyle->SetFuncWidth(2);
11104 gStyle->SetLineWidth(2);
11105 gStyle->SetLabelSize(0.05,"xyz");
11106 gStyle->SetLabelOffset(0.01,"y");
11107 gStyle->SetLabelColor(kBlack,"xyz");
11108 gStyle->SetTitleSize(0.06,"xyz");
11109 gStyle->SetTitleOffset(1.3,"y");
11110 gStyle->SetTitleFillColor(0);
11111 gStyle->SetLineWidth(2);
11112 gStyle->SetHistLineColor(1);
11113 gStyle->SetTextColor(1);
11114 gStyle->SetTitleTextColor(1);
11115 TGaxis::SetMaxDigits(4);
11116 gStyle->SetOptStat(0); // removes stat. box from all histos
11117 gROOT->ForceStyle();
11119 } // end of void SetFlowStyle()
11121 void PlotPtDistributionsSubtracted(const char* fileName1, Int_t centrBegin = 1, Int_t centrEnd = 6, Int_t fit = 0)
11125 Int_t nCentralityBins = 5;
11126 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
11128 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
11130 TCanvas* canvas = new TCanvas("Pt", "Pt", 1000, 1000);
11131 canvas->Divide(2, 2);
11133 TLegend* legend = new TLegend(0.3, 0.8, 0.99, 0.99);
11134 legend->SetFillColor(0);
11136 Int_t colors[] = { 1, 2, 4, 6, 3, 5 };
11137 Int_t markers[] = { 20, 21, 22, 23, 24, 25 };
11139 Double_t ptMin = 10.01;
11140 Double_t ptMax = 39.99;
11143 str.Form("%.1f < p_{T,trig} < %.1f", ptMin - 0.01, ptMax + 0.01);
11146 gPad->SetLeftMargin(0.15);
11147 gPad->SetBottomMargin(0.2);
11148 gPad->SetTopMargin(0.01);
11149 gPad->SetRightMargin(0.01);
11155 TH2F* dummy = new TH2F("dummy", "", 100, 1, 40, 100, 1e-5, 1e3);
11156 dummy->SetStats(kFALSE);
11157 dummy->SetXTitle("p_{T,assoc}");
11158 dummy->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
11159 dummy->GetYaxis()->SetTitleOffset(1);
11160 Prepare1DPlot(dummy);
11162 dummy->GetXaxis()->SetLabelSize(0.05);
11163 dummy->GetYaxis()->SetLabelSize(0.05);
11164 dummy->GetXaxis()->SetTitleSize(0.05);
11165 dummy->GetYaxis()->SetTitleSize(0.05);
11169 gPad->SetLeftMargin(0.15);
11170 gPad->SetBottomMargin(0.2);
11171 gPad->SetTopMargin(0.01);
11172 gPad->SetRightMargin(0.01);
11180 gPad->SetLeftMargin(0.15);
11181 gPad->SetBottomMargin(0.2);
11182 gPad->SetTopMargin(0.01);
11183 gPad->SetRightMargin(0.01);
11188 dummy = new TH2F("dummy2", "", 100, 1, 40, 100, 0, 100);
11189 dummy->SetStats(kFALSE);
11190 dummy->SetXTitle("p_{T,assoc}");
11191 dummy->SetYTitle("Ratio: Distribution / Inclusive");
11192 dummy->GetYaxis()->SetTitleOffset(1);
11193 Prepare1DPlot(dummy);
11194 dummy->GetXaxis()->SetLabelSize(0.05);
11195 dummy->GetYaxis()->SetLabelSize(0.05);
11196 dummy->GetXaxis()->SetTitleSize(0.05);
11197 dummy->GetYaxis()->SetTitleSize(0.05);
11201 gPad->SetLeftMargin(0.15);
11202 gPad->SetBottomMargin(0.2);
11203 gPad->SetTopMargin(0.01);
11204 gPad->SetRightMargin(0.01);
11211 // see GetAcceptanceScalingFactor
11212 Float_t scalingFactor = 0.328396; // 0.8
11213 //Float_t scalingFactor = 0.433268; // 0.7
11214 //Float_t scalingFactor = 0.895593; // 0.5 --> 1.6
11216 Float_t phiRange[] = { 0, TMath::Pi() / 2, TMath::Pi() };
11217 const char* phiLabels[] = { "Towards", "Transverse", "Away" };
11219 //Float_t phiSizeTowards = TMath::Pi() / 3;
11220 Float_t phiSizeTowards = 0.75;
11221 //Float_t etaLimit = 0.5;
11222 Float_t etaLimit = 0.8;
11224 towardsCentralEta = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, -etaLimit + 0.01, etaLimit - 0.01);
11225 towardsSideEta1 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, -1.59, -etaLimit - 0.01);
11226 TH1* towardsSideEta2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, etaLimit + 0.01, 1.59);
11227 towardsSideEta1->Add(towardsSideEta2); // TODO can be done smarter? what about the errors?
11229 Prepare1DPlot(towardsSideEta1);
11230 Prepare1DPlot(towardsCentralEta);
11232 towardsCentralEta->SetLineColor(colors[0]);
11233 towardsSideEta1->SetLineColor(colors[3]);
11234 //towardsSideEta1->SetLineStyle(2);
11236 legend->AddEntry(towardsCentralEta->Clone(), Form("Jet, %s: |#Delta#eta| < 0.8, #phi ~ %.1f", phiLabels[0], phiRange[0]));
11237 legend->AddEntry(towardsSideEta1->Clone(), Form("Ridge, %s: 0.8 < |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[0], phiRange[0]));
11239 // TODO update when data with new phi binning is available
11240 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);
11242 transverse2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, -0.5 * TMath::Pi(), -TMath::Pi() / 3, -1.59, 1.59, kTRUE);
11243 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);
11244 transverse->Add(transverse2);
11245 transverse->Add(transverse3);
11246 transverse->Scale(1.0 / (2.0 / 3 * TMath::Pi()));
11249 //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);
11250 //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);
11251 //transverseSideEta1->Add(transverseSideEta2); // TODO can be done smarter? what about the errors?
11253 transverse->SetLineColor(colors[2]);
11254 //transverseSideEta1->SetLineColor(colors[2]);
11255 //transverseSideEta1->SetLineStyle(2);
11257 Prepare1DPlot(transverse);
11258 //Prepare1DPlot(transverseSideEta1);
11259 legend->AddEntry(transverse->Clone(), Form("%s: |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[1], phiRange[1]));
11260 //legend->AddEntry(transverseSideEta1->Clone(), Form("%s: 0.8 < |#Delta #eta| < 1.6, #phi ~ %.1f", phiLabels[1], phiRange[1]));
11262 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);
11265 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);
11266 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);
11267 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);
11271 away->SetLineColor(colors[1]);
11272 //away3->SetLineColor(colors[1]);
11273 //away3->SetLineStyle(2);
11275 Prepare1DPlot(away);
11276 legend->AddEntry(away->Clone(), Form("%s: |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[2], phiRange[2]));
11278 //inclusive = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), -1.59, 1.59);
11281 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1)->SetRange(centrBegin, centrEnd);
11282 inclusive = h->GetUEHist(2)->GetEventHist()->ShowProjection(0, 6);
11283 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1)->SetRange(0, -1);
11286 axis = h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1);
11288 inclusiveTmp = h->GetCorrelationpT()->ProjectionY("inclusiveTmp", h->GetCorrelationpT()->GetXaxis()->FindBin(axis->GetBinLowEdge(centrBegin) + 0.01), h->GetCorrelationpT()->GetXaxis()->FindBin(axis->GetBinUpEdge(centrEnd) - 0.01));
11290 //rebin to match other histograms
11291 //inclusive2 = inclusive->Rebin(away->GetNbinsX(), "inclusive2", away->GetXaxis()->GetXbins()->GetArray());
11293 // manually, as usual the ROOT function makes a SEGV
11294 inclusive = (TH1*) away->Clone("inclusive");
11295 inclusive->Reset();
11296 inclusive->Sumw2();
11297 for (Int_t bin=1; bin<=inclusiveTmp->GetNbinsX(); bin++)
11298 inclusive->Fill(inclusiveTmp->GetBinCenter(bin), inclusiveTmp->GetBinContent(bin));
11300 for (Int_t bin=1; bin<=inclusive->GetNbinsX(); bin++)
11301 inclusive->SetBinError(bin, TMath::Sqrt(inclusive->GetBinContent(bin)));
11303 // normalization: events, phase space
11304 inclusive->Scale(1.0 / h->GetCentralityDistribution()->Integral(centrBegin, centrEnd));
11305 inclusive->Scale(1.0 / (TMath::TwoPi() * 0.8 * 2));
11308 for (Int_t i=1; i<=inclusive->GetNbinsX(); i++)
11310 inclusive->SetBinContent(i, inclusive->GetBinContent(i) / inclusive->GetXaxis()->GetBinWidth(i));
11311 inclusive->SetBinError (i, inclusive->GetBinError(i) / inclusive->GetXaxis()->GetBinWidth(i));
11314 Prepare1DPlot(inclusive);
11315 inclusive->SetLineColor(colors[4]);
11316 legend->AddEntry(inclusive->Clone(), "Inclusive");
11318 //Prepare1DPlot(away3);
11319 //legend->AddEntry(away3->Clone(), Form("%s: 0.8 < |#Delta #eta| < 1.6, #phi ~ %.1f", phiLabels[2], phiRange[2]));
11321 // scale for acceptance to match acceptance of towardsCentralEta
11322 towardsSideEta1->Scale(1.0 / scalingFactor); // contains only "side-eta"
11323 transverse->Scale(1.0 / (1.0 + scalingFactor)); // full eta
11324 away->Scale(1.0 / (1.0 + scalingFactor)); // full eta
11325 inclusive->Scale(1.0 / (1.0 + scalingFactor)); // full eta (phi scaling implicit)
11328 towardsCentralEtaClone = towardsCentralEta->DrawCopy("SAME");
11329 towardsSideEta1Clone = towardsSideEta1->DrawCopy("SAME");
11330 transverseClone = transverse->DrawCopy("SAME");
11331 //transverseSideEta1->DrawCopy("SAME");
11332 awayClone = away->DrawCopy("SAME");
11333 inclusiveClone = inclusive->DrawCopy("SAME");
11334 //inclusive2->DrawCopy("SAME");
11335 //away3->DrawCopy("SAME");
11339 towardsCentralEtaR = (TH1*) towardsCentralEta->Clone("towardsCentralEtaR");
11340 towardsSideEta1R = (TH1*) towardsSideEta1->Clone("towardsSideEta1R");
11341 transverseR = (TH1*) transverse->Clone("transverseR");
11342 awayR = (TH1*) away->Clone("awayR");
11344 towardsCentralEtaR->Divide(inclusive);
11345 towardsSideEta1R->Divide(inclusive);
11346 transverseR->Divide(inclusive);
11347 awayR->Divide(inclusive);
11349 towardsCentralEtaR->DrawCopy("SAME");
11350 towardsSideEta1R->DrawCopy("SAME");
11351 transverseR->DrawCopy("SAME");
11352 awayR->DrawCopy("SAME");
11358 awayClone->Fit("expo", "", "SAME", 1.1, 2.9);
11359 awayClone->GetFunction("expo")->SetRange(1, 10);
11366 func = new TF1("func", "[0] * x**[1]");
11367 func->SetParameters(1, 1);
11369 Float_t limitLow = 2.1;
11370 Float_t limitHigh = 4.9;
11372 func2 = (TF1*) func->Clone();
11373 towardsCentralEtaClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11374 towardsCentralEtaClone->GetFunction("func")->SetRange(1, 10);
11375 towardsCentralEtaClone->GetFunction("func")->SetLineColor(towardsCentralEtaClone->GetLineColor());
11377 func2 = (TF1*) func->Clone();
11378 towardsSideEta1Clone->Fit(func2, "", "SAME", limitLow, limitHigh);
11379 towardsSideEta1Clone->GetFunction("func")->SetRange(1, 10);
11380 towardsSideEta1Clone->GetFunction("func")->SetLineColor(towardsSideEta1Clone->GetLineColor());
11382 func2 = (TF1*) func->Clone();
11383 transverseClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11384 transverseClone->GetFunction("func")->SetRange(1, 10);
11385 transverseClone->GetFunction("func")->SetLineColor(transverseClone->GetLineColor());
11387 func2 = (TF1*) func->Clone();
11388 awayClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11389 awayClone->GetFunction("func")->SetRange(1, 10);
11390 awayClone->GetFunction("func")->SetLineColor(awayClone->GetLineColor());
11392 func2 = (TF1*) func->Clone();
11393 inclusiveClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11394 inclusiveClone->GetFunction("func")->SetRange(1, 10);
11395 inclusiveClone->GetFunction("func")->SetLineColor(inclusiveClone->GetLineColor());
11398 // subtract transverse part
11399 away->Add(transverse, -1);
11400 //away3->Add(transverseSideEta1, -1);
11401 towardsCentralEta->Add(transverse, -1);
11402 towardsSideEta1->Add(transverse, -1);
11403 //inclusive->Add(transverse, -1);
11406 towardsCentralEta->DrawCopy("SAME");
11407 towardsSideEta1->DrawCopy("SAME");
11408 away->DrawCopy("SAME");
11409 inclusive->DrawCopy("SAME");
11410 //away3->DrawCopy("SAME");
11414 towardsCentralEtaR = (TH1*) towardsCentralEta->Clone("towardsCentralEtaR2");
11415 towardsSideEta1R = (TH1*) towardsSideEta1->Clone("towardsSideEta1R2");
11416 awayR = (TH1*) away->Clone("awayR2");
11418 towardsCentralEtaR->Divide(inclusive);
11419 towardsSideEta1R->Divide(inclusive);
11420 awayR->Divide(inclusive);
11422 towardsCentralEtaR->DrawCopy("SAME");
11423 towardsSideEta1R->DrawCopy("SAME");
11424 awayR->DrawCopy("SAME");
11430 away->Fit("expo", "", "SAME", 1.1, 2.9);
11431 away->GetFunction("expo")->SetRange(1, 10);
11438 func = new TF1("func", "[0] * x**[1]");
11439 func->SetParameters(1, 1);
11441 func2 = (TF1*) func->Clone();
11442 towardsCentralEta->Fit(func2, "", "SAME", limitLow, limitHigh);
11443 func2->SetRange(1, 10);
11445 func2 = (TF1*) func->Clone();
11446 towardsSideEta1->Fit(func2, "", "SAME", limitLow, limitHigh);
11447 func2->SetRange(1, 10);
11449 func2 = (TF1*) func->Clone();
11450 away->Fit(func2, "", "SAME", limitLow, limitHigh);
11451 func2->SetRange(1, 10);
11453 func2 = (TF1*) func->Clone();
11454 inclusive->Fit(func2, "", "SAME", limitLow, limitHigh);
11455 func2->SetRange(1, 10);
11458 for (Int_t i=1; i<=2; i++)
11463 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
11464 latex = new TLatex(0.2, 0.3, str3);
11466 latex->SetTextSize(0.06);
11468 latex2 = new TLatex(0.55, 0.6, str);
11470 latex2->SetTextSize(0.06);
11479 void CombineDeltaPhiWithWeighting()
11483 // xsection: 11.879829, ntrials: 8132994.000000
11486 // xsection: 0.623421, ntrials: 2293420.000000
11489 // xsection: 0.043815, ntrials: 1314525.375000
11491 // TODO is merging only same event distribution at present
11496 const char* inputList[] = { "mergejob/LHC11a2a_110124.root", "mergejob/LHC11a2b_110131.root", "mergejob/LHC11a2c_110131.root" };
11498 Float_t xSections[] = { 11.879829 * 1e6 / 8132994, 0.623421 * 1e6 / 2293420, 0.043815 * 1e6 / 1314525 };
11499 xSections[2] /= xSections[0];
11500 xSections[1] /= xSections[0];
11501 xSections[0] /= xSections[0];
11503 AliUEHistograms* files[3];
11504 TList* finalList = 0;
11505 for (Int_t i=0; i<nInput; i++)
11507 files[i] = (AliUEHistograms*) GetUEHistogram(inputList[i], (i == 0) ? &finalList : 0);
11510 files[i]->Scale(xSections[i]);
11512 TList* list2 = new TList;
11513 list2->Add(files[i]);
11514 files[0]->Merge(list2);
11518 TFile* file3 = TFile::Open("out.root", "RECREATE");
11519 file3->mkdir("PWG4_PhiCorrelations");
11520 file3->cd("PWG4_PhiCorrelations");
11521 finalList->Write(0, TObject::kSingleKey);
11525 void NormalizeToBinWidth(TH1* hist)
11528 // normalizes a 1-d histogram to its bin width
11531 if (hist->GetDimension() == 1)
11533 for (Int_t i=1; i<=hist->GetNbinsX(); ++i)
11535 hist->SetBinContent(i, hist->GetBinContent(i) / hist->GetBinWidth(i));
11536 hist->SetBinError(i, hist->GetBinError(i) / hist->GetBinWidth(i));
11539 else if (hist->GetDimension() == 2)
11541 for (Int_t i=1; i<=hist->GetNbinsX(); ++i)
11543 for (Int_t j=1; j<=hist->GetNbinsY(); ++j)
11545 hist->SetBinContent(i, j, hist->GetBinContent(i, j) / hist->GetXaxis()->GetBinWidth(i) / hist->GetYaxis()->GetBinWidth(j));
11546 hist->SetBinError(i, j, hist->GetBinError(i) / hist->GetXaxis()->GetBinWidth(i) / hist->GetYaxis()->GetBinWidth(j));
11552 void GetAcceptanceScalingFactor(const char* fileName1, Float_t eta1 = 0.8, Float_t eta2 = 1.6)
11556 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1, 0, kTRUE);
11557 h->SetPtRange(1.01, 39.99);
11560 mixed = ((TH2*)h->GetUEHist(2)->GetUEHist(6, 0, 1.01, 39.99, 0, 16, kTRUE))->ProjectionY();
11563 Float_t left = mixed->Integral(mixed->FindBin(-eta2 + 0.01), mixed->FindBin(-eta1 - 0.01));
11564 Float_t center = mixed->Integral(mixed->FindBin(-eta1 + 0.01), mixed->FindBin(eta1 - 0.01));
11565 Float_t right = mixed->Integral(mixed->FindBin(eta1 + 0.01), mixed->FindBin(eta2 - 0.01));
11567 Printf("%f %f %f", left, center, right);
11568 Printf("%f", (left + right) / center);
11571 void TrackingEfficiencyCentralityDependence(const char* fileName, Int_t step1 = 2, Int_t step2 = 4)
11573 Int_t nCentralityBins = 3;
11574 Float_t centralityBins[] = { 0, 20, 40, 90 };
11576 Int_t colors[] = { 1, 2, 4, 6 };
11580 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
11583 dummy = new TH2F("dummy", ";p_{T};tracking efficiency", 100, 0, 20, 100, 0.7, 1.3);
11584 dummy->SetStats(0);
11587 legend = new TLegend(0.13, 0.67, 0.31, 0.87);
11588 legend->SetTextSize(0.04);
11589 legend->SetFillColor(0);
11591 for (Int_t i=0; i<nCentralityBins; i++)
11593 eventHist = h->GetUEHist(2)->GetEventHist();
11595 eventHist->GetGrid(step1)->SetRangeUser(1, centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
11596 eventHist->GetGrid(step2)->SetRangeUser(1, centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
11598 TH1* hist1 = eventHist->ShowProjection(0, step1);
11599 TH1* hist2 = eventHist->ShowProjection(0, step2);
11601 hist2->Divide(hist1);
11603 hist2->SetLineColor(colors[i]);
11604 hist2->GetYaxis()->SetTitle("tracking efficiency");
11605 hist2->Draw("SAME");
11607 legend->AddEntry(hist2, Form("%.0f-%.0f%%", centralityBins[i], centralityBins[i+1]));
11614 TGraphErrors* ReadHepdata(const char* fileName, Bool_t errorsAreAdded = kFALSE, Int_t skipYErrors = 0, Int_t skipXerrors = 1)
11616 // expected format: x [x2] [x3] y [ye] [ye2] [xe]
11618 // skipYErrors: 0 --> ye present
11619 // 1 --> no errors ye
11620 // 2 --> y and ye are lower and upper error, i.e. y' = (y + ye) / 2 and ye = (ye - y) / 2
11621 // 3 --> ye and ye2 are stat and syst error, will be added in quadrature
11623 // skipXerrors: 0 --> xe present
11624 // 1 --> no errors xe
11625 // 2 --> x2 present, xe not present and is calculated from x2 - x
11626 // 3 --> x2 and x3 present, ignored
11628 ifstream fin(fileName);
11630 graph = new TGraphErrors(0);
11637 if (fin.peek() == '#')
11639 fin.getline(buffer, 2000);
11651 if (skipXerrors == 2)
11654 xe = (x2 - x + 1) / 2;
11655 x = x + (x2 - x) / 2;
11658 if (skipXerrors == 3)
11669 if (skipYErrors == 0)
11676 else if (skipYErrors == 2)
11683 Double_t newy = (y + ye) / 2;
11687 else if (skipYErrors == 3)
11699 ye = TMath::Sqrt(ye*ye + ye2*ye2);
11702 if (skipXerrors == 0)
11710 //Printf("%f %f %f %f", x, y, xe, ye);
11712 if (errorsAreAdded)
11715 graph->SetPoint(graph->GetN(), x, y);
11716 graph->SetPointError(graph->GetN()-1, xe, ye);
11720 // read rest until end of line...
11721 fin.getline(buffer, 2000);
11725 Printf("%s: %f", fileName, sum);
11730 void EvaluateParticleEfficiency(const char* fileName)
11732 Int_t centralityBegin = 1;
11733 Int_t centralityEnd = 15;
11746 Float_t ptTriggerBegin = 4.01;
11747 Float_t ptTriggerEnd = 19.99;
11749 Bool_t verbose = 1;
11753 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
11754 AliUEHist* cont = h->GetUEHist(2);
11756 cont->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
11757 cont->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
11759 Int_t stepEff1 = step1 - (Int_t) AliUEHist::kCFStepAnaTopology;
11760 if (stepEff1 == -1)
11762 Int_t stepEff2 = step2 - (Int_t) AliUEHist::kCFStepAnaTopology;
11763 if (stepEff2 == -1)
11766 cont->GetTrackHistEfficiency()->GetGrid(stepEff1)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
11767 cont->GetTrackHistEfficiency()->GetGrid(stepEff2)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
11769 TH1* triggerParticle = cont->GetEventHist()->Project(step2, 0);
11770 triggerParticle->Divide(cont->GetEventHist()->Project(step1, 0));
11772 TH1* singleParticle = cont->GetTrackHistEfficiency()->Project(stepEff2, 1);
11773 singleParticle->Divide(cont->GetTrackHistEfficiency()->Project(stepEff1, 1));
11775 //singleParticle = singleParticle->Rebin(triggerParticle->GetNbinsX(), "singleRebin", triggerParticle->GetXaxis()->GetXbins()->GetArray());
11777 TGraphErrors* effectiveEffect = new TGraphErrors;
11778 TGraphErrors* triggerCorrelatedEffect = new TGraphErrors;
11779 TGraphErrors* afterBaseLine = new TGraphErrors;
11780 TGraphErrors* triggerCorrelatedEffect2D = new TGraphErrors;
11782 //TVirtualFitter::SetDefaultFitter("Linear");
11784 for (Int_t bin=3; bin<=triggerParticle->GetNbinsX(); bin++)
11786 if (triggerParticle->GetBinCenter(bin) > 10)
11789 cont->SetPtRange(triggerParticle->GetXaxis()->GetBinLowEdge(bin) + 0.01, triggerParticle->GetXaxis()->GetBinUpEdge(bin) - 0.01);
11791 TH1* hist1 = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd);
11792 TH1* hist2 = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd);
11794 // TODO the uncertainties on the ratios should be properly calculated! (if that helps ;))
11795 clone = (TH1*) hist2->Clone("clone");
11796 clone->Divide(hist1);
11798 //func = new TF1("func", "[0]", -10, 10);
11800 if ((Int_t) clone->Fit("pol0", "0", "", -10, 10) == 0)
11802 func = clone->GetFunction("pol0");
11803 effectiveEffect->SetPoint(effectiveEffect->GetN(), triggerParticle->GetBinCenter(bin) - 0.2, func->GetParameter(0));
11804 effectiveEffect->SetPointError(effectiveEffect->GetN()-1, 0, func->GetParError(0));
11809 clone->GetYaxis()->SetRangeUser(0.9, 1.3);
11811 func->DrawClone("SAME");
11815 if ((Int_t) clone->Fit("pol0", "0", "", -0.3, 0.3) == 0)
11817 func = clone->GetFunction("pol0");
11818 triggerCorrelatedEffect->SetPoint(triggerCorrelatedEffect->GetN(), triggerParticle->GetBinCenter(bin) - 0.1, func->GetParameter(0));
11819 triggerCorrelatedEffect->SetPointError(triggerCorrelatedEffect->GetN()-1, 0, func->GetParError(0));
11823 func->SetLineColor(2);
11824 func->DrawClone("SAME");
11828 if ((Int_t) hist2->Fit("pol0", "0", "", 1, 2) == 0)
11830 func = hist2->GetFunction("pol0");
11831 func->SetRange(-10, 10);
11832 hist2->Add(func, -1);
11834 if ((Int_t) hist1->Fit("pol0", "0", "", 1, 2) == 0)
11836 func = hist1->GetFunction("pol0");
11837 func->SetRange(-10, 10);
11838 hist1->Add(func, -1);
11840 //new TCanvas; hist1->DrawCopy();
11842 hist2->Divide(hist1);
11844 if ((Int_t) hist2->Fit("pol0", "0", "", -0.3, 0.3) == 0)
11846 func = hist2->GetFunction("pol0");
11847 afterBaseLine->SetPoint(afterBaseLine->GetN(), triggerParticle->GetBinCenter(bin) + 0.2, func->GetParameter(0));
11848 afterBaseLine->SetPointError(afterBaseLine->GetN()-1, 0, func->GetParError(0));
11853 hist2->GetYaxis()->SetRangeUser(0.9, 1.3);
11855 func->SetLineColor(4);
11856 func->DrawClone("SAME");
11863 TH2* hist1_2D = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
11864 TH2* hist2_2D = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
11866 //((TH2*)hist1)->Rebin2D(2, 2); ((TH2*)hist2)->Rebin2D(2, 2);
11868 hist2_2D->Divide(hist1_2D);
11873 hist2_2D->Draw("COLZ");
11876 //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));
11879 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);
11881 integral /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
11882 integral /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
11884 error /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
11885 error /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
11887 triggerCorrelatedEffect2D->SetPoint(triggerCorrelatedEffect2D->GetN(), triggerParticle->GetBinCenter(bin) + 0.1, integral);
11888 triggerCorrelatedEffect2D->SetPointError(triggerCorrelatedEffect2D->GetN()-1, 0, error);
11895 triggerParticle->Draw();
11896 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
11898 singleParticle->SetLineColor(2);
11899 //singleParticle->Draw("SAME");
11901 effectiveEffect->SetMarkerStyle(24);
11902 effectiveEffect->Draw("PSAME");
11904 triggerCorrelatedEffect->SetMarkerStyle(25);
11905 triggerCorrelatedEffect->SetMarkerColor(2);
11906 triggerCorrelatedEffect->SetLineColor(2);
11907 triggerCorrelatedEffect->Draw("PSAME");
11909 triggerCorrelatedEffect2D->SetMarkerStyle(27);
11910 triggerCorrelatedEffect2D->SetMarkerColor(3);
11911 triggerCorrelatedEffect2D->SetLineColor(3);
11912 triggerCorrelatedEffect2D->Draw("PSAME");
11914 afterBaseLine->SetMarkerStyle(26);
11915 afterBaseLine->SetMarkerColor(4);
11916 afterBaseLine->SetLineColor(4);
11917 afterBaseLine->Draw("PSAME");
11919 legend = new TLegend(0.66, 0.15, 0.88, 0.38);
11920 legend->SetFillColor(0);
11921 legend->SetTextSize(0.04);
11922 legend->AddEntry(triggerParticle, "trigger", "L");
11923 //legend->AddEntry(singleParticle, "single", "L");
11924 legend->AddEntry(effectiveEffect, "effective", "P");
11925 legend->AddEntry(triggerCorrelatedEffect, "at 0", "P");
11926 legend->AddEntry(triggerCorrelatedEffect2D, "at 0 (2d)", "P");
11927 legend->AddEntry(afterBaseLine, "baseline", "P");
11931 void EvaluateParticleEfficiency2D(const char* fileName)
11933 Int_t centralityBegin = 1;
11934 Int_t centralityEnd = 15;
11947 Bool_t verbose = 0;
11951 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
11952 AliUEHist* cont = h->GetUEHist(2);
11954 cont->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
11955 cont->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
11957 Int_t stepEff1 = step1 - (Int_t) AliUEHist::kCFStepAnaTopology;
11958 if (stepEff1 == -1)
11960 Int_t stepEff2 = step2 - (Int_t) AliUEHist::kCFStepAnaTopology;
11961 if (stepEff2 == -1)
11964 cont->GetTrackHistEfficiency()->GetGrid(stepEff1)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
11965 cont->GetTrackHistEfficiency()->GetGrid(stepEff2)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
11967 TH1* triggerParticle = cont->GetEventHist()->Project(step2, 0);
11968 triggerParticle->Divide(cont->GetEventHist()->Project(step1, 0));
11970 TH1* singleParticle = cont->GetTrackHistEfficiency()->Project(stepEff2, 1);
11971 singleParticle->Divide(cont->GetTrackHistEfficiency()->Project(stepEff1, 1));
11973 cont->GetTrackHist(0)->GetGrid(step1)->SetRangeUser(0, -0.01, 0.01); // delta eta
11974 cont->GetTrackHist(0)->GetGrid(step1)->SetRangeUser(4, -0.01, 0.01); // delta phi
11975 TH2* tracksStep1 = (TH2*) cont->GetTrackHist(0)->Project(step1, 1, 2);
11977 cont->GetTrackHist(0)->GetGrid(step2)->SetRangeUser(0, -0.01, 0.01); // delta eta
11978 cont->GetTrackHist(0)->GetGrid(step2)->SetRangeUser(4, -0.01, 0.01); // delta phi
11979 TH2* tracksStep2 = (TH2*) cont->GetTrackHist(0)->Project(step2, 1, 2);
11981 tracksStep2->Divide(tracksStep1);
11983 TH1* triggersStep1 = cont->GetEventHist()->Project(step1, 0);
11984 TH1* triggersStep2 = cont->GetEventHist()->Project(step2, 0);
11986 for (Int_t x=1; x<=tracksStep2->GetNbinsX(); x++)
11987 for (Int_t y=1; y<=tracksStep2->GetNbinsY(); y++)
11988 if (singleParticle->GetBinContent(x) > 0)
11989 tracksStep2->SetBinContent(x, y, tracksStep2->GetBinContent(x, y) / triggersStep2->GetBinContent(y) * triggersStep1->GetBinContent(y) / singleParticle->GetBinContent(x));
11991 tracksStep2->SetBinContent(x, y, 0);
11994 tracksStep2->Draw("COLZ");
11996 TGraphErrors** triggerCorrelatedEffect2D = new TGraphErrors*[triggerParticle->GetNbinsX()+1];
11997 TGraphErrors** triggerCorrelatedEffect2DSub = new TGraphErrors*[triggerParticle->GetNbinsX()+1];
11999 for (Int_t bin1=0; bin1<=triggerParticle->GetNbinsX(); bin1++)
12001 triggerCorrelatedEffect2D[bin1] = 0;
12002 triggerCorrelatedEffect2DSub[bin1] = 0;
12005 for (Int_t bin1=5; bin1<=triggerParticle->GetNbinsX(); bin1++)
12007 if (triggerParticle->GetBinCenter(bin1) > 10)
12010 Float_t ptTriggerBegin = triggerParticle->GetXaxis()->GetBinLowEdge(bin1) + 0.01;
12011 Float_t ptTriggerEnd = triggerParticle->GetXaxis()->GetBinUpEdge(bin1) - 0.01;
12013 for (Int_t bin2=3; bin2<=triggerParticle->GetNbinsX(); bin2++)
12015 if (triggerParticle->GetBinCenter(bin2) > 8)
12021 cont->SetPtRange(triggerParticle->GetXaxis()->GetBinLowEdge(bin2) + 0.01, triggerParticle->GetXaxis()->GetBinUpEdge(bin2) - 0.01);
12024 TH2* hist1_2D = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
12025 TH2* hist2_2D = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
12027 //((TH2*)hist1)->Rebin2D(2, 2); ((TH2*)hist2)->Rebin2D(2, 2);
12029 hist2_2D->Divide(hist1_2D);
12034 hist2_2D->Draw("COLZ");
12037 //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));
12040 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);
12042 integral /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
12043 integral /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
12045 error /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
12046 error /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
12051 if (!triggerCorrelatedEffect2D[bin1])
12052 triggerCorrelatedEffect2D[bin1] = new TGraphErrors;
12054 triggerCorrelatedEffect2D[bin1]->SetPoint(triggerCorrelatedEffect2D[bin1]->GetN(), triggerParticle->GetBinCenter(bin2) - 0.5 + 0.1 * bin1, integral);
12055 triggerCorrelatedEffect2D[bin1]->SetPointError(triggerCorrelatedEffect2D[bin1]->GetN()-1, 0, error);
12057 if (!triggerCorrelatedEffect2DSub[bin1])
12058 triggerCorrelatedEffect2DSub[bin1] = new TGraphErrors;
12060 triggerCorrelatedEffect2DSub[bin1]->SetPoint(triggerCorrelatedEffect2DSub[bin1]->GetN(), triggerParticle->GetBinCenter(bin2) - 0.5 + 0.1 * bin1, integral / triggerParticle->GetBinContent(bin2));
12061 triggerCorrelatedEffect2DSub[bin1]->SetPointError(triggerCorrelatedEffect2DSub[bin1]->GetN()-1, 0, error / triggerParticle->GetBinContent(bin2));
12072 triggerParticle->Draw();
12073 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
12075 legend = new TLegend(0.66, 0.15, 0.88, 0.38);
12076 legend->SetFillColor(0);
12077 legend->SetTextSize(0.04);
12078 legend->AddEntry(triggerParticle, "trigger", "L");
12083 for (Int_t bin1=3; bin1<=triggerParticle->GetNbinsX(); bin1++)
12084 if (triggerCorrelatedEffect2D[bin1])
12086 triggerCorrelatedEffect2D[bin1]->SetMarkerStyle(marker++);
12087 triggerCorrelatedEffect2D[bin1]->SetMarkerColor(color);
12088 triggerCorrelatedEffect2D[bin1]->SetLineColor(color++);
12089 triggerCorrelatedEffect2D[bin1]->Draw("PSAME");
12090 legend->AddEntry(triggerCorrelatedEffect2D[bin1], Form("pt %.2f", triggerParticle->GetBinCenter(bin1)), "P");
12096 triggerParticle->Draw();
12097 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
12102 for (Int_t bin1=3; bin1<=triggerParticle->GetNbinsX(); bin1++)
12103 if (triggerCorrelatedEffect2DSub[bin1])
12105 triggerCorrelatedEffect2DSub[bin1]->SetMarkerStyle(marker++);
12106 triggerCorrelatedEffect2DSub[bin1]->SetMarkerColor(color);
12107 triggerCorrelatedEffect2DSub[bin1]->SetLineColor(color++);
12108 triggerCorrelatedEffect2DSub[bin1]->Draw("PSAME");
12114 void DrawEventCount(const char* fileName, Int_t step = 8)
12118 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12119 h->GetEventCount()->Draw("TEXT");
12121 eventCount = h->GetEventCount();
12122 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));
12123 Printf("Events: %f", events);
12126 void FitDCADistributions(const char* fileName1)
12130 TFile::Open(fileName1);
12131 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
12132 prim = (TH2*) list->FindObject("fDCAPrimaries");
12133 sec = (TH2*) list->FindObject("fDCASecondaries");
12135 Float_t zCut = 0.5;
12137 TH2* histList[] = { prim, sec };
12142 for (Int_t i=0; i<2; i++)
12149 // hist = histList[i]->ProjectionX("proj", prim->GetYaxis()->FindBin(-zCut), prim->GetYaxis()->FindBin(zCut))->DrawCopy("");
12150 hist = histList[i]->ProjectionY("proj", prim->GetXaxis()->FindBin(-zCut), prim->GetXaxis()->FindBin(zCut))->DrawCopy("");
12153 func = new TF1("func", "gaus(0)+gaus(3)");
12154 func->SetParameters(1e6, 0, 0.02, 1e3, 0, 2);
12155 func->FixParameter(1, 0);
12156 func->FixParameter(4, 0);
12157 func->SetParLimits(2, 0, 0.1);
12158 func->SetParLimits(5, 1, 3);
12160 hist->Fit(func, "", "", -2, 2);
12162 func2 = new TF1("func2", "gaus(0)");
12163 func2->SetParameters(1e3, 0, 2);
12164 func2->FixParameter(1, 0);
12165 func2->SetParLimits(2, 0.5, 5);
12167 hist->Fit(func2, "+", "", -2, -1);
12168 func2->SetRange(-3, 3);
12169 func2->Draw("SAME");
12175 void CompareDCADistributions(const char* fileName1, const char* fileName2)
12177 TFile::Open(fileName1);
12178 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
12179 prim = (TH2*) list->FindObject("fDCAPrimaries");
12180 sec = (TH2*) list->FindObject("fDCASecondaries");
12182 TFile::Open(fileName2);
12183 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
12184 all = (TH2*) list->FindObject("fDCAPrimaries");
12186 Float_t zCut = 3.2;
12188 TH2* histList[] = { prim, sec, all };
12199 for (Int_t i=0; i<3; i++)
12201 hist = histList[i]->ProjectionX("proj", prim->GetYaxis()->FindBin(-zCut), prim->GetYaxis()->FindBin(zCut))->DrawCopy(i>0?"SAME":"");
12203 //hist = histList[i]->ProjectionY("proj", prim->GetXaxis()->FindBin(-zCut), prim->GetXaxis()->FindBin(zCut))->DrawCopy(i>0?"SAME":"");
12204 hist->SetLineColor(i+1);
12210 hist->Scale(1.0 / hist->Integral(hist->GetXaxis()->FindBin(-0.5), hist->GetXaxis()->FindBin(0.5)) * count);
12212 count += hist->Integral(hist->GetXaxis()->FindBin(-0.5), hist->GetXaxis()->FindBin(0.5));
12217 ratio = (TH1*) hist->Clone("ratio");
12218 ratio->Add(primProj, -1);
12220 /* for (Int_t i=hist->GetXaxis()->FindBin(-0.1); i<=hist->GetXaxis()->FindBin(0.1); i++)
12221 ratio->SetBinContent(i, 0);*/
12223 for (Int_t i=1; i<=hist->GetNbinsX(); i++)
12224 ratio->SetBinError(i, 0);
12226 ratio->SetLineColor(4);
12227 ratio->DrawCopy("SAME E");
12234 secProj = (TH1*) secProj->Clone();
12237 ratio->Divide(secProj);
12239 /* for (Int_t i=1; i<=hist->GetNbinsX(); i++)
12240 ratio->SetBinError(i, 0);*/
12242 ratio->Draw("HIST");
12243 ratio->GetYaxis()->SetRangeUser(0.7, 1.3);
12245 ratio->Fit("pol0", "0+", "", -5, -1);
12246 ratio->Fit("pol0", "0+", "", 1, 5);
12249 void TrackCuts_CompareParameters(const char* fileName1, const char* fileName2, const char* histName, const char* cutFolder = "cuts_quality_only")
12251 // plotWhich: 0 = only before
12255 // mirror: kTRUE --> project negative values on the positive side
12257 Int_t plotWhich = 0;
12258 Bool_t mirror = kFALSE;
12261 files[0] = TFile::Open(fileName1);
12262 files[1] = TFile::Open(fileName2);
12265 Int_t colors[] = { 1, 2, 3, 4, 5, 6 };
12267 TLegend* legend = new TLegend(0.7, 0.85, 0.93, 0.98);
12268 legend->SetTextSize(0.04);
12269 legend->SetFillColor(0);
12271 TCanvas* c1 = new TCanvas(histName, histName, 1200, 600);
12273 //TCanvas* c2 = new TCanvas("c2", "c2", 800, 600);
12274 //TCanvas* c3 = new TCanvas("c3", "c3", 800, 600);
12276 const char* folders2[] = { "before_cuts", "after_cuts" };
12277 const char* names[] = { "MC", "Data" };
12278 Bool_t first = kTRUE;
12279 for (Int_t j = ((plotWhich < 2) ? 0 : 1); j < ((plotWhich > 0) ? 2 : 1); j++)
12283 for (Int_t i = 0; i < 2; i++)
12285 Printf("%d %d", j, i);
12287 folder.Form("%s/%s/%s", cutFolder, folders2[j], histName);
12288 TH1* hist = (TH1*) files[i]->Get(folder);
12292 for (Int_t bin=1; bin<=hist->GetXaxis()->FindBin(-0.0001); bin++)
12294 Int_t newBin = hist->GetXaxis()->FindBin(-hist->GetXaxis()->GetBinCenter(bin));
12297 hist->Fill(-hist->GetXaxis()->GetBinCenter(bin), hist->GetBinContent(bin));
12298 hist->SetBinContent(bin, 0);
12303 legend->AddEntry(hist, Form("%s %s", names[i], (plotWhich == 1) ? folders2[j] : " "));
12306 hist->SetLineColor(colors[count]);
12307 hist->Scale(1.0 / hist->Integral());
12309 hist->DrawCopy((count == 0) ? "" : "SAME");
12313 case 0: base = hist; break;
12314 case 1: base2 = hist; break;
12321 ratio->Divide(base2);
12323 ratio->GetYaxis()->SetRangeUser(0, 2);
12326 ratio->DrawCopy((first) ? "" : "SAME");
12330 c1->cd(1)->SetLogy();
12331 c1->cd(1)->SetGridx();
12332 c1->cd(1)->SetGridy();
12335 c1->cd(2)->SetGridx();
12336 c1->cd(2)->SetGridy();
12338 c1->SaveAs(Form("%s.png", histName));
12341 void PlotQA(const char* fileName, const char* tag = "")
12345 if (!gGrid && TString(fileName).BeginsWith("alien://"))
12346 TGrid::Connect("alien://");
12348 TFile::Open(fileName);
12351 Int_t runNumber = 0;
12352 list = (TList*) gFile->Get("PhysSel");
12355 physSel = (AliPhysicsSelection*) list->FindObject("AliPhysicsSelection");
12356 // runNumber = physSel->GetCurrentRun();
12359 TString tmp(fileName);
12360 tmp.ReplaceAll("alien:///alice/cern.ch/user/j/jgrosseo/gridjob/dir_", "");
12361 tmp.ReplaceAll(".root", ".png");
12362 tmp.ReplaceAll("/", "-");
12364 title.Form("QA_%d_%s", runNumber, tmp.Data());
12365 c = new TCanvas(title, title, 1200, 800);
12369 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
12372 prim = (TH2*) list->FindObject("fDCAPrimaries");
12373 dcaxy = prim->ProjectionX("dcaxy", prim->GetYaxis()->FindBin(-3.2), prim->GetYaxis()->FindBin(3.2));
12374 dcaz = prim->ProjectionY("dcaz", prim->GetXaxis()->FindBin(-2.4), prim->GetXaxis()->FindBin(2.4));
12375 centrCorr = (TH2*) list->FindObject("fCentralityCorrelation");
12377 c->cd(1); dcaxy->Draw(); dcaz->SetLineColor(2); dcaz->Draw("SAME"); gPad->SetLogy();
12378 c->cd(6); centrCorr->Draw("COLZ"); gPad->SetLogz();
12380 cuts = (AliESDtrackCuts*) list->FindObject("cuts_quality_dca");
12383 cluster = cuts->GetNClustersTPC(1);
12384 c->cd(3); cluster->Draw();
12386 ptall = (TH1F*) cuts->GetPtHist(1)->Clone("ptall");
12387 if (ptall->Integral() > 0)
12388 ptall->Scale(1.0 / ptall->Integral());
12394 check_its = (AliESDtrackCuts*) list->FindObject("check_its");
12397 ptIts = (TH1F*) check_its->GetPtHist(1)->Clone("ptIts");
12398 if (ptIts->Integral() > 0)
12399 ptIts->Scale(1.0 / ptIts->Integral());
12403 global_cuts = (AliESDtrackCuts*) list->FindObject("global_cuts");
12406 ptItsAcc = (TH1*) global_cuts->GetPtHist(1)->Clone("ptItsAcc");
12407 if (ptItsAcc->Integral() > 0)
12408 ptItsAcc->Scale(1.0 / ptItsAcc->Integral());
12413 ptIts->SetLineColor(2);
12414 ptIts->Draw("SAME");
12419 ptItsAcc->SetLineColor(4);
12420 ptItsAcc->Draw("SAME");
12428 list = (TList*) gFile->Get("CentralityStat");
12429 TH1* centrQuality = 0;
12432 centrQuality = (TH1*) list->FindObject("fHOutQuality");
12434 c->cd(4); if (centrQuality) centrQuality->Draw();
12438 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE, tag);
12440 if (h->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetNbins() == 0)
12442 Printf("We have %d axes", ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0)->GetNVar()));
12444 // ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
12445 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->FillParent();
12446 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
12448 centr = h->GetCentralityDistribution();
12449 NormalizeToBinWidth(centr);
12450 Int_t events = (Int_t) h->GetEventCount()->ProjectionX()->GetBinContent(3);
12451 Int_t mergeCount = h->GetMergeCount();
12453 h->SetPtRange(1.01, 3.99);
12454 dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, 1.01, 14.99, 1, 8);
12455 if (dphi_corr->GetEntries() == 0)
12456 dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed+2, 0, 1.01, 14.99, 1, 8);
12457 if (dphi_corr->GetEntries() == 0)
12458 dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepAll, 0, 1.01, 14.99, 1, 8);
12460 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE, tag);
12461 if (hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetNbins() == 0)
12463 // ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
12464 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->FillParent();
12467 Float_t ptMin = 0.51;
12468 hMixed->SetPtRange(ptMin, 3.99);
12469 dphi_corr_mixed = hMixed->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, ptMin, 14.99, 1, 8);
12470 if (dphi_corr_mixed->GetEntries() == 0)
12471 dphi_corr_mixed = hMixed->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed+2, 0, ptMin, 14.99, 1, 8);
12472 if (dphi_corr_mixed->GetEntries() == 0)
12473 dphi_corr_mixed = hMixed->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepAll, 0, ptMin, 14.99, 1, 8);
12475 if (runNumber != 0 && runNumber != h->GetRunNumber())
12476 AliFatal("Run numbers inconsistent");
12478 Printf("%d", h->GetRunNumber());
12479 if (runNumber == 0)
12480 runNumber = h->GetRunNumber();
12482 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");
12483 c->cd(5); centr->Draw("HIST");
12486 latex = new TLatex(0.15, 0.8, Form("%d events, %d merged objects", events, mergeCount));
12487 latex->SetTextSize(0.075);
12492 h->GetEventCount()->Draw("TEXT");
12494 title.Form("QA_%d_%s", runNumber, tmp.Data());
12495 c->SetTitle(title);
12499 h->SetPtRange(gpTMin, gpTMax);
12500 hMixed->SetPtRange(gpTMin, gpTMax);
12504 //h->GetUEHist(2)->SetSkipScaleMixedEvent(kTRUE);
12506 if (h->GetUEHist(2)->GetTrackHist(0)->GetNVar() > 5)
12511 GetDistAndFlow(h, 0, &hist1, 0, step, 0, 20, 2.01, 2.99, 1);
12512 hist1->DrawCopy("SURF1");
12515 GetDistAndFlow(hMixed, 0, &hist1, 0, step, 0, 20, 2.01, 2.99, 1);
12516 hist1->DrawCopy("SURF1");
12519 GetSumOfRatios(h, hMixed, &hist1, step, 0, 20, 2.01, 2.99, kTRUE);
12521 hist1->DrawCopy("SURF1");
12524 c->SaveAs(Form("qa/%s", c->GetTitle()));
12527 void GetEventNumber(const char* fileName)
12531 new TCanvas("c1", "", 800, 600);
12535 TFile::Open(fileName);
12536 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12537 centr = h->GetCentralityDistribution();
12538 nEvent = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(59.99));
12540 cout << "Number of events: " << nEvent << endl;
12541 centr->Draw("HIST");
12543 void CompareStepsOnePlot(const char* fileName, Int_t caseId)
12547 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12549 Int_t stepList[] = { 0, 1, 2, 4, 5, 6 };
12550 Int_t stepListNames[] = { 0, 1, 2, 3, 4, 5 };
12552 //const char* names[] = { "All", "PhysSel+Vertex", "Reco Primaries", "Reco "
12553 // //Int_t stepList[] = { 2, 4, 5, 6 };
12556 // TH1* hist1 = h->GetUEHist(2)->GetUEHist(0, 0, 6.01, 9.99, 6, 14);
12557 // TH1* hist2 = h->GetUEHist(2)->GetUEHist(0, 0, 6.01, 7.99, 6, 14);
12558 // TH1* hist3 = h->GetUEHist(2)->GetUEHist(0, 0, 8.01, 9.99, 6, 14);
12561 // hist2->SetLineColor(2);
12562 // hist2->Draw("SAME");
12563 // hist3->SetLineColor(4);
12564 // hist3->Draw("SAME");
12568 legend = new TLegend(0.65, 0.45, 0.85, 0.85);
12569 legend->SetTextSize(0.04);
12570 legend->SetFillColor(0);
12574 for (Int_t i=0; i<nSteps; i++)
12576 //TH1* hist1 = h->GetUEHist(2)->GetEventHist()->Project(stepList[i], 0);
12578 /* h->GetUEHist(2)->GetTrackHist(0)->GetGrid(stepList[i])->GetGrid()->GetAxis(1)->SetRangeUser(1.01, 3.99);
12579 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(stepList[i])->GetGrid()->GetAxis(2)->SetRangeUser(4.01, 19.99);
12580 TH1* hist1 = h->GetUEHist(2)->GetTrackHist(0)->Project(stepList[i], 4);*/
12583 TH1* hist1 = h->GetUEHist(2)->GetUEHist(stepList[i], 0, 1.01, 19.99);
12584 else if (caseId == 1)
12585 TH1* hist1 = h->GetUEHist(2)->GetEventHist()->Project(stepList[i], 0);
12589 hist1->SetMarkerStyle(24+i);
12590 hist1->SetTitle("");
12591 hist1->SetStats(0);
12592 hist1->DrawCopy((i==0)?"":"SAME");
12593 hist1->Fit("pol0", "0");
12594 //hist1->Fit("pol0");
12595 histList[i] = hist1;
12596 legend->AddEntry(hist1, Form("Step %d", stepListNames[i]), "P");
12602 legend = new TLegend(0.65, 0.45, 0.85, 0.85);
12603 legend->SetTextSize(0.04);
12604 legend->SetFillColor(0);
12606 for (Int_t i=1; i<nSteps; i++)
12608 histList[i]->DrawCopy((i==1)?"":"SAME")->Divide(histList[i-1]);
12609 legend->AddEntry(histList[i], Form("Step %d/%d", stepListNames[i], stepListNames[i-1]), "P");
12615 for (Int_t i=0; i<nSteps; i++)
12617 hist1 = histList[i];
12618 func = new TF1("func", "[0]", -10, 10);
12619 hist1->Fit(func, "0", "", 1, 2);
12620 hist1->Add(func, -1);
12621 hist1->DrawCopy((i==0)?"":"SAME");
12627 for (Int_t i=1; i<nSteps; i++)
12629 histList[i]->DrawCopy((i==1)?"":"SAME")->Divide(histList[i-1]);
12635 void PtShift(const char* fileName)
12639 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12644 ptHist3 = h->GetCorrelationpT()->ProjectionY();
12645 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12646 //ptHist3->Sumw2();
12649 func = new TF1("func", "[0]+[1]*x**[2]", 4, 20);
12650 func->SetParLimits(2, -10, -1);
12651 func->SetParameters(0, 1, -4);
12652 ptHist3->Fit(func, "", "", 4, 20);
12657 ptHist3Shifted = (TH1*) ptHist3->Clone("ptHist3Shifted");
12658 for (Int_t i=1; i<ptHist3Shifted->GetNbinsX(); i++)
12659 //ptHist3Shifted->SetBinContent(i, ptHist3Shifted->GetBinContent(i+3));
12660 ptHist3Shifted->SetBinContent(i, ptHist3Shifted->GetBinContent(1.1*i));
12664 ptHist3Shifted->SetLineColor(2);
12667 ptHist3Shifted->Rebin(2);
12669 ptHist3->DrawCopy();
12670 ptHist3Shifted->DrawCopy("SAME");
12673 ptHist3->Divide(ptHist3Shifted);
12676 //ptHist3->Rebin(2); ptHist3->Scale(1.0 / 2);
12682 void RAA(const char* fileName, const char* fileName2)
12688 for (Int_t j=0; j<2; j++)
12691 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12697 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName2);
12700 ptHist3 = h->GetCorrelationpT()->ProjectionY(Form("proj1_%d", j), 1, 5);
12701 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12703 //h->GetCentralityDistribution()->Draw(); new TCanvas;
12705 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(4.99));
12706 Printf("%d", nEvents);
12707 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12713 hist[0]->DrawCopy("");
12714 hist[1]->DrawCopy("SAME")->SetLineColor(2);
12718 hist[1]->Divide(hist[0]);
12719 hist[1]->DrawCopy();
12721 raa_central = ReadHepdata("raa_alice_central.txt", kFALSE, 3);
12722 raa_central->SetMarkerStyle(20);
12723 raa_central->Draw("PSAME");
12726 void PtComparison(const char* fileName, const char* fileName2 = 0, const char* tag = 0)
12735 for (Int_t j=0; j<2; j++)
12738 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE, tag);
12744 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName2, 0, kFALSE, tag);
12747 ptHist3 = h->GetInvYield()->ProjectionY("pt1", h->GetInvYield()->GetXaxis()->FindBin(0.01), h->GetInvYield()->GetXaxis()->FindBin(4.99));
12748 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12750 //h->GetCentralityDistribution()->Draw(); new TCanvas;
12752 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(4.99));
12753 Printf("%d", nEvents);
12754 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12757 ptHist3->SetLineStyle(j+1);
12758 ptHist3->DrawCopy((j == 0) ? "HIST" : "HISTSAME")->SetLineColor(1);
12760 centralPt = (TH1*) ptHist3->Clone();
12764 ptHist3 = h->GetInvYield()->ProjectionY("pt2", h->GetInvYield()->GetXaxis()->FindBin(70.01), h->GetInvYield()->GetXaxis()->FindBin(79.99));
12765 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12767 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(70.1), h->GetCentralityDistribution()->FindBin(79.9));
12768 Printf("%d", nEvents);
12769 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12771 ptHist3->SetLineStyle(j+1);
12772 ptHist3->DrawCopy("HISTSAME")->SetLineColor(2);
12774 peripheralPt = (TH1*) ptHist3->Clone();
12778 ptHist3 = h->GetInvYield()->ProjectionY("pt3", h->GetInvYield()->GetXaxis()->FindBin(20.01), h->GetInvYield()->GetXaxis()->FindBin(29.99));
12779 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12781 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(20.1), h->GetCentralityDistribution()->FindBin(29.9));
12782 Printf("%d", nEvents);
12783 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12785 ptHist3->SetLineStyle(j+1);
12786 ptHist3->DrawCopy("HISTSAME")->SetLineColor(4);
12792 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
12793 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
12798 dndpt_central = ReadHepdata("raa2_dndpt_05.txt", kFALSE, 1, 3);
12799 dndpt_midcentral = ReadHepdata("raa2_dndpt_2030.txt", kFALSE, 1, 3);
12800 dndpt_peripheral = ReadHepdata("raa2_dndpt_7080.txt", kFALSE, 1, 3);
12803 // RemovePointsBelowX(dndpt_central, 1);
12804 // RemovePointsBelowX(dndpt_peripheral, 1);
12806 // NormalizeTo(dndpt_central, 1);
12807 // NormalizeTo(dndpt_peripheral, 10);
12809 dndpt_central->Draw("*SAME");
12810 dndpt_peripheral->SetLineColor(2);
12811 dndpt_peripheral->SetMarkerColor(2);
12812 dndpt_peripheral->Draw("*SAME");
12813 dndpt_midcentral->SetLineColor(4);
12814 dndpt_midcentral->SetMarkerColor(4);
12815 dndpt_midcentral->Draw("*SAME");
12821 for (Int_t i=1; i<ptHist3->GetNbinsX(); i++)
12822 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / dndpt_midcentral->Eval(ptHist3->GetBinCenter(i), 0, "S"));
12824 for (Int_t i=1; i<centralPt->GetNbinsX(); i++)
12825 centralPt->SetBinContent(i, centralPt->GetBinContent(i) / dndpt_central->Eval(centralPt->GetBinCenter(i), 0, "S"));
12827 for (Int_t i=1; i<peripheralPt->GetNbinsX(); i++)
12828 peripheralPt->SetBinContent(i, peripheralPt->GetBinContent(i) / dndpt_peripheral->Eval(peripheralPt->GetBinCenter(i), 0, "S"));
12830 // ptHist3->Rebin(2); ptHist3->Scale(0.5);
12831 // centralPt->Rebin(2); centralPt->Scale(0.5);
12833 ptHist3->GetXaxis()->SetRangeUser(0.51, 19);
12834 ptHist3->GetYaxis()->SetRangeUser(0.5, 1.5);
12835 ptHist3->DrawCopy((j == 0) ? "" : "SAME")->SetLineColor(4);
12836 centralPt->DrawCopy("SAME")->SetLineColor(1);
12837 peripheralPt->DrawCopy("SAME")->SetLineColor(2);
12841 void PtComparisonOld(const char* fileName, const char* fileName2 = 0)
12843 // use GetCorrectedYields to get input file
12852 for (Int_t j=0; j<2; j++)
12856 TFile::Open(fileName);
12863 TFile::Open(fileName2);
12865 yieldCorr = (TH3F*) gFile->Get("fYieldsCorr");
12866 eventDist = (TH1*) gFile->Get("events");
12868 //new TCanvas; h->GetCorrelationpT()->Draw("COLZ");
12870 yieldCorr->GetXaxis()->SetRangeUser(0.1, 4.9);
12871 yieldCorr->GetZaxis()->SetRangeUser(-0.79, 0.79);
12873 ptHist3 = yieldCorr->Project3D(Form("y1_%d", j));
12874 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12876 //h->GetCentralityDistribution()->Draw(); new TCanvas;
12878 Int_t nEvents = eventDist->Integral(eventDist->FindBin(0.1), eventDist->FindBin(4.9));
12879 Printf("%d", nEvents);
12880 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12882 //ptHist3->Scale(1690);
12883 //ptHist3->Scale(1.0 / ptHist3->Integral(ptHist3->GetXaxis()->FindBin(1.01), ptHist3->GetNbinsX()) / 3 / 0.6);
12885 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
12886 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
12887 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
12889 //AliPWG0Helper::NormalizeToBinWidth(ptHist3);
12892 ptHist3->SetLineStyle(j+1);
12893 ptHist3->DrawCopy((j == 0) ? "HIST" : "HISTSAME")->SetLineColor(1);
12895 centralPt = (TH1*) ptHist3->Clone();
12899 yieldCorr->GetZaxis()->SetRangeUser(-0.79, 0.79);
12900 yieldCorr->GetXaxis()->SetRangeUser(70.1, 79.9);
12901 ptHist3 = yieldCorr->Project3D(Form("y2_%d", j));
12902 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12904 Int_t nEvents = eventDist->Integral(eventDist->FindBin(70.1), eventDist->FindBin(79.9));
12905 Printf("%d", nEvents);
12906 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12908 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
12909 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
12910 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
12912 ptHist3->SetLineStyle(j+1);
12913 ptHist3->DrawCopy("HISTSAME")->SetLineColor(2);
12915 peripheralPt = (TH1*) ptHist3->Clone();
12919 yieldCorr->GetZaxis()->SetRangeUser(-0.79, 0.79);
12920 yieldCorr->GetXaxis()->SetRangeUser(20.1, 29.9);
12921 ptHist3 = yieldCorr->Project3D(Form("y2_%d", j));
12922 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12924 Int_t nEvents = eventDist->Integral(eventDist->FindBin(20.1), eventDist->FindBin(29.9));
12925 Printf("%d", nEvents);
12926 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12928 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
12929 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
12930 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
12932 ptHist3->SetLineStyle(j+1);
12933 ptHist3->DrawCopy("HISTSAME")->SetLineColor(4);
12939 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
12940 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
12945 dndpt_central = ReadHepdata("raa2_dndpt_05.txt", kFALSE, 1, 3);
12946 dndpt_midcentral = ReadHepdata("raa2_dndpt_2030.txt", kFALSE, 1, 3);
12947 dndpt_peripheral = ReadHepdata("raa2_dndpt_7080.txt", kFALSE, 1, 3);
12950 // RemovePointsBelowX(dndpt_central, 1);
12951 // RemovePointsBelowX(dndpt_peripheral, 1);
12953 // NormalizeTo(dndpt_central, 1);
12954 // NormalizeTo(dndpt_peripheral, 10);
12956 dndpt_central->Draw("*SAME");
12957 dndpt_peripheral->SetLineColor(2);
12958 dndpt_peripheral->SetMarkerColor(2);
12959 dndpt_peripheral->Draw("*SAME");
12960 dndpt_midcentral->SetLineColor(4);
12961 dndpt_midcentral->SetMarkerColor(4);
12962 dndpt_midcentral->Draw("*SAME");
12968 for (Int_t i=1; i<ptHist3->GetNbinsX(); i++)
12969 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / dndpt_midcentral->Eval(ptHist3->GetBinCenter(i), 0, "S"));
12971 for (Int_t i=1; i<centralPt->GetNbinsX(); i++)
12972 centralPt->SetBinContent(i, centralPt->GetBinContent(i) / dndpt_central->Eval(centralPt->GetBinCenter(i), 0, "S"));
12974 for (Int_t i=1; i<peripheralPt->GetNbinsX(); i++)
12975 peripheralPt->SetBinContent(i, peripheralPt->GetBinContent(i) / dndpt_peripheral->Eval(peripheralPt->GetBinCenter(i), 0, "S"));
12977 // ptHist3->Rebin(2); ptHist3->Scale(0.5);
12978 // centralPt->Rebin(2); centralPt->Scale(0.5);
12980 ptHist3->GetXaxis()->SetRangeUser(0.51, 19);
12981 ptHist3->GetYaxis()->SetRangeUser(0.5, 1.5);
12982 ptHist3->DrawCopy((j == 0) ? "" : "SAME")->SetLineColor(4);
12983 centralPt->DrawCopy("SAME")->SetLineColor(1);
12984 peripheralPt->DrawCopy("SAME")->SetLineColor(2);
12989 ReadYields("preliminaries/yields_110303.root");
12991 ptHist3->Scale(100);
12993 TGraphErrors** tmp = yields[0][1][0];
12994 nearSide = tmp[18];
12995 nearSide->Draw("* SAME");
12997 TGraphErrors** tmp = yields[1][1][0];
12998 awaySide = tmp[18];
12999 awaySide->SetLineColor(2);
13000 awaySide->SetMarkerColor(2);
13001 awaySide->Draw("* SAME");
13005 void style(Int_t styleId = 1)
13007 gStyle->SetPalette(1);
13008 gStyle->SetCanvasColor(10);
13009 gStyle->SetHistFillColor(10);
13010 gStyle->SetHistFillStyle(0);
13011 gStyle->SetOptStat(0);
13012 gStyle->SetPadTickX(1);
13013 gStyle->SetPadTickY(1);
13014 gStyle->SetAxisColor(1, "X");
13015 gStyle->SetAxisColor(1, "Y");
13016 gStyle->SetAxisColor(1, "Z");
13017 gStyle->SetLabelColor(1, "X");
13018 gStyle->SetLabelColor(1, "Y");
13019 gStyle->SetLabelColor(1, "Z");
13020 gStyle->SetTickLength(0.03, "X");
13021 gStyle->SetTickLength(0.03, "Y");
13022 gStyle->SetTickLength(0.03, "Z");
13023 gStyle->SetTitleXSize(0.05);
13024 gStyle->SetTitleYSize(0.05);
13025 gStyle->SetNdivisions(506, "X");
13026 gStyle->SetNdivisions(506, "Y");
13027 gStyle->SetNdivisions(506, "Z");
13029 //gStyle->SetPadGridX(1);
13030 //gStyle->SetPadGridY(1);
13032 //gStyle->SetLabelOffset(0.02, "X");
13033 //gStyle->SetLabelOffset(0.02, "Y");
13034 //gStyle->SetLabelOffset(0.02, "Z");
13035 gStyle->SetLabelSize(0.05, "X");
13036 gStyle->SetLabelSize(0.05, "Y");
13037 gStyle->SetLabelSize(0.05, "Z");
13039 gStyle->SetPadLeftMargin(0.12);
13040 gStyle->SetPadRightMargin(0.02);
13041 gStyle->SetPadBottomMargin(0.13);
13042 gStyle->SetPadTopMargin(0.02);
13044 gStyle->SetMarkerSize(1.4); // CKB
13046 const int iFont = 42; // type * 10 + prec 6: helvetica bold 13: times normal 2: times bold
13049 *-* 1 : times-medium-i-normal "Times New Roman" 1 4
13050 *-* 2 : times-bold-r-normal "Times New Roman" 0 7
13051 *-* 3 : times-bold-i-normal "Times New Roman" 1 7
13052 *-* 4 : helvetica-medium-r-normal "Arial" 0 4
13053 *-* 5 : helvetica-medium-o-normal "Arial" 1 4
13054 *-* 6 : helvetica-bold-r-normal "Arial" 0 7
13055 *-* 7 : helvetica-bold-o-normal "Arial" 1 7
13056 *-* 8 : courier-medium-r-normal "Courier New" 0 4
13057 *-* 9 : courier-medium-o-normal "Courier New" 1 4
13058 *-* 10 : courier-bold-r-normal "Courier New" 0 7
13059 *-* 11 : courier-bold-o-normal "Courier New" 1 7
13060 *-* 12 : symbol-medium-r-normal "Symbol" 0 6
13061 *-* 13 : times-medium-r-normal "Times New Roman" 0 4
13062 *-* 14 : "Wingdings" 0 4
13065 //gStyle->SetTitleXOffset(1); // 1.1
13066 //gStyle->SetTitleYOffset(1); // 1-4
13068 gStyle->SetLabelFont(iFont, "xyz");
13069 gStyle->SetStatFont(iFont);
13070 gStyle->SetTitleFont(iFont, "xyz");
13071 gStyle->SetTextFont(iFont);
13075 gStyle->SetLabelSize(0.07, "X");
13076 gStyle->SetLabelSize(0.07, "Y");
13077 gStyle->SetLabelSize(0.07, "Z");
13078 gStyle->SetTitleXSize(0.07);
13079 gStyle->SetTitleYSize(0.07);
13081 gStyle->SetPadLeftMargin(0.26);
13082 gStyle->SetPadRightMargin(0.01);
13083 gStyle->SetPadBottomMargin(0.15);
13084 gStyle->SetPadTopMargin(0.01);
13087 //gStyle->SetEndErrorSize(0.0);
13089 gROOT->ForceStyle();
13093 void NormalizeTo(TGraphErrors* graph, Float_t normalizeTo)
13096 for (Int_t i=0; i<graph->GetN(); i++)
13097 sum += graph->GetY()[i];
13099 if (normalizeTo > 0 && sum > 0)
13101 sum /= normalizeTo;
13102 for (Int_t i=0; i<graph->GetN(); i++)
13104 graph->SetPoint(i, graph->GetX()[i], graph->GetY()[i] / sum);
13105 graph->SetPointError(i, graph->GetEX()[i], graph->GetEY()[i] / sum);
13110 void CompareMixedEvent(const char* fileName)
13114 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
13115 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
13116 Int_t leadingPtOffset = 2;
13117 Int_t centralityBins[] = { 0, 0, 1, 6, 9, 16 };
13119 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
13122 for (Int_t j=2; j<5; j++)
13124 gpTMin = assocPtArr[j] + 0.01;
13125 gpTMax = assocPtArr[j+1] - 0.01;
13130 SetupRanges(hMixed);
13132 TH2* mixed = hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centralityBins[j], centralityBins[j+1]-1, 1);
13136 TH1* histMixedproj = mixed->ProjectionY();
13137 histMixedproj->Scale(1.0 / mixed->GetNbinsX());
13139 for (Int_t x=1; x<=mixed->GetNbinsX(); x++)
13140 for (Int_t y=1; y<=mixed->GetNbinsY(); y++)
13141 mixed->SetBinContent(x, y, histMixedproj->GetBinContent(y));
13143 histMixedproj->Scale(1.0 / (0.5 * (histMixedproj->GetBinContent(histMixedproj->GetXaxis()->FindBin(-0.01)) + histMixedproj->GetBinContent(histMixedproj->GetXaxis()->FindBin(0.01)))));
13145 histMixedproj->DrawCopy((j == 2) ? "" : "SAME")->SetLineColor(j-1);
13149 void FillParentTHnSparse(const char* fileName, Bool_t reduce = kFALSE, const char* tag = "")
13151 TString fileNameStr(fileName);
13153 if (fileNameStr.BeginsWith("/alice"))
13155 fileNameStr = Form("alien://%s", fileNameStr.Data());
13156 if (fileNameStr.EndsWith("merge"))
13157 fileNameStr += "/AnalysisResults.root";
13160 if (fileNameStr.BeginsWith("alien:"))
13161 TGrid::Connect("alien:");
13167 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNameStr, &list, kFALSE, tag);
13168 Printf("We have %d axes", ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0)->GetNVar()));
13171 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
13172 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->FillParent();
13173 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
13175 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileNameStr, 0, kTRUE, tag);
13177 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
13178 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->FillParent();
13179 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
13181 TString newFileName(fileNameStr);
13183 if (fileNameStr.BeginsWith("alien:"))
13184 newFileName = gSystem->BaseName(newFileName);
13186 newFileName.ReplaceAll(".root", "");
13188 newFileName += "_.root";
13190 newFileName += "_zvtx.root";
13192 file3 = TFile::Open(newFileName, "RECREATE");
13193 file3->mkdir("PWG4_PhiCorrelations");
13194 file3->cd("PWG4_PhiCorrelations");
13195 list->Write("histosPhiCorrelations", TObject::kSingleKey);
13199 void CompareZVertex(const char* fileName)
13203 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13204 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
13206 axis = h->GetUEHist(2)->GetEventHist()->GetAxis(2, 6);
13212 SetupRanges(hMixed);
13214 TFile::Open("test.root", "RECREATE");
13216 for (Int_t i=0; i<=axis->GetNbins(); i++)
13221 Printf("%d %f %f", i, axis->GetBinLowEdge(i) + 0.01, axis->GetBinUpEdge(i) - 0.01);
13222 h->SetZVtxRange(axis->GetBinLowEdge(i) + 0.01, axis->GetBinUpEdge(i) - 0.01);
13223 hMixed->SetZVtxRange(axis->GetBinLowEdge(i) + 0.01, axis->GetBinUpEdge(i) - 0.01);
13226 GetDistAndFlow(h, hMixed, &hist, 0, 6, 0, 10, 2.01, 14.99, 1, kTRUE, 0, kFALSE);
13229 hist->DrawCopy("SURF1");
13231 hist->Write(Form("detadphi_%d", i));
13233 // if (i == 0) break;
13237 hist->SetLineColor(i+1);
13238 hist->Scale(1.0 / hist->Integral() / hist->GetBinWidth(1));
13239 hist->Draw((i == 0) ? "" : "SAME");
13245 void DrawZRanges(Float_t min, Float_t max)
13247 legend = new TLegend(0.5, 0.5, 0.8, 0.8);
13249 TFile::Open("test.root");
13251 for (Int_t i=0; i<8; i++)
13253 if (i == 1 || i == 7)
13256 hist = (TH2*) gFile->Get(Form("detadphi_%d", i));
13257 hist->Rebin2D(2, 2);
13260 proj = hist->ProjectionY("proj", hist->GetXaxis()->FindBin(min), hist->GetXaxis()->FindBin(max));
13261 proj->Scale(1.0 / (hist->GetXaxis()->FindBin(max) - hist->GetXaxis()->FindBin(min) + 1));
13263 proj->SetLineColor(i+1);
13264 proj->DrawCopy((i == 0) ? "" : "SAME HIST");
13266 legend->AddEntry(proj->Clone(), Form("%d", i));
13272 void PlotTrackingEfficiency(const char* fileName)
13276 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13278 c = new TCanvas("c", "c", 600, 600);
13279 gPad->SetLeftMargin(0.15);
13281 h->SetEtaRange(-0.89, 0.89);
13283 Float_t centralityBins[] = { 0, 10, 20, 40, 60, 100 };
13284 Int_t nCentralityBins = 5;
13286 legend = new TLegend(0.2, 0.15, 0.46, 0.42);
13287 legend->SetFillColor(0);
13289 Int_t colors[] = { 1, 2, 3, 4, 6 };
13291 for (Int_t i=0; i<nCentralityBins; i++)
13293 h->GetUEHist(2)->SetCentralityRange(centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
13294 proj = h->GetUEHist(2)->GetTrackingEfficiency(1);
13295 proj->GetYaxis()->SetRangeUser(0.7, 0.9);
13296 proj->GetXaxis()->SetRangeUser(0.5, 9.9);
13297 proj->GetYaxis()->SetTitleOffset(1.5);
13298 proj->SetTitle("");
13299 proj->GetYaxis()->SetTitle("Tracking efficiency");
13300 proj->SetMarkerColor(colors[i]);
13301 proj->SetLineColor(colors[i]);
13303 projClone = proj->DrawClone((i == 0) ? "" : "SAME");
13305 legend->AddEntry(projClone, Form("%.0f-%.0f%%", centralityBins[i], centralityBins[i+1]));
13309 // DrawLatex(0.58, 0.85, 1, "HIJING Pb-Pb 2.76 TeV", 0.03);
13310 // DrawLatex(0.58, 0.81, 1, "|#eta| < 0.9", 0.03);
13312 // DrawALICELogo(kFALSE, 0.7, 0.2, 0.9, 0.4);
13314 c->SaveAs("correction_tracking.eps");
13316 c = new TCanvas("c2", "c2", 600, 600);
13317 gPad->SetLeftMargin(0.15);
13319 proj = (TH1D*) h->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepTracked, AliUEHist::kCFStepTrackedOnlyPrim, 1);
13320 proj->GetYaxis()->SetRangeUser(0.8, 1.0);
13321 proj->GetXaxis()->SetRangeUser(0.5, 9.9);
13322 proj->GetYaxis()->SetTitleOffset(1.5);
13323 proj->SetTitle("");
13324 proj->GetYaxis()->SetTitle("contamination correction");
13326 projClone = proj->DrawClone("");
13328 // DrawLatex(0.58, 0.85, 1, "HIJING Pb-Pb 2.76 TeV", 0.03);
13329 // DrawLatex(0.58, 0.81, 1, "|#eta| < 0.9", 0.03);
13330 // DrawALICELogo(kFALSE, 0.7, 0.2, 0.9, 0.4);
13332 c->SaveAs("correction_contamination.eps");
13334 c = new TCanvas("c3", "c3", 600, 600);
13335 gPad->SetLeftMargin(0.15);
13337 proj = (TH1D*) h->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepTrackedOnlyPrim, AliUEHist::kCFStepTracked, 1);
13338 proj->GetYaxis()->SetRangeUser(0.95, 1.15);
13339 proj->GetXaxis()->SetRangeUser(0.5, 9.9);
13340 proj->GetYaxis()->SetTitleOffset(1.5);
13341 proj->SetTitle("");
13342 proj->GetYaxis()->SetTitle("contamination");
13344 projClone = proj->DrawClone("");
13346 // DrawLatex(0.58, 0.85, 1, "HIJING Pb-Pb 2.76 TeV", 0.03);
13347 // DrawLatex(0.58, 0.81, 1, "|#eta| < 0.9", 0.03);
13348 // DrawALICELogo(kFALSE, 0.7, 0.2, 0.9, 0.4);
13350 c->SaveAs("contamination.eps");
13353 void PlotCorrections(const char* fileName, const char* tag = "")
13357 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE, tag);
13359 c = new TCanvas("c", "c", 1200, 800);
13362 c2 = new TCanvas("c2", "c2", 800, 900);
13365 h->SetEtaRange(-0.89, 0.89);
13366 // h->SetEtaRange(-1.19, 1.19);
13368 Float_t centrBins[] = { 0, 20, 40, 60, 100.1 };
13370 for (Int_t i=0; i<4; i++)
13372 h->GetUEHist(2)->SetCentralityRange(centrBins[i] + 0.1, centrBins[i+1] - 0.1);
13374 h->GetUEHist(2)->GetTrackingEfficiency()->DrawClone("COLZ");
13377 proj = h->GetUEHist(2)->GetTrackingEfficiency(1);
13378 proj->SetTitle(""); proj->SetStats(0);
13379 proj->GetYaxis()->SetTitle("tracking efficiency");
13380 proj->SetLineColor(i+1);
13381 proj->DrawClone((i == 0) ? "" : "SAME");
13384 proj = h->GetUEHist(2)->GetTrackingEfficiency(0);
13385 proj->GetYaxis()->SetTitle("tracking efficiency");
13386 proj->SetTitle(""); proj->SetStats(0);
13387 proj->GetXaxis()->SetTitle("#eta");
13388 proj->SetLineColor(i+1);
13389 proj->DrawClone((i == 0) ? "" : "SAME");
13392 proj = h->GetUEHist(2)->GetTrackingContamination(1);
13393 proj->GetYaxis()->SetTitle("contamination correction");
13394 proj->SetTitle(""); proj->SetStats(0);
13395 proj->SetLineColor(i+1);
13396 proj->DrawClone((i == 0) ? "" : "SAME");
13400 h->GetUEHist(2)->SetCentralityRange(0, -1);
13401 for (Int_t i=0; i<10; i++)
13404 h->SetZVtxRange(-10.0 + 2 * i, -8.0 + 2 * i);
13405 proj = h->GetUEHist(2)->GetTrackingEfficiency(0);
13406 proj->GetYaxis()->SetTitle("tracking efficiency");
13407 proj->SetTitle(""); proj->SetStats(0);
13408 proj->GetXaxis()->SetTitle("#eta");
13409 proj->SetLineColor(i+1);
13410 proj->DrawClone((i == 0) ? "" : "SAME");
13413 h->SetZVtxRange(0, -1);
13415 for (Int_t i=0; i<4; i++)
13418 h->SetPartSpecies(i);
13419 proj = h->GetUEHist(2)->GetTrackingEfficiency(1);
13420 proj->GetYaxis()->SetTitle("tracking efficiency");
13421 proj->SetTitle(""); proj->SetStats(0);
13422 // proj->GetXaxis()->SetTitle("#eta");
13423 proj->SetLineColor(i+1);
13424 proj->DrawClone((i == 0) ? "" : "SAME");
13430 h->GetUEHist(2)->GetTrackingContamination()->Draw("COLZ");*/
13432 proj2 = h->GetUEHist(2)->GetTrackingEfficiency(1);
13433 // proj2 = h->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepAnaTopology, (AliUEHist::CFStep) (AliUEHist::kCFStepTrackedOnlyPrim+2), 1);
13438 hist = h->GetUEHist(2)->GetCorrelatedContamination();
13439 // if (hist->GetEntries() > 0)
13440 // hist->Draw("COLZ");
13443 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)
13445 // partSpecies= -1 No PID, 0: Pions, 1: Kaons, 2: Protons
13446 // icharge is needed because GF correction applies only to negative particles, 0:Positive 1:negative
13447 // ApplyGFCorrection, for Geant3 version >= v1.14 this correction is not needed anymore for antiprotons
13448 // the number of TRD modules installed depends on the year
13450 Printf("condenseCentrality: %d; extrapolateHighpT: %d", condenseCentrality, extrapolateHighpT);
13454 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE, tag);
13456 if(partSpecies!=-1){
13457 Double_t epsilon=0.001;
13458 h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
13459 h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(4)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
13462 Int_t dimensions[] = { 0, 1, 3, 4 }; // eta, pT, centrality, vertex
13463 THnBase* generated = h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->ProjectionND(4, dimensions);
13464 THnBase* measured = h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid((partSpecies==-1)?2:4)->GetGrid()->ProjectionND(4, dimensions); //for ID particle the matched+identified are taken
13466 // new TCanvas; measured->Projection(0, 1, 3)->Draw();
13468 Printf("%f %f", generated->GetEntries(), measured->GetEntries());
13470 Int_t nBins[] = { generated->GetAxis(0)->GetNbins(), generated->GetAxis(1)->GetNbins(), 1, generated->GetAxis(3)->GetNbins() };
13472 if (condenseCentrality)
13474 Double_t centrAxis[] = { 0, 101 };
13478 Double_t centrAxis[] = { 0, 10, 20, 40, 60, 101 };
13482 generated_new = new THnF("generated_new", "", 4, nBins, 0, 0);
13484 generated_new->SetBinEdges(0, generated->GetAxis(0)->GetXbins()->GetArray()); //eta
13485 generated_new->SetBinEdges(1, generated->GetAxis(1)->GetXbins()->GetArray()); //pT
13486 generated_new->SetBinEdges(2, centrAxis); //centrality
13487 generated_new->SetBinEdges(3, generated->GetAxis(3)->GetXbins()->GetArray()); //vertex
13489 for (Int_t i=0; i<4; i++)
13490 generated_new->GetAxis(i)->SetTitle(generated->GetAxis(i)->GetTitle());
13492 measured_new = (THnF*) generated_new->Clone("measured_new");
13493 effCorr = (THnF*) generated_new->Clone("correction");
13495 generated_new->RebinnedAdd(generated);
13496 measured_new->RebinnedAdd(measured);
13498 // new TCanvas; measured_new->Projection(0, 1, 3)->Draw();
13502 Printf("%f %f", generated_new->GetEntries(), measured_new->GetEntries());
13504 effCorr->Divide(generated_new, measured_new, 1, 1, "B");
13505 // effCorr->Divide(measured_new);
13507 if(ApplyGFCorrection && partSpecies!=-1){//define the functions for the GF correction
13511 if(year==2011)ntrd=10;
13512 if(year>=2012)ntrd=13;
13513 Printf("Number of TRD module in %d : %d",year,ntrd);
13514 Printf("Applying GF correction for particle specie %d %s",partSpecies,Sign[icharge].Data());
13515 Int_t partSpeciesAliPID=partSpecies+2; //in AliPID 2: Pions 3:Kaons 4:protons
13516 fGFTracking = TrackingEff_geantflukaCorrection(partSpeciesAliPID,(icharge==0)?kPositive:kNegative);
13517 fGFMatching = TOFmatchMC_geantflukaCorrection(partSpeciesAliPID,(icharge==0)?kPositive:kNegative,ntrd);
13518 TCanvas *cGF=new TCanvas("cGF","cGF");
13519 fGFTracking->SetLineColor(1);
13520 fGFTracking->DrawClone();
13521 fGFMatching->DrawClone("same");
13522 gPad->BuildLegend();
13525 Double_t maxEffValue=5;
13526 for (Int_t bin0 = 1; bin0<=effCorr->GetAxis(0)->GetNbins(); bin0++)
13527 for (Int_t bin1 = 1; bin1<=effCorr->GetAxis(1)->GetNbins(); bin1++)
13528 for (Int_t bin2 = 1; bin2<=effCorr->GetAxis(2)->GetNbins(); bin2++)
13529 for (Int_t bin3 = 1; bin3<=effCorr->GetAxis(3)->GetNbins(); bin3++)
13536 // 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));
13537 if(ApplyGFCorrection && partSpecies!=-1)
13539 if(effCorr->GetBinContent(nBins) > 0)
13541 Double_t pt=effCorr->GetAxis(1)->GetBinCenter(bin1);
13542 Double_t GFTracking=fGFTracking->Eval(pt);
13543 Double_t GFMatching=fGFMatching->Eval(pt);
13544 //printf("pt: %.3f GFCorrectionTracking: %f GFCorrectionMatching: %f",pt,GFTracking,GFMatching);
13545 //printf(" Eff before: %f",effCorr->GetBinContent(nBins));
13546 effCorr->SetBinContent(nBins,effCorr->GetBinContent(nBins)*GFTracking*GFMatching);
13547 //Printf(" Eff after: %f",effCorr->GetBinContent(nBins));
13551 if (effCorr->GetBinContent(nBins) > maxEffValue)
13553 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));
13554 effCorr->SetBinContent(nBins, 0);
13560 const Float_t fitRangeBegin = 5.01;
13561 const Float_t fitRangeEnd = 14.99;
13562 const Float_t extendRangeBegin = 8.01;
13563 Bool_t verbose = kTRUE;
13565 if (extrapolateHighpT)
13567 Printf("Extrapolating high pT...");
13569 for (Int_t bin0 = 1; bin0<=effCorr->GetAxis(0)->GetNbins(); bin0++)
13570 for (Int_t bin2 = 1; bin2<=effCorr->GetAxis(2)->GetNbins(); bin2++)
13571 for (Int_t bin3 = 1; bin3<=effCorr->GetAxis(3)->GetNbins(); bin3++)
13573 effCorr->GetAxis(0)->SetRange(bin0, bin0);
13574 effCorr->GetAxis(2)->SetRange(bin2, bin2);
13575 effCorr->GetAxis(3)->SetRange(bin3, bin3);
13577 if (gRandom->Uniform() < 0.02) verbose = kTRUE;
13579 proj = effCorr->Projection(1);
13581 if (proj->Integral(proj->FindBin(fitRangeBegin), proj->FindBin(fitRangeEnd)) <= 0)
13584 // Printf("%d %d %d %d %f", bin0, bin1, bin2, bin3, proj->Integral(proj->FindBin(fitRangeBegin), proj->FindBin(fitRangeEnd)));
13592 proj->Fit("pol0", (verbose) ? "+" : "Q0+", "SAME", fitRangeBegin, fitRangeEnd);
13594 if (!proj->GetFunction("pol0"))
13597 Float_t trackingEff = proj->GetFunction("pol0")->GetParameter(0);
13599 for (Int_t bin1 = 1; bin1<=effCorr->GetAxis(1)->GetNbins(); bin1++)
13601 if (effCorr->GetAxis(1)->GetBinCenter(bin1) < extendRangeBegin)
13609 // 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));
13610 effCorr->SetBinContent(nBins, trackingEff);
13617 effCorr->GetAxis(0)->UnZoom();
13618 effCorr->GetAxis(1)->UnZoom();
13619 effCorr->GetAxis(2)->UnZoom();
13620 effCorr->GetAxis(3)->UnZoom();
13623 Printf("%f", effCorr->GetEntries());
13625 TObjString tag2(Form("corrections from file %s with tag %s", fileName, tag));
13627 file = TFile::Open("correction.root", "RECREATE");
13633 effCorr->GetAxis(0)->SetRangeUser(-0.49, 0.49);
13634 effCorr->GetAxis(2)->SetRangeUser(65, 65);
13635 effCorr->GetAxis(3)->SetRangeUser(0.01, 0.01);
13636 effCorr->Projection(1)->Draw();
13639 void CompareEfficiencyCorrection(const char* fileName1, const char* fileName2, Int_t axis1, Int_t axis2)
13641 if (TString(fileName1).BeginsWith("alien") || TString(fileName2).BeginsWith("alien"))
13642 TGrid::Connect("alien:");
13644 file1 = TFile::Open(fileName1);
13645 corr1 = (THnBase*) file1->Get("correction");
13647 file2 = TFile::Open(fileName2);
13648 corr2 = (THnBase*) file2->Get("correction");
13650 corr1->GetAxis(0)->SetRangeUser(-1.19, 1.19);
13651 corr2->GetAxis(0)->SetRangeUser(-1.19, 1.19);
13652 corr1->GetAxis(1)->SetRangeUser(0.51, 3.99);
13653 corr2->GetAxis(1)->SetRangeUser(0.51, 3.99);
13654 corr1->GetAxis(3)->SetRangeUser(0.01, 0.01);
13655 corr2->GetAxis(3)->SetRangeUser(0.01, 0.01);
13657 proj1 = (TH1*) corr1->Projection(axis1, axis2)->Clone("proj1");
13658 new TCanvas; proj1->DrawCopy("COLZ");
13660 proj2 = (TH1*) corr2->Projection(axis1, axis2)->Clone("proj2");
13661 new TCanvas; proj2->DrawCopy("COLZ");
13663 proj1->Divide(proj2);
13664 new TCanvas; proj1->DrawCopy("COLZ");
13666 corr1->GetAxis(0)->SetRangeUser(-0.49, 0.49);
13667 corr2->GetAxis(0)->SetRangeUser(-0.49, 0.49);
13669 proj1 = (TH1*) corr1->Projection(axis2)->Clone("proj3");
13670 new TCanvas; proj1->DrawCopy();
13672 proj2 = (TH1*) corr2->Projection(axis2)->Clone("proj4");
13673 proj2->SetLineColor(2);
13674 proj2->DrawCopy("SAME");
13676 proj1->Divide(proj2);
13677 new TCanvas; proj1->DrawCopy();
13682 void PlotFake(const char* fileName, const char* fileName2 = 0)
13686 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13687 if (fileName2) AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
13689 TLegend* legend = new TLegend(0.7, 0.8, 0.95, 0.95);
13690 legend->SetFillColor(0);
13691 legend->SetTextSize(0.03);
13692 const char* title[] = {"0-20%", "20-40%", "40-60%", "60-80%", "80-100%"};
13693 TLegend* legend2 = new TLegend(0.7, 0.8, 0.95, 0.95);
13694 legend2->SetFillColor(0);
13695 legend2->SetTextSize(0.03);
13697 c1 = new TCanvas("c1", "Ratio of fakes", 1200, 800);
13699 c2 = new TCanvas("c2", "pTrec vs pT", 1200, 800);
13701 c3 = new TCanvas("c3", "pTrec pT ratio", 1200, 800);
13704 h->SetEtaRange(-0.79, 0.79);
13706 for (Int_t i=0; i<5; i++)
13708 // h->GetUEHist(2)->SetCentralityRange(100.0/5*i + 0.1, 100.0/5*(i+1) - 0.1);
13709 h->GetUEHist(2)->SetCentralityRange(0, 100);
13711 h->GetUEHist(2)->GetFakeRate()->DrawClone("COLZ");
13713 proj = h->GetUEHist(2)->GetFakeRate(1);
13714 proj->GetYaxis()->SetRangeUser(0,150);
13715 proj->SetLineColor((i==4) ? 6 : i+1);
13716 proj->DrawClone((i == 0) ? "" : "SAME");
13717 legend->AddEntry(proj, title[i] , "PL");
13723 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetXaxis()->SetTitle("p_{T,rec}");
13724 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetYaxis()->SetTitle("p_{T}");
13725 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetZaxis()->SetTitle("Centrality");
13726 h->GetUEHist(2)->GetMCRecoPtCorrelation()->DrawCopy();
13728 Float_t difference = 0.05;
13730 for (Int_t i=0; i<5; i++)
13733 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetZaxis()->SetRangeUser(100.0/5*i + 0.1,100.0/5*(i+1) - 0.1);
13734 hist = h->GetUEHist(2)->GetMCRecoPtCorrelation()->Project3D("yx");
13735 hist->DrawClone("COLZ");
13736 c2->cd(i+2)->SetLogz();
13738 TH1* MisreconstructedPtRate = h->GetUEHist(2)->GetMCRecoPtCorrelation()->ProjectionX("MisreconstructedPtRate");
13739 MisreconstructedPtRate->Reset();
13740 MisreconstructedPtRate->GetYaxis()->SetRangeUser(0,1);
13742 for (Int_t x=0; x<=hist->GetNbinsX(); x++)
13744 Float_t ptRec = hist->GetXaxis()->GetBinCenter(x);
13745 Float_t Misreconstructed = 0;
13746 Float_t Reconstructed = 0;
13747 for (Int_t y=0; y<=hist->GetNbinsY(); y++)
13749 Float_t pt = hist->GetYaxis()->GetBinCenter(y);
13750 Reconstructed += hist->GetBinContent(x,y);
13751 if (TMath::Abs(ptRec-pt)/pt > difference)
13752 Misreconstructed += hist->GetBinContent(x,y);
13754 if (Reconstructed!=0) MisreconstructedPtRate->Fill(ptRec,Misreconstructed/Reconstructed);
13756 MisreconstructedPtRate->SetLineColor((i==4) ? 6 : i+1);
13757 MisreconstructedPtRate->DrawClone();
13758 if (i==0) legend2->AddEntry(MisreconstructedPtRate, "2010" , "L");
13760 MisreconstructedPtRate->DrawClone((i == 0) ? "" : "SAME");
13763 h2->GetUEHist(2)->GetMCRecoPtCorrelation()->GetZaxis()->SetRangeUser(100.0/5*i + 0.1,100.0/5*(i+1) - 0.1);
13764 hist = h2->GetUEHist(2)->GetMCRecoPtCorrelation()->Project3D("yx");
13765 TH1* MisreconstructedPtRate2 = h2->GetUEHist(2)->GetMCRecoPtCorrelation()->ProjectionX("MisreconstructedPtRate2");
13766 MisreconstructedPtRate2->Reset();
13767 MisreconstructedPtRate2->GetYaxis()->SetRangeUser(0,1);
13768 for (Int_t x=0; x<=hist->GetNbinsX(); x++)
13770 Float_t ptRec = hist->GetXaxis()->GetBinCenter(x);
13771 Float_t Misreconstructed = 0;
13772 Float_t Reconstructed = 0;
13773 for (Int_t y=0; y<=hist->GetNbinsY(); y++)
13775 Float_t pt = hist->GetYaxis()->GetBinCenter(y);
13776 Reconstructed += hist->GetBinContent(x,y);
13777 if (TMath::Abs(ptRec-pt)/pt > difference)
13778 Misreconstructed += hist->GetBinContent(x,y);
13780 if (Reconstructed!=0) MisreconstructedPtRate2->Fill(ptRec,Misreconstructed/Reconstructed);
13783 MisreconstructedPtRate2->SetLineColor((i==2) ? 12 : i+8);
13784 MisreconstructedPtRate2->DrawClone("SAME");
13785 if (i==0) legend2->AddEntry(MisreconstructedPtRate2, "2011" , "L");
13786 legend2->DrawClone();
13793 void CompareCorrections(const char* fileName1, const char* fileName2)
13797 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
13798 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
13800 c = new TCanvas("c", "c", 1200, 800);
13802 TLegend* legend = new TLegend(0.7, 0.8, 0.95, 0.95);
13803 legend->SetFillColor(0);
13804 legend->SetTextSize(0.03);
13806 h1->SetEtaRange(-0.89, 0.89);
13807 h2->SetEtaRange(-0.89, 0.89);
13810 // const char* title1[] = {"2010, 0-10%", "2010, 10-20%", "2010, 20-30%", "2010, 30-40%", "2010, 40-50%"};
13811 const char* title1[] = {"FullTPC, 0-10%", "FullTPC, 10-20%", "FullTPC, 20-30%", "FullTPC, 30-40%", "FullTPC, 40-50%"};
13812 const char* title1[] = {"FullTPC, 0-10%", "FullTPC, 10-20%", "FullTPC, 20-30%", "FullTPC, 30-40%", "FullTPC, 40-50%"};
13813 // const char* title2[] = {"2011, 0-10%", "2011, 10-20%", "2011, 20-30%", "2011, 30-40%", "2011, 40-50%"};
13814 const char* title2[] = {"NotFullTPC, 0-10%", "NotFullTPC, 10-20%", "NotFullTPC, 20-30%", "NotFullTPC, 30-40%", "NotFullTPC, 40-50%"};
13816 Int_t colors[16] = { 1, 3, 2, 6, 4, 7, 8, 9, 11, 12, 28, 30, 36, 40, 46 };
13817 Int_t markers[16] = { 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 2, 5};
13819 for (Int_t i=0; i<5; i++)
13821 h1->GetUEHist(2)->SetCentralityRange(100.0/10*i + 0.1, 100.0/10*(i+1) - 0.1);
13822 h2->GetUEHist(2)->SetCentralityRange(100.0/10*i + 0.1, 100.0/10*(i+1) - 0.1);
13825 proj = h1->GetUEHist(2)->GetTrackingEfficiency(1);
13826 proj->SetLineColor(colors[6]);
13827 proj->SetMarkerColor(colors[6]);
13828 proj->SetMarkerStyle(markers[i]);
13829 proj->DrawClone((i == 0) ? "" : "SAME");
13830 legend->AddEntry(proj, title1[i] , "PL");
13832 proj = h2->GetUEHist(2)->GetTrackingEfficiency(1);
13833 proj->SetLineColor(colors[2]);
13834 proj->SetMarkerColor(colors[2]);
13835 proj->SetMarkerStyle(markers[i+5]);
13836 proj->SetMarkerStyle(markers[i]);
13837 proj->DrawClone("SAME");
13838 legend->AddEntry(proj, title2[i] , "PL");
13844 void ComparePPHIMixedEvent(const char* ppFile, const char* pbpbFile)
13848 AliUEHistograms* hpp = (AliUEHistograms*) GetUEHistogram(ppFile);
13849 AliUEHistograms* hpbpb = (AliUEHistograms*) GetUEHistogram(pbpbFile);
13852 hpp->SetPtRange(2, 10);
13853 ppEff = hpp->GetUEHist(2)->GetTrackingEfficiency(0);
13856 hpbpb->SetPtRange(2, 10);
13857 pbpbEff = hpbpb->GetUEHist(2)->GetTrackingEfficiency(0);
13858 pbpbEff->DrawCopy("SAME")->SetLineColor(2);
13861 ppEff2 = hpp->GetUEHist(2)->GetTrackingEfficiency(1);
13864 pbpbEff2 = hpbpb->GetUEHist(2)->GetTrackingEfficiency(1);
13865 pbpbEff2->DrawCopy("SAME")->SetLineColor(2);
13867 mixed = ComparePPHIMixedEventGetMixed(ppEff);
13868 mixed2 = ComparePPHIMixedEventGetMixed(pbpbEff);
13872 mixed2->DrawCopy("SAME")->SetLineColor(2);
13875 mixed->Divide(mixed2);
13879 TH1* ComparePPHIMixedEventGetMixed(TH1* eff)
13881 eff->Fit("pol0", "0W");
13882 Float_t avgEff = eff->GetFunction("pol0")->GetParameter(0);
13884 eff->Fit("pol0", "0W", "", -0.89, 0.89);
13885 Float_t avgEffCenter = eff->GetFunction("pol0")->GetParameter(0);
13886 Printf("Avg is %f and avg in center is %f", avgEff, avgEffCenter);
13888 TH1* mixed = new TH1F("mixed", "", 100, -2, 2);
13890 Float_t etaLimit = 1.0;
13894 for (Int_t i=0; i<n; i++)
13896 Float_t etaTrig = gRandom->Uniform(-etaLimit, etaLimit);
13898 for (Int_t j=0; j<n2; j++)
13900 Float_t etaAssoc = gRandom->Uniform(-etaLimit, etaLimit);
13902 if (gRandom->Uniform(0, 1) > eff->GetBinContent(eff->FindBin(etaAssoc)))
13905 mixed->Fill(etaTrig - etaAssoc);
13909 // mixed->Scale(1.0 / avgEffCenter);
13910 mixed->Scale(1.0 / avgEff);
13912 Printf("We have %f pairs and put in %d", mixed->Integral(), n*n2);
13917 void MACHConeEvolution(const char* fileName, const char* fileNameMixed = 0)
13921 if (!fileNameMixed)
13922 fileNameMixed = fileName;
13924 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13925 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileNameMixed, 0, kTRUE);
13927 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
13928 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
13934 gpTMin = assocPtArr[i] + 0.01;
13935 gpTMax = assocPtArr[i+1] - 0.01;
13937 for (Int_t centrBin = 0; centrBin < 5; centrBin++)
13939 Int_t centralityBegin = centrBin;
13940 Int_t centralityEnd = centrBin+1;
13943 SetupRanges(hMixed);
13947 Bool_t scaleToPairs = 0;
13949 GetDistAndFlow(h, hMixed, &hist, 0, step, centralityBegin, centralityEnd, leadingPtArr[j] + 0.01, leadingPtArr[j+1] - 0.01, 11, kTRUE, 0, scaleToPairs);
13950 hist->Rebin(2); hist->Scale(0.5);
13952 copy = hist->DrawCopy((centrBin == 0) ? "" : "SAME");
13953 copy->SetLineColor(centrBin+1);
13957 void PlotTwoTrackEfficiencyControlPlots(const char* fileName)
13960 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13962 Float_t ptRange[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0 };
13964 graph = new TGraphErrors;
13966 for (Int_t ptID = 0; ptID < 7; ptID++)
13968 c = new TCanvas(Form("c%d", ptID), Form("%.0f < pT < %.0f", ptRange[ptID], ptRange[ptID+1]), 800, 400);
13971 for (Int_t i=0; i<2; i++)
13974 h->GetTwoTrackDistance(i)->GetZaxis()->SetRangeUser(ptRange[ptID] + 0.01, ptRange[ptID+1] - 0.01);
13975 p = h->GetTwoTrackDistance(i)->Project3D(Form("yx_%d_%d", i, ptID));
13979 pc = (TH2*) p->Clone("pc");
13982 p->DrawCopy("COLZ");
13986 // reduce to one quadrant
13987 for (Int_t x=1; x<=p->GetNbinsX(); x++)
13988 for (Int_t y=1; y<=p->GetNbinsY(); y++)
13989 pc->Fill(TMath::Abs(p->GetXaxis()->GetBinCenter(x)), TMath::Abs(p->GetYaxis()->GetBinCenter(y)), p->GetBinContent(x, y));
13992 copy = pc->DrawCopy("COLZ");
13993 copy->GetXaxis()->SetRangeUser(0, 10);
13994 copy->GetYaxis()->SetRangeUser(0.00101, 10);
13999 Float_t center = pc->Integral(pc->GetXaxis()->FindBin(0), pc->GetXaxis()->FindBin(0.009999), 1, pc->GetNbinsY());
14000 Float_t outside = pc->Integral(pc->GetXaxis()->FindBin(0.01001), pc->GetXaxis()->FindBin(0.04999), 1, pc->GetNbinsY());
14002 Float_t excess1 = center - outside / 4;
14004 Float_t center = pc->Integral(pc->GetXaxis()->FindBin(0), pc->GetXaxis()->FindBin(0.001999), 1, pc->GetNbinsY());
14005 Float_t outside = pc->Integral(pc->GetXaxis()->FindBin(0.002001), pc->GetXaxis()->FindBin(0.00999), 1, pc->GetNbinsY());
14007 Float_t excess2 = center - outside / 4;
14009 Printf("%d %f %f", ptID, excess1, excess2);
14015 p2 = ((TH2*)pc)->ProjectionX("p2", 52, 52+4);
14016 // p3 = ((TH2*)p)->ProjectionX("p3", 49-4, 49);
14018 //new TCanvas; p2->Draw();
14020 p2->Fit("pol0", "0");
14021 Float_t avg = p2->GetFunction("pol0")->GetParameter(0);
14022 p2->Fit("pol0", "0", "", -0.002, 0.002);
14023 Float_t min = p2->GetFunction("pol0")->GetParameter(0);
14024 Float_t mine = p2->GetFunction("pol0")->GetParError(0);
14028 graph->SetPoint(graph->GetN(), ptRange[ptID], min / avg);
14029 graph->SetPointError(graph->GetN()-1, 0, mine / avg);
14035 c->SaveAs(Form("twotrack_pt_%d_%d.png", (Int_t) ptRange[ptID], (Int_t) ptRange[ptID+1]));
14036 c->SaveAs(Form("twotrack_pt_%d_%d.eps", (Int_t) ptRange[ptID], (Int_t) ptRange[ptID+1]));
14044 void PlotTwoTrackEfficiencyControlPlots2(const char* fileName)
14047 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14049 Float_t ptRange[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0 };
14051 graph = new TGraphErrors;
14053 for (Int_t ptID = 0; ptID < 5; ptID++)
14055 c = new TCanvas(Form("c%d", ptID), Form("%.0f < pT < %.0f", ptRange[ptID], ptRange[ptID+1]), 1200, 400);
14060 for (Int_t i=0; i<3; i++)
14063 gPad->SetRightMargin(0.2);
14067 h->GetTwoTrackDistance(i)->GetZaxis()->SetRangeUser(ptRange[ptID] + 0.01, ptRange[ptID+1] - 0.01);
14068 p = (TH2*) h->GetTwoTrackDistance(i)->Project3D(Form("yx_%d_%d", i, ptID));
14072 // reduce to one quadrant
14073 pc = (TH2*) p->Clone(Form("%s_pc", p->GetName()));
14076 for (Int_t x=1; x<=p->GetNbinsX(); x++)
14077 for (Int_t y=1; y<=p->GetNbinsY(); y++)
14078 pc->Fill(TMath::Abs(p->GetXaxis()->GetBinCenter(x)), TMath::Abs(p->GetYaxis()->GetBinCenter(y)), p->GetBinContent(x, y));
14079 pc->GetXaxis()->SetRangeUser(0, 100);
14080 pc->GetYaxis()->SetRangeUser(0, 100);
14087 p->DrawCopy("COLZ");
14093 proj[0]->Divide(proj[1]);
14094 proj[0]->SetStats(0);
14096 // 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);
14097 Float_t scale = proj[0]->Integral(1, proj[1]->GetNbinsX(), 1, proj[1]->GetNbinsY()) / proj[1]->GetNbinsX() / proj[1]->GetNbinsY();
14098 proj[0]->Scale(1./ scale / 4);
14099 proj[0]->DrawCopy("COLZ");
14105 void PlotTwoTrackEfficiencyControlPlots3(const char* fileName, Int_t histID = 0)
14108 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14109 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14111 Float_t ptRange[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0 };
14113 graph = new TGraphErrors;
14115 for (Int_t ptID = 0; ptID < 5; ptID++)
14117 c = new TCanvas(Form("c%d", ptID), Form("%.0f < pT < %.0f", ptRange[ptID], ptRange[ptID+1]), 1200, 400);
14122 for (Int_t i=0; i<3; i++)
14125 gPad->SetRightMargin(0.2);
14129 AliUEHistograms* input = ((i == 0) ? h : hMixed);
14130 input->GetTwoTrackDistance(histID)->GetZaxis()->SetRangeUser(ptRange[ptID] + 0.01, ptRange[ptID+1] - 0.01);
14131 p = (TH2*) input->GetTwoTrackDistance(histID)->Project3D(Form("yx_%d_%d", i, ptID));
14135 // reduce to one quadrant
14136 pc = (TH2*) p->Clone(Form("%s_pc", p->GetName()));
14138 // pc->Rebin2D(2, 2);
14139 for (Int_t x=1; x<=p->GetNbinsX(); x++)
14140 for (Int_t y=1; y<=p->GetNbinsY(); y++)
14141 pc->Fill(TMath::Abs(p->GetXaxis()->GetBinCenter(x)), TMath::Abs(p->GetYaxis()->GetBinCenter(y)), p->GetBinContent(x, y));
14142 pc->GetXaxis()->SetRangeUser(0, 100);
14143 pc->GetYaxis()->SetRangeUser(0, 100);
14150 p->DrawCopy("COLZ");
14156 Float_t scale = proj[0]->Integral() / proj[1]->Integral();
14157 proj[0]->Divide(proj[1]);
14158 proj[0]->SetStats(0);
14160 // 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);
14161 // Float_t scale = proj[0]->Integral(1, proj[1]->GetNbinsX(), 1, proj[1]->GetNbinsY()) / proj[1]->GetNbinsX() / proj[1]->GetNbinsY();
14162 proj[0]->Scale(1./ scale);
14163 // proj[0]->Scale(1./ scale / 4);
14164 proj[0]->DrawCopy("COLZ");
14172 void SystematicpTResolution(const char* inputYield, Int_t caseId = 18, Int_t triggerId = 1)
14174 // Study by Jacek comparing TPC only tracks with global tracks for new cuts (crossed rows) (Fwd by Andrew, 07.07.11)
14175 // Resolution from tpc only tracks twice as worse than global tracks
14176 // Parameterization for tpc-only tracks:
14177 // f(pT) = a * pT * sqrt(1+b/(pT^abs(c)))
14178 // a = 0.003; b = 2.08; c = 7.07e-7
14179 Float_t a = 0.003; Float_t b = 2.08; Float_t c = 7.07e-7;
14180 res = new TF1("res", "[0] * x * sqrt(1+[1]/(x**abs([2])))", 0, 15);
14181 res->SetParameters(a, b, c);
14182 // res->Draw(); return;
14184 ReadYields(inputYield);
14186 for (Int_t side = 0; side < 2; side++)
14188 for (Int_t centrality = 0; centrality < 4; centrality++)
14190 TGraphErrors** tmp = yields[side][triggerId][centrality];
14191 graph = tmp[caseId];
14193 // graph->DrawClone("A*");
14195 Float_t axisLimits[20];
14196 for (Int_t i=0; i<graph->GetN(); i++)
14198 axisLimits[i] = graph->GetX()[i] - graph->GetEX()[i];
14199 axisLimits[i+1] = graph->GetX()[i] + graph->GetEX()[i];
14202 hist = new TH1F("hist", "", graph->GetN(), axisLimits);
14204 for (Int_t i=0; i<graph->GetN(); i++)
14206 gaus = new TF1("gaus", "gaus(0)", 0, 15);
14207 Float_t sigma = graph->GetX()[i] * res->Eval(graph->GetX()[i]);
14208 Float_t norm = graph->GetY()[i] / TMath::Sqrt(2 * TMath::Pi()) / sigma;
14209 gaus->SetParameters(norm, graph->GetX()[i], sigma);
14210 // gaus->Draw("SAME");
14211 // Printf("%f %f", graph->GetY()[i], gaus->Integral(0, 20));
14214 for (Int_t j=1; j<=hist->GetNbinsX(); j++)
14215 hist->SetBinContent(j, hist->GetBinContent(j) + gaus->Integral(hist->GetBinLowEdge(j), hist->GetXaxis()->GetBinUpEdge(j)));
14218 // hist->Draw("SAME"); return;
14220 for (Int_t i=0; i<graph->GetN(); i++)
14221 graph->GetY()[i] = hist->GetBinContent(i+1);
14223 // graph->SetMarkerColor(2); graph->DrawClone("*SAME");
14228 void DrawProcessIDPlot(const char* fileName)
14232 TFile::Open(fileName);
14233 list = (TList*) gFile->Get("PWG4_PhiCorrelations/histosPhiCorrelations");
14234 ((TH1*) list->FindObject("processIDs"))->Draw();
14237 void GetExampleDphi(const char* fileName)
14241 Int_t leadingPtOffset = 1;
14243 Int_t maxLeadingPt = 5;
14244 Int_t maxAssocPt = 6;
14247 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 15.0, 20.0 };
14248 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
14252 Float_t leadingPtArr[] = { 0.15, 10.0 };
14253 Float_t assocPtArr[] = { 0.15, 10.0 };
14255 leadingPtOffset = 1;
14257 // AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14258 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14262 // h->SetZVtxRange(-0.99, 0.99);
14263 hMixed->SetZVtxRange(-0.99, 0.99);
14269 gpTMin = assocPtArr[j] + 0.01;
14270 gpTMax = assocPtArr[j+1] - 0.01;
14273 SetupRanges(hMixed);
14276 bin[0] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(0)->FindBin(0.01);
14277 bin[1] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(1)->FindBin(1.1);
14278 bin[2] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(2)->FindBin(2.1);
14279 bin[3] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(3)->FindBin(5.5);
14280 bin[4] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(4)->FindBin(0);
14281 if (hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5))
14282 bin[5] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5)->FindBin(0);
14283 Printf("tracks: %f +- %f", hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetBinContent(bin), hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetBinError(bin));
14285 bin[0] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(2)->FindBin(2.1);
14286 bin[1] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(3)->FindBin(5.5);
14287 if (hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5))
14288 bin[2] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5)->FindBin(0);
14289 Printf("events: %f +- %f", hMixed->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetBinContent(bin), hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetBinError(bin));
14293 Int_t stepMixed = 6;
14294 TH2* mixedTwoD = (TH2*) hMixed->GetUEHist(2)->GetUEHist(stepMixed, 0, leadingPtArr[i+leadingPtOffset], leadingPtArr[i+1+leadingPtOffset], 12, 13, 1, kFALSE);
14296 TH1* proj = mixedTwoD->ProjectionX("px", 11, 30);
14302 func = new TF1("func", "gaus(0)", -2, 2);
14303 func->SetParameters(1, 0, 0.5);
14305 hist = new TH1F("hist", "", 100, -2, 2);
14306 hist->FillRandom("func", 10000);
14308 func = new TF1("func", "gaus(0)", -2, 2);
14309 func->SetParLimits(2, 0, 10);
14310 func->FixParameter(1, 0);
14311 func->SetParameters(2, 0, 0.1);
14312 hist->Fit(func, "", "", -1, 1);
14315 func2 = new TF1("func2", "gaus(0)+[3]", -2, 2);
14316 func2->SetParLimits(2, 0, 10);
14317 func2->FixParameter(1, 0);
14318 func2->SetParameters(2, 0, 0.1, 0);
14319 func2->SetLineColor(2);
14320 hist->Fit(func2, "+", "", -1, 1);
14325 constant = new TF1("constant", "1", -2, 2);
14326 hist->Add(constant, -30);
14327 func->SetParameters(2, 0, 0.1);
14328 hist->Fit(func, "", "", -1, 1);
14331 void GaussToyFit2()
14333 func = new TF2("func", "[0]*exp(-0.5*((x/[1])**2+(y/[2])**2))", -2, 2, -2, 2);
14334 func->SetParameters(1, 0.4, 0.6);
14336 hist = new TH2F("hist", "", 100, -2, 2, 100, -2, 2);
14337 hist->FillRandom("func", 100000);
14339 func = new TF2("func", "[0]*exp(-0.5*((x/[1])**2+(y/[2])**2))", -2, 2, -2, 2);
14340 func->SetParameters(1, 0.2, 0.2);
14341 hist->Fit(func, "", "");
14345 hist->ProjectionX()->Fit("gaus");
14348 hist->ProjectionY()->Fit("gaus");
14351 void AcceptanceToy()
14353 // study a la Jan Rak presented in Corr PAG on 06.03.12
14355 hist = new TH1F("hist", "", 200, -1.5, 1.5);
14357 Float_t sigma = 0.3;
14358 for (Int_t i=0; i<1000000; i++)
14361 Float_t mean = gRandom->Uniform(-5, 5);
14363 Float_t trig = gRandom->Gaus(mean, sigma);
14364 Float_t assoc = gRandom->Gaus(mean, sigma);
14366 // Float_t trig = gRandom->Uniform(-5, 5);
14367 // Float_t assoc = gRandom->Uniform(-5, 5);
14369 /* if (trig < 0 && assoc < trig)
14371 if (trig > 0 && assoc > trig)
14374 if (TMath::Abs(trig) < 1 && TMath::Abs(assoc) < 1)
14375 // hist->Fill(trig - assoc);
14376 hist->Fill(trig - assoc, 1.0 / (1.0 - TMath::Abs(trig-assoc) / 2));
14380 hist->Fit("gaus", "", "", -1.5, 1.5);
14381 Printf("%f %f %f", sigma, hist->GetFunction("gaus")->GetParameter(2), hist->GetFunction("gaus")->GetParameter(2) / TMath::Sqrt(2));
14382 hist->GetFunction("gaus")->SetLineColor(2);
14385 void DrawEfficiency(const char* fileName, Int_t step1, Int_t step2)
14392 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14393 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14396 SetupRanges(hMixed);
14401 GetDistAndFlow(h, hMixed, &hist1, 0, step1, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
14402 GetDistAndFlow(h, hMixed, &hist2, 0, step2, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
14404 ((TH2*)hist1)->Rebin2D(2, 2);
14405 ((TH2*)hist2)->Rebin2D(2, 2);
14407 new TCanvas("c", "c", 800, 800);
14408 gPad->SetLeftMargin(0.15);
14409 hist1->SetTitle("");
14410 hist1->GetYaxis()->SetRangeUser(-1.39, 1.39);
14411 hist1->GetXaxis()->SetTitleOffset(1.5);
14412 hist1->GetYaxis()->SetTitleOffset(2);
14413 hist1->SetStats(kFALSE);
14414 hist1->DrawCopy("SURF1");
14416 new TCanvas("c2", "c2", 800, 800);
14417 gPad->SetLeftMargin(0.15);
14418 hist2->SetTitle("");
14419 hist2->GetYaxis()->SetRangeUser(-1.39, 1.39);
14420 hist2->GetXaxis()->SetTitleOffset(1.5);
14421 hist2->GetYaxis()->SetTitleOffset(2);
14422 hist2->SetStats(kFALSE);
14423 hist2->DrawCopy("SURF1");
14425 hist2->Divide(hist1);
14427 new TCanvas("c3", "c3", 800, 800);
14428 gPad->SetLeftMargin(0.15);
14429 hist2->SetTitle("");
14430 hist2->GetYaxis()->SetRangeUser(-1.39, 1.39);
14431 hist2->GetXaxis()->SetTitleOffset(1.5);
14432 hist2->GetYaxis()->SetTitleOffset(2);
14433 hist2->SetStats(kFALSE);
14434 hist2->Draw("SURF1");
14437 void RewriteObjects(const char* fileName)
14441 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14442 Int_t nAxes = ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0)->GetNVar());
14443 Printf("We have %d axes", nAxes);
14445 TString histId; histId.Form("%dRC", nAxes-1);
14446 Printf("%s", histId.Data());
14448 AliUEHistograms* hNew = new AliUEHistograms(h->GetName(), histId);
14452 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14453 AliUEHistograms* hMixedNew = new AliUEHistograms(hMixed->GetName(), histId);
14454 hMixedNew->DeepCopy(hMixed);
14457 TString newFileName(fileName);
14458 newFileName.ReplaceAll(".root", "");
14459 newFileName += "_rebinned.root";
14463 list->Add(hMixedNew);
14465 file3 = TFile::Open(newFileName, "RECREATE");
14466 file3->mkdir("PWG4_PhiCorrelations");
14467 file3->cd("PWG4_PhiCorrelations");
14468 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14472 void CondenseCentrality(const char* fileName, Float_t targetValue, Int_t step = 0, Float_t from = 0, Float_t to = -1)
14476 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14477 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14479 h->GetUEHist(2)->CondenseBin(step, 3, 1, targetValue, from, to);
14480 hMixed->GetUEHist(2)->CondenseBin(step, 3, 1, targetValue, from, to);
14482 Float_t events = h->GetCentralityDistribution()->Integral();
14483 h->GetCentralityDistribution()->Reset();
14484 h->GetCentralityDistribution()->Fill(targetValue, events);
14486 events = hMixed->GetCentralityDistribution()->Integral();
14487 hMixed->GetCentralityDistribution()->Reset();
14488 hMixed->GetCentralityDistribution()->Fill(targetValue, events);
14490 TString newFileName(fileName);
14491 newFileName.ReplaceAll(".root", "");
14492 newFileName += "_condensed.root";
14498 file3 = TFile::Open(newFileName, "RECREATE");
14499 file3->mkdir("PWG4_PhiCorrelations");
14500 file3->cd("PWG4_PhiCorrelations");
14501 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14505 void SymmetrizepTBins(const char* fileName)
14507 // copy pt,a < pt,t bins to pt,a > pt,t
14512 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, &list);
14513 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14515 h->GetUEHist(2)->SymmetrizepTBins();
14516 hMixed->GetUEHist(2)->SymmetrizepTBins();
14518 TString newFileName(fileName);
14519 newFileName.ReplaceAll(".root", "");
14520 newFileName += "_symmetrized.root";
14522 file3 = TFile::Open(newFileName, "RECREATE");
14523 file3->mkdir("PWG4_PhiCorrelations");
14524 file3->cd("PWG4_PhiCorrelations");
14525 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14529 void PtDistributions(Int_t step = 8, Float_t centralityBegin = 1, Float_t centralityEnd = 10)
14533 // 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" };
14535 // const char* fileNames[] = { "LHC10h_AOD086_120411_zvtx_rebinned.root", "LHC10h_AOD086_120411_hybrid_zvtx_rebinned.root", "LHC10h_AOD086_120430_raacuts_zvtx_rebinned.root" };
14536 const char* fileNames[] = { "pt_pos.root", "pt_neg.root" };
14537 // const char* fileNames[] = { "LHC11a10a_bis_AOD090_120406_zvtx.root" };
14539 // Float_t eventCount[] = { 1098234., 1034306., 1369707. };
14540 // Float_t eventCount[] = { 987360.000000, 930278.000000, 1231806.000000 };
14541 Float_t eventCount[] = { 1., 1. };
14546 for (Int_t i=0; i<2; i++)
14548 /* AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNames[i]);
14550 h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
14551 ptDist = h->GetUEHist(2)->GetEventHist()->Project(step, 0);*/
14553 /* eventCount = h->GetEventCount();
14554 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));*/
14555 Float_t events = eventCount[i];
14557 TFile::Open(fileNames[i]);
14558 ptDist = (TH2*) gFile->Get("ptDist");
14560 ptDistProj = ptDist->ProjectionX(Form("ptDistProj_%d", i), ptDist->GetYaxis()->FindBin(0.01 + centralityBegin), ptDist->GetYaxis()->FindBin(-0.01 + centralityEnd));
14562 // new TCanvas; ptDistProj->Draw(); gPad->SetLogy();
14565 ptDistProj->Scale(1.0 / events);
14567 ptDistProj->SetLineColor(i+1);
14568 ptDistProj->DrawCopy((i == 0) ? "" : "SAME");
14570 pt[i] = (TH1*) ptDistProj->Clone(Form("clone_%d", i));
14575 for (Int_t i=1; i<2; i++)
14577 pt[i]->Divide(pt[0]);
14578 pt[i]->DrawCopy((i == 1) ? "" : "SAME");
14582 void test(const char* fileNameESD)
14587 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD);
14591 ptDist = (TH2*) esd->GetUEHist(2)->GetEventHist()->Project(step, 0, 1);
14593 Printf("%f", ptDist->Integral());
14596 void CorrectPtDistribution(const char* fileNameCorrections, const char* fileNameESD, const char* outputFile)
14602 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
14605 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD, &list);
14610 corr->SetEtaRange(-0.89, 0.89);
14611 corr->ExtendTrackingEfficiency(0);
14613 eff = corr->GetUEHist(2)->GetTrackingEfficiencyCorrectionCentrality();
14614 new TCanvas; eff->Draw("COLZ");
14616 cont = corr->GetUEHist(2)->GetTrackingContaminationCentrality();
14617 new TCanvas; cont->Draw("COLZ");
14619 ptDist = (TH2*) esd->GetUEHist(2)->GetEventHist()->Project(step, 0, 1);
14620 ptDist->SetStats(0);
14621 new TCanvas; ptDist->DrawCopy("COLZ");
14623 for (Int_t x=1; x<=ptDist->GetNbinsX(); x++)
14624 for (Int_t y=1; y<=ptDist->GetNbinsY(); y++)
14626 Float_t factor = eff->GetBinContent(eff->GetXaxis()->FindBin(ptDist->GetXaxis()->GetBinCenter(x)), eff->GetYaxis()->FindBin(ptDist->GetYaxis()->GetBinCenter(y)));
14627 Float_t contFactor = cont->GetBinContent(cont->GetXaxis()->FindBin(ptDist->GetXaxis()->GetBinCenter(x)), cont->GetYaxis()->FindBin(ptDist->GetYaxis()->GetBinCenter(y)));
14629 printf("%f", contFactor);
14630 if (contFactor > 0)
14631 contFactor = 1.0 + 1.1 * (contFactor - 1.0);
14632 printf(" --> %f\n", contFactor);
14634 factor *= contFactor;
14636 ptDist->SetBinContent(x, y, ptDist->GetBinContent(x, y) * factor);
14637 ptDist->SetBinError(x, y, ptDist->GetBinError(x, y) * factor);
14640 new TCanvas; ptDist->DrawCopy("COLZ");
14642 file3 = TFile::Open(outputFile, "RECREATE");
14643 ptDist->Write("ptDist");
14651 void CorrectPtDistributionAll()
14653 CorrectPtDistribution("LHC11a10a_bis_AOD090_120406.root", "LHC10h_AOD086_120411_zvtx_rebinned.root", "ptdist1.root");
14654 CorrectPtDistribution("LHC11a10a_bis_AOD090_120505_zvtx_hybrid.root", "LHC10h_AOD086_120411_hybrid_zvtx_rebinned.root", "ptdist2.root");
14655 CorrectPtDistribution("LHC11a10a_bis_AOD090_120505_zvtx_raa.root", "LHC10h_AOD086_120430_raacuts_zvtx_rebinned.root", "ptdist3.root");
14658 void CreateNormalizationTestObject(Bool_t addRidge = kFALSE)
14661 gSystem->Load("libPWGCFCorrelationsDPhi");
14663 AliUEHistograms* hNew = new AliUEHistograms("AliUEHistogramsSame", "5RC");
14665 // fill 1000 particles in one bin
14666 TObjArray* particles = new TObjArray;
14667 particles->Add(new AliDPhiBasicParticle(0, 0, 3.5, 1));
14668 for (Int_t i=0; i<2000; i++)
14669 particles->Add(new AliDPhiBasicParticle(gRandom->Gaus(0, 0.3), gRandom->Gaus(0, 0.3), 1.75, 1));
14671 hNew->FillCorrelations(61, 0, 8, particles);
14675 for (Int_t i=0; i<10000; i++)
14676 particles->Add(new AliDPhiBasicParticle(gRandom->Uniform(-2, 2), gRandom->Gaus(0, 0.5), 1.75, 1));
14679 hNew->FillCorrelations(0.5, 0, 8, particles);
14681 // fill flat mixed event
14682 AliUEHistograms* hMixedNew = new AliUEHistograms("AliUEHistogramsMixed", "5RC");
14683 THnSparse* sparse = hMixedNew->GetUEHist(2)->GetTrackHist(0)->GetGrid(8)->GetGrid();
14684 for (Int_t x=1; x<=sparse->GetAxis(0)->GetNbins(); x++)
14685 for (Int_t y=1; y<=sparse->GetAxis(4)->GetNbins(); y++)
14688 bin[0] = sparse->GetAxis(0)->GetBinCenter(x);
14689 bin[4] = sparse->GetAxis(4)->GetBinCenter(y);
14711 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14714 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14718 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14721 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14723 ((AliTHn*) hNew->GetUEHist(2)->GetTrackHist(0))->FillParent();
14724 ((AliTHn*) hNew->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
14726 ((AliTHn*) hMixedNew->GetUEHist(2)->GetTrackHist(0))->FillParent();
14727 ((AliTHn*) hMixedNew->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
14731 list->Add(hMixedNew);
14733 file3 = TFile::Open("norm.root", "RECREATE");
14734 file3->mkdir("PWG4_PhiCorrelations");
14735 file3->cd("PWG4_PhiCorrelations");
14736 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14740 void CompareSumOfRatiosAndDefault(const char* fileName, Int_t bin, Int_t step)
14744 Int_t centralityFrom = 0;
14745 Int_t centralityTo = 20;
14750 Float_t ptTrigBegin = 2.01;
14751 Float_t ptTrigEnd = 3.99;
14755 ptTrigBegin = 1.01;
14762 ptTrigBegin = 0.49;
14766 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14767 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14770 SetupRanges(hMixed);
14774 GetSumOfRatios(h, hMixed, &hist1, step, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, kTRUE);
14775 GetDistAndFlow(h, hMixed, &hist2, 0, step, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE);
14777 hist1->Rebin2D(2, 2); hist1->Scale(0.25);
14778 hist2->Rebin2D(2, 2); hist2->Scale(0.25);
14780 c = new TCanvas("c", "c", 1000, 1000);
14784 hist1->DrawCopy("SURF1");
14787 hist2->DrawCopy("SURF1");
14790 proj1 = ((TH2*) hist1)->ProjectionY("proj1", hist1->GetXaxis()->FindBin(-0.99), hist1->GetXaxis()->FindBin(0.99));
14792 proj2 = ((TH2*) hist2)->ProjectionY("proj2", hist2->GetXaxis()->FindBin(-0.99), hist2->GetXaxis()->FindBin(0.99));
14793 proj2->SetLineColor(2);
14794 proj2->DrawCopy("SAME");
14797 proj1->Divide(proj1, proj2, 1, 1, "B");
14801 hist1->Divide(hist2);
14802 hist1->DrawCopy("SURF1");
14805 void PtDistribution(const char* fileName, Int_t step, Int_t bin = 0)
14807 Int_t centralityFrom = 0;
14808 Int_t centralityTo = 80;
14810 Float_t ptTrigBegin = 2.01;
14811 Float_t ptTrigEnd = 3.99;
14815 ptTrigBegin = 1.01;
14820 ptTrigBegin = 0.51;
14826 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14828 Int_t centralityBeginBin = 0;
14829 Int_t centralityEndBin = -1;
14831 if (centralityTo >= centralityFrom)
14833 centralityBeginBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityFrom);
14834 centralityEndBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityTo);
14837 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);
14838 pt2 = h->GetUEHist(2)->GetPtHist(step, 0, ptTrigBegin, ptTrigEnd, centralityBeginBin, centralityEndBin, -0.5, 0.5, -1.99, 1.99);
14842 pt2->SetLineColor(2);
14843 pt2->DrawCopy("SAME");
14846 // TODO proper subtraction, to get the pT distribution in the peak
14849 void GetRefMultiplicity(const char* fileNameESD, const char* tag = "")
14855 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD, 0, kFALSE, tag);
14857 Float_t centrBins[] = { 0, 20, 40, 60, 100 };
14858 // Float_t centrBins[] = { 0, 100 };
14860 // NOTE Run it on data with limited zvtx range so that there are no empty bins in the corrections!
14862 for (Int_t i=0; i<4; i++)
14864 Float_t centrBegin = centrBins[i] + 0.1;
14865 Float_t centrEnd = centrBins[i+1] - 0.1;
14866 esd->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(centrBegin, centrEnd);
14868 ptDist = (TH2*) esd->GetUEHist(2)->GetEventHist()->Project(step, 0);
14870 centrDist = esd->GetCentralityDistribution();
14874 // add syst from R_pA
14875 for (Int_t j=1; j<=ptDist->GetNbinsX(); j++)
14876 ptDist->SetBinError(j, TMath::Sqrt(ptDist->GetBinError(j) * ptDist->GetBinError(j) + 0.052 * 0.052 * ptDist->GetBinContent(j) * ptDist->GetBinContent(j)));
14879 Float_t events = centrDist->Integral(centrDist->FindBin(centrBegin), centrDist->FindBin(centrEnd));
14880 Double_t error = 0;
14881 // Float_t integral = ptDist->IntegralAndError(ptDist->FindBin(0.51), ptDist->FindBin(3.99), error);
14882 Float_t integral = ptDist->IntegralAndError(ptDist->FindBin(0.51), ptDist->FindBin(7.99), error);
14883 Printf("%d: %f +- %f %f --> %f +- %F", i, integral, error, events, integral / events, error / events);
14885 ptDist->Scale(1.0 / events);
14886 // ptDist->Scale(1.0 / integral);
14888 // ptDist->Rebin(2);
14890 NormalizeToBinWidth(ptDist);
14891 ptDist->SetLineColor(i + 1);
14892 ptDist->DrawCopy((i == 0) ? "" : "SAME");
14896 TFile::Open("dNdPt_pPb_lab_MinBias_NEW.root");
14897 comparison = (TH1*) gFile->Get("dNdPt_pPb_eta08_stat");
14898 comparison->Scale(1.6); // normalize to my eta range
14899 comparison->SetLineColor(2);
14900 comparison->DrawCopy("SAME");
14903 for (Int_t i=1; i<=comparison->GetNbinsX(); i++)
14905 // multiply by bin width
14906 comparison->SetBinContent(i, comparison->GetBinContent(i) * comparison->GetBinWidth(i));
14907 comparison->SetBinError(i, comparison->GetBinError(i) * comparison->GetBinWidth(i));
14910 Float_t integral = comparison->IntegralAndError(comparison->FindBin(0.51), comparison->FindBin(7.99), error);
14911 Float_t integral2 = comparison->IntegralAndError(comparison->FindBin(0.51), comparison->FindBin(19.99), error);
14912 Printf("%f %f", integral, integral2);
14914 Float_t integral = comparison->IntegralAndError(comparison->FindBin(0.51), comparison->FindBin(7.99), error);
14915 Float_t integral2 = comparison->IntegralAndError(comparison->FindBin(0.61), comparison->FindBin(7.99), error);
14916 Printf("%f %f", integral, integral2);
14918 rebinned = comparison->Rebin(ptDist->GetNbinsX(), "rebinned", ptDist->GetXaxis()->GetXbins()->GetArray());
14921 NormalizeToBinWidth(rebinned);
14922 rebinned->Draw("SAME");
14925 ptDist->Divide(rebinned);
14931 syst = (TH1*) gFile->Get("dNdPt_pPb_eta08_syst");
14935 for (Int_t i=1; i<=syst->GetNbinsX(); i++)
14937 if (syst->GetBinContent(i) > 0)
14938 syst->SetBinContent(i, syst->GetBinError(i) / syst->GetBinContent(i));
14939 syst->SetBinError(i, 0);
14944 void CheckBin(const char* fileName)
14948 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14949 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14951 sparse = h->GetUEHist(2)->GetTrackHist(0)->GetGrid(8)->GetGrid();
14952 sparse->GetAxis(1)->SetRangeUser(5, 5.1);
14953 sparse->GetAxis(2)->SetRangeUser(7, 7.1);
14954 sparse->GetAxis(3)->SetRangeUser(90, 91);
14955 sparse->GetAxis(4)->SetRangeUser(9, 9.1);
14958 sparse->Projection(0, 4)->Draw("colz");
14960 sparse = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(8)->GetGrid();
14961 sparse->GetAxis(1)->SetRangeUser(5, 5.1);
14962 sparse->GetAxis(2)->SetRangeUser(7, 7.1);
14963 sparse->GetAxis(3)->SetRangeUser(90, 91);
14964 sparse->GetAxis(4)->SetRangeUser(9, 9.1);
14967 sparse->Projection(0, 4)->Draw("colz");
14970 void GetCorrectedYields(const char* fileName, const char* correctionFile, const char* tagCorrections = "", Int_t partSpecies=-1 )
14974 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14976 // centrality, pT, eta
14977 yieldsUncorr = h->GetYield();
14978 new TCanvas; yieldsUncorr->DrawCopy();
14979 // new TCanvas; yieldsUncorr->ProjectionX("x1")->DrawCopy();
14981 AliUEHistograms* hCorr = (AliUEHistograms*) GetUEHistogram(correctionFile, 0, kFALSE, tagCorrections);
14982 if(partSpecies!=-1){
14983 Double_t epsilon=0.001;
14984 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
14985 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(4)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
14988 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->GetAxis(4)->SetRangeUser(-1.9, 1.9);
14989 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(2)->GetGrid()->GetAxis(4)->SetRangeUser(-1.9, 1.9);
14990 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(4)->GetGrid()->GetAxis(4)->SetRangeUser(-1.9, 1.9);
14993 TH2* generated = hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->Projection(1, 0);
14994 TH2* measured = hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid((partSpecies==-1)?2:4)->GetGrid()->Projection(1, 0);
14996 Printf("%f %f", generated->GetEntries(), measured->GetEntries());
14998 new TCanvas; generated->Draw("COLZ");
14999 new TCanvas; measured->Draw("COLZ");
15001 effCorr = (TH2*) generated->Clone("correction");
15002 effCorr->Divide(generated, measured, 1, 1, "B");
15004 new TCanvas; effCorr->Draw("COLZ");
15008 yieldsCorr = (TH3F*) yieldsUncorr->Clone("fYieldsCorr");
15009 yieldsCorr->Reset();
15011 for (Int_t x=1; x<=yieldsUncorr->GetNbinsX(); x++)
15012 for (Int_t y=1; y<=yieldsUncorr->GetNbinsY(); y++)
15013 for (Int_t z=1; z<=yieldsUncorr->GetNbinsZ(); z++)
15015 Double_t factor = effCorr->GetBinContent(effCorr->GetXaxis()->FindBin(yieldsUncorr->GetZaxis()->GetBinCenter(z)), effCorr->GetYaxis()->FindBin(yieldsUncorr->GetYaxis()->GetBinCenter(y)));
15016 yieldsCorr->SetBinContent(x, y, z, yieldsUncorr->GetBinContent(x, y, z) * factor);
15017 yieldsCorr->SetBinError(x, y, z, yieldsUncorr->GetBinError(x, y, z) * factor);
15020 new TCanvas; yieldsCorr->DrawCopy();
15022 TFile::Open("corr_yield.root", "RECREATE");
15023 yieldsCorr->Write();
15026 // normalize per event
15027 centrDist = h->GetCentralityCorrelation()->ProjectionX();
15028 new TCanvas; centrDist->Draw();
15030 for (Int_t x=1; x<=yieldsCorr->GetNbinsX(); x++)
15032 Double_t factor = centrDist->Integral(centrDist->FindBin(yieldsCorr->GetXaxis()->GetBinLowEdge(x)+0.0001), centrDist->FindBin(yieldsCorr->GetXaxis()->GetBinUpEdge(x)-0.0001));
15033 // 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);
15037 for (Int_t y=0; y<=yieldsCorr->GetNbinsY()+1; y++)
15038 for (Int_t z=0; z<=yieldsCorr->GetNbinsZ()+1; z++)
15040 if (yieldsCorr->GetBinContent(x, y, z) > 0)
15042 yieldsCorr->SetBinContent(x, y, z, yieldsCorr->GetBinContent(x, y, z) / factor);
15043 yieldsCorr->SetBinError(x, y, z, yieldsCorr->GetBinError(x, y, z) / factor);
15045 if (yieldsUncorr->GetBinContent(x, y, z) > 0)
15047 yieldsUncorr->SetBinContent(x, y, z, yieldsUncorr->GetBinContent(x, y, z) / factor);
15048 yieldsUncorr->SetBinError(x, y, z, yieldsUncorr->GetBinError(x, y, z) / factor);
15053 TFile::Open("corr_yield.root", "UPDATE");
15054 yieldsCorr->Write("fYieldsCorr_per_event");
15055 centrDist->Write("events");
15058 // new TCanvas; yieldsUncorr->ProjectionX("x2")->DrawCopy(); return;
15060 yieldsUncorr->GetXaxis()->SetRangeUser(1, yieldsUncorr->GetNbinsX());
15062 new TCanvas; yieldsUncorr->Project3D("z1")->DrawCopy()->SetLineColor(1); yieldsCorr->Project3D("z2")->DrawCopy("SAME")->SetLineColor(2);
15064 yieldsUncorr->GetXaxis()->SetRangeUser(0.1, 9.9);
15065 yieldsCorr->GetXaxis()->SetRangeUser(0.1, 9.9);
15066 new TCanvas; yieldsUncorr->Project3D("z3")->DrawCopy()->SetLineColor(1); yieldsCorr->Project3D("z4")->DrawCopy("SAME")->SetLineColor(2);
15067 yieldsUncorr->GetXaxis()->SetRangeUser(60.1, 99.9);
15068 yieldsCorr->GetXaxis()->SetRangeUser(60.1, 99.9);
15069 yieldsUncorr->Project3D("z5")->DrawCopy("SAME")->SetLineColor(3); yieldsCorr->Project3D("z6")->DrawCopy("SAME")->SetLineColor(4);
15072 void PlotPtCentrality()
15074 TFile::Open("corr_yield.root");
15075 yieldsCorr = (TH3F*) gFile->Get("fYieldsCorr");
15077 yieldsCorr->GetZaxis()->SetRangeUser(-0.4999, 0.4999);
15078 yieldsProj = (TH2*) yieldsCorr->Project3D("yx");
15079 Printf("%f", yieldsProj->Integral());
15081 Float_t ptMin[] = { 0.5001, 1.0001, 2.0001 };
15082 Float_t ptMax = 10;
15084 for (Int_t i=0; i<3; i++)
15086 profile = yieldsProj->ProjectionX(Form("x%d", i), yieldsProj->GetYaxis()->FindBin(ptMin[i]), yieldsProj->GetYaxis()->FindBin(ptMax));
15087 profile->SetLineColor(i+1);
15088 profile->Draw((i > 0) ? "SAME" : "");
15092 void ExtractForAllSpecies()
15094 TString baseName = "LHC13b2_fix_1_Train";
15095 const char* suffix[] = { "55_Hadrons_symmetrized", "63_Pions", "63_Kaons", "63_Protons" };
15096 TString baseNameOutput = "dphi_corr_mc_130531_allpt_";
15098 for (Int_t i=0; i<4; i++)
15099 PlotDeltaPhiEtaGap(baseName + suffix[i] + ".root", 0, 0, 0, baseNameOutput + suffix[i] + ".root");
15102 void Compare2D(const char* fileName, const char* fileName2)
15111 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
15112 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
15114 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
15115 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileName2, 0, kTRUE);
15118 SetupRanges(hMixed);
15120 SetupRanges(hMixed2);
15122 // h->SetZVtxRange(0.1, 0.5);
15123 // hMixed->SetZVtxRange(0.1, 0.5);
15124 // h2->SetZVtxRange(0.1, 0.5);
15125 // hMixed2->SetZVtxRange(0.1, 0.5);
15128 GetDistAndFlow(h, 0, &hist1, 0, step, 0, 20, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
15131 GetDistAndFlow(h2, 0, &hist2, 0, step, 0, 20, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
15133 c = new TCanvas("c", "c", 1600, 800);
15136 gPad->SetLeftMargin(0.15);
15138 hist1->DrawCopy("SURF1");
15141 gPad->SetLeftMargin(0.15);
15143 hist2->DrawCopy("SURF1");
15145 Printf("%f %f", hist1->Integral(), hist2->Integral());
15147 new TCanvas("c3", "c3", 800, 800);
15148 gPad->SetLeftMargin(0.15);
15149 hist2->Divide(hist1);
15150 hist2->DrawCopy("COLZ");
15153 //Geant3/Fluka correction for tracking from the spectra analysis
15155 TrackingEff_geantflukaCorrection(Int_t ipart, Int_t icharge)
15158 if (ipart == 3 && icharge == kNegative) {
15159 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "TrackingPtGeantFlukaCorrectionKaMinus(x);p_{T};GF correction", 0., 5.);
15162 else if (ipart == 4 && icharge == kNegative) {
15163 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "TrackingPtGeantFlukaCorrectionPrMinus(x);p_{T};GF correction", 0., 5.);
15166 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "TrackingPtGeantFlukaCorrectionNull(x);p_{T};GF correction", 0., 5.);
15172 TrackingPtGeantFlukaCorrectionNull(Double_t pTmc)
15178 TrackingPtGeantFlukaCorrectionPrMinus(Double_t pTmc)
15180 return (1 - 0.129758 *TMath::Exp(-pTmc*0.679612));
15184 TrackingPtGeantFlukaCorrectionKaMinus(Double_t pTmc)
15186 return TMath::Min((0.972865 + 0.0117093*pTmc), 1.);
15189 //Geant3/Fluka correction for matching from the spectra analysis
15191 TOFmatchMC_geantflukaCorrection(Int_t ipart, Int_t icharge,Int_t ntrd)
15193 if (ipart == 3 && icharge == kNegative) {
15194 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]),Form("MatchingPtGeantFlukaCorrectionKaMinus(x,%d);p_{T};GF correction",ntrd), 0., 5.);
15197 else if (ipart == 4 && icharge == kNegative) {
15198 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]),Form("MatchingPtGeantFlukaCorrectionPrMinus(x,%d);p_{T};GF correction",ntrd), 0., 5.);
15201 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "MatchingPtGeantFlukaCorrectionNull(x);p_{T};GF correction", 0., 5.);
15208 MatchingPtGeantFlukaCorrectionNull(Double_t pTmc)
15213 MatchingPtGeantFlukaCorrectionKaMinus(Double_t pTmc, Int_t ntrd = 7)//ntrd is 7 in 2010, 10 in 2011, 13 in 2012+2013
15215 Float_t ptTPCoutK=pTmc*(1- 3.37297e-03/pTmc/pTmc - 3.26544e-03/pTmc);
15216 Float_t scale = (ntrd * 0.14638485 + (18 - ntrd) * 0.02406) / 18.;
15217 return TMath::Min((TMath::Power(0.972865 + 0.0117093*ptTPCoutK,scale/0.03471)), 1.);
15220 MatchingPtGeantFlukaCorrectionPrMinus(Double_t pTmc, Int_t ntrd = 7)//ntrd is 7 in 2010, 10 in 2011, 13 in 2012+2013
15222 Float_t ptTPCoutP =pTmc*(1-6.81059e-01*TMath::Exp(-pTmc*4.20094));
15223 Float_t scale = (ntrd * 0.14638485 + (18 - ntrd) * 0.02406) / 18.;
15224 return (TMath::Power(1 - 0.129758*TMath::Exp(-ptTPCoutP*0.679612),scale/0.03471));
15227 void Browse(const char* fileName)
15231 if (!gGrid && TString(fileName).BeginsWith("alien://"))
15232 TGrid::Connect("alien://");
15234 TFile::Open(fileName);
15239 void CalculateCentralityWeights(const char* fileName)
15243 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
15246 // Bool_t bins = kFALSE;
15248 // Int_t binning[] = { 0, 10, 20, 30, 50, 80 };
15249 // TH1* centralityDist = h->GetCentralityCorrelation()->ProjectionX();
15252 Bool_t bins = kTRUE;
15254 Int_t binning[] = { 1, 3, 4, 5, 7, 10 };
15255 TH1* centralityDist = h->GetCentralityDistribution();
15258 centralityDist->DrawCopy();
15260 for (Int_t i=0; i<n; i++)
15264 Int_t minBin = binning[i];
15265 Int_t maxBin = binning[i+1]-1;
15269 Int_t minBin = centralityDist->FindBin(binning[i]+0.01);
15270 Int_t maxBin = centralityDist->FindBin(binning[i+1]-0.01);
15273 Float_t min = centralityDist->GetBinContent(minBin);
15274 for (Int_t bin=minBin; bin<=maxBin; bin++)
15275 min = TMath::Min(min, centralityDist->GetBinContent(bin));
15277 for (Int_t bin=minBin; bin<=maxBin; bin++)
15278 centralityDist->SetBinContent(bin, min / centralityDist->GetBinContent(bin));
15281 for (Int_t bin=centralityDist->FindBin(binning[n]+0.01); bin<=centralityDist->GetNbinsX(); bin++)
15282 centralityDist->SetBinContent(bin, 1);
15285 centralityDist->DrawCopy();
15287 file = TFile::Open("centralityWeights.root", "RECREATE");
15288 centralityDist->Write("weights");
15292 Double_t gIntegral = 0;
15293 Double_t FitFunctionGauss(Double_t *x, Double_t *par)
15295 Double_t integralGaussian = TMath::Erf(1.8/TMath::Sqrt(2)/par[2]);
15296 Double_t par0 = gIntegral / integralGaussian;
15298 return par0/TMath::Sqrt(TMath::TwoPi())/par[2] * TMath::Exp(-0.5*x[0]*x[0]/par[2]/par[2]);
15301 void correction_gauss_one(Float_t begin, Float_t end, Bool_t silent = kTRUE)
15303 graph = new TGraph;
15304 graph2 = new TGraph;
15305 for (Float_t f=0.1; f<1.0; f+=0.01)
15307 TH1* hist = new TH1F("hist", "", 60, -3, 3);
15308 TF1* func = new TF1("func", "gaus(0)", -5, 5);
15311 func->SetParameters(1, 0, f);
15312 hist->FillRandom("func", 1000000);
15314 hist->Scale(1.0 / hist->GetMaximum());
15315 // hist->GetXaxis()->SetRangeUser(-1.39, 1.39);
15316 hist->SetLineWidth(2);
15318 clone = (TH1*) hist->Clone("clone");
15322 for (Int_t i=hist->FindBin(-0.29); i<=hist->FindBin(0.29); i++)
15323 hist->SetBinError(i, 1e4);
15332 func = new TF1("func", &FitFunctionGauss, -end, end, 3);
15333 func->FixParameter(0, 0);
15334 func->FixParameter(1, 0);
15335 func->SetParLimits(2, 0, 2);
15336 func->SetParameters(1, 0, 0.5);
15338 // hist->Fit("gaus", (silent) ? "0" : "", "", -end+0.01, end-0.01);
15339 gIntegral = hist->Integral(hist->FindBin(-1.79), hist->FindBin(1.79), "width");
15340 hist->Fit(func, (silent) ? "0" : "", "", -end+0.01, end-0.01);
15341 Float_t first = ((TF1*) hist->GetListOfFunctions()->First())->GetParameter(2);
15342 hist->GetYaxis()->SetRangeUser(-0.2, 1.05);
15344 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);
15345 Printf("%f", offset);
15347 TF1* constant = new TF1("constant", "1", -5, 5);
15348 clone->Add(constant, -offset);
15349 clone->SetLineColor(2);
15351 clone->Draw("same");
15352 // clone->Fit("gaus", (silent) ? "0" : "", "SAME", -end+0.01, end-0.01);
15353 gIntegral = clone->Integral(clone->FindBin(-1.79), clone->FindBin(1.79), "width");
15354 clone->Fit(func, (silent) ? "0" : "", "SAME", -end+0.01, end-0.01);
15355 Float_t second = ((TF1*) clone->GetListOfFunctions()->First())->GetParameter(2);
15357 Printf("%f %f", first, second);
15358 graph->SetPoint(graph->GetN(), second, first);
15359 graph2->SetPoint(graph2->GetN(), second, first / second);
15369 graph2->Draw("A*");
15370 // Printf("%f %f", hist->GetRMS(), clone->GetRMS());
15372 graph2->Write(Form("corr_%.1f_%.1f", begin, end));
15375 void correction_gauss()
15379 TFile::Open("sigma_correction.root", "RECREATE");
15381 gauss_one(1.4, 1.8);
15382 gauss_one(1.2, 1.8);
15383 gauss_one(0.5, 1.0);