2 Float_t gpTMax = 49.99;
7 Float_t gForceRange = -1;
10 const char* gText = "";
11 TString Sign[]={"Plus","Minus"};
18 void SetRanges(TAxis* axis)
20 if (strcmp(axis->GetTitle(), "leading p_{T} (GeV/c)") == 0)
21 axis->SetRangeUser(0, (gEnergy == 900) ? 10 : 25);
23 if (strcmp(axis->GetTitle(), "multiplicity") == 0)
24 axis->SetRangeUser(0, 10);
27 void SetRanges(TH1* hist)
29 SetRanges(hist->GetXaxis());
30 SetRanges(hist->GetYaxis());
31 SetRanges(hist->GetZaxis());
34 void Prepare1DPlot(TH1* hist)
39 hist->SetLineWidth(2);
40 hist->SetStats(kFALSE);
42 hist->GetXaxis()->SetLabelOffset(0.02);
43 hist->GetXaxis()->SetTitleOffset(1.3);
44 hist->GetYaxis()->SetTitleOffset(1.3);
49 TH1* GetSystematicUncertainty(TH1* corr, TH1* trackHist)
53 systError = (TH1*) corr->Clone("systError");
56 else // for dphi evaluation
57 systError = new TH1F("systError", "", 100, 0, 50);
59 Float_t constantUnc = 0;
61 // particle composition
62 constantUnc += 0.8 ** 2;
65 if (gEnergy == 900 && gpTMin < 1.0)
66 constantUnc += 1.0 ** 2;
67 else if (gEnergy == 900 && gpTMin < 1.5)
68 constantUnc += 0.5 ** 2;
69 if (gEnergy == 7000 && gpTMin < 1.0)
70 constantUnc += 1.0 ** 2;
71 else if (gEnergy == 7000 && gpTMin < 1.5)
72 constantUnc += 0.6 ** 2;
75 if (gEnergy == 900 && gpTMin < 1.0)
76 constantUnc += 2.5 ** 2;
77 else if (gEnergy == 900 && gpTMin < 1.5)
78 constantUnc += 2.0 ** 2;
80 constantUnc += 3.0 ** 2;
82 // difference corrected with pythia and phojet
83 if (gEnergy == 900 && gpTMin < 1.0)
84 constantUnc += 0.6 ** 2;
85 else if (gEnergy == 900 && gpTMin < 1.5)
86 constantUnc += 0.8 ** 2;
88 if (gEnergy == 7000 && gpTMin < 1.0)
91 constantUnc += 0.6 ** 2;
93 constantUnc += 0.8 ** 2;
95 constantUnc += 1.0 ** 2;
97 else if (gEnergy == 7000 && gpTMin < 1.5)
98 constantUnc += 1.0 ** 2;
100 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
101 systError->SetBinContent(bin, constantUnc);
104 if (gUEHist == 0 || gUEHist == 2)
105 systError->Fill(0.75, 4.0 ** 2);
107 systError->Fill(0.75, 5.0 ** 2);
112 systError->Fill(1.25, 1.0 ** 2);
113 else if (gpTMin < 1.5)
114 systError->Fill(1.25, 2.0 ** 2);
119 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
120 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 1.0 ** 2);
124 if (gUEHist == 0 && gUEHist == 1)
125 systError->Fill(0.75, 2.0 ** 2);
127 systError->Fill(0.75, 1.2 ** 2);
131 systError->Fill(0.75, 1.0 ** 2);
134 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
137 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 0.5 ** 2);
138 if (gEnergy == 7000 && systError->GetXaxis()->GetBinCenter(bin) < 1.5)
139 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 2.0 ** 2);
140 else if (gEnergy == 7000)
141 systError->Fill(systError->GetXaxis()->GetBinCenter(bin), 1.0 ** 2);
144 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
145 systError->SetBinContent(bin, TMath::Sqrt(systError->GetBinContent(bin)));
149 //new TCanvas; trackHist->Draw();
150 //new TCanvas; systError->DrawCopy("");
153 for (Int_t i=1; i<=trackHist->GetNbinsX(); i++)
154 uncFlat += trackHist->GetBinContent(i) * systError->GetBinContent(systError->FindBin(trackHist->GetBinCenter(i)));
155 if (trackHist->Integral() > 0)
156 uncFlat /= trackHist->Integral();
158 systError = (TH1F*) corr->Clone("systError");
161 for (Int_t i=1; i<=systError->GetNbinsX(); i++)
162 systError->SetBinContent(i, uncFlat);
164 //new TCanvas; systError->DrawCopy("");
167 systError->SetFillColor(kGray);
168 systError->SetFillStyle(1001);
169 systError->SetMarkerStyle(0);
170 systError->SetLineColor(0);
175 void DrawRatio(TH1* corr, TH1* mc, const char* name, TH1* syst = 0)
179 TCanvas* canvas3 = new TCanvas(name, name, 600, 600);
180 canvas3->Range(0, 0, 1, 1);
182 TPad* pad1 = new TPad(Form("%s_1", name), "", 0, 0.5, 0.98, 0.98);
185 TPad* pad2 = new TPad(Form("%s_2", name), "", 0, 0.02, 0.98, 0.5);
188 pad1->SetRightMargin(0.01);
189 pad2->SetRightMargin(0.01);
190 pad1->SetTopMargin(0.05);
191 pad1->SetLeftMargin(0.13);
192 pad2->SetLeftMargin(0.13);
193 pad2->SetBottomMargin(0.22);
195 // no border between them
196 pad1->SetBottomMargin(0);
197 pad2->SetTopMargin(0);
204 TLegend* legend = new TLegend(0.15, 0.65, 0.55, 0.90);
206 TLegend* legend = new TLegend(0.55, 0.65, 0.95, 0.90);
208 legend->SetFillColor(0);
209 legend->AddEntry(corr, "Corrected");
210 legend->AddEntry(mc, "MC prediction");
211 legend->SetTextSize(0.08);
215 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);
216 dummy->SetYTitle(corr->GetYaxis()->GetTitle());
218 //dummy = new TH2F("dummy", "", 100, corr->GetXaxis()->GetBinLowEdge(1), corr->GetXaxis()->GetBinUpEdge(corr->GetNbinsX()), 1000, 13.5, 20.5);
219 //dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
221 dummy->SetStats(kFALSE);
222 dummy->SetXTitle(corr->GetXaxis()->GetTitle());
223 dummy->GetYaxis()->SetTitleOffset(1);
224 Prepare1DPlot(dummy);
226 dummy->GetXaxis()->SetLabelSize(0.08);
227 dummy->GetYaxis()->SetLabelSize(0.08);
228 dummy->GetXaxis()->SetTitleSize(0.08);
229 dummy->GetYaxis()->SetTitleSize(0.08);
230 dummy->GetYaxis()->SetTitleOffset(0.8);
233 dummy->GetYaxis()->SetRangeUser(0, gForceRange);
237 if (0 && gUEHist != 2)
239 const char* regionStr[] = { "Toward Region", "Away Region", "Transverse Region" };
240 latex = new TLatex(0.65, 0.1, regionStr[gRegion]);
241 latex->SetTextSize(0.075);
248 systError = (TH1*) syst->Clone("corrSystError");
249 for (Int_t bin=1; bin<=systError->GetNbinsX(); bin++)
251 systError->SetBinError(bin, corr->GetBinContent(bin) * syst->GetBinContent(bin) / 100);
252 systError->SetBinContent(bin, corr->GetBinContent(bin));
255 systError->Draw("E2 ][ SAME");
261 if (strlen(gText) > 0)
263 latex = new TLatex(0.2, 0.2, gText);
265 latex->SetTextSize(0.06);
272 //pad2->SetBottomMargin(0.15);
276 TH1* ratio = (TH1*) mc->Clone("ratio");
279 Float_t minR = TMath::Min(0.91, ratio->GetMinimum() * 0.95);
280 Float_t maxR = TMath::Max(1.09, ratio->GetMaximum() * 1.05);
285 TH1F dummy3("dummy3", ";;Ratio: MC / corr", 100, corr->GetXaxis()->GetBinLowEdge(1), corr->GetXaxis()->GetBinUpEdge(corr->GetNbinsX()));
286 dummy3.SetXTitle(corr->GetXaxis()->GetTitle());
287 Prepare1DPlot(&dummy3);
288 dummy3.SetStats(kFALSE);
289 for (Int_t i=1; i<=100; ++i)
290 dummy3.SetBinContent(i, 1);
291 dummy3.GetYaxis()->SetRangeUser(minR, maxR);
292 dummy3.SetLineWidth(2);
293 dummy3.GetXaxis()->SetLabelSize(0.08);
294 dummy3.GetYaxis()->SetLabelSize(0.08);
295 dummy3.GetXaxis()->SetTitleSize(0.08);
296 dummy3.GetYaxis()->SetTitleSize(0.08);
297 dummy3.GetYaxis()->SetTitleOffset(0.8);
302 // for the ratio add in quadrature
303 for (Int_t bin=1; bin<=syst->GetNbinsX(); bin++)
305 if (corr->GetBinError(bin) > 0)
306 syst->SetBinError(bin, TMath::Sqrt(TMath::Power(syst->GetBinContent(bin) / 100, 2) + TMath::Power(corr->GetBinError(bin) / corr->GetBinContent(bin), 2)));
308 syst->SetBinError(bin, 0);
309 syst->SetBinContent(bin, 1);
312 syst->Draw("E2 ][ SAME");
313 dummy3.DrawCopy("SAME");
318 ratio->Fit("pol0", "N");
321 //canvas3->SaveAs(Form("%s.eps", canvas3->GetTitle()));
326 gSystem->Load("libANALYSIS");
327 gSystem->Load("libANALYSISalice");
328 gSystem->Load("libCORRFW");
329 gSystem->Load("libPWGTools");
330 gSystem->Load("libPWGCFCorrelationsBase");
333 const char* lastFileName = 0;
334 void* cacheSameEvent = 0;
335 void* cacheMixedEvent = 0;
337 void* GetUEHistogram(const char* fileName, TList** listRef = 0, Bool_t mixed = kFALSE, const char* tag = "")
339 if (!lastFileName || strcmp(lastFileName, fileName) != 0)
341 lastFileName = fileName;
342 file = TFile::Open(fileName);
346 list = (TList*) gFile->Get("PWG4_LeadingTrackUE/histosLeadingTrackUE");
348 list = (TList*) gFile->Get(Form("PWG4_PhiCorrelations/histosPhiCorrelations%s", tag));
350 list = (TList*) gFile->Get("PWG4_PhiCorrelations/histosPhiCorrelations_Syst");
358 cacheMixedEvent = list->FindObject("AliUEHistogramsMixed");
359 cacheSameEvent = list->FindObject("AliUEHistogramsSame");
362 return cacheMixedEvent;
364 if (list->FindObject("AliUEHistograms"))
365 return list->FindObject("AliUEHistograms");
367 return cacheSameEvent;
371 Printf("GetUEHistogram --> Using cache for %s", fileName);
374 return cacheMixedEvent;
376 return cacheSameEvent;
380 void CompareBias(const char* mcFile = "PWG4_JetTasksOutput.root", Int_t region, Int_t ueHist)
384 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(mcFile);
387 const char* axis = "z";
388 Float_t ptLeadMin = 0;
389 Float_t ptLeadMax = -1;
393 ptLeadMin = 0.51 + 0;
394 ptLeadMax = 1.99 + 0;
398 biasFromData = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepBiasStudy, AliUEHist::kCFStepReconstructed, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromData");
399 biasFromData2 = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepBiasStudy2, AliUEHist::kCFStepReconstructed, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromData2");
400 //biasFromData = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepRealLeading, region, axis)->Clone("biasFromData");
401 biasFromMC = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepTracked, region, axis, ptLeadMin, ptLeadMax)->Clone("biasFromMC");
402 //biasFromMC = (TH1*) h->GetUEHist(ueHist)->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepRealLeading, region, axis)->Clone("biasFromMC");
404 /* biasFromData->Draw();
405 biasFromMC->SetLineColor(2);
406 biasFromMC->Draw("SAME");
409 DrawRatio(biasFromData, biasFromMC, "bias: data vs MC");
410 DrawRatio(biasFromData, biasFromData2, "bias: data vs data two step");
413 void CompareBiasWithData(const char* mcFile = "PWG4_JetTasksOutput.root", const char* dataFile = "esd.root", Int_t region = 2)
417 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(mcFile);
420 biasFromMC = (TH1*) h->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepReconstructed, AliUEHist::kCFStepTracked, region, "z")->Clone("biasFromMC");
422 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(dataFile);
425 biasFromData = (TH1*) h2->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepBiasStudy, AliUEHist::kCFStepReconstructed, region, "z")->Clone("biasFromData");
426 biasFromData2 = (TH1*) h2->GetNumberDensitypT()->GetBias(AliUEHist::kCFStepBiasStudy2, AliUEHist::kCFStepReconstructed, region, "z")->Clone("biasFromData2");
428 DrawRatio(biasFromData, biasFromMC, "bias: data vs MC");
429 DrawRatio(biasFromData, biasFromData2, "bias: data vs data two step");
434 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)
438 if (!gCache || !gFirst)
440 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
441 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
453 AliUEHistograms* h = (AliUEHistograms*) gFirst;
454 AliUEHistograms* h2 = (AliUEHistograms*) gSecond;
461 TH1* hist1 = h->GetUEHist(id)->GetUEHist(step1, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
462 //TH1* hist1 = h->GetUEHist(id)->GetUEHist(step1, region, ptLeadMin, ptLeadMax);
463 TH1* hist2 = h2->GetUEHist(id)->GetUEHist(step2, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
465 //hist1->Scale(1.0 / hist1->Integral());
466 //hist2->Scale(1.0 / hist2->Integral());
471 trackHist = h->GetUEHist(id)->GetTrackHist(region)->ShowProjection(2, 0);
472 // only keep bins under consideration
473 for (Int_t bin=1; bin<=trackHist->GetNbinsX(); bin++)
474 if (bin < trackHist->FindBin(ptLeadMin) || bin > trackHist->FindBin(ptLeadMax))
475 trackHist->SetBinContent(bin, 0);
478 // systematic uncertainty
479 TH1* syst = 0; //GetSystematicUncertainty(hist1, trackHist);
481 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);
484 void CompareEventHist(const char* fileName1, const char* fileName2, Int_t id, Int_t step, Int_t var)
488 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
491 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
494 TH1* hist1 = h->GetUEHist(id)->GetEventHist()->ShowProjection(var, step);
495 TH1* hist2 = h2->GetUEHist(id)->GetEventHist()->ShowProjection(var, step);
497 // hist1 = hist1->Rebin(hist2->GetNbinsX(), "new", hist2->GetXaxis()->GetXbins()->GetArray());
499 // hist2 = hist2->Rebin(hist1->GetNbinsX(), "new", hist1->GetXaxis()->GetXbins()->GetArray());
501 DrawRatio(hist1, hist2, "compare");
504 void CompareEventHist(const char* fileName1, const char* fileName2, Int_t id, Int_t step1, Int_t step2, Int_t var)
508 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
511 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
514 // h->GetUEHist(id)->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(1, 5);
515 // h2->GetUEHist(id)->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(1, 5);
517 TH1* hist1 = h->GetUEHist(id)->GetEventHist()->ShowProjection(var, step1);
518 TH1* hist2 = h2->GetUEHist(id)->GetEventHist()->ShowProjection(var, step2);
520 DrawRatio(hist1, hist2, "compare");
523 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)
525 // fileName1 is labelled Corrected in the plot
531 Compare(fileName1, fileName2, id, step, step, region, ptLeadMin, ptLeadMax);
534 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)
536 // fileName1 is labelled Corrected in the plot
542 Compare(fileName1, fileName2, id, step1, step2, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd);
545 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)
549 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, mixed);
553 return h->GetUEHist(id)->GetUEHist(step, region, ptLeadMin, ptLeadMax, centralityBegin, centralityEnd, twoD)->DrawCopy();
556 void DrawProjectionsRidge(const char* fileName, const char* fileNamePbPbMix = 0)
558 if (!fileNamePbPbMix)
559 fileNamePbPbMix = fileName;
566 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
567 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
573 GetDistAndFlow(h, hMixed, &hist1, 0, 8, 0, 100, 3.01, 3.99, 1, kTRUE, 0, kTRUE);
575 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
577 // NormalizeToBinWidth(hist1);
579 proj1y = ((TH2*) hist1)->ProjectionY("proj1y", hist1->GetXaxis()->FindBin(-0.5), hist1->GetXaxis()->FindBin(0.5));
580 proj1x = ((TH2*) hist1)->ProjectionX("proj1x", hist1->GetYaxis()->FindBin(-1.79), hist1->GetYaxis()->FindBin(1.79));
582 proj1y->Scale(1.0 / (hist1->GetXaxis()->FindBin(0.5) - hist1->GetXaxis()->FindBin(-0.5) + 1));
583 proj1x->Scale(1.0 / (hist1->GetYaxis()->FindBin(1.79) - hist1->GetYaxis()->FindBin(-1.79) + 1));
585 proj1y->GetXaxis()->SetTitleOffset(1);
586 proj1x->GetXaxis()->SetTitleOffset(1);
588 Float_t zyam = proj1x->GetBinContent(proj1x->GetXaxis()->FindBin(TMath::Pi()/2));
589 proj1x->Add(new TF1("func", "-1", -100, 100), zyam);
590 proj1y->Add(new TF1("func", "-1", -100, 100), zyam);
592 new TCanvas("c", "c", 800, 800);
593 gPad->SetLeftMargin(0.15);
595 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
596 hist1->GetXaxis()->SetTitleOffset(1.5);
597 hist1->GetYaxis()->SetTitleOffset(2);
598 hist1->SetStats(kFALSE);
599 hist1->DrawCopy("SURF1");
601 // new TCanvas; proj1y->Draw(); new TCanvas; proj1x->Draw(); return;
604 GetDistAndFlow(h, hMixed, &hist2, 0, 8, 40, 100, 4.01, 5.99, 1, kTRUE, 0, kTRUE);
606 // ((TH2*) hist2)->Rebin2D(2, 2); hist2->Scale(0.25);
607 // NormalizeToBinWidth(hist2);
609 proj2y = ((TH2*) hist2)->ProjectionY("proj2y", hist1->GetXaxis()->FindBin(-0.5), hist1->GetXaxis()->FindBin(0.5));
610 proj2x = ((TH2*) hist2)->ProjectionX("proj2x", hist1->GetYaxis()->FindBin(-1.79), hist1->GetYaxis()->FindBin(1.79));
612 proj2y->Scale(1.0 / (hist1->GetXaxis()->FindBin(0.5) - hist1->GetXaxis()->FindBin(-0.5) + 1));
613 proj2x->Scale(1.0 / (hist1->GetYaxis()->FindBin(1.79) - hist1->GetYaxis()->FindBin(-1.79) + 1));
615 zyam = proj2x->GetBinContent(proj2x->GetXaxis()->FindBin(TMath::Pi()/2));
616 proj2x->Add(new TF1("func", "-1", -100, 100), zyam);
617 proj2y->Add(new TF1("func", "-1", -100, 100), zyam);
619 proj2y->SetLineColor(2); proj2x->SetLineColor(2);
621 new TCanvas; proj1y->Draw(); proj2y->Draw("SAME");
622 new TCanvas; proj1x->Draw(); proj2x->Draw("SAME");
624 new TCanvas("c2", "c2", 800, 800);
625 gPad->SetLeftMargin(0.15);
627 hist2->GetYaxis()->SetRangeUser(-1.79, 1.79);
628 hist2->GetXaxis()->SetTitleOffset(1.5);
629 hist2->GetYaxis()->SetTitleOffset(2);
630 hist2->SetStats(kFALSE);
631 hist2->DrawCopy("SURF1");
634 void DrawExample(const char* fileName, const char* fileNamePbPbMix = 0)
636 if (!fileNamePbPbMix)
637 fileNamePbPbMix = fileName;
644 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
645 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
651 GetDistAndFlow(h, hMixed, &hist1, 0, 8, 0, 40, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
653 ((TH2*) hist1)->Rebin2D(2, 2);
656 // NormalizeToBinWidth(hist1);
658 new TCanvas("c", "c", 800, 800);
659 gPad->SetLeftMargin(0.15);
661 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
662 hist1->GetXaxis()->SetTitleOffset(1.5);
663 hist1->GetYaxis()->SetTitleOffset(2);
664 hist1->SetStats(kFALSE);
665 hist1->DrawCopy("SURF1");
668 GetDistAndFlow(h, hMixed, &hist2, 0, 8, 40, 100, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
670 ((TH2*) hist2)->Rebin2D(2, 2); hist2->Scale(0.25);
672 // NormalizeToBinWidth(hist1);
674 new TCanvas("c2", "c2", 800, 800);
675 gPad->SetLeftMargin(0.15);
677 hist2->GetYaxis()->SetRangeUser(-1.79, 1.79);
678 hist2->GetXaxis()->SetTitleOffset(1.5);
679 hist2->GetYaxis()->SetTitleOffset(2);
680 hist2->SetStats(kFALSE);
681 hist2->DrawCopy("SURF1");
689 GetDistAndFlow(h, hMixed, &hist1, 0, 0, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
691 ((TH2*) hist1)->Rebin2D(2, 2);
692 // NormalizeToBinWidth(hist1);
694 new TCanvas("c2", "c2", 800, 800);
695 gPad->SetLeftMargin(0.15);
697 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
698 hist1->GetXaxis()->SetTitleOffset(1.5);
699 hist1->GetYaxis()->SetTitleOffset(2);
700 hist1->SetStats(kFALSE);
701 hist1->DrawCopy("SURF1");
703 hist1->Divide(hist2);
705 new TCanvas("c5", "c5", 800, 800);
706 gPad->SetLeftMargin(0.15);
708 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
709 hist1->GetXaxis()->SetTitleOffset(1.5);
710 hist1->GetYaxis()->SetTitleOffset(2);
711 hist1->SetStats(kFALSE);
712 hist1->DrawCopy("SURF1");
716 GetDistAndFlow(h, hMixed, &hist1, 0, 6, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE, 6);
718 ((TH2*) hist1)->Rebin2D(2, 2);
719 // NormalizeToBinWidth(hist1);
721 new TCanvas("c3", "c3", 800, 800);
722 gPad->SetLeftMargin(0.15);
724 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
725 hist1->GetXaxis()->SetTitleOffset(1.5);
726 hist1->GetYaxis()->SetTitleOffset(2);
727 hist1->SetStats(kFALSE);
728 hist1->DrawCopy("SURF1");
733 // GetDistAndFlow(h, hMixed, &hist1, 0, 4, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE, 6);
735 // ((TH2*) hist1)->Rebin2D(2, 2);
736 // // hist1->Scale(0.25);
738 // // NormalizeToBinWidth(hist1);
740 // new TCanvas("c1b", "c1b", 800, 800);
741 // gPad->SetLeftMargin(0.15);
742 // hist1->SetTitle("");
743 // hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
744 // hist1->GetXaxis()->SetTitleOffset(1.5);
745 // hist1->GetYaxis()->SetTitleOffset(2);
746 // hist1->SetStats(kFALSE);
747 // hist1->DrawCopy("SURF1");
752 // GetDistAndFlow(h, 0, &hist1, 0, 8, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
754 // NormalizeToBinWidth(hist1);
756 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
758 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
760 // Float_t factor = 1.0 / (2.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j)));
761 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
762 // hist1->SetBinError(i, j, hist1->GetBinError(i, j) * factor);
766 /* new TCanvas("c4", "c4", 800, 800);
767 gPad->SetLeftMargin(0.15);
769 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
770 hist1->GetXaxis()->SetTitleOffset(1.5);
771 hist1->GetYaxis()->SetTitleOffset(2);
772 hist1->SetStats(kFALSE);
773 hist1->DrawCopy("SURF1"); */
775 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram("corrected.root");
776 AliUEHistograms* h2Mixed = (AliUEHistograms*) GetUEHistogram("corrected.root", 0, kTRUE);
778 SetupRanges(h2Mixed);
780 GetDistAndFlow(h2, h2Mixed, &hist1, 0, 8, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
781 ((TH2*) hist1)->Rebin2D(2, 2);
783 new TCanvas("c4", "c4", 800, 800);
784 gPad->SetLeftMargin(0.15);
786 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
787 hist1->GetXaxis()->SetTitleOffset(1.5);
788 hist1->GetYaxis()->SetTitleOffset(2);
789 hist1->SetStats(kFALSE);
790 hist1->DrawCopy("SURF1");
792 hist1->Divide(hist2);
794 new TCanvas("c5", "c5", 800, 800);
795 gPad->SetLeftMargin(0.15);
797 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
798 hist1->GetXaxis()->SetTitleOffset(1.5);
799 hist1->GetYaxis()->SetTitleOffset(2);
800 hist1->SetStats(kFALSE);
801 hist1->DrawCopy("SURF1");
803 // hist1->Divide(histMixed);
805 // NormalizeToBinWidth(hist1);
807 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
809 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
811 // Float_t factor = 1.0 / (2.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j)));
812 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
813 // hist1->SetBinError(i, j
814 // }, hist1->GetBinError(i, j) * factor);
817 // new TCanvas("c6", "c6", 800, 800);
818 // gPad->SetLeftMargin(0.15);
819 // hist1->SetTitle("");
820 // hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
821 // hist1->GetXaxis()->SetTitleOffset(1.5);
822 // hist1->GetYaxis()->SetTitleOffset(2);
823 // hist1->SetStats(kFALSE);
824 // hist1->DrawCopy("SURF1");
828 GetSumOfRatios(h, hMixed, &hist1, 6, 60, 90, 8.01, 9.99, kTRUE);
829 new TCanvas("c2", "c2", 800, 800);
830 gPad->SetLeftMargin(0.15);
832 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
833 hist1->GetXaxis()->SetTitleOffset(1.5);
834 hist1->GetYaxis()->SetTitleOffset(2);
835 hist1->SetStats(kFALSE);
836 hist1->Draw("SURF1");
840 latex = new TLatex(0.82, 0.74, "ALICE performance");
841 latex->SetTextSize(0.02);
842 latex->SetTextAlign(22);
845 latex = new TLatex(0.82, 0.72, "Pb-Pb 2.76 TeV");
846 latex->SetTextSize(0.02);
847 latex->SetTextAlign(22);
850 latex = new TLatex(0.82, 0.70, "28.09.11");
851 latex->SetTextSize(0.02);
852 latex->SetTextAlign(22);
856 DrawALICELogo(0.75, 0.75, 0.9, 0.9);
859 void DrawExample2(const char* fileName)
863 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
864 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
872 GetSumOfRatios(h, hMixed, &hist1, 8, 0, 5, 0.51, 0.99);
874 new TCanvas("c", "c", 800, 800);
875 gPad->SetLeftMargin(0.15);
876 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
877 hist1->GetXaxis()->SetTitleOffset(1.5);
878 hist1->GetYaxis()->SetTitleOffset(2);
879 hist1->SetStats(kFALSE);
880 hist1->DrawCopy("SURF1");
883 void CompareZVtxWeighting(const char* fileName, Int_t step = 8)
890 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
891 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
897 GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 10, 5.01, 9.99, 1, kTRUE, 0, kTRUE);
898 hist1->Scale(1.0 / 0.972222);
901 GetSumOfRatios(h, hMixed, &hist2, step, 0, 10, 5.01, 9.99, kTRUE);
903 c = new TCanvas("c", "c", 1200, 400);
906 c->cd(1); hist1->DrawCopy("SURF1");
907 c->cd(2); hist2->DrawCopy("SURF1");
910 hist1->Divide(hist2);
912 c->cd(3); hist1->DrawCopy("COLZ");
915 void DrawSameMixed(const char* fileName, const char* fileNamePbPbMix = 0, Int_t step = 6)
917 if (!fileNamePbPbMix)
918 fileNamePbPbMix = fileName;
925 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
926 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
932 GetDistAndFlow(h, 0, &hist1, 0, step, 0, 80, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
934 // ((TH2*) hist1)->Rebin2D(2, 2);
935 // hist1->Scale(0.25);
937 NormalizeToBinWidth(hist1);
939 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
941 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
943 // Float_t factor = 1.0 / (2.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j) / 0.9));
944 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
945 // hist1->SetBinError(i, j, hist1->GetBinError(i, j) * factor);
949 c = new TCanvas("c", "c", 1600, 800);
952 gPad->SetLeftMargin(0.15);
954 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
955 hist1->GetZaxis()->SetTitleOffset(1.8);
956 hist1->GetXaxis()->SetTitleOffset(1.5);
957 hist1->GetYaxis()->SetTitleOffset(2);
958 hist1->GetZaxis()->SetTitle("same event pairs (a.u.)");
959 hist1->SetStats(kFALSE);
960 hist1->DrawCopy("SURF1");
962 DrawALICELogo(kFALSE, 0.2, 0.7, 0.4, 0.9);
966 GetDistAndFlow(hMixed, 0, &hist1, 0, step, 0, 80, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
968 // ((TH2*) hist1)->Rebin2D(2, 2);
969 NormalizeToBinWidth(hist1);
971 // for (Int_t j=1; j<=hist1->GetNbinsY(); ++j)
973 // Float_t factor = 1.0 / (1.0 - TMath::Abs(hist1->GetYaxis()->GetBinCenter(j)) / 6.0);
974 // Printf("%d %f", j, factor);
975 // for (Int_t i=1; i<=hist1->GetNbinsX(); ++i)
977 // hist1->SetBinContent(i, j, hist1->GetBinContent(i, j) * factor);
978 // hist1->SetBinError(i, j, hist1->GetBinError(i, j) * factor);
983 gPad->SetLeftMargin(0.15);
985 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
986 hist1->GetZaxis()->SetTitleOffset(1.8);
987 hist1->GetXaxis()->SetTitleOffset(1.5);
988 hist1->GetYaxis()->SetTitleOffset(2);
989 hist1->GetZaxis()->SetTitle("mixed event pairs (a.u.)");
990 hist1->SetStats(kFALSE);
991 hist1->DrawCopy("SURF1");
993 DrawALICELogo(kFALSE, 0.2, 0.7, 0.4, 0.9);
995 c->SaveAs(Form("samemixed_%d.eps", step));
996 c->SaveAs(Form("samemixed_%d.png", step));
998 new TCanvas("c3", "c3", 800, 800);
999 gPad->SetLeftMargin(0.15);
1000 hist2->Divide(hist1);
1001 hist2->DrawCopy("SURF1");
1004 void Validation2DAllStepsNew(const char* fileName, Int_t bin = 0)
1006 Int_t centralityFrom = 0;
1007 Int_t centralityTo = 80;
1012 Float_t ptTrigBegin = 2.01;
1013 Float_t ptTrigEnd = 3.99;
1044 centralityFrom = 60;
1057 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1058 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1061 SetupRanges(hMixed);
1065 GetSumOfRatios(h, hMixed, &hist[0], 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1066 GetSumOfRatios(h, hMixed, &hist[1], 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1067 GetSumOfRatios(h, hMixed, &hist[2], 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1068 GetSumOfRatios(h, hMixed, &hist[3], 6, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1069 GetSumOfRatios(h, hMixed, &hist[4], 8, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1070 GetSumOfRatios(h, hMixed, &hist[5], 10, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1072 c = new TCanvas("c", "c", 1600, 1000);
1075 Float_t peakYield1[6];
1076 Float_t baselineValues1[6];
1078 for (Int_t i=0; i<6; i++)
1083 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1084 hist[i]->Scale(1.0 / hist[i]->GetYaxis()->GetBinWidth(1));
1086 ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1089 for (Int_t i=0; i<6; i++)
1095 hist[i]->GetYaxis()->SetRangeUser(-1.99, 1.99);
1096 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1097 hist[i]->GetYaxis()->SetTitleOffset(2);
1098 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1099 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1100 hist[i]->SetStats(kFALSE);
1101 hist[i]->DrawCopy("SURF1");
1106 TH2* clone = (TH2*) hist[i]->Clone();
1107 clone->Divide(hist[5]);
1108 clone->DrawCopy("COLZ");
1109 gPad->SetRightMargin(0.15);
1113 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj1_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1116 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);
1117 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];
1118 Printf("%d: %f %f", i, peakYield1[i], baselineValues1[i]);
1122 proj2 = ((TH2*) hist[5])->ProjectionX(Form("proj2_%d", i), hist[5]->GetYaxis()->FindBin(-0.99), hist[5]->GetYaxis()->FindBin(0.99));
1123 proj2->SetLineColor(2);
1124 proj2->DrawCopy("SAME");
1127 proj1->Divide(proj1, proj2, 1, 1, "B");
1132 c = new TCanvas("c2", "c2", 1600, 1000);
1135 for (Int_t i=0; i<6; i++)
1141 hist[i]->GetYaxis()->SetRangeUser(-1.99, 1.99);
1142 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1143 hist[i]->GetYaxis()->SetTitleOffset(2);
1144 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1145 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1146 hist[i]->SetStats(kFALSE);
1147 hist[i]->DrawCopy("SURF1");
1150 TH2* clone = (TH2*) hist[i]->Clone();
1151 clone->Divide(hist[0]);
1152 clone->DrawCopy("COLZ");
1153 gPad->SetRightMargin(0.15);
1156 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj3_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1159 proj2 = ((TH2*) hist[0])->ProjectionX(Form("proj4_%d", i), hist[0]->GetYaxis()->FindBin(-0.99), hist[0]->GetYaxis()->FindBin(0.99));
1160 proj2->SetLineColor(2);
1161 proj2->DrawCopy("SAME");
1164 proj1->Divide(proj1, proj2, 1, 1, "B");
1168 c = new TCanvas("c3", "c3", 1600, 1000);
1171 for (Int_t i=3; i<4; i++)
1177 hist[i]->GetYaxis()->SetRangeUser(-1.99, 1.99);
1178 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1179 hist[i]->GetYaxis()->SetTitleOffset(2);
1180 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1181 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1182 hist[i]->SetStats(kFALSE);
1183 hist[i]->DrawCopy("SURF1");
1186 TH2* clone = (TH2*) hist[i]->Clone();
1187 clone->Divide(hist[4]);
1188 clone->DrawCopy("COLZ");
1189 gPad->SetRightMargin(0.15);
1192 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj4_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1195 proj2 = ((TH2*) hist[4])->ProjectionX(Form("proj5_%d", i), hist[4]->GetYaxis()->FindBin(-0.99), hist[4]->GetYaxis()->FindBin(0.99));
1196 proj2->SetLineColor(2);
1197 proj2->DrawCopy("SAME");
1200 proj1->Divide(proj1, proj2, 1, 1, "B");
1204 c = new TCanvas("c4", "c4", 1200, 400);
1207 for (Int_t i=0; i<1; i++)
1215 TH2* clone = (TH2*) hist[i]->Clone();
1216 clone->Divide(hist[5]);
1217 clone->DrawCopy("COLZ");
1218 gPad->SetRightMargin(0.15);
1222 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj1_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1225 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);
1226 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];
1227 Printf("%d: %f %f", i, peakYield1[i], baselineValues1[i]);
1231 proj2 = ((TH2*) hist[5])->ProjectionX(Form("proj2_%d", i), hist[5]->GetYaxis()->FindBin(-0.99), hist[5]->GetYaxis()->FindBin(0.99));
1232 proj2->SetLineColor(2);
1233 proj2->DrawCopy("SAME");
1236 proj1->Divide(proj1, proj2, 1, 1, "B");
1241 for (Int_t i=0; i<6; i++)
1242 Printf("%d/%d: %f %f", i, 0, peakYield1[i] / peakYield1[0] - 1, baselineValues1[i] / baselineValues1[0] - 1);
1246 for (Int_t i=0; i<6; i++)
1247 Printf("%d/%d: %f %f", i, 5, peakYield1[i] / peakYield1[5] - 1, baselineValues1[i] / baselineValues1[5] - 1);
1251 void Validation2DAllBins(const char* fileName, const char *fileName2)
1253 /* Int_t is[] = { 0, 1, 2, 3, 4, 5};
1254 Int_t js[] = { 1, 2, 3, 4, 5, 6 };
1256 /* Int_t is[] = { 0, 1, 1, 2, 2, 2, 3, 3, 3 };
1257 Int_t js[] = { 1, 1, 2, 1, 2, 3, 1, 2, 3 };*/
1258 Int_t is[] = { 0, 1, 1, 2, 2, 2, 3 };
1259 Int_t js[] = { 1, 1, 2, 1, 2, 3, 3 };
1262 file1 = TFile::Open(fileName);
1265 file2 = TFile::Open(fileName2);
1267 file3 = TFile::Open("non_closure.root", "RECREATE");
1270 Float_t baselineValues1, baselineValues2, peakYield1, peakYield2;
1274 for (Int_t centr=0; centr<4; centr++)
1276 for (Int_t i=0; i<n; i++)
1280 c = new TCanvas(Form("c%d", padID), Form("c%d", padID), 1100, 750);
1286 TH2* hist1 = (TH2*) file1->Get(Form("dphi_%d_%d_%d", is[i], js[i], centr));
1291 hist2 = (TH2*) file2->Get(Form("dphi_%d_%d_%d", is[i], js[i], centr));
1293 hist2 = (TH2*) file1->Get(Form("dphi_%d_%d_%d", is[i], js[i], centr+4));
1295 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1296 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1297 hist2->Scale(1.0 / hist2->GetYaxis()->GetBinWidth(1));
1299 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1300 ((TH2*) hist2)->Rebin2D(2, 2); hist2->Scale(0.25);
1302 const Float_t outerEta = 1.8;
1303 const Float_t exclusion = 0.5;
1306 proj1 = ((TH2*) hist1)->ProjectionX(Form("proj1a_%d_%d", centr, i), hist1->GetYaxis()->FindBin(-outerEta + 0.01), hist1->GetYaxis()->FindBin(-exclusion - 0.01));
1307 proj1b = ((TH2*) hist1)->ProjectionX(Form("proj1b_%d_%d", centr, i), hist1->GetYaxis()->FindBin(exclusion + 0.01), hist1->GetYaxis()->FindBin(outerEta - 0.01));
1309 copy = proj1->DrawCopy();
1310 copy->GetYaxis()->SetRangeUser(proj1->GetMinimum() * 0.9, proj1->GetMaximum() * 1.2);
1311 proj1c = ((TH2*) hist1)->ProjectionX(Form("proj1c_%d_%d", centr, i), hist1->GetYaxis()->FindBin(-outerEta + 0.01), hist1->GetYaxis()->FindBin(outerEta - 0.01));
1312 proj1c->SetLineColor(2);
1313 proj1c->DrawCopy("SAME");
1314 copy->SetMinimum(TMath::Min(copy->GetMinimum(), proj1c->GetMinimum()));
1315 copy->SetMaximum(1.2 * TMath::Max(copy->GetMaximum(), proj1c->GetMaximum()));
1317 Double_t baselineValues1E, peakYield1E;
1318 baselineValues1 = proj1->IntegralAndError(proj1->FindBin(TMath::Pi()/2 - 0.2), proj1->FindBin(TMath::Pi()/2 + 0.2), baselineValues1E);
1319 baselineValues1 /= (proj1->FindBin(TMath::Pi()/2 + 0.2) - proj1->FindBin(TMath::Pi()/2 - 0.2) + 1);
1320 baselineValues1E /= (proj1->FindBin(TMath::Pi()/2 + 0.2) - proj1->FindBin(TMath::Pi()/2 - 0.2) + 1);
1321 peakYield1 = proj1->IntegralAndError(proj1->GetXaxis()->FindBin(-1), proj1->GetXaxis()->FindBin(1), peakYield1E);
1322 peakYield1 /= (proj1->GetXaxis()->FindBin(0.99) - proj1->GetXaxis()->FindBin(-0.99) + 1);
1323 peakYield1E /= (proj1->GetXaxis()->FindBin(0.99) - proj1->GetXaxis()->FindBin(-0.99) + 1);
1324 peakYield1 -= baselineValues1;
1325 peakYield1E = TMath::Sqrt(peakYield1E * peakYield1E + baselineValues1E * baselineValues1E);
1327 proj2 = ((TH2*) hist2)->ProjectionX(Form("proj2a_%d_%d", centr, i), hist2->GetYaxis()->FindBin(-outerEta + 0.01), hist2->GetYaxis()->FindBin(-exclusion - 0.01));
1328 proj2b = ((TH2*) hist2)->ProjectionX(Form("proj2b_%d_%d", centr, i), hist2->GetYaxis()->FindBin(exclusion + 0.01), hist2->GetYaxis()->FindBin(outerEta - 0.01));
1330 proj2->SetLineColor(3);
1331 proj2->DrawCopy("SAME");
1332 proj2c = ((TH2*) hist2)->ProjectionX(Form("proj2c_%d_%d", centr, i), hist2->GetYaxis()->FindBin(-outerEta + 0.01), hist2->GetYaxis()->FindBin(outerEta - 0.01));
1333 proj2c->SetLineColor(4);
1334 proj2c->DrawCopy("SAME");
1336 Double_t baselineValues2E, peakYield2E;
1337 baselineValues2 = proj2->IntegralAndError(proj1->FindBin(TMath::Pi()/2 - 0.2), proj2->FindBin(TMath::Pi()/2 + 0.2), baselineValues2E);
1338 baselineValues2 /= (proj2->FindBin(TMath::Pi()/2 + 0.2) - proj2->FindBin(TMath::Pi()/2 - 0.2) + 1);
1339 baselineValues2E /= (proj2->FindBin(TMath::Pi()/2 + 0.2) - proj2->FindBin(TMath::Pi()/2 - 0.2) + 1);
1340 peakYield2 = proj2->IntegralAndError(proj2->GetXaxis()->FindBin(-1), proj2->GetXaxis()->FindBin(1), peakYield2E);
1341 peakYield2 /= (proj2->GetXaxis()->FindBin(0.99) - proj2->GetXaxis()->FindBin(-0.99) + 1);
1342 peakYield2E /= (proj2->GetXaxis()->FindBin(0.99) - proj2->GetXaxis()->FindBin(-0.99) + 1);
1343 peakYield2 -= baselineValues2;
1344 peakYield2E = TMath::Sqrt(peakYield2E * peakYield2E + baselineValues2E * baselineValues2E);
1346 // Printf("%d: %f %f %f %f %.2f%% %.2f%%", i, peakYield1, baselineValues1, peakYield2, baselineValues2, 100.0 * peakYield1 / peakYield2 - 100, 100.0 * baselineValues1 / baselineValues2 - 100);
1347 Printf("%s: %.2f%% +- %.2f%% %.2f%% +- %.2f%%",
1349 100.0 * peakYield1 / peakYield2 - 100,
1350 100.0 * peakYield1 / peakYield2 * TMath::Sqrt(TMath::Power(peakYield1E / peakYield1, 2) + TMath::Power(peakYield2E / peakYield2, 2)),
1351 100.0 * baselineValues1 / baselineValues2 - 100,
1352 100.0 * baselineValues1 / baselineValues2 * TMath::Sqrt(TMath::Power(baselineValues1E / baselineValues1, 2) + TMath::Power(baselineValues2E / baselineValues2, 2))
1356 proj1->Divide(proj1, proj2, 1, 1, "B");
1357 proj1c->Divide(proj1c, proj2c, 1, 1, "B");
1358 // proj1->Add(proj2, -1);
1360 proj1c->SetLineColor(2);
1361 proj1c->Draw("SAME");
1364 hist1->Divide(hist2);
1365 hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
1366 hist1->Draw("COLZ");
1368 file3 = TFile::Open("non_closure.root", "UPDATE");
1369 proj1->Write(Form("non_closure_%d_%d_%d", is[i], js[i], centr));
1370 proj1c->Write(Form("non_closure_all_%d_%d_%d", is[i], js[i], centr));
1371 hist1->Write(Form("non_closure_2d_%d_%d_%d", is[i], js[i], centr));
1379 void Validation2DAllSteps(const char* fileName, const char* fileNameCorrected = "corrected.root", Int_t startStep = 8)
1381 Int_t centralityFrom = 0;
1382 Int_t centralityTo = 80;
1387 Float_t ptTrigBegin = 2.01;
1388 Float_t ptTrigEnd = 2.99;
1392 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1393 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1395 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected);
1396 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected, 0, kTRUE);
1399 SetupRanges(hMixed);
1401 SetupRanges(hMixed2);
1406 // GetSumOfRatios(h, hMixed, &hist[0], 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, kTRUE);
1408 GetDistAndFlow(h, hMixed, &hist[0], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 0);
1409 GetDistAndFlow(h, hMixed, &hist[1], 0, 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1410 GetDistAndFlow(h, hMixed, &hist[2], 0, 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1411 GetDistAndFlow(h, hMixed, &hist[3], 0, startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1412 GetDistAndFlow(h2, hMixed2, &hist2[0], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1413 GetDistAndFlow(h2, hMixed2, &hist2[1], 0, 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1414 GetDistAndFlow(h2, hMixed2, &hist2[2], 0, 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1415 GetDistAndFlow(h2, hMixed2, &hist2[3], 0, startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1417 c = new TCanvas("c", "c", 1600, 1000);
1420 Float_t peakYield1[4];
1421 Float_t baselineValues1[4];
1422 Float_t peakYield2[4];
1423 Float_t baselineValues2[4];
1424 for (Int_t i=0; i<4; i++)
1426 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1427 hist[i]->Scale(1.0 / hist[i]->GetYaxis()->GetBinWidth(1));
1428 hist2[i]->Scale(1.0 / hist2[i]->GetYaxis()->GetBinWidth(1));
1430 ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1431 // ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1434 hist[i]->GetYaxis()->SetRangeUser(-1.59, 1.59);
1435 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1436 hist[i]->GetYaxis()->SetTitleOffset(2);
1437 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1438 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1439 hist[i]->SetStats(kFALSE);
1440 hist[i]->DrawCopy("SURF1");
1442 ((TH2*) hist2[i])->Rebin2D(2, 2); hist2[i]->Scale(0.25);
1443 // ((TH2*) hist2[i])->Rebin2D(2, 2); hist2[i]->Scale(0.25);
1445 // TF2* func2 = new TF2("func2", "[0]+[1]*exp(-0.5*((x/[2])**2+(y/[3])**2))", -1, 1, -0.99, 0.99);
1446 // func2->SetParameters(0, 1, 0.5, 0.5);
1447 // hist[i]->Fit(func2, "0R");
1448 // hist[i]->Fit(func2, "0R");
1451 // func2->DrawClone("SURF1");
1453 // baselineValues1[i] = func2->GetParameter(0);
1454 // func2->SetParameter(0, 0);
1455 // peakYield1[i] = func2->Integral(-0.5 * TMath::Pi(), 0.5 * TMath::Pi(), -1.4, 1.4);
1456 // Printf("%f %f", peakYield1[i], baselineValues1[i]);
1459 hist2[i]->GetYaxis()->SetRangeUser(-1.59, 1.59);
1460 hist2[i]->GetXaxis()->SetTitleOffset(1.5);
1461 hist2[i]->GetYaxis()->SetTitleOffset(2);
1462 hist2[i]->GetZaxis()->SetTitleOffset(1.8);
1463 hist2[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1464 hist2[i]->SetStats(kFALSE);
1465 hist2[i]->DrawCopy("SURF1");
1468 proj1 = ((TH2*) hist[i])->ProjectionX(Form("proj1_%d", i), hist[i]->GetYaxis()->FindBin(-0.99), hist[i]->GetYaxis()->FindBin(0.99));
1471 baselineValues1[i] = proj1->GetMinimum();
1472 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];
1473 Printf("%f %f", peakYield1[i], baselineValues1[i]);
1475 proj2 = ((TH2*) hist2[i])->ProjectionX(Form("proj2_%d", i), hist2[i]->GetYaxis()->FindBin(-0.99), hist2[i]->GetYaxis()->FindBin(0.99));
1476 proj2->SetLineColor(2);
1477 proj2->DrawCopy("SAME");
1479 baselineValues2[i] = proj2->GetMinimum();
1480 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];
1481 Printf("%f %f", peakYield2[i], baselineValues2[i]);
1484 proj1->Divide(proj2);
1487 // func2 = new TF2("func2", "[0]+[1]*exp(-0.5*((x/[2])**2+(y/[3])**2))", -1, 1, -0.99, 0.99);
1488 // func2->SetParameters(0, 1, 0.5, 0.5);
1489 // hist2[i]->Fit(func2, "0R");
1490 // hist2[i]->Fit(func2, "0R");
1493 // func2->DrawClone("SURF1");
1495 // baselineValues2[i] = func2->GetParameter(0);
1496 // func2->SetParameter(0, 0);
1497 // peakYield2[i] = func2->Integral(-0.5 * TMath::Pi(), 0.5 * TMath::Pi(), -1.4, 1.4);
1498 // Printf("%f %f", peakYield2[i], baselineValues2[i]);
1501 TH2* clone = (TH2*) hist[i]->Clone();
1502 clone->Divide(hist2[i]);
1503 // clone->Add(hist2[i], -1);
1504 clone->DrawCopy("COLZ");
1505 gPad->SetRightMargin(0.15);
1507 /* 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);
1508 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);*/
1513 for (Int_t i=0; i<4; i++)
1515 Printf("%d: %f %f", i, peakYield1[i] / peakYield2[i] - 1, baselineValues1[i] / baselineValues2[i] - 1);
1516 // Printf("%d: %f %f", i, peakYield1[i] - 1, baselineValues1[i] - 1);
1520 void CorrelatedContaminationEffect(const char* fileName, const char* fileNameCorrected = "corrected.root", Int_t bin = 0, Int_t startStep = 8)
1522 Int_t centralityFrom = 0;
1523 Int_t centralityTo = 80;
1528 Float_t ptTrigBegin = 2.01;
1529 Float_t ptTrigEnd = 3.99;
1551 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1552 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1554 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected);
1555 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected, 0, kTRUE);
1558 SetupRanges(hMixed);
1560 SetupRanges(hMixed2);
1564 Int_t maxFilled = 5;
1565 GetSumOfRatios(h, hMixed, &hist[0], 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1566 GetSumOfRatios(h, hMixed, &hist[1], 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1567 GetSumOfRatios(h, hMixed, &hist[2], 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1568 GetSumOfRatios(h, hMixed, &hist[3], 6, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1569 GetSumOfRatios(h, hMixed, &hist[4], startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1570 // GetSumOfRatios(h2, hMixed2, &hist[5], startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd);
1572 // GetDistAndFlow(h, hMixed, &hist[0], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 0);
1573 // GetDistAndFlow(h, hMixed, &hist[1], 0, 4, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1574 // GetDistAndFlow(h, hMixed, &hist[2], 0, 5, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1575 // GetDistAndFlow(h, hMixed, &hist[3], 0, 6, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, 6);
1576 // GetDistAndFlow(h, hMixed, &hist[4], 0, startStep, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1577 // GetDistAndFlow(h2, hMixed2, &hist[5], 0, 0, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE, startStep);
1579 c = new TCanvas("c", "c", 1600, 1000);
1582 for (Int_t i=0; i<maxFilled; i++)
1584 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1585 hist[i]->Scale(1.0 / hist[i]->GetYaxis()->GetBinWidth(1));
1587 ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1588 // ((TH2*) hist[i])->Rebin2D(2, 2); hist[i]->Scale(0.25);
1591 hist[i]->GetYaxis()->SetRangeUser(-1.59, 1.59);
1592 hist[i]->GetXaxis()->SetTitleOffset(1.5);
1593 hist[i]->GetYaxis()->SetTitleOffset(2);
1594 hist[i]->GetZaxis()->SetTitleOffset(1.8);
1595 hist[i]->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1596 hist[i]->SetStats(kFALSE);
1597 hist[i]->DrawCopy("SURF1");
1600 for (Int_t i=1; i<maxFilled; i++)
1602 TH2* clone = (TH2*) hist[i]->Clone();
1604 clone->Divide(hist[i-1]);
1606 clone->Divide(hist[2]);
1608 clone->Divide(hist[0]);
1611 gPad->SetRightMargin(0.15);
1612 // hist1->SetTitle("");
1613 // clone->GetZaxis()->SetRangeUser(0.8, 1.2);
1614 clone->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1615 clone->SetStats(kFALSE);
1616 clone->DrawCopy("COLZ");
1619 Float_t peakYield[6];
1620 Float_t baselineValues[6];
1621 for (Int_t i=0; i<maxFilled; i++)
1623 Int_t phi1 = hist[i]->GetXaxis()->FindBin(-1);
1624 Int_t phi2 = hist[i]->GetXaxis()->FindBin(1);
1625 Int_t eta1 = hist[i]->GetYaxis()->FindBin(-1.59);
1626 Int_t eta2 = hist[i]->GetYaxis()->FindBin(1.01);
1627 Int_t eta3 = hist[i]->GetYaxis()->FindBin(1.59);
1628 Float_t baseline = ((TH2*) hist[i])->Integral(phi1, phi2, eta2, eta3, "width") / (phi2 - phi1 + 1) / (eta3 - eta2 + 1);
1629 Float_t peak = ((TH2*) hist[i])->Integral(phi1, phi2, eta1, eta3, "width");
1630 Printf("%f %f", baseline, peak);
1631 peak -= baseline * (eta3 - eta1 + 1) * (phi2 - phi1 + 1);
1633 peakYield[i] = peak;
1634 baselineValues[i] = baseline;
1637 for (Int_t i=1; i<maxFilled; i++)
1640 Printf("%d/%d: %f %f", i, i-1, peakYield[i] / peakYield[i-1] - 1, baselineValues[i] / baselineValues[i-1] - 1);
1642 Printf("%d/%d: %f %f", i, 2, peakYield[i] / peakYield[2] - 1, baselineValues[i] / baselineValues[2] - 1);
1644 Printf("%d/%d: %f %f", 0, i, peakYield[0] / peakYield[i] - 1, baselineValues[0] / baselineValues[i] - 1);
1647 c = new TCanvas("c2", "c2", 1600, 1000);
1649 for (Int_t i=0; i<maxFilled; i++)
1652 hist[i]->DrawCopy("SURF1");
1654 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);
1655 func2->SetParameters(0, 1, 0.5, 0.5);
1656 // func2->SetParLimits(1, 0, 10);
1657 // func2->SetParLimits(2, sigmaFitLimit, 1);
1658 // func2->SetParLimits(3, sigmaFitLimit, 1);
1659 hist[i]->Fit(func2, "0R");
1662 func2->DrawClone("SURF1");
1664 baselineValues[i] = func2->GetParameter(0);
1665 func2->SetParameter(0, 0);
1666 peakYield[i] = func2->Integral(-0.5 * TMath::Pi(), 0.5 * TMath::Pi(), -1.4, 1.4);
1667 Printf("%f %f", peakYield[i], baselineValues[i]);
1670 for (Int_t i=1; i<maxFilled; i++)
1673 Printf("%d/%d: %f %f", i, i-1, peakYield[i] / peakYield[i-1] - 1, baselineValues[i] / baselineValues[i-1] - 1);
1675 Printf("%d/%d: %f %f", i, 2, peakYield[i] / peakYield[2] - 1, baselineValues[i] / baselineValues[2] - 1);
1677 Printf("%d/%d: %f %f", 0, i, peakYield[0] / peakYield[i] - 1, baselineValues[0] / baselineValues[i] - 1);
1680 for (Int_t i=1; i<maxFilled; i++)
1682 Printf("%d/%d: %f %f", 0, i, peakYield[0] / peakYield[i] - 1, baselineValues[0] / baselineValues[i] - 1);
1686 void DrawValidation2D(const char* fileName, const char* fileNameCorrected = "corrected.root", Int_t startStep = 8)
1688 Int_t centralityTo = 80;
1695 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1696 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1699 SetupRanges(hMixed);
1702 GetDistAndFlow(h, hMixed, &hist1, 0, 0, 0, centralityTo, 2.01, 3.99, 1, kTRUE, 0, kTRUE, 0);
1703 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1704 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1706 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1707 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1709 // NormalizeToBinWidth(hist1);
1711 c = new TCanvas("c", "c", 1000, 1000);
1715 gPad->SetLeftMargin(0.15);
1716 // hist1->SetTitle("");
1717 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1718 hist1->GetXaxis()->SetTitleOffset(1.5);
1719 hist1->GetYaxis()->SetTitleOffset(2);
1720 hist1->GetZaxis()->SetTitleOffset(1.8);
1721 hist1->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1722 hist1->SetStats(kFALSE);
1723 hist1->DrawCopy("SURF1");
1724 DrawLatex(0.1, 0.85, 1, "MC", 0.04);
1725 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1729 GetDistAndFlow(h, hMixed, &hist1, 0, startStep, 0, centralityTo, 2.01, 3.99, 1, kTRUE, 0, kTRUE, startStep);
1730 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1731 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1733 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1734 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1735 // NormalizeToBinWidth(hist1);
1738 gPad->SetLeftMargin(0.15);
1739 hist1->SetTitle("");
1740 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1741 hist1->GetXaxis()->SetTitleOffset(1.5);
1742 hist1->GetYaxis()->SetTitleOffset(2);
1743 hist1->GetZaxis()->SetTitleOffset(1.8);
1744 hist1->SetStats(kFALSE);
1745 hist1->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1746 hist1->DrawCopy("SURF1");
1747 DrawLatex(0.1, 0.85, 1, "Uncorrected", 0.04);
1748 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1750 c2 = new TCanvas("c3", "c3", 800, 800);
1751 // hist2->Scale(1.09);
1752 hist1->Divide(hist2);
1753 // hist1->Add(hist2, -1);
1754 hist1->DrawCopy("SURF1");
1758 // AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram("LHC11a10a_bis_AOD090_120406_zvtx_rebinned_corrected.root");
1759 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileNameCorrected);
1762 GetDistAndFlow(h2, hMixed, &hist1, 0, 0, 0, centralityTo, 2.01, 3.99, 1, kTRUE, 0, kTRUE, startStep);
1763 // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
1764 hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
1766 ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1767 // ((TH2*) hist1)->Rebin2D(2, 2); hist1->Scale(0.25);
1770 gPad->SetLeftMargin(0.15);
1771 hist1->SetTitle("");
1772 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1773 hist1->GetXaxis()->SetTitleOffset(1.5);
1774 hist1->GetZaxis()->SetTitleOffset(1.8);
1775 hist1->GetZaxis()->SetTitle("1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad.)");
1776 hist1->GetYaxis()->SetTitleOffset(2);
1777 hist1->SetStats(kFALSE);
1778 hist1->DrawCopy("SURF1");
1779 DrawLatex(0.1, 0.85, 1, "Corrected", 0.04);
1780 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1782 hist1->Divide(hist2);
1785 gPad->SetRightMargin(0.15);
1786 hist1->SetTitle("");
1787 hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
1788 hist1->GetXaxis()->SetTitleOffset(1.2);
1789 hist1->GetYaxis()->SetTitleOffset(1.2);
1790 hist1->GetZaxis()->SetTitle("Ratio: Corrected / MC");
1791 hist1->SetStats(kFALSE);
1792 hist1->GetZaxis()->SetRangeUser(0.99, 1.01);
1793 hist1->DrawCopy("COLZ");
1795 // DrawALICELogo(kFALSE, 0.7, 0.7, 0.9, 0.9);
1797 c->SaveAs("validation.eps");
1798 c->SaveAs("validation.gif");
1801 void DrawValidation(const char* fileName1, const char* fileName2)
1806 CompareStep(fileName1, fileName2, 2, 6, 4, 0, 4.01, 19.99);
1807 CompareStep(fileName1, fileName2, 2, 4, 4, 0, 4.01, 19.99);
1809 CompareStep(fileName1, fileName2, 2, 4, 2, 0, 4.01, 19.99);
1810 CompareStep(fileName1, fileName2, 2, 2, 2, 0, 4.01, 19.99);
1813 void ProfileMultiplicity(const char* fileName = "PWG4_JetTasksOutput.root")
1817 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1820 h->GetCorrelationMultiplicity()->Draw("colz");
1824 h->GetCorrelationMultiplicity()->ProfileX()->DrawCopy()->Fit("pol1", "", "", 1, 10);
1827 void SetupRanges(void* obj)
1831 ((AliUEHistograms*) obj)->SetEtaRange(0, 0);
1832 // ((AliUEHistograms*) obj)->SetEtaRange(-0.99, 0.99); Printf("WARNING: Setting eta Range!");
1833 ((AliUEHistograms*) obj)->SetPtRange(gpTMin, gpTMax);
1834 ((AliUEHistograms*) obj)->SetCombineMinMax(kTRUE);
1837 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)
1839 AliUEHist* corrected = (AliUEHist*) correctedVoid;
1840 AliUEHist* comparison = (AliUEHist*) comparisonVoid;
1842 Int_t beginStep = AliUEHist::kCFStepAll;
1843 Int_t endStep = AliUEHist::kCFStepReconstructed;
1845 if (compareStep != -1)
1847 beginStep = compareStep;
1848 endStep = compareStep;
1851 Int_t beginRegion = 0;
1852 Int_t endRegion = 2;
1854 if (compareRegion != -1)
1856 beginRegion = compareRegion;
1857 endRegion = compareRegion;
1860 for (Int_t step=beginStep; step<=endStep; step++)
1862 if (compareStep == -1 && (step == AliUEHist::kCFStepAnaTopology || step == AliUEHist::kCFStepTriggered))
1865 for (Int_t region=beginRegion; region <= endRegion; region++)
1867 Printf("%f %f", ptLeadMin, ptLeadMax);
1868 TH1* corrHist = corrected->GetUEHist(step, region, ptLeadMin, ptLeadMax);
1869 TH1* mcHist = comparison->GetUEHist(step, region, ptLeadMin, ptLeadMax);
1871 DrawRatio(corrHist, mcHist, TString(Form("%s: step %d %s %s", name, step, corrected->GetStepTitle(step), corrected->GetRegionTitle(region))));
1876 void DrawRatios(void* correctedVoid, void* comparisonVoid, Int_t compareStep = -1, Int_t compareRegion = 2, Int_t compareUEHist = 0)
1878 AliUEHistograms* corrected = (AliUEHistograms*) correctedVoid;
1879 AliUEHistograms* comparison = (AliUEHistograms*) comparisonVoid;
1881 if (1 && compareUEHist == 2)
1883 for (Float_t ptMin = 2.01; ptMin < 8; ptMin += 2)
1885 ((AliUEHistograms*) corrected)->SetPtRange(ptMin, ptMin + 1.98);
1886 ((AliUEHistograms*) comparison)->SetPtRange(ptMin, ptMin + 1.98);
1888 DrawRatios(TString(Form("Dphi %d pT %f", compareUEHist, ptMin)), corrected->GetUEHist(compareUEHist), comparison->GetUEHist(compareUEHist), compareStep, compareRegion, 8.01, 19.99);
1893 if (compareUEHist == -1)
1895 for (Int_t i=0; i<2; i++)
1896 DrawRatios(TString(Form("UE %d", i)), corrected->GetUEHist(i), comparison->GetUEHist(i), compareStep, compareRegion);
1899 DrawRatios(TString(Form("UE %d", compareUEHist)), corrected->GetUEHist(compareUEHist), comparison->GetUEHist(compareUEHist), compareStep, compareRegion);
1902 void CompareEventsTracks(void* corrVoid, void* mcVoid, Int_t compareStep, Int_t compareRegion, Int_t compareUEHist = 0)
1904 AliUEHist* corr = ((AliUEHistograms*) corrVoid)->GetUEHist(compareUEHist);
1905 AliUEHist* mc = ((AliUEHistograms*) mcVoid)->GetUEHist(compareUEHist);
1907 Float_t ptLeadMin = 0;
1908 Float_t ptLeadMax = -1;
1911 if (compareUEHist == 2)
1918 TH1* corrHist = corr->GetUEHist(compareStep, compareRegion, ptLeadMin, ptLeadMax);
1919 TH1* mcHist = mc ->GetUEHist(compareStep, compareRegion, ptLeadMin, ptLeadMax);
1921 DrawRatio(corrHist, mcHist, Form("check"));
1923 corr->SetBinLimits(corr->GetTrackHist(compareRegion)->GetGrid(compareStep));
1924 mc->SetBinLimits(corr->GetTrackHist(compareRegion)->GetGrid(compareStep));
1926 corrHist = corr->GetTrackHist(compareRegion)->GetGrid(compareStep)->Project(axis);
1927 mcHist = mc ->GetTrackHist(compareRegion)->GetGrid(compareStep)->Project(axis);
1928 DrawRatio(corrHist, mcHist, Form("check2"));
1930 corrHist = corr->GetEventHist()->GetGrid(compareStep)->Project(0);
1931 mcHist = mc ->GetEventHist()->GetGrid(compareStep)->Project(0);
1932 DrawRatio(corrHist, mcHist, Form("check3"));
1935 void CopyReconstructedData(const char* fileName)
1939 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
1940 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
1943 AliUEHistograms* onlyRec = (AliUEHistograms*) h->Clone();
1945 onlyRec->CopyReconstructedData(h);
1947 AliUEHistograms* onlyRecMixed = (AliUEHistograms*) hMixed->Clone();
1948 onlyRecMixed->Reset();
1949 onlyRecMixed->CopyReconstructedData(hMixed);
1951 TString newFileName(fileName);
1952 newFileName.ReplaceAll(".root", "");
1953 newFileName += "_onlyreco.root";
1957 list->Add(onlyRecMixed);
1959 file3 = TFile::Open(newFileName, "RECREATE");
1960 file3->mkdir("PWG4_PhiCorrelations");
1961 file3->cd("PWG4_PhiCorrelations");
1962 list->Write("histosPhiCorrelations", TObject::kSingleKey);
1966 void correctMC(const char* fileNameCorrections, const char* fileNameESD = 0, Int_t compareStep = -1, Int_t compareRegion = 2, Int_t compareUEHist = 0)
1968 // corrects the reconstructed step in fileNameESD with fileNameCorr
1969 // if fileNameESD is 0 data from fileNameCorr is taken
1970 // afterwards the corrected distributions are compared with the MC stored in fileNameESD
1974 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
1977 corr->ExtendTrackingEfficiency();
1979 AliUEHistograms* testSample = corr;
1981 testSample = (AliUEHistograms*) GetUEHistogram(fileNameESD);
1983 // copy to esd object
1984 AliUEHistograms* esd = (AliUEHistograms*) corr->Clone();
1986 esd->CopyReconstructedData(testSample);
1989 SetupRanges(testSample);
1997 file3 = TFile::Open("correctedMC.root", "RECREATE");
1998 file3->mkdir("PWG4_PhiCorrelations");
1999 file3->cd("PWG4_PhiCorrelations");
2000 list->Write("histosPhiCorrelations", TObject::kSingleKey);
2004 DrawRatios(esd, testSample, compareStep, compareRegion, compareUEHist);
2008 esd->SetPtRange(2.01, 3.99);
2009 corrected = esd->GetUEHist(2)->GetUEHist(0, 0, 4.01, 7.99, 0, -1, 1);
2010 testSample->SetPtRange(2.01, 3.99);
2011 mc = testSample->GetUEHist(2)->GetUEHist(0, 0, 4.01, 7.99, 0, -1, 1);
2012 new TCanvas; corrected->DrawCopy("SURF1");
2013 new TCanvas; mc->DrawCopy("SURF1");
2014 new TCanvas; mc->DrawCopy("SURF1")->Divide(corrected);
2017 //CompareEventsTracks(esd, testSample, compareStep, compareRegion, compareUEHist);
2020 // function to compare only final step for all regions and distributions
2022 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)
2024 // corrects fileNameESD with fileNameCorrections and compares the two
2028 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
2031 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD, &list);
2036 Float_t etaRange = 1.2;
2037 Printf(">>>>> Using eta range: |eta| < %f", etaRange);
2038 corr->SetEtaRange(-etaRange+0.01, etaRange-0.01);
2039 corr->ExtendTrackingEfficiency(0);
2041 // corr->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepTracked, AliUEHist::kCFStepTrackedOnlyPrim, 1, -1, 2);
2044 if (contEnhancement)
2046 TFile::Open(contEnhancement);
2047 contEncHist = (TH1*) gFile->Get("histo");
2048 contEncHistFullRange = (TH1*) corr->GetUEHist(0)->GetTrackingEfficiency(1)->Clone("contEncHistFullRange");
2050 contEncHistFullRange->Reset();
2051 for (Int_t i=1; i<=contEncHistFullRange->GetNbinsX(); i++)
2053 contEncHistFullRange->SetBinContent(i, 1);
2054 if (i <= contEncHist->GetNbinsX() && contEncHist->GetXaxis()->GetBinCenter(i) < contEncUpTo && contEncHist->GetBinContent(i) > 0)
2055 contEncHistFullRange->SetBinContent(i, contEncHist->GetBinContent(i));
2057 corr->SetContaminationEnhancement((TH1F*) contEncHistFullRange);
2061 //esd->GetUEHist(2)->AdditionalDPhiCorrection(0);
2063 file3 = TFile::Open("corrected.root", "RECREATE");
2064 file3->mkdir("PWG4_PhiCorrelations");
2065 file3->cd("PWG4_PhiCorrelations");
2066 list->Write("histosPhiCorrelations", TObject::kSingleKey);
2069 // DrawRatios(esd, corr, compareStep, compareRegion, compareUEHist);
2072 void ITSTPCEfficiency(const char* fileNameData, Int_t id, Int_t itsTPC = 0)
2076 // uncertainty from dN/dpT paper
2077 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};
2078 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
2079 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
2081 TH1F* effHist = new TH1F("effHist", "effHist", 39, pTBins);
2082 for (Int_t i=0; i<39; i++)
2087 effHist->SetBinContent(i+1, (itsTPC == 0) ? effITS[bin] : effTPC[bin]);
2090 new TCanvas; effHist->Draw();
2092 EffectOfModifiedTrackingEfficiency(fileNameData, id, 2, effHist, 1, -1, (itsTPC == 0) ? "ITS" : "TPC");
2096 void EffectOfModifiedTrackingEfficiency(const char* fileNameData, Int_t id, Int_t region, TH1* trackingEff, Int_t axis1, Int_t axis2 = -1, const char* name = "EffectOfModifiedTrackingEfficiency")
2098 // trackingEff should contain the change in tracking efficiency, i.e. between before and after in the eta-pT plane
2102 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
2103 SetupRanges(corrected);
2105 AliUEHist* ueHist = corrected->GetUEHist(id);
2107 Float_t ptLeadMin = -1;
2108 Float_t ptLeadMax = -1;
2111 // the uncertainty is flat in delta phi, so use this trick to get directly the uncertainty as function of leading pT
2117 TH1* before = ueHist->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2120 // the CFStepTriggered step is overwritten here and cannot be used for comparison afterwards anymore
2121 ueHist->CorrectTracks(AliUEHist::kCFStepAll, AliUEHist::kCFStepTriggered, (TH1*) 0, 0, -1);
2123 // reapply tracking efficiency
2124 ueHist->CorrectTracks(AliUEHist::kCFStepTriggered, AliUEHist::kCFStepAll, trackingEff, axis1, axis2);
2127 TH1* after = ueHist->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2129 DrawRatio(before, after, name);
2130 gPad->GetCanvas()->SaveAs(Form("%s.png", name));
2133 void EffectOfTrackCuts(const char* fileNameData, Int_t id, const char* systFile)
2137 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
2138 effHist = (TH2D*) corrected->GetUEHist(0)->GetTrackingEfficiency()->Clone("effHist");
2140 file = TFile::Open(systFile);
2143 const char* systNames[] = { "NClusTPC", "Chi2TPC", "SigmaDCA" };
2145 for (Int_t i=0; i<maxSyst; i++)
2147 for (Int_t j=0; j<2; j++)
2150 histName.Form("%s_syst_%s", systNames[i], (j == 0) ? "up" : "down");
2151 systEffect = (TH2*) file->Get(histName);
2155 for (Int_t x=1; x <= effHist->GetNbinsX(); x++)
2156 for (Int_t y=1; y <= effHist->GetNbinsY(); y++)
2157 effHist->SetBinContent(x, y, 1);
2159 for (Int_t x=1; x <= systEffect->GetNbinsX(); x++)
2160 for (Int_t y=1; y <= systEffect->GetNbinsY(); y++)
2161 if (systEffect->GetBinContent(x, y) != 0)
2162 effHist->SetBinContent(effHist->GetXaxis()->FindBin(systEffect->GetYaxis()->GetBinCenter(y)), effHist->GetYaxis()->FindBin(systEffect->GetXaxis()->GetBinCenter(x)), systEffect->GetBinContent(x, y));
2165 //new TCanvas; systEffect->Draw("COLZ"); new TCanvas; effHist->Draw("COLZ");
2167 EffectOfModifiedTrackingEfficiency(fileNameData, id, (id == 2) ? 0 : 2, effHist, 0, 1, histName);
2174 void ModifyComposition(const char* fileNameData, const char* fileNameCorrections, Int_t id, Bool_t verbose = kFALSE)
2178 AliUEHistograms* corrected = (AliUEHistograms*) GetUEHistogram(fileNameData);
2179 SetupRanges(corrected);
2181 AliUEHistograms* corrections = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
2182 SetupRanges(corrections);
2184 ueHistData = (AliUEHist*) corrected->GetUEHist(id);
2185 ueHistCorrections = (AliUEHist*) corrections->GetUEHist(id);
2188 // the CFStepTriggered step is overwritten here and cannot be used for comparison afterwards anymore
2189 ueHistData->CorrectTracks(AliUEHist::kCFStepAll, AliUEHist::kCFStepTriggered, (TH1*) 0, 0);
2191 Int_t maxRegion = 3;
2192 Float_t ptLeadMin = -1;
2193 Float_t ptLeadMax = -1;
2197 // the uncertainty is flat in delta phi, so use this trick to get directly the uncertainty as function of leading pT
2204 for (Int_t region=0; region<maxRegion; region++)
2205 before[region] = ueHistData->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2207 //defaultEff = ueHistCorrections->GetTrackingEfficiency();
2208 defaultEff = ueHistCorrections->GetTrackingCorrection();
2209 //defaultEffpT = ueHistCorrections->GetTrackingEfficiency(1);
2210 defaultEffpT = ueHistCorrections->GetTrackingCorrection(1);
2211 defaultContainer = ueHistCorrections->GetTrackHistEfficiency();
2214 defaultEffpT->Draw("");
2216 Float_t largestDeviation[3];
2217 for (Int_t i=0; i<maxRegion; i++)
2218 largestDeviation[i] = 0;
2220 for (Int_t i=0; i<7; i++)
2222 // case 0: // default
2223 // case 1: // + 30% kaons
2224 // case 2: // - 30% kaons
2225 // case 3: // + 30% protons
2226 // case 4: // - 30% protons
2227 // case 5: // + 30% others
2228 // case 6: // - 30% others
2229 Int_t correctionIndex = (i+1) / 2 + 1; // bin 1 == protons, bin 2 == kaons, ...
2230 Double_t scaleFactor = (i % 2 == 1) ? 1.3 : 0.7;
2234 newContainer = (AliCFContainer*) defaultContainer->Clone();
2236 // modify, change all steps
2237 for (Int_t j=0; j<newContainer->GetNStep(); j++)
2239 THnSparse* grid = newContainer->GetGrid(j)->GetGrid();
2241 for (Int_t binIdx = 0; binIdx < grid->GetNbins(); binIdx++)
2244 Double_t value = grid->GetBinContent(binIdx, bins);
2245 Double_t error = grid->GetBinError(binIdx);
2247 if (bins[2] != correctionIndex)
2250 value *= scaleFactor;
2251 error *= scaleFactor;
2253 grid->SetBinContent(bins, value);
2254 grid->SetBinError(bins, error);
2258 // put in corrections
2259 ueHistCorrections->SetTrackHistEfficiency(newContainer);
2262 //modifiedEff = ueHistCorrections->GetTrackingEfficiency();
2263 modifiedEff = ueHistCorrections->GetTrackingCorrection();
2264 modifiedEff->Divide(modifiedEff, defaultEff);
2265 //modifiedEff->Draw("COLZ");
2268 //modifiedEffpT = ueHistCorrections->GetTrackingEfficiency(1);
2269 modifiedEffpT = ueHistCorrections->GetTrackingCorrection(1);
2270 modifiedEffpT->SetLineColor(i+1);
2271 modifiedEffpT->Draw("SAME");
2273 // apply change in tracking efficiency
2274 ueHistData->CorrectTracks(AliUEHist::kCFStepTriggered, AliUEHist::kCFStepAll, modifiedEff, 0, 1);
2276 for (Int_t region=0; region<maxRegion; region++)
2279 TH1* after = ueHistData->GetUEHist(AliUEHist::kCFStepAll, region, ptLeadMin, ptLeadMax);
2282 DrawRatio(before[region], (TH1*) after->Clone(), Form("Region %d Composition %d", region, i));
2284 // ratio is flat, extract deviation
2285 after->Divide(before[region]);
2286 after->Fit("pol0", "0");
2287 Float_t deviation = 100.0 - 100.0 * after->GetFunction("pol0")->GetParameter(0);
2288 Printf("Deviation for region %d case %d is %.2f %%", region, i, deviation);
2290 if (TMath::Abs(deviation) > largestDeviation[region])
2291 largestDeviation[region] = TMath::Abs(deviation);
2296 for (Int_t i=0; i<maxRegion; i++)
2297 Printf("Largest deviation in region %d is %f", i, largestDeviation[i]);
2300 void MergeList(const char* prefix = "", Bool_t copy = kFALSE)
2303 gSystem->Load("libPWGflowBase");
2304 gSystem->Load("libPWGflowTasks");
2309 TFileMerger m(copy);
2316 if (line.Length() == 0)
2320 fileName.Form("%s%s", prefix, line.Data());
2321 // fileName.Form("alien://%s", line.Data());
2322 Printf("%s", fileName.Data());
2324 m.AddFile(fileName);
2328 m.OutputFile("merged.root");
2332 void Merge2(const char* file1, const char* file2)
2341 m.OutputFile("merged.root");
2345 void Merge3(const char* file1, const char* file2, const char* file3)
2355 m.OutputFile("merged.root");
2359 void MergeList2(const char* listFile, const char* dir, Bool_t onlyPrintEvents = kFALSE, const char* targetDir = "PWG4_LeadingTrackUE")
2366 AliUEHistograms* final = 0;
2367 TList* finalList = 0;
2374 if (line.Length() == 0)
2378 fileName.Form("%s/%s/PWG4_JetTasksOutput.root", dir, line.Data());
2379 Printf("%s", fileName.Data());
2382 AliUEHistograms* obj = (AliUEHistograms*) GetUEHistogram(fileName, &list);
2388 final = (AliUEHistograms*) obj;
2389 //final->GetEventCount()->Draw(); return;
2390 Printf("Events: %d", (Int_t) final->GetEventCount()->ProjectionX()->GetBinContent(4));
2395 additional = (AliUEHistograms*) obj;
2396 Printf("Events: %d", (Int_t) additional->GetEventCount()->ProjectionX()->GetBinContent(4));
2398 if (!onlyPrintEvents)
2401 list2.Add(additional);
2402 final->Merge(&list2);
2409 if (onlyPrintEvents)
2412 Printf("Total events (at step 0): %d", (Int_t) final->GetEventCount()->ProjectionX()->GetBinContent(4));
2414 file3 = TFile::Open("merged.root", "RECREATE");
2415 file3->mkdir(targetDir);
2416 file3->cd(targetDir);
2417 finalList->Write(0, TObject::kSingleKey);
2421 void PlotAll(const char* correctedFile, const char* mcFile)
2427 Float_t range[] = { 1.5, 2 };
2431 Float_t range[] = { 3, 10 };
2434 for (Int_t id=0; id<3; id++)
2437 gForceRange = range[id];
2443 for (Int_t region=0; region<3; region++)
2445 CompareStep(correctedFile, mcFile, id, 0, region);
2446 gPad->GetCanvas()->SaveAs(Form("%s_%s_%d_%d.png", TString(correctedFile).Tokenize(".")->First()->GetName(), TString(mcFile).Tokenize(".")->First()->GetName(), id, region));
2451 Float_t leadingPtArr[] = { 0.50, 2.0, 4.0, 6.0, 10.0, 20.0, 50.0 };
2452 for (Int_t leadingPtID=0; leadingPtID<6; leadingPtID++)
2454 CompareStep(correctedFile, mcFile, id, 0, 0, leadingPtArr[leadingPtID] + 0.01, leadingPtArr[leadingPtID+1] - 0.01);
2455 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]));
2462 TGraph* GetFlow2040()
2464 // from first ALICE flow paper (provided by Raimond)
2465 // http://www-library.desy.de/spires/find/hep/www?eprint=arXiv:1011.3914
2467 // centrality 20-30%
2468 Double_t xCumulant4th2030ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2469 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
2470 5.500000,7.000000,9.000000};
2471 Double_t yCumulant4th2030ALICE[] = {0.000000,0.000000,0.030926,0.041076,0.052063,0.059429,0.070500,0.084461,0.086745,0.099254,
2472 0.109691,0.116398,0.130831,0.141959,0.158932,0.169680,0.171387,0.178858,0.171475,0.140358,
2473 0.000000,0.000000,0.000000};
2474 Double_t xErrCumulant4th2030ALICE[23] = {0.};
2475 Double_t yErrCumulant4th2030ALICE[] = {0.000000,0.000000,0.002857,0.003451,0.003567,0.003859,0.004609,0.004976,0.005412,0.006277,
2476 0.004748,0.005808,0.006896,0.007987,0.008683,0.008080,0.013278,0.018413,0.024873,0.026057,
2477 0.000000,0.000000,0.000000};
2478 Int_t nPointsCumulant4th2030ALICE = sizeof(xCumulant4th2030ALICE)/sizeof(Double_t);
2479 TGraphErrors *Cumulant4th2030ALICE = new TGraphErrors(nPointsCumulant4th2030ALICE,xCumulant4th2030ALICE,yCumulant4th2030ALICE,
2480 xErrCumulant4th2030ALICE,yErrCumulant4th2030ALICE);
2481 Cumulant4th2030ALICE->SetMarkerStyle(kFullSquare);
2482 Cumulant4th2030ALICE->SetMarkerColor(kRed);
2483 Cumulant4th2030ALICE->SetMarkerSize(1.2);
2484 Cumulant4th2030ALICE->SetFillStyle(1001);
2485 Cumulant4th2030ALICE->SetFillColor(kRed-10);
2487 //===================================================================================================================
2488 // centrality 30-40%
2489 Double_t xCumulant4th3040ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2490 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
2491 5.500000,7.000000,9.000000};
2492 Double_t yCumulant4th3040ALICE[] = {0.000000,0.000000,0.037071,0.048566,0.061083,0.070910,0.078831,0.091396,0.102026,0.109691,
2493 0.124449,0.139819,0.155561,0.165701,0.173678,0.191149,0.202015,0.204540,0.212560,0.195885,
2494 0.000000,0.000000,0.000000};
2495 Double_t xErrCumulant4th3040ALICE[23] = {0.};
2496 Double_t yErrCumulant4th3040ALICE[] = {0.000000,0.000000,0.002992,0.003364,0.003669,0.003931,0.004698,0.005261,0.005446,0.006151,
2497 0.004980,0.005741,0.007198,0.008576,0.010868,0.009926,0.015269,0.020691,0.027601,0.031834,
2498 0.000000,0.000000,0.000000};
2499 Int_t nPointsCumulant4th3040ALICE = sizeof(xCumulant4th3040ALICE)/sizeof(Double_t);
2500 TGraphErrors *Cumulant4th3040ALICE = new TGraphErrors(nPointsCumulant4th3040ALICE,xCumulant4th3040ALICE,yCumulant4th3040ALICE,
2501 xErrCumulant4th3040ALICE,yErrCumulant4th3040ALICE);
2502 Cumulant4th3040ALICE->SetMarkerStyle(kFullTriangleUp);
2503 Cumulant4th3040ALICE->SetMarkerColor(kGreen+2);
2504 Cumulant4th3040ALICE->SetMarkerSize(1.2);
2505 Cumulant4th3040ALICE->SetFillStyle(1001);
2506 Cumulant4th3040ALICE->SetFillColor(kGreen+2);
2508 // build average between the two (for class 20-40%)
2509 Double_t* yAverage = new Double_t[nPointsCumulant4th3040ALICE];
2510 for (Int_t i=0; i<nPointsCumulant4th3040ALICE; i++)
2511 yAverage[i] = (yCumulant4th2030ALICE[i] + yCumulant4th3040ALICE[i]) / 2;
2513 // assume flow constant above highest pT; not neccessarily physically sound ;)
2516 yAverage[20] = yAverage[19];
2517 xCumulant4th3040ALICE[20] = 100;
2518 nPointsCumulant4th3040ALICE -= 2;
2521 TGraph *flow2040 = new TGraph(nPointsCumulant4th3040ALICE,xCumulant4th3040ALICE,yAverage);
2525 flow2040->Draw("*A");
2526 Cumulant4th2030ALICE->Draw("PSAME");
2527 Cumulant4th3040ALICE->Draw("PSAME");
2535 TGraph* GetFlow1020()
2537 // from first ALICE flow paper (provided by Raimond)
2538 // http://www-library.desy.de/spires/find/hep/www?eprint=arXiv:1011.3914
2540 //===================================================================================================================
2541 // centrality 10-20%
2542 Double_t xCumulant4th1020ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2543 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000,
2544 5.500000,7.000000,9.000000};
2545 Double_t yCumulant4th1020ALICE[] = {0.000000,0.000000,0.024075,0.031505,0.040413,0.044981,0.055358,0.060563,0.063378,0.070030,
2546 0.082692,0.091611,0.099641,0.107223,0.122376,0.131240,0.137425,0.146050,0.131365,0.124708,
2547 0.000000,0.000000,0.000000};
2548 Double_t xErrCumulant4th1020ALICE[23] = {0.};
2549 Double_t yErrCumulant4th1020ALICE[] = {0.000000,0.000000,0.002413,0.002931,0.003444,0.003950,0.004338,0.004835,0.005059,0.005586,
2550 0.004521,0.005278,0.005999,0.007072,0.008260,0.007279,0.011897,0.017409,0.023995,0.025701,
2551 0.000000,0.000000,0.000000};
2552 Int_t nPointsCumulant4th1020ALICE = sizeof(xCumulant4th1020ALICE)/sizeof(Double_t);
2554 // assume flow constant above highest pT; not neccessarily physically sound ;)
2557 yCumulant4th1020ALICE[20] = yCumulant4th1020ALICE[19];
2558 xCumulant4th1020ALICE[20] = 100;
2559 nPointsCumulant4th1020ALICE -= 2;
2562 TGraphErrors *Cumulant4th1020ALICE = new TGraphErrors(nPointsCumulant4th1020ALICE,xCumulant4th1020ALICE,yCumulant4th1020ALICE,
2563 xErrCumulant4th1020ALICE,yErrCumulant4th1020ALICE);
2565 Cumulant4th1020ALICE->SetMarkerStyle(kFullCircle);
2566 Cumulant4th1020ALICE->SetMarkerColor(kBlue);
2567 Cumulant4th1020ALICE->SetMarkerSize(1.2);
2568 Cumulant4th1020ALICE->SetFillStyle(1001);
2569 Cumulant4th1020ALICE->SetFillColor(kBlue-10);
2571 TGraph *flow1020 = new TGraph(nPointsCumulant4th1020ALICE,xCumulant4th1020ALICE,yCumulant4th1020ALICE);
2575 flow1020->Draw("*A");
2576 Cumulant4th1020ALICE->Draw("PSAME");
2586 // takes flow measurement from 10-20% and scales by a factor extracted from Fig.3 in the ALICE flow paper
2587 // factor = integrated flow in 0-5% / integrated flow in 10-20%
2589 graph = GetFlow1020();
2590 for (Int_t i=0; i<graph->GetN(); i++)
2591 graph->GetY()[i] *= 0.016 / 0.055;
2596 TGraphErrors* GetFlow01_Rap02(Int_t n)
2598 // private communication 19.04.11, Raimond / Ante
2602 // v2{SP}(pt) for 0-1%, rapidity gap = 0.2:
2603 const Int_t nPointsSP_0001ALICE_v2_etaGap02 = 18;
2604 Double_t xSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2605 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};
2606 Double_t ySP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.009235,0.014105,0.017274,0.018245,0.023190,
2607 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};
2608 Double_t xErrSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.};
2609 Double_t yErrSP_0001ALICE_v2_etaGap02[nPointsSP_0001ALICE_v2_etaGap02] = {0.000515,0.000504,0.000532,0.000585,0.000641,
2610 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};
2611 TGraphErrors *SP_0001ALICE_v2_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v2_etaGap02,xSP_0001ALICE_v2_etaGap02,
2612 ySP_0001ALICE_v2_etaGap02,xErrSP_0001ALICE_v2_etaGap02,yErrSP_0001ALICE_v2_etaGap02);
2613 SP_0001ALICE_v2_etaGap02->SetMarkerStyle(kFullCircle);
2614 SP_0001ALICE_v2_etaGap02->SetMarkerColor(kBlue);
2615 SP_0001ALICE_v2_etaGap02->SetFillStyle(1001);
2616 SP_0001ALICE_v2_etaGap02->SetFillColor(kBlue-10);
2618 return SP_0001ALICE_v2_etaGap02;
2623 // v3{SP}(pt) for 0-1%, rapidity gap = 0.2:
2624 const Int_t nPointsSP_0001ALICE_v3_etaGap02 = 18;
2625 Double_t xSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2626 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};
2627 Double_t ySP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.005688,0.007222,0.010305,0.013795,0.016077,
2628 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};
2629 Double_t xErrSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.};
2630 Double_t yErrSP_0001ALICE_v3_etaGap02[nPointsSP_0001ALICE_v3_etaGap02] = {0.000585,0.000582,0.000614,0.000667,0.000734,
2631 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};
2632 TGraphErrors *SP_0001ALICE_v3_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v3_etaGap02,xSP_0001ALICE_v3_etaGap02,ySP_0001ALICE_v3_etaGap02,
2633 xErrSP_0001ALICE_v3_etaGap02,yErrSP_0001ALICE_v3_etaGap02);
2634 SP_0001ALICE_v3_etaGap02->SetMarkerStyle(kFullTriangleUp);
2635 SP_0001ALICE_v3_etaGap02->SetMarkerSize(1.4);
2636 SP_0001ALICE_v3_etaGap02->SetMarkerColor(kGreen+2);
2637 SP_0001ALICE_v3_etaGap02->SetFillStyle(1001);
2638 SP_0001ALICE_v3_etaGap02->SetFillColor(kGreen-10);
2640 return SP_0001ALICE_v3_etaGap02;
2645 // v4{SP}(pt) for 0-1%, rapidity gap = 0.2:
2646 const Int_t nPointsSP_0001ALICE_v4_etaGap02 = 18;
2647 Double_t xSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2648 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};
2649 Double_t ySP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.001189,0.003540,0.004682,0.004210,0.007032,
2650 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};
2651 Double_t xErrSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.};
2652 Double_t yErrSP_0001ALICE_v4_etaGap02[nPointsSP_0001ALICE_v4_etaGap02] = {0.001035,0.001017,0.001081,0.001187,0.001299,
2653 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};
2654 TGraphErrors *SP_0001ALICE_v4_etaGap02 = new TGraphErrors(nPointsSP_0001ALICE_v4_etaGap02,xSP_0001ALICE_v4_etaGap02,ySP_0001ALICE_v4_etaGap02,
2655 xErrSP_0001ALICE_v4_etaGap02,yErrSP_0001ALICE_v4_etaGap02);
2656 SP_0001ALICE_v4_etaGap02->SetMarkerStyle(kFullSquare);
2657 SP_0001ALICE_v4_etaGap02->SetMarkerColor(kRed);
2658 SP_0001ALICE_v4_etaGap02->SetFillStyle(1001);
2659 SP_0001ALICE_v4_etaGap02->SetFillColor(kRed-10);
2661 return SP_0001ALICE_v4_etaGap02;
2667 TGraphErrors* GetFlow01_Rap10(Int_t n)
2671 // v2{SP}(pt) for 0-1%, rapidity gap = 1.0:
2672 const Int_t nPointsSP_0001ALICE_v2_etaGap10 = 21;
2673 Double_t xSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2674 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,
2675 3.250000,3.750000,4.500000};
2676 Double_t ySP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.009129,0.013461,0.017567,0.018041,0.020384,
2677 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,
2678 0.036905,0.054836,0.030527};
2679 Double_t xErrSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.};
2680 Double_t yErrSP_0001ALICE_v2_etaGap10[nPointsSP_0001ALICE_v2_etaGap10] = {0.001179,0.001152,0.001219,0.001339,0.001480,
2681 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,
2682 0.009145,0.014749,0.018698};
2683 TGraphErrors *SP_0001ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v2_etaGap10,xSP_0001ALICE_v2_etaGap10,
2684 ySP_0001ALICE_v2_etaGap10,xErrSP_0001ALICE_v2_etaGap10,yErrSP_0001ALICE_v2_etaGap10);
2685 SP_0001ALICE_v2_etaGap10->SetMarkerStyle(kOpenCircle);
2686 SP_0001ALICE_v2_etaGap10->SetMarkerColor(kBlue);
2687 SP_0001ALICE_v2_etaGap10->SetFillStyle(1001);
2688 SP_0001ALICE_v2_etaGap10->SetFillColor(kBlue-10);
2690 return SP_0001ALICE_v2_etaGap10;
2695 // v3{SP}(pt) for 0-1%, rapidity gap = 1.0:
2696 const Int_t nPointsSP_0001ALICE_v3_etaGap10 = 18;
2697 Double_t xSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,
2698 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};
2699 Double_t ySP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.006373,0.008403,0.010848,0.011505,0.016728,
2700 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};
2701 Double_t xErrSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.};
2702 Double_t yErrSP_0001ALICE_v3_etaGap10[nPointsSP_0001ALICE_v3_etaGap10] = {0.001286,0.001269,0.001346,0.001474,0.001620,
2703 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};
2704 TGraphErrors *SP_0001ALICE_v3_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v3_etaGap10,xSP_0001ALICE_v3_etaGap10,ySP_0001ALICE_v3_etaGap10,
2705 xErrSP_0001ALICE_v3_etaGap10,yErrSP_0001ALICE_v3_etaGap10);
2706 SP_0001ALICE_v3_etaGap10->SetMarkerStyle(kOpenTriangleUp);
2707 SP_0001ALICE_v3_etaGap10->SetMarkerSize(1.2);
2708 SP_0001ALICE_v3_etaGap10->SetMarkerColor(kGreen+2);
2709 SP_0001ALICE_v3_etaGap10->SetFillStyle(1001);
2710 SP_0001ALICE_v3_etaGap10->SetFillColor(kGreen-10);
2712 return SP_0001ALICE_v3_etaGap10;
2717 // v4{SP}(pt) for 0-1%, rapidity gap = 1.0:
2718 const Int_t nPointsSP_0001ALICE_v4_etaGap10 = 11;
2719 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};
2720 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};
2721 Double_t xErrSP_0001ALICE_v4_etaGap10[nPointsSP_0001ALICE_v4_etaGap10] = {0.};
2722 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};
2723 TGraphErrors *SP_0001ALICE_v4_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v4_etaGap10,xSP_0001ALICE_v4_etaGap10,ySP_0001ALICE_v4_etaGap10,
2724 xErrSP_0001ALICE_v4_etaGap10,yErrSP_0001ALICE_v4_etaGap10);
2725 SP_0001ALICE_v4_etaGap10->SetMarkerStyle(kOpenSquare);
2726 SP_0001ALICE_v4_etaGap10->SetMarkerColor(kRed);
2727 SP_0001ALICE_v4_etaGap10->SetFillStyle(1001);
2728 SP_0001ALICE_v4_etaGap10->SetFillColor(kRed-10);
2730 return SP_0001ALICE_v4_etaGap10;
2735 // v5{SP}(pt) for 0-1%, rapidity gap = 1.0:
2736 const Int_t nPointsSP_0001ALICE_v5_etaGap10 = 11;
2737 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};
2738 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};
2739 Double_t xErrSP_0001ALICE_v5_etaGap10[nPointsSP_0001ALICE_v5_etaGap10] = {0.};
2740 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};
2741 TGraphErrors *SP_0001ALICE_v5_etaGap10 = new TGraphErrors(nPointsSP_0001ALICE_v5_etaGap10,xSP_0001ALICE_v5_etaGap10,ySP_0001ALICE_v5_etaGap10,
2742 xErrSP_0001ALICE_v5_etaGap10,yErrSP_0001ALICE_v5_etaGap10);
2743 return SP_0001ALICE_v5_etaGap10;
2747 TGraphErrors* GetFlow02_Rap10(Int_t n)
2749 // private communication 20.04.11, Ante B. / Raimond
2753 // v2{SP}(pt) for 00-02%, eta gap = 1.0:
2754 const Int_t nPointsSP_0002_v2_etaGap10 = 15;
2755 Double_t xSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
2756 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
2757 Double_t ySP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.010171,0.013190,0.017342,0.020629,0.022617,0.026549,
2758 0.027423,0.032261,0.037467,0.041001,0.045763,0.049327,0.049688,0.051480,0.038527};
2759 Double_t xErrSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.};
2760 Double_t yErrSP_0002_v2_etaGap10[nPointsSP_0002_v2_etaGap10] = {0.000600,0.000590,0.000625,0.000683,0.000757,0.000839,
2761 0.000692,0.000848,0.000888,0.001209,0.001653,0.002252,0.002465,0.003968,0.009391};
2762 TGraphErrors *SP_0002_v2_etaGap10 = new TGraphErrors(nPointsSP_0002_v2_etaGap10,xSP_0002_v2_etaGap10,ySP_0002_v2_etaGap10,
2763 xErrSP_0002_v2_etaGap10,yErrSP_0002_v2_etaGap10);
2765 return SP_0002_v2_etaGap10;
2770 const Int_t nPointsSP_0002_v3_etaGap10 = 15;
2771 Double_t xSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
2772 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
2773 Double_t ySP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.006592,0.007286,0.012180,0.012242,0.017416,0.018393,
2774 0.024716,0.030980,0.037703,0.046558,0.051285,0.064613,0.074831,0.077093,0.082442};
2775 Double_t xErrSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.};
2776 Double_t yErrSP_0002_v3_etaGap10[nPointsSP_0002_v3_etaGap10] = {0.000682,0.000676,0.000713,0.000782,0.000860,0.000953,
2777 0.000782,0.000957,0.001002,0.001361,0.001862,0.002541,0.002767,0.004466,0.010586};
2778 TGraphErrors *SP_0002_v3_etaGap10 = new TGraphErrors(nPointsSP_0002_v3_etaGap10,xSP_0002_v3_etaGap10,ySP_0002_v3_etaGap10,
2779 xErrSP_0002_v3_etaGap10,yErrSP_0002_v3_etaGap10);
2781 return SP_0002_v3_etaGap10;
2786 const Int_t nPointsSP_0002_v4_etaGap10 = 15;
2787 Double_t xSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,
2788 0.900000,1.100000,1.350000,1.650000,1.950000,2.250000,2.700000,3.500000,4.500000};
2789 Double_t ySP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {-0.000533,0.001167,0.002081,0.005218,0.006826,0.008440,
2790 0.013009,0.014812,0.017125,0.030106,0.038279,0.050488,0.067640,0.071637,0.084239};
2791 Double_t xErrSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.};
2792 Double_t yErrSP_0002_v4_etaGap10[nPointsSP_0002_v4_etaGap10] = {0.001427,0.001398,0.001482,0.001594,0.001758,0.001945,
2793 0.001593,0.001951,0.002046,0.002787,0.003802,0.005182,0.005663,0.009064,0.021449};
2794 TGraphErrors *SP_0002_v4_etaGap10 = new TGraphErrors(nPointsSP_0002_v4_etaGap10,xSP_0002_v4_etaGap10,ySP_0002_v4_etaGap10,
2795 xErrSP_0002_v4_etaGap10,yErrSP_0002_v4_etaGap10);
2796 return SP_0002_v4_etaGap10;
2801 // v5{SP}(pt) for 00-02%, eta gap = 0.2:
2802 const Int_t nPointsSP_0002_v5_etaGap02 = 13;
2803 Double_t xSP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.300000,0.500000,0.700000,0.900000,1.100000,1.300000,1.500000,
2804 1.700000,2.000000,2.550000,3.250000,3.950000,4.650000};
2805 Double_t ySP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.000570,0.002922,0.002151,0.005256,0.006287,0.005849,0.009399,
2806 0.011420,0.012455,0.032134,0.057009,0.020607,0.013551};
2807 Double_t xErrSP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.};
2808 Double_t yErrSP_0002_v5_etaGap02[nPointsSP_0002_v5_etaGap02] = {0.001074,0.001155,0.001433,0.001725,0.002123,0.002608,0.003196,
2809 0.003930,0.003755,0.004869,0.009719,0.018353,0.031814};
2810 TGraphErrors *SP_0002_v5_etaGap02 = new TGraphErrors(nPointsSP_0002_v5_etaGap02,xSP_0002_v5_etaGap02,ySP_0002_v5_etaGap02,
2811 xErrSP_0002_v5_etaGap02,yErrSP_0002_v5_etaGap02);
2812 return SP_0002_v5_etaGap02;
2816 TGraphErrors* GetFlow02(Int_t n)
2818 // private communication 28.01.11, Ante B. / Raimond
2823 Double_t xCumulant2nd0002ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2824 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2825 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
2827 Double_t yCumulant2nd0002ALICE_v2[] = {0.000000,0.000000,0.012173,0.015186,0.018580,0.021114,0.024646,0.027040,0.030269,0.032677,
2828 0.035332,0.037382,0.039228,0.040614,0.042460,0.044658,0.046246,0.050392,0.051436,0.054669,
2829 0.057330,0.063439,0.067425,0.060144,0.071260,0.070206,0.000000,0.000000,0.000000,0.000000,
2831 Double_t xErrCumulant2nd0002ALICE_v2[31] = {0.};
2832 Double_t yErrCumulant2nd0002ALICE_v2[] = {0.000000,0.000000,0.000256,0.000259,0.000271,0.000296,0.000322,0.000357,0.000397,0.000438,
2833 0.000483,0.000529,0.000590,0.000639,0.000713,0.000793,0.000877,0.000976,0.001070,0.001197,
2834 0.000725,0.001265,0.002069,0.003156,0.004605,0.006543,0.000000,0.000000,0.000000,0.000000,
2836 Int_t nPointsCumulant2nd0002ALICE_v2 = sizeof(xCumulant2nd0002ALICE_v2)/sizeof(Double_t);
2837 TGraphErrors *Cumulant2nd0002ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v2,xCumulant2nd0002ALICE_v2,yCumulant2nd0002ALICE_v2,
2838 xErrCumulant2nd0002ALICE_v2,yErrCumulant2nd0002ALICE_v2);
2839 Cumulant2nd0002ALICE_v2->SetMarkerStyle(kFullCircle);
2840 Cumulant2nd0002ALICE_v2->SetMarkerColor(kBlue);
2842 return Cumulant2nd0002ALICE_v2;
2848 Double_t xCumulant2nd0002ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2849 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2850 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
2852 Double_t yCumulant2nd0002ALICE_v3[] = {0.000000,0.000000,0.007696,0.008994,0.010544,0.013269,0.016330,0.019234,0.023465,0.026803,
2853 0.029906,0.032211,0.035300,0.038158,0.041861,0.046002,0.049382,0.053574,0.055773,0.059420,
2854 0.069373,0.079922,0.090265,0.103583,0.111358,0.090740,0.000000,0.000000,0.000000,0.000000,
2856 Double_t xErrCumulant2nd0002ALICE_v3[31] = {0.};
2857 Double_t yErrCumulant2nd0002ALICE_v3[] = {0.000000,0.000000,0.000318,0.000317,0.000333,0.000360,0.000392,0.000431,0.000476,0.000523,
2858 0.000575,0.000637,0.000707,0.000785,0.000878,0.000964,0.001064,0.001175,0.001320,0.001459,
2859 0.000889,0.001539,0.002530,0.003826,0.005614,0.007892,0.000000,0.000000,0.000000,0.000000,
2861 Int_t nPointsCumulant2nd0002ALICE_v3 = sizeof(xCumulant2nd0002ALICE_v3)/sizeof(Double_t);
2862 TGraphErrors *Cumulant2nd0002ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v3,xCumulant2nd0002ALICE_v3,yCumulant2nd0002ALICE_v3,
2863 xErrCumulant2nd0002ALICE_v3,yErrCumulant2nd0002ALICE_v3);
2864 Cumulant2nd0002ALICE_v3->SetMarkerStyle(kFullTriangleUp);
2865 Cumulant2nd0002ALICE_v3->SetMarkerSize(1.2);
2866 Cumulant2nd0002ALICE_v3->SetMarkerColor(kGreen+2);
2868 return Cumulant2nd0002ALICE_v3;
2874 Double_t xCumulant2nd0002ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2875 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
2876 2.250000,2.750000,3.250000,3.750000,4.250000,4.750000,5.500000,6.500000,7.500000,8.500000,
2878 Double_t yCumulant2nd0002ALICE_v4[] = {0.000000,0.000000,0.005710,0.006014,0.004483,0.005453,0.007714,0.006837,0.009721,0.011288,
2879 0.012531,0.016461,0.016606,0.018587,0.022722,0.025497,0.025832,0.030994,0.030349,0.034730,
2880 0.045529,0.061153,0.074238,0.079307,0.088885,0.085218,0.000000,0.000000,0.000000,0.000000,
2882 Double_t xErrCumulant2nd0002ALICE_v4[31] = {0.};
2883 Double_t yErrCumulant2nd0002ALICE_v4[] = {0.000000,0.000000,0.000488,0.000493,0.000523,0.000571,0.000609,0.000678,0.000742,0.000805,
2884 0.000903,0.000985,0.001100,0.001219,0.001352,0.001503,0.001682,0.001847,0.002060,0.002303,
2885 0.001400,0.002431,0.003974,0.006040,0.008901,0.012343,0.000000,0.000000,0.000000,0.000000,
2887 Int_t nPointsCumulant2nd0002ALICE_v4 = sizeof(xCumulant2nd0002ALICE_v4)/sizeof(Double_t);
2888 TGraphErrors *Cumulant2nd0002ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0002ALICE_v4,xCumulant2nd0002ALICE_v4,yCumulant2nd0002ALICE_v4,
2889 xErrCumulant2nd0002ALICE_v4,yErrCumulant2nd0002ALICE_v4);
2890 Cumulant2nd0002ALICE_v4->SetMarkerStyle(kFullSquare);
2891 Cumulant2nd0002ALICE_v4->SetMarkerColor(kRed);
2893 return Cumulant2nd0002ALICE_v4;
2899 /* results up to 5 GeV/c
2901 TGraphErrors* GetFlow05(Int_t n)
2903 // private communication 02.02.11, Ante B. / Raimond
2907 // v2{2}(pt) for 0-5%:
2908 Double_t xCumulant2nd0005ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2909 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2910 Double_t yCumulant2nd0005ALICE_v2[] = {0.000000,0.000000,0.013891,0.017693,0.021693,0.025323,0.029131,0.032443,0.035781,0.038256,
2911 0.042801,0.047705,0.053229,0.057387,0.062677,0.068815,0.077695,0.082058,0.082511,0.079791};
2912 Double_t xErrCumulant2nd0005ALICE_v2[20] = {0.};
2913 Double_t yErrCumulant2nd0005ALICE_v2[] = {0.000000,0.000000,0.000149,0.000150,0.000160,0.000174,0.000191,0.000211,0.000233,0.000257,
2914 0.000208,0.000254,0.000311,0.000377,0.000464,0.000419,0.000726,0.001180,0.001791,0.002131};
2915 Int_t nPointsCumulant2nd0005ALICE_v2 = sizeof(xCumulant2nd0005ALICE_v2)/sizeof(Double_t);
2916 TGraphErrors *Cumulant2nd0005ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v2,xCumulant2nd0005ALICE_v2,yCumulant2nd0005ALICE_v2,
2917 xErrCumulant2nd0005ALICE_v2,yErrCumulant2nd0005ALICE_v2);
2918 Cumulant2nd0005ALICE_v2->SetMarkerStyle(kFullCircle);
2919 Cumulant2nd0005ALICE_v2->SetMarkerColor(kBlue);
2921 return Cumulant2nd0005ALICE_v2;
2926 // v3{2}(pt) for 0-5%:
2927 Double_t xCumulant2nd0005ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2928 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2929 Double_t yCumulant2nd0005ALICE_v3[] = {0.000000,0.000000,0.007788,0.009472,0.011596,0.014618,0.017540,0.021020,0.024946,0.028004,
2930 0.032330,0.039491,0.046368,0.053620,0.060662,0.071750,0.086746,0.097857,0.103111,0.104796};
2931 Double_t xErrCumulant2nd0005ALICE_v3[20] = {0.};
2932 Double_t yErrCumulant2nd0005ALICE_v3[] = {0.000000,0.000000,0.000194,0.000192,0.000204,0.000221,0.000241,0.000265,0.000293,0.000323,
2933 0.000266,0.000323,0.000397,0.000486,0.000601,0.000545,0.000947,0.001541,0.002328,0.002777};
2934 Int_t nPointsCumulant2nd0005ALICE_v3 = sizeof(xCumulant2nd0005ALICE_v3)/sizeof(Double_t);
2935 TGraphErrors *Cumulant2nd0005ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v3,xCumulant2nd0005ALICE_v3,yCumulant2nd0005ALICE_v3,
2936 xErrCumulant2nd0005ALICE_v3,yErrCumulant2nd0005ALICE_v3);
2937 Cumulant2nd0005ALICE_v3->SetMarkerStyle(kFullCircle);
2938 Cumulant2nd0005ALICE_v3->SetMarkerColor(kBlue);
2940 return Cumulant2nd0005ALICE_v3;
2945 // v4{2}(pt) for 0-5%:
2946 Double_t xCumulant2nd0005ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2947 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2948 Double_t yCumulant2nd0005ALICE_v4[] = {0.000000,0.000000,0.006121,0.006137,0.005598,0.005956,0.007262,0.007991,0.009159,0.012062,
2949 0.015085,0.019225,0.024782,0.030092,0.035708,0.046542,0.060077,0.076088,0.082964,0.085405};
2950 Double_t xErrCumulant2nd0005ALICE_v4[20] = {0.};
2951 Double_t yErrCumulant2nd0005ALICE_v4[] = {0.000000,0.000000,0.000275,0.000278,0.000294,0.000319,0.000346,0.000380,0.000419,0.000459,
2952 0.000378,0.000460,0.000570,0.000700,0.000865,0.000789,0.001370,0.002227,0.003370,0.004018};
2953 Int_t nPointsCumulant2nd0005ALICE_v4 = sizeof(xCumulant2nd0005ALICE_v4)/sizeof(Double_t);
2954 TGraphErrors *Cumulant2nd0005ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0005ALICE_v4,xCumulant2nd0005ALICE_v4,yCumulant2nd0005ALICE_v4,
2955 xErrCumulant2nd0005ALICE_v4,yErrCumulant2nd0005ALICE_v4);
2956 Cumulant2nd0005ALICE_v4->SetMarkerStyle(kFullCircle);
2957 Cumulant2nd0005ALICE_v4->SetMarkerColor(kBlue);
2959 return Cumulant2nd0005ALICE_v4;
2965 TGraphErrors* GetFlow510(Int_t n)
2967 // private communication 02.02.11, Ante B. / Raimond
2971 // v2{2}(pt) for 5-10%:
2972 Double_t xCumulant2nd0510ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2973 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2974 Double_t yCumulant2nd0510ALICE_v2[] = {0.000000,0.000000,0.019872,0.026451,0.032901,0.039085,0.044930,0.050200,0.054887,0.060253,
2975 0.066587,0.075080,0.083303,0.090298,0.098782,0.109632,0.124486,0.129621,0.132076,0.120697};
2976 Double_t xErrCumulant2nd0510ALICE_v2[20] = {0.};
2977 Double_t yErrCumulant2nd0510ALICE_v2[] = {0.000000,0.000000,0.000150,0.000152,0.000163,0.000178,0.000196,0.000215,0.000237,0.000261,
2978 0.000213,0.000256,0.000313,0.000381,0.000468,0.000423,0.000727,0.001157,0.001741,0.002064};
2979 Int_t nPointsCumulant2nd0510ALICE_v2 = sizeof(xCumulant2nd0510ALICE_v2)/sizeof(Double_t);
2980 TGraphErrors *Cumulant2nd0510ALICE_v2 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v2,xCumulant2nd0510ALICE_v2,yCumulant2nd0510ALICE_v2,
2981 xErrCumulant2nd0510ALICE_v2,yErrCumulant2nd0510ALICE_v2);
2982 Cumulant2nd0510ALICE_v2->SetMarkerStyle(kOpenCircle);
2983 Cumulant2nd0510ALICE_v2->SetMarkerColor(kBlue);
2985 return Cumulant2nd0510ALICE_v2;
2990 // v3{2}(pt) for 5-10%:
2991 Double_t xCumulant2nd0510ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
2992 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
2993 Double_t yCumulant2nd0510ALICE_v3[] = {0.000000,0.000000,0.008596,0.010700,0.013820,0.017524,0.021507,0.024316,0.028491,0.032880,
2994 0.038741,0.045830,0.052486,0.059560,0.067990,0.081006,0.097402,0.107050,0.111743,0.116434};
2995 Double_t xErrCumulant2nd0510ALICE_v3[20] = {0.};
2996 Double_t yErrCumulant2nd0510ALICE_v3[] = {0.000000,0.000000,0.000208,0.000207,0.000218,0.000235,0.000258,0.000284,0.000314,0.000347,
2997 0.000285,0.000345,0.000426,0.000521,0.000642,0.000586,0.001008,0.001611,0.002421,0.002853};
2998 Int_t nPointsCumulant2nd0510ALICE_v3 = sizeof(xCumulant2nd0510ALICE_v3)/sizeof(Double_t);
2999 TGraphErrors *Cumulant2nd0510ALICE_v3 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v3,xCumulant2nd0510ALICE_v3,yCumulant2nd0510ALICE_v3,
3000 xErrCumulant2nd0510ALICE_v3,yErrCumulant2nd0510ALICE_v3);
3001 Cumulant2nd0510ALICE_v3->SetMarkerStyle(kOpenCircle);
3002 Cumulant2nd0510ALICE_v3->SetMarkerColor(kBlue);
3004 return Cumulant2nd0510ALICE_v3;
3009 // v4{2}(pt) for 5-10%:
3010 Double_t xCumulant2nd0510ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3011 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3012 Double_t yCumulant2nd0510ALICE_v4[] = {0.000000,0.000000,0.006466,0.006731,0.006344,0.007374,0.008775,0.010324,0.012323,0.014533,
3013 0.017261,0.022507,0.028776,0.035403,0.041936,0.051491,0.070340,0.080081,0.095077,0.088526};
3014 Double_t xErrCumulant2nd0510ALICE_v4[20] = {0.};
3015 Double_t yErrCumulant2nd0510ALICE_v4[] = {0.000000,0.000000,0.000292,0.000295,0.000312,0.000336,0.000366,0.000403,0.000443,0.000485,
3016 0.000399,0.000486,0.000603,0.000738,0.000914,0.000836,0.001443,0.002303,0.003448,0.004078};
3017 Int_t nPointsCumulant2nd0510ALICE_v4 = sizeof(xCumulant2nd0510ALICE_v4)/sizeof(Double_t);
3018 TGraphErrors *Cumulant2nd0510ALICE_v4 = new TGraphErrors(nPointsCumulant2nd0510ALICE_v4,xCumulant2nd0510ALICE_v4,yCumulant2nd0510ALICE_v4,
3019 xErrCumulant2nd0510ALICE_v4,yErrCumulant2nd0510ALICE_v4);
3020 Cumulant2nd0510ALICE_v4->SetMarkerStyle(kOpenCircle);
3021 Cumulant2nd0510ALICE_v4->SetMarkerColor(kBlue);
3023 return Cumulant2nd0510ALICE_v4;
3029 TGraphErrors* GetFlow1020(Int_t n)
3031 // private communication 02.02.11, Ante B. / Raimond
3035 // v2{2}(pt) for 10-20%:
3036 Double_t xCumulant2nd1020ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3037 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3038 Double_t yCumulant2nd1020ALICE_v2[] = {0.000000,0.000000,0.027683,0.037083,0.046511,0.055519,0.063979,0.071626,0.078537,0.085975,
3039 0.095001,0.106979,0.118456,0.129721,0.140641,0.155161,0.173402,0.179870,0.180616,0.168921};
3040 Double_t xErrCumulant2nd1020ALICE_v2[20] = {0.};
3041 Double_t yErrCumulant2nd1020ALICE_v2[] = {0.000000,0.000000,0.000121,0.000124,0.000134,0.000147,0.000163,0.000179,0.000198,0.000217,
3042 0.000177,0.000212,0.000257,0.000311,0.000380,0.000341,0.000569,0.000882,0.001309,0.001537};
3043 Int_t nPointsCumulant2nd1020ALICE_v2 = sizeof(xCumulant2nd1020ALICE_v2)/sizeof(Double_t);
3044 TGraphErrors *Cumulant2nd1020ALICE_v2 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v2,xCumulant2nd1020ALICE_v2,yCumulant2nd1020ALICE_v2,
3045 xErrCumulant2nd1020ALICE_v2,yErrCumulant2nd1020ALICE_v2);
3046 Cumulant2nd1020ALICE_v2->SetMarkerStyle(kFullSquare);
3047 Cumulant2nd1020ALICE_v2->SetMarkerColor(kRed);
3049 return Cumulant2nd1020ALICE_v2;
3054 // v3{2}(pt) for 10-20%:
3055 Double_t xCumulant2nd1020ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3056 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3057 Double_t yCumulant2nd1020ALICE_v3[] = {0.000000,0.000000,0.009830,0.012858,0.016111,0.020120,0.023948,0.028349,0.032741,0.037244,
3058 0.043385,0.051803,0.059374,0.068686,0.076763,0.090151,0.106530,0.117448,0.121383,0.118247};
3059 Double_t xErrCumulant2nd1020ALICE_v3[20] = {0.};
3060 Double_t yErrCumulant2nd1020ALICE_v3[] = {0.000000,0.000000,0.000171,0.000170,0.000180,0.000195,0.000215,0.000236,0.000261,0.000287,
3061 0.000236,0.000288,0.000353,0.000434,0.000536,0.000488,0.000823,0.001277,0.001892,0.002224};
3062 Int_t nPointsCumulant2nd1020ALICE_v3 = sizeof(xCumulant2nd1020ALICE_v3)/sizeof(Double_t);
3063 TGraphErrors *Cumulant2nd1020ALICE_v3 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v3,xCumulant2nd1020ALICE_v3,yCumulant2nd1020ALICE_v3,
3064 xErrCumulant2nd1020ALICE_v3,yErrCumulant2nd1020ALICE_v3);
3065 Cumulant2nd1020ALICE_v3->SetMarkerStyle(kFullSquare);
3066 Cumulant2nd1020ALICE_v3->SetMarkerColor(kRed);
3068 return Cumulant2nd1020ALICE_v3;
3073 // v4{2}(pt) for 10-20%:
3074 Double_t xCumulant2nd1020ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3075 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3076 Double_t yCumulant2nd1020ALICE_v4[] = {0.000000,0.000000,0.007423,0.007647,0.008189,0.008592,0.009489,0.011671,0.013739,0.017199,
3077 0.020084,0.026004,0.031843,0.038388,0.047357,0.057251,0.072433,0.086326,0.094282,0.097432};
3078 Double_t xErrCumulant2nd1020ALICE_v4[20] = {0.};
3079 Double_t yErrCumulant2nd1020ALICE_v4[] = {0.000000,0.000000,0.000243,0.000244,0.000257,0.000279,0.000306,0.000335,0.000368,0.000405,
3080 0.000333,0.000406,0.000502,0.000618,0.000770,0.000701,0.001185,0.001845,0.002730,0.003193};
3081 Int_t nPointsCumulant2nd1020ALICE_v4 = sizeof(xCumulant2nd1020ALICE_v4)/sizeof(Double_t);
3082 TGraphErrors *Cumulant2nd1020ALICE_v4 = new TGraphErrors(nPointsCumulant2nd1020ALICE_v4,xCumulant2nd1020ALICE_v4,yCumulant2nd1020ALICE_v4,
3083 xErrCumulant2nd1020ALICE_v4,yErrCumulant2nd1020ALICE_v4);
3084 Cumulant2nd1020ALICE_v4->SetMarkerStyle(kFullSquare);
3085 Cumulant2nd1020ALICE_v4->SetMarkerColor(kRed);
3087 return Cumulant2nd1020ALICE_v4;
3093 TGraphErrors* GetFlow2030(Int_t n)
3095 // private communication 02.02.11, Ante B. / Raimond
3099 Double_t xCumulant2nd2030ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3100 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3101 Double_t yCumulant2nd2030ALICE_v2[] = {0.000000,0.000000,0.035557,0.048064,0.060768,0.072585,0.083808,0.093772,0.103310,0.112602,
3102 0.124846,0.140603,0.155345,0.169450,0.183077,0.200173,0.219693,0.225741,0.223318,0.207356};
3103 Double_t xErrCumulant2nd2030ALICE_v2[20] = {0.};
3104 Double_t yErrCumulant2nd2030ALICE_v2[] = {0.000000,0.000000,0.000144,0.000147,0.000159,0.000175,0.000194,0.000214,0.000235,0.000259,
3105 0.000211,0.000254,0.000310,0.000377,0.000464,0.000418,0.000677,0.001027,0.001513,0.001761};
3106 Int_t nPointsCumulant2nd2030ALICE_v2 = sizeof(xCumulant2nd2030ALICE_v2)/sizeof(Double_t);
3107 TGraphErrors *Cumulant2nd2030ALICE_v2 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v2,xCumulant2nd2030ALICE_v2,yCumulant2nd2030ALICE_v2,
3108 xErrCumulant2nd2030ALICE_v2,yErrCumulant2nd2030ALICE_v2);
3109 Cumulant2nd2030ALICE_v2->SetMarkerStyle(kOpenSquare);
3110 Cumulant2nd2030ALICE_v2->SetMarkerColor(kRed);
3112 return Cumulant2nd2030ALICE_v2;
3117 // v3{2}(pt) for 20-30%:
3118 Double_t xCumulant2nd2030ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3119 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3120 Double_t yCumulant2nd2030ALICE_v3[] = {0.000000,0.000000,0.011287,0.014937,0.018479,0.022962,0.027854,0.031938,0.037038,0.041443,
3121 0.049872,0.058720,0.068353,0.077692,0.087859,0.099863,0.116141,0.124486,0.124786,0.119520};
3122 Double_t xErrCumulant2nd2030ALICE_v3[20] = {0.};
3123 Double_t yErrCumulant2nd2030ALICE_v3[] = {0.000000,0.000000,0.000215,0.000216,0.000228,0.000248,0.000272,0.000300,0.000332,0.000366,
3124 0.000301,0.000369,0.000456,0.000561,0.000700,0.000636,0.001038,0.001574,0.002307,0.002676};
3125 Int_t nPointsCumulant2nd2030ALICE_v3 = sizeof(xCumulant2nd2030ALICE_v3)/sizeof(Double_t);
3126 TGraphErrors *Cumulant2nd2030ALICE_v3 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v3,xCumulant2nd2030ALICE_v3,yCumulant2nd2030ALICE_v3,
3127 xErrCumulant2nd2030ALICE_v3,yErrCumulant2nd2030ALICE_v3);
3128 Cumulant2nd2030ALICE_v3->SetMarkerStyle(kOpenSquare);
3129 Cumulant2nd2030ALICE_v3->SetMarkerColor(kRed);
3131 return Cumulant2nd2030ALICE_v3;
3136 // v4{2}(pt) for 20-30%:
3137 Double_t xCumulant2nd2030ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3138 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3139 Double_t yCumulant2nd2030ALICE_v4[] = {0.000000,0.000000,0.008435,0.009824,0.009387,0.010408,0.011458,0.013770,0.016335,0.019165,
3140 0.023770,0.030071,0.036231,0.043950,0.051803,0.065222,0.082155,0.091864,0.105061,0.105167};
3141 Double_t xErrCumulant2nd2030ALICE_v4[20] = {0.};
3142 Double_t yErrCumulant2nd2030ALICE_v4[] = {0.000000,0.000000,0.000308,0.000308,0.000328,0.000355,0.000391,0.000430,0.000473,0.000524,
3143 0.000430,0.000524,0.000652,0.000807,0.001006,0.000919,0.001502,0.002277,0.003339,0.003871};
3144 Int_t nPointsCumulant2nd2030ALICE_v4 = sizeof(xCumulant2nd2030ALICE_v4)/sizeof(Double_t);
3145 TGraphErrors *Cumulant2nd2030ALICE_v4 = new TGraphErrors(nPointsCumulant2nd2030ALICE_v4,xCumulant2nd2030ALICE_v4,yCumulant2nd2030ALICE_v4,
3146 xErrCumulant2nd2030ALICE_v4,yErrCumulant2nd2030ALICE_v4);
3147 Cumulant2nd2030ALICE_v4->SetMarkerStyle(kOpenSquare);
3148 Cumulant2nd2030ALICE_v4->SetMarkerColor(kRed);
3150 return Cumulant2nd2030ALICE_v4;
3156 TGraphErrors* GetFlow3040(Int_t n)
3158 // private communication 02.02.11, Ante B. / Raimond
3162 // v2{2}(pt) for 30-40%:
3163 Double_t xCumulant2nd3040ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3164 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3165 Double_t yCumulant2nd3040ALICE_v2[] = {0.000000,0.000000,0.040797,0.055427,0.070543,0.084024,0.096562,0.109411,0.119853,0.130964,
3166 0.145377,0.163806,0.179825,0.196178,0.210377,0.226556,0.245686,0.247898,0.240058,0.225011};
3167 Double_t xErrCumulant2nd3040ALICE_v2[20] = {0.};
3168 Double_t yErrCumulant2nd3040ALICE_v2[] = {0.000000,0.000000,0.000177,0.000182,0.000197,0.000216,0.000239,0.000265,0.000293,0.000325,
3169 0.000266,0.000321,0.000395,0.000486,0.000603,0.000536,0.000840,0.001258,0.001843,0.002118};
3170 Int_t nPointsCumulant2nd3040ALICE_v2 = sizeof(xCumulant2nd3040ALICE_v2)/sizeof(Double_t);
3171 TGraphErrors *Cumulant2nd3040ALICE_v2 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v2,xCumulant2nd3040ALICE_v2,yCumulant2nd3040ALICE_v2,
3172 xErrCumulant2nd3040ALICE_v2,yErrCumulant2nd3040ALICE_v2);
3173 Cumulant2nd3040ALICE_v2->SetMarkerStyle(kFullTriangleUp);
3174 Cumulant2nd3040ALICE_v2->SetMarkerSize(1.2);
3175 Cumulant2nd3040ALICE_v2->SetMarkerColor(kGreen+2);
3177 return Cumulant2nd3040ALICE_v2;
3182 // v3{2}(pt) for 30-40%:
3183 Double_t xCumulant2nd3040ALICE_v3[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3184 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3185 Double_t yCumulant2nd3040ALICE_v3[] = {0.000000,0.000000,0.012226,0.016391,0.020792,0.026208,0.030380,0.035710,0.041025,0.047062,
3186 0.053075,0.064201,0.074116,0.085314,0.094391,0.106819,0.124012,0.129388,0.134315,0.132330};
3187 Double_t xErrCumulant2nd3040ALICE_v3[20] = {0.};
3188 Double_t yErrCumulant2nd3040ALICE_v3[] = {0.000000,0.000000,0.000284,0.000286,0.000303,0.000329,0.000364,0.000403,0.000443,0.000492,
3189 0.000408,0.000500,0.000627,0.000778,0.000973,0.000874,0.001375,0.002050,0.002992,0.003438};
3190 Int_t nPointsCumulant2nd3040ALICE_v3 = sizeof(xCumulant2nd3040ALICE_v3)/sizeof(Double_t);
3191 TGraphErrors *Cumulant2nd3040ALICE_v3 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v3,xCumulant2nd3040ALICE_v3,yCumulant2nd3040ALICE_v3,
3192 xErrCumulant2nd3040ALICE_v3,yErrCumulant2nd3040ALICE_v3);
3193 Cumulant2nd3040ALICE_v3->SetMarkerStyle(kFullTriangleUp);
3194 Cumulant2nd3040ALICE_v3->SetMarkerSize(1.2);
3195 Cumulant2nd3040ALICE_v3->SetMarkerColor(kGreen+2);
3197 return Cumulant2nd3040ALICE_v3;
3202 // v4{2}(pt) for 30-40%:
3203 Double_t xCumulant2nd3040ALICE_v4[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3204 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3205 Double_t yCumulant2nd3040ALICE_v4[] = {0.000000,0.000000,0.010718,0.011490,0.010994,0.012527,0.013748,0.016425,0.018857,0.021622,
3206 0.026853,0.034636,0.042651,0.049892,0.057795,0.070865,0.088486,0.101656,0.113886,0.118202};
3207 Double_t xErrCumulant2nd3040ALICE_v4[20] = {0.};
3208 Double_t yErrCumulant2nd3040ALICE_v4[] = {0.000000,0.000000,0.000401,0.000406,0.000433,0.000472,0.000521,0.000575,0.000634,0.000704,
3209 0.000580,0.000714,0.000890,0.001114,0.001398,0.001253,0.001974,0.002945,0.004290,0.004909};
3210 Int_t nPointsCumulant2nd3040ALICE_v4 = sizeof(xCumulant2nd3040ALICE_v4)/sizeof(Double_t);
3211 TGraphErrors *Cumulant2nd3040ALICE_v4 = new TGraphErrors(nPointsCumulant2nd3040ALICE_v4,xCumulant2nd3040ALICE_v4,yCumulant2nd3040ALICE_v4,
3212 xErrCumulant2nd3040ALICE_v4,yErrCumulant2nd3040ALICE_v4);
3213 Cumulant2nd3040ALICE_v4->SetMarkerStyle(kFullTriangleUp);
3214 Cumulant2nd3040ALICE_v4->SetMarkerSize(1.2);
3215 Cumulant2nd3040ALICE_v4->SetMarkerColor(kGreen+2);
3217 return Cumulant2nd3040ALICE_v4;
3223 TGraphErrors* GetFlow4050(Int_t n)
3225 // private communication 02.02.11, Ante B. / Raimond
3229 // v2{2}(pt) for 40-50%:
3230 Double_t xCumulant2nd4050ALICE_v2[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3231 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.500000};
3232 Double_t yCumulant2nd4050ALICE_v2[] = {0.000000,0.000000,0.043593,0.059522,0.075558,0.090681,0.104453,0.117913,0.129349,0.141743,
3233 0.157076,0.176121,0.193651,0.208844,0.222402,0.238407,0.252512,0.253592,0.243571,0.233018};
3234 Double_t xErrCumulant2nd4050ALICE_v2[20] = {0.};
3235 Double_t yErrCumulant2nd4050ALICE_v2[] = {0.000000,0.000000,0.000234,0.000241,0.000261,0.000288,0.000322,0.000357,0.000395,0.000438,
3236 0.000362,0.000447,0.000555,0.000685,0.000846,0.000733,0.001121,0.001665,0.002433,0.002768};
3237 Int_t nPointsCumulant2nd4050ALICE_v2 = sizeof(xCumulant2nd4050ALICE_v2)/sizeof(Double_t);
3238 TGraphErrors *Cumulant2nd4050ALICE_v2 = new TGraphErrors(nPointsCumulant2nd4050ALICE_v2,xCumulant2nd4050ALICE_v2,yCumulant2nd4050ALICE_v2,
3239 xErrCumulant2nd4050ALICE_v2,yErrCumulant2nd4050ALICE_v2);
3240 Cumulant2nd4050ALICE_v2->SetMarkerStyle(kOpenTriangleUp);
3241 Cumulant2nd4050ALICE_v2->SetMarkerSize(1.2);
3242 Cumulant2nd4050ALICE_v2->SetMarkerColor(kGreen+2);
3244 return Cumulant2nd4050ALICE_v2;
3251 // results up to high pT
3253 TGraphErrors* GetFlow05(Int_t n)
3255 // private communication 09.03.11, Ante B. / Raimond
3259 // v2{2}(pt) for 0-5%:
3260 Double_t xCumulant2nd0005ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3261 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3262 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3263 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3264 Double_t yCumulant2nd0005ALICE[] = {0.000000,0.000000,0.018169,0.020988,0.024899,0.028309,0.031974,0.035188,0.038218,0.041202,
3265 0.043910,0.046560,0.048183,0.050640,0.052874,0.055334,0.056948,0.059427,0.061540,0.063218,
3266 0.065452,0.069222,0.072578,0.074723,0.077749,0.077178,0.080514,0.075325,0.077692,0.079710,
3267 0.073280,0.063849,0.068274,0.066045,0.071496,0.104352,0.091646,0.050220,0.124185,0.088535};
3268 Double_t xErrCumulant2nd0005ALICE[40] = {0.};
3269 Double_t yErrCumulant2nd0005ALICE[] = {0.000000,0.000000,0.000190,0.000191,0.000199,0.000212,0.000230,0.000248,0.000268,0.000293,
3270 0.000319,0.000346,0.000379,0.000418,0.000459,0.000502,0.000554,0.000614,0.000674,0.000749,
3271 0.000620,0.000769,0.000958,0.001182,0.001446,0.001331,0.001858,0.002552,0.003453,0.004606,
3272 0.004289,0.007006,0.010046,0.013853,0.017709,0.016630,0.025728,0.036763,0.045056,0.029011};
3273 Int_t nPointsCumulant2nd0005ALICE = sizeof(xCumulant2nd0005ALICE)/sizeof(Double_t);
3274 TGraphErrors *Cumulant2nd0005ALICE = new TGraphErrors(nPointsCumulant2nd0005ALICE,xCumulant2nd0005ALICE,yCumulant2nd0005ALICE,
3275 xErrCumulant2nd0005ALICE,yErrCumulant2nd0005ALICE);
3276 Cumulant2nd0005ALICE->SetMarkerStyle(kFullCircle);
3277 Cumulant2nd0005ALICE->SetMarkerColor(kBlue);
3279 return Cumulant2nd0005ALICE;
3293 TGraphErrors* GetFlow05_Rap10(Int_t n)
3295 // private communication 17.05.11, Ante B. / should correspond to machcone paper draft
3299 // v2{SP}(pt) for 00-05%:
3300 const Int_t nPointsSP_0005ALICE_v2_etaGap10 = 17;
3301 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,
3302 1.300000,1.500000,1.700000,1.900000,2.200000,2.600000,3.000000,3.650000,4.550000};
3303 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,
3304 0.043103,0.046626,0.052386,0.057132,0.060070,0.068419,0.061459,0.056816,0.050311};
3305 Double_t xErrSP_0005ALICE_v2_etaGap10[nPointsSP_0005ALICE_v2_etaGap10] = {0.};
3306 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,
3307 0.001410,0.001736,0.002131,0.002620,0.002502,0.003759,0.005615,0.006617,0.014242};
3308 TGraphErrors *GrSP_0005ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v2_etaGap10,xSP_0005ALICE_v2_etaGap10,ySP_0005ALICE_v2_etaGap10,
3309 xErrSP_0005ALICE_v2_etaGap10,yErrSP_0005ALICE_v2_etaGap10);
3311 return GrSP_0005ALICE_v2_etaGap10;
3316 // v3{SP}(pt) for 00-05%:
3317 const Int_t nPointsSP_0005ALICE_v3_etaGap10 = 16;
3318 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,
3319 1.300000,1.500000,1.700000,1.900000,2.300000,2.900000,3.650000,4.550000};
3320 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,
3321 0.038730,0.045653,0.052469,0.062303,0.071522,0.082223,0.083373,0.076951};
3322 Double_t xErrSP_0005ALICE_v3_etaGap10[nPointsSP_0005ALICE_v3_etaGap10] = {0.};
3323 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,
3324 0.001734,0.002124,0.002610,0.003206,0.002724,0.004977,0.008123,0.017180};
3325 TGraphErrors *GrSP_0005ALICE_v3_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v3_etaGap10,xSP_0005ALICE_v3_etaGap10,ySP_0005ALICE_v3_etaGap10,
3326 xErrSP_0005ALICE_v3_etaGap10,yErrSP_0005ALICE_v3_etaGap10);
3329 return GrSP_0005ALICE_v3_etaGap10;
3334 // v4{SP}(pt) for 00-05%:
3335 const Int_t nPointsSP_0005ALICE_v4_etaGap10 = 11;
3336 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};
3337 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,
3339 Double_t xErrSP_0005ALICE_v4_etaGap10[nPointsSP_0005ALICE_v4_etaGap10] = {0.};
3340 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,
3342 TGraphErrors *GrSP_0005ALICE_v4_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v4_etaGap10,xSP_0005ALICE_v4_etaGap10,ySP_0005ALICE_v4_etaGap10,
3343 xErrSP_0005ALICE_v4_etaGap10,yErrSP_0005ALICE_v4_etaGap10);
3345 return GrSP_0005ALICE_v4_etaGap10;
3350 // v5{SP}(pt) for 00-05%:
3351 const Int_t nPointsSP_0005ALICE_v5_etaGap10 = 12;
3352 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,
3353 2.800000,3.500000,4.500000};
3354 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,
3355 0.031373,0.068504,0.017964};
3356 Double_t xErrSP_0005ALICE_v5_etaGap10[nPointsSP_0005ALICE_v5_etaGap10] = {0.};
3357 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,
3358 0.010073,0.011899,0.027756};
3359 TGraphErrors *GrSP_0005ALICE_v5_etaGap10 = new TGraphErrors(nPointsSP_0005ALICE_v5_etaGap10,xSP_0005ALICE_v5_etaGap10,ySP_0005ALICE_v5_etaGap10,
3360 xErrSP_0005ALICE_v5_etaGap10,yErrSP_0005ALICE_v5_etaGap10);
3362 return GrSP_0005ALICE_v5_etaGap10;
3368 TGraphErrors* GetFlow510(Int_t n)
3370 // private communication 09.03.11, Ante B. / Raimond
3374 // v2{2}(pt) for 5-10%:
3375 Double_t xCumulant2nd0510ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3376 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3377 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3378 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3379 Double_t yCumulant2nd0510ALICE[] = {0.000000,0.000000,0.022354,0.028064,0.034341,0.040769,0.046265,0.051160,0.056712,0.061354,
3380 0.066290,0.070340,0.074453,0.078444,0.082367,0.085785,0.088086,0.092676,0.096169,0.100366,
3381 0.104227,0.109710,0.117032,0.121784,0.122227,0.126537,0.127966,0.117790,0.117884,0.111436,
3382 0.104945,0.097640,0.086481,0.091663,0.091404,0.080132,0.015864,0.101500,0.033347,0.205130};
3383 Double_t xErrCumulant2nd0510ALICE[40] = {0.};
3384 Double_t yErrCumulant2nd0510ALICE[] = {0.000000,0.000000,0.000173,0.000176,0.000186,0.000199,0.000219,0.000236,0.000260,0.000283,
3385 0.000312,0.000340,0.000373,0.000410,0.000454,0.000501,0.000552,0.000610,0.000675,0.000753,
3386 0.000620,0.000774,0.000961,0.001183,0.001431,0.001309,0.001814,0.002481,0.003342,0.004379,
3387 0.004122,0.006716,0.009851,0.013626,0.017517,0.015790,0.025680,0.038041,0.054144,0.038987};
3388 Int_t nPointsCumulant2nd0510ALICE = sizeof(xCumulant2nd0510ALICE)/sizeof(Double_t);
3389 TGraphErrors *Cumulant2nd0510ALICE = new TGraphErrors(nPointsCumulant2nd0510ALICE,xCumulant2nd0510ALICE,yCumulant2nd0510ALICE,
3390 xErrCumulant2nd0510ALICE,yErrCumulant2nd0510ALICE);
3391 Cumulant2nd0510ALICE->SetMarkerStyle(kOpenCircle);
3392 Cumulant2nd0510ALICE->SetMarkerColor(kBlue);
3394 return Cumulant2nd0510ALICE;
3408 TGraphErrors* GetFlow510_Rap10(Int_t n)
3410 // private communication 18.05.11, Ante B.
3414 // v2{SP}(pt) for 05-10%, rapidity gap = 1.0:
3415 const Int_t nPointsSP_0510ALICE_v2_etaGap10 = 19;
3416 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,
3417 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.250000,
3419 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,
3420 0.066516,0.073891,0.080945,0.090386,0.094505,0.106393,0.120303,0.122586,0.121731,0.107343,
3422 Double_t xErrSP_0510ALICE_v2_etaGap10[nPointsSP_0510ALICE_v2_etaGap10] = {0.};
3423 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,
3424 0.000586,0.000717,0.000880,0.001082,0.001333,0.001189,0.001969,0.003199,0.005011,0.007602,
3426 TGraphErrors *GrSP_0510ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_0510ALICE_v2_etaGap10,xSP_0510ALICE_v2_etaGap10,
3427 ySP_0510ALICE_v2_etaGap10,xErrSP_0510ALICE_v2_etaGap10,
3428 yErrSP_0510ALICE_v2_etaGap10);
3430 return GrSP_0510ALICE_v2_etaGap10;
3436 TGraphErrors* GetFlow1020(Int_t n)
3438 // private communication 09.03.11, Ante B. / Raimond
3442 // v2{2}(pt) for 10-20%:
3443 Double_t xCumulant2nd1020ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3444 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3445 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3446 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3447 Double_t yCumulant2nd1020ALICE[] = {0.000000,0.000000,0.028508,0.037698,0.046914,0.055750,0.063948,0.072298,0.079396,0.086829,
3448 0.093382,0.099676,0.105412,0.110792,0.116715,0.122327,0.127079,0.132302,0.137183,0.142346,
3449 0.149059,0.156729,0.164672,0.171840,0.175346,0.176824,0.178878,0.174979,0.169229,0.153109,
3450 0.139676,0.125686,0.120554,0.096537,0.084736,0.118152,0.116079,0.060032,0.093764,0.206506};
3451 Double_t xErrCumulant2nd1020ALICE[40] = {0.};
3452 Double_t yErrCumulant2nd1020ALICE[] = {0.000000,0.000000,0.000134,0.000136,0.000145,0.000158,0.000173,0.000190,0.000209,0.000229,
3453 0.000252,0.000275,0.000301,0.000331,0.000365,0.000401,0.000442,0.000488,0.000541,0.000599,
3454 0.000496,0.000614,0.000757,0.000915,0.001095,0.000989,0.001360,0.001847,0.002477,0.003234,
3455 0.003012,0.004867,0.007123,0.009774,0.012740,0.011682,0.019629,0.028568,0.039931,0.024776};
3456 Int_t nPointsCumulant2nd1020ALICE = sizeof(xCumulant2nd1020ALICE)/sizeof(Double_t);
3457 TGraphErrors *Cumulant2nd1020ALICE = new TGraphErrors(nPointsCumulant2nd1020ALICE,xCumulant2nd1020ALICE,yCumulant2nd1020ALICE,
3458 xErrCumulant2nd1020ALICE,yErrCumulant2nd1020ALICE);
3459 Cumulant2nd1020ALICE->SetMarkerStyle(kFullSquare);
3460 Cumulant2nd1020ALICE->SetMarkerColor(kRed);
3462 return Cumulant2nd1020ALICE;
3476 TGraphErrors* GetFlow1020_Rap10(Int_t n)
3478 // private communication 18.05.11, Ante B.
3482 // v2{SP}(pt) for 10-20%, rapidity gap = 1.0:
3483 const Int_t nPointsSP_1020ALICE_v2_etaGap10 = 19;
3484 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,
3485 1.100000,1.300000,1.500000,1.700000,1.900000,2.250000,2.750000,3.250000,3.750000,4.250000,
3487 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,
3488 0.094701,0.105631,0.117906,0.128147,0.138505,0.153494,0.166651,0.172691,0.177337,0.155068,
3490 Double_t xErrSP_1020ALICE_v2_etaGap10[nPointsSP_1020ALICE_v2_etaGap10] = {0.};
3491 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,
3492 0.000423,0.000517,0.000634,0.000779,0.000959,0.000856,0.001406,0.002266,0.003528,0.005281,
3494 TGraphErrors *GrSP_1020ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_1020ALICE_v2_etaGap10,xSP_1020ALICE_v2_etaGap10,
3495 ySP_1020ALICE_v2_etaGap10,xErrSP_1020ALICE_v2_etaGap10,
3496 yErrSP_1020ALICE_v2_etaGap10);
3498 return GrSP_1020ALICE_v2_etaGap10;
3504 TGraphErrors* GetFlow2030(Int_t n)
3506 // private communication 09.03.11, Ante B. / Raimond
3510 // v2{2}(pt) for 20-30%:
3511 Double_t xCumulant2nd2030ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3512 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3513 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3514 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3515 Double_t yCumulant2nd2030ALICE[] = {0.000000,0.000000,0.035366,0.047465,0.060083,0.072090,0.083418,0.093576,0.103842,0.113110,
3516 0.122193,0.130168,0.138158,0.145627,0.152851,0.159129,0.166073,0.173144,0.178698,0.186188,
3517 0.192045,0.202199,0.210535,0.215004,0.220457,0.223339,0.224050,0.211567,0.203955,0.189716,
3518 0.165994,0.147185,0.131953,0.139331,0.151293,0.127406,0.153764,0.089628,0.161247,0.511418};
3519 Double_t xErrCumulant2nd2030ALICE[40] = {0.};
3520 Double_t yErrCumulant2nd2030ALICE[] = {0.000000,0.000000,0.000155,0.000157,0.000169,0.000184,0.000202,0.000222,0.000244,0.000269,
3521 0.000296,0.000325,0.000357,0.000394,0.000435,0.000481,0.000532,0.000589,0.000655,0.000731,
3522 0.000605,0.000743,0.000904,0.001081,0.001277,0.001145,0.001568,0.002119,0.002806,0.003635,
3523 0.003383,0.005346,0.007935,0.010739,0.014682,0.013434,0.021531,0.032352,0.040396,0.028472};
3524 Int_t nPointsCumulant2nd2030ALICE = sizeof(xCumulant2nd2030ALICE)/sizeof(Double_t);
3525 TGraphErrors *Cumulant2nd2030ALICE = new TGraphErrors(nPointsCumulant2nd2030ALICE,xCumulant2nd2030ALICE,yCumulant2nd2030ALICE,
3526 xErrCumulant2nd2030ALICE,yErrCumulant2nd2030ALICE);
3527 Cumulant2nd2030ALICE->SetMarkerStyle(kOpenSquare);
3528 Cumulant2nd2030ALICE->SetMarkerColor(kRed);
3530 return Cumulant2nd2030ALICE;
3544 TGraphErrors* GetFlow3040(Int_t n)
3546 // private communication 09.03.11, Ante B. / Raimond
3550 // v2{2}(pt) for 30-40%:
3551 Double_t xCumulant2nd3040ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3552 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3553 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3554 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3555 Double_t yCumulant2nd3040ALICE[] = {0.000000,0.000000,0.039584,0.054196,0.069291,0.082976,0.095622,0.108940,0.119830,0.131587,
3556 0.141091,0.150899,0.160573,0.168676,0.176301,0.183823,0.191672,0.199506,0.206854,0.212830,
3557 0.219526,0.229376,0.236513,0.240863,0.245961,0.245891,0.242608,0.234302,0.219580,0.212848,
3558 0.194666,0.190184,0.171036,0.159173,0.156932,0.141324,0.132809,0.182683,0.023272,0.032825};
3559 Double_t xErrCumulant2nd3040ALICE[40] = {0.};
3560 Double_t yErrCumulant2nd3040ALICE[] = {0.000000,0.000000,0.000189,0.000192,0.000205,0.000224,0.000247,0.000273,0.000302,0.000334,
3561 0.000369,0.000407,0.000448,0.000496,0.000552,0.000612,0.000682,0.000758,0.000844,0.000941,
3562 0.000774,0.000937,0.001123,0.001329,0.001565,0.001397,0.001911,0.002549,0.003378,0.004306,
3563 0.003987,0.006353,0.009128,0.013032,0.016891,0.015806,0.025150,0.035119,0.044487,0.050083};
3564 Int_t nPointsCumulant2nd3040ALICE = sizeof(xCumulant2nd3040ALICE)/sizeof(Double_t);
3565 TGraphErrors *Cumulant2nd3040ALICE = new TGraphErrors(nPointsCumulant2nd3040ALICE,xCumulant2nd3040ALICE,yCumulant2nd3040ALICE,
3566 xErrCumulant2nd3040ALICE,yErrCumulant2nd3040ALICE);
3567 Cumulant2nd3040ALICE->SetMarkerStyle(kFullTriangleUp);
3568 Cumulant2nd3040ALICE->SetMarkerColor(kGreen+2);
3570 return Cumulant2nd3040ALICE;
3584 TGraphErrors* GetFlow4050(Int_t n)
3586 // private communication 09.03.11, Ante B. / Raimond
3590 // v2{2}(pt) for 40-50%:
3591 Double_t xCumulant2nd4050ALICE[] = {0.050000,0.150000,0.250000,0.350000,0.450000,0.550000,0.650000,0.750000,0.850000,0.950000,
3592 1.050000,1.150000,1.250000,1.350000,1.450000,1.550000,1.650000,1.750000,1.850000,1.950000,
3593 2.100000,2.300000,2.500000,2.700000,2.900000,3.200000,3.600000,4.000000,4.400000,4.800000,
3594 5.500000,6.500000,7.500000,8.500000,9.500000,11.250000,13.750000,16.250000,18.750000,60.000000};
3595 Double_t yCumulant2nd4050ALICE[] = {0.000000,0.000000,0.041872,0.058090,0.074444,0.089181,0.103780,0.117279,0.129769,0.142051,
3596 0.153185,0.163147,0.173309,0.181668,0.190998,0.197703,0.205011,0.211063,0.219587,0.223287,
3597 0.231163,0.239606,0.246533,0.251457,0.250034,0.252989,0.240823,0.236489,0.230268,0.204321,
3598 0.213476,0.200247,0.167065,0.190655,0.173573,0.166173,0.153232,0.173112,-0.123540,0.211999};
3599 Double_t xErrCumulant2nd4050ALICE[40] = {0.};
3600 Double_t yErrCumulant2nd4050ALICE[] = {0.000000,0.000000,0.000248,0.000251,0.000270,0.000296,0.000328,0.000363,0.000403,0.000447,
3601 0.000500,0.000556,0.000617,0.000687,0.000770,0.000857,0.000952,0.001057,0.001176,0.001297,
3602 0.001054,0.001265,0.001498,0.001767,0.002076,0.001849,0.002527,0.003358,0.004372,0.005573,
3603 0.005091,0.007981,0.011746,0.015732,0.021883,0.019866,0.032443,0.046521,0.051631,0.083717};
3604 Int_t nPointsCumulant2nd4050ALICE = sizeof(xCumulant2nd4050ALICE)/sizeof(Double_t);
3605 TGraphErrors *Cumulant2nd4050ALICE = new TGraphErrors(nPointsCumulant2nd4050ALICE,xCumulant2nd4050ALICE,yCumulant2nd4050ALICE,
3606 xErrCumulant2nd4050ALICE,yErrCumulant2nd4050ALICE);
3607 Cumulant2nd4050ALICE->SetMarkerStyle(kOpenTriangleUp);
3608 Cumulant2nd4050ALICE->SetMarkerColor(kGreen+2);
3610 return Cumulant2nd4050ALICE;
3616 TGraphErrors* GetFlow6070_Rap10(Int_t n)
3618 // private communication 18.05.11, Ante B.
3622 // v2{SP}(pt) for 60-70%, rapidity gap = 1.0:
3623 const Int_t nPointsSP_6070ALICE_v2_etaGap10 = 9;
3624 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};
3625 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};
3626 Double_t xErrSP_6070ALICE_v2_etaGap10[nPointsSP_6070ALICE_v2_etaGap10] = {0.};
3627 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};
3628 TGraphErrors *GrSP_6070ALICE_v2_etaGap10 = new TGraphErrors(nPointsSP_6070ALICE_v2_etaGap10,xSP_6070ALICE_v2_etaGap10,
3629 ySP_6070ALICE_v2_etaGap10,xErrSP_6070ALICE_v2_etaGap10,
3630 yErrSP_6070ALICE_v2_etaGap10);
3632 return GrSP_6070ALICE_v2_etaGap10;
3638 Float_t CalculateFlow(TH1* ptDist, Float_t ptMin, Float_t ptMax, Int_t n, Int_t centralityBegin, Int_t centralityEnd)
3640 if (centralityBegin == 0 && centralityEnd == 1)
3641 flow = GetFlow01_Rap10(n);
3642 else if (centralityBegin == 0 && centralityEnd == 2)
3643 flow = GetFlow02_Rap10(n);
3644 else if (centralityBegin == 0 && centralityEnd == 5)
3645 flow = GetFlow05_Rap10(n);
3646 else if (centralityBegin == 5 && centralityEnd == 10)
3647 flow = GetFlow510_Rap10(n);
3648 else if (centralityBegin == 20 && centralityEnd == 30)
3649 flow = GetFlow2030(n);
3650 else if (centralityBegin == 30 && centralityEnd == 40)
3651 flow = GetFlow3040(n);
3652 else if (centralityBegin == 40 && centralityEnd == 50)
3653 flow = GetFlow4050(n);
3654 else if (centralityBegin > 50)
3655 flow = GetFlow6070_Rap10(n);
3656 else if (centralityBegin == 0 && centralityEnd == 20)
3658 flow1 = GetFlow05_Rap10(n);
3659 flow2 = GetFlow510_Rap10(n);
3660 flow3 = GetFlow1020_Rap10(n);
3662 flow = (TGraphErrors*) flow2->Clone();
3664 // centrality width * dn/deta from http://arxiv.org/PS_cache/arxiv/pdf/1012/1012.1657v2.pdf
3665 Float_t mult[] = { 5 * 1601, 5 * 1294, 10 * 966 };
3667 for (Int_t i=0; i<flow->GetN(); i++)
3669 Float_t x= flow->GetX()[i];
3671 // Printf("%f: %f %f %f", x, flow1->Eval(x), flow2->Eval(x), flow3->Eval(x));
3672 flow->GetY()[i] = flow1->Eval(x) * mult[0] + flow2->Eval(x) * mult[1] + flow3->Eval(x) * mult[2];
3673 flow->GetY()[i] /= mult[0] + mult[1] + mult[2];
3674 // Printf(" --> %f", flow->GetY()[i]);
3677 else if (centralityBegin == 20 && centralityEnd == 60)
3679 flow = GetFlow2030(n);
3680 flow2 = GetFlow3040(n);
3681 flow3 = GetFlow4050(n);
3683 // centrality width * dn/deta from http://arxiv.org/PS_cache/arxiv/pdf/1012/1012.1657v2.pdf
3684 Float_t mult[] = { 10 * 649, 10 * 426, 10 * (261+149) };
3686 if (flow->GetN() != flow2->GetN() || flow2->GetN() != flow3->GetN())
3687 AliFatal("Incompatible graphs");
3689 for (Int_t i=0; i<flow->GetN(); i++)
3691 // Printf("%f %f %f", flow->GetY()[i], flow2->GetY()[i], flow3->GetY()[i]);
3692 flow->GetY()[i] = flow->GetY()[i] * mult[0] + flow2->GetY()[i] * mult[1] + flow3->GetY()[i] * mult[2];
3693 flow->GetY()[i] /= mult[0] + mult[1] + mult[2];
3694 // Printf(" --> %f", flow->GetY()[i]);
3699 Printf("Flow range %d %d not available", centralityBegin, centralityEnd);
3705 for (Int_t bin = ptDist->FindBin(ptMin + 0.01); bin <= ptDist->FindBin(ptMax - 0.01); bin++)
3707 if (ptDist->GetBinCenter(bin) > flow->GetX()[flow->GetN()-1])
3708 vn += ptDist->GetBinContent(bin) * flow->GetY()[flow->GetN()-1];
3710 vn += ptDist->GetBinContent(bin) * flow->Eval(ptDist->GetBinCenter(bin));
3711 sum += ptDist->GetBinContent(bin);
3717 Printf("v_{%d} = %f for %f < pT < %f", n, vn, ptMin, ptMax);
3722 void CalculateFlow(const char* fileName, Int_t centralityBegin, Int_t centralityEnd)
3724 Float_t ptTrigMin = 2;
3725 Float_t ptTrigMax = 3;
3732 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
3734 cont = h->GetUEHist(2)->GetTrackHist(0);
3735 cont->GetGrid(6)->GetGrid()->GetAxis(3)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
3736 cont->GetGrid(6)->GetGrid()->GetAxis(2)->SetRangeUser(ptTrigMin + 0.01, ptTrigMax - 0.01);
3738 ptDist = cont->ShowProjection(1, 6);
3739 ptDist->Scale(1.0 / ptDist->Integral());
3741 cont = h->GetUEHist(2)->GetEventHist();
3742 cont->GetGrid(6)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
3744 ptDist2 = cont->ShowProjection(0, 6);
3745 ptDist2->Scale(1.0 / ptDist2->Integral());
3749 for (Int_t n=2; n<=4; n++)
3751 Float_t v2A = CalculateFlow(ptDist, ptMin, ptMax, n, centralityBegin, centralityEnd);
3752 Float_t v2T = CalculateFlow(ptDist2, ptTrigMin, ptTrigMax, n, centralityBegin, centralityEnd);
3754 str += Form("%f * %f, ", v2A, v2T);
3758 ptDist2->SetLineColor(2);
3759 ptDist2->Draw("SAME");
3761 Printf("%s", str.Data());
3764 // 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...)
3765 TGraphErrors***** yields = 0;
3766 TString currentYieldFile;
3770 TFile::Open("yields.root", "RECREATE");
3771 for (Int_t i=0; i<3; i++)
3773 for (Int_t j=0; j<6; j++)
3775 for (Int_t k=0; k<4; k++)
3777 // CINT limitation here
3778 TGraphErrors** tmp = yields[i][j][k];
3779 for (Int_t l=0; l<31; l++)
3781 //Printf("%d %d %d %d", i, j, k, l);
3782 tmp[l]->Write(Form("yield_%d_%d_%d_%d", i, j, k, l));
3790 void ReadYields(const char* fileName = "yields.root")
3792 if (currentYieldFile == fileName)
3795 currentYieldFile = fileName;
3797 CreateYieldStructure();
3798 TFile::Open(fileName);
3799 for (Int_t i=0; i<3; i++)
3801 for (Int_t j=0; j<6; j++)
3803 for (Int_t k=0; k<4; k++)
3805 // CINT limitation here
3806 TGraphErrors** tmp = yields[i][j][k];
3807 for (Int_t l=0; l<31; l++)
3809 //Printf("%d %d %d %d", i, j, k, l);
3810 tmp[l] = gFile->Get(Form("yield_%d_%d_%d_%d", i, j, k, l));
3817 void CreateYieldStructure()
3821 yields = new TGraphErrors****[3];
3822 for (Int_t i=0; i<3; i++)
3824 yields[i] = new TGraphErrors***[6];
3825 for (Int_t j=0; j<6; j++)
3827 yields[i][j] = new TGraphErrors**[4];
3828 for (Int_t k=0; k<4; k++)
3830 yields[i][j][k] = new TGraphErrors*[31];
3831 // CINT limitation here
3832 TGraphErrors** tmp = yields[i][j][k];
3833 for (Int_t l=0; l<31; l++)
3835 //Printf("%d %d %d %d", i, j, k, l);
3836 TGraphErrors* graph = new TGraphErrors;
3845 void GraphShiftX(TGraphErrors* graph, Float_t offset)
3847 for (Int_t i=0; i<graph->GetN(); i++)
3848 graph->GetX()[i] += offset;
3851 // Float_t kPythiaScalingFactor = 0.935;
3852 Float_t kPythiaScalingFactor = 1;
3854 void DrawYields(const char* fileName = "yields.root")
3856 ReadYields(fileName);
3858 c = new TCanvas("c", "c", 1800, 1200);
3861 Int_t markers1[] = { 24, 25, 26, 30 };
3862 Int_t markers2[] = { 20, 21, 22, 29 };
3863 Int_t colors[] = { 1, 2, 3, 4 };
3864 //Int_t caseList[] = { 0, 10+1, 10+1, 8, 10, 11, 12, 13, 1, 9 };
3865 Int_t caseList[] = { 0, 18, 18, 23, 18, 19, 20, 21, 22, 9 };
3866 const char* caseString[] = { "", "baseline sub", "baseline vs v2 sub comp", 0, "baseline sub comp", "Same/Mixed", "Same/Mixed - v2 subtr" };
3871 Int_t centralityList[] = { 0, 1, 2, 0, 0, 1 };
3872 Int_t centralityList2[] = { -1, -1, -1, 1, 2, 2 };
3873 Float_t factors[] = { 1, 1, 1, 1, 1, 1 };
3874 const char* centralityString[] = { "0-5%", "20-40%", "60-90%", "0-5% vs 20-40%", "0-5% vs 60-90%", "20-40% vs 60-90%" };
3878 Int_t centralityList[] = { 0, 2, 3, 0, 0, 2 };
3879 Int_t centralityList2[] = { -1, -1, -1, 2, 3, 3 };
3880 //Float_t factors[] = { 1, 1, 1, 1, 1.0/0.9, 1.0/0.9 };
3881 //Float_t factors[] = { 1, 1, 1, 1, 1.0/0.804, 1.0/0.804 };
3882 Float_t factors[] = { 1, 1, 1, 1, 1.0/kPythiaScalingFactor, 1.0/kPythiaScalingFactor };
3883 //Float_t factors[] = { 1, 1, 1, 1, 1.0, 1.0 };
3884 const char* centralityString[] = { "0-5%", "60-90%", "pp", "0-5% vs 60-90%", "0-5% vs pp", "60-90% vs pp" };
3887 l = new TLegend(0.5, 0.5, 0.9, 0.9);
3890 Float_t max[] = { 0.4, 2, 2, 2, 2, 10, 10 };
3891 Float_t max2[] = { 5, 2, 2, 2, 2, 2, 2, 2, 2 };
3893 dummy = new TH2F("dummy", ";p_{T,assoc};yield", 100, 0, 20, 20000, 0, 10);
3896 TGraphErrors* prevNear[6];
3897 TGraphErrors* prevAway[6];
3898 for (Int_t caseId=0; caseId<9; caseId++) // case 0->9
3900 for (Int_t k=0; k<6; k++) // centrality
3902 if (caseId != 3 && caseId < 5)
3905 c->cd(1 + k + caseId*6);
3907 c->cd(1 + k + (caseId-1)*6);
3908 currentDummy = dummy->DrawCopy();
3909 currentDummy->GetYaxis()->SetRangeUser(0, max[caseId]);
3913 latex = new TLatex(0.15, 0.95, Form("%s - %s", caseString[caseId], centralityString[k]));
3915 latex->SetTextSize(0.05);
3918 else if (caseId == 3)
3923 for (Int_t j=0; j<3; j++) // trigger pt
3925 if (caseId >= 2 && j != 1)
3927 Printf("%d %d %d %d", caseId, k, j, caseList[caseId]);
3931 // CINT limitation here
3932 TGraphErrors** tmp = yields[0][j][centralityList[k]];
3933 nearSide = tmp[caseList[caseId]];
3934 //new TCanvas; nearSide->Draw("AP"); return;
3936 nearSide->SetMarkerStyle(markers1[j]);
3937 nearSide->SetMarkerColor(colors[j]);
3938 nearSide->SetLineColor(colors[j]);
3940 if (caseId == 0 && k == 0)
3941 l->AddEntry(nearSide, Form("trig pt bin %d", j), "P");
3943 TGraphErrors** tmp = yields[1][j][centralityList[k]];
3944 awaySide = tmp[caseList[caseId]];
3945 awaySide->SetMarkerStyle(markers2[j]);
3946 awaySide->SetMarkerColor(colors[j]);
3947 awaySide->SetLineColor(colors[j]);
3949 GraphShiftX(nearSide, -0.1 + j*0.1);
3950 GraphShiftX(awaySide, -0.1 + j*0.1);
3954 nearSide->SetLineColor(caseId - 2);
3955 nearSide->SetMarkerColor(caseId - 2);
3956 awaySide->SetLineColor(caseId - 2);
3957 awaySide->SetMarkerColor(caseId - 2);
3962 nearSide->SetLineColor(caseId - 3);
3963 nearSide->SetMarkerColor(caseId - 3);
3964 awaySide->SetLineColor(caseId - 3);
3965 awaySide->SetMarkerColor(caseId - 3);
3970 prevNear[k] = (TGraphErrors*) nearSide->DrawClone("PSAME");
3971 prevAway[k] = (TGraphErrors*) awaySide->DrawClone("PSAME");
3976 for (Int_t i=0; i<nearSide->GetN(); i++)
3978 Printf("%f: %.0f%%", nearSide->GetX()[i], 100.0 * nearSide->GetEY()[i] / nearSide->GetY()[i]);
3979 Printf("%f: %.0f%%", awaySide->GetX()[i], 100.0 * awaySide->GetEY()[i] / awaySide->GetY()[i]);
3985 // CINT limitation here
3986 tmp = yields[0][j][centralityList[k]]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
3987 tmp = yields[1][j][centralityList[k]]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
3989 tmp = yields[0][j][centralityList2[k]];
3990 nearSidePeripheral = tmp[caseList[caseId]];
3991 if (iaa && caseId == 3 && k >= 4)
3992 nearSidePeripheral = tmp[caseList[caseId-1]];
3994 tmp = yields[1][j][centralityList2[k]];
3995 awaySidePeripheral = tmp[caseList[caseId]];
3996 if (iaa && caseId == 3 && k >= 4)
3997 awaySidePeripheral = tmp[caseList[caseId-1]];
3999 // nearSideCentral->Print();
4000 // nearSidePeripheral->Print();
4003 currentDummy->GetYaxis()->SetTitle("I_{CP}");
4005 currentDummy->GetYaxis()->SetTitle("I_{AA}");
4006 currentDummy->GetYaxis()->SetRangeUser(0, max2[caseId]);
4008 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4010 if (i >= nearSidePeripheral->GetN())
4012 nearSideCentral->RemovePoint(i);
4017 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4018 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4020 nearSideCentral->RemovePoint(i);
4021 nearSidePeripheral->RemovePoint(i);
4026 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4027 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4028 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4030 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4031 nearSideCentral->GetY()[i] *= factors[k];
4033 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4037 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4039 if (i >= awaySidePeripheral->GetN())
4041 awaySideCentral->RemovePoint(i);
4046 //Printf("away %d", i);
4047 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
4049 awaySideCentral->RemovePoint(i);
4050 awaySidePeripheral->RemovePoint(i);
4055 awaySideCentral->GetEY()[i] = TMath::Sqrt(
4056 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
4057 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
4059 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
4060 awaySideCentral->GetY()[i] *= factors[k];
4062 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
4067 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4068 nearSideCentral->SetLineColor(1);
4069 nearSideCentral->SetMarkerColor(1);
4071 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4072 awaySideCentral->SetLineColor(1);
4073 awaySideCentral->SetMarkerColor(1);
4078 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4079 nearSideCentral->SetLineColor(caseId - 3);
4080 nearSideCentral->SetMarkerColor(caseId - 3);
4082 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4083 awaySideCentral->SetLineColor(caseId - 3);
4084 awaySideCentral->SetMarkerColor(caseId - 3);
4087 //Printf("%d", caseList[caseId]);
4089 // nearSideCentral->Print();
4091 nearSideCentral->Draw("PSAME");
4092 awaySideCentral->Draw("PSAME");
4096 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4097 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]));
4098 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4099 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]));
4102 prevNear[k] = nearSideCentral;
4103 prevAway[k] = awaySideCentral;
4106 if (caseId == 0 && k == 0)
4111 c->SaveAs("yields.png");
4114 void FitGaussians(const char* fileName, Bool_t flat)
4116 CreateYieldStructure();
4118 aliceFile = TFile::Open(fileName);
4120 Int_t maxLeadingPt = 3;
4121 Int_t maxAssocPt = 3;
4123 TCanvas* canvas = new TCanvas("FitGaussians", "FitGaussians", 1000, 700);
4124 canvas->Divide(maxAssocPt, maxLeadingPt);
4126 for (Int_t i=0; i<maxLeadingPt; i++)
4127 for (Int_t j=0; j<maxAssocPt; j++)
4130 for (Int_t aliceCentrality=0; aliceCentrality<4; aliceCentrality++)
4132 Printf("%d %d %d", i, j, aliceCentrality);
4134 canvas->cd(j+1 + (i) * maxAssocPt);
4135 gPad->SetLeftMargin(0.15);
4136 gPad->SetBottomMargin(0.2);
4137 //gPad->SetTopMargin(0.01);
4138 gPad->SetRightMargin(0.01);
4140 hist = (TH1*) aliceFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, (flat) ? "_fit_flat" : ""));
4147 gausFit = new TF1("gausFit", "[0] + gaus(1) + gaus(4)", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
4148 gausFit->SetParameters(0, 1, 0, 1, 1, TMath::Pi(), 1);
4149 gausFit->SetParLimits(0, -1, 10000);
4150 gausFit->SetParLimits(1, 0.001, 10000);
4151 gausFit->FixParameter(2, 0);
4152 gausFit->SetParLimits(3, 0.05, 10);
4153 gausFit->SetParLimits(4, 0.001, 10000);
4154 gausFit->FixParameter(5, TMath::Pi());
4155 gausFit->SetParLimits(6, 0.1, 10);
4157 gausFit->SetLineWidth(1);
4158 gausFit->SetLineColor(hist->GetLineColor());
4160 hist->Fit(gausFit, "0RIQ");
4161 gausFit->FixParameter(0, gausFit->GetParameter(0));
4162 hist->Fit(gausFit, "RI", (aliceCentrality == 0) ? "" : "SAME");
4163 //gausFit->DrawCopy("SAME");
4166 TPRegexp reg("(\\d+\\.\\d+) \\< p_\\{T,assoc\\} \\< (\\d+\\.\\d+)");
4167 arr = reg.MatchS(hist->GetTitle(), "", 0, 10);
4168 if (arr->GetEntries() != 3)
4171 Float_t pt1 = atof(arr->At(1)->GetName());
4172 Float_t pt2 = atof(arr->At(2)->GetName());
4174 FillYield(i, aliceCentrality, (pt1 + pt2) / 2, (pt2 - pt1) / 2, 18, gausFit->GetParameter(3), gausFit->GetParError(3), gausFit->GetParameter(6), gausFit->GetParError(6));
4179 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), hist->GetMinimum()), TMath::Max(first->GetMaximum(), hist->GetMaximum()));
4181 first->GetYaxis()->SetRangeUser(first->GetMinimum(), 2 * first->GetMaximum());
4189 for (Int_t j=0; j<maxLeadingPt; j++)
4193 Int_t markers1[] = { 24, 25, 26, 30 };
4194 Int_t markers2[] = { 20, 21, 22, 29 };
4195 Int_t colors[] = { 1, 2, 3, 4 };
4197 dummy = new TH2F("dummy", ";p_{T,assoc};", 100, 0, 10, 1000, 0, 1);
4201 for (Int_t k=0; k<4; k++) // centrality
4203 // CINT limitation here
4204 TGraphErrors** tmp = yields[0][j][k];
4206 nearSide->SetMarkerStyle(markers1[k]);
4207 nearSide->SetMarkerColor(colors[k]);
4208 nearSide->SetLineColor(colors[k]);
4210 TGraphErrors** tmp = yields[1][j][k];
4212 awaySide->SetMarkerStyle(markers2[k]);
4213 awaySide->SetMarkerColor(colors[k]);
4214 awaySide->SetLineColor(colors[k]);
4216 nearSide->DrawClone("PSAME");
4217 awaySide->DrawClone("PSAME");
4222 void TsallisExamples()
4224 tsallis = new TF1("tsallis", "[0] * (1-[2]*(1-[1])*x*x)**(1/(1-[1]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
4226 Float_t q[] = { 1.0000001, 1.5, 2 };
4227 Float_t beta[] = { 0.1, 1, 10, 100 };
4229 dummy = new TH2F("dummy", "", 100, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), 100, 0, 1.2);
4233 legend = new TLegend(0.65, 0.5, 1, 1);
4234 legend->SetFillColor(0);
4236 for (Int_t i=0; i<3; i++)
4237 for (Int_t j=0; j<4; j++)
4239 tsallis->SetParameters(1, q[i], beta[j]);
4240 tsallis->SetLineColor(i+1);
4241 tsallis->SetLineStyle(j+1);
4243 legend->AddEntry(tsallis->DrawCopy("SAME"), Form("q = %.1f, #beta = %.1f", q[i], beta[j]), "L");
4249 void DrawTsallisParams()
4253 c = new TCanvas("c", "c", 900, 600);
4256 Int_t markers1[] = { 24, 25, 26, 30 };
4257 Int_t markers2[] = { 20, 21, 22, 29 };
4258 Int_t colors[] = { 1, 2, 3, 4 };
4259 Int_t caseList[] = { 12, 13, 8, 6, 8, 9, 10, 11, 1, 7 };
4260 const char* caseString[] = { "q", "beta" };
4261 const char* centralityString[] = { "0-5%", "20-40%", "60-90%", "0-5% vs 20-40%", "0-5% vs 60-90%", "20-40% vs 60-90%" };
4263 l = new TLegend(0.5, 0.5, 0.9, 0.9);
4266 Float_t max[] = { 3, 1000 };
4267 Float_t max2[] = { 5, 2 };
4269 dummy = new TH2F("dummy", ";p_{T,assoc};", 100, 0, 20, 1000, 0, 1000);
4272 for (Int_t caseId=0; caseId<2; caseId++) // case
4274 for (Int_t k=0; k<3; k++) // centrality
4276 c->cd(1 + k + caseId*3);
4278 currentDummy = dummy->DrawCopy();
4279 currentDummy->GetYaxis()->SetRangeUser(0, max[caseId]);
4280 if (caseId == 1 && k < 3)
4283 latex = new TLatex(0.15, 0.95, Form("%s - %s", caseString[caseId], centralityString[k]));
4285 latex->SetTextSize(0.05);
4288 for (Int_t j=0; j<2; j++) // trigger pt
4292 // CINT limitation here
4293 TGraphErrors** tmp = yields[0][j][k];
4294 nearSide = tmp[caseList[caseId]];
4295 nearSide->SetMarkerStyle(markers1[j]);
4296 nearSide->SetMarkerColor(colors[j]);
4297 nearSide->SetLineColor(colors[j]);
4299 if (caseId == 0 && k == 0)
4300 l->AddEntry(nearSide, Form("trig pt bin %d", j), "P");
4302 TGraphErrors** tmp = yields[1][j][k];
4303 awaySide = tmp[caseList[caseId]];
4304 awaySide->SetMarkerStyle(markers2[j]);
4305 awaySide->SetMarkerColor(colors[j]);
4306 awaySide->SetLineColor(colors[j]);
4308 GraphShiftX(nearSide, -0.1 + j*0.1);
4309 GraphShiftX(awaySide, -0.1 + j*0.1);
4311 Printf("%d %d %d", caseId, j, k);
4315 nearSide->DrawClone("PSAME");
4316 awaySide->DrawClone("PSAME");
4320 // CINT limitation here
4323 tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4324 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4325 tmp = yields[0][j][1]; nearSidePeripheral = tmp[caseList[caseId]];
4326 tmp = yields[1][j][1]; awaySidePeripheral = tmp[caseList[caseId]];
4330 tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4331 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4332 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
4333 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
4337 tmp = yields[0][j][1]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4338 tmp = yields[1][j][1]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4339 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
4340 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
4343 currentDummy->GetYaxis()->SetTitle("I_{CP}");
4344 currentDummy->GetYaxis()->SetRangeUser(0, max2[caseId]);
4346 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4348 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4349 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4351 nearSideCentral->RemovePoint(i);
4352 nearSidePeripheral->RemovePoint(i);
4357 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4358 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4359 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4361 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4363 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4367 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4369 //Printf("away %d", i);
4370 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
4372 awaySideCentral->RemovePoint(i);
4373 awaySidePeripheral->RemovePoint(i);
4378 awaySideCentral->GetEY()[i] = TMath::Sqrt(
4379 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
4380 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
4382 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
4384 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
4389 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4390 nearSideCentral->SetLineColor(1);
4391 nearSideCentral->SetMarkerColor(1);
4393 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4394 awaySideCentral->SetLineColor(1);
4395 awaySideCentral->SetMarkerColor(1);
4400 nearSideCentral = (TGraphErrors*) nearSideCentral->Clone();
4401 nearSideCentral->SetLineColor(caseId - 3);
4402 nearSideCentral->SetMarkerColor(caseId - 3);
4404 awaySideCentral = (TGraphErrors*) awaySideCentral->Clone();
4405 awaySideCentral->SetLineColor(caseId - 3);
4406 awaySideCentral->SetMarkerColor(caseId - 3);
4409 //Printf("%d", caseList[caseId]);
4411 nearSideCentral->Draw("PSAME");
4412 awaySideCentral->Draw("PSAME");
4415 if (caseId == 0 && k == 0)
4420 c->SaveAs("tsallisparams.png");
4423 void DrawYieldLHCRHIC_ICP(const char* fileName = "yields.root")
4426 Int_t caseList[] = { 18 };
4429 ReadYields(fileName);
4431 c = new TCanvas("lhc_rhic", "lhc_rhic", 800, 600);
4435 dummy = new TH2F("dummy", ";p_{T,assoc};I_{CP}", 100, 0, 12, 1000, 0, 10);
4437 currentDummy = dummy->DrawCopy();
4438 currentDummy->GetYaxis()->SetRangeUser(0, 2);
4440 TGraphErrors** tmp = yields[0][j][0]; nearSideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4441 tmp = yields[1][j][0]; awaySideCentral = (TGraphErrors*) tmp[caseList[caseId]]->Clone();
4442 tmp = yields[0][j][2]; nearSidePeripheral = tmp[caseList[caseId]];
4443 tmp = yields[1][j][2]; awaySidePeripheral = tmp[caseList[caseId]];
4445 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4447 //Printf("near %d %f %f", i, nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4448 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4450 nearSideCentral->RemovePoint(i);
4451 nearSidePeripheral->RemovePoint(i);
4456 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4457 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4458 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4460 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4462 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4466 for (Int_t i=0; i<awaySideCentral->GetN(); i++)
4468 //Printf("away %d", i);
4469 if (awaySidePeripheral->GetY()[i] <= 1e-5 || awaySideCentral->GetY()[i] <= 1e-5)
4471 awaySideCentral->RemovePoint(i);
4472 awaySidePeripheral->RemovePoint(i);
4477 awaySideCentral->GetEY()[i] = TMath::Sqrt(
4478 TMath::Power(awaySideCentral->GetEY()[i] / awaySideCentral->GetY()[i], 2) +
4479 TMath::Power(awaySidePeripheral->GetEY()[i] / awaySidePeripheral->GetY()[i], 2) );
4481 awaySideCentral->GetY()[i] /= awaySidePeripheral->GetY()[i];
4483 awaySideCentral->GetEY()[i] *= awaySideCentral->GetY()[i];
4486 nearSideCentral->SetMarkerStyle(21);
4487 nearSideCentral->SetLineColor(1);
4488 nearSideCentral->SetMarkerColor(1);
4490 awaySideCentral->SetMarkerStyle(25);
4491 awaySideCentral->SetLineColor(1);
4492 awaySideCentral->SetMarkerColor(1);
4494 nearSideCentral->Draw("PSAME");
4495 awaySideCentral->Draw("PSAME");
4497 legend = new TLegend(0.4, 0.8, 0.99, 0.99);
4498 legend->SetFillColor(0);
4499 legend->AddEntry(nearSideCentral, "ALICE I_{CP} Near 8-15 GeV 0-5%/60-90%", "P");
4500 legend->AddEntry(awaySideCentral, "ALICE I_{CP} Away 8-15 GeV 0-5%/60-90%", "P");
4504 nearSideCentral->Fit("pol1", "", "SAME", 4.5, 11.5);
4505 awaySideCentral->Fit("pol1", "", "SAME", 4.5, 11.5);
4506 nearSideCentral->GetFunction("pol1")->SetLineWidth(1);
4507 awaySideCentral->GetFunction("pol1")->SetLineWidth(1);
4513 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
4514 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
4516 //dndpt_central->Print();
4517 //dndpt_peripheral->Print();
4519 // ratio of Ncoll (from paper)
4520 // TODO there is also an uncertainty on that
4521 Double_t scale = 1690. / 15.7;
4522 Double_t scaleUnc = TMath::Sqrt(TMath::Power(131. / 1690., 2) + TMath::Power(0.7 / 15.7, 2));
4524 for (Int_t i=0; i<dndpt_central->GetN(); i++)
4526 dndpt_central->GetEY()[i] = TMath::Sqrt(TMath::Power(dndpt_central->GetEY()[i] / dndpt_central->GetY()[i], 2) +
4527 TMath::Power(dndpt_peripheral->GetEY()[i] / dndpt_peripheral->GetY()[i], 2));
4528 dndpt_central->GetY()[i] /= dndpt_peripheral->GetY()[i] * scale;
4529 dndpt_central->GetEY()[i] *= dndpt_central->GetY()[i];
4533 //dndpt_central->Print();
4534 //dndpt_central->Draw("AP");
4536 dndpt_central->Draw("*SAME");
4538 latex = new TLatex(0.34, 0.09, "9% N_{coll} scale uncertainty on R_{CP}");
4539 latex->SetTextSize(0.03);
4543 raa_central = ReadHepdata("raa_alice_central.txt", kFALSE, 3);
4544 raa_central->SetMarkerStyle(20);
4545 //raa_central->Draw("PSAME");
4547 legend->AddEntry(dndpt_central, "ALICE R_{CP} 0-5%/70-80%", "P");
4553 // calculate ICP from IAA(0-20) / IAA (20-60)
4554 // TODO only using uncertainties from IAA(0-20)
4555 // TODO systematic uncertainty stored in graph with _sys appended
4556 TFile::Open("rhic/pi0h_graphs.root");
4558 for (Int_t i=0; i<3; i+=2)
4560 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
4561 central = (TGraphErrors*) gFile->Get(Form("gIAA_3_0_%d", i));
4562 peripheral = (TGraphErrors*) gFile->Get(Form("gIAA_3_1_%d", i));
4564 for (Int_t j=0; j<central->GetN(); j++)
4566 central->GetY()[j] /= peripheral->GetY()[j];
4567 central->GetEY()[j] /= peripheral->GetY()[j];
4570 central->SetMarkerStyle((i == 0) ? 29 : 30);
4571 central->SetMarkerColor(2);
4572 central->SetLineColor(2);
4573 central->Draw("PSAME");
4574 legend->AddEntry(central, Form("PHENIX I_{CP} %s 9-12 GeV 0-20%/20-60%", (i == 0) ? "Near" : "Away"), "P");
4580 c->SaveAs("icp.png");
4583 TGraphErrors* GetRatio(const char* fileName, Int_t centrality1, Int_t centrality2, Int_t triggerId, Int_t caseId, Int_t side, const char* fileName2 = 0)
4585 // 0 = near side; 1 = away side
4587 ReadYields(fileName);
4589 TGraphErrors** tmp = yields[side][triggerId][centrality1];
4590 nearSideCentral = (TGraphErrors*) tmp[caseId]->Clone();
4593 ReadYields(fileName2);
4595 tmp = yields[side][triggerId][centrality2];
4596 nearSidePeripheral = (TGraphErrors*) tmp[caseId]->Clone();
4598 // Printf("%d %d", nearSideCentral->GetN(), nearSidePeripheral->GetN());
4600 for (Int_t i=0; i<nearSideCentral->GetN(); i++)
4602 if (nearSidePeripheral->GetY()[i] <= 1e-5 || nearSideCentral->GetY()[i] <= 1e-5)
4604 nearSideCentral->RemovePoint(i);
4605 nearSidePeripheral->RemovePoint(i);
4610 if (nearSideCentral->GetX()[i] != nearSidePeripheral->GetX()[i])
4612 Printf("Inconsistent x values %f %f", nearSideCentral->GetX()[i], nearSidePeripheral->GetX()[i]);
4616 // printf("%f %f %f", nearSideCentral->GetX()[i], nearSideCentral->GetY()[i], nearSidePeripheral->GetY()[i]);
4618 nearSideCentral->GetEY()[i] = TMath::Sqrt(
4619 TMath::Power(nearSideCentral->GetEY()[i] / nearSideCentral->GetY()[i], 2) +
4620 TMath::Power(nearSidePeripheral->GetEY()[i] / nearSidePeripheral->GetY()[i], 2) );
4622 nearSideCentral->GetY()[i] /= nearSidePeripheral->GetY()[i];
4624 if (centrality2 == 3)
4625 nearSideCentral->GetY()[i] /= kPythiaScalingFactor;
4627 // Printf(" %f", nearSideCentral->GetY()[i]);
4629 nearSideCentral->GetEY()[i] *= nearSideCentral->GetY()[i];
4632 //nearSideCentral->GetXaxis()->SetTitle("p_{T, assoc}");
4633 //nearSideCentral->GetYaxis()->SetTitle((centrality2 == 3) ? "I_{AA}" : "I_{CP}");
4635 if (0 && side == 1 && centrality2 == 3)
4637 Printf("\n\n\nWARNING !!! Fudging different away side acceptance (only for second file)\n\n\n");
4638 ScaleGraph(nearSideCentral, 1.56);
4641 return nearSideCentral;
4644 TGraphErrors* GetIAA(const char* fileName, Int_t centrality, Int_t triggerId, Int_t caseId, Int_t side)
4646 return GetRatio(fileName, centrality, 3, triggerId, caseId, side);
4649 TGraphErrors* GetICP(const char* fileName, Int_t triggerId, Int_t caseId, Int_t side)
4651 return GetRatio(fileName, 1, 2, triggerId, caseId, side);
4654 void DrawYieldLHCRHIC_IAA(const char* fileName, Bool_t central, Bool_t rhic)
4657 Int_t caseList[] = { 18 };
4660 ReadYields(fileName);
4662 c = new TCanvas("lhc_rhic", "lhc_rhic", 800, 600);
4666 dummy = new TH2F("dummy", ";p_{T,assoc};I_{AA}", 100, 0, 12, 1000, 0, 10);
4668 currentDummy = dummy->DrawCopy();
4669 currentDummy->GetYaxis()->SetRangeUser(0, 3);
4671 Int_t nominatorBin = 0;
4675 nearSideCentral = GetIAA(fileName, nominatorBin, j, caseList[caseId], 0);
4676 awaySideCentral = GetIAA(fileName, nominatorBin, j, caseList[caseId], 1);
4678 nearSideCentral->SetMarkerStyle(21);
4679 nearSideCentral->SetLineColor(1);
4680 nearSideCentral->SetMarkerColor(1);
4682 awaySideCentral->SetMarkerStyle(25);
4683 awaySideCentral->SetLineColor(1);
4684 awaySideCentral->SetMarkerColor(1);
4686 nearSideCentral->Draw("PSAME");
4687 awaySideCentral->Draw("PSAME");
4689 legend = new TLegend(0.4, 0.8, 0.99, 0.99);
4690 legend->SetFillColor(0);
4691 legend->AddEntry(nearSideCentral, Form("ALICE I_{AA} Near 8-15 GeV %s%%/Pythia6", (central) ? "0-5" : "60-90"), "P");
4692 legend->AddEntry(awaySideCentral, Form("ALICE I_{AA} Away 8-15 GeV %s%%/Pythia6", (central) ? "0-5" : "60-90"), "P");
4697 // systematic uncertainty stored in graph with _sys appended
4698 TFile::Open("rhic/pi0h_graphs.root");
4700 for (Int_t i=0; i<3; i+=2)
4702 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
4703 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_2_%d_%d", (central) ? 0 : 1, i));
4704 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_2_%d_%d_sys", (central) ? 0 : 1, i));
4706 rhic_iaa->SetMarkerStyle((i == 0) ? 29 : 30);
4707 rhic_iaa->SetMarkerColor(2);
4708 rhic_iaa->SetLineColor(2);
4709 rhic_iaa->Draw("PSAME");
4710 rhic_iaa_sys->SetLineColor(2);
4711 rhic_iaa_sys->SetMarkerColor(2);
4712 rhic_iaa_sys->Draw("PSAME");
4713 legend->AddEntry(rhic_iaa, Form("PHENIX I_{AA} %s 7-9 GeV %s%%/pp", (i == 0) ? "Near" : "Away", (central) ? "0-20" : "20-60"), "P");
4715 for (Int_t i=0; i<3; i+=2)
4717 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
4718 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_3_%d_%d", (central) ? 0 : 1, i));
4719 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_3_%d_%d_sys", (central) ? 0 : 1, i));
4721 rhic_iaa->SetMarkerStyle((i == 0) ? 20 : 24);
4722 rhic_iaa->SetMarkerColor(4);
4723 rhic_iaa->SetLineColor(4);
4724 rhic_iaa->Draw("PSAME");
4725 rhic_iaa_sys->SetLineColor(4);
4726 rhic_iaa_sys->SetMarkerColor(4);
4727 rhic_iaa_sys->Draw("PSAME");
4728 legend->AddEntry(rhic_iaa, Form("PHENIX I_{AA} %s 9-12 GeV %s%%/pp", (i == 0) ? "Near" : "Away", (central) ? "0-20" : "20-60"), "P");
4734 c->SaveAs("iaa.png");
4737 void CompareIAAICP(const char* fileName1, const char* fileName2, Int_t nominatorBin, Int_t denominatorBin, Bool_t skipAway = kFALSE)
4741 // caseId = 23; Printf("WARNING: Comparing case 23");
4742 //Int_t caseId = 12;
4744 nearSide1 = GetRatio(fileName1, nominatorBin, denominatorBin, j, caseId, 0);
4746 awaySide1 = GetRatio(fileName1, nominatorBin, denominatorBin, j, caseId, 1);
4748 awaySide1 = new TGraphErrors;
4750 kPythiaScalingFactor = 1;
4751 nearSide2 = GetRatio(fileName2, nominatorBin, denominatorBin, j, caseId, 0);
4753 awaySide2 = GetRatio(fileName2, nominatorBin, denominatorBin, j, caseId, 1);
4755 awaySide2 = new TGraphErrors;
4757 // Printf("\n\n\nWARNING !!! Fudging different away side acceptance (only for second file)\n\n\n");
4758 // ScaleGraph(awaySide2, 1.56);
4760 /* ScaleGraph(nearSide2, 1.33);
4761 ScaleGraph(awaySide2, 1.33);*/
4764 dummy = new TH2F("dummy", Form(";p_{T,assoc};%s", (denominatorBin == 3) ? "I_{AA}" : "I_{CP}"), 100, 2, 12, 1000, 0, 10);
4766 currentDummy = dummy->DrawCopy();
4767 currentDummy->GetYaxis()->SetRangeUser(0, 2.5);
4769 nearSide1->SetMarkerStyle(21);
4770 nearSide1->SetLineColor(1);
4771 nearSide1->SetMarkerColor(1);
4773 nearSide2->SetMarkerStyle(21);
4774 nearSide2->SetLineColor(2);
4775 nearSide2->SetMarkerColor(2);
4777 awaySide1->SetMarkerStyle(25);
4778 awaySide1->SetLineColor(1);
4779 awaySide1->SetMarkerColor(1);
4781 awaySide2->SetMarkerStyle(25);
4782 awaySide2->SetLineColor(2);
4783 awaySide2->SetMarkerColor(2);
4785 RemovePointsBelowX(nearSide1, 3);
4786 RemovePointsBelowX(nearSide2, 3);
4787 RemovePointsBelowX(awaySide1, 3);
4788 RemovePointsBelowX(awaySide2, 3);
4793 nearSide1->DrawClone("PSAME");
4794 awaySide1->DrawClone("PSAME");
4795 nearSide2->DrawClone("PSAME");
4796 awaySide2->DrawClone("PSAME");
4799 currentDummy = dummy->DrawCopy();
4800 currentDummy->GetYaxis()->SetRangeUser(0.5, 1.5);
4804 DivideGraphs(nearSide1, nearSide2);
4805 DivideGraphs(awaySide1, awaySide2);
4807 nearSide1->Draw("PSAME");
4808 awaySide1->Draw("PSAME");
4810 nearSide1->Fit("pol0", "", "SAME", 3.01, 9.99);
4811 awaySide1->Fit("pol0", "", "SAME", 3.01, 9.99);
4814 void ScaleGraph(TGraphErrors* graph, Float_t factor)
4816 for (Int_t i=0; i<graph->GetN(); i++)
4818 graph->GetY()[i] *= factor;
4819 graph->GetEY()[i] *= factor;
4823 TGraphErrors* DrawBaselines(const char* fileName, Int_t numeratorBin, Int_t denominatorBin, Int_t side, Bool_t verbose = kTRUE)
4827 TGraphErrors* first = 0;
4828 TGraphErrors* max = 0;
4833 dummy = new TH2F("dummy", Form(";p_{T,assoc};%s", (denominatorBin == 3) ? "I_{AA}" : "I_{CP}"), 100, 0, 12, 1000, 0, 10);
4835 currentDummy = dummy->DrawCopy();
4836 currentDummy->GetYaxis()->SetRangeUser(0, 3);
4839 currentDummy = dummy->DrawCopy();
4840 currentDummy->GetYaxis()->SetRangeUser(0, 2);
4843 // Int_t caseList[] = { 18, 19, 21, 22 };
4844 //Int_t caseList[] = { 23, 24, 26, 27 };
4845 Int_t caseList[] = { 18, 19, 22 };
4847 for (Int_t caseId = 0; caseId < 3; caseId++)
4849 graph = GetRatio(fileName, numeratorBin, denominatorBin, j, caseList[caseId], side);
4851 graph->SetLineColor(caseId + 1);
4852 graph->SetMarkerColor(caseId + 1);
4854 RemovePointsBelowX(graph, 3);
4859 graph->DrawClone("*SAME");
4865 max = (TGraphErrors*) graph->Clone();
4866 for (Int_t i=0; i<max->GetN(); i++)
4869 max->GetEY()[i] = 0;
4874 DivideGraphs(graph, first);
4879 graph->DrawClone("*SAME");
4882 for (Int_t i=0; i<graph->GetN(); i++)
4884 if (max->GetY()[i] < TMath::Abs(graph->GetY()[i] - 1))
4885 max->GetY()[i] = TMath::Abs(graph->GetY()[i] - 1);
4896 max->GetXaxis()->SetTitle("p_{T, assoc}");
4897 max->GetYaxis()->SetTitle((denominatorBin == 3) ? "Effect on I_{AA}" : "Effect on I_{CP}");
4898 max->GetYaxis()->SetRangeUser(0, 0.4);
4903 void DrawBaselinesAll(const char* fileName)
4905 c = new TCanvas("c", "c", 1000, 600);
4908 for (Int_t i=0; i<2; i++)
4910 c->cd(1+i*4); DrawBaselines(fileName, 0, 3, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4911 c->cd(2+i*4); DrawBaselines(fileName, 1, 3, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4912 c->cd(3+i*4); DrawBaselines(fileName, 2, 3, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4913 c->cd(4+i*4); DrawBaselines(fileName, 0, 2, i, kFALSE)->Draw("A*"); gPad->SetGridy();
4917 TGraphErrors* DrawSystUncIAAPYTHIA(TGraphErrors* graph, Int_t iaa_icp, Int_t awaySide)
4921 Float_t baseline = 1;
4924 else if (awaySide == 1)
4928 Float_t reference = 0;
4933 Float_t efficiency = 0.08;
4935 Float_t centrality = 1;
4937 centrality = (awaySide == 0) ? 0.02 : 0.06;
4938 else if (iaa_icp == 1)
4939 centrality = (awaySide == 0) ? 0.04 : 0.08;
4941 Float_t ptResolution = 0;
4943 Float_t total = TMath::Sqrt(baseline * baseline + efficiency * efficiency + centrality * centrality + ptResolution * ptResolution);
4945 Printf("Total syst: %f", total);
4947 systUnc = (TGraphErrors*) graph->Clone();
4948 for (Int_t i=0; i<systUnc->GetN(); i++)
4950 systUnc->GetEY()[i] = systUnc->GetY()[i] * total;
4951 systUnc->GetEX()[i] = 0;
4956 systUnc->SetLineColor(kGray + 1);
4957 systUnc->SetLineWidth(6);
4959 systUnc->Draw("PSAME");
4964 TGraphErrors* DrawSystUncPreliminaries(TGraphErrors* graph, Int_t iaa_icp, Int_t awaySide, Int_t iaa, Bool_t central)
4968 Float_t baseline = 1;
4971 else if (awaySide == 1)
4973 if (iaa == 0 && central || iaa == 1)
4975 else if (iaa == 0 && !central)
4977 else if (iaa == 2 && central)
4982 Float_t reference = 0;
4987 Float_t efficiency = 0.08;
4991 Float_t centrality = 1;
4994 else if (iaa_icp == 1)
4997 Float_t ptResolution = 0.03;
4999 Float_t integrationWindow = 0;
5001 integrationWindow = 0.03;
5003 Float_t total = TMath::Sqrt(baseline * baseline + efficiency * efficiency + centrality * centrality + ptResolution * ptResolution + integrationWindow * integrationWindow);
5005 Printf("Total syst: %f", total);
5007 systUnc = (TGraphErrors*) graph->Clone();
5008 for (Int_t i=0; i<systUnc->GetN(); i++)
5010 systUnc->GetEY()[i] = systUnc->GetY()[i] * total;
5011 systUnc->GetEX()[i] = 0;
5016 systUnc->SetLineColor(kGray + 1);
5017 systUnc->SetLineWidth(6);
5019 systUnc->Draw("PSAME");
5024 TGraphErrors* DrawSystUnc(TGraphErrors* graph, Int_t iaa_icp, Int_t awaySide, Int_t iaa, Bool_t central, Float_t shift = 0.0)
5026 // iaa_icp: iaa = 0, icp = 1
5028 Float_t baseline = 1;
5031 else if (awaySide == 1)
5033 if (iaa == 0 && central || iaa == 1)
5035 else if (iaa == 0 && !central)
5037 else if (iaa == 2 && central)
5042 Float_t reference = 0;
5047 Float_t efficiency = 0.04;
5049 Float_t centrality = 1;
5052 else if (iaa_icp == 1)
5055 Float_t ptResolution = 0;
5057 Float_t integrationWindow = 0;
5059 integrationWindow = 0.03;
5061 Float_t corrections = 1;
5064 else if (iaa_icp == 1)
5067 Float_t twoTrack = 0.01;
5069 Float_t total = TMath::Sqrt(baseline * baseline + efficiency * efficiency + centrality * centrality + ptResolution * ptResolution + integrationWindow * integrationWindow + corrections * corrections + twoTrack * twoTrack);
5071 Printf("%f %f %f %f %f %f %f --> Total syst: %f", baseline, efficiency, centrality, ptResolution, integrationWindow, corrections, twoTrack, total);
5073 systUnc = (TGraphErrors*) graph->Clone();
5074 for (Int_t i=0; i<systUnc->GetN(); i++)
5076 systUnc->GetEY()[i] = systUnc->GetY()[i] * total;
5077 systUnc->GetEX()[i] = 0;
5078 Printf("pt = %.2f y = %.2f +- %.2f (stat.) +- %.2f (syst.)", graph->GetX()[i] - shift, graph->GetY()[i], graph->GetEY()[i], systUnc->GetEY()[i]);
5083 systUnc->SetLineColor(kGray + 1);
5084 systUnc->SetLineWidth(4);
5086 systUnc->Draw("PSAME e2");
5091 void IAA(const char* fileName, Int_t iaa, const char* fileNameEtaGap = 0)
5097 // 3 = IAA LHC with theory
5099 Bool_t showTheory = 0;
5100 Bool_t showSTAR = 0;
5114 if (kPythiaScalingFactor != 1)
5115 Printf("Using reference data scaling factor: %f", kPythiaScalingFactor);
5120 Int_t caseId[] = { 18, 23 };
5122 c = new TCanvas((iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", (iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", 900, 450);
5123 c->Range(0, 0, 1, 1);
5125 TPad* pad1 = new TPad(Form("%s_2", fileName), "", 0, 0, 0.5, 1);
5128 TPad* pad2 = new TPad(Form("%s_1", fileName), "", 0.5, 0, 1, 1);
5132 gPad->SetRightMargin(0);
5133 gPad->SetTopMargin(0.05);
5134 gPad->SetLeftMargin(0.13);
5136 // gPad->SetGridy();
5139 gPad->SetLeftMargin(0);
5140 gPad->SetTopMargin(0.05);
5141 gPad->SetRightMargin(0.13);
5143 // gPad->SetGridy();
5146 // 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);
5147 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);
5149 // dummy->GetYaxis()->SetTitleOffset(1.3);
5150 dummy->GetXaxis()->SetTitleOffset(1.1);
5151 currentDummy = dummy->DrawCopy();
5153 gStyle->SetTextAlign(13);
5155 latex = new TLatex(0.17, 0.90, "Near-side_{ }");
5156 latex->SetTextSize(0.04);
5162 // box = new TBox(2, 0.87, 2.5, 1.13);
5163 // box->SetFillColor(kGray + 1);
5164 // box->SetLineColor(kGray + 1);
5167 // box2 = new TBox(2, 0.87 * 1.5, 2.5, 1.13 * 1.5);
5168 // box2->SetFillColor(kGray + 1);
5169 // box2->SetLineColor(kGray + 1);
5174 currentDummy = dummy->DrawCopy();
5179 latex = new TLatex(0.05, 0.90, "Away-side");
5180 latex->SetTextSize(0.04);
5184 legend = new TLegend(0.27, (showTheory) ? 0.60 : 0.62, (iaa != 2 && !showSTAR) ? 0.63 : 0.95, 0.77);
5185 legend->SetFillColor(0);
5186 legend->SetBorderSize(0);
5187 legend->SetTextSize((iaa != 2) ? 0.04 : 0.035);
5189 for (Int_t i=0; i<2; i++)
5191 nearSideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 0);
5193 nearSidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 0);
5194 awaySideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 1);
5196 awaySidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 1);
5198 RemovePointsBelowX(nearSideCentral, 3);
5199 RemovePointsBelowX(awaySideCentral, 3);
5200 RemovePointsAboveX(nearSideCentral, 10);
5201 RemovePointsAboveX(awaySideCentral, 10);
5203 RemoveXErrors(nearSideCentral); RemoveXErrors(awaySideCentral);
5207 RemovePointsBelowX(nearSidePeripheral, 3);
5208 RemovePointsBelowX(awaySidePeripheral, 3);
5209 RemovePointsAboveX(nearSidePeripheral, 10);
5210 RemovePointsAboveX(awaySidePeripheral, 10);
5211 ShiftPoints(nearSidePeripheral, 0.2);
5212 ShiftPoints(awaySidePeripheral, 0.2);
5213 RemoveXErrors(nearSidePeripheral); RemoveXErrors(awaySidePeripheral);
5216 nearSideCentral->SetMarkerStyle(21);
5217 nearSideCentral->SetLineColor(1);
5218 nearSideCentral->SetMarkerColor(1);
5220 awaySideCentral->SetMarkerStyle(21);
5221 awaySideCentral->SetLineColor(1);
5222 awaySideCentral->SetMarkerColor(1);
5226 nearSideCentral->SetLineColor(2);
5227 nearSideCentral->SetMarkerColor(2);
5228 awaySideCentral->SetLineColor(2);
5229 awaySideCentral->SetMarkerColor(2);
5234 nearSidePeripheral->SetMarkerStyle(22);
5235 nearSidePeripheral->SetLineColor(2);
5236 nearSidePeripheral->SetMarkerColor(2);
5238 awaySidePeripheral->SetMarkerStyle(22);
5239 awaySidePeripheral->SetLineColor(2);
5240 awaySidePeripheral->SetMarkerColor(2);
5245 // TString denominatorStr("Pythia");
5246 TString denominatorStr("pp");
5249 legend->AddEntry(nearSideCentral, Form("%s0-5% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5251 legend->AddEntry(nearSidePeripheral, Form("%s60-90% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5255 // legend->AddEntry(nearSideCentral, Form("0-20% / %s", denominatorStr.Data()), "P");
5256 legend->AddEntry(nearSideCentral, Form("ALICE 8 GeV/#font[12]{c} < p_{T,trig} < 15 GeV/#font[12]{c}", denominatorStr.Data()), "P");
5261 const char* style = "PSAME";
5265 awaySideCentral->Print();
5269 DrawSystUnc(nearSideCentral, (iaa == 1), 0, iaa, kTRUE);
5270 nearSideCentral->DrawClone(style);
5271 if (iaa == 0 && !showTheory)
5274 DrawSystUnc(nearSidePeripheral, (iaa == 1), 0, iaa, kFALSE);
5275 nearSidePeripheral->DrawClone(style);
5280 DrawSystUnc(awaySideCentral, (iaa == 1), 1, iaa, kTRUE);
5281 awaySideCentral->DrawClone(style);
5282 if (iaa == 0 && !showTheory)
5285 DrawSystUnc(awaySidePeripheral, (iaa == 1), 1, iaa, kFALSE);
5286 awaySidePeripheral->DrawClone(style);
5294 nearSideEtaGapCentral = GetRatio(fileNameEtaGap, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[0], 0);
5295 RemovePointsBelowX(nearSideEtaGapCentral, 3);
5296 RemovePointsAboveX(nearSideEtaGapCentral, 10);
5297 RemoveXErrors(nearSideEtaGapCentral);
5298 nearSideEtaGapCentral->SetMarkerStyle(25);
5299 nearSideEtaGapCentral->SetLineColor(1);
5300 nearSideEtaGapCentral->SetMarkerColor(1);
5301 nearSideEtaGapCentral->Draw("PSAME");
5305 nearSideEtaGapPeripheral = GetRatio(fileNameEtaGap, 2, 3, j, caseId[0], 0);
5306 RemovePointsBelowX(nearSideEtaGapPeripheral, 3);
5307 RemovePointsAboveX(nearSideEtaGapPeripheral, 10);
5308 RemoveXErrors(nearSideEtaGapPeripheral);
5309 ShiftPoints(nearSideEtaGapPeripheral, 0.2);
5310 nearSideEtaGapPeripheral->SetMarkerStyle(26);
5311 nearSideEtaGapPeripheral->SetLineColor(2);
5312 nearSideEtaGapPeripheral->SetMarkerColor(2);
5313 nearSideEtaGapPeripheral->Draw("PSAME");
5319 // IAA, RHIC, PHENIX
5320 // systematic uncertainty stored in graph with _sys appended
5321 TFile::Open("rhic/pi0h_graphs.root");
5323 legend2 = new TLegend(0.5, 0.16, 0.96, 0.27);
5324 legend2->SetFillColor(0);
5326 for (Int_t ptTrigBin=2; ptTrigBin<4; ptTrigBin++)
5328 Bool_t central = kTRUE;
5329 for (Int_t i=0; i<3; i+=2)
5331 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
5332 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d", ptTrigBin, (central) ? 0 : 1, i));
5333 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d_sys", ptTrigBin, (central) ? 0 : 1, i));
5335 rhic_iaa->SetMarkerStyle((ptTrigBin == 2) ? 20 : 33);
5336 rhic_iaa->SetMarkerColor(2);
5337 rhic_iaa->SetLineColor(2);
5338 rhic_iaa_sys->SetLineColor(2);
5339 rhic_iaa_sys->SetMarkerColor(2);
5341 RemovePointsBelowX(rhic_iaa, 2);
5342 RemovePointsBelowX(rhic_iaa_sys, 2);
5346 rhic_iaa_sys->Print();
5348 ShiftPoints(rhic_iaa, -0.05 + 0.05 * (ptTrigBin*2-4));
5349 ShiftPoints(rhic_iaa_sys, -0.05 + 0.05 * (ptTrigBin*2-4));
5355 rhic_iaa->Draw("PSAME");
5356 rhic_iaa_sys->Draw("PSAME");
5359 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");
5360 // 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");
5368 if (iaa == 0 && showSTAR)
5370 for (Int_t i=0; i<2; i++)
5372 const char* centralityStr = "05";
5374 centralityStr = "4080";
5377 // systematic uncertainty stored in graph with _sys appended
5378 nearSide = ReadHepdata(Form("rhic/star_iaa_%s_near.txt", centralityStr));
5379 awaySide = ReadHepdata(Form("rhic/star_iaa_%s_away.txt", centralityStr));
5381 nearSide->SetMarkerStyle(20 + i * 13);
5382 nearSide->SetMarkerColor(4);
5383 nearSide->SetLineColor(4);
5385 awaySide->SetMarkerStyle(20 + i * 13);
5386 awaySide->SetMarkerColor(4);
5387 awaySide->SetLineColor(4);
5389 ShiftPoints(nearSide, -0.1 + 0.2 * i);
5390 ShiftPoints(awaySide, -0.1 + 0.2 * i);
5393 nearSide->Draw("PSAME");
5395 awaySide->Draw("PSAME");
5397 legend->AddEntry(nearSide, Form("STAR Au-Au 0.2 TeV %s / dAu", (i == 0) ? "0-5%" : "40-80%"), "P");
5401 // Theory predictions
5402 if (showTheory && iaa == 0)
5404 const char* theoryList[] = { "AdS", "ASW", "YaJEM", "YaJEM-D", "XinNian" };
5406 Int_t markers[] = { 27, 28, 29, 30, 34 };
5408 for (Int_t i=0; i<nTheory; i++)
5410 nearSide = ReadHepdata(Form("theory/IAA_near_%s.dat", theoryList[i]));
5411 awaySide = ReadHepdata(Form("theory/IAA_away_%s.dat", theoryList[i]));
5413 nearSide->SetMarkerStyle(markers[i]);
5414 awaySide->SetMarkerStyle(markers[i]);
5416 RemovePointsBelowX(nearSide, 3);
5417 RemovePointsBelowX(awaySide, 3);
5419 Float_t shiftBy = (i % 2 == 0) ? -0.2 : 0.2;
5420 ShiftPoints(nearSide, shiftBy);
5421 ShiftPoints(awaySide, shiftBy);
5424 nearSide->Draw("PSAME");
5427 awaySide->Draw("PSAME");
5430 theoryList[i] = "AdS/CFT";
5432 theoryList[i] = "X-N Wang";
5433 legend->AddEntry(nearSide, theoryList[i], "P");
5437 for (Int_t i=0; i<2; i++)
5449 latex = new TLatex(xC, 0.84, "0-20% / pp");
5451 latex = new TLatex(0.35+xC, 0.9, "8 GeV/#font[12]{c} < p_{T,trig} < 15 GeV/#font[12]{c}");
5452 latex->SetTextSize(0.04);
5457 line = new TLine(1.5, 1, 10.5, 1);
5458 line->SetLineStyle(2);
5463 latex = new TLatex(xC, 0.84, "0-5% / 60-90%");
5464 latex->SetTextSize(0.04);
5469 latex = new TLatex(0.65+xC, 0.90, "ALICE");
5470 // latex = new TLatex(0.5+xC, 0.90, "-- work in progress --");
5471 latex->SetTextSize(0.04);
5476 latex = new TLatex(0.35+xC, 0.84, "p_{T,assoc} < p_{T,trig}");
5477 latex->SetTextSize(0.04);
5482 if (iaa == 1 || iaa == 0)
5484 if (iaa == 0 && showSTAR)
5485 latex = new TLatex(0.3+xC, 0.90, "|#eta| < 1.0");
5487 latex = new TLatex(xC + 0.65, 0.20, "|#eta| < 1.0");
5488 latex->SetTextSize(0.04);
5494 if (iaa == 1 || (iaa == 0 && !showSTAR))
5496 latex = new TLatex(0.5+xC, 0.72, "Pb-Pb 2.76 TeV");
5497 latex->SetTextSize(0.04);
5505 latex = new TLatex(0.5, 0.24, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
5507 latex = new TLatex(xC, 0.6, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
5508 latex->SetTextSize(0.035);
5513 latex = new TLatex(0.5, 0.18, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
5515 latex = new TLatex(xC, 0.54, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
5516 latex->SetTextSize(0.035);
5521 if (showTheory && iaa == 0 && i == 1)
5522 latex = new TLatex(xC, 0.18, "Points: flat pedestal");
5524 latex = new TLatex(xC + 0.5 * i, 0.26, "Points: flat pedestal");
5525 latex->SetTextSize(0.04);
5530 latex = new TLatex(xC + 0.5 * i, 0.20, "Line: v_{2} subtracted");
5531 latex->SetTextSize(0.04);
5536 if (iaa != 1 && i == 1)
5538 legendClone = (TLegend*) legend->DrawClone();
5539 if (showTheory && iaa == 0 && i == 0)
5540 legendClone->GetListOfPrimitives()->RemoveLast();
5542 // legendClone->SetY1(legendClone->GetY1()-0.05);
5544 legend->SetX1(legend->GetX1()-0.12);
5545 legend->SetX2(legend->GetX2()-0.12);
5548 /* if (i == 0 && iaa != 2)
5549 DrawALICELogo(0.83,0.15,0.98,0.30);
5551 DrawALICELogo(0.62 + xC,0.48,0.77 + xC,0.63);*/
5554 c->SaveAs(Form("%s.eps", c->GetTitle()));
5555 c->SaveAs(Form("%s.png", c->GetTitle()));
5558 void IAAPaper(const char* fileName, Int_t iaa, const char* fileNameEtaGap = 0)
5564 Bool_t showTheory = 0;
5565 Bool_t showSTAR = 0;
5579 if (kPythiaScalingFactor != 1)
5580 Printf("Using reference data scaling factor: %f", kPythiaScalingFactor);
5585 Int_t caseId[] = { 18, 23 };
5587 c = new TCanvas((iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", (iaa != 1) ? ((iaa == 0) ? "iaa" : "iaarhic") : "icp", 900, 450);
5588 c->Range(0, 0, 1, 1);
5590 TPad* pad1 = new TPad(Form("%s_2", fileName), "", 0, 0, 0.5, 1);
5593 TPad* pad2 = new TPad(Form("%s_1", fileName), "", 0.5, 0, 1, 1);
5597 gPad->SetRightMargin(0);
5598 gPad->SetTopMargin(0.05);
5599 gPad->SetLeftMargin(0.13);
5601 // gPad->SetGridy();
5604 gPad->SetLeftMargin(0);
5605 gPad->SetTopMargin(0.05);
5606 gPad->SetRightMargin(0.13);
5608 // gPad->SetGridy();
5611 // 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);
5612 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);
5614 // dummy->GetYaxis()->SetTitleOffset(1.3);
5615 dummy->GetXaxis()->SetTitleOffset(1.1);
5616 currentDummy = dummy->DrawCopy();
5618 gStyle->SetTextAlign(13);
5620 latex = new TLatex(0.17, 0.90, "Near-side_{ }");
5621 latex->SetTextSize(0.04);
5625 latex = new TLatex(0.17, /*(iaa == 1) ? 0.78 :*/ 0.84, "#sqrt{#font[12]{s}_{NN}} = 2.76 TeV");
5626 latex->SetTextSize(0.04);
5630 latex = new TLatex(0.17, 0.2, (iaa == 1) ? "b)" : "a)");
5631 latex->SetTextSize(0.04);
5637 // box = new TBox(2, 0.87, 2.5, 1.13);
5638 // box->SetFillColor(kGray + 1);
5639 // box->SetLineColor(kGray + 1);
5642 // box2 = new TBox(2, 0.87 * 1.5, 2.5, 1.13 * 1.5);
5643 // box2->SetFillColor(kGray + 1);
5644 // box2->SetLineColor(kGray + 1);
5649 currentDummy = dummy->DrawCopy();
5654 latex = new TLatex(0.05, 0.90, "Away-side");
5655 latex->SetTextSize(0.04);
5660 legend = new TLegend(0.22, 0.60, 0.67, 0.73);
5662 legend = new TLegend(0.12, 0.60, 0.76, 0.79);
5663 legend->SetFillColor(0);
5664 legend->SetBorderSize(0);
5665 legend->SetTextSize((iaa != 2) ? 0.04 : 0.035);
5667 for (Int_t i=0; i<2; i++)
5669 nearSideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 0);
5671 nearSidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 0);
5672 awaySideCentral = GetRatio(fileName, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[i], 1);
5674 awaySidePeripheral = GetRatio(fileName, 2, 3, j, caseId[i], 1);
5676 RemovePointsBelowX(nearSideCentral, 3);
5677 RemovePointsBelowX(awaySideCentral, 3);
5678 RemovePointsAboveX(nearSideCentral, 10);
5679 RemovePointsAboveX(awaySideCentral, 10);
5681 ShiftPoints(nearSideCentral, -0.05);
5682 ShiftPoints(awaySideCentral, -0.05);
5686 ShiftPoints(nearSideCentral, -0.2);
5687 ShiftPoints(awaySideCentral, -0.2);
5691 ShiftPoints(nearSidePeripheral, 0.2);
5692 ShiftPoints(awaySidePeripheral, 0.2);
5696 RemoveXErrors(nearSideCentral); RemoveXErrors(awaySideCentral);
5700 RemovePointsBelowX(nearSidePeripheral, 3);
5701 RemovePointsBelowX(awaySidePeripheral, 3);
5702 RemovePointsAboveX(nearSidePeripheral, 10);
5703 RemovePointsAboveX(awaySidePeripheral, 10);
5704 ShiftPoints(nearSidePeripheral, 0.05);
5705 ShiftPoints(awaySidePeripheral, 0.05);
5706 RemoveXErrors(nearSidePeripheral); RemoveXErrors(awaySidePeripheral);
5709 nearSideCentral->SetMarkerStyle((i == 0) ? 25 : 27);
5710 nearSideCentral->SetLineColor(1);
5711 nearSideCentral->SetMarkerColor(1);
5713 awaySideCentral->SetMarkerStyle((i == 0) ? 25 : 27);
5714 awaySideCentral->SetLineColor(1);
5715 awaySideCentral->SetMarkerColor(1);
5719 nearSideCentral->SetLineColor(2);
5720 nearSideCentral->SetMarkerColor(2);
5721 awaySideCentral->SetLineColor(2);
5722 awaySideCentral->SetMarkerColor(2);
5727 nearSidePeripheral->SetMarkerStyle((i == 0) ? 21 : 33);
5728 nearSidePeripheral->SetLineColor(2);
5729 nearSidePeripheral->SetMarkerColor(2);
5731 awaySidePeripheral->SetMarkerStyle((i == 0) ? 21 : 33);
5732 awaySidePeripheral->SetLineColor(2);
5733 awaySidePeripheral->SetMarkerColor(2);
5738 // TString denominatorStr("Pythia");
5739 TString denominatorStr("pp");
5742 legend->SetHeader("0-5% Pb-Pb/pp 60-90% Pb-Pb/pp");
5743 legend->SetNColumns(2);
5745 legend->AddEntry(nearSideCentral, (i == 0) ? "Flat bkg" : "#font[12]{v}_{2} bkg", "P");
5747 legend->AddEntry(nearSidePeripheral, (i == 0) ? "Flat bkg" : "#font[12]{v}_{2} bkg", "P");
5749 // legend->AddEntry(nearSideCentral, Form("%s0-5% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5751 // legend->AddEntry(nearSidePeripheral, Form("%s60-90% / %s", (showSTAR) ? "ALICE Pb-Pb 2.76 TeV " : "", denominatorStr.Data()), "P");
5754 // legend->AddEntry(nearSideCentral, Form("0-20% / %s", denominatorStr.Data()), "P");
5755 legend->AddEntry(nearSideCentral, Form("ALICE 8 GeV/#font[12]{c} < p_{T,trig} < 15 GeV/#font[12]{c}", denominatorStr.Data()), "P");
5760 const char* style = "PSAME";
5762 // style = "LSAMEX";
5766 DrawSystUnc(nearSideCentral, (iaa == 1), 0, iaa, kTRUE, -0.05 - 0.2 * i);
5767 nearSideCentral->DrawClone(style);
5768 if (iaa == 0 && !showTheory)
5771 DrawSystUnc(nearSidePeripheral, (iaa == 1), 0, iaa, kFALSE, 0.05 + ((iaa == 0) ? i * 0.2 : 0));
5772 nearSidePeripheral->DrawClone(style);
5777 DrawSystUnc(awaySideCentral, (iaa == 1), 1, iaa, kTRUE, -0.05 - 0.2 * i);
5778 awaySideCentral->DrawClone(style);
5779 if (iaa == 0 && !showTheory)
5782 DrawSystUnc(awaySidePeripheral, (iaa == 1), 1, iaa, kFALSE, 0.05 + ((iaa == 0) ? i * 0.2 : 0));
5783 awaySidePeripheral->DrawClone(style);
5791 nearSideEtaGapCentral = GetRatio(fileNameEtaGap, (iaa != 2) ? 0 : 1, (iaa != 1) ? 3 : 2, j, caseId[0], 0);
5792 RemovePointsBelowX(nearSideEtaGapCentral, 3);
5793 RemovePointsAboveX(nearSideEtaGapCentral, 10);
5794 RemoveXErrors(nearSideEtaGapCentral);
5795 nearSideEtaGapCentral->SetMarkerStyle(24);
5796 nearSideEtaGapCentral->SetLineColor(1);
5797 nearSideEtaGapCentral->SetMarkerColor(1);
5798 ShiftPoints(nearSideEtaGapCentral, -0.45);
5799 DrawSystUnc(nearSideEtaGapCentral, (iaa == 1), 0, iaa, kTRUE, -0.45);
5800 nearSideEtaGapCentral->Draw("PSAME");
5802 legend->AddEntry(nearSideEtaGapCentral, "#font[12]{#eta}-gap", "P");
5807 nearSideEtaGapPeripheral = GetRatio(fileNameEtaGap, 2, 3, j, caseId[0], 0);
5808 RemovePointsBelowX(nearSideEtaGapPeripheral, 3);
5809 RemovePointsAboveX(nearSideEtaGapPeripheral, 10);
5810 RemoveXErrors(nearSideEtaGapPeripheral);
5811 nearSideEtaGapPeripheral->SetMarkerStyle(20);
5812 nearSideEtaGapPeripheral->SetLineColor(2);
5813 nearSideEtaGapPeripheral->SetMarkerColor(2);
5814 ShiftPoints(nearSideEtaGapPeripheral, 0.45);
5815 DrawSystUnc(nearSideEtaGapPeripheral, (iaa == 1), 0, iaa, kFALSE, 0.45);
5816 nearSideEtaGapPeripheral->Draw("PSAME");
5818 legend->AddEntry(nearSideEtaGapPeripheral, "#font[12]{#eta}-gap", "P");
5824 // add pythia line showing gluon filtering
5825 // from Jan Rak, by mail, 22.09.11
5826 // pp CF calculated without any adjustment
5827 // AA CF also no adjustment. Particles (h+-) in acceptance are identified with their parent string parton (status 71)
5828 // and the flavor of parent hard outgoing parton (status 23) which is the parent of string parton 71 is checked.
5829 // If it is a gluon the particle is ignored.
5831 Float_t xVal[] = { 3.5, 4.5, 5.5, 7, 9};
5832 Float_t yVal[] = { 0.779418, 0.794234, 0.82759, 0.856457, 0.880526 };
5833 gluonfiltering = new TGraph(5, xVal, yVal);
5835 gluonfiltering->Draw("L");
5837 legend3 = new TLegend(0.38, 0.15, 0.58, 0.25);
5838 legend3->SetFillColor(0);
5839 legend3->SetBorderSize(0);
5840 legend3->SetTextSize(0.04);
5841 legend3->AddEntry(gluonfiltering, "PYTHIA quark-only fragmentation", "L");
5847 // IAA, RHIC, PHENIX
5848 // systematic uncertainty stored in graph with _sys appended
5849 TFile::Open("rhic/pi0h_graphs.root");
5851 legend2 = new TLegend(0.5, 0.16, 0.96, 0.27);
5852 legend2->SetFillColor(0);
5854 for (Int_t ptTrigBin=2; ptTrigBin<4; ptTrigBin++)
5856 Bool_t central = kTRUE;
5857 for (Int_t i=0; i<3; i+=2)
5859 // gIAA_<ptTrigBin>_<centBin>_<angularRegionBin>
5860 rhic_iaa = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d", ptTrigBin, (central) ? 0 : 1, i));
5861 rhic_iaa_sys = (TGraphErrors*) gFile->Get(Form("gIAA_%d_%d_%d_sys", ptTrigBin, (central) ? 0 : 1, i));
5863 rhic_iaa->SetMarkerStyle((ptTrigBin == 2) ? 20 : 33);
5864 rhic_iaa->SetMarkerColor(2);
5865 rhic_iaa->SetLineColor(2);
5866 rhic_iaa_sys->SetLineColor(2);
5867 rhic_iaa_sys->SetMarkerColor(2);
5869 ShiftPoints(rhic_iaa, -0.05 + 0.05 * (ptTrigBin*2-4));
5870 ShiftPoints(rhic_iaa_sys, -0.05 + 0.05 * (ptTrigBin*2-4));
5876 rhic_iaa->Draw("PSAME");
5877 rhic_iaa_sys->Draw("PSAME");
5880 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");
5881 // 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");
5889 if (iaa == 0 && showSTAR)
5891 for (Int_t i=0; i<2; i++)
5893 const char* centralityStr = "05";
5895 centralityStr = "4080";
5898 // systematic uncertainty stored in graph with _sys appended
5899 nearSide = ReadHepdata(Form("rhic/star_iaa_%s_near.txt", centralityStr));
5900 awaySide = ReadHepdata(Form("rhic/star_iaa_%s_away.txt", centralityStr));
5902 nearSide->SetMarkerStyle(20 + i * 13);
5903 nearSide->SetMarkerColor(4);
5904 nearSide->SetLineColor(4);
5906 awaySide->SetMarkerStyle(20 + i * 13);
5907 awaySide->SetMarkerColor(4);
5908 awaySide->SetLineColor(4);
5910 ShiftPoints(nearSide, -0.1 + 0.2 * i);
5911 ShiftPoints(awaySide, -0.1 + 0.2 * i);
5914 nearSide->Draw("PSAME");
5916 awaySide->Draw("PSAME");
5918 legend->AddEntry(nearSide, Form("STAR Au-Au 0.2 TeV %s / dAu", (i == 0) ? "0-5%" : "40-80%"), "P");
5922 // Theory predictions
5923 if (showTheory && iaa == 0)
5925 const char* theoryList[] = { "AdS", "ASW", "YaJEM", "YaJEM-D", "XinNian" };
5927 Int_t markers[] = { 27, 28, 29, 30, 34 };
5929 for (Int_t i=0; i<nTheory; i++)
5931 nearSide = ReadHepdata(Form("theory/IAA_near_%s.dat", theoryList[i]));
5932 awaySide = ReadHepdata(Form("theory/IAA_away_%s.dat", theoryList[i]));
5934 nearSide->SetMarkerStyle(markers[i]);
5935 awaySide->SetMarkerStyle(markers[i]);
5937 RemovePointsBelowX(nearSide, 3);
5938 RemovePointsBelowX(awaySide, 3);
5940 Float_t shiftBy = (i % 2 == 0) ? -0.2 : 0.2;
5941 ShiftPoints(nearSide, shiftBy);
5942 ShiftPoints(awaySide, shiftBy);
5945 nearSide->Draw("PSAME");
5948 awaySide->Draw("PSAME");
5951 theoryList[i] = "AdS/CFT";
5953 theoryList[i] = "X-N Wang";
5954 legend->AddEntry(nearSide, theoryList[i], "P");
5958 for (Int_t i=0; i<2; i++)
5970 latex = new TLatex(xC, 0.84, "0-20% / pp");
5972 latex = new TLatex(0.35+xC, 0.9, "8 GeV/#font[12]{c} < #font[12]{p}_{t,trig} < 15 GeV/#font[12]{c}");
5973 latex->SetTextSize(0.04);
5978 line = new TLine(1.5, 1, 10.5, 1);
5979 line->SetLineStyle(2);
5982 // if (iaa == 1 && i == 0)
5984 // latex = new TLatex(xC, 0.84, "0-5% / 60-90%");
5985 // latex->SetTextSize(0.04);
5990 latex = new TLatex(0.65+xC, 0.90, "ALICE");
5991 // latex = new TLatex(0.5+xC, 0.90, "-- work in progress --");
5992 latex->SetTextSize(0.04);
5997 latex = new TLatex(0.35+xC, 0.84, "#font[12]{p}_{t,assoc} < #font[12]{p}_{t,trig}");
5998 latex->SetTextSize(0.04);
6003 if (iaa == 1 || iaa == 0)
6005 if (iaa == 0 && showSTAR)
6006 latex = new TLatex(0.3+xC, 0.90, "|#font[12]{#eta}| < 1.0");
6008 latex = new TLatex(0.82, 0.84, "|#font[12]{#eta}| < 1.0");
6009 latex->SetTextSize(0.04);
6015 if (iaa == 1 || (iaa == 0 && !showSTAR))
6017 latex = new TLatex(0.5+xC, 0.72, "Pb-Pb 2.76 TeV");
6018 latex->SetTextSize(0.04);
6026 latex = new TLatex(0.5, 0.24, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
6028 latex = new TLatex(xC, 0.6, "ALICE: Pb-Pb 2.76 TeV |#eta| < 1.0");
6029 latex->SetTextSize(0.035);
6034 latex = new TLatex(0.5, 0.18, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
6036 latex = new TLatex(xC, 0.54, "PHENIX: Au-Au 0.2 TeV |#eta| < 0.35");
6037 latex->SetTextSize(0.035);
6044 legendClone = (TLegend*) legend->DrawClone();
6045 if (showTheory && iaa == 0 && i == 0)
6046 legendClone->GetListOfPrimitives()->RemoveLast();
6048 // legendClone->SetY1(legendClone->GetY1()-0.05);
6050 legend->SetX1(legend->GetX1()-0.12);
6051 legend->SetX2(legend->GetX2()-0.12);
6056 /* if (i == 0 && iaa != 2)
6057 DrawALICELogo(0.83,0.15,0.98,0.30);
6059 DrawALICELogo(0.62 + xC,0.48,0.77 + xC,0.63);*/
6062 c->SaveAs(Form("%s.eps", c->GetTitle()));
6063 c->SaveAs(Form("%s.png", c->GetTitle()));
6067 void DrawALICELogo(Float_t x1, Float_t y1, Float_t x2, Float_t y2, Bool_t debug = kFALSE)
6069 DrawALICELogo(kTRUE, x1, y1, x2, y2, debug);
6072 void DrawALICELogo(Bool_t prel, Float_t x1, Float_t y1, Float_t x2, Float_t y2, Bool_t debug = kFALSE)
6074 // correct for aspect ratio of figure plus aspect ratio of pad (coordinates are NDC!)
6075 // Printf("%d %f %d %f", gPad->GetCanvas()->GetWindowHeight(), gPad->GetHNDC(), gPad->GetCanvas()->GetWindowWidth(), gPad->GetWNDC());
6076 //x2 = x1 + (y2 - y1) * 0.891 * gPad->GetCanvas()->GetWindowHeight() * gPad->GetHNDC() / (gPad->GetWNDC() * gPad->GetCanvas()->GetWindowWidth());
6077 x2 = x1 + (y2 - y1) * (466. / 523) * gPad->GetWh() * gPad->GetHNDC() / (gPad->GetWNDC() * gPad->GetWw());
6078 // Printf("%f %f %f %f", x1, x2, y1, y2);
6081 DrawLatex((x1+x2)/2, y1, 1, "09.05.12", 0.03)->SetTextAlign(23);
6082 TPad *myPadLogo = new TPad("myPadLogo", "Pad for ALICE Logo", x1, y1, x2, y2);
6084 myPadLogo->SetFillColor(2); // color to first figure out where is the pad then comment !
6085 myPadLogo->SetLeftMargin(0);
6086 myPadLogo->SetTopMargin(0);
6087 myPadLogo->SetRightMargin(0);
6088 myPadLogo->SetBottomMargin(0);
6091 // TASImage *myAliceLogo = new TASImage("~/alice_logo_transparent.png");
6092 TASImage *myAliceLogo = new TASImage((prel) ? "~/alice_logo_preliminary.eps" : "~/alice_logo_performance.eps");
6093 myAliceLogo->Draw();
6096 void RemoveXErrors(TGraphErrors* graph)
6098 for (Int_t i=0; i<graph->GetN(); i++)
6099 graph->GetEX()[i] = 0;
6102 void RemovePointsBelowX(TGraphErrors* graph, Float_t minX)
6105 while (i<graph->GetN())
6107 if (graph->GetX()[i] < minX)
6108 graph->RemovePoint(i);
6114 void RemovePointsAboveX(TGraphErrors* graph, Float_t maxX)
6117 while (i<graph->GetN())
6119 if (graph->GetX()[i] > maxX)
6120 graph->RemovePoint(i);
6126 void ShiftPoints(TGraphErrors* graph, Float_t dx)
6129 while (i<graph->GetN())
6131 graph->GetX()[i] += dx;
6136 void DivideGraphs(TGraphErrors* graph1, TGraphErrors* graph2)
6141 for (Int_t bin1 = 0; bin1 < graph1->GetN(); bin1++)
6143 Float_t x = graph1->GetX()[bin1];
6146 for (bin2 = 0; bin2<graph2->GetN(); bin2++)
6147 if (graph2->GetX()[bin2] >= x)
6150 if (bin2 == graph2->GetN())
6154 if (TMath::Abs(graph2->GetX()[bin2-1] - x) < TMath::Abs(graph2->GetX()[bin2] - x))
6157 if (graph1->GetY()[bin1] == 0 || graph2->GetY()[bin2] == 0 || bin2 == graph2->GetN())
6159 Printf("%d %d removed", bin1, bin2);
6160 graph1->RemovePoint(bin1--);
6164 Float_t graph2Extrapolated = graph2->GetY()[bin2];
6165 if (TMath::Abs(x - graph2->GetX()[bin2]) > 0.0001)
6167 Printf("%f %f %d %d not found", x, graph2->GetX()[bin2], bin1, bin2);
6168 graph1->RemovePoint(bin1--);
6172 Float_t value = graph1->GetY()[bin1] / graph2Extrapolated;
6173 Float_t error = value * TMath::Sqrt(TMath::Power(graph1->GetEY()[bin1] / graph1->GetY()[bin1], 2) + TMath::Power(graph2->GetEY()[bin2] / graph2->GetY()[bin2], 2));
6175 graph1->GetY()[bin1] = value;
6176 graph1->GetEY()[bin1] = error;
6178 Printf("%d %d %f %f %f %f", bin1, bin2, x, graph2Extrapolated, value, error);
6182 Float_t ExtractYields(TH1* hist, Int_t trigId, Int_t centralityId, Float_t ptA, Float_t ptW, Int_t caseId, Double_t normUnc)
6184 CreateYieldStructure();
6186 Float_t width = 0.69;
6187 // Float_t width = 0.5; Printf("WARNING. Using integration width 0.5");
6188 // Float_t width = 0.85; Printf("WARNING. Using integration width 0.85");
6190 //new TCanvas; hist->DrawCopy();
6192 Int_t binBegin = hist->FindBin(-width);
6193 Int_t binEnd = hist->FindBin(width);
6194 Double_t nearSideError = 0;
6195 Float_t nearSideYield = hist->IntegralAndError(binBegin, binEnd, nearSideError);
6196 nearSideYield *= hist->GetXaxis()->GetBinWidth(1);
6197 nearSideError *= hist->GetXaxis()->GetBinWidth(1);
6199 Int_t binBegin = hist->FindBin(TMath::Pi() - width);
6200 Int_t binEnd = hist->FindBin(TMath::Pi() + width);
6201 Double_t awaySideError = 0;
6202 Float_t awaySideYield = hist->IntegralAndError(binBegin, binEnd, awaySideError);
6203 awaySideYield *= hist->GetXaxis()->GetBinWidth(1);
6204 awaySideError *= hist->GetXaxis()->GetBinWidth(1);
6206 Printf("%d %d %f %d: %f+-%f %f+-%f (%f)", trigId, centralityId, ptA, caseId, nearSideYield, nearSideError, awaySideYield, awaySideError, normUnc);
6208 FillYield(trigId, centralityId, ptA, ptW, caseId, nearSideYield, TMath::Sqrt(nearSideError * nearSideError + normUnc * normUnc), awaySideYield, TMath::Sqrt(awaySideError * awaySideError + normUnc * normUnc));
6210 // store normUnc for error propagation later
6211 TGraphErrors** tmp = yields[2][trigId][centralityId];
6212 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, normUnc);
6214 return awaySideYield;
6217 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)
6219 // CINT limitation here
6220 TGraphErrors** tmp = yields[0][trigId][centralityId];
6221 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, nearSideYield);
6222 tmp[caseId]->SetPointError(tmp[caseId]->GetN()-1, ptW, nearSideError);
6223 //tmp[caseId]->Print();
6225 tmp = yields[1][trigId][centralityId];
6226 tmp[caseId]->SetPoint(tmp[caseId]->GetN(), ptA, awaySideYield);
6227 tmp[caseId]->SetPointError(tmp[caseId]->GetN()-1, ptW, awaySideError);
6230 Double_t hypgeo(Double_t a, Double_t b, Double_t c, Double_t z)
6232 // ROOT::Math::hyperg is only defined for |z| < 1
6234 return ROOT::Math::hyperg(a, b, c, z);
6236 // for z < -1 we can use an identity from http://en.wikipedia.org/wiki/Hypergeometric_function
6237 return TMath::Power(1-z, -b) * ROOT::Math::hyperg(c-a, b, c, z / (z-1));
6240 Double_t hypgeoder2(Double_t a, Double_t b, Double_t c, Double_t z)
6242 // derivate of hypgeo with parameter b: d/db hypgeo
6244 static TF1* func = 0;
6246 func = new TF1("hypgeoder2_func", "hypgeo([0], x, [1], [2])");
6248 func->SetParameters(a, c, z);
6249 return func->Derivative(b);
6252 void TsallisYieldUncertainty(Double_t n, Double_t q, Double_t beta, TMatrixDSym covMatrix, Int_t offset, Double_t& yield, Double_t& unc)
6254 gSystem->Load("libMathMore");
6256 TF1 tsallis("tsallis", "[0] * (1-[2]*(1-[1])*x*x)**(1/(1-[1]))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
6258 // 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]
6259 // [0] = n, [1] = q, [2] = beta
6260 TF1 tsallisIntegral("tsallisIntegral", "[0]*x*hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x)");
6261 TF1 tsallisIntegralDerN("tsallisIntegralDerN", "x*hypgeo(0.5, 1/([1]-1), 1.5, -[2]*([1]-1)*x*x)");
6263 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)");
6265 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]");
6267 const Float_t width = 0.7;
6270 derivates[0] = new TF1("const", "1");
6271 derivates[1] = &tsallisIntegralDerN;
6272 derivates[2] = &tsallisIntegralDerq;
6273 derivates[3] = &tsallisIntegralDerbeta;
6275 Printf("%f %f %f", n, q, beta);
6277 tsallis.SetParameters(n, q, beta);
6278 tsallisIntegral.SetParameters(n, q, beta);
6279 for (Int_t i=1; i<4; i++)
6280 derivates[i]->SetParameters(n, q, beta);
6282 yield = tsallisIntegral.Eval(width) - tsallisIntegral.Eval(-width);
6283 Double_t yield2 = tsallis.Integral(-width, width);
6286 for (Int_t i=0; i<4; i++)
6287 for (Int_t j=0; j<4; j++)
6296 Double_t der1 = (derivates[i]->Eval(width) - derivates[i]->Eval(-width));
6297 Double_t der2 = (derivates[j]->Eval(width) - derivates[j]->Eval(-width));
6299 unc += der1 * der2 * covMatrix(covI, covJ);
6301 Printf("%d %d % .3e % .3e % .3e % .3e", i, j, der1, der2, covMatrix(covI, covJ), unc);
6304 unc = TMath::Sqrt(unc);
6307 yield2 /= width * 2;
6310 Printf("%f (%f) +- %f", yield, yield2, unc);
6313 double NLowestBinAverage(TH1 &h, int N)
6315 // Returns mean content of N lowest bins in h.
6319 std::list<double> content;
6320 std::list<double>::iterator i;
6322 for (int jbin=1; jbin<=h.GetNbinsX(); jbin++) {
6323 content.push_back(h.GetBinContent(jbin));
6327 for (i = content.begin(); i != content.end(); ++i) {
6337 Warning("NLowestBinAverage()",
6338 "Avg. of %d bins requested, %d used", N, counter);
6343 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)
6346 // 0 same with v2 (14 tsallis for baseline [28/29 tsallis params]; 15 yield from tsallis function)
6347 // [disabled] 1 same/mixed with v2 (15 tsallis for baseline)
6348 // 2 same no v2 (16 tsallis for baseline; 17 yield from tsallis function)
6349 // 4 same no v2 (18 flat fit 1)
6350 // 5 same no v2 (19 flat fit 2)
6351 // 6 same no v2 (20 flat avg over 4)
6352 // 7 same no v2 (21 flat avg over 8)
6353 // 8 same no v2 (22 flat avg over 16)
6354 // 9 same with v2 (23 flat fit 1)
6355 // 10 same with v2 (24 flat fit 2)
6356 // 11 same with v2 (25 flat avg over 4)
6357 // 12 same with v2 (26 flat avg over 8)
6358 // 13 same with v2 (27 flat avg over 16)
6360 // 30 gaussian fit width
6362 // same stuff for same/mixed
6363 if (0 && caseOffset == 0 && histMixed)
6365 TH1* clone = (TH1*) hist->Clone();
6366 clone->Divide(histMixed);
6367 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 1, ptACenter, ptAWidth, kFALSE, 0, vn);
6370 // same for other baseline subtractions
6371 if (caseOffset == 0)
6373 file = TFile::Open("dphi_corr.root", "UPDATE");
6377 TH1* clone = (TH1*) hist->Clone();
6378 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 2, ptACenter, ptAWidth, kTRUE, 0, vn);
6380 clone = (TH1*) hist->Clone();
6381 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 4, ptACenter, ptAWidth, kTRUE, 1, vn);
6383 clone = (TH1*) hist->Clone();
6384 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 5, ptACenter, ptAWidth, kTRUE, 2, vn);
6386 clone = (TH1*) hist->Clone();
6387 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 6, ptACenter, ptAWidth, kTRUE, 3, vn);
6389 clone = (TH1*) hist->Clone();
6390 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 7, ptACenter, ptAWidth, kTRUE, 4, vn);
6392 clone = (TH1*) hist->Clone();
6393 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 8, ptACenter, ptAWidth, kTRUE, 5, vn);
6395 clone = (TH1*) hist->Clone();
6396 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 9, ptACenter, ptAWidth, kFALSE, 1, vn);
6398 clone = (TH1*) hist->Clone();
6399 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 10, ptACenter, ptAWidth, kFALSE, 2, vn);
6401 clone = (TH1*) hist->Clone();
6402 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 11, ptACenter, ptAWidth, kFALSE, 3, vn);
6404 clone = (TH1*) hist->Clone();
6405 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 12, ptACenter, ptAWidth, kFALSE, 4, vn);
6407 clone = (TH1*) hist->Clone();
6408 DrawFlow(v2, clone, ptT, ptA, histMixed, trigId, centralityId, 13, ptACenter, ptAWidth, kFALSE, 5, vn);
6411 Float_t awaySideYield = ExtractYields(hist, trigId, centralityId, ptACenter, ptAWidth, 0 + caseOffset, 0);
6419 /* Float_t v2Trig = flowGraph->Eval(ptT);
6420 Float_t v2Assoc = flowGraph->Eval(ptA);
6421 Float_t v2 = v2Trig * v2Assoc;
6422 Printf("%f %f: %.2f %.2f --> %.4f", ptT, ptA, v2Trig, v2Assoc, v2);*/
6424 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());
6429 Float_t minBin = hist->FindBin(0.6);
6430 for (Int_t bin=hist->FindBin(0.6); bin<=hist->FindBin(1.8); bin++)
6431 if (hist->GetBinContent(bin) < hist->GetBinContent(minBin))
6434 Float_t norm = hist->GetBinContent(minBin) / (1 + 2 * v2 * cos(2 * hist->GetBinCenter(minBin)));
6435 Double_t normUnc = 0;
6439 if (baseLineDetermination == 0)
6443 if (centralityId == 0)
6444 hist->Fit("pol0", "0", "", 0.8., 1.2);
6446 hist->Fit("pol0", "0", "", 1.2, 1.6);
6448 //tsallis = new TF1("tsallis", "(1-[1]*(1-[0])*x*x)**(1/(1-[0]))", 0, 10)
6449 // (1-b(1-q)x*x)**(1/(1-q))
6451 // combination of two tsallis functions
6452 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());
6453 //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());
6454 // 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
6455 total->SetParLimits(0, 0, 10000);
6456 total->SetParLimits(1, 0, 10000);
6457 total->SetParLimits(4, 0, 10000);
6459 total->SetParLimits(2, 1.0000001, 5);
6460 total->SetParLimits(5, 1.0000001, 5);
6462 total->SetParLimits(3, 0.1, 1000);
6463 total->SetParLimits(6, 0.1, 1000);
6465 total->SetParameters(1, 1, 1.5, 3, 1, 1.5, 1.1);
6468 hist->Fit(total, "0RI");
6469 fitResult = hist->Fit(total, "0RSI");
6471 if (0 && fitResult->CovMatrixStatus() > 0)
6473 TMatrixDSym cov(fitResult->GetCovarianceMatrix());
6476 Double_t nearSideYield, nearSideError;
6477 TsallisYieldUncertainty(total->GetParameter(1), total->GetParameter(2), total->GetParameter(3), cov, 0, nearSideYield, nearSideError);
6479 Double_t awaySideYield2, awaySideError;
6480 TsallisYieldUncertainty(total->GetParameter(4), total->GetParameter(5), total->GetParameter(6), cov, 3, awaySideYield2, awaySideError);
6482 FillYield(trigId, centralityId, ptACenter, ptAWidth, 14 + caseOffset + 1, nearSideYield, nearSideError, awaySideYield2, awaySideError);
6484 Printf("Chi2 %f / ndf %d = %f", total->GetChisquare(), total->GetNDF(), (total->GetNDF() > 0) ? total->GetChisquare() / total->GetNDF() : -1);
6486 total->SetLineColor(hist->GetLineColor());
6487 total->SetLineWidth(1);
6488 if (caseOffset == 2)
6491 total->DrawCopy("SAME");
6492 //total->SetParameter(5, total->GetParameter(5) - TMath::Sqrt(cov[5][5]));
6493 //total->DrawCopy("SAME");
6494 //total->SetParameter(5, total->GetParameter(5) + 2 * TMath::Sqrt(cov[5][5]));
6495 //Printf("%f", total->Integral(-0.7,0.7));
6496 //total->DrawCopy("SAME");
6499 if (caseOffset == 0)
6501 // store fit parameters
6504 FillYield(trigId, centralityId, ptACenter, ptAWidth, 28, total->GetParameter(2), total->GetParError(2), total->GetParameter(5), total->GetParError(5));
6506 FillYield(trigId, centralityId, ptACenter, ptAWidth, 29, total->GetParameter(3), total->GetParError(3), total->GetParameter(6), total->GetParError(6));
6511 gausFit = new TF1("gausFit", "[0] + gaus(1) + gaus(4)", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
6512 gausFit->SetParameters(1, 1, 0, 1, 1, TMath::Pi(), 0);
6513 gausFit->SetParLimits(0, 0, 10000);
6514 gausFit->SetParLimits(1, 0, 10000);
6515 gausFit->FixParameter(2, 0);
6516 gausFit->SetParLimits(3, 0.01, 10);
6517 gausFit->SetParLimits(4, 0, 10000);
6518 gausFit->FixParameter(5, TMath::Pi());
6519 gausFit->SetParLimits(6, 0.01, 10);
6521 hist->Fit(gausFit, "0RI");
6522 gausFit->SetLineWidth(1);
6523 gausFit->DrawCopy("SAME");
6525 FillYield(trigId, centralityId, ptACenter, ptAWidth, 30, gausFit->GetParameter(3), total->GetParError(3), total->GetParameter(6), total->GetParError(6));
6529 if (0 && cov[0][0] > 0)
6531 for (Int_t i=0; i<cov.GetNcols(); i++)
6532 for (Int_t j=0; j<cov.GetNrows(); j++)
6533 cov[j][i] /= TMath::Sqrt(cov[i][i]) * TMath::Sqrt(cov[j][j]);
6539 Float_t norm = func->GetParameter(0) / (1 - 2 * v2);
6540 Double_t normUnc = func->GetParError(0) / (1 - 2 * v2);
6543 else if (baseLineDetermination <= 2)
6548 if (baseLineDetermination == 1)
6550 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4, 1.5 * TMath::Pi() - 0.4 };
6551 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4, TMath::Pi() / 2 + 0.4, 1.5 * TMath::Pi() };
6553 else if (baseLineDetermination == 2)
6555 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4 - 0.2, 1.5 * TMath::Pi() - 0.4 - 0.2};
6556 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4 - 0.2, TMath::Pi() / 2 + 0.4 - 0.2, 1.5 * TMath::Pi() };
6562 for (Int_t i=0; i<3; i++)
6564 hist->Fit("pol0", "0Q", "", regionBegin[i], regionEnd[i]);
6565 func = hist->GetFunction("pol0");
6568 sum += func->GetParameter(0) / func->GetParError(0) / func->GetParError(0);
6569 weight += 1. / func->GetParError(0) / func->GetParError(0);
6576 weight = TMath::Sqrt(1. / weight);
6578 Float_t norm = sum / (1 - 2 * v2);
6579 Double_t normUnc = weight / (1 - 2 * v2);
6584 if (baseLineDetermination == 4)
6586 if (baseLineDetermination == 5)
6588 Float_t norm = NLowestBinAverage(*hist, bins);
6589 Double_t normUnc = 0;
6591 Printf("NLowestBinAverage %d --> %f", bins, norm);
6593 norm /= (1 - 2 * v2);
6596 Printf("Baseline: %f +- %f", norm, normUnc);
6599 if (caseOffset == 0)
6601 Float_t awaySideYieldNoBaseline = awaySideYield - norm * (1 - 2 * v2);
6602 Float_t v2YieldNoBaseline = norm * 2 * v2 * (1 + 1.4) / 1.4;
6603 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);
6606 //flowFunc->SetParameters(hist->GetBinContent(hist->FindBin(1.4)) / (1.0 - 2.0 * v2), v2);
6607 flowFunc->SetParameters(norm, v2, 0, 0, 0);
6609 flowFunc->SetParameters(norm, vn[1], vn[2], vn[3], vn[4]);
6610 flowFunc->SetLineWidth(2);
6611 if (caseOffset >= 4 && caseOffset <= 9 && caseOffset != 6 && caseOffset != 7)
6613 if (caseOffset != 4 && caseOffset != 9)
6614 flowFunc->SetLineStyle(2);
6615 flowFunc->DrawCopy("SAME"); //->SetLineColor(caseOffset - 3);
6618 flowFuncTmp = (TF1*) flowFunc->Clone("flowFuncTmp");
6619 for (Int_t i=1; i<=4; i++)
6621 flowFuncTmp->SetParameters(flowFuncTmp->GetParameter(0), 0, 0, 0, 0);
6622 flowFuncTmp->SetParameter(i, vn[i]);
6623 flowFuncTmp->SetLineStyle(2);
6624 flowFuncTmp->Print();
6625 flowFuncTmp->DrawCopy("SAME");
6630 hist->Add(flowFunc, -1);
6631 if (caseOffset == 0)
6633 file = TFile::Open("dphi_corr.root", "UPDATE");
6634 hist->SetName(TString(hist->GetName()) + "_tsallis_v2");
6637 // hist->DrawCopy("SAME");
6639 if (caseOffset == 2 && flatBaseLine)
6641 file = TFile::Open("dphi_corr.root", "UPDATE");
6642 hist->SetName(TString(hist->GetName()) + "_tsallis_flat");
6645 // hist->DrawCopy("SAME");
6647 if (caseOffset == 4 && flatBaseLine)
6649 file = TFile::Open("dphi_corr.root", "UPDATE");
6650 hist->SetName(TString(hist->GetName()) + "_fit_flat");
6653 // hist->DrawCopy("SAME");
6655 if (caseOffset == 9)
6657 file = TFile::Open("dphi_corr.root", "UPDATE");
6658 hist->SetName(TString(hist->GetName()) + "_fit_v2");
6661 // hist->DrawCopy("SAME");
6664 ExtractYields(hist, trigId, centralityId, ptACenter, ptAWidth, 14 + caseOffset, normUnc);
6668 Printf("%f", histMixed->Integral() / histMixed->GetNbinsX());
6669 flowFunc->SetParameters(histMixed->Integral() / histMixed->GetNbinsX(), v2);
6670 flowFunc->SetLineColor(2);
6671 //if (caseOffset == 0)
6672 // flowFunc->DrawCopy("SAME");
6676 void RemoveBaseLine(TH1* hist)
6684 hist->Fit("pol0", "0", "", 1.07, 2.07);
6686 if (!hist->GetFunction("pol0"))
6689 Float_t zyam = hist->GetFunction("pol0")->GetParameter(0);
6696 for (Int_t i=1; i<=hist->GetNbinsX(); i++)
6697 hist->SetBinContent(i, hist->GetBinContent(i) - zyam);
6701 TH2* cacheMixed[10];
6703 Int_t gHistCount = 0;
6704 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)
6706 h = (AliUEHistograms*) hVoid;
6707 hMixed = (AliUEHistograms*) hMixedVoid;
6712 Int_t centralityBeginBin = 0;
6713 Int_t centralityEndBin = -1;
6715 if (!useCentralityBinsDirectly && centralityEnd >= centralityBegin)
6717 centralityBeginBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityBegin);
6718 centralityEndBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityEnd);
6720 else if (useCentralityBinsDirectly)
6722 centralityBeginBin = centralityBegin;
6723 centralityEndBin = centralityEnd;
6726 // 2d same and mixed event
6727 TH2* sameTwoD = h->GetUEHist(2)->GetUEHist(step, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, 1, kFALSE);
6733 // No centrality, nor pT associated dep of the mixed event observed. Use a larger range to get more statistics
6737 for (Int_t i=0; i<10; i++)
6738 if (cacheIds[i] == hMixed)
6746 for (Int_t i=0; i<10; i++)
6747 if (cacheIds[i] == 0)
6753 if (!cacheIds[cacheId])
6755 hMixed->SetPtRange(3.0, 10);
6756 cacheMixed[cacheId] = (TH2*) hMixed->GetUEHist(2)->GetUEHist(stepMixed, 0, 3.0, 10.0, centralityBeginBin, centralityEndBin, 1, kFALSE);
6757 cacheIds[cacheId] = hMixed;
6758 Printf("GetDistAndFlow: Cached for %p on slot %d", hMixed, cacheId);
6761 TH2* mixedTwoD = cacheMixed[cacheId];
6765 // use same bin for mixing
6767 TH2* mixedTwoD = (TH2*) hMixed->GetUEHist(2)->GetUEHist(stepMixed, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, 1, kFALSE);
6772 // asssume flat in dphi, gain in statistics
6773 Printf("NOTE: Assuming flat acceptance in phi!");
6775 TH1* histMixedproj = mixedTwoD->ProjectionY();
6776 histMixedproj->Scale(1.0 / mixedTwoD->GetNbinsX());
6778 for (Int_t x=1; x<=mixedTwoD->GetNbinsX(); x++)
6779 for (Int_t y=1; y<=mixedTwoD->GetNbinsY(); y++)
6780 mixedTwoD->SetBinContent(x, y, histMixedproj->GetBinContent(y));
6783 // get mixed event normalization by assuming full acceptance at deta of 0 (only works for flat dphi)
6786 Double_t mixedNorm = mixedTwoD->Integral(1, mixedTwoD->GetNbinsX(), mixedTwoD->GetYaxis()->FindBin(-0.01), mixedTwoD->GetYaxis()->FindBin(0.01));
6787 mixedNorm /= mixedTwoD->GetNbinsX() * (mixedTwoD->GetYaxis()->FindBin(0.01) - mixedTwoD->GetYaxis()->FindBin(-0.01) + 1);
6790 Double_t mixedNorm = mixedTwoD->Integral() / sameTwoD->Integral();
6793 sameTwoD->Divide(mixedTwoD);
6794 sameTwoD->Scale(mixedNorm);
6797 sameTwoD->Draw("SURF1");
6802 histName.Form("GetDistAndFlow%d", gHistCount++);
6804 // extract dphi distribution if requested
6810 // Float_t etaLimit = 0.8;
6811 Float_t etaLimit = 1.0;
6813 // 20: return corr in |delta eta| < 1 from which 1 < |delta eta| < 2 is subtracted
6814 if (twoD == 0 || twoD == 10 || twoD == 20)
6817 Int_t etaEnd = sameTwoD->GetNbinsY();
6819 if (twoD == 10 || twoD == 20)
6821 etaBegin = sameTwoD->GetYaxis()->FindBin(-etaLimit + 0.01);
6822 etaEnd = sameTwoD->GetYaxis()->FindBin(etaLimit - 0.01);
6825 *hist = sameTwoD->ProjectionX(histName, etaBegin, etaEnd);
6828 (*hist)->Scale(1.0 / (etaEnd - etaBegin + 1));
6831 if (twoD == 11 || twoD == 20)
6833 // errors --> are ok
6835 // Float_t outerLimit = 2.0;
6836 Float_t outerLimit = 1.8;
6837 Printf("Phi dist: Using outer limit %.2f", outerLimit);
6838 // Float_t outerLimit = etaLimit * 2;
6840 histTmp = sameTwoD->ProjectionX(histName + "1", TMath::Max(1, sameTwoD->GetYaxis()->FindBin(-outerLimit + 0.01)), sameTwoD->GetYaxis()->FindBin(-etaLimit - 0.01));
6841 Int_t etaBins = sameTwoD->GetYaxis()->FindBin(-etaLimit - 0.01) - TMath::Max(1, sameTwoD->GetYaxis()->FindBin(-outerLimit + 0.01)) + 1;
6843 TH1D* tracksTmp = sameTwoD->ProjectionX(histName + "2", sameTwoD->GetYaxis()->FindBin(etaLimit + 0.01), TMath::Min(sameTwoD->GetYaxis()->GetNbins(), sameTwoD->GetYaxis()->FindBin(outerLimit - 0.01)));
6844 etaBins += TMath::Min(sameTwoD->GetYaxis()->GetNbins(), sameTwoD->GetYaxis()->FindBin(outerLimit - 0.01)) - sameTwoD->GetYaxis()->FindBin(etaLimit + 0.01) + 1;
6846 // printf("%f +- %f %f +- %f ", (*hist)->GetBinContent(1), (*hist)->GetBinError(1), tracksTmp->GetBinContent(1), tracksTmp->GetBinError(1));
6847 histTmp->Add(tracksTmp);
6848 // Printf(" --> %f +- %f", (*hist)->GetBinContent(1), (*hist)->GetBinError(1));
6851 histTmp->Scale(1.0 / etaBins);
6855 else if (twoD == 20)
6857 // calculate acc with 2 * (deta - 0.5 * deta*deta / 1.6)
6859 histTmp->Scale(0.75 / 0.25);
6861 histTmp->Scale(1.0 / 0.8);
6863 (*hist)->Add(histTmp, -1);
6867 // (*hist)->Rebin(2); (*hist)->Scale(0.5);
6869 //*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);
6872 str.Form("%.1f < p_{T,trig} < %.1f", ptBegin - 0.01, ptEnd + 0.01);
6875 str2.Form("%.2f < p_{T,assoc} < %.2f", gpTMin - 0.01, gpTMax + 0.01);
6878 newTitle.Form("%s - %s - %d-%d", str.Data(), str2.Data(), centralityBegin, centralityEnd);
6879 if (!useCentralityBinsDirectly)
6881 (*hist)->SetTitle(newTitle);
6885 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));
6887 //new TCanvas; (*hist)->DrawCopy(); histMixed->DrawCopy("SAME")->SetLineColor(2);
6889 Float_t totalPairs = (*hist)->Integral();
6891 (*hist)->Divide(histMixed);
6892 (*hist)->Scale(totalPairs / (*hist)->Integral());
6894 //(*hist)->DrawCopy("SAME")->SetLineColor(4);
6899 // calculate v2trigger
6900 h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
6901 ptDist = h->GetUEHist(2)->GetEventHist()->Project(step, 0);
6903 for (Int_t i=2; i<=((vn) ? 5 : 2); i++)
6904 vTrig[i-1] = CalculateFlow(ptDist, ptBegin, ptEnd, i, centralityBegin, centralityEnd);
6907 // calculate v2 assoc
6908 cont = h->GetUEHist(2)->GetTrackHist(0);
6909 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(step)->GetGrid()->GetAxis(3)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
6910 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(step)->GetGrid()->GetAxis(2)->SetRangeUser(ptBegin, ptEnd);
6911 ptDist = h->GetUEHist(2)->GetTrackHist(0)->Project(step, 1);
6913 for (Int_t i=2; i<=((vn) ? 5 : 2); i++)
6914 vAssoc[i-1] = CalculateFlow(ptDist, gpTMin, gpTMax, i, centralityBegin, centralityEnd);
6918 *v2 = vTrig[2-1] * vAssoc[2-1];
6920 for (Int_t i=2; i<=5; i++)
6921 vn[i-1] = vTrig[i-1] * vAssoc[i-1];
6925 void CompareNtrDist(const char* fileName1, const char* fileNameCentrality1)
6930 TCanvas *c1 = new TCanvas("c1", "", 1400, 1100);
6931 TCanvas *c2 = new TCanvas("c2", "", 1400, 1100);
6933 dndpt_central = ReadHepdata("/home/mkofarag/work/Project/2010/raa_dndpt_central.txt", kFALSE, 3);
6934 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
6935 AliUEHistograms* hc1 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality1);
6937 h1->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 5);
6938 ptDist1 = h1->GetUEHist(2)->GetEventHist()->Project(step, 0);
6939 ptDist1->Scale(1.0/1.8/TMath::TwoPi()/hc1->GetCentralityDistribution()->Integral(hc1->GetCentralityDistribution()->FindBin(0.01), hc1->GetCentralityDistribution()->FindBin(4.99)));
6940 for (Int_t i=1; i<=ptDist1->GetNbinsX(); i++)
6942 ptDist1->SetBinContent(i, ptDist1->GetBinContent(i)/ptDist1->GetBinWidth(i));
6944 for (Int_t i=0; i<dndpt_central->GetN();i++)
6946 Double_t x = dndpt_central->GetX()[i];
6947 Double_t y = dndpt_central->GetY()[i]*x;
6948 dndpt_central->SetPoint(i,x,y);
6950 ptDist2 = (TH1*) ptDist1->Clone("ptDist2");
6952 for (Int_t i=0; i<dndpt_central->GetN(); i++)
6956 width += (dndpt_central->GetX()[i] - dndpt_central->GetX()[i-1]) / 2;
6957 if (i < dndpt_central->GetN()-1)
6958 width += (dndpt_central->GetX()[i+1] - dndpt_central->GetX()[i]) / 2;
6959 if (i == 0 || i == dndpt_central->GetN() - 1)
6961 ptDist2->Fill(dndpt_central->GetX()[i],dndpt_central->GetY()[i]*width);
6963 for (Int_t i=1; i<=ptDist2->GetNbinsX(); i++)
6965 ptDist2->SetBinContent(i, ptDist2->GetBinContent(i)/ptDist2->GetBinWidth(i));
6966 ptDist2->SetBinError(i,0);
6968 /* for (Int_t i=1; i<=ptDist1->GetNbinsX(); i++)
6970 ptDist1->SetBinError(i,0);
6975 ptDist1->SetMarkerStyle(3);
6976 ptDist2->SetMarkerStyle(2);
6977 ptDist1->SetMarkerColor(2);
6978 ptDist2->SetMarkerColor(3);
6979 ptDist1->SetLineColor(2);
6980 ptDist2->SetLineColor(3);
6981 ptDist1->DrawCopy("EP");
6982 ptDist2->Draw("EPSAME");
6983 ptDist1->Divide(ptDist1,ptDist2);
6985 ptDist1->Draw("EP");
6989 void FitNtrDist(const char* fileName1, const char* fileNameCentrality1)
6994 TCanvas *c1 = new TCanvas("c1", "", 1400, 1100);
6995 TCanvas *c2 = new TCanvas("c2", "", 1400, 1100);
6996 TCanvas *c3 = new TCanvas("c3", "", 1400, 1100);
6998 dndpt_central = ReadHepdata("/home/mkofarag/work/Project/2010/raa_dndpt_central.txt", kFALSE, 3);
6999 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);
7000 TF1* func2 = new TF1("func2", "[0]*TMath::Power(x,-1*[1])",5,20);
7002 func1->SetParLimits(0, 2000, 5000);
7003 func1->SetParLimits(1, 1, 6);
7004 func1->SetParLimits(2, 7, 20);
7005 dndpt_central->Fit(func1,"RB","",0.5,5);
7007 func2->SetParLimits(0, 0, 1000);
7008 func2->SetParLimits(1, 4, 8);
7009 dndpt_central->Fit(func2,"RB","",5,20);
7014 dndpt_central->Draw("AP");
7015 func1->Draw("SAME");
7016 func2->Draw("SAME");
7018 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);
7019 TF1* func4 = new TF1("func4", "[0]*x*TMath::Power(x,-1*[1])",5,20);
7021 func3->FixParameter(0,func1->GetParameter(0));
7022 func3->FixParameter(1,func1->GetParameter(1));
7023 func3->FixParameter(2,func1->GetParameter(2));
7024 func4->FixParameter(0,func2->GetParameter(0));
7025 func4->FixParameter(1,func2->GetParameter(1));
7027 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
7028 AliUEHistograms* hc1 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality1);
7030 h1->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 5);
7031 ptDist1 = h1->GetUEHist(2)->GetEventHist()->Project(step, 0);
7032 ptDist1->Scale(1.0/1.8/TMath::TwoPi()/hc1->GetCentralityDistribution()->Integral(hc1->GetCentralityDistribution()->FindBin(0.01), hc1->GetCentralityDistribution()->FindBin(4.99)));
7033 ptDist2 = (TH1*) ptDist1->Clone("ptDist2");
7035 for (Int_t i=1; i<=ptDist1->GetNbinsX(); i++)
7037 ptDist1->SetBinContent(i, ptDist1->GetBinContent(i)/ptDist1->GetBinWidth(i));
7038 if (ptDist1->GetBinLowEdge(i)<5) ptDist2->SetBinContent(i, func3->Integral(ptDist1->GetBinLowEdge(i),ptDist1->GetBinLowEdge(i+1)));
7039 else ptDist2->SetBinContent(i, func4->Integral(ptDist1->GetBinLowEdge(i),ptDist1->GetBinLowEdge(i+1)));
7042 for (Int_t i=1; i<=ptDist2->GetNbinsX(); i++)
7044 ptDist2->SetBinContent(i, ptDist2->GetBinContent(i)/ptDist2->GetBinWidth(i));
7048 ptDist1->SetMarkerStyle(3);
7049 ptDist2->SetMarkerStyle(2);
7050 ptDist1->SetMarkerColor(2);
7051 ptDist2->SetMarkerColor(3);
7052 ptDist1->SetLineColor(2);
7053 ptDist2->SetLineColor(3);
7054 ptDist1->DrawCopy("EP");
7055 ptDist2->Draw("EPSAME");
7057 ptDist1->Divide(ptDist1,ptDist2);
7059 ptDist1->Draw("EP");
7062 void DrawNtrDist(const char* fileName1, const char* fileName2, const char* fileNameCentrality1, const char* fileNameCentrality2)
7068 new TCanvas("c", "", 1400, 1100);
7069 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
7070 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
7071 AliUEHistograms* hc1 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality1);
7072 AliUEHistograms* hc2 = (AliUEHistograms*) GetUEHistogram(fileNameCentrality2);
7073 h1->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 10);
7074 h2->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + 0, -0.01 + 10);
7075 ptDist1 = h1->GetUEHist(2)->GetEventHist()->Project(step, 0);
7076 ptDist2 = h2->GetUEHist(2)->GetEventHist()->Project(step, 0);
7077 ptDist1->Scale(1/hc1->GetCentralityDistribution()->Integral(hc1->GetCentralityDistribution()->FindBin(0.01), hc1->GetCentralityDistribution()->FindBin(9.99)));
7078 ptDist2->Scale(1/hc2->GetCentralityDistribution()->Integral(hc2->GetCentralityDistribution()->FindBin(0.01), hc2->GetCentralityDistribution()->FindBin(9.99)));
7079 ptDist1->Divide(ptDist1,ptDist2);
7080 ptDist1->SetMarkerStyle(3);
7084 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)
7086 Printf("GetSumOfRatios | step %d | %d-%d%% | %.1f - %.1f GeV/c | %.1f - %.1f GeV/c", step, centralityBegin, centralityEnd, gpTMin, gpTMax, ptBegin, ptEnd);
7088 h = (AliUEHistograms*) hVoid;
7089 hMixed = (AliUEHistograms*) hMixedVoid;
7091 Int_t centralityBeginBin = 0;
7092 Int_t centralityEndBin = -1;
7094 if (!useCentralityBinsDirectly && centralityEnd >= centralityBegin)
7096 centralityBeginBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityBegin);
7097 centralityEndBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityEnd);
7099 else if (useCentralityBinsDirectly)
7101 centralityBeginBin = centralityBegin;
7102 centralityEndBin = centralityEnd;
7105 *hist = h->GetUEHist(2)->GetSumOfRatios2(hMixed->GetUEHist(2), step, 0, ptBegin, ptEnd, centralityBeginBin, centralityEndBin, normalizePerTrigger);
7108 str.Form("%.1f < p_{T,trig} < %.1f", ptBegin - 0.01, ptEnd + 0.01);
7111 str2.Form("%.2f < p_{T,assoc} < %.2f", gpTMin - 0.01, gpTMax + 0.01);
7114 newTitle.Form("%s - %s - %d-%d", str.Data(), str2.Data(), centralityBegin, centralityEnd);
7115 if (!useCentralityBinsDirectly)
7118 (*hist)->SetTitle(newTitle);
7121 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)
7125 Bool_t veryCentral = 0;
7126 Bool_t flowComparison = 0;
7127 Bool_t rhicOverlay = 0;
7128 Bool_t highStatBinning = 0;
7130 file = TFile::Open("dphi_corr.root", "RECREATE");
7133 Int_t leadingPtOffset = 1;
7135 if (veryCentral || flowComparison)
7137 Int_t maxLeadingPt = 2;
7138 Int_t maxAssocPt = 2;
7139 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
7140 //Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 4.0, 6.0, 10.0, 20.0, 40.0 };
7141 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
7143 else if (rhicOverlay) // RHIC binning
7145 Int_t maxLeadingPt = 4;
7146 Int_t maxAssocPt = 5;
7147 Float_t leadingPtArr[] = { 4.0, 5.0, 7.0, 9.0, 12.0 };
7148 Float_t assocPtArr[] = { 0.5, 1.0, 2.0, 3.0, 5.0, 7.0 };
7150 else if (highStatBinning)
7152 Int_t maxLeadingPt = 3;
7153 Int_t maxAssocPt = 2;
7154 Float_t leadingPtArr[] = { 4.0, 6.0, 8.0, 15.0 };
7155 Float_t assocPtArr[] = { 1.0, 4.0, 10.0 };
7157 else // ALICE binning
7159 if (1) // binning from preliminaries
7161 Int_t maxLeadingPt = 2;
7162 Int_t maxAssocPt = 7;
7163 // Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 10.0, 15.0 };
7164 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
7165 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7166 leadingPtOffset = 2;
7170 Int_t maxLeadingPt = 1;
7171 Int_t maxAssocPt = 4;
7172 Float_t leadingPtArr[] = { 8.0, 10.0, 15.0, 15.0 };
7173 Float_t assocPtArr[] = { 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7174 leadingPtOffset = 2;
7178 Int_t maxLeadingPt = 3;
7179 Int_t maxAssocPt = 3;
7180 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 20.0 };
7181 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7182 leadingPtOffset = 2;
7186 Int_t nCentralityBins = 5;
7187 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
7188 //Int_t centralityBins[] = { 1, 3, 5, 7, 9, 13 };
7190 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
7192 // h->SetZVtxRange(-0.5, 0.5);
7193 // h->SetZVtxRange(1.5, 2.5);
7195 AliUEHistograms* hMixed = 0;
7196 AliUEHistograms* hMixed2 = 0; // GetUEHistogram(fileName2, 0, kTRUE);
7200 hMixed = (AliUEHistograms*) GetUEHistogram(fileName1, 0, kTRUE);
7201 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileName2, 0, kTRUE);
7207 Printf("WARNING: Reading mixed event from preliminaries/corrected_110317.root");
7208 hMixed = (AliUEHistograms*) GetUEHistogram("preliminaries/corrected_110317.root", 0, kTRUE);
7211 AliUEHistograms* h2 = 0;
7213 h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
7216 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
7217 canvas->Divide(maxAssocPt, maxLeadingPt);
7219 TCanvas* canvas2 = new TCanvas("Centrality", "Centrality", 800, 600);
7220 centralityHist = (TH1*) h->GetCentralityDistribution();
7221 NormalizeToBinWidth(centralityHist);
7222 centralityHist->Draw();
7225 TLegend* legend = new TLegend(0.2, 0.5, 0.95, 0.90);
7226 TLegend* legend2 = new TLegend(0.5, 0.63, 0.95, 0.90);
7227 legend2->SetFillColor(0);
7228 legend2->SetTextSize(0.04);
7230 for (Int_t i=0; i<maxLeadingPt; i++)
7231 for (Int_t j=0; j<maxAssocPt; j++)
7234 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+leadingPtOffset]);
7239 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->SetRangeUser(0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7240 centralityHist = h->GetUEHist(2)->GetEventHist()->ShowProjection(1, 6);
7241 centralityHist->SetLineColor(i+2);
7242 NormalizeToBinWidth(centralityHist);
7243 centralityHist->DrawCopy("SAME");
7244 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->SetRangeUser(0, 0, -1);
7245 legend2->AddEntry(centralityHist, str);
7248 canvas->cd(j+1 + i * maxAssocPt);
7249 gPad->SetLeftMargin(0.15);
7250 gPad->SetBottomMargin(0.2);
7251 gPad->SetTopMargin(0.01);
7252 gPad->SetRightMargin(0.01);
7254 if (i == 0 && j == 3)
7257 gpTMin = assocPtArr[j] + 0.01;
7258 gpTMax = assocPtArr[j+1] - 0.01;
7261 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
7267 SetupRanges(h2); // SetEtaRange(0, 0) does not need to be called for the leading track result
7272 SetupRanges(hMixed);
7278 if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
7285 // 40-80% --> 11, 14
7288 TString hist1Str, hist2Str, hist2bStr;
7291 for (Int_t k=0; k<3; k++)
7303 GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist1Str = "0-2%";
7304 // GetDistAndFlow(h, hMixed, &hist2, v2, step, 1, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2Str = "1-3%";
7305 GetDistAndFlow(h, hMixed, &hist2b, v2+2, step, 30, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01); hist2bStr = "30-40%";
7307 //TH1* hist1 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 2); hist1Str = "0-2%";
7308 //TH1* hist2 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 2, 3); hist2Str = "2-3%";
7309 //TH1* hist2b = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, 10); hist2bStr = "30-40%";
7311 else if (flowComparison)
7313 TH1* hist1 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 5); hist1Str = "0-5%";
7314 TH1* hist2 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 10); hist2Str = "20-40%";
7315 TH1* hist2b = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, 10); hist2bStr = "30-40%";
7316 TH1* hist3 = 0; // h2->GetUEHist(2)->GetUEHist(0, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7318 else if (rhicOverlay)
7320 TH1* hist1 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 8); hist1Str = "0-20%";
7321 TH1* hist2 = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 12); hist2Str = "20-60%";
7322 TH1* hist2b = h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15);hist2bStr = "60-90%";
7323 TH1* hist3 = h2->GetUEHist(2)->GetUEHist(0, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7332 Bool_t equivMixedBin = 1;
7334 // histType = 20; Printf("WARNING: Using histogram type 20");
7336 // GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, vn[0]); hist1Str = "0-2%";
7337 // GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, vn[0]); hist1Str = "0-5%";
7338 GetDistAndFlow(h, hMixed, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin); hist1Str = "0-5%";
7345 GetDistAndFlow(h, hMixed, &histTmp1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, equivMixedBin); hist1Str = "0-5%";
7346 histTmp1->SetLineColor(2);
7347 histTmp1->Draw("SAME");
7348 histTmp1->Scale(1 / 0.75);
7351 GetDistAndFlow(h, hMixed, &histTmp1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 20, equivMixedBin); hist1Str = "0-5%";
7352 histTmp1->SetLineColor(4);
7353 histTmp1->Draw("SAME");
7354 histTmp1->Scale(1 / 0.75);
7357 GetDistAndFlow(h, hMixed, &histTmp1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 11, equivMixedBin); hist1Str = "0-5%";
7358 histTmp1->SetLineColor(3);
7359 histTmp1->Draw("SAME");
7360 histTmp1->Scale(1 / 0.25);
7365 GetDistAndFlow(h, hMixed, &hist2, v2+1, step, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin); hist2Str = "0-20%";
7366 // GetDistAndFlow(h, hMixed, &hist2b, v2[2], step, 60, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 0, equivMixedBin); hist2bStr = "60-80%";
7367 GetDistAndFlow(h, hMixed, &hist2b, v2+2, step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin); hist2bStr = "60-90%";
7369 Printf("%f %f %f", v2[0], v2[1], v2[2]);
7370 // Printf("%f %f %f", vn[0][1], vn[0][2], vn[0][3]);
7372 // TH1* hist1 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 8); hist1Str = "0-20%";
7373 // TH1* hist2 = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 12); hist2Str = "20-60%";
7374 // TH1* hist2b = h->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15); hist2bStr = "60-90%";
7377 // TH1* hist3Old = h2->GetUEHist(2)->GetUEHist(step, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
7379 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin);
7380 // hist3->Rebin(2); hist3->Scale(0.5);
7384 hist3Old->DrawCopy("SAME")->SetLineColor(2); */
7388 RemoveBaseLine(hist1);
7389 RemoveBaseLine(hist2);
7390 RemoveBaseLine(hist2b);
7391 RemoveBaseLine(hist3);
7395 newTitle.Form("%s - %s", str.Data(), str2.Data());
7398 hist1->SetName(Form("dphi_%d_%d_%d", i, j, 0));
7399 hist1->SetTitle(newTitle + " - " + hist1Str);
7403 hist2->SetName(Form("dphi_%d_%d_%d", i, j, 1));
7404 hist2->SetTitle(newTitle + " - " + hist2Str);
7408 hist2b->SetName(Form("dphi_%d_%d_%d", i, j, 2));
7409 hist2b->SetTitle(newTitle + " - " + hist2bStr);
7413 hist3->SetName(Form("dphi_%d_%d_%d", i, j, 3));
7414 hist3->SetTitle(newTitle + " - pp");
7419 hist1->Scale(1.0 / hist1->Integral());
7420 hist2->Scale(1.0 / hist2->Integral());
7421 hist3->Scale(1.0 / hist3->Integral());
7424 if (i == 0 && j == 0)
7426 legend->SetFillColor(0);
7427 legend->AddEntry(hist1, "Pb+Pb 0-5%");
7429 legend->AddEntry(hist2, "Pb+Pb 20-40%");
7431 legend->AddEntry(hist2b, "Pb+Pb 60-90%");
7433 legend->AddEntry(hist3, "p+p 7 TeV");
7434 legend->SetTextSize(0.08);
7437 Prepare1DPlot(hist1);
7438 Prepare1DPlot(hist2);
7439 Prepare1DPlot(hist2b);
7440 Prepare1DPlot(hist3);
7442 Double_t yMin = 0.01;
7443 Double_t yMax2 = yMax;
7447 yMin = -0.01; //TMath::Min(hist1->GetMinimum(), hist2->GetMinimum()) * 0.97;
7448 yMax2 = TMath::Max((hist3) ? hist3->GetMaximum() : 0.0, TMath::Max(hist1->GetMaximum(), (hist2) ? hist2->GetMaximum() : 0.0)) * 1.03;
7453 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);
7454 dummy->SetStats(kFALSE);
7455 dummy->SetXTitle(hist1->GetXaxis()->GetTitle());
7456 dummy->SetYTitle(hist1->GetYaxis()->GetTitle());
7457 dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
7458 Prepare1DPlot(dummy);
7460 dummy->GetYaxis()->SetTitleOffset(0.8);
7462 dummy->GetXaxis()->SetLabelSize(0.08);
7463 dummy->GetYaxis()->SetLabelSize(0.08);
7464 dummy->GetXaxis()->SetTitleSize(0.08);
7465 dummy->GetYaxis()->SetTitleSize(0.08);
7467 dummy->GetYaxis()->SetTitleOffset(0.8);
7470 dummyTmp = dummy->DrawCopy();
7472 hist1->DrawCopy("SAME");
7476 SetupRanges(hMixed);
7477 // for HI file do not set range in eta anymore after it was changed to delta eta axis
7478 hMixed->SetEtaRange(0, 0);
7480 TH1* hist1Mixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 5);
7481 //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]);
7482 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);
7484 //hist1Mixed->Draw("SAME");
7487 hist2->SetLineColor(2);
7488 hist2->DrawCopy("SAME");
7490 TH1* hist2Mixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 9, 10);
7491 //hist2Mixed->SetLineColor(2);
7492 //hist2Mixed->Draw("SAME");
7494 DrawFlow(v2[1], hist2, leadingPtArr[i], assocPtArr[j], hist2Mixed, i, 1, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
7495 //DrawFlow(GetFlow05(), hist2, leadingPtArr[i], assocPtArr[j], hist2Mixed);
7499 hist2b->SetLineColor(3);
7500 hist2b->DrawCopy("SAME");
7502 TH1* hist2bMixed = 0; //hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 13, 15);
7503 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], hist2bMixed, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
7504 //DrawFlow(GetFlow05(), hist2b, leadingPtArr[i], assocPtArr[j], hist2bMixed);
7508 hist3->SetLineColor(4);
7509 hist3->DrawCopy("SAME");
7511 DrawFlow(0, hist3, leadingPtArr[i], assocPtArr[j], 0, i, 3, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
7513 //dummyTmp->GetYaxis()->SetRangeUser(0, 1.1 * TMath::Max(TMath::Max(hist1->GetMaximum(), hist2->GetMaximum()), hist2b->GetMaximum()));
7515 else // delta eta delta phi
7519 if (assocPtArr[j] > leadingPtArr[i])
7526 if (assocPtArr[jRef] > leadingPtArr[i])
7530 gpTMin = assocPtArr[jRef] + 0.01;
7531 gpTMax = assocPtArr[jRef+1] - 0.01;
7533 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
7535 // use j for centrality
7536 if (j >= nCentralityBins)
7539 centrBegin = centralityBins[j];
7540 centrEnd = centralityBins[j+1] - 1;
7544 // for HI file do not set range in eta anymore after it was changed to delta eta axis
7545 h->SetEtaRange(0, 0);
7547 SetupRanges(hMixed);
7548 // for HI file do not set range in eta anymore after it was changed to delta eta axis
7549 hMixed->SetEtaRange(0, 0);
7551 TH2* histSame = (TH2*) h->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centrBegin, centrEnd, kTRUE);
7552 TH2* histMixed = (TH2*) hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centrBegin, centrEnd, kTRUE);
7555 histSame->Rebin2D(2, 2);
7556 histMixed->Rebin2D(2, 2);
7560 // fit delta eta, assuming no dependence on dphi
7562 //new TCanvas; histMixed->DrawCopy("SURF1");
7564 histMixedproj = histMixed->ProjectionY();
7565 histMixedproj->Scale(1.0 / histMixed->GetNbinsX());
7567 for (Int_t x=1; x<=histMixed->GetNbinsX(); x++)
7568 for (Int_t y=1; y<=histMixed->GetNbinsY(); y++)
7569 histMixed->SetBinContent(x, y, histMixedproj->GetBinContent(y));
7571 //new TCanvas; histMixed->DrawCopy("SURF1");
7574 histSame->SetStats(0);
7575 histSame->GetYaxis()->SetRangeUser(-1.5, 1.5);
7576 histSame->SetTitle("");
7577 histSame->Divide(histMixed);
7578 histSame->DrawCopy("SURF1");
7581 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
7582 latex = new TLatex(0.15, 0.95, str3);
7584 latex->SetTextSize(0.08);
7588 latex = new TLatex(0.55, 0.8, str);
7590 latex->SetTextSize(0.06);
7593 latex = new TLatex(0.55, 0.88, str2);
7595 latex->SetTextSize(0.06);
7598 // if (i == 0) return;
7601 canvas->SaveAs(Form("DeltaPhi_%.2f.png", yMax));
7607 //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]);
7610 void ExamplePhiEtaGap(const char* fileNamePbPb, const char* fileNamePbPbMix)
7614 if (!fileNamePbPbMix)
7615 fileNamePbPbMix = fileNamePbPb;
7617 Int_t leadingPtOffset = 1;
7619 Int_t maxLeadingPt = 4;
7620 Int_t maxAssocPt = 5;
7621 Float_t leadingPtArr[] = { 2.0, 3.0, 6.0, 6.0, 8.0, 10.0, 15.0, 20.0 };
7622 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7623 leadingPtOffset = 1;
7625 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb);
7626 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
7631 gpTMin = assocPtArr[j] + 0.01;
7632 gpTMax = assocPtArr[j+1] - 0.01;
7635 SetupRanges(hMixed);
7637 if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
7640 TString hist1Str, hist2Str, hist2bStr;
7649 Bool_t equivMixedBin = kTRUE;
7651 Int_t centralityBegin = 20;
7652 Int_t centralityEnd = 30;
7654 GetDistAndFlow(h, hMixed, &hist1, 0, step, centralityBegin, centralityEnd, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 20, equivMixedBin);
7656 GetDistAndFlow(h, hMixed, &hist2, 0, step, centralityBegin, centralityEnd, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 10, equivMixedBin);
7657 // hist2->Scale(1.0 / 0.8);
7659 GetDistAndFlow(h, hMixed, &hist3, 0, step, centralityBegin, centralityEnd, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 11, equivMixedBin);
7660 hist3->Scale(1.0 / 0.8);
7663 hist2->SetLineColor(2);
7664 hist2->Draw("SAME");
7665 hist3->SetLineColor(4);
7666 hist3->Draw("SAME");
7669 void ExampleDEtaDPhi(const char* fileNamePbPb, const char* fileNamePbPbMix)
7673 if (!fileNamePbPbMix)
7674 fileNamePbPbMix = fileNamePbPb;
7676 Int_t leadingPtOffset = 1;
7678 Int_t maxLeadingPt = 4;
7679 Int_t maxAssocPt = 5;
7680 Float_t leadingPtArr[] = { 1.0, 2.0, 3.0, 6.0, 6.0, 8.0, 10.0, 15.0, 20.0 };
7681 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 };
7682 leadingPtOffset = 1;
7684 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb);
7685 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
7690 gpTMin = assocPtArr[j] + 0.01;
7691 gpTMax = assocPtArr[j+1] - 0.01;
7694 SetupRanges(hMixed);
7699 GetSumOfRatios(h, hMixed, &hist1, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
7701 hist1->Draw("SURF1");
7704 Double_t GetEtaCut(TTree* analysisSettings)
7706 Double_t etaCut = 0;
7707 if (analysisSettings)
7709 analysisSettings->GetBranch("fTrackEtaCut")->SetAddress(&etaCut);
7710 analysisSettings->GetEntry(0);
7715 void PlotDeltaPhiEtaGap(const char* fileNamePbPb, const char* fileNamePbPbMix = 0, const char* fileNamepp = 0, const char* fileNamepp2 = 0, const char* outputFile = "dphi_corr.root")
7719 if (!fileNamePbPbMix)
7720 fileNamePbPbMix = fileNamePbPb;
7722 file = TFile::Open(outputFile, "RECREATE");
7725 Int_t leadingPtOffset = 1;
7727 Bool_t symmetrizePt = kFALSE;
7728 Int_t maxLeadingPt = 4;
7729 Int_t maxAssocPt = 6;
7732 //PbPb, NS peak shapes
7733 Float_t leadingPtArr[] = { 1.0, 2.0, 3.0, 4.0, 8.0, 15.0, 20.0 };
7734 // Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 8.0, 15.0, 20.0 };
7735 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 10.0, 12.0 };
7739 //Example for the Hadrons_Example wagon
7742 Float_t leadingPtArr[] = { 3.0, 5.0, 8.0, 16.0 };
7743 Float_t assocPtArr[] = {0.15, 0.3, 50.0, 0.5, 50.0, 1.0, 50.0 };
7747 //pA, trigger from all pT
7750 Float_t leadingPtArr[] = { 0.3, 4.0 };
7751 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 };
7752 // symmetrizePt = kTRUE;
7756 //pA, associated from all pT
7759 Float_t leadingPtArr[] = { 0.5, 1.0, 2.0, 3.0, 4.0, 0.5, 4.0 };
7760 Float_t assocPtArr[] = { 0.15, 0.5, 4.0 };
7761 // symmetrizePt = kTRUE;
7768 Float_t leadingPtArr[] = { 0.5, 1.0, 1.5, 2.0, 2.5, 4.0, 8.0, 15.0, 20.0 };
7769 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 1.5, 2.0, 2.5, 4.0, 8.0, 10.0, 12.0 };
7773 //pPb and PbPb with PID, with low pt points TPC only
7776 Float_t leadingPtArr[] = { 0.2, 0.3, 0.5 , 0.75, 1.0, 1.25, 1.5, 2.0, 2.5, 3., 4.0};
7777 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 };
7781 //PbPb for comaprison with You
7784 Float_t leadingPtArr[] = { 0.2, 0.3, 0.5 , 1.0, 1.5, 2.0, 2.5, 3., 4.0};
7785 Float_t assocPtArr[] = { 0.15, 0.2, 0.3, 0.5 , 1.0, 1.5, 2.0, 2.5, 3., 4.0 };
7792 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 };
7793 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 };
7800 Float_t leadingPtArr[] = { 0.5, 1.5, 2.5, 4.0, 5.0, 8.0, 15.0, 20.0 };
7801 Float_t assocPtArr[] = { 0.15, 0.5, 1.5, 2.5, 4.0, 5.0, 8.0, 10.0, 12.0 };
7805 //pA 2012; MC validation (also PbPb)
7808 Float_t leadingPtArr[] = { 0.5, 1.0, 2.0, 4.0, 8.0, 15.0, 20.0 };
7809 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 4.0, 8.0, 10.0, 12.0 };
7813 // pA, CMS ridge comparison
7816 Float_t leadingPtArr[] = { 0.5, 1.0, 2.0, 3.0, 4.0, 8.0, 15.0, 20.0 };
7817 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
7823 Float_t leadingPtArr[] = { 2.0, 3.0};
7824 Float_t assocPtArr[] = {0.15, 0.5, 1.0, 2.0};
7826 else if (0) //Comparison to STAR (p_T,t)
7830 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 5.0, 6.0};
7831 Float_t assocPtArr[] = {0.15, 0.5, 1.5, 6.0};
7833 else if (0) //Comparison to STAR (p_T,a)
7837 Float_t leadingPtArr[] = { 3.0, 6.0};
7838 Float_t assocPtArr[] = {0.15, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0};
7844 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 8.0, 15.0 };
7845 Float_t assocPtArr[] = {0.15, 0.5, 1.0, 1.5, 2.0};
7849 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb, &list);
7850 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPbMix, 0, kTRUE);
7851 // hMixed3 = (AliUEHistograms*) hMixed->Clone();
7855 h->GetUEHist(2)->SymmetrizepTBins();
7856 hMixed->GetUEHist(2)->SymmetrizepTBins();
7860 AliUEHistograms* h2 = 0;
7861 AliUEHistograms* hMixed2 = 0;
7864 h2 = (AliUEHistograms*) GetUEHistogram(fileNamepp, &list2);
7865 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileNamepp, 0, kTRUE);
7869 AliUEHistograms* h3 = 0;
7870 AliUEHistograms* hMixed3 = 0;
7873 h3 = (AliUEHistograms*) GetUEHistogram(fileNamepp2, &list3);
7874 hMixed3 = (AliUEHistograms*) GetUEHistogram(fileNamepp2, 0, kTRUE);
7877 // h->GetUEHist(2)->SetGetMultCache();
7878 // hMixed->GetUEHist(2)->SetGetMultCache();
7880 TH2* refMultRaw = (TH2*) list->FindObject("referenceMultiplicity");
7883 // new TCanvas; refMultRaw->Draw("COLZ");
7884 Int_t nCentrBins = 4;
7885 Double_t centrBins[] = { 0., 20., 40., 60., 100. };
7886 // Double_t centrBins[] = { 0., 3., 10., 50., 100. };
7887 TH1* refMult = new TH1F("refMult", ";centrality;<Nch>", nCentrBins, centrBins);
7888 for (Int_t i=0; i<nCentrBins; i++)
7890 TH1* proj = refMultRaw->ProjectionY(Form("proj%d", i), refMultRaw->GetXaxis()->FindBin(centrBins[i] + 0.1), refMultRaw->GetXaxis()->FindBin(centrBins[i+1] - 0.1));
7891 // new TCanvas; proj->DrawClone();
7892 refMult->SetBinContent(refMult->GetXaxis()->FindBin(centrBins[i] + 0.1), proj->GetMean());
7893 refMult->SetBinError(refMult->GetXaxis()->FindBin(centrBins[i] + 0.1), proj->GetMeanError());
7894 Printf("Ref multiplicity for centrality %f to %f: %f", centrBins[i], centrBins[i+1], proj->GetMean());
7896 // new TCanvas; refMult->Draw();
7897 file = TFile::Open(outputFile, "UPDATE");
7903 tree = (TTree*) list->FindObject("UEAnalysisSettings");
7904 Double_t etaCut = GetEtaCut(tree);
7905 Printf("Setting eta cut to %f", etaCut);
7906 h->SetTrackEtaCut(etaCut);
7910 tree = (TTree*) list2->FindObject("UEAnalysisSettings");
7913 Double_t etaCut = GetEtaCut(tree);
7914 Printf("Setting eta cut to %f", etaCut);
7915 h2->SetTrackEtaCut(etaCut);
7919 Double_t etaCut = 0.9;
7920 Printf("WARNING: Setting eta cut to %f without checking", etaCut);
7921 h2->SetTrackEtaCut(etaCut);
7927 tree = (TTree*) list3->FindObject("UEAnalysisSettings");
7930 Double_t etaCut = GetEtaCut(tree);
7931 Printf("Setting eta cut to %f", etaCut);
7932 h3->SetTrackEtaCut(etaCut);
7936 Double_t etaCut = 0.9;
7937 Printf("WARNING: Setting eta cut to %f without checking", etaCut);
7938 h3->SetTrackEtaCut(etaCut);
7946 h->SetZVtxRange(-0.99, 0.99);
7947 hMixed->SetZVtxRange(-0.99, 0.99);
7948 h2->SetZVtxRange(-0.99, 0.99);
7949 hMixed2->SetZVtxRange(-0.99, 0.99);
7952 for (Int_t i=0; i<maxLeadingPt; i++)
7954 for (Int_t j=1; j<maxAssocPt; j++)
7957 if(j!=(i+1))continue;
7958 Printf("\nOnly symmetric pt bins selected, leading pt: %f - %f associated pt: %f - %f",leadingPtArr[i],leadingPtArr[i+leadingPtOffset],assocPtArr[j],assocPtArr[j+1]);
7961 gpTMin = assocPtArr[j] + 0.01;
7962 gpTMax = assocPtArr[j+1] - 0.01;
7964 if(gpTMin >= gpTMax)continue;
7967 SetupRanges(hMixed);
7969 SetupRanges(hMixed2);
7971 SetupRanges(hMixed3);
7972 // SetupRanges(hMixed3);
7974 if(1) if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
7986 Bool_t equivMixedBin = 1; //kFALSE; // TODO ?
7987 Bool_t scaleToPairs = kTRUE;
7995 Bool_t normalizePerTrigger = kFALSE; // don't do if histograms are to be merged -> Use MergeDPhiFiles below
7997 GetSumOfRatios(h, hMixed, &hist1, step, 0, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
7998 GetSumOfRatios(h, hMixed, &hist5, step, 10, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
7999 GetSumOfRatios(h, hMixed, &hist4, step, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
8000 GetSumOfRatios(h, hMixed, &hist6, step, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
8001 GetSumOfRatios(h, hMixed, &hist2, step, 60, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
8002 // GetSumOfRatios(h, hMixed, &hist7, step, 70, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
8003 // GetSumOfRatios(h, hMixed, &hist8, step, 80, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, normalizePerTrigger);
8006 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8014 GetSumOfRatios(h, hMixed, &hist1, step, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8015 GetSumOfRatios(h, hMixed, &hist2, step, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8016 GetSumOfRatios(h, hMixed, &hist4, step, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8017 GetSumOfRatios(h, hMixed, &hist5, step, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8018 // GetSumOfRatios(h, hMixed, &hist7, step, 70, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8019 // GetSumOfRatios(h, hMixed, &hist8, step, 80, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8022 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8025 GetSumOfRatios(h3, hMixed3, &hist6, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8029 // pA, V0 as trigger particle detector
8032 h->GetUEHist(2)->SetSkipScaleMixedEvent(kTRUE);
8033 GetSumOfRatios(h, hMixed, &hist1, step, 0, 20, 1.01, 1.99, kTRUE);
8034 GetSumOfRatios(h, hMixed, &hist2, step, 20, 40, 1.01, 1.99, kTRUE);
8035 GetSumOfRatios(h, hMixed, &hist4, step, 40, 60, 1.01, 1.99, kTRUE);
8036 GetSumOfRatios(h, hMixed, &hist5, step, 60, 100, 1.01, 1.99, kTRUE);
8039 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8042 GetSumOfRatios(h3, hMixed3, &hist6, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8048 GetSumOfRatios(h, hMixed, &hist1, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8055 GetSumOfRatios(h, hMixed, &hist1, step, 4, 4, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8056 GetSumOfRatios(h, hMixed, &hist2, step, 3, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8057 GetSumOfRatios(h, hMixed, &hist4, step, 2, 2, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8058 GetSumOfRatios(h, hMixed, &hist5, step, 1, 1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE, kTRUE);
8062 // pA, course binning
8065 GetSumOfRatios(h, hMixed, &hist1, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8066 GetSumOfRatios(h, hMixed, &hist2, step, 0, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8067 GetSumOfRatios(h, hMixed, &hist4, step, 40, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8069 GetDistAndFlow(h, hMixed, &hist5, 0, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8071 GetSumOfRatios(h2, hMixed2, &hist3, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8075 // pA, CMS ridge paper comparison
8078 GetSumOfRatios(h, hMixed, &hist1, step, 0, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8079 GetSumOfRatios(h, hMixed, &hist2, step, 3, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8080 GetSumOfRatios(h, hMixed, &hist4, step, 10, 50, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8081 GetSumOfRatios(h, hMixed, &hist5, step, 50, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8082 GetSumOfRatios(h, hMixed, &hist7, step, 80, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8086 // pA, MC, validation binning
8087 GetSumOfRatios(h, hMixed, &hist1, 0, 0, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8088 GetSumOfRatios(h, hMixed, &hist5, 10, 0, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8092 // pA, MC, validation binning
8093 GetSumOfRatios(h, hMixed, &hist1, 0, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8094 GetSumOfRatios(h, hMixed, &hist2, 0, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8095 GetSumOfRatios(h, hMixed, &hist3, 0, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8096 GetSumOfRatios(h, hMixed, &hist4, 0, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8097 GetSumOfRatios(h, hMixed, &hist5, 10, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8098 GetSumOfRatios(h, hMixed, &hist6, 10, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8099 GetSumOfRatios(h, hMixed, &hist7, 10, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8100 GetSumOfRatios(h, hMixed, &hist8, 10, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8107 GetSumOfRatios(h, hMixed, &hist1, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8111 // pA, MC, validation binning, without vertex axis
8112 GetDistAndFlow(h, hMixed, &hist1, 0, 0, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8113 GetDistAndFlow(h, hMixed, &hist2, 0, 0, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8114 GetDistAndFlow(h, hMixed, &hist3, 0, 0, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8115 GetDistAndFlow(h, hMixed, &hist4, 0, 0, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8116 GetDistAndFlow(h, hMixed, &hist5, 0, 10, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8117 GetDistAndFlow(h, hMixed, &hist6, 0, 10, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8118 GetDistAndFlow(h, hMixed, &hist7, 0, 10, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8119 GetDistAndFlow(h, hMixed, &hist8, 0, 10, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8123 // PbPb, MC, impact parameter binning
8126 Printf(">>>>>>>> Not using GetSumOfRatios!!!");
8128 GetDistAndFlow(h, hMixed, &hist1, 0, step, 1, 6, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8129 GetDistAndFlow(h, hMixed, &hist5, 0, step, 7, 7, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8130 GetDistAndFlow(h, hMixed, &hist4, 0, step, 8, 9, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8131 GetDistAndFlow(h, hMixed, &hist6, 0, step, 10, 11, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8132 GetDistAndFlow(h, hMixed, &hist2, 0, step, 12, 13, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs, -1, kTRUE);
8135 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8142 Printf(">>>>>>>> Not using GetSumOfRatios!!!");
8143 GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8144 // Printf("integral: %f", ((TH2*) hist1)->Integral(1, 36, 5, 36));
8147 GetDistAndFlow(h, hMixed, &hist5, 0, step, 10, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8148 GetDistAndFlow(h, hMixed, &hist4, 0, step, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8149 GetDistAndFlow(h, hMixed, &hist6, 0, step, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8150 GetDistAndFlow(h, hMixed, &hist2, 0, step, 60, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8153 GetDistAndFlow(h2, hMixed2, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8154 // new TCanvas; hist3->DrawClone("SURF1");
8155 // GetDistAndFlow(hMixed2, 0, &hist3, 0, step, 0, -1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8156 // new TCanvas; hist3->DrawClone("SURF1");
8157 // Printf("integral: %f", ((TH2*) hist3)->Integral(1, 36, 5, 36));
8160 //MC closure test in pA and PbPb with PID
8161 // GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8162 // GetDistAndFlow(h, hMixed, &hist2, 0, step, 20, 40, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8163 // GetDistAndFlow(h, hMixed, &hist4, 0, step, 40, 60, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8164 // GetDistAndFlow(h, hMixed, &hist5, 0, step, 60, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8165 // GetDistAndFlow(h, hMixed, &hist7, 0, step, 80, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8166 // GetDistAndFlow(h, hMixed, &hist8, 0, step, 0, 100, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, histType, equivMixedBin, 0, scaleToPairs);
8172 GetSumOfRatios(h, hMixed, &hist1, step, 60, 70, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8173 GetSumOfRatios(h, hMixed, &hist2, step, 70, 80, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8174 GetSumOfRatios(h, hMixed, &hist3, step, 80, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8180 GetSumOfRatios(h, hMixed, &hist1, step, 0, 1, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8181 GetSumOfRatios(h, hMixed, &hist2, step, 1, 3, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8182 GetSumOfRatios(h, hMixed, &hist4, step, 3, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8183 GetSumOfRatios(h, hMixed, &hist5, step, 5, 10, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8184 GetSumOfRatios(h, hMixed, &hist6, step, 10, 20, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kTRUE);
8187 file = TFile::Open(outputFile, "UPDATE");
8191 hist1->SetName(Form("dphi_%d_%d_%d", i, j, 0));
8197 hist2->SetName(Form("dphi_%d_%d_%d", i, j, 1));
8203 hist4->SetName(Form("dphi_%d_%d_%d", i, j, 3));
8209 hist5->SetName(Form("dphi_%d_%d_%d", i, j, 4));
8215 hist7->SetName(Form("dphi_%d_%d_%d", i, j, 6));
8221 hist8->SetName(Form("dphi_%d_%d_%d", i, j, 7));
8227 hist6->SetName(Form("dphi_%d_%d_%d", i, j, 5));
8228 TString title(hist6->GetTitle());
8229 title.ReplaceAll("0--1%", "pp");
8230 hist6->SetTitle(title);
8236 hist3->SetName(Form("dphi_%d_%d_%d", i, j, 2));
8237 TString title(hist3->GetTitle());
8238 title.ReplaceAll("0--1%", "pp");
8239 hist3->SetTitle(title);
8257 TH1* triggers = h->GetUEHist(2)->GetTriggersAsFunctionOfMultiplicity(step, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
8258 triggers->SetName(Form("triggers_%d", i));
8260 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+leadingPtOffset]);
8261 triggers->SetTitle(str);
8263 file = TFile::Open(outputFile, "UPDATE");
8272 void MergeDPhiFiles(const char* fileName, const char* fileName2, const char* target)
8274 // merges the dphi histograms (except the pp histogram at index "2") as well as the triggers
8275 // then divides the dphi histograms by the respective number of triggers
8277 file = TFile::Open(fileName);
8278 file2 = TFile::Open(fileName2);
8280 fileTarget = TFile::Open(target, "RECREATE");
8281 fileTarget->Close();
8283 Int_t maxLeadingPt = 10;
8284 Int_t maxAssocPt = 11;
8287 for (Int_t i=0; i<maxLeadingPt; i++)
8289 TH1* triggers = (TH1*) file->Get(Form("triggers_%d", i));
8293 TH1* triggers2 = (TH1*) ((file2) ? file2->Get(Form("triggers_%d", i)) : 0);
8295 Printf("WARNING: trigger %d missing", i);
8297 for (Int_t j=0; j<maxAssocPt; j++)
8299 for (Int_t histId = 0; histId < nHists; histId++)
8301 TH2* hist = (TH2*) file->Get(Form("dphi_%d_%d_%d", i, j, histId));
8304 TH2* hist2 = (TH2*) ((file2) ? file2->Get(Form("dphi_%d_%d_%d", i, j, histId)) : 0);
8306 Printf("WARNING: %d %d %d exists only in file2, not copied!");
8310 if (histId != 2) // don't merge pp
8312 TString title(hist->GetTitle());
8313 title.ReplaceAll("%", "");
8314 tokens = title.Tokenize("-");
8316 Float_t centralityBegin = ((TObjString*) tokens->At(2))->String().Atoi();
8317 Float_t centralityEnd = ((TObjString*) tokens->At(3))->String().Atoi();
8319 Double_t nTriggers = triggers->Integral(triggers->FindBin(centralityBegin + 0.001), triggers->FindBin(centralityEnd - 0.001));
8320 Double_t nTriggers2 = 0;
8322 TH2* hist2 = (TH2*) ((file2) ? file2->Get(Form("dphi_%d_%d_%d", i, j, histId)) : 0);
8323 if (hist2 && triggers2)
8325 if (histId != 1 && histId != 5) // don't merge 60-80% and 40-60%
8328 nTriggers2 = triggers2->Integral(triggers2->FindBin(centralityBegin + 0.001), triggers2->FindBin(centralityEnd - 0.001));
8332 Printf("WARNING: %d %d %d missing", i, j, histId);
8334 if (nTriggers + nTriggers2 > 0)
8335 hist->Scale(1.0 / (nTriggers + nTriggers2));
8337 Printf("%s %f %f %f %f", hist->GetTitle(), centralityBegin, centralityEnd, nTriggers, nTriggers2);
8340 fileTarget = TFile::Open(target, "UPDATE");
8342 fileTarget->Close();
8348 void ExtractMiniJetHistograms(const char* fileNamePbPb, Bool_t useMixed = kTRUE, const char* outputFile = "dphi_corr.root")
8352 file = TFile::Open(outputFile, "RECREATE");
8355 Int_t leadingPtOffset = 1;
8360 Int_t maxLeadingPt = 1;
8361 Int_t maxAssocPt = 1;
8362 Float_t leadingPtArr[] = { 0.7, 5.0 };
8363 Float_t assocPtArr[] = { 0.7, 5.0 };
8366 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNamePbPb);
8367 hMixed = (AliUEHistograms*) GetUEHistogram(fileNamePbPb, 0, kTRUE);
8371 for (Int_t i=0; i<maxLeadingPt; i++)
8373 for (Int_t j=0; j<maxAssocPt; j++)
8377 gpTMin = assocPtArr[j] + 0.01;
8378 gpTMax = assocPtArr[j+1] - 0.01;
8381 SetupRanges(hMixed);
8383 if (assocPtArr[j] >= leadingPtArr[i+leadingPtOffset])
8388 // pA, minijets, very fine binning
8390 for (Int_t centr=0; centr<20; centr++)
8394 GetSumOfRatios(h, hMixed, &hist1, step, 5*centr, 5*centr+5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, kFALSE);
8396 GetDistAndFlow(h, 0, &hist1, 0, step, 5*centr, 5*centr+5, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, 1, 1, 0, kTRUE);
8401 file = TFile::Open(outputFile, "UPDATE");
8402 hist1->SetName(Form("dphi_%d_%d_%d", i, j, centr));
8411 TH1* triggers = h->GetUEHist(2)->GetTriggersAsFunctionOfMultiplicity(step, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01);
8412 triggers->SetName(Form("triggers_%d", i));
8414 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+leadingPtOffset]);
8415 triggers->SetTitle(str);
8417 file = TFile::Open(outputFile, "UPDATE");
8422 TH1* events = h->GetEventCount()->ProjectionY("events", h->GetEventCount()->GetXaxis()->FindBin(step), h->GetEventCount()->GetXaxis()->FindBin(step));
8423 file = TFile::Open(outputFile, "UPDATE");
8424 events->Write("events");
8428 TLatex* DrawLatex(Float_t x, Float_t y, Int_t color, const char* text, Float_t fontSize = 0.06)
8430 latex = new TLatex(x, y, text);
8432 latex->SetTextSize(fontSize);
8433 latex->SetTextColor(color);
8438 void DrawChi2NDF(TF1* func, TH1* hist, Float_t x, Float_t y, Int_t color = 1)
8442 for (Int_t i=hist->GetXaxis()->FindBin(-0.8); i<=hist->GetXaxis()->FindBin(0.8); i++)
8444 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);
8447 ndf -= func->GetNumberFreeParameters();
8449 printf("#chi^{2}/ndf = %.1f/%d = %.1f ", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF());
8450 Printf("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf);
8452 DrawLatex(x, y, color, Form("#chi^{2}/ndf = %.1f/%d = %.1f", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF()));
8453 DrawLatex(x, y - 0.05, color, Form("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf));
8456 void FitDeltaPhiEtaGap(TH1* hist, Int_t color, TGraphErrors* graph, Float_t x, Float_t yPosChi2)
8458 hist->SetLineColor(color);
8459 hist->DrawCopy("SAME");
8461 Bool_t twoGauss = kFALSE;
8464 func = new TF1("func", "[0]+gaus(1)");
8467 func = new TF1("func", "[0]+gaus(1)+gaus(4)");
8468 func->FixParameter(5, 0);
8469 func->SetParLimits(3, 0.1, 10);
8470 func->SetParLimits(6, 0.1, 10);
8471 func->SetParLimits(1, 0, 10);
8472 func->SetParLimits(4, 0, 10);
8475 func->SetParameters(0, 1, 0, 0.3, 1, 0, 1);
8476 func->FixParameter(2, 0);
8477 func->SetLineColor(color);
8479 hist->Fit(func, "", "SAME");
8480 // hist->Fit(func, "IM", "SAME");
8484 func2 = new TF1("func2", "[0]+gaus(1)", -1.5, 4.5);
8485 func2->SetParameters(func->GetParameter(0), func->GetParameter(1), func->GetParameter(2), func->GetParameter(3));
8486 func2->SetLineColor(color);
8487 func2->SetLineWidth(1);
8488 func2->SetLineStyle(2);
8489 func2->Draw("SAME");
8491 func2 = new TF1("func2", "[0]+gaus(1)", -1.5, 4.5);
8492 func2->SetParameters(func->GetParameter(0), func->GetParameter(4), func->GetParameter(5), func->GetParameter(6));
8493 func2->SetLineColor(color);
8494 func2->SetLineWidth(1);
8495 func2->SetLineStyle(2);
8496 func2->Draw("SAME");
8501 Bool_t firstIsMin = func->GetParameter(3) < func->GetParameter(6);
8503 Bool_t onlyOne = kFALSE;
8504 if (func->GetParameter(1) / func->GetParameter(4) < 0.1)
8506 firstIsMin = kFALSE;
8509 if (func->GetParameter(1) / func->GetParameter(4) > 10)
8515 graph->SetPoint(graph->GetN(), x - 0.1, func->GetParameter((firstIsMin) ? 3 : 6));
8516 graph->SetPointError(graph->GetN()-1, 0, func->GetParError((firstIsMin) ? 3 : 6));
8520 graph->SetPoint(graph->GetN(), x + 0.1, TMath::Abs(func->GetParameter((!firstIsMin) ? 3 : 6)));
8521 graph->SetPointError(graph->GetN()-1, 0, func->GetParError((!firstIsMin) ? 3 : 6));
8526 graph->SetPoint(graph->GetN(), x, TMath::Abs(func->GetParameter(3)));
8527 graph->SetPointError(graph->GetN()-1, 0, func->GetParError(3));
8530 DrawChi2NDF(func, hist, 0.5, yPosChi2, color);
8533 void AnalyzeDeltaPhiEtaGap(const char* fileName)
8535 TFile::Open(fileName);
8537 Int_t maxLeadingPt = 5;
8538 Int_t maxAssocPt = 6;
8540 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
8541 canvas->Divide(maxAssocPt, maxLeadingPt);
8543 TGraphErrors* width1 = new TGraphErrors;
8544 TGraphErrors* width2 = new TGraphErrors;
8545 TGraphErrors* width3 = new TGraphErrors;
8547 for (Int_t i=0; i<maxLeadingPt; i++)
8548 for (Int_t j=0; j<maxAssocPt; j++)
8550 canvas->cd(j+1 + i * maxAssocPt);
8551 gPad->SetLeftMargin(0.15);
8552 gPad->SetBottomMargin(0.2);
8553 gPad->SetTopMargin(0.01);
8554 gPad->SetRightMargin(0.01);
8556 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 0));
8557 hist2 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 1));
8558 hist3 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 2));
8563 TString tmpStr(hist1->GetTitle());
8564 tmpStr.ReplaceAll(" - ", "#");
8565 tokens = tmpStr.Tokenize("#");
8566 TString str(tokens->At(0)->GetName());
8567 TString str2(tokens->At(1)->GetName());
8569 Prepare1DPlot(hist1);
8570 Prepare1DPlot(hist2);
8571 Prepare1DPlot(hist3);
8574 hist1->Fit("pol0", "0", "", 1, 4);
8575 if (!hist1->GetFunction("pol0"))
8577 hist1->GetFunction("pol0")->SetRange(-10, 10);
8578 hist1->Add(hist1->GetFunction("pol0"), -1);
8580 hist3->Fit("pol0", "0", "", 1, 4);
8581 hist3->GetFunction("pol0")->SetRange(-10, 10);
8582 hist3->Add(hist3->GetFunction("pol0"), -1);
8584 Double_t yMin = 0.01;
8589 yMin = TMath::Min(hist1->GetMinimum(), hist2->GetMinimum()) * 0.97;
8590 yMax = TMath::Max(hist1->GetMaximum(), (hist2) ? hist2->GetMaximum() : 0.0) * 1.1;
8593 // yMin = hist1->GetMinimum() * 0.9;
8596 TH2F* dummy = new TH2F("dummy", "", 100, hist1->GetXaxis()->GetBinLowEdge(1), hist1->GetXaxis()->GetBinUpEdge(hist1->GetNbinsX()), 1000, yMin, yMax);
8597 dummy->SetStats(kFALSE);
8598 dummy->SetXTitle(hist1->GetXaxis()->GetTitle());
8599 dummy->SetYTitle(hist1->GetYaxis()->GetTitle());
8600 dummy->SetYTitle("1/N_{trig} dN/d#Delta#phi");
8601 Prepare1DPlot(dummy);
8603 dummy->GetYaxis()->SetTitleOffset(0.8);
8605 dummy->GetXaxis()->SetLabelSize(0.08);
8606 dummy->GetYaxis()->SetLabelSize(0.08);
8607 dummy->GetXaxis()->SetTitleSize(0.08);
8608 dummy->GetYaxis()->SetTitleSize(0.08);
8610 dummy->GetYaxis()->SetTitleOffset(0.8);
8613 dummyTmp = dummy->DrawCopy();
8615 // TODO plot yield? baseline problematic?
8617 Float_t xPos = width1->GetN();
8620 FitDeltaPhiEtaGap(hist1, 1, width1, xPos, 0.7);
8621 FitDeltaPhiEtaGap(hist2, 4, width2, xPos, 0.5);
8622 FitDeltaPhiEtaGap(hist3, 2, width3, xPos, 0.6);
8624 latex = new TLatex(0.3, 0.8, str);
8626 latex->SetTextSize(0.06);
8629 latex = new TLatex(0.3, 0.88, str2);
8631 latex->SetTextSize(0.06);
8634 DrawLatex(0.8, 0.9, 1, "0-5%");
8635 DrawLatex(0.8, 0.85, 2, "60-90%");
8636 DrawLatex(0.8, 0.8, 4, "pp");
8643 width1->SetMarkerStyle(20);
8646 width2->SetMarkerStyle(24);
8647 width2->SetMarkerColor(4);
8648 width2->Draw("P SAME");
8650 width3->SetMarkerStyle(25);
8651 width3->SetMarkerColor(2);
8652 width3->Draw("P SAME");
8655 void CheckWing(const char* fileName)
8657 TFile::Open(fileName);
8659 Int_t maxLeadingPt = 4;
8660 Int_t maxAssocPt = 5;
8662 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
8663 canvas->Divide(maxAssocPt-1, maxLeadingPt);
8665 for (Int_t i=0; i<maxLeadingPt; i++)
8666 for (Int_t j=1; j<maxAssocPt; j++)
8668 canvas->cd(j + i * (maxAssocPt - 1));
8669 gPad->SetLeftMargin(0.15);
8670 gPad->SetBottomMargin(0.2);
8671 // gPad->SetTopMargin(0.01);
8672 gPad->SetRightMargin(0.01);
8674 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j+1, 0));
8679 // hist1->Draw("COLZ");
8681 Float_t width = 0.25;
8683 proj = ((TH2*) hist1)->ProjectionY(Form("%s_projx", hist1->GetName()), hist1->GetXaxis()->FindBin(TMath::Pi() - width),hist1->GetXaxis()->FindBin(TMath::Pi() + width));
8685 proj->GetXaxis()->SetRangeUser(-1.79, 1.79);
8686 proj->SetStats(kFALSE);
8689 proj2 = ((TH2*) hist1)->ProjectionY(Form("%s_proj2x", hist1->GetName()), hist1->GetXaxis()->FindBin(TMath::Pi() / 2 - width),hist1->GetXaxis()->FindBin(TMath::Pi() / 2 + width));
8691 proj2->GetXaxis()->SetRangeUser(-1.79, 1.79);
8692 proj2->SetLineColor(2);
8693 proj2->Draw("SAME");
8695 proj->SetMinimum(0.999 * proj2->GetMinimum());
8701 Int_t maxLeadingPt = 3;
8702 Int_t maxAssocPt = 3;
8704 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
8705 canvas->Divide(maxAssocPt, maxLeadingPt);
8707 // const char* fileNames[] = { "dphi_corr_allpt_zcentral_01.root", "dphi_corr_allpt_01.root" };
8708 // const char* fileNames[] = { "dphi_corr_allpt_zcentral.root", "dphi_corr_allpt.root" };
8709 // const char* fileNames[] = { "dphi_corr_allpt_zcentral.root", "dphi_corr.root" };
8710 // const char* fileNames[] = { "dphi_corr_allpt_01_zcentral.root", "dphi_corr_allpt_01_zsumofratios.root" };
8711 // const char* fileNames[] = { "dphi_corr_allpt_cfct_01_zcentral.root", "dphi_corr_allpt_cfct_01_zsumofratios.root" };
8712 // const char* fileNames[] = { "dphi_corr_2d.root", "dphi_corr.root" };
8713 // const char* fileNames[] = { "dphi_corr_2d_01.root", "dphi_corr.root" };
8714 // const char* fileNames[] = { "dphi_corr_2d.root", "dphi_corr_2d_vtxzcentral.root" };
8715 // const char* fileNames[] = { "dphi_corr_2d_01.root", , "dphi_corr_2d_01centr_zvtxcentral.root" };
8716 // const char* fileNames[] = { "dphi_corr_10k.root", "dphi_corr_50k.root" };
8717 // const char* fileNames[] = { "wing1.root", "wing2.root" };
8718 const char* fileNames[] = { "dphi_corr_2d_120112.root", "dphi_corr_2d_p2_111105.root" };
8720 for (Int_t i=0; i<maxLeadingPt; i++)
8721 for (Int_t j=0; j<maxAssocPt; j++)
8723 canvas->cd(j+1 + i * maxAssocPt);
8724 gPad->SetLeftMargin(0.15);
8725 gPad->SetBottomMargin(0.2);
8726 // gPad->SetTopMargin(0.01);
8727 gPad->SetRightMargin(0.01);
8730 for (Int_t fileId = 0; fileId < 2; fileId++)
8732 TFile::Open(fileNames[fileId]);
8734 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, 3));
8739 // hist1->Draw("COLZ");
8741 Float_t width = 0.5;
8743 for (Int_t areaId = 0; areaId < 3; areaId++)
8745 Float_t center = TMath::Pi() / 2 * areaId;
8746 proj = ((TH2*) hist1)->ProjectionY(Form("%s_%d_%d_projx", hist1->GetName(), fileId, areaId), hist1->GetXaxis()->FindBin(center - width), hist1->GetXaxis()->FindBin(center + width));
8747 // proj->Rebin(2); proj->Scale(0.5);
8749 proj->GetXaxis()->SetRangeUser(-1.79, 1.79);
8750 proj->SetStats(kFALSE);
8751 proj->SetLineColor(fileId + 1 + areaId * 2);
8752 proj->Draw((fileId == 0 && areaId == 0) ? "" : "SAME");
8756 proj->Scale(1. / 12);
8758 first->SetMinimum(0.999 * TMath::Min(first->GetMinimum() / 0.999, proj->GetMinimum()));
8759 first->SetMaximum(1.001 * TMath::Max(first->GetMaximum() / 1.001, proj->GetMaximum()));
8765 void FitDeltaPhiEtaGap2D(TH2* hist, Bool_t scale, TVirtualPad* pad1, TVirtualPad* pad2, TVirtualPad* pad3, TGraphErrors* width1, TGraphErrors* width2, Float_t x, Float_t yPosChi2)
8767 Float_t etaLimit = 1.0;
8768 Float_t outerLimit = 1.8;
8770 TString histName(hist->GetName());
8772 TH1D* etaGap = hist->ProjectionX(histName + "_1", TMath::Max(1, hist->GetYaxis()->FindBin(-outerLimit + 0.01)), hist->GetYaxis()->FindBin(-etaLimit - 0.01));
8773 Int_t etaBins = hist->GetYaxis()->FindBin(-etaLimit - 0.01) - TMath::Max(1, hist->GetYaxis()->FindBin(-outerLimit + 0.01)) + 1;
8775 TH1D* tracksTmp = hist->ProjectionX(histName + "_2", hist->GetYaxis()->FindBin(etaLimit + 0.01), TMath::Min(hist->GetYaxis()->GetNbins(), hist->GetYaxis()->FindBin(outerLimit - 0.01)));
8776 etaBins += TMath::Min(hist->GetYaxis()->GetNbins(), hist->GetYaxis()->FindBin(outerLimit - 0.01)) - hist->GetYaxis()->FindBin(etaLimit + 0.01) + 1;
8778 etaGap->Add(tracksTmp);
8780 // get per bin result
8781 etaGap->Scale(1.0 / etaBins);
8783 // new TCanvas; etaGap->DrawCopy();
8785 histTmp2D = (TH2*) hist->Clone("histTmp2D");
8788 for (Int_t xbin=1; xbin<=histTmp2D->GetNbinsX(); xbin++)
8789 for (Int_t y=1; y<=histTmp2D->GetNbinsY(); y++)
8790 histTmp2D->SetBinContent(xbin, y, etaGap->GetBinContent(xbin));
8794 // mixed event does not reproduce away-side perfectly
8795 // --> extract scaling factor on the away-side from ratios of eta gap and central region
8796 TH1D* centralRegion = hist->ProjectionX(histName + "_3", hist->GetYaxis()->FindBin(-etaLimit + 0.01), hist->GetYaxis()->FindBin(etaLimit - 0.01));
8797 etaBins = hist->GetYaxis()->FindBin(etaLimit - 0.01) - hist->GetYaxis()->FindBin(-etaLimit + 0.01) + 1;
8798 centralRegion->Scale(1.0 / etaBins);
8800 // new TCanvas; centralRegion->DrawCopy(); etaGap->SetLineColor(2); etaGap->DrawCopy("SAME");
8801 centralRegion->Divide(etaGap);
8802 // new TCanvas; centralRegion->Draw();
8803 centralRegion->Fit("pol0", "0", "", TMath::Pi() - 1, TMath::Pi() + 1);
8804 Float_t scalingFactor = centralRegion->GetFunction("pol0")->GetParameter(0);
8805 Printf(" scalingFactor = %f", scalingFactor);
8806 histTmp2D->Scale(scalingFactor);
8809 // new TCanvas; hist->DrawCopy("SURF1");
8811 hist->Add(histTmp2D, -1);
8813 // new TCanvas; hist->DrawCopy("SURF1");
8815 hist->GetYaxis()->SetRangeUser(-1.59, 1.59);
8819 hist->DrawCopy("SURF1");
8821 Float_t min = hist->GetMinimum();
8822 Float_t max = hist->GetMaximum();
8824 // ranges are to exclude eta gap region from fit
8825 func = new TF2("func", "[0]+[1]*exp(-0.5*((x/[2])**2+(y/[3])**2))", -5, 5, -1, 1);
8826 func->SetParameters(0, 1, 0.3, 0.3);
8827 func->SetParLimits(1, 0, 10);
8828 func->SetParLimits(2, 0.1, 10);
8829 func->SetParLimits(3, 0.1, 10);
8831 hist->Fit(func, "0R", "");
8832 // hist->Fit(func, "IM", "SAME");
8835 funcHist = (TH2*) hist->Clone("funcHist");
8837 funcHist->Add(func);
8838 funcHist->SetMinimum(min);
8839 funcHist->SetMaximum(max);
8840 funcHist->Draw("SURF1");
8843 hist->Add(func, -1);
8844 hist->SetMinimum(min);
8845 hist->SetMaximum(max);
8846 hist->DrawCopy("SURF1");
8848 width1->SetPoint(width1->GetN(), x, TMath::Abs(func->GetParameter(2)));
8849 width1->SetPointError(width1->GetN()-1, 0, func->GetParError(2));
8851 width2->SetPoint(width2->GetN(), x, TMath::Abs(func->GetParameter(3)));
8852 width2->SetPointError(width2->GetN()-1, 0, func->GetParError(3));
8856 for (Int_t i=hist->GetXaxis()->FindBin(-0.8); i<=hist->GetXaxis()->FindBin(0.8); i++)
8857 for (Int_t j=hist->GetYaxis()->FindBin(-0.8); j<=hist->GetYaxis()->FindBin(0.8); j++)
8859 if (hist->GetBinError(i, j) > 0)
8861 chi2 += TMath::Power(hist->GetBinContent(i, j) / hist->GetBinError(i, j), 2);
8865 ndf -= func->GetNumberFreeParameters();
8867 printf("#chi^{2}/ndf = %.1f/%d = %.1f ", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF());
8868 Printf("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf);
8870 DrawLatex(0.5, yPosChi2, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF()));
8871 DrawLatex(0.5, yPosChi2 - 0.05, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf));
8874 Double_t DeltaPhiWidth2DFitFunction(Double_t *x, Double_t *par)
8876 // params: 0: gaussian amplitude, 1: phi width, 2: eta width
8877 // 3..bins+2 constants as fct of eta
8879 Int_t etaBin = (Int_t) ((x[1] + 2.0) / 0.1);
8881 return par[3+etaBin]+par[0]*TMath::Exp(-0.5*((x[0]/par[1])**2+(x[1]/par[2])**2));
8884 void FitDeltaPhi2DOneFunction(TH2* hist, TVirtualPad* pad1, TVirtualPad* pad2, TVirtualPad* pad3, TGraphErrors* width1, TGraphErrors* width2, Float_t x, Float_t yPosChi2)
8886 Float_t outerLimit = 1.8;
8888 hist->GetYaxis()->SetRangeUser(-1.59, 1.59);
8892 hist->DrawCopy("SURF1");
8894 Float_t min = hist->GetMinimum();
8895 Float_t max = hist->GetMaximum();
8897 Int_t bins = hist->GetNbinsX();
8899 // ranges are to exclude eta gap region from fit
8900 func = new TF2("func", DeltaPhiWidth2DFitFunction, -5, 5, -outerLimit, outerLimit, bins+3);
8901 func->SetParameters(1, 0.3, 0.3);
8902 for (Int_t i=3; i<bins+3; i++)
8903 func->SetParameter(i, 0);
8905 func->SetParLimits(0, 0, 10);
8906 func->SetParLimits(1, 0.1, 10);
8907 func->SetParLimits(2, 0.1, 10);
8909 hist->Fit(func, "0R", "");
8910 // hist->Fit(func, "IM", "SAME");
8913 funcHist = (TH2*) hist->Clone("funcHist");
8915 funcHist->Add(func);
8916 funcHist->SetMinimum(min);
8917 funcHist->SetMaximum(max);
8918 funcHist->Draw("SURF1");
8921 hist->Add(func, -1);
8922 hist->SetMinimum(min);
8923 hist->SetMaximum(max);
8924 hist->DrawCopy("SURF1");
8926 width1->SetPoint(width1->GetN(), x, TMath::Abs(func->GetParameter(1)));
8927 width1->SetPointError(width1->GetN()-1, 0, func->GetParError(1));
8929 width2->SetPoint(width2->GetN(), x, TMath::Abs(func->GetParameter(2)));
8930 width2->SetPointError(width2->GetN()-1, 0, func->GetParError(2));
8934 for (Int_t i=hist->GetXaxis()->FindBin(-0.8); i<=hist->GetXaxis()->FindBin(0.8); i++)
8935 for (Int_t j=hist->GetYaxis()->FindBin(-0.8); j<=hist->GetYaxis()->FindBin(0.8); j++)
8937 if (hist->GetBinError(i, j) > 0)
8939 chi2 += TMath::Power(hist->GetBinContent(i, j) / hist->GetBinError(i, j), 2);
8943 ndf -= func->GetNumberFreeParameters();
8945 printf("#chi^{2}/ndf = %.1f/%d = %.1f ", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF());
8946 Printf("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf);
8948 DrawLatex(0.5, yPosChi2, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", func->GetChisquare(), func->GetNDF(), func->GetChisquare() / func->GetNDF()));
8949 DrawLatex(0.5, yPosChi2 - 0.05, 1, Form("#chi^{2}/ndf = %.1f/%d = %.1f", chi2, ndf, chi2 / ndf));
8952 void AnalyzeDeltaPhiEtaGap2D(const char* fileName, Int_t method)
8954 TFile::Open(fileName);
8956 Int_t maxLeadingPt = 5;
8957 Int_t maxAssocPt = 6;
8959 TGraphErrors* width1[4];
8960 TGraphErrors* width2[4];
8963 for (Int_t histId = 0; histId < nHists; histId++)
8965 width1[histId] = new TGraphErrors;
8966 width2[histId] = new TGraphErrors;
8967 for (Int_t i=0; i<maxLeadingPt; i++)
8969 TCanvas* canvas = new TCanvas(Form("DeltaPhi_%d_%d", histId, i), Form("DeltaPhi_%d_%d", histId, i), 1000, 1000);
8970 canvas->Divide(3, maxAssocPt);
8972 for (Int_t j=0; j<maxAssocPt; j++)
8974 for (Int_t k=1; k<=3; k++)
8976 canvas->cd(3 * j + k);
8977 gPad->SetLeftMargin(0.15);
8978 gPad->SetBottomMargin(0.2);
8979 gPad->SetTopMargin(0.01);
8980 gPad->SetRightMargin(0.01);
8983 // if (i != 1 || j != 2)
8986 hist1 = (TH1*) gFile->Get(Form("dphi_%d_%d_%d", i, j, histId));
8990 Float_t xPos = j*8+i;
8993 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);
8995 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);
9008 Int_t marker[] = { 20, 24, 25, 26 };
9009 Int_t colors[] = { 2, 2, 4, 6 };
9010 const char* labels[] = { "0-5%", "60-90%", "pp", "30-40%" };
9012 Bool_t found = kTRUE;
9013 c1 = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("width_phi");
9016 c1 = new TCanvas("width_phi", "width_phi", 800, 600);
9022 for (Int_t histId = 0; histId < nHists; histId++)
9024 width1[histId]->SetMarkerStyle(marker[histId]);
9025 width1[histId]->SetMarkerColor(colors[histId]);
9026 width1[histId]->Draw((histId == 0 && !found) ? "AP" : "PSAME");
9027 DrawLatex(0.7, 0.8 - 0.05 * histId, colors[histId], labels[histId]);
9031 c1 = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("width_eta");
9034 c1 = new TCanvas("width_eta", "width_eta", 800, 600);
9039 for (Int_t histId = 0; histId < nHists; histId++)
9041 width2[histId]->SetMarkerStyle(marker[histId]);
9042 width2[histId]->SetMarkerColor(colors[histId]);
9043 width2[histId]->Draw((histId == 0 && !found) ? "AP" : "PSAME");
9044 DrawLatex(0.7, 0.8 - 0.05 * histId, colors[histId], labels[histId]);
9049 void RemoveWing(const char* fileName, const char* outputFile)
9051 // 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
9053 file = TFile::Open(fileName);
9054 file2 = TFile::Open(outputFile, "RECREATE");
9057 Int_t maxLeadingPt = 10;
9058 Int_t maxAssocPt = 11;
9061 for (Int_t histId = 0; histId < nHists; histId++)
9063 for (Int_t i=0; i<maxLeadingPt; i++)
9065 for (Int_t j=0; j<maxAssocPt; j++)
9067 hist = (TH2*) file->Get(Form("dphi_%d_%d_%d", i, j, histId));
9071 Float_t width = 1.5;
9072 TH1* proj = hist->ProjectionY(Form("projx", hist->GetName()), hist->GetXaxis()->FindBin(TMath::Pi() - width), hist->GetXaxis()->FindBin(TMath::Pi()+ width));
9073 proj->Fit("pol0", "0");
9074 //new TCanvas; proj->DrawCopy();
9075 proj->Divide(proj->GetFunction("pol0"));
9076 //new TCanvas; proj->DrawCopy();
9077 //new TCanvas; hist->DrawCopy("SURF1");
9078 for (Int_t x=1; x<=hist->GetNbinsX(); x++)
9079 for (Int_t y=1; y<=hist->GetNbinsY(); y++)
9081 if (proj->GetBinContent(y) <= 0)
9083 hist->SetBinContent(x, y, hist->GetBinContent(x, y) / proj->GetBinContent(y));
9084 hist->SetBinError(x, y, hist->GetBinError(x, y) / proj->GetBinContent(y));
9086 //new TCanvas; hist->DrawCopy("SURF1");
9088 file2 = TFile::Open(outputFile, "UPDATE");
9096 void RemoveWingAllSpecies()
9098 const char* suffix[] = { "Hadrons", "Pions", "Kaons", "Protons" };
9099 TString baseName = "dphi_corr_LHC13bc_20130604_";
9101 for (Int_t i=0; i<4; i++)
9102 RemoveWing(baseName + suffix[i] + ".root", baseName + suffix[i] + "_wingremoved.root");
9105 void PlotPtDistributions(const char* fileName1, Int_t centrBegin = 1, Int_t centrEnd = 2)
9109 Int_t maxLeadingPt = 3;
9110 Float_t leadingPtArr[] = { 1.0, 10.0, 20.0, 40.0 };
9112 Int_t nCentralityBins = 5;
9113 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
9115 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
9117 TCanvas* canvas = new TCanvas("Pt", "Pt", 1000, 1000);
9118 canvas->Divide(2, maxLeadingPt+2);
9120 TLegend* legend = new TLegend(0.2, 0.2, 0.95, 0.90);
9121 legend->SetFillColor(0);
9122 legend->SetTextSize(0.08);
9124 TLegend* legendB = new TLegend(0.2, 0.2, 0.95, 0.90);
9125 legendB->SetFillColor(0);
9126 legendB->SetTextSize(0.08);
9128 TLegend* legend2 = new TLegend(0.2, 0.2, 0.95, 0.90);
9129 legend2->SetFillColor(0);
9130 legend2->SetTextSize(0.08);
9132 Int_t colors[] = { 1, 2, 4, 6 };
9133 Int_t markers[] = { 20, 21, 22, 23, 24, 25 };
9135 for (Int_t i=0; i<maxLeadingPt; i++)
9137 Double_t ptMin = leadingPtArr[i] + 0.01;
9138 //Double_t ptMax = leadingPtArr[i+1] - 0.01;
9139 Double_t ptMax = 39.99;
9142 str.Form("%.1f < p_{T,trig} < %.1f", ptMin - 0.01, ptMax + 0.01);
9144 canvas->cd(2*i+1+2);
9145 gPad->SetLeftMargin(0.15);
9146 gPad->SetBottomMargin(0.2);
9147 gPad->SetTopMargin(0.01);
9148 gPad->SetRightMargin(0.01);
9154 TH2F* dummy = new TH2F("dummy", "", 100, 1, 40, 100, 1e-5, 1e3);
9155 dummy->SetStats(kFALSE);
9156 dummy->SetXTitle("p_{T,assoc}");
9157 dummy->SetYTitle("");
9158 dummy->GetYaxis()->SetTitleOffset(1);
9159 Prepare1DPlot(dummy);
9161 dummy->GetXaxis()->SetLabelSize(0.06);
9162 dummy->GetYaxis()->SetLabelSize(0.06);
9163 dummy->GetXaxis()->SetTitleSize(0.06);
9164 dummy->GetYaxis()->SetTitleSize(0.06);
9167 Float_t phiRange[] = { 0, TMath::Pi() / 2, TMath::Pi() };
9168 const char* phiLabels[] = { "Towards", "Transverse", "Away" };
9170 for (Int_t j=0; j<3; j++)
9172 TH1* centralEta = 0;
9177 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);
9178 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);
9179 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);
9180 sideEta1->Add(sideEta2); // TODO can be done smarter? what about the errors?
9182 Prepare1DPlot(sideEta1);
9183 Prepare1DPlot(centralEta);
9185 centralEta->SetLineColor(colors[j]);
9186 sideEta1->SetLineColor(colors[j+1]);
9190 legend->AddEntry(centralEta->Clone(), Form("Jet, %s: |#eta| < 0.7, #phi ~ %.1f", phiLabels[j], phiRange[j]));
9191 legend->AddEntry(sideEta1->Clone(), Form("Ridge, %s: 0.7 < |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]));
9196 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);
9197 centralEta->Scale(0.5);
9198 centralEta->SetLineColor(colors[j+1]);
9200 Prepare1DPlot(centralEta);
9203 legend->AddEntry(centralEta->Clone(), Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]));
9206 canvas->cd(2*i+1+2);
9207 centralEta->DrawCopy("SAME");
9209 sideEta1->DrawCopy("SAME");
9211 centralEta->SetLineColor(colors[i]);
9212 centralEta->Scale(100.0 / centralEta->Integral());
9215 sideEta1->SetLineColor(colors[i]);
9216 sideEta1->Scale(100.0 / sideEta1->Integral());
9225 gPad->SetLeftMargin(0.15);
9226 gPad->SetBottomMargin(0.2);
9227 gPad->SetTopMargin(0.01);
9228 gPad->SetRightMargin(0.01);
9239 str3.Form("Jet, %s: |#eta| < 0.7, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9241 str3.Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9242 latex = new TLatex(0.2, 0.3, str3);
9244 latex->SetTextSize(0.08);
9249 legend2->AddEntry(centralEta->Clone(), str);
9251 centralEta->DrawCopy("SAME");
9255 canvas->cd(j*4+4+2);
9258 gPad->SetLeftMargin(0.15);
9259 gPad->SetBottomMargin(0.2);
9260 gPad->SetTopMargin(0.01);
9261 gPad->SetRightMargin(0.01);
9272 str3.Form("Ridge, %s: 0.7 < |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9274 str3.Form("%s: |#eta| < 1.4, #phi ~ %.1f", phiLabels[j], phiRange[j]);
9275 latex = new TLatex(0.2, 0.3, str3);
9277 latex->SetTextSize(0.08);
9281 sideEta1->DrawCopy("SAME");
9286 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
9287 latex = new TLatex(0.2, 0.3, str3);
9289 latex->SetTextSize(0.08);
9291 latex2 = new TLatex(0.55, 0.8, str);
9293 latex2->SetTextSize(0.06);
9295 canvas->cd(2*i+1+2);
9309 TH1* GetNonSubtractedRHICYield(Int_t ptT, Int_t ptA, Int_t centrality)
9311 rhicFile = TFile::Open("rhic/postcorr_AuAu_iter6_ppg106final.root");
9313 corrFunc = (TH1*) rhicFile->Get(Form("pi0hdphi_%d_%d_%d_2", ptT, ptA, centrality));
9317 corrFunc->Scale(1.0 / corrFunc->Integral());
9319 corrFunc->Scale(TMath::TwoPi() / corrFunc->GetBinWidth(1));
9321 same = (TH1*) rhicFile->Get(Form("pi0hdphi_%d_%d_%d_0", ptT, ptA, centrality));
9322 Float_t nPairs = same->Integral();
9324 triggers = (TH1*) rhicFile->Get(Form("pi0pt_%d_%d", ptT, centrality));
9325 Float_t nTrigs = triggers->Integral();
9327 graph = (TGraph*) rhicFile->Get(Form("gS_%d_%d", ptT, centrality));
9329 Printf("%f %f %f %f", nPairs, nTrigs, nPairs / nTrigs, graph->GetY()[ptA]);
9331 corrFunc->Scale(nPairs / nTrigs);
9333 //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))));
9338 Float_t regionBegin[3] = { -TMath::Pi() / 2, TMath::Pi() / 2 - 0.4, 1.5 * TMath::Pi() - 0.4 };
9339 Float_t regionEnd[3] = { -TMath::Pi() / 2 + 0.4, TMath::Pi() / 2 + 0.4, 1.5 * TMath::Pi() };
9344 for (Int_t i=0; i<3; i++)
9346 corrFunc->Fit("pol0", "0Q", "", regionBegin[i], regionEnd[i]);
9347 func = corrFunc->GetFunction("pol0");
9350 sum += func->GetParameter(0) / func->GetParError(0) / func->GetParError(0);
9351 weight += 1. / func->GetParError(0) / func->GetParError(0);
9358 weight = TMath::Sqrt(1. / weight);
9360 corrFunc->Add(new TF1("func", "1", -5, 5), -sum);
9366 compHist = (TH1*) rhicFile->Get(Form("ptyMSMP_0_%d%d%d", ptT, ptA, centrality));
9367 compHist->DrawCopy("SAME");
9369 //compHist->Add((TF1*) compHist->GetListOfFunctions()->First());
9370 //compHist->DrawCopy("SAME");
9373 void DeltaPhiVsRHIC(Int_t rhicCentrality = 0, Int_t aliceCentrality = 0, Bool_t reduced = kFALSE)
9375 aliceFile = TFile::Open("alice_dphi_corr_rhicbinning.root");
9376 rhicFile = TFile::Open("rhic/postcorr_AuAu_iter6_ppg106final.root");
9378 Int_t maxLeadingPt = 4;
9379 Int_t maxAssocPt = 5;
9383 Int_t maxSelected = 4;
9384 Int_t selectedLead[] = { 0, 0, 2, 2 };
9385 Int_t selectedAssoc[] = { 1, 2, 3, 4 };
9387 maxLeadingPt = TMath::Sqrt(maxSelected);
9388 maxAssocPt = TMath::Sqrt(maxSelected);
9391 TCanvas* canvas = new TCanvas("DeltaPhi", "DeltaPhi", 1000, 700);
9392 canvas->Divide(maxAssocPt, maxLeadingPt);
9394 for (Int_t i=0; i<maxLeadingPt; i++)
9395 for (Int_t j=0; j<maxAssocPt; j++)
9397 Printf("%d %d", i, j);
9399 canvas->cd(j+1 + i * maxAssocPt);
9400 gPad->SetLeftMargin(0.15);
9401 gPad->SetBottomMargin(0.2);
9402 //gPad->SetTopMargin(0.01);
9403 gPad->SetRightMargin(0.01);
9410 iSel = selectedLead[j + i * maxAssocPt];
9411 jSel = selectedAssoc[j + i * maxAssocPt];
9414 //rhic = (TH1*) rhicFile->Get(Form("VptyMSMP_0_%d%d%d", iSel, jSel, rhicCentrality));
9415 rhic = GetNonSubtractedRHICYield(iSel, jSel, rhicCentrality);
9418 rhic->SetLineColor(2);
9419 rhic->SetMarkerStyle(1);
9421 alice = (TH1*) aliceFile->Get(Form("dphi_%d_%d_%d_fit_flat", iSel, jSel, aliceCentrality));
9425 // match near side yield
9428 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));
9430 Printf("%f", factor);
9431 rhic->Scale(factor);
9434 alice->SetLineColor(1);
9436 //alice->Rebin(36); rhic->Rebin(30);
9438 clone = alice->DrawCopy("");
9439 rhic->DrawCopy("SAME");
9441 //Printf("chi2 test: chi2/ndf = %f", alice->Chi2Test(rhic, "WW CHI2/NDF"));
9444 for (Int_t k=1; k<=rhic->GetNbinsX(); k++)
9446 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));
9451 Printf("chi2 test: chi2/ndf = %f", chi2);
9453 clone->GetYaxis()->SetRangeUser(TMath::Min(alice->GetMinimum(), rhic->GetMinimum()) * 1.1, TMath::Max(alice->GetMaximum(), rhic->GetMaximum()) * 1.1);
9455 for (Int_t bin=1; bin<=rhic->GetNbinsX(); bin++)
9457 Double_t aliceValue = alice->GetBinContent(alice->FindBin(rhic->GetXaxis()->GetBinCenter(bin)));
9458 if (aliceValue == 0)
9460 rhic->SetBinContent(bin, rhic->GetBinContent(bin) / aliceValue);
9461 rhic->SetBinError(bin, 0);
9467 rhic->SetLineColor(3);
9468 //rhic->DrawCopy("SAME");
9473 canvas->SaveAs("yield_comparison.png");
9476 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")
9478 // DeltaPhi("high_stat_binning_pp7_pt8.root", "high_stat_binning_pp7_pythia_pt8.root", 0, 1, 0, "pp 7 TeV uncorrected")
9479 // DeltaPhi("high_stat_binning_pp900_pt8.root", "high_stat_binning_pp900_pythia_pt8.root", 0, 1, 0, "pp 0.9 TeV uncorrected")
9483 aliceFile = TFile::Open(fileName);
9485 secondFile = TFile::Open(fileName2);
9489 Int_t maxLeadingPt = 3;
9490 Int_t maxAssocPt = 3;
9494 Int_t maxLeadingPt = 3;
9495 Int_t maxAssocPt = 7;
9500 Int_t maxSelected = 4;
9501 Int_t selectedLead[] = { 1, 1, 1, 1 };
9502 Int_t selectedAssoc[] = { 2, 3, 4, 5 };
9504 maxLeadingPt = TMath::Sqrt(maxSelected);
9505 maxAssocPt = TMath::Sqrt(maxSelected);
9508 factorGraph = new TGraphErrors;
9510 // TCanvas* canvas = new TCanvas(Form("%s_%s", fileName, fileName2 ? fileName2 : ""), Form("%s_%s", fileName, fileName2 ? fileName2 : ""), 600, 900);
9511 TCanvas* canvas = new TCanvas(Form("%s_%s", fileName, fileName2 ? fileName2 : ""), Form("%s_%s", fileName, fileName2 ? fileName2 : ""), 1000, 1000);
9512 canvas->Divide(maxAssocPt, maxLeadingPt);
9514 for (Int_t i=0; i<maxLeadingPt; i++)
9515 for (Int_t j=0; j<maxAssocPt; j++)
9518 TH1* peripheral = 0;
9519 for (Int_t aliceCentrality=0; aliceCentrality<4; aliceCentrality++)
9521 Printf("%d %d %d", i, j, aliceCentrality);
9523 if (aliceCentrality == 1)
9526 canvas->cd(j+1 + i * maxAssocPt);
9530 Int_t centralitySel = aliceCentrality;
9531 currentFile = aliceFile;
9535 iSel = selectedLead[j + i * maxAssocPt];
9536 jSel = selectedAssoc[j + i * maxAssocPt];
9544 if (aliceCentrality == 1)
9545 currentFile = secondFile;
9546 else if (aliceCentrality == 2)
9550 if (aliceCentrality == 3)
9551 currentFile = secondFile;
9554 //alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", iSel, jSel, centralitySel, (centralitySel < 3) ? "_tsallis_flat" : ((flatOrTsallis) ? "" : "_fit_flat")));
9555 alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", iSel, jSel, centralitySel, histName));
9561 Printf("WARNING: Applying some scaling and rebinning! Only for 2.76 data-MC comparison!");
9562 if (aliceCentrality == 0)
9564 alice->Rebin(2); alice->Scale(0.5);
9565 alice->Scale(1.0 / 1.6);
9568 // alice->Scale(1.6);
9571 alice->Rebin(2); alice->Scale(0.5);
9572 // alice->Scale(1.0 / 1.6);
9574 // match near side yield to peripheral
9575 if (1 && centralitySel == 3 && peripheral)
9577 if (mode == 0 || mode == 1)
9579 Double_t width = 0.5;
9580 Double_t error1, error2;
9581 Double_t integral1 = peripheral->IntegralAndError(peripheral->FindBin(-width), peripheral->FindBin(width), error1);
9582 Double_t integral2 = alice->IntegralAndError(alice->FindBin(-width), alice->FindBin(width), error2);
9585 Double_t tmpErr = 0;
9586 integral1 += peripheral->IntegralAndError(peripheral->FindBin(TMath::Pi() - width), peripheral->FindBin(TMath::Pi() + width), tmpErr);
9587 error1 = TMath::Sqrt(error1 * error1 + tmpErr * tmpErr);
9589 integral2 += alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), tmpErr);
9590 error2 = TMath::Sqrt(error2 * error2 + tmpErr * tmpErr);
9595 Double_t error1, error2;
9596 Double_t integral1 = peripheral->IntegralAndError(1, peripheral->GetNbinsX(), error1);
9597 Double_t integral2 = alice->IntegralAndError(1, alice->GetNbinsX(), error2);
9601 Double_t width = 1.0;
9602 Double_t error1, error2;
9603 Double_t integral1 = peripheral->IntegralAndError(peripheral->FindBin(TMath::Pi() - width), peripheral->FindBin(TMath::Pi() + width), error1);
9604 Double_t integral2 = alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), error2);
9607 Double_t factor = integral1 / integral2;
9609 //factor = 0.804 * 0.9;
9610 Printf("%f", factor);
9611 // alice->Scale(factor);
9612 factorGraph->SetPoint(factorGraph->GetN(), factorGraph->GetN(), factor);
9613 factorGraph->SetPointError(factorGraph->GetN() - 1, 0, factor * TMath::Sqrt(TMath::Power(error1 / integral1, 2) + TMath::Power(error2 / integral2, 2)));
9616 if (ppComparison && aliceCentrality == 0)
9618 else if (aliceCentrality == 2)
9621 // alice->SetYTitle("1/(N_{trig} #Delta#eta) dN_{assoc}/d#Delta#phi (1/rad)");
9622 alice->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi (1/rad)");
9623 alice->SetXTitle("#Delta#phi (rad)");
9624 alice->SetLineColor(aliceCentrality+1);
9625 alice->SetLineWidth(2);
9626 alice->SetMarkerColor(aliceCentrality+1);
9627 alice->GetYaxis()->SetTitleOffset(1.7);
9628 clone = alice->DrawCopy((aliceCentrality > 0) ? "SAME" : "");
9629 clone->SetTitle("");
9631 TString str(alice->GetTitle());
9632 str.ReplaceAll(" - ", "#");
9633 tokens = str.Tokenize("#");
9635 if (aliceCentrality == 0)
9637 for (Int_t k=0; k<2; k++)
9639 TString str(tokens->At(k)->GetName());
9640 str.ReplaceAll(".0", "");
9641 str.ReplaceAll("< p", "GeV/c < p");
9643 latex = new TLatex(0.48, 0.92-k*0.06, str);
9645 latex->SetTextSize(0.04);
9654 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), clone->GetMinimum()), TMath::Max(first->GetMaximum(), clone->GetMaximum()));
9661 //first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.2);
9662 first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.5);
9667 for (Int_t i=1; i<=6; i++)
9671 latex = new TLatex(0.58, 0.8, "ALICE preliminary");
9672 latex->SetTextSize(0.04);
9676 latex = new TLatex(0.58, 0.74, Form("%s", dataTag));
9677 latex->SetTextSize(0.04);
9681 latex = new TLatex(0.58, 0.68, "Stat. uncertainties only");
9682 latex->SetTextSize(0.04);
9686 latex = new TLatex(0.58, 0.62, "|#eta| < 0.8");
9687 latex->SetTextSize(0.04);
9693 legend = new TLegend(0.3, 0.8, 0.47, 0.95);
9694 legend->SetFillColor(0);
9695 legend->SetTextSize(0.04);
9696 legend->AddEntry(peripheral, "Data");
9697 legend->AddEntry(alice, "Pythia");
9701 DrawALICELogo(0.75, 0.47, 0.95, 0.6);
9705 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
9706 canvas->SaveAs(Form("%s.png", canvas->GetName()));
9709 peripheral->Divide(alice);
9710 peripheral->DrawCopy();
9711 //alice->DrawCopy("SAME");
9714 graphCanvas = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("graphCanvas");
9715 factorGraph->SetMarkerStyle(20);
9718 graphCanvas = new TCanvas("graphCanvas", "graphCanvas", 800, 600);
9719 factorGraph->Draw("AP");
9724 factorGraph->SetLineColor(2);
9725 factorGraph->SetMarkerColor(2);
9726 factorGraph->Draw("SAMEP");
9728 factorGraph->GetYaxis()->SetRangeUser(0.6, 1.4);
9730 factorGraph->Print();
9733 void ComparePPYields(const char* histName = "_fit_flat")
9735 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" };
9736 const char* titles[] = { "0.9 data", "0.9 Pythia", "2.76 Pythia", "7 Pythia", "7 data" };
9738 Int_t colors[] = { 1, 2, 3, 4, 6 };
9740 Int_t maxLeadingPt = 3;
9741 Int_t maxAssocPt = 2;
9743 TCanvas* canvas = new TCanvas("ComparePPYields", "ComparePPYields", 600, 900);
9744 canvas->Divide(maxAssocPt, maxLeadingPt);
9746 legend = new TLegend(0.5, 0.5, 0.8, 0.8);
9747 legend->SetFillColor(0);
9749 TGraphErrors** graphs = new TGraphErrors*[5];
9750 TGraphErrors** graphs2 = new TGraphErrors*[5];
9752 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
9754 graphs[nFiles] = new TGraphErrors;
9755 graphs2[nFiles] = new TGraphErrors;
9758 for (Int_t i=0; i<maxLeadingPt; i++)
9759 for (Int_t j=0; j<maxAssocPt; j++)
9761 canvas->cd(j+1 + i * maxAssocPt);
9762 gPad->SetLeftMargin(0.18);
9763 gPad->SetBottomMargin(0.1);
9764 gPad->SetTopMargin(0.01);
9765 gPad->SetRightMargin(0.01);
9769 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
9771 currentFile = TFile::Open(files[nFiles]);
9773 Int_t aliceCentrality = 3;
9775 Printf("%d %d %d", i, j, nFiles);
9777 alice = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, histName));
9781 alice->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
9782 alice->SetLineColor(colors[nFiles]);
9783 alice->SetMarkerColor(colors[nFiles]);
9784 alice->GetYaxis()->SetTitleOffset(1.7);
9785 clone = alice->DrawCopy((nFiles > 0) ? "SAME" : "");
9786 clone->SetTitle("");
9788 Double_t width = 0.7;
9789 Double_t error, error2;
9790 Double_t integral = alice->IntegralAndError(alice->FindBin(-width), alice->FindBin(width), error);
9791 Double_t integral2 = alice->IntegralAndError(alice->FindBin(TMath::Pi() - width), alice->FindBin(TMath::Pi() + width), error2);
9793 graphs[nFiles]->SetPoint(graphs[nFiles]->GetN(), j + i * maxAssocPt - 0.2, integral);
9794 graphs[nFiles]->SetPointError(graphs[nFiles]->GetN()-1, 0, error);
9796 graphs2[nFiles]->SetPoint(graphs2[nFiles]->GetN(), j + i * maxAssocPt + 0.2, integral2);
9797 graphs2[nFiles]->SetPointError(graphs2[nFiles]->GetN()-1, 0, error2);
9802 first->GetYaxis()->SetRangeUser(TMath::Min(first->GetMinimum(), clone->GetMinimum()), TMath::Max(first->GetMaximum(), clone->GetMaximum()));
9806 TString str(alice->GetTitle());
9807 str.ReplaceAll(" - ", "#");
9808 tokens = str.Tokenize("#");
9810 for (Int_t k=0; k<2; k++)
9812 latex = new TLatex(0.6, 0.88-k*0.07, tokens->At(k)->GetName());
9814 latex->SetTextSize(0.04);
9819 if (i == 0 && j == 0)
9820 legend->AddEntry(clone, titles[nFiles]);
9823 first->GetYaxis()->SetRangeUser(first->GetMinimum(), first->GetMaximum() * 1.1);
9831 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
9833 graphs[nFiles]->SetMarkerStyle(25);
9834 graphs[nFiles]->SetLineColor(colors[nFiles]);
9835 graphs[nFiles]->SetMarkerColor(colors[nFiles]);
9836 clone2 = (TGraphErrors*) graphs[nFiles]->DrawClone((nFiles == 0) ? "AP" : "PSAME");
9837 clone2->GetYaxis()->SetRangeUser(0, 5);
9839 graphs2[nFiles]->SetMarkerStyle(26);
9840 graphs2[nFiles]->SetLineColor(colors[nFiles]);
9841 graphs2[nFiles]->SetMarkerColor(colors[nFiles]);
9842 graphs2[nFiles]->DrawClone("PSAME");
9846 for (Int_t nFiles = 0; nFiles < 5; nFiles++)
9848 DivideGraphs(graphs[nFiles], graphs[4]);
9849 DivideGraphs(graphs2[nFiles], graphs2[4]);
9851 graphs[nFiles]->SetMarkerStyle(25);
9852 graphs[nFiles]->SetLineColor(colors[nFiles]);
9853 graphs[nFiles]->SetMarkerColor(colors[nFiles]);
9854 clone2 = (TGraphErrors*) graphs[nFiles]->DrawClone((nFiles == 0) ? "AP" : "PSAME");
9855 clone2->GetYaxis()->SetRangeUser(0, 1.5);
9857 graphs2[nFiles]->SetMarkerStyle(26);
9858 graphs2[nFiles]->SetLineColor(colors[nFiles]);
9859 graphs2[nFiles]->SetMarkerColor(colors[nFiles]);
9860 graphs2[nFiles]->DrawClone("PSAME");
9864 void DeltaPhiPreliminary(const char* fileName, const char* histName)
9868 currentFile = TFile::Open(fileName);
9870 TCanvas* canvas = new TCanvas(Form("dphi%s", histName), "dphi", 800, 800);
9871 canvas->Divide(2, 2);
9873 TLegend* legend = new TLegend(0.55, 0.47, 0.85, 0.65);
9874 legend->SetFillColor(0);
9875 legend->SetTextSize(0.04);
9877 Int_t colors[] = { 1, 2, 4, 6 };
9880 for (Int_t i=1; i<2; i++)
9881 for (Int_t j=2; j<6; j++)
9885 for (Int_t aliceCentrality=0; aliceCentrality<3; aliceCentrality+=2)
9887 Printf("%d %d %d", i, j, aliceCentrality);
9889 hist = (TH1*) currentFile->Get(Form("dphi_%d_%d_%d%s", i, j, aliceCentrality, histName));
9893 if (aliceCentrality == 3)
9894 hist->Scale(kPythiaScalingFactor);
9896 hist->GetYaxis()->SetTitleOffset(1.9);
9897 hist->SetLineColor(colors[aliceCentrality]);
9898 hist->SetMarkerColor(colors[aliceCentrality]);
9899 hist->SetLineWidth(2);
9900 hist->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
9901 hist->SetXTitle("#Delta#phi (rad)");
9903 clone = hist->DrawCopy((aliceCentrality > 0) ? "SAME" : "");
9904 clone->SetTitle("");
9906 TString str(hist->GetTitle());
9907 str.ReplaceAll(" - ", "#");
9908 tokens = str.Tokenize("#");
9911 if (aliceCentrality == 0)
9913 for (Int_t k=0; k<2; k++)
9915 TString str(tokens->At(k)->GetName());
9916 str.ReplaceAll(".0", "");
9917 str.ReplaceAll("< p", "GeV/c < p");
9920 latex = new TLatex(0.5, 0.88-k*0.06, str);
9922 latex->SetTextSize(0.04);
9926 latex = new TLatex(0.5, 0.76, "ALICE preliminary");
9927 latex->SetTextSize(0.04);
9931 latex = new TLatex(0.5, 0.70, "Stat. uncertainties only");
9932 latex->SetTextSize(0.04);
9936 clone->GetYaxis()->SetRangeUser(0, clone->GetMaximum() * 1.2);
9941 if (aliceCentrality == 3)
9942 legend->AddEntry(hist, "Pythia");
9944 legend->AddEntry(hist, tokens->At(2)->GetName());
9954 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
9955 canvas->SaveAs(Form("%s.png", canvas->GetName()));
9958 void DeltaPhiBaseLinePreliminary(const char* fileName)
9964 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
9965 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
9966 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
9972 gpTMin = assocPtArr[j] + 0.01;
9973 gpTMax = assocPtArr[j+1] - 0.01;
9977 str.Form("%.0f GeV/c < p_{T,trig} < %.0f GeV/c", leadingPtArr[i], leadingPtArr[i+2]);
9980 str2.Form("%.0f GeV/c < p_{T,assoc} < %.0f GeV/c", gpTMin - 0.01, gpTMax + 0.01);
9986 GetDistAndFlow(h, 0, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
9987 GetDistAndFlow(h, 0, &hist2b, v2+2, step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
9989 hist1->SetLineWidth(2);
9990 hist2b->SetLineWidth(2);
9992 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 1200, 1200);
9993 canvas->Divide(2, 2);
9996 // gPad->SetLeftMargin(0.20);
9998 hist1->GetYaxis()->SetTitleOffset(1.9);
9999 hist1->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
10000 hist1->SetXTitle("#Delta#phi (rad)");
10001 hist1->SetTitle("");
10002 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0, 0.59);
10004 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);
10006 latex = new TLatex(0.5, 0.78, "0-5%");
10008 latex->SetTextSize(0.04);
10014 // gPad->SetLeftMargin(0.20);
10016 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.18, 0.295);
10017 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10022 // gPad->SetLeftMargin(0.20);
10024 hist2b->GetYaxis()->SetTitleOffset(1.9);
10025 hist2b->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
10026 hist2b->SetXTitle("#Delta#phi (rad)");
10027 hist2b->SetTitle("");
10028 hist2b->DrawCopy();
10030 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);
10032 latex = new TLatex(0.5, 0.78, "60-90%");
10034 latex->SetTextSize(0.04);
10038 // gPad->SetLeftMargin(0.20);
10040 hist2b->DrawCopy()->GetYaxis()->SetRangeUser(0.01, 0.13);
10041 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10046 for (Int_t i=1; i<=4; i++)
10050 latex = new TLatex(0.5, 0.84, str);
10052 latex->SetTextSize(0.04);
10055 latex = new TLatex(0.5, 0.90, str2);
10057 latex->SetTextSize(0.04);
10060 latex = new TLatex(0.5, 0.72, "ALICE preliminary");
10061 latex->SetTextSize(0.04);
10065 latex = new TLatex(0.5, 0.66, "Stat. uncertainties only");
10066 latex->SetTextSize(0.04);
10071 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10072 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10076 void DeltaPhiBaseLinePaperPlot(const char* fileName, const char* yieldFile)
10080 Float_t fontSize = 0.08;
10081 Float_t titleOffset = 0.85;
10083 gStyle->SetTextSize(fontSize);
10084 gStyle->SetLabelSize(fontSize, "xy");
10085 gStyle->SetTitleSize(fontSize, "xy");
10086 gStyle->SetTitleOffset(titleOffset, "y");
10087 gStyle->SetHistLineWidth(2);
10088 gROOT->ForceStyle();
10092 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
10093 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
10094 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
10100 gpTMin = assocPtArr[j] + 0.01;
10101 gpTMax = assocPtArr[j+1] - 0.01;
10105 str.Form("%.0f GeV/#font[12]{c} < p_{t,trig} < %.0f GeV/#font[12]{c}", leadingPtArr[i], leadingPtArr[i+2]);
10108 str2.Form("%.0f GeV/#font[12]{c} < p_{t,assoc} < %.0f GeV/#font[12]{c}", gpTMin - 0.01, gpTMax + 0.01);
10114 GetDistAndFlow(h, 0, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10116 hist1->SetLineWidth(2);
10118 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 600, 840);
10119 canvas->Range(0, 0, 1, 1);
10121 pad1 = new TPad("pad1", "pad1", 0, 0.69, 1, 1);
10124 pad2 = new TPad("pad2", "pad2", 0, 0.38, 1, 0.69);
10127 pad3 = new TPad("pad3", "pad3", 0, 0 , 1, 0.38);
10131 gPad->SetMargin(0.15, 0.02, 0, 0.01);
10133 // hist1->GetYaxis()->SetTitleOffset(0.85);
10134 hist1->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#varphi");
10135 hist1->SetXTitle("#Delta#varphi (rad)");
10136 hist1->SetTitle("");
10138 hist1->SetLabelSize(fontSize * 0.38 / 0.31, "xy");
10139 hist1->SetTitleSize(fontSize * 0.38 / 0.31, "xy");
10140 hist1->SetTitleOffset(titleOffset / 0.38 * 0.31, "y");
10142 hist1->DrawCopy(); //->GetYaxis()->SetRangeUser(0, 0.59);
10144 //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 gPad->SetMargin(0.15, 0.02, 0, 0);
10149 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.381, 0.457);
10150 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10153 gPad->SetMargin(0.15, 0.02, 0.2, 0);
10155 // get zero subtracted plots
10156 TFile::Open(yieldFile);
10157 hist1sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 0));
10158 hist1sub->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#varphi");
10159 hist1sub->SetXTitle("#Delta#varphi (rad)");
10160 hist1sub->SetTitle("");
10161 hist1sub->DrawCopy();
10163 hist2sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 2));
10164 hist2sub->SetMarkerStyle(24);
10165 hist2sub->SetLineColor(2);
10166 hist2sub->SetMarkerColor(2);
10167 // hist2sub->SetMarkerSize(0.8);
10168 hist2sub->DrawCopy("SAMEP E X0");
10170 hist3sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 3));
10171 hist3sub->SetMarkerStyle(25);
10172 hist3sub->SetLineColor(4);
10173 hist3sub->SetMarkerColor(4);
10174 // hist3sub->SetMarkerSize(0.8);
10175 hist3sub->DrawCopy("SAMEP E X0");
10177 legend = new TLegend(0.4, 0.55, 0.9, 0.9);
10178 legend->SetFillColor(0);
10179 legend->SetBorderSize(0);
10180 legend->SetTextSize(0.08);
10181 legend->AddEntry(hist1sub, "Pb-Pb 0-5% centrality", "L");
10182 legend->AddEntry(hist2sub, "Pb-Pb 60-90% centrality", "P");
10183 legend->AddEntry(hist3sub, "pp", "P");
10188 latex = new TLatex(0.47, 0.85, str);
10189 latex->SetTextSize(fontSize * 0.38 / 0.31);
10193 latex = new TLatex(0.47, 0.73, str2);
10194 latex->SetTextSize(fontSize * 0.38 / 0.31);
10198 latex = new TLatex(0.5, 0.42, "0-5% centrality");
10202 latex = new TLatex(0.45, 0.62, "Stat. uncertainties only");
10206 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10207 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10211 void DeltaPhiBaseLinePaperPlot(const char* fileName, const char* yieldFile)
10215 Float_t fontSize = 0.08;
10216 Float_t titleOffset = 0.85;
10218 gStyle->SetTextSize(fontSize);
10219 gStyle->SetLabelSize(fontSize, "xy");
10220 gStyle->SetTitleSize(fontSize, "xy");
10221 gStyle->SetTitleOffset(titleOffset, "y");
10222 gStyle->SetHistLineWidth(2);
10223 gROOT->ForceStyle();
10227 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
10228 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
10229 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
10235 gpTMin = assocPtArr[j] + 0.01;
10236 gpTMax = assocPtArr[j+1] - 0.01;
10240 str.Form("%.0f < #font[12]{p}_{T,trig} < %.0f GeV/#font[12]{c}", leadingPtArr[i], leadingPtArr[i+2]);
10243 str2.Form("%.0f < #font[12]{p}_{T,assoc} < %.0f GeV/#font[12]{c}", gpTMin - 0.01, gpTMax + 0.01);
10249 GetDistAndFlow(h, 0, &hist1, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10251 hist1->SetLineWidth(2);
10253 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 600, 840);
10254 canvas->Range(0, 0, 1, 1);
10256 pad1 = new TPad("pad1", "pad1", 0, 0.69, 1, 1);
10259 pad2 = new TPad("pad2", "pad2", 0, 0.38, 1, 0.69);
10262 pad3 = new TPad("pad3", "pad3", 0, 0 , 1, 0.38);
10266 gPad->SetMargin(0.15, 0.02, 0, 0.01);
10268 // hist1->GetYaxis()->SetTitleOffset(0.85);
10269 hist1->SetYTitle("");
10270 hist1->SetXTitle("#Delta#font[12]{#varphi} (rad)");
10271 hist1->SetTitle("");
10273 hist1->SetLabelSize(fontSize * 0.38 / 0.31, "xy");
10274 hist1->SetTitleSize(fontSize * 0.38 / 0.31, "xy");
10275 hist1->SetTitleOffset(titleOffset / 0.38 * 0.31, "y");
10277 hist1->DrawCopy("HISTE"); //->GetYaxis()->SetRangeUser(0, 0.59);
10279 //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);
10282 gPad->SetMargin(0.15, 0.02, 0, 0);
10284 hist1->SetYTitle("1/#font[12]{N}_{trig} d#font[12]{N}_{assoc}/d#Delta#font[12]{#varphi} (rad^{-1})");
10285 hist1->DrawCopy("HISTE")->GetYaxis()->SetRangeUser(0.381, 0.457);
10286 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10289 gPad->SetMargin(0.15, 0.02, 0.2, 0);
10291 // get zero subtracted plots
10292 TFile::Open(yieldFile);
10294 hist1sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 0));
10295 hist1sub->SetYTitle("");
10296 hist1sub->SetXTitle("#Delta#varphi (rad)");
10297 hist1sub->SetTitle("");
10298 // hist1sub->SetMarkerStyle(25);
10299 // hist1sub->SetLineColor(4);
10300 // hist1sub->SetMarkerColor(4);
10301 hist1sub->SetMaximum(0.79);
10302 hist1sub->DrawCopy("HIST E");
10304 hist3sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 3));
10305 // hist3sub->SetFillColor(4);
10306 // hist3sub->SetFillStyle(3354);
10307 // hist3sub->SetLineWidth(0);
10308 // hist3sub->SetLineColor(0);
10309 hist3sub->SetMarkerStyle(25);
10310 hist3sub->SetLineColor(4);
10311 hist3sub->SetMarkerColor(4);
10312 hist3sub->DrawCopy("SAME E X0");
10314 hist1sub->DrawCopy("SAME HIST E");
10316 hist2sub = (TH1*) gFile->Get(Form("dphi_%d_%d_%d_fit_flat", i, j, 2));
10317 hist2sub->SetMarkerStyle(24);
10318 hist2sub->SetLineColor(2);
10319 hist2sub->SetMarkerColor(2);
10320 hist2sub->DrawCopy("SAMEP E X0");
10322 legend = new TLegend(0.4, 0.45, 0.9, 0.8);
10323 legend->SetFillColor(0);
10324 legend->SetBorderSize(0);
10325 legend->SetTextSize(fontSize);
10326 legend->AddEntry(hist1sub, "Pb-Pb 0-5% centrality", "L");
10327 legend->AddEntry(hist2sub, "Pb-Pb 60-90% centrality", "P");
10328 legend->AddEntry(hist3sub, "pp", "P");
10333 latex = new TLatex(0.59, 0.70, str);
10334 latex->SetTextSize(fontSize * 0.38 / 0.31);
10338 latex = new TLatex(0.59, 0.58, str2);
10339 latex->SetTextSize(fontSize * 0.38 / 0.31);
10343 latex = new TLatex(0.59, 0.46, "#sqrt{#font[12]{s}_{NN}} = 2.76 TeV");
10344 latex->SetTextSize(fontSize * 0.38 / 0.31);
10348 latex = new TLatex(0.43, 0.90, "a) not background subtracted");
10349 latex->SetTextSize(fontSize * 0.38 / 0.31);
10353 latex = new TLatex(0.5, 0.42, "0-5% centrality");
10357 latex = new TLatex(0.45, 0.62, "Stat. uncertainties only");
10363 latex = new TLatex(0.43, 0.90, "b) zoomed");
10364 latex->SetTextSize(fontSize * 0.38 / 0.31);
10370 latex = new TLatex(0.43, 0.90, "c) background subtracted");
10375 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10376 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10380 void DeltaPhiRidgePreliminary(const char* fileName)
10386 Float_t leadingPtArr[] = { 2.0, 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
10387 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
10388 // Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
10389 // Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
10390 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE);
10391 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
10399 gpTMin = assocPtArr[j] + 0.01;
10400 gpTMax = assocPtArr[j+1] - 0.01;
10402 SetupRanges(hMixed);
10405 str.Form("%.1f < p_{T,trig} < %.1f", leadingPtArr[i], leadingPtArr[i+2]);
10408 str2.Form("%.1f < p_{T,assoc} < %.1f", gpTMin - 0.01, gpTMax + 0.01);
10413 TH1* hist1Peak = 0;
10414 TH1* hist2bPeak = 0;
10415 TH1* hist1Ridge = 0;
10416 TH1* hist2bRidge = 0;
10419 TH1* hist2dMixed = 0;
10421 // GetDistAndFlow(h, 0, &hist2d, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 1);
10422 // GetDistAndFlow(hMixed, 0, &hist2dMixed, v2, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 1);
10424 // //hist2d->Divide(hist2dMixed);
10425 // hist2dMixed->Draw("SURF1");
10427 GetDistAndFlow(h, hMixed, &hist1, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10428 // GetDistAndFlow(h, 0, &hist2b, v2[2], step, 60, 90, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01);
10429 GetDistAndFlow(h, hMixed, &hist1Peak, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 10);
10431 GetDistAndFlow(h, hMixed, &hist1Ridge, 0, step, 0, 5, leadingPtArr[i] + 0.01, leadingPtArr[i+2] - 0.01, 11);
10435 canvas = new TCanvas("dphi_baseline", "dphi_baseline", 800, 800);
10436 canvas->Divide(2, 2);
10439 gPad->SetLeftMargin(0.20);
10441 hist1->GetYaxis()->SetTitleOffset(1.9);
10442 hist1->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
10443 hist1->SetTitle("");
10446 hist1Peak->SetLineColor(2);
10447 hist1Peak->DrawCopy("SAME");
10449 hist1Ridge->SetLineColor(4);
10450 hist1Ridge->DrawCopy("SAME");
10452 // hist1Peak->Add(hist1Ridge);
10453 // hist1Peak->DrawCopy("SAME")->SetLineColor(3);
10457 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);
10459 latex = new TLatex(0.65, 0.84, str);
10461 latex->SetTextSize(0.04);
10464 latex = new TLatex(0.65, 0.90, str2);
10466 latex->SetTextSize(0.04);
10469 latex = new TLatex(0.84, 0.78, "0-5%");
10471 latex->SetTextSize(0.04);
10475 gPad->SetLeftMargin(0.20);
10477 hist1->DrawCopy()->GetYaxis()->SetRangeUser(0.18, 0.28);
10478 DrawFlow(v2[0], hist1, leadingPtArr[i], assocPtArr[j], 0, i, 0, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10482 latex = new TLatex(0.5, 0.90, "ALICE preliminary");
10483 latex->SetTextSize(0.04);
10487 latex = new TLatex(0.5, 0.84, "Statistical uncertainties only");
10488 latex->SetTextSize(0.04);
10493 gPad->SetLeftMargin(0.20);
10495 hist2b->GetYaxis()->SetTitleOffset(1.9);
10496 hist2b->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
10497 hist2b->SetTitle("");
10498 hist2b->DrawCopy();
10500 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);
10502 latex = new TLatex(0.84, 0.78, "60-90%");
10504 latex->SetTextSize(0.04);
10508 gPad->SetLeftMargin(0.20);
10510 hist2b->DrawCopy()->GetYaxis()->SetRangeUser(0.01, 0.1);
10511 DrawFlow(v2[2], hist2b, leadingPtArr[i], assocPtArr[j], 0, i, 2, 0, (assocPtArr[j] + assocPtArr[j+1]) / 2, (assocPtArr[j+1] - assocPtArr[j]) / 2);
10515 canvas->SaveAs(Form("%s.eps", canvas->GetName()));
10516 canvas->SaveAs(Form("%s.png", canvas->GetName()));
10519 void MCScalingFactor(Int_t caseId)
10522 // x[5]=5, y[5]=0.813743, ex[5]=0, ey[5]=0.158446
10523 // x[5]=5, y[5]=1.09804, ex[5]=0, ey[5]=0.265434
10525 // x[5]=5, y[5]=1.02276, ex[5]=0, ey[5]=0.0199991
10526 // x[5]=5, y[5]=0.870247, ex[5]=0, ey[5]=0.0294444
10528 Float_t factors[] = { 0.814, 1.098, 1.022, 0.870 };
10529 Float_t errors[] = { 0.158, 0.265, 0.020, 0.029 };
10533 for (Int_t i=0; i<2; i++)
10538 avgs[i] = factors[2*i] / errors[2*i] / errors[2*i] + factors[2*i+1] / errors[2*i+1] / errors[2*i+1];
10539 avgs[i] /= 1. / errors[2*i] / errors[2*i] + 1. / errors[2*i+1] / errors[2*i+1];
10543 avgs[i] = factors[2*i];
10547 avgs[i] = factors[2*i+1];
10551 avgs[0] = factors[0];
10552 avgs[1] = factors[3];
10556 avgs[0] = factors[1];
10557 avgs[1] = factors[2];
10562 Float_t a = avgs[0];
10563 Float_t b = avgs[1];
10565 Printf("%f %f", a, b);
10567 Float_t linEx = a + (b-a)/(7.-0.9) * (2.76-0.9);
10568 Float_t logEx = a + (b-a)/(log(7.)-log(0.9)) * (log(2.76)-log(0.9));
10570 Printf("%f %f", linEx, logEx);
10573 void CompareDeltaPhi(const char* fileName1, const char* fileName2, Int_t centralityID, const char* dist = "_fit_flat", Bool_t reduced = kFALSE)
10575 firstFile = TFile::Open(fileName1);
10576 secondFile = TFile::Open(fileName2);
10578 Int_t maxLeadingPt = 2;
10579 Int_t maxAssocPt = 7;
10580 Int_t minLeadingPt = 0;
10581 Int_t minAssocPt = 0;
10591 TCanvas* canvas = new TCanvas(Form("%s %s", fileName1, fileName2 ? fileName2 : ""), Form("%s %s", fileName1, fileName2 ? fileName2 : ""), 1000, 700);
10592 canvas->Divide(maxAssocPt-minAssocPt, maxLeadingPt-minLeadingPt);
10594 for (Int_t i=minLeadingPt; i<maxLeadingPt; i++)
10595 for (Int_t j=minAssocPt; j<maxAssocPt; j++)
10597 Printf("%d %d", i, j);
10599 canvas->cd(j+1-minAssocPt + (i-minLeadingPt) * maxAssocPt);
10600 gPad->SetLeftMargin(0.15);
10601 gPad->SetBottomMargin(0.2);
10602 //gPad->SetTopMargin(0.01);
10603 gPad->SetRightMargin(0.01);
10605 hist1 = (TH1*) firstFile->Get(Form("dphi_%d_%d_%d%s", i, j, centralityID, dist));
10606 hist2 = (TH1*) secondFile->Get(Form("dphi_%d_%d_%d%s", i, j, centralityID, dist));
10611 /* hist1->Rebin(2); hist1->Scale(0.5);
10612 hist2->Rebin(2); hist2->Scale(0.5); */
10613 // hist1->Scale(1.6);
10615 hist1->SetLineColor(1);
10616 hist2->SetLineColor(2);
10618 hist1->DrawCopy()->GetYaxis()->SetRangeUser(hist1->GetMinimum(), hist1->GetMaximum() * 1.2);
10619 hist2->DrawCopy("SAME");
10621 /* if (strlen(dist) == 0)
10622 Printf("chi2 test: %f", hist1->Chi2Test(hist2, "UU NORM CHI2/NDF"));*/
10624 //DrawRatio(hist1, hist2, hist1->GetTitle());
10630 TH1* MACHCone(const char* fileName, Int_t centrality, const char* drawingOption, Bool_t plotContributions, Int_t twoD, TF1** flowFuncP = 0)
10634 TFile::Open("machcone_input.root");
10636 switch (centrality)
10639 hist = (TH1*) gFile->Get("dphi_0_0_0");
10643 hist = (TH1*) gFile->Get("dphi_1_1_0");
10647 hist = (TH1*) gFile->Get("dphi_0_0_2");
10651 hist = (TH1*) gFile->Get("dphi_1_1_2");
10659 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
10660 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
10662 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
10663 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
10664 // Float_t assocPtArr[] = { 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
10666 Int_t i = centrality % 2;
10671 gpTMin = assocPtArr[i] + 0.01;
10672 gpTMax = assocPtArr[i+1] - 0.01;
10674 Int_t centralityBegin = 0;
10675 Int_t centralityEnd = 1;
10677 if (centrality >= 2)
10679 centralityBegin = 30;
10680 centralityEnd = 40;
10684 SetupRanges(hMixed);
10694 Bool_t scaleToPairs = 0;
10696 GetDistAndFlow(h, hMixed, &hist, 0, step, centralityBegin, centralityEnd, leadingPtArr[j] + 0.01, leadingPtArr[j+1] - 0.01, twoD, kTRUE, vn, scaleToPairs);
10697 if (scaleToPairs && twoD == 11)
10700 Printf("%f %f %f", vn[2], vn[3], vn[4]);
10702 // mirror delta phi to improve stats
10705 for (Int_t bin=1; bin<=hist->GetNbinsX(); bin++)
10707 if (hist->GetBinCenter(bin) < 0 || hist->GetBinCenter(bin) > TMath::Pi())
10709 if (hist->GetBinCenter(bin) < 0)
10710 Int_t bin2 = hist->FindBin(-1.0 * hist->GetBinCenter(bin));
10712 Int_t bin2 = hist->FindBin(TMath::TwoPi() - hist->GetBinCenter(bin));
10714 Float_t combValue = hist->GetBinContent(bin) / hist->GetBinError(bin) / hist->GetBinError(bin) + hist->GetBinContent(bin2) / hist->GetBinError(bin2) / hist->GetBinError(bin2);
10716 Float_t weight = 1. / hist->GetBinError(bin) / hist->GetBinError(bin) + 1. / hist->GetBinError(bin2) / hist->GetBinError(bin2);
10717 combValue /= weight;
10719 Float_t combError = TMath::Sqrt(1.0 / weight);
10721 hist->SetBinContent(bin2, combValue);
10722 hist->SetBinError(bin2, combError);
10724 hist->SetBinContent(bin, combValue);
10725 hist->SetBinError(bin, combError);
10727 Printf("%d %d %f %f", bin, bin2, combValue, combError);
10733 TString str(hist->GetTitle());
10734 str.ReplaceAll(" - ", "#");
10735 tokens = str.Tokenize("#");
10736 hist->SetTitle("");
10738 hist->SetLineColor(1);
10739 hist->SetYTitle("1/N_{trig} dN_{assoc}/d#Delta#phi");
10740 hist->SetXTitle("#Delta#phi (rad)");
10741 hist = (TH1*) hist->Clone();
10742 if (!drawingOption)
10745 hist = hist->DrawCopy(drawingOption);
10747 for (Int_t i=0; i<tokens->GetEntries()-1; i++)
10749 if (centrality == 1)
10750 latex = new TLatex(0.6, 0.9 - i*0.05 - gPad->GetTopMargin(), tokens->At(i)->GetName());
10752 latex = new TLatex(0.6, 0.12 - i*0.05, tokens->At(i)->GetName());
10755 latex->SetTextSize(0.04);
10759 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());
10760 //flowFunc->SetLineWidth(1);
10761 flowFunc->SetLineColor(2);
10762 flowFunc->SetLineStyle(2);
10763 for (Int_t i=0; i<4; i++)
10764 flowFunc->FixParameter(i+1, vn[i+1]);
10765 //flowFunc->SetParameter(0, 84.95); flowFunc->DrawClone("SAME");
10767 //flowFunc->SetParameter(0, 85.4); flowFunc->DrawClone("SAME");
10768 //flowFunc->SetParameter(0, 85.6); flowFunc->DrawClone("SAME");
10770 // hist->Fit(flowFunc, "", "SAME", 1.8, 4.5);
10771 hist->Fit(flowFunc, "N", "", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
10772 hist->GetYaxis()->SetRangeUser(hist->GetMinimum() * 0.95, hist->GetMaximum() * 1.05);
10773 flowFunc->SetRange(-0.5 * TMath::Pi(), 1.5 * TMath::Pi());
10774 flowFunc->Draw("SAME");
10777 *flowFuncP = flowFunc;
10779 //hist->GetYaxis()->SetRangeUser(84, 89);
10780 //flowFunc->SetParameter(4, 1);
10784 for (Int_t bin=hist->FindBin(1.8); bin<=hist->FindBin(4.5); bin++)
10786 chi2 += TMath::Power((hist->GetBinContent(bin) - flowFunc->Eval(hist->GetBinCenter(bin))) / hist->GetBinError(bin), 2);
10788 //Printf("%f", TMath::Power((hist->GetBinContent(bin) - flowFunc->Eval(hist->GetBinCenter(bin))) / hist->GetBinError(bin), 2));
10793 Printf("chi2/ndf = %f", chi2);
10795 if (!plotContributions)
10798 for (Int_t n=1; n<=5; n++)
10800 flowFuncPart = new TF1("flowFuncPart", "[0] * (1+2*[1]*cos([2]*x))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
10801 flowFuncPart->SetParameters(flowFunc->GetParameter(0), vn[n-1], n);
10802 flowFuncPart->SetLineWidth(1);
10803 flowFuncPart->SetLineStyle(n);
10804 flowFuncPart->Draw("SAME");
10810 void MACHConeAll(const char* fileName)
10816 c = new TCanvas("c", "c", 300, 800);
10817 c->SetTopMargin(0);
10818 c->SetLeftMargin(0);
10819 c->SetRightMargin(0);
10820 c->SetBottomMargin(0);
10821 c->Divide(1, 2, 0, 0);
10823 Float_t rangesMin[] = { 136.1, 17.45, 18, 2.4 };
10824 Float_t rangesMax[] = { 139.4, 18.95, 23.5, 3.6 };
10826 for (Int_t i=0; i<2; i++)
10830 gPad->SetRightMargin(0.05);
10831 gPad->SetLeftMargin(0.20);
10832 gPad->SetTopMargin(0.15);
10833 gPad->SetBottomMargin(0.15);
10837 gPad->SetBottomMargin(0.01);
10841 gPad->SetTopMargin(0.01);
10842 gPad->SetBottomMargin(0.7);
10851 // hist = MACHCone(fileName, i, "", kTRUE, 0, &flowFunc);
10852 hist = (TH1*) MACHCone(fileName, i, 0, kFALSE, 0)->Clone("hist");
10853 hist->GetYaxis()->SetRangeUser(rangesMin[i], rangesMax[i]);
10854 hist->GetYaxis()->SetTitleOffset(1.7);
10860 // hist2 = MACHCone(fileName, i, 0, kFALSE, 11);
10861 hist2 = MACHCone(fileName, i, "SAME", kTRUE, 11, &flowFunc);
10862 //hist2->GetYaxis()->SetRangeUser(rangesMin[i], rangesMax[i]);
10863 // hist2->Scale(2);
10864 hist2->SetLineColor(4);
10865 //hist2->Draw("SAME");
10868 // sample flowFunc with same binning
10869 flowFuncHist = (TH1*) hist->Clone("flowFuncHist");
10870 flowFuncHist->Reset();
10872 for (Int_t i=1; i<=flowFuncHist->GetNbinsX(); i++)
10874 flowFuncHist->SetBinContent(i, flowFunc->Integral(flowFuncHist->GetXaxis()->GetBinLowEdge(i), flowFuncHist->GetXaxis()->GetBinUpEdge(i)));
10875 flowFuncHist->SetBinError(i, 0);
10880 flowFuncHist->Scale(1.0 / flowFuncHist->GetBinWidth(1));
10883 // flowFuncHist->Draw();
10884 // flowFunc->Draw("SAME");
10888 residuals = (TH1*) hist->Clone("res1");
10889 residuals->SetYTitle("Residuals");
10890 residuals->Divide(flowFuncHist);
10893 residuals->GetYaxis()->SetNdivisions(505);
10894 residuals->GetYaxis()->SetRangeUser(0.995, 1.005);
10896 residuals = (TH1*) hist2->Clone("res2");
10897 residuals->Divide(flowFuncHist);
10899 residuals->SetLineColor(4);
10900 residuals->Draw("SAME");
10906 legend = new TLegend(0.43, 0.66, 0.91, 0.82);
10907 legend->SetFillColor(0);
10908 legend->SetTextSize(0.034);
10909 legend->SetTextAlign(22);
10911 legend->SetHeader("Centrality 0-1%");
10912 legend->AddEntry(hist, "|#eta| < 0.8 & All #Delta#eta", "L");
10913 legend->AddEntry(hist2, "|#eta| < 0.8 & |#Delta#eta| > 0.8 (2x)", "L");
10919 c->SaveAs(Form("machcone_%d.png", 0));
10920 c->SaveAs(Form("machcone_%d.eps", 0));
10921 c->SaveAs(Form("machcone_%d.C", 0));
10926 MACHCone(3, "", kTRUE)->SetTitle("");
10929 hist1 = MACHCone(0, "", kFALSE);
10930 hist2 = MACHCone(1, "SAME", kFALSE);
10931 hist3 = MACHCone(2, "SAME", kFALSE);
10933 hist1->SetTitle("");
10934 hist1->GetYaxis()->SetRangeUser(1, 7);
10937 void SetFlowStyle()
10939 // Set style which will affect all plots.
10942 // gStyle->SetOptitle(0);
10943 // gStyle->SetOptStat(0);
10944 //gStyle->SetOptDate(1);
10945 // gStyle->SetPalette(8,0); // (1,0)
10946 gStyle->SetPalette(1); // (1,0)
10947 gStyle->SetDrawBorder(0);
10948 // gStyle->SetFillColor(0); // kills palete ???
10949 gStyle->SetCanvasColor(0);
10950 gStyle->SetPadColor(0);
10951 // gStyle->SetFillColor(0); // otherwize it affects Fill colors later
10952 gStyle->SetFrameFillColor(0);
10953 gStyle->SetCanvasBorderMode(0);
10954 gStyle->SetFrameLineWidth(2);
10955 // gStyle->SetFrameFillStyle(4000);
10956 gStyle->SetPadBorderMode(0);
10957 gStyle->SetPadTickX(1);
10958 gStyle->SetPadTickY(1);
10959 gStyle->SetPadBottomMargin(0.15);
10960 gStyle->SetPadLeftMargin(0.15);
10961 gStyle->SetHistLineWidth(2);
10962 gStyle->SetFuncWidth(2);
10963 gStyle->SetLineWidth(2);
10964 gStyle->SetLabelSize(0.05,"xyz");
10965 gStyle->SetLabelOffset(0.01,"y");
10966 gStyle->SetLabelColor(kBlack,"xyz");
10967 gStyle->SetTitleSize(0.06,"xyz");
10968 gStyle->SetTitleOffset(1.3,"y");
10969 gStyle->SetTitleFillColor(0);
10970 gStyle->SetLineWidth(2);
10971 gStyle->SetHistLineColor(1);
10972 gStyle->SetTextColor(1);
10973 gStyle->SetTitleTextColor(1);
10974 TGaxis::SetMaxDigits(4);
10975 gStyle->SetOptStat(0); // removes stat. box from all histos
10976 gROOT->ForceStyle();
10978 } // end of void SetFlowStyle()
10980 void PlotPtDistributionsSubtracted(const char* fileName1, Int_t centrBegin = 1, Int_t centrEnd = 6, Int_t fit = 0)
10984 Int_t nCentralityBins = 5;
10985 Int_t centralityBins[] = { 1, 7, 9, 11, 13, 16 };
10987 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1);
10989 TCanvas* canvas = new TCanvas("Pt", "Pt", 1000, 1000);
10990 canvas->Divide(2, 2);
10992 TLegend* legend = new TLegend(0.3, 0.8, 0.99, 0.99);
10993 legend->SetFillColor(0);
10995 Int_t colors[] = { 1, 2, 4, 6, 3, 5 };
10996 Int_t markers[] = { 20, 21, 22, 23, 24, 25 };
10998 Double_t ptMin = 10.01;
10999 Double_t ptMax = 39.99;
11002 str.Form("%.1f < p_{T,trig} < %.1f", ptMin - 0.01, ptMax + 0.01);
11005 gPad->SetLeftMargin(0.15);
11006 gPad->SetBottomMargin(0.2);
11007 gPad->SetTopMargin(0.01);
11008 gPad->SetRightMargin(0.01);
11014 TH2F* dummy = new TH2F("dummy", "", 100, 1, 40, 100, 1e-5, 1e3);
11015 dummy->SetStats(kFALSE);
11016 dummy->SetXTitle("p_{T,assoc}");
11017 dummy->SetYTitle("1/N_{trig} dN/dp_{T,assoc}");
11018 dummy->GetYaxis()->SetTitleOffset(1);
11019 Prepare1DPlot(dummy);
11021 dummy->GetXaxis()->SetLabelSize(0.05);
11022 dummy->GetYaxis()->SetLabelSize(0.05);
11023 dummy->GetXaxis()->SetTitleSize(0.05);
11024 dummy->GetYaxis()->SetTitleSize(0.05);
11028 gPad->SetLeftMargin(0.15);
11029 gPad->SetBottomMargin(0.2);
11030 gPad->SetTopMargin(0.01);
11031 gPad->SetRightMargin(0.01);
11039 gPad->SetLeftMargin(0.15);
11040 gPad->SetBottomMargin(0.2);
11041 gPad->SetTopMargin(0.01);
11042 gPad->SetRightMargin(0.01);
11047 dummy = new TH2F("dummy2", "", 100, 1, 40, 100, 0, 100);
11048 dummy->SetStats(kFALSE);
11049 dummy->SetXTitle("p_{T,assoc}");
11050 dummy->SetYTitle("Ratio: Distribution / Inclusive");
11051 dummy->GetYaxis()->SetTitleOffset(1);
11052 Prepare1DPlot(dummy);
11053 dummy->GetXaxis()->SetLabelSize(0.05);
11054 dummy->GetYaxis()->SetLabelSize(0.05);
11055 dummy->GetXaxis()->SetTitleSize(0.05);
11056 dummy->GetYaxis()->SetTitleSize(0.05);
11060 gPad->SetLeftMargin(0.15);
11061 gPad->SetBottomMargin(0.2);
11062 gPad->SetTopMargin(0.01);
11063 gPad->SetRightMargin(0.01);
11070 // see GetAcceptanceScalingFactor
11071 Float_t scalingFactor = 0.328396; // 0.8
11072 //Float_t scalingFactor = 0.433268; // 0.7
11073 //Float_t scalingFactor = 0.895593; // 0.5 --> 1.6
11075 Float_t phiRange[] = { 0, TMath::Pi() / 2, TMath::Pi() };
11076 const char* phiLabels[] = { "Towards", "Transverse", "Away" };
11078 //Float_t phiSizeTowards = TMath::Pi() / 3;
11079 Float_t phiSizeTowards = 0.75;
11080 //Float_t etaLimit = 0.5;
11081 Float_t etaLimit = 0.8;
11083 towardsCentralEta = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, -etaLimit + 0.01, etaLimit - 0.01);
11084 towardsSideEta1 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, -1.59, -etaLimit - 0.01);
11085 TH1* towardsSideEta2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, phiRange[0] - phiSizeTowards, phiRange[0] + phiSizeTowards, etaLimit + 0.01, 1.59);
11086 towardsSideEta1->Add(towardsSideEta2); // TODO can be done smarter? what about the errors?
11088 Prepare1DPlot(towardsSideEta1);
11089 Prepare1DPlot(towardsCentralEta);
11091 towardsCentralEta->SetLineColor(colors[0]);
11092 towardsSideEta1->SetLineColor(colors[3]);
11093 //towardsSideEta1->SetLineStyle(2);
11095 legend->AddEntry(towardsCentralEta->Clone(), Form("Jet, %s: |#Delta#eta| < 0.8, #phi ~ %.1f", phiLabels[0], phiRange[0]));
11096 legend->AddEntry(towardsSideEta1->Clone(), Form("Ridge, %s: 0.8 < |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[0], phiRange[0]));
11098 // TODO update when data with new phi binning is available
11099 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);
11101 transverse2 = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, -0.5 * TMath::Pi(), -TMath::Pi() / 3, -1.59, 1.59, kTRUE);
11102 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);
11103 transverse->Add(transverse2);
11104 transverse->Add(transverse3);
11105 transverse->Scale(1.0 / (2.0 / 3 * TMath::Pi()));
11108 //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);
11109 //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);
11110 //transverseSideEta1->Add(transverseSideEta2); // TODO can be done smarter? what about the errors?
11112 transverse->SetLineColor(colors[2]);
11113 //transverseSideEta1->SetLineColor(colors[2]);
11114 //transverseSideEta1->SetLineStyle(2);
11116 Prepare1DPlot(transverse);
11117 //Prepare1DPlot(transverseSideEta1);
11118 legend->AddEntry(transverse->Clone(), Form("%s: |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[1], phiRange[1]));
11119 //legend->AddEntry(transverseSideEta1->Clone(), Form("%s: 0.8 < |#Delta #eta| < 1.6, #phi ~ %.1f", phiLabels[1], phiRange[1]));
11121 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);
11124 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);
11125 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);
11126 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);
11130 away->SetLineColor(colors[1]);
11131 //away3->SetLineColor(colors[1]);
11132 //away3->SetLineStyle(2);
11134 Prepare1DPlot(away);
11135 legend->AddEntry(away->Clone(), Form("%s: |#Delta#eta| < 1.6, #phi ~ %.1f", phiLabels[2], phiRange[2]));
11137 //inclusive = h->GetUEHist(2)->GetPtHist(6, 0, ptMin, ptMax, centrBegin, centrEnd, -0.5 * TMath::Pi(), 1.5 * TMath::Pi(), -1.59, 1.59);
11140 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1)->SetRange(centrBegin, centrEnd);
11141 inclusive = h->GetUEHist(2)->GetEventHist()->ShowProjection(0, 6);
11142 h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1)->SetRange(0, -1);
11145 axis = h->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetAxis(1);
11147 inclusiveTmp = h->GetCorrelationpT()->ProjectionY("inclusiveTmp", h->GetCorrelationpT()->GetXaxis()->FindBin(axis->GetBinLowEdge(centrBegin) + 0.01), h->GetCorrelationpT()->GetXaxis()->FindBin(axis->GetBinUpEdge(centrEnd) - 0.01));
11149 //rebin to match other histograms
11150 //inclusive2 = inclusive->Rebin(away->GetNbinsX(), "inclusive2", away->GetXaxis()->GetXbins()->GetArray());
11152 // manually, as usual the ROOT function makes a SEGV
11153 inclusive = (TH1*) away->Clone("inclusive");
11154 inclusive->Reset();
11155 inclusive->Sumw2();
11156 for (Int_t bin=1; bin<=inclusiveTmp->GetNbinsX(); bin++)
11157 inclusive->Fill(inclusiveTmp->GetBinCenter(bin), inclusiveTmp->GetBinContent(bin));
11159 for (Int_t bin=1; bin<=inclusive->GetNbinsX(); bin++)
11160 inclusive->SetBinError(bin, TMath::Sqrt(inclusive->GetBinContent(bin)));
11162 // normalization: events, phase space
11163 inclusive->Scale(1.0 / h->GetCentralityDistribution()->Integral(centrBegin, centrEnd));
11164 inclusive->Scale(1.0 / (TMath::TwoPi() * 0.8 * 2));
11167 for (Int_t i=1; i<=inclusive->GetNbinsX(); i++)
11169 inclusive->SetBinContent(i, inclusive->GetBinContent(i) / inclusive->GetXaxis()->GetBinWidth(i));
11170 inclusive->SetBinError (i, inclusive->GetBinError(i) / inclusive->GetXaxis()->GetBinWidth(i));
11173 Prepare1DPlot(inclusive);
11174 inclusive->SetLineColor(colors[4]);
11175 legend->AddEntry(inclusive->Clone(), "Inclusive");
11177 //Prepare1DPlot(away3);
11178 //legend->AddEntry(away3->Clone(), Form("%s: 0.8 < |#Delta #eta| < 1.6, #phi ~ %.1f", phiLabels[2], phiRange[2]));
11180 // scale for acceptance to match acceptance of towardsCentralEta
11181 towardsSideEta1->Scale(1.0 / scalingFactor); // contains only "side-eta"
11182 transverse->Scale(1.0 / (1.0 + scalingFactor)); // full eta
11183 away->Scale(1.0 / (1.0 + scalingFactor)); // full eta
11184 inclusive->Scale(1.0 / (1.0 + scalingFactor)); // full eta (phi scaling implicit)
11187 towardsCentralEtaClone = towardsCentralEta->DrawCopy("SAME");
11188 towardsSideEta1Clone = towardsSideEta1->DrawCopy("SAME");
11189 transverseClone = transverse->DrawCopy("SAME");
11190 //transverseSideEta1->DrawCopy("SAME");
11191 awayClone = away->DrawCopy("SAME");
11192 inclusiveClone = inclusive->DrawCopy("SAME");
11193 //inclusive2->DrawCopy("SAME");
11194 //away3->DrawCopy("SAME");
11198 towardsCentralEtaR = (TH1*) towardsCentralEta->Clone("towardsCentralEtaR");
11199 towardsSideEta1R = (TH1*) towardsSideEta1->Clone("towardsSideEta1R");
11200 transverseR = (TH1*) transverse->Clone("transverseR");
11201 awayR = (TH1*) away->Clone("awayR");
11203 towardsCentralEtaR->Divide(inclusive);
11204 towardsSideEta1R->Divide(inclusive);
11205 transverseR->Divide(inclusive);
11206 awayR->Divide(inclusive);
11208 towardsCentralEtaR->DrawCopy("SAME");
11209 towardsSideEta1R->DrawCopy("SAME");
11210 transverseR->DrawCopy("SAME");
11211 awayR->DrawCopy("SAME");
11217 awayClone->Fit("expo", "", "SAME", 1.1, 2.9);
11218 awayClone->GetFunction("expo")->SetRange(1, 10);
11225 func = new TF1("func", "[0] * x**[1]");
11226 func->SetParameters(1, 1);
11228 Float_t limitLow = 2.1;
11229 Float_t limitHigh = 4.9;
11231 func2 = (TF1*) func->Clone();
11232 towardsCentralEtaClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11233 towardsCentralEtaClone->GetFunction("func")->SetRange(1, 10);
11234 towardsCentralEtaClone->GetFunction("func")->SetLineColor(towardsCentralEtaClone->GetLineColor());
11236 func2 = (TF1*) func->Clone();
11237 towardsSideEta1Clone->Fit(func2, "", "SAME", limitLow, limitHigh);
11238 towardsSideEta1Clone->GetFunction("func")->SetRange(1, 10);
11239 towardsSideEta1Clone->GetFunction("func")->SetLineColor(towardsSideEta1Clone->GetLineColor());
11241 func2 = (TF1*) func->Clone();
11242 transverseClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11243 transverseClone->GetFunction("func")->SetRange(1, 10);
11244 transverseClone->GetFunction("func")->SetLineColor(transverseClone->GetLineColor());
11246 func2 = (TF1*) func->Clone();
11247 awayClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11248 awayClone->GetFunction("func")->SetRange(1, 10);
11249 awayClone->GetFunction("func")->SetLineColor(awayClone->GetLineColor());
11251 func2 = (TF1*) func->Clone();
11252 inclusiveClone->Fit(func2, "", "SAME", limitLow, limitHigh);
11253 inclusiveClone->GetFunction("func")->SetRange(1, 10);
11254 inclusiveClone->GetFunction("func")->SetLineColor(inclusiveClone->GetLineColor());
11257 // subtract transverse part
11258 away->Add(transverse, -1);
11259 //away3->Add(transverseSideEta1, -1);
11260 towardsCentralEta->Add(transverse, -1);
11261 towardsSideEta1->Add(transverse, -1);
11262 //inclusive->Add(transverse, -1);
11265 towardsCentralEta->DrawCopy("SAME");
11266 towardsSideEta1->DrawCopy("SAME");
11267 away->DrawCopy("SAME");
11268 inclusive->DrawCopy("SAME");
11269 //away3->DrawCopy("SAME");
11273 towardsCentralEtaR = (TH1*) towardsCentralEta->Clone("towardsCentralEtaR2");
11274 towardsSideEta1R = (TH1*) towardsSideEta1->Clone("towardsSideEta1R2");
11275 awayR = (TH1*) away->Clone("awayR2");
11277 towardsCentralEtaR->Divide(inclusive);
11278 towardsSideEta1R->Divide(inclusive);
11279 awayR->Divide(inclusive);
11281 towardsCentralEtaR->DrawCopy("SAME");
11282 towardsSideEta1R->DrawCopy("SAME");
11283 awayR->DrawCopy("SAME");
11289 away->Fit("expo", "", "SAME", 1.1, 2.9);
11290 away->GetFunction("expo")->SetRange(1, 10);
11297 func = new TF1("func", "[0] * x**[1]");
11298 func->SetParameters(1, 1);
11300 func2 = (TF1*) func->Clone();
11301 towardsCentralEta->Fit(func2, "", "SAME", limitLow, limitHigh);
11302 func2->SetRange(1, 10);
11304 func2 = (TF1*) func->Clone();
11305 towardsSideEta1->Fit(func2, "", "SAME", limitLow, limitHigh);
11306 func2->SetRange(1, 10);
11308 func2 = (TF1*) func->Clone();
11309 away->Fit(func2, "", "SAME", limitLow, limitHigh);
11310 func2->SetRange(1, 10);
11312 func2 = (TF1*) func->Clone();
11313 inclusive->Fit(func2, "", "SAME", limitLow, limitHigh);
11314 func2->SetRange(1, 10);
11317 for (Int_t i=1; i<=2; i++)
11322 str3.Form("%d-%d%%", (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinLowEdge(centrBegin), (Int_t) h->GetCentralityDistribution()->GetXaxis()->GetBinUpEdge(centrEnd));
11323 latex = new TLatex(0.2, 0.3, str3);
11325 latex->SetTextSize(0.06);
11327 latex2 = new TLatex(0.55, 0.6, str);
11329 latex2->SetTextSize(0.06);
11338 void CombineDeltaPhiWithWeighting()
11342 // xsection: 11.879829, ntrials: 8132994.000000
11345 // xsection: 0.623421, ntrials: 2293420.000000
11348 // xsection: 0.043815, ntrials: 1314525.375000
11350 // TODO is merging only same event distribution at present
11355 const char* inputList[] = { "mergejob/LHC11a2a_110124.root", "mergejob/LHC11a2b_110131.root", "mergejob/LHC11a2c_110131.root" };
11357 Float_t xSections[] = { 11.879829 * 1e6 / 8132994, 0.623421 * 1e6 / 2293420, 0.043815 * 1e6 / 1314525 };
11358 xSections[2] /= xSections[0];
11359 xSections[1] /= xSections[0];
11360 xSections[0] /= xSections[0];
11362 AliUEHistograms* files[3];
11363 TList* finalList = 0;
11364 for (Int_t i=0; i<nInput; i++)
11366 files[i] = (AliUEHistograms*) GetUEHistogram(inputList[i], (i == 0) ? &finalList : 0);
11369 files[i]->Scale(xSections[i]);
11371 TList* list2 = new TList;
11372 list2->Add(files[i]);
11373 files[0]->Merge(list2);
11377 TFile* file3 = TFile::Open("out.root", "RECREATE");
11378 file3->mkdir("PWG4_PhiCorrelations");
11379 file3->cd("PWG4_PhiCorrelations");
11380 finalList->Write(0, TObject::kSingleKey);
11384 void NormalizeToBinWidth(TH1* hist)
11387 // normalizes a 1-d histogram to its bin width
11390 if (hist->GetDimension() == 1)
11392 for (Int_t i=1; i<=hist->GetNbinsX(); ++i)
11394 hist->SetBinContent(i, hist->GetBinContent(i) / hist->GetBinWidth(i));
11395 hist->SetBinError(i, hist->GetBinError(i) / hist->GetBinWidth(i));
11398 else if (hist->GetDimension() == 2)
11400 for (Int_t i=1; i<=hist->GetNbinsX(); ++i)
11402 for (Int_t j=1; j<=hist->GetNbinsY(); ++j)
11404 hist->SetBinContent(i, j, hist->GetBinContent(i, j) / hist->GetXaxis()->GetBinWidth(i) / hist->GetYaxis()->GetBinWidth(j));
11405 hist->SetBinError(i, j, hist->GetBinError(i) / hist->GetXaxis()->GetBinWidth(i) / hist->GetYaxis()->GetBinWidth(j));
11411 void GetAcceptanceScalingFactor(const char* fileName1, Float_t eta1 = 0.8, Float_t eta2 = 1.6)
11415 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName1, 0, kTRUE);
11416 h->SetPtRange(1.01, 39.99);
11419 mixed = ((TH2*)h->GetUEHist(2)->GetUEHist(6, 0, 1.01, 39.99, 0, 16, kTRUE))->ProjectionY();
11422 Float_t left = mixed->Integral(mixed->FindBin(-eta2 + 0.01), mixed->FindBin(-eta1 - 0.01));
11423 Float_t center = mixed->Integral(mixed->FindBin(-eta1 + 0.01), mixed->FindBin(eta1 - 0.01));
11424 Float_t right = mixed->Integral(mixed->FindBin(eta1 + 0.01), mixed->FindBin(eta2 - 0.01));
11426 Printf("%f %f %f", left, center, right);
11427 Printf("%f", (left + right) / center);
11430 void TrackingEfficiencyCentralityDependence(const char* fileName, Int_t step1 = 2, Int_t step2 = 4)
11432 Int_t nCentralityBins = 3;
11433 Float_t centralityBins[] = { 0, 20, 40, 90 };
11435 Int_t colors[] = { 1, 2, 4, 6 };
11439 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
11442 dummy = new TH2F("dummy", ";p_{T};tracking efficiency", 100, 0, 20, 100, 0.7, 1.3);
11443 dummy->SetStats(0);
11446 legend = new TLegend(0.13, 0.67, 0.31, 0.87);
11447 legend->SetTextSize(0.04);
11448 legend->SetFillColor(0);
11450 for (Int_t i=0; i<nCentralityBins; i++)
11452 eventHist = h->GetUEHist(2)->GetEventHist();
11454 eventHist->GetGrid(step1)->SetRangeUser(1, centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
11455 eventHist->GetGrid(step2)->SetRangeUser(1, centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
11457 TH1* hist1 = eventHist->ShowProjection(0, step1);
11458 TH1* hist2 = eventHist->ShowProjection(0, step2);
11460 hist2->Divide(hist1);
11462 hist2->SetLineColor(colors[i]);
11463 hist2->GetYaxis()->SetTitle("tracking efficiency");
11464 hist2->Draw("SAME");
11466 legend->AddEntry(hist2, Form("%.0f-%.0f%%", centralityBins[i], centralityBins[i+1]));
11473 TGraphErrors* ReadHepdata(const char* fileName, Bool_t errorsAreAdded = kFALSE, Int_t skipYErrors = 0, Int_t skipXerrors = 1)
11475 // expected format: x [x2] y [ye] [ye2] [xe]
11477 // skipYErrors: 0 --> ye present
11478 // 1 --> no errors ye
11479 // 2 --> y and ye are lower and upper error, i.e. y' = (y + ye) / 2 and ye = (ye - y) / 2
11480 // 3 --> ye and ye2 are stat and syst error, will be added in quadrature
11482 // skipXerrors: 0 --> xe present
11483 // 1 --> no errors xe
11484 // 2 --> x2 present, xe not present and is calculated from x2 - x
11486 ifstream fin(fileName);
11488 graph = new TGraphErrors(0);
11495 if (fin.peek() == '#')
11497 fin.getline(buffer, 2000);
11509 if (skipXerrors == 2)
11512 xe = (x2 - x + 1) / 2;
11513 x = x + (x2 - x) / 2;
11521 if (skipYErrors == 0)
11528 else if (skipYErrors == 2)
11535 Double_t newy = (y + ye) / 2;
11539 else if (skipYErrors == 3)
11551 ye = TMath::Sqrt(ye*ye + ye2*ye2);
11554 if (skipXerrors == 0)
11562 //Printf("%f %f %f %f", x, y, xe, ye);
11564 if (errorsAreAdded)
11567 graph->SetPoint(graph->GetN(), x, y);
11568 graph->SetPointError(graph->GetN()-1, xe, ye);
11572 // read rest until end of line...
11573 fin.getline(buffer, 2000);
11577 Printf("%s: %f", fileName, sum);
11582 void EvaluateParticleEfficiency(const char* fileName)
11584 Int_t centralityBegin = 1;
11585 Int_t centralityEnd = 15;
11598 Float_t ptTriggerBegin = 4.01;
11599 Float_t ptTriggerEnd = 19.99;
11601 Bool_t verbose = 1;
11605 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
11606 AliUEHist* cont = h->GetUEHist(2);
11608 cont->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
11609 cont->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
11611 Int_t stepEff1 = step1 - (Int_t) AliUEHist::kCFStepAnaTopology;
11612 if (stepEff1 == -1)
11614 Int_t stepEff2 = step2 - (Int_t) AliUEHist::kCFStepAnaTopology;
11615 if (stepEff2 == -1)
11618 cont->GetTrackHistEfficiency()->GetGrid(stepEff1)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
11619 cont->GetTrackHistEfficiency()->GetGrid(stepEff2)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
11621 TH1* triggerParticle = cont->GetEventHist()->Project(step2, 0);
11622 triggerParticle->Divide(cont->GetEventHist()->Project(step1, 0));
11624 TH1* singleParticle = cont->GetTrackHistEfficiency()->Project(stepEff2, 1);
11625 singleParticle->Divide(cont->GetTrackHistEfficiency()->Project(stepEff1, 1));
11627 //singleParticle = singleParticle->Rebin(triggerParticle->GetNbinsX(), "singleRebin", triggerParticle->GetXaxis()->GetXbins()->GetArray());
11629 TGraphErrors* effectiveEffect = new TGraphErrors;
11630 TGraphErrors* triggerCorrelatedEffect = new TGraphErrors;
11631 TGraphErrors* afterBaseLine = new TGraphErrors;
11632 TGraphErrors* triggerCorrelatedEffect2D = new TGraphErrors;
11634 //TVirtualFitter::SetDefaultFitter("Linear");
11636 for (Int_t bin=3; bin<=triggerParticle->GetNbinsX(); bin++)
11638 if (triggerParticle->GetBinCenter(bin) > 10)
11641 cont->SetPtRange(triggerParticle->GetXaxis()->GetBinLowEdge(bin) + 0.01, triggerParticle->GetXaxis()->GetBinUpEdge(bin) - 0.01);
11643 TH1* hist1 = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd);
11644 TH1* hist2 = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd);
11646 // TODO the uncertainties on the ratios should be properly calculated! (if that helps ;))
11647 clone = (TH1*) hist2->Clone("clone");
11648 clone->Divide(hist1);
11650 //func = new TF1("func", "[0]", -10, 10);
11652 if ((Int_t) clone->Fit("pol0", "0", "", -10, 10) == 0)
11654 func = clone->GetFunction("pol0");
11655 effectiveEffect->SetPoint(effectiveEffect->GetN(), triggerParticle->GetBinCenter(bin) - 0.2, func->GetParameter(0));
11656 effectiveEffect->SetPointError(effectiveEffect->GetN()-1, 0, func->GetParError(0));
11661 clone->GetYaxis()->SetRangeUser(0.9, 1.3);
11663 func->DrawClone("SAME");
11667 if ((Int_t) clone->Fit("pol0", "0", "", -0.3, 0.3) == 0)
11669 func = clone->GetFunction("pol0");
11670 triggerCorrelatedEffect->SetPoint(triggerCorrelatedEffect->GetN(), triggerParticle->GetBinCenter(bin) - 0.1, func->GetParameter(0));
11671 triggerCorrelatedEffect->SetPointError(triggerCorrelatedEffect->GetN()-1, 0, func->GetParError(0));
11675 func->SetLineColor(2);
11676 func->DrawClone("SAME");
11680 if ((Int_t) hist2->Fit("pol0", "0", "", 1, 2) == 0)
11682 func = hist2->GetFunction("pol0");
11683 func->SetRange(-10, 10);
11684 hist2->Add(func, -1);
11686 if ((Int_t) hist1->Fit("pol0", "0", "", 1, 2) == 0)
11688 func = hist1->GetFunction("pol0");
11689 func->SetRange(-10, 10);
11690 hist1->Add(func, -1);
11692 //new TCanvas; hist1->DrawCopy();
11694 hist2->Divide(hist1);
11696 if ((Int_t) hist2->Fit("pol0", "0", "", -0.3, 0.3) == 0)
11698 func = hist2->GetFunction("pol0");
11699 afterBaseLine->SetPoint(afterBaseLine->GetN(), triggerParticle->GetBinCenter(bin) + 0.2, func->GetParameter(0));
11700 afterBaseLine->SetPointError(afterBaseLine->GetN()-1, 0, func->GetParError(0));
11705 hist2->GetYaxis()->SetRangeUser(0.9, 1.3);
11707 func->SetLineColor(4);
11708 func->DrawClone("SAME");
11715 TH2* hist1_2D = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
11716 TH2* hist2_2D = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
11718 //((TH2*)hist1)->Rebin2D(2, 2); ((TH2*)hist2)->Rebin2D(2, 2);
11720 hist2_2D->Divide(hist1_2D);
11725 hist2_2D->Draw("COLZ");
11728 //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));
11731 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);
11733 integral /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
11734 integral /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
11736 error /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
11737 error /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
11739 triggerCorrelatedEffect2D->SetPoint(triggerCorrelatedEffect2D->GetN(), triggerParticle->GetBinCenter(bin) + 0.1, integral);
11740 triggerCorrelatedEffect2D->SetPointError(triggerCorrelatedEffect2D->GetN()-1, 0, error);
11747 triggerParticle->Draw();
11748 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
11750 singleParticle->SetLineColor(2);
11751 //singleParticle->Draw("SAME");
11753 effectiveEffect->SetMarkerStyle(24);
11754 effectiveEffect->Draw("PSAME");
11756 triggerCorrelatedEffect->SetMarkerStyle(25);
11757 triggerCorrelatedEffect->SetMarkerColor(2);
11758 triggerCorrelatedEffect->SetLineColor(2);
11759 triggerCorrelatedEffect->Draw("PSAME");
11761 triggerCorrelatedEffect2D->SetMarkerStyle(27);
11762 triggerCorrelatedEffect2D->SetMarkerColor(3);
11763 triggerCorrelatedEffect2D->SetLineColor(3);
11764 triggerCorrelatedEffect2D->Draw("PSAME");
11766 afterBaseLine->SetMarkerStyle(26);
11767 afterBaseLine->SetMarkerColor(4);
11768 afterBaseLine->SetLineColor(4);
11769 afterBaseLine->Draw("PSAME");
11771 legend = new TLegend(0.66, 0.15, 0.88, 0.38);
11772 legend->SetFillColor(0);
11773 legend->SetTextSize(0.04);
11774 legend->AddEntry(triggerParticle, "trigger", "L");
11775 //legend->AddEntry(singleParticle, "single", "L");
11776 legend->AddEntry(effectiveEffect, "effective", "P");
11777 legend->AddEntry(triggerCorrelatedEffect, "at 0", "P");
11778 legend->AddEntry(triggerCorrelatedEffect2D, "at 0 (2d)", "P");
11779 legend->AddEntry(afterBaseLine, "baseline", "P");
11783 void EvaluateParticleEfficiency2D(const char* fileName)
11785 Int_t centralityBegin = 1;
11786 Int_t centralityEnd = 15;
11799 Bool_t verbose = 0;
11803 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
11804 AliUEHist* cont = h->GetUEHist(2);
11806 cont->GetEventHist()->GetGrid(step1)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
11807 cont->GetEventHist()->GetGrid(step2)->GetGrid()->GetAxis(1)->SetRange(centralityBegin, centralityEnd);
11809 Int_t stepEff1 = step1 - (Int_t) AliUEHist::kCFStepAnaTopology;
11810 if (stepEff1 == -1)
11812 Int_t stepEff2 = step2 - (Int_t) AliUEHist::kCFStepAnaTopology;
11813 if (stepEff2 == -1)
11816 cont->GetTrackHistEfficiency()->GetGrid(stepEff1)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
11817 cont->GetTrackHistEfficiency()->GetGrid(stepEff2)->GetGrid()->GetAxis(3)->SetRange(centralityBegin, centralityEnd);
11819 TH1* triggerParticle = cont->GetEventHist()->Project(step2, 0);
11820 triggerParticle->Divide(cont->GetEventHist()->Project(step1, 0));
11822 TH1* singleParticle = cont->GetTrackHistEfficiency()->Project(stepEff2, 1);
11823 singleParticle->Divide(cont->GetTrackHistEfficiency()->Project(stepEff1, 1));
11825 cont->GetTrackHist(0)->GetGrid(step1)->SetRangeUser(0, -0.01, 0.01); // delta eta
11826 cont->GetTrackHist(0)->GetGrid(step1)->SetRangeUser(4, -0.01, 0.01); // delta phi
11827 TH2* tracksStep1 = (TH2*) cont->GetTrackHist(0)->Project(step1, 1, 2);
11829 cont->GetTrackHist(0)->GetGrid(step2)->SetRangeUser(0, -0.01, 0.01); // delta eta
11830 cont->GetTrackHist(0)->GetGrid(step2)->SetRangeUser(4, -0.01, 0.01); // delta phi
11831 TH2* tracksStep2 = (TH2*) cont->GetTrackHist(0)->Project(step2, 1, 2);
11833 tracksStep2->Divide(tracksStep1);
11835 TH1* triggersStep1 = cont->GetEventHist()->Project(step1, 0);
11836 TH1* triggersStep2 = cont->GetEventHist()->Project(step2, 0);
11838 for (Int_t x=1; x<=tracksStep2->GetNbinsX(); x++)
11839 for (Int_t y=1; y<=tracksStep2->GetNbinsY(); y++)
11840 if (singleParticle->GetBinContent(x) > 0)
11841 tracksStep2->SetBinContent(x, y, tracksStep2->GetBinContent(x, y) / triggersStep2->GetBinContent(y) * triggersStep1->GetBinContent(y) / singleParticle->GetBinContent(x));
11843 tracksStep2->SetBinContent(x, y, 0);
11846 tracksStep2->Draw("COLZ");
11848 TGraphErrors** triggerCorrelatedEffect2D = new TGraphErrors*[triggerParticle->GetNbinsX()+1];
11849 TGraphErrors** triggerCorrelatedEffect2DSub = new TGraphErrors*[triggerParticle->GetNbinsX()+1];
11851 for (Int_t bin1=0; bin1<=triggerParticle->GetNbinsX(); bin1++)
11853 triggerCorrelatedEffect2D[bin1] = 0;
11854 triggerCorrelatedEffect2DSub[bin1] = 0;
11857 for (Int_t bin1=5; bin1<=triggerParticle->GetNbinsX(); bin1++)
11859 if (triggerParticle->GetBinCenter(bin1) > 10)
11862 Float_t ptTriggerBegin = triggerParticle->GetXaxis()->GetBinLowEdge(bin1) + 0.01;
11863 Float_t ptTriggerEnd = triggerParticle->GetXaxis()->GetBinUpEdge(bin1) - 0.01;
11865 for (Int_t bin2=3; bin2<=triggerParticle->GetNbinsX(); bin2++)
11867 if (triggerParticle->GetBinCenter(bin2) > 8)
11873 cont->SetPtRange(triggerParticle->GetXaxis()->GetBinLowEdge(bin2) + 0.01, triggerParticle->GetXaxis()->GetBinUpEdge(bin2) - 0.01);
11876 TH2* hist1_2D = cont->GetUEHist(step1, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
11877 TH2* hist2_2D = cont->GetUEHist(step2, 0, ptTriggerBegin, ptTriggerEnd, centralityBegin, centralityEnd, 1);
11879 //((TH2*)hist1)->Rebin2D(2, 2); ((TH2*)hist2)->Rebin2D(2, 2);
11881 hist2_2D->Divide(hist1_2D);
11886 hist2_2D->Draw("COLZ");
11889 //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));
11892 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);
11894 integral /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
11895 integral /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
11897 error /= hist2_2D->GetXaxis()->FindBin(0.01) - hist2_2D->GetXaxis()->FindBin(-0.01) + 1;
11898 error /= hist2_2D->GetYaxis()->FindBin(0.01) - hist2_2D->GetYaxis()->FindBin(-0.01) + 1;
11903 if (!triggerCorrelatedEffect2D[bin1])
11904 triggerCorrelatedEffect2D[bin1] = new TGraphErrors;
11906 triggerCorrelatedEffect2D[bin1]->SetPoint(triggerCorrelatedEffect2D[bin1]->GetN(), triggerParticle->GetBinCenter(bin2) - 0.5 + 0.1 * bin1, integral);
11907 triggerCorrelatedEffect2D[bin1]->SetPointError(triggerCorrelatedEffect2D[bin1]->GetN()-1, 0, error);
11909 if (!triggerCorrelatedEffect2DSub[bin1])
11910 triggerCorrelatedEffect2DSub[bin1] = new TGraphErrors;
11912 triggerCorrelatedEffect2DSub[bin1]->SetPoint(triggerCorrelatedEffect2DSub[bin1]->GetN(), triggerParticle->GetBinCenter(bin2) - 0.5 + 0.1 * bin1, integral / triggerParticle->GetBinContent(bin2));
11913 triggerCorrelatedEffect2DSub[bin1]->SetPointError(triggerCorrelatedEffect2DSub[bin1]->GetN()-1, 0, error / triggerParticle->GetBinContent(bin2));
11924 triggerParticle->Draw();
11925 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
11927 legend = new TLegend(0.66, 0.15, 0.88, 0.38);
11928 legend->SetFillColor(0);
11929 legend->SetTextSize(0.04);
11930 legend->AddEntry(triggerParticle, "trigger", "L");
11935 for (Int_t bin1=3; bin1<=triggerParticle->GetNbinsX(); bin1++)
11936 if (triggerCorrelatedEffect2D[bin1])
11938 triggerCorrelatedEffect2D[bin1]->SetMarkerStyle(marker++);
11939 triggerCorrelatedEffect2D[bin1]->SetMarkerColor(color);
11940 triggerCorrelatedEffect2D[bin1]->SetLineColor(color++);
11941 triggerCorrelatedEffect2D[bin1]->Draw("PSAME");
11942 legend->AddEntry(triggerCorrelatedEffect2D[bin1], Form("pt %.2f", triggerParticle->GetBinCenter(bin1)), "P");
11948 triggerParticle->Draw();
11949 triggerParticle->GetXaxis()->SetRangeUser(0, 9.9);
11954 for (Int_t bin1=3; bin1<=triggerParticle->GetNbinsX(); bin1++)
11955 if (triggerCorrelatedEffect2DSub[bin1])
11957 triggerCorrelatedEffect2DSub[bin1]->SetMarkerStyle(marker++);
11958 triggerCorrelatedEffect2DSub[bin1]->SetMarkerColor(color);
11959 triggerCorrelatedEffect2DSub[bin1]->SetLineColor(color++);
11960 triggerCorrelatedEffect2DSub[bin1]->Draw("PSAME");
11966 void DrawEventCount(const char* fileName, Int_t step = 8)
11970 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
11971 h->GetEventCount()->Draw("TEXT");
11973 eventCount = h->GetEventCount();
11974 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));
11975 Printf("Events: %f", events);
11978 void FitDCADistributions(const char* fileName1)
11982 TFile::Open(fileName1);
11983 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
11984 prim = (TH2*) list->FindObject("fDCAPrimaries");
11985 sec = (TH2*) list->FindObject("fDCASecondaries");
11987 Float_t zCut = 0.5;
11989 TH2* histList[] = { prim, sec };
11994 for (Int_t i=0; i<2; i++)
12001 // hist = histList[i]->ProjectionX("proj", prim->GetYaxis()->FindBin(-zCut), prim->GetYaxis()->FindBin(zCut))->DrawCopy("");
12002 hist = histList[i]->ProjectionY("proj", prim->GetXaxis()->FindBin(-zCut), prim->GetXaxis()->FindBin(zCut))->DrawCopy("");
12005 func = new TF1("func", "gaus(0)+gaus(3)");
12006 func->SetParameters(1e6, 0, 0.02, 1e3, 0, 2);
12007 func->FixParameter(1, 0);
12008 func->FixParameter(4, 0);
12009 func->SetParLimits(2, 0, 0.1);
12010 func->SetParLimits(5, 1, 3);
12012 hist->Fit(func, "", "", -2, 2);
12014 func2 = new TF1("func2", "gaus(0)");
12015 func2->SetParameters(1e3, 0, 2);
12016 func2->FixParameter(1, 0);
12017 func2->SetParLimits(2, 0.5, 5);
12019 hist->Fit(func2, "+", "", -2, -1);
12020 func2->SetRange(-3, 3);
12021 func2->Draw("SAME");
12027 void CompareDCADistributions(const char* fileName1, const char* fileName2)
12029 TFile::Open(fileName1);
12030 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
12031 prim = (TH2*) list->FindObject("fDCAPrimaries");
12032 sec = (TH2*) list->FindObject("fDCASecondaries");
12034 TFile::Open(fileName2);
12035 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
12036 all = (TH2*) list->FindObject("fDCAPrimaries");
12038 Float_t zCut = 3.2;
12040 TH2* histList[] = { prim, sec, all };
12051 for (Int_t i=0; i<3; i++)
12053 hist = histList[i]->ProjectionX("proj", prim->GetYaxis()->FindBin(-zCut), prim->GetYaxis()->FindBin(zCut))->DrawCopy(i>0?"SAME":"");
12055 //hist = histList[i]->ProjectionY("proj", prim->GetXaxis()->FindBin(-zCut), prim->GetXaxis()->FindBin(zCut))->DrawCopy(i>0?"SAME":"");
12056 hist->SetLineColor(i+1);
12062 hist->Scale(1.0 / hist->Integral(hist->GetXaxis()->FindBin(-0.5), hist->GetXaxis()->FindBin(0.5)) * count);
12064 count += hist->Integral(hist->GetXaxis()->FindBin(-0.5), hist->GetXaxis()->FindBin(0.5));
12069 ratio = (TH1*) hist->Clone("ratio");
12070 ratio->Add(primProj, -1);
12072 /* for (Int_t i=hist->GetXaxis()->FindBin(-0.1); i<=hist->GetXaxis()->FindBin(0.1); i++)
12073 ratio->SetBinContent(i, 0);*/
12075 for (Int_t i=1; i<=hist->GetNbinsX(); i++)
12076 ratio->SetBinError(i, 0);
12078 ratio->SetLineColor(4);
12079 ratio->DrawCopy("SAME E");
12086 secProj = (TH1*) secProj->Clone();
12089 ratio->Divide(secProj);
12091 /* for (Int_t i=1; i<=hist->GetNbinsX(); i++)
12092 ratio->SetBinError(i, 0);*/
12094 ratio->Draw("HIST");
12095 ratio->GetYaxis()->SetRangeUser(0.7, 1.3);
12097 ratio->Fit("pol0", "0+", "", -5, -1);
12098 ratio->Fit("pol0", "0+", "", 1, 5);
12101 void TrackCuts_CompareParameters(const char* fileName1, const char* fileName2, const char* histName, const char* cutFolder = "cuts_quality_only")
12103 // plotWhich: 0 = only before
12107 // mirror: kTRUE --> project negative values on the positive side
12109 Int_t plotWhich = 0;
12110 Bool_t mirror = kFALSE;
12113 files[0] = TFile::Open(fileName1);
12114 files[1] = TFile::Open(fileName2);
12117 Int_t colors[] = { 1, 2, 3, 4, 5, 6 };
12119 TLegend* legend = new TLegend(0.7, 0.85, 0.93, 0.98);
12120 legend->SetTextSize(0.04);
12121 legend->SetFillColor(0);
12123 TCanvas* c1 = new TCanvas(histName, histName, 1200, 600);
12125 //TCanvas* c2 = new TCanvas("c2", "c2", 800, 600);
12126 //TCanvas* c3 = new TCanvas("c3", "c3", 800, 600);
12128 const char* folders2[] = { "before_cuts", "after_cuts" };
12129 const char* names[] = { "MC", "Data" };
12130 Bool_t first = kTRUE;
12131 for (Int_t j = ((plotWhich < 2) ? 0 : 1); j < ((plotWhich > 0) ? 2 : 1); j++)
12135 for (Int_t i = 0; i < 2; i++)
12137 Printf("%d %d", j, i);
12139 folder.Form("%s/%s/%s", cutFolder, folders2[j], histName);
12140 TH1* hist = (TH1*) files[i]->Get(folder);
12144 for (Int_t bin=1; bin<=hist->GetXaxis()->FindBin(-0.0001); bin++)
12146 Int_t newBin = hist->GetXaxis()->FindBin(-hist->GetXaxis()->GetBinCenter(bin));
12149 hist->Fill(-hist->GetXaxis()->GetBinCenter(bin), hist->GetBinContent(bin));
12150 hist->SetBinContent(bin, 0);
12155 legend->AddEntry(hist, Form("%s %s", names[i], (plotWhich == 1) ? folders2[j] : " "));
12158 hist->SetLineColor(colors[count]);
12159 hist->Scale(1.0 / hist->Integral());
12161 hist->DrawCopy((count == 0) ? "" : "SAME");
12165 case 0: base = hist; break;
12166 case 1: base2 = hist; break;
12173 ratio->Divide(base2);
12175 ratio->GetYaxis()->SetRangeUser(0, 2);
12178 ratio->DrawCopy((first) ? "" : "SAME");
12182 c1->cd(1)->SetLogy();
12183 c1->cd(1)->SetGridx();
12184 c1->cd(1)->SetGridy();
12187 c1->cd(2)->SetGridx();
12188 c1->cd(2)->SetGridy();
12190 c1->SaveAs(Form("%s.png", histName));
12193 void PlotQA(const char* fileName, const char* tag = "")
12197 if (!gGrid && TString(fileName).BeginsWith("alien://"))
12198 TGrid::Connect("alien://");
12200 TFile::Open(fileName);
12203 Int_t runNumber = 0;
12204 list = (TList*) gFile->Get("PhysSel");
12207 physSel = (AliPhysicsSelection*) list->FindObject("AliPhysicsSelection");
12208 // runNumber = physSel->GetCurrentRun();
12211 TString tmp(fileName);
12212 tmp.ReplaceAll("alien:///alice/cern.ch/user/j/jgrosseo/gridjob/dir_", "");
12213 tmp.ReplaceAll(".root", ".png");
12214 tmp.ReplaceAll("/", "-");
12216 title.Form("QA_%d_%s", runNumber, tmp.Data());
12217 c = new TCanvas(title, title, 1200, 800);
12221 list = (TList*) gFile->Get("histosPhiCorrelationsQA");
12224 prim = (TH2*) list->FindObject("fDCAPrimaries");
12225 dcaxy = prim->ProjectionX("dcaxy", prim->GetYaxis()->FindBin(-3.2), prim->GetYaxis()->FindBin(3.2));
12226 dcaz = prim->ProjectionY("dcaz", prim->GetXaxis()->FindBin(-2.4), prim->GetXaxis()->FindBin(2.4));
12227 centrCorr = (TH2*) list->FindObject("fCentralityCorrelation");
12229 c->cd(1); dcaxy->Draw(); dcaz->SetLineColor(2); dcaz->Draw("SAME"); gPad->SetLogy();
12230 c->cd(6); centrCorr->Draw("COLZ"); gPad->SetLogz();
12232 cuts = (AliESDtrackCuts*) list->FindObject("cuts_quality_dca");
12235 cluster = cuts->GetNClustersTPC(1);
12236 c->cd(3); cluster->Draw();
12238 ptall = (TH1F*) cuts->GetPtHist(1)->Clone("ptall");
12239 if (ptall->Integral() > 0)
12240 ptall->Scale(1.0 / ptall->Integral());
12246 check_its = (AliESDtrackCuts*) list->FindObject("check_its");
12249 ptIts = (TH1F*) check_its->GetPtHist(1)->Clone("ptIts");
12250 if (ptIts->Integral() > 0)
12251 ptIts->Scale(1.0 / ptIts->Integral());
12255 global_cuts = (AliESDtrackCuts*) list->FindObject("global_cuts");
12258 ptItsAcc = (TH1*) global_cuts->GetPtHist(1)->Clone("ptItsAcc");
12259 if (ptItsAcc->Integral() > 0)
12260 ptItsAcc->Scale(1.0 / ptItsAcc->Integral());
12265 ptIts->SetLineColor(2);
12266 ptIts->Draw("SAME");
12271 ptItsAcc->SetLineColor(4);
12272 ptItsAcc->Draw("SAME");
12280 list = (TList*) gFile->Get("CentralityStat");
12281 TH1* centrQuality = 0;
12284 centrQuality = (TH1*) list->FindObject("fHOutQuality");
12286 c->cd(4); if (centrQuality) centrQuality->Draw();
12290 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE, tag);
12292 if (h->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetNbins() == 0)
12294 Printf("We have %d axes", ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0)->GetNVar()));
12296 // ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
12297 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->FillParent();
12298 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
12300 centr = h->GetCentralityDistribution();
12301 NormalizeToBinWidth(centr);
12302 Int_t events = (Int_t) h->GetEventCount()->ProjectionX()->GetBinContent(3);
12303 Int_t mergeCount = h->GetMergeCount();
12305 h->SetPtRange(1.01, 3.99);
12306 dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, 1.01, 14.99, 1, 8);
12307 if (dphi_corr->GetEntries() == 0)
12308 dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed+2, 0, 1.01, 14.99, 1, 8);
12309 if (dphi_corr->GetEntries() == 0)
12310 dphi_corr = h->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepAll, 0, 1.01, 14.99, 1, 8);
12312 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE, tag);
12313 if (hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetNbins() == 0)
12315 // ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
12316 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->FillParent();
12319 Float_t ptMin = 0.51;
12320 hMixed->SetPtRange(ptMin, 3.99);
12321 dphi_corr_mixed = hMixed->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed, 0, ptMin, 14.99, 1, 8);
12322 if (dphi_corr_mixed->GetEntries() == 0)
12323 dphi_corr_mixed = hMixed->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepReconstructed+2, 0, ptMin, 14.99, 1, 8);
12324 if (dphi_corr_mixed->GetEntries() == 0)
12325 dphi_corr_mixed = hMixed->GetUEHist(2)->GetUEHist(AliUEHist::kCFStepAll, 0, ptMin, 14.99, 1, 8);
12327 if (runNumber != 0 && runNumber != h->GetRunNumber())
12328 AliFatal("Run numbers inconsistent");
12330 Printf("%d", h->GetRunNumber());
12331 if (runNumber == 0)
12332 runNumber = h->GetRunNumber();
12334 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");
12335 c->cd(5); centr->Draw("HIST");
12338 latex = new TLatex(0.15, 0.8, Form("%d events, %d merged objects", events, mergeCount));
12339 latex->SetTextSize(0.075);
12344 h->GetEventCount()->Draw("TEXT");
12346 title.Form("QA_%d_%s", runNumber, tmp.Data());
12347 c->SetTitle(title);
12351 h->SetPtRange(gpTMin, gpTMax);
12352 hMixed->SetPtRange(gpTMin, gpTMax);
12356 //h->GetUEHist(2)->SetSkipScaleMixedEvent(kTRUE);
12358 if (h->GetUEHist(2)->GetTrackHist(0)->GetNVar() > 5)
12363 GetDistAndFlow(h, 0, &hist1, 0, step, 0, 20, 2.01, 2.99, 1);
12364 hist1->DrawCopy("SURF1");
12367 GetDistAndFlow(hMixed, 0, &hist1, 0, step, 0, 20, 2.01, 2.99, 1);
12368 hist1->DrawCopy("SURF1");
12371 GetSumOfRatios(h, hMixed, &hist1, step, 0, 20, 2.01, 2.99, kTRUE);
12373 hist1->DrawCopy("SURF1");
12376 c->SaveAs(Form("qa/%s", c->GetTitle()));
12379 void GetEventNumber(const char* fileName)
12383 new TCanvas("c1", "", 800, 600);
12387 TFile::Open(fileName);
12388 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12389 centr = h->GetCentralityDistribution();
12390 nEvent = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(59.99));
12392 cout << "Number of events: " << nEvent << endl;
12393 centr->Draw("HIST");
12395 void CompareStepsOnePlot(const char* fileName, Int_t caseId)
12399 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12401 Int_t stepList[] = { 0, 1, 2, 4, 5, 6 };
12402 Int_t stepListNames[] = { 0, 1, 2, 3, 4, 5 };
12404 //const char* names[] = { "All", "PhysSel+Vertex", "Reco Primaries", "Reco "
12405 // //Int_t stepList[] = { 2, 4, 5, 6 };
12408 // TH1* hist1 = h->GetUEHist(2)->GetUEHist(0, 0, 6.01, 9.99, 6, 14);
12409 // TH1* hist2 = h->GetUEHist(2)->GetUEHist(0, 0, 6.01, 7.99, 6, 14);
12410 // TH1* hist3 = h->GetUEHist(2)->GetUEHist(0, 0, 8.01, 9.99, 6, 14);
12413 // hist2->SetLineColor(2);
12414 // hist2->Draw("SAME");
12415 // hist3->SetLineColor(4);
12416 // hist3->Draw("SAME");
12420 legend = new TLegend(0.65, 0.45, 0.85, 0.85);
12421 legend->SetTextSize(0.04);
12422 legend->SetFillColor(0);
12426 for (Int_t i=0; i<nSteps; i++)
12428 //TH1* hist1 = h->GetUEHist(2)->GetEventHist()->Project(stepList[i], 0);
12430 /* h->GetUEHist(2)->GetTrackHist(0)->GetGrid(stepList[i])->GetGrid()->GetAxis(1)->SetRangeUser(1.01, 3.99);
12431 h->GetUEHist(2)->GetTrackHist(0)->GetGrid(stepList[i])->GetGrid()->GetAxis(2)->SetRangeUser(4.01, 19.99);
12432 TH1* hist1 = h->GetUEHist(2)->GetTrackHist(0)->Project(stepList[i], 4);*/
12435 TH1* hist1 = h->GetUEHist(2)->GetUEHist(stepList[i], 0, 1.01, 19.99);
12436 else if (caseId == 1)
12437 TH1* hist1 = h->GetUEHist(2)->GetEventHist()->Project(stepList[i], 0);
12441 hist1->SetMarkerStyle(24+i);
12442 hist1->SetTitle("");
12443 hist1->SetStats(0);
12444 hist1->DrawCopy((i==0)?"":"SAME");
12445 hist1->Fit("pol0", "0");
12446 //hist1->Fit("pol0");
12447 histList[i] = hist1;
12448 legend->AddEntry(hist1, Form("Step %d", stepListNames[i]), "P");
12454 legend = new TLegend(0.65, 0.45, 0.85, 0.85);
12455 legend->SetTextSize(0.04);
12456 legend->SetFillColor(0);
12458 for (Int_t i=1; i<nSteps; i++)
12460 histList[i]->DrawCopy((i==1)?"":"SAME")->Divide(histList[i-1]);
12461 legend->AddEntry(histList[i], Form("Step %d/%d", stepListNames[i], stepListNames[i-1]), "P");
12467 for (Int_t i=0; i<nSteps; i++)
12469 hist1 = histList[i];
12470 func = new TF1("func", "[0]", -10, 10);
12471 hist1->Fit(func, "0", "", 1, 2);
12472 hist1->Add(func, -1);
12473 hist1->DrawCopy((i==0)?"":"SAME");
12479 for (Int_t i=1; i<nSteps; i++)
12481 histList[i]->DrawCopy((i==1)?"":"SAME")->Divide(histList[i-1]);
12487 void PtShift(const char* fileName)
12491 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12496 ptHist3 = h->GetCorrelationpT()->ProjectionY();
12497 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12498 //ptHist3->Sumw2();
12501 func = new TF1("func", "[0]+[1]*x**[2]", 4, 20);
12502 func->SetParLimits(2, -10, -1);
12503 func->SetParameters(0, 1, -4);
12504 ptHist3->Fit(func, "", "", 4, 20);
12509 ptHist3Shifted = (TH1*) ptHist3->Clone("ptHist3Shifted");
12510 for (Int_t i=1; i<ptHist3Shifted->GetNbinsX(); i++)
12511 //ptHist3Shifted->SetBinContent(i, ptHist3Shifted->GetBinContent(i+3));
12512 ptHist3Shifted->SetBinContent(i, ptHist3Shifted->GetBinContent(1.1*i));
12516 ptHist3Shifted->SetLineColor(2);
12519 ptHist3Shifted->Rebin(2);
12521 ptHist3->DrawCopy();
12522 ptHist3Shifted->DrawCopy("SAME");
12525 ptHist3->Divide(ptHist3Shifted);
12528 //ptHist3->Rebin(2); ptHist3->Scale(1.0 / 2);
12534 void RAA(const char* fileName, const char* fileName2)
12540 for (Int_t j=0; j<2; j++)
12543 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12549 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName2);
12552 ptHist3 = h->GetCorrelationpT()->ProjectionY(Form("proj1_%d", j), 1, 5);
12553 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12555 //h->GetCentralityDistribution()->Draw(); new TCanvas;
12557 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(4.99));
12558 Printf("%d", nEvents);
12559 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12565 hist[0]->DrawCopy("");
12566 hist[1]->DrawCopy("SAME")->SetLineColor(2);
12570 hist[1]->Divide(hist[0]);
12571 hist[1]->DrawCopy();
12573 raa_central = ReadHepdata("raa_alice_central.txt", kFALSE, 3);
12574 raa_central->SetMarkerStyle(20);
12575 raa_central->Draw("PSAME");
12578 void PtComparison(const char* fileName, const char* fileName2 = 0)
12585 for (Int_t j=0; j<2; j++)
12588 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12594 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName2);
12597 //new TCanvas; h->GetCorrelationpT()->Draw("COLZ");
12599 ptHist3 = h->GetCorrelationpT()->ProjectionY(Form("proj1_%d", j), 1, 5);
12600 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12602 //h->GetCentralityDistribution()->Draw(); new TCanvas;
12604 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(0.01), h->GetCentralityDistribution()->FindBin(4.99));
12605 Printf("%d", nEvents);
12606 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12608 //ptHist3->Scale(1690);
12609 //ptHist3->Scale(1.0 / ptHist3->Integral(ptHist3->GetXaxis()->FindBin(1.01), ptHist3->GetNbinsX()) / 3 / 0.6);
12611 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
12612 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
12613 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
12615 //AliPWG0Helper::NormalizeToBinWidth(ptHist3);
12618 ptHist3->SetLineStyle(j+1);
12619 ptHist3->DrawCopy((j == 0) ? "HIST" : "HISTSAME")->SetLineColor(1);
12621 centralPt = (TH1*) ptHist3->Clone();;
12625 ptHist3 = h->GetCorrelationpT()->ProjectionY(Form("proj2_%d", j), 71, 80);
12626 ptHist3->GetXaxis()->SetRangeUser(0, 20);
12628 Int_t nEvents = h->GetCentralityDistribution()->Integral(h->GetCentralityDistribution()->FindBin(70.01), h->GetCentralityDistribution()->FindBin(79.99));
12629 ptHist3->Scale(1.0 / 1.6 / TMath::TwoPi() / nEvents / ptHist3->GetBinWidth(1));
12630 //ptHist3->Scale(10.0 / ptHist3->Integral(ptHist3->GetXaxis()->FindBin(1.01), ptHist3->GetNbinsX()) / 3 / 0.6);
12631 Printf("%d", nEvents);
12633 for (Int_t i=2; i<ptHist3->GetNbinsX(); i++)
12634 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinCenter(i));
12635 //ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / ptHist3->GetBinLowEdge(i));
12638 ptHist3->SetLineStyle(j+1);
12639 ptHist3->DrawCopy("HISTSAME")->SetLineColor(2);
12641 dndpt_central = ReadHepdata("raa_dndpt_central.txt", kFALSE, 3);
12642 dndpt_peripheral = ReadHepdata("raa_dndpt_peripheral.txt", kFALSE, 3);
12644 // RemovePointsBelowX(dndpt_central, 1);
12645 // RemovePointsBelowX(dndpt_peripheral, 1);
12647 // NormalizeTo(dndpt_central, 1);
12648 // NormalizeTo(dndpt_peripheral, 10);
12650 dndpt_central->Draw("*SAME");
12651 dndpt_peripheral->SetLineColor(2);
12652 dndpt_peripheral->SetMarkerColor(2);
12653 dndpt_peripheral->Draw("*SAME");
12659 for (Int_t i=1; i<ptHist3->GetNbinsX(); i++)
12660 ptHist3->SetBinContent(i, ptHist3->GetBinContent(i) / dndpt_peripheral->Eval(ptHist3->GetBinCenter(i)));
12662 for (Int_t i=1; i<centralPt->GetNbinsX(); i++)
12663 centralPt->SetBinContent(i, centralPt->GetBinContent(i) / dndpt_central->Eval(centralPt->GetBinCenter(i)));
12665 ptHist3->Rebin(2); ptHist3->Scale(0.5);
12666 centralPt->Rebin(2); centralPt->Scale(0.5);
12668 ptHist3->DrawCopy((j == 0) ? "" : "SAME")->SetLineColor(2);
12669 centralPt->DrawCopy("SAME")->SetLineColor(1);
12674 ReadYields("preliminaries/yields_110303.root");
12676 ptHist3->Scale(100);
12678 TGraphErrors** tmp = yields[0][1][0];
12679 nearSide = tmp[18];
12680 nearSide->Draw("* SAME");
12682 TGraphErrors** tmp = yields[1][1][0];
12683 awaySide = tmp[18];
12684 awaySide->SetLineColor(2);
12685 awaySide->SetMarkerColor(2);
12686 awaySide->Draw("* SAME");
12690 void style(Int_t styleId = 1)
12692 gStyle->SetPalette(1);
12693 gStyle->SetCanvasColor(10);
12694 gStyle->SetHistFillColor(10);
12695 gStyle->SetHistFillStyle(0);
12696 gStyle->SetOptStat(0);
12697 gStyle->SetPadTickX(1);
12698 gStyle->SetPadTickY(1);
12699 gStyle->SetAxisColor(1, "X");
12700 gStyle->SetAxisColor(1, "Y");
12701 gStyle->SetAxisColor(1, "Z");
12702 gStyle->SetLabelColor(1, "X");
12703 gStyle->SetLabelColor(1, "Y");
12704 gStyle->SetLabelColor(1, "Z");
12705 gStyle->SetTickLength(0.03, "X");
12706 gStyle->SetTickLength(0.03, "Y");
12707 gStyle->SetTickLength(0.03, "Z");
12708 gStyle->SetTitleXSize(0.05);
12709 gStyle->SetTitleYSize(0.05);
12710 gStyle->SetNdivisions(506, "X");
12711 gStyle->SetNdivisions(506, "Y");
12712 gStyle->SetNdivisions(506, "Z");
12714 //gStyle->SetPadGridX(1);
12715 //gStyle->SetPadGridY(1);
12717 //gStyle->SetLabelOffset(0.02, "X");
12718 //gStyle->SetLabelOffset(0.02, "Y");
12719 //gStyle->SetLabelOffset(0.02, "Z");
12720 gStyle->SetLabelSize(0.05, "X");
12721 gStyle->SetLabelSize(0.05, "Y");
12722 gStyle->SetLabelSize(0.05, "Z");
12724 gStyle->SetPadLeftMargin(0.12);
12725 gStyle->SetPadRightMargin(0.02);
12726 gStyle->SetPadBottomMargin(0.13);
12727 gStyle->SetPadTopMargin(0.02);
12729 gStyle->SetMarkerSize(1.4); // CKB
12731 const int iFont = 42; // type * 10 + prec 6: helvetica bold 13: times normal 2: times bold
12734 *-* 1 : times-medium-i-normal "Times New Roman" 1 4
12735 *-* 2 : times-bold-r-normal "Times New Roman" 0 7
12736 *-* 3 : times-bold-i-normal "Times New Roman" 1 7
12737 *-* 4 : helvetica-medium-r-normal "Arial" 0 4
12738 *-* 5 : helvetica-medium-o-normal "Arial" 1 4
12739 *-* 6 : helvetica-bold-r-normal "Arial" 0 7
12740 *-* 7 : helvetica-bold-o-normal "Arial" 1 7
12741 *-* 8 : courier-medium-r-normal "Courier New" 0 4
12742 *-* 9 : courier-medium-o-normal "Courier New" 1 4
12743 *-* 10 : courier-bold-r-normal "Courier New" 0 7
12744 *-* 11 : courier-bold-o-normal "Courier New" 1 7
12745 *-* 12 : symbol-medium-r-normal "Symbol" 0 6
12746 *-* 13 : times-medium-r-normal "Times New Roman" 0 4
12747 *-* 14 : "Wingdings" 0 4
12750 //gStyle->SetTitleXOffset(1); // 1.1
12751 //gStyle->SetTitleYOffset(1); // 1-4
12753 gStyle->SetLabelFont(iFont, "xyz");
12754 gStyle->SetStatFont(iFont);
12755 gStyle->SetTitleFont(iFont, "xyz");
12756 gStyle->SetTextFont(iFont);
12760 gStyle->SetLabelSize(0.07, "X");
12761 gStyle->SetLabelSize(0.07, "Y");
12762 gStyle->SetLabelSize(0.07, "Z");
12763 gStyle->SetTitleXSize(0.07);
12764 gStyle->SetTitleYSize(0.07);
12766 gStyle->SetPadLeftMargin(0.26);
12767 gStyle->SetPadRightMargin(0.01);
12768 gStyle->SetPadBottomMargin(0.15);
12769 gStyle->SetPadTopMargin(0.01);
12772 //gStyle->SetEndErrorSize(0.0);
12774 gROOT->ForceStyle();
12778 void NormalizeTo(TGraphErrors* graph, Float_t normalizeTo)
12781 for (Int_t i=0; i<graph->GetN(); i++)
12782 sum += graph->GetY()[i];
12784 if (normalizeTo > 0 && sum > 0)
12786 sum /= normalizeTo;
12787 for (Int_t i=0; i<graph->GetN(); i++)
12789 graph->SetPoint(i, graph->GetX()[i], graph->GetY()[i] / sum);
12790 graph->SetPointError(i, graph->GetEX()[i], graph->GetEY()[i] / sum);
12795 void CompareMixedEvent(const char* fileName)
12799 Float_t leadingPtArr[] = { 6.0, 8.0, 10.0, 15.0, 15.0 };
12800 Float_t assocPtArr[] = { 0.5, 1.5, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
12801 Int_t leadingPtOffset = 2;
12802 Int_t centralityBins[] = { 0, 0, 1, 6, 9, 16 };
12804 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
12807 for (Int_t j=2; j<5; j++)
12809 gpTMin = assocPtArr[j] + 0.01;
12810 gpTMax = assocPtArr[j+1] - 0.01;
12815 SetupRanges(hMixed);
12817 TH2* mixed = hMixed->GetUEHist(2)->GetUEHist(6, 0, leadingPtArr[i] + 0.01, leadingPtArr[i+leadingPtOffset] - 0.01, centralityBins[j], centralityBins[j+1]-1, 1);
12821 TH1* histMixedproj = mixed->ProjectionY();
12822 histMixedproj->Scale(1.0 / mixed->GetNbinsX());
12824 for (Int_t x=1; x<=mixed->GetNbinsX(); x++)
12825 for (Int_t y=1; y<=mixed->GetNbinsY(); y++)
12826 mixed->SetBinContent(x, y, histMixedproj->GetBinContent(y));
12828 histMixedproj->Scale(1.0 / (0.5 * (histMixedproj->GetBinContent(histMixedproj->GetXaxis()->FindBin(-0.01)) + histMixedproj->GetBinContent(histMixedproj->GetXaxis()->FindBin(0.01)))));
12830 histMixedproj->DrawCopy((j == 2) ? "" : "SAME")->SetLineColor(j-1);
12834 void FillParentTHnSparse(const char* fileName, Bool_t reduce = kFALSE, const char* tag = "")
12836 TString fileNameStr(fileName);
12838 if (fileNameStr.BeginsWith("/alice"))
12840 fileNameStr = Form("alien://%s", fileNameStr.Data());
12841 if (fileNameStr.EndsWith("merge"))
12842 fileNameStr += "/AnalysisResults.root";
12845 if (fileNameStr.BeginsWith("alien:"))
12846 TGrid::Connect("alien:");
12852 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNameStr, &list, kFALSE, tag);
12853 Printf("We have %d axes", ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0)->GetNVar()));
12856 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
12857 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->FillParent();
12858 ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
12860 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileNameStr, 0, kTRUE, tag);
12862 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->ReduceAxis();
12863 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->FillParent();
12864 ((AliTHn*) hMixed->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
12866 TString newFileName(fileNameStr);
12868 if (fileNameStr.BeginsWith("alien:"))
12869 newFileName = gSystem->BaseName(newFileName);
12871 newFileName.ReplaceAll(".root", "");
12873 newFileName += "_.root";
12875 newFileName += "_zvtx.root";
12877 file3 = TFile::Open(newFileName, "RECREATE");
12878 file3->mkdir("PWG4_PhiCorrelations");
12879 file3->cd("PWG4_PhiCorrelations");
12880 list->Write("histosPhiCorrelations", TObject::kSingleKey);
12884 void CompareZVertex(const char* fileName)
12888 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12889 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
12891 axis = h->GetUEHist(2)->GetEventHist()->GetAxis(2, 6);
12897 SetupRanges(hMixed);
12899 TFile::Open("test.root", "RECREATE");
12901 for (Int_t i=0; i<=axis->GetNbins(); i++)
12906 Printf("%d %f %f", i, axis->GetBinLowEdge(i) + 0.01, axis->GetBinUpEdge(i) - 0.01);
12907 h->SetZVtxRange(axis->GetBinLowEdge(i) + 0.01, axis->GetBinUpEdge(i) - 0.01);
12908 hMixed->SetZVtxRange(axis->GetBinLowEdge(i) + 0.01, axis->GetBinUpEdge(i) - 0.01);
12911 GetDistAndFlow(h, hMixed, &hist, 0, 6, 0, 10, 2.01, 14.99, 1, kTRUE, 0, kFALSE);
12914 hist->DrawCopy("SURF1");
12916 hist->Write(Form("detadphi_%d", i));
12918 // if (i == 0) break;
12922 hist->SetLineColor(i+1);
12923 hist->Scale(1.0 / hist->Integral() / hist->GetBinWidth(1));
12924 hist->Draw((i == 0) ? "" : "SAME");
12930 void DrawZRanges(Float_t min, Float_t max)
12932 legend = new TLegend(0.5, 0.5, 0.8, 0.8);
12934 TFile::Open("test.root");
12936 for (Int_t i=0; i<8; i++)
12938 if (i == 1 || i == 7)
12941 hist = (TH2*) gFile->Get(Form("detadphi_%d", i));
12942 hist->Rebin2D(2, 2);
12945 proj = hist->ProjectionY("proj", hist->GetXaxis()->FindBin(min), hist->GetXaxis()->FindBin(max));
12946 proj->Scale(1.0 / (hist->GetXaxis()->FindBin(max) - hist->GetXaxis()->FindBin(min) + 1));
12948 proj->SetLineColor(i+1);
12949 proj->DrawCopy((i == 0) ? "" : "SAME HIST");
12951 legend->AddEntry(proj->Clone(), Form("%d", i));
12957 void PlotTrackingEfficiency(const char* fileName)
12961 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
12963 c = new TCanvas("c", "c", 600, 600);
12964 gPad->SetLeftMargin(0.15);
12966 h->SetEtaRange(-0.89, 0.89);
12968 Float_t centralityBins[] = { 0, 10, 20, 40, 60, 100 };
12969 Int_t nCentralityBins = 5;
12971 legend = new TLegend(0.2, 0.15, 0.46, 0.42);
12972 legend->SetFillColor(0);
12974 Int_t colors[] = { 1, 2, 3, 4, 6 };
12976 for (Int_t i=0; i<nCentralityBins; i++)
12978 h->GetUEHist(2)->SetCentralityRange(centralityBins[i] + 0.1, centralityBins[i+1] - 0.1);
12979 proj = h->GetUEHist(2)->GetTrackingEfficiency(1);
12980 proj->GetYaxis()->SetRangeUser(0.7, 0.9);
12981 proj->GetXaxis()->SetRangeUser(0.5, 9.9);
12982 proj->GetYaxis()->SetTitleOffset(1.5);
12983 proj->SetTitle("");
12984 proj->GetYaxis()->SetTitle("Tracking efficiency");
12985 proj->SetMarkerColor(colors[i]);
12986 proj->SetLineColor(colors[i]);
12988 projClone = proj->DrawClone((i == 0) ? "" : "SAME");
12990 legend->AddEntry(projClone, Form("%.0f-%.0f%%", centralityBins[i], centralityBins[i+1]));
12994 // DrawLatex(0.58, 0.85, 1, "HIJING Pb-Pb 2.76 TeV", 0.03);
12995 // DrawLatex(0.58, 0.81, 1, "|#eta| < 0.9", 0.03);
12997 // DrawALICELogo(kFALSE, 0.7, 0.2, 0.9, 0.4);
12999 c->SaveAs("correction_tracking.eps");
13001 c = new TCanvas("c2", "c2", 600, 600);
13002 gPad->SetLeftMargin(0.15);
13004 proj = (TH1D*) h->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepTracked, AliUEHist::kCFStepTrackedOnlyPrim, 1);
13005 proj->GetYaxis()->SetRangeUser(0.8, 1.0);
13006 proj->GetXaxis()->SetRangeUser(0.5, 9.9);
13007 proj->GetYaxis()->SetTitleOffset(1.5);
13008 proj->SetTitle("");
13009 proj->GetYaxis()->SetTitle("contamination correction");
13011 projClone = proj->DrawClone("");
13013 // DrawLatex(0.58, 0.85, 1, "HIJING Pb-Pb 2.76 TeV", 0.03);
13014 // DrawLatex(0.58, 0.81, 1, "|#eta| < 0.9", 0.03);
13015 // DrawALICELogo(kFALSE, 0.7, 0.2, 0.9, 0.4);
13017 c->SaveAs("correction_contamination.eps");
13019 c = new TCanvas("c3", "c3", 600, 600);
13020 gPad->SetLeftMargin(0.15);
13022 proj = (TH1D*) h->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepTrackedOnlyPrim, AliUEHist::kCFStepTracked, 1);
13023 proj->GetYaxis()->SetRangeUser(0.95, 1.15);
13024 proj->GetXaxis()->SetRangeUser(0.5, 9.9);
13025 proj->GetYaxis()->SetTitleOffset(1.5);
13026 proj->SetTitle("");
13027 proj->GetYaxis()->SetTitle("contamination");
13029 projClone = proj->DrawClone("");
13031 // DrawLatex(0.58, 0.85, 1, "HIJING Pb-Pb 2.76 TeV", 0.03);
13032 // DrawLatex(0.58, 0.81, 1, "|#eta| < 0.9", 0.03);
13033 // DrawALICELogo(kFALSE, 0.7, 0.2, 0.9, 0.4);
13035 c->SaveAs("contamination.eps");
13038 void PlotCorrections(const char* fileName, const char* tag = "")
13042 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE, tag);
13044 c = new TCanvas("c", "c", 1200, 800);
13047 c2 = new TCanvas("c2", "c2", 800, 900);
13050 h->SetEtaRange(-0.89, 0.89);
13051 // h->SetEtaRange(-1.19, 1.19);
13053 Float_t centrBins[] = { 0, 20, 40, 60, 100.1 };
13055 for (Int_t i=0; i<4; i++)
13057 h->GetUEHist(2)->SetCentralityRange(centrBins[i] + 0.1, centrBins[i+1] - 0.1);
13059 h->GetUEHist(2)->GetTrackingEfficiency()->DrawClone("COLZ");
13062 proj = h->GetUEHist(2)->GetTrackingEfficiency(1);
13063 proj->SetTitle(""); proj->SetStats(0);
13064 proj->GetYaxis()->SetTitle("tracking efficiency");
13065 proj->SetLineColor(i+1);
13066 proj->DrawClone((i == 0) ? "" : "SAME");
13069 proj = h->GetUEHist(2)->GetTrackingEfficiency(0);
13070 proj->GetYaxis()->SetTitle("tracking efficiency");
13071 proj->SetTitle(""); proj->SetStats(0);
13072 proj->GetXaxis()->SetTitle("#eta");
13073 proj->SetLineColor(i+1);
13074 proj->DrawClone((i == 0) ? "" : "SAME");
13077 proj = h->GetUEHist(2)->GetTrackingContamination(1);
13078 proj->GetYaxis()->SetTitle("contamination correction");
13079 proj->SetTitle(""); proj->SetStats(0);
13080 proj->SetLineColor(i+1);
13081 proj->DrawClone((i == 0) ? "" : "SAME");
13085 h->GetUEHist(2)->SetCentralityRange(0, -1);
13086 for (Int_t i=0; i<10; i++)
13089 h->SetZVtxRange(-10.0 + 2 * i, -8.0 + 2 * i);
13090 proj = h->GetUEHist(2)->GetTrackingEfficiency(0);
13091 proj->GetYaxis()->SetTitle("tracking efficiency");
13092 proj->SetTitle(""); proj->SetStats(0);
13093 proj->GetXaxis()->SetTitle("#eta");
13094 proj->SetLineColor(i+1);
13095 proj->DrawClone((i == 0) ? "" : "SAME");
13098 h->SetZVtxRange(0, -1);
13100 for (Int_t i=0; i<4; i++)
13103 h->SetPartSpecies(i);
13104 proj = h->GetUEHist(2)->GetTrackingEfficiency(1);
13105 proj->GetYaxis()->SetTitle("tracking efficiency");
13106 proj->SetTitle(""); proj->SetStats(0);
13107 // proj->GetXaxis()->SetTitle("#eta");
13108 proj->SetLineColor(i+1);
13109 proj->DrawClone((i == 0) ? "" : "SAME");
13115 h->GetUEHist(2)->GetTrackingContamination()->Draw("COLZ");*/
13117 proj2 = h->GetUEHist(2)->GetTrackingEfficiency(1);
13118 // proj2 = h->GetUEHist(2)->GetTrackEfficiency(AliUEHist::kCFStepAnaTopology, (AliUEHist::CFStep) (AliUEHist::kCFStepTrackedOnlyPrim+2), 1);
13123 hist = h->GetUEHist(2)->GetCorrelatedContamination();
13124 // if (hist->GetEntries() > 0)
13125 // hist->Draw("COLZ");
13128 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)
13130 // partSpecies= -1 No PID, 0: Pions, 1: Kaons, 2: Protons
13131 // icharge is needed because GF correction applies only to negative particles, 0:Positive 1:negative
13132 // ApplyGFCorrection, for Geant3 version >= v1.14 this correction is not needed anymore for antiprotons
13133 // the number of TRD modules installed depends on the year
13137 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, 0, kFALSE, tag);
13139 if(partSpecies!=-1){
13140 Double_t epsilon=0.001;
13141 h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
13142 h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(4)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
13145 Int_t dimensions[] = { 0, 1, 3, 4 }; // eta, pT, centrality, vertex
13146 THnBase* generated = h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->ProjectionND(4, dimensions);
13147 THnBase* measured = h->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid((partSpecies==-1)?2:4)->GetGrid()->ProjectionND(4, dimensions); //for ID particle the matched+identified are taken
13149 // new TCanvas; measured->Projection(0, 1, 3)->Draw();
13151 Printf("%f %f", generated->GetEntries(), measured->GetEntries());
13153 Int_t nBins[] = { generated->GetAxis(0)->GetNbins(), generated->GetAxis(1)->GetNbins(), 1, generated->GetAxis(3)->GetNbins() };
13155 if (condenseCentrality)
13157 Double_t centrAxis[] = { 0, 101 };
13161 Double_t centrAxis[] = { 0, 10, 20, 40, 60, 101 };
13165 generated_new = new THnF("generated_new", "", 4, nBins, 0, 0);
13167 generated_new->SetBinEdges(0, generated->GetAxis(0)->GetXbins()->GetArray()); //eta
13168 generated_new->SetBinEdges(1, generated->GetAxis(1)->GetXbins()->GetArray()); //pT
13169 generated_new->SetBinEdges(2, centrAxis); //centrality
13170 generated_new->SetBinEdges(3, generated->GetAxis(3)->GetXbins()->GetArray()); //vertex
13172 for (Int_t i=0; i<4; i++)
13173 generated_new->GetAxis(i)->SetTitle(generated->GetAxis(i)->GetTitle());
13175 measured_new = (THnF*) generated_new->Clone("measured_new");
13176 effCorr = (THnF*) generated_new->Clone("correction");
13178 generated_new->RebinnedAdd(generated);
13179 measured_new->RebinnedAdd(measured);
13181 // new TCanvas; measured_new->Projection(0, 1, 3)->Draw();
13185 Printf("%f %f", generated_new->GetEntries(), measured_new->GetEntries());
13187 effCorr->Divide(generated_new, measured_new, 1, 1, "B");
13188 // effCorr->Divide(measured_new);
13190 if(ApplyGFCorrection && partSpecies!=-1){//define the functions for the GF correction
13194 if(year==2011)ntrd=10;
13195 if(year>=2012)ntrd=13;
13196 Printf("Number of TRD module in %d : %d",year,ntrd);
13197 Printf("Applying GF correction for particle specie %d %s",partSpecies,Sign[icharge].Data());
13198 Int_t partSpeciesAliPID=partSpecies+2; //in AliPID 2: Pions 3:Kaons 4:protons
13199 fGFTracking = TrackingEff_geantflukaCorrection(partSpeciesAliPID,(icharge==0)?kPositive:kNegative);
13200 fGFMatching = TOFmatchMC_geantflukaCorrection(partSpeciesAliPID,(icharge==0)?kPositive:kNegative,ntrd);
13201 TCanvas *cGF=new TCanvas("cGF","cGF");
13202 fGFTracking->SetLineColor(1);
13203 fGFTracking->DrawClone();
13204 fGFMatching->DrawClone("same");
13205 gPad->BuildLegend();
13208 Double_t maxEffValue=5;
13209 for (Int_t bin0 = 1; bin0<=effCorr->GetAxis(0)->GetNbins(); bin0++)
13210 for (Int_t bin1 = 1; bin1<=effCorr->GetAxis(1)->GetNbins(); bin1++)
13211 for (Int_t bin2 = 1; bin2<=effCorr->GetAxis(2)->GetNbins(); bin2++)
13212 for (Int_t bin3 = 1; bin3<=effCorr->GetAxis(3)->GetNbins(); bin3++)
13219 // 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));
13220 if(ApplyGFCorrection && partSpecies!=-1)
13222 if(effCorr->GetBinContent(nBins) > 0)
13224 Double_t pt=effCorr->GetAxis(1)->GetBinCenter(bin1);
13225 Double_t GFTracking=fGFTracking->Eval(pt);
13226 Double_t GFMatching=fGFMatching->Eval(pt);
13227 //printf("pt: %.3f GFCorrectionTracking: %f GFCorrectionMatching: %f",pt,GFTracking,GFMatching);
13228 //printf(" Eff before: %f",effCorr->GetBinContent(nBins));
13229 effCorr->SetBinContent(nBins,effCorr->GetBinContent(nBins)*GFTracking*GFMatching);
13230 //Printf(" Eff after: %f",effCorr->GetBinContent(nBins));
13234 if (effCorr->GetBinContent(nBins) > maxEffValue)
13236 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));
13237 effCorr->SetBinContent(nBins, 0);
13243 const Float_t fitRangeBegin = 5.01;
13244 const Float_t fitRangeEnd = 14.99;
13245 const Float_t extendRangeBegin = 8.01;
13246 Bool_t verbose = kTRUE;
13248 if (extrapolateHighpT)
13250 Printf("Extrapolating high pT...");
13252 for (Int_t bin0 = 1; bin0<=effCorr->GetAxis(0)->GetNbins(); bin0++)
13253 for (Int_t bin2 = 1; bin2<=effCorr->GetAxis(2)->GetNbins(); bin2++)
13254 for (Int_t bin3 = 1; bin3<=effCorr->GetAxis(3)->GetNbins(); bin3++)
13256 effCorr->GetAxis(0)->SetRange(bin0, bin0);
13257 effCorr->GetAxis(2)->SetRange(bin2, bin2);
13258 effCorr->GetAxis(3)->SetRange(bin3, bin3);
13260 if (gRandom->Uniform() < 0.02) verbose = kTRUE;
13262 proj = effCorr->Projection(1);
13264 if (proj->Integral(proj->FindBin(fitRangeBegin), proj->FindBin(fitRangeEnd)) <= 0)
13267 // Printf("%d %d %d %d %f", bin0, bin1, bin2, bin3, proj->Integral(proj->FindBin(fitRangeBegin), proj->FindBin(fitRangeEnd)));
13275 proj->Fit("pol0", (verbose) ? "+" : "Q0+", "SAME", fitRangeBegin, fitRangeEnd);
13277 if (!proj->GetFunction("pol0"))
13280 Float_t trackingEff = proj->GetFunction("pol0")->GetParameter(0);
13282 for (Int_t bin1 = 1; bin1<=effCorr->GetAxis(1)->GetNbins(); bin1++)
13284 if (effCorr->GetAxis(1)->GetBinCenter(bin1) < extendRangeBegin)
13292 // 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));
13293 effCorr->SetBinContent(nBins, trackingEff);
13300 effCorr->GetAxis(0)->UnZoom();
13301 effCorr->GetAxis(1)->UnZoom();
13302 effCorr->GetAxis(2)->UnZoom();
13303 effCorr->GetAxis(3)->UnZoom();
13306 Printf("%f", effCorr->GetEntries());
13308 TObjString tag2(Form("corrections from file %s with tag %s", fileName, tag));
13310 file = TFile::Open("correction.root", "RECREATE");
13316 effCorr->GetAxis(0)->SetRangeUser(-0.49, 0.49);
13317 effCorr->GetAxis(2)->SetRangeUser(65, 65);
13318 effCorr->GetAxis(3)->SetRangeUser(0.01, 0.01);
13319 effCorr->Projection(1)->Draw();
13322 void CompareEfficiencyCorrection(const char* fileName1, const char* fileName2, Int_t axis1, Int_t axis2)
13324 if (TString(fileName1).BeginsWith("alien") || TString(fileName2).BeginsWith("alien"))
13325 TGrid::Connect("alien:");
13327 file1 = TFile::Open(fileName1);
13328 corr1 = (THnBase*) file1->Get("correction");
13330 file2 = TFile::Open(fileName2);
13331 corr2 = (THnBase*) file2->Get("correction");
13333 corr1->GetAxis(0)->SetRangeUser(-1.19, 1.19);
13334 corr2->GetAxis(0)->SetRangeUser(-1.19, 1.19);
13335 corr1->GetAxis(1)->SetRangeUser(0.51, 3.99);
13336 corr2->GetAxis(1)->SetRangeUser(0.51, 3.99);
13337 corr1->GetAxis(3)->SetRangeUser(0.01, 0.01);
13338 corr2->GetAxis(3)->SetRangeUser(0.01, 0.01);
13340 proj1 = (TH1*) corr1->Projection(axis1, axis2)->Clone("proj1");
13341 new TCanvas; proj1->DrawCopy("COLZ");
13343 proj2 = (TH1*) corr2->Projection(axis1, axis2)->Clone("proj2");
13344 new TCanvas; proj2->DrawCopy("COLZ");
13346 proj1->Divide(proj2);
13347 new TCanvas; proj1->DrawCopy("COLZ");
13349 corr1->GetAxis(0)->SetRangeUser(-0.49, 0.49);
13350 corr2->GetAxis(0)->SetRangeUser(-0.49, 0.49);
13352 proj1 = (TH1*) corr1->Projection(axis2)->Clone("proj3");
13353 new TCanvas; proj1->DrawCopy();
13355 proj2 = (TH1*) corr2->Projection(axis2)->Clone("proj4");
13356 proj2->SetLineColor(2);
13357 proj2->DrawCopy("SAME");
13359 proj1->Divide(proj2);
13360 new TCanvas; proj1->DrawCopy();
13365 void PlotFake(const char* fileName, const char* fileName2 = 0)
13369 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13370 if (fileName2) AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
13372 TLegend* legend = new TLegend(0.7, 0.8, 0.95, 0.95);
13373 legend->SetFillColor(0);
13374 legend->SetTextSize(0.03);
13375 const char* title[] = {"0-20%", "20-40%", "40-60%", "60-80%", "80-100%"};
13376 TLegend* legend2 = new TLegend(0.7, 0.8, 0.95, 0.95);
13377 legend2->SetFillColor(0);
13378 legend2->SetTextSize(0.03);
13380 c1 = new TCanvas("c1", "Ratio of fakes", 1200, 800);
13382 c2 = new TCanvas("c2", "pTrec vs pT", 1200, 800);
13384 c3 = new TCanvas("c3", "pTrec pT ratio", 1200, 800);
13387 h->SetEtaRange(-0.79, 0.79);
13389 for (Int_t i=0; i<5; i++)
13391 // h->GetUEHist(2)->SetCentralityRange(100.0/5*i + 0.1, 100.0/5*(i+1) - 0.1);
13392 h->GetUEHist(2)->SetCentralityRange(0, 100);
13394 h->GetUEHist(2)->GetFakeRate()->DrawClone("COLZ");
13396 proj = h->GetUEHist(2)->GetFakeRate(1);
13397 proj->GetYaxis()->SetRangeUser(0,150);
13398 proj->SetLineColor((i==4) ? 6 : i+1);
13399 proj->DrawClone((i == 0) ? "" : "SAME");
13400 legend->AddEntry(proj, title[i] , "PL");
13406 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetXaxis()->SetTitle("p_{T,rec}");
13407 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetYaxis()->SetTitle("p_{T}");
13408 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetZaxis()->SetTitle("Centrality");
13409 h->GetUEHist(2)->GetMCRecoPtCorrelation()->DrawCopy();
13411 Float_t difference = 0.05;
13413 for (Int_t i=0; i<5; i++)
13416 h->GetUEHist(2)->GetMCRecoPtCorrelation()->GetZaxis()->SetRangeUser(100.0/5*i + 0.1,100.0/5*(i+1) - 0.1);
13417 hist = h->GetUEHist(2)->GetMCRecoPtCorrelation()->Project3D("yx");
13418 hist->DrawClone("COLZ");
13419 c2->cd(i+2)->SetLogz();
13421 TH1* MisreconstructedPtRate = h->GetUEHist(2)->GetMCRecoPtCorrelation()->ProjectionX("MisreconstructedPtRate");
13422 MisreconstructedPtRate->Reset();
13423 MisreconstructedPtRate->GetYaxis()->SetRangeUser(0,1);
13425 for (Int_t x=0; x<=hist->GetNbinsX(); x++)
13427 Float_t ptRec = hist->GetXaxis()->GetBinCenter(x);
13428 Float_t Misreconstructed = 0;
13429 Float_t Reconstructed = 0;
13430 for (Int_t y=0; y<=hist->GetNbinsY(); y++)
13432 Float_t pt = hist->GetYaxis()->GetBinCenter(y);
13433 Reconstructed += hist->GetBinContent(x,y);
13434 if (TMath::Abs(ptRec-pt)/pt > difference)
13435 Misreconstructed += hist->GetBinContent(x,y);
13437 if (Reconstructed!=0) MisreconstructedPtRate->Fill(ptRec,Misreconstructed/Reconstructed);
13439 MisreconstructedPtRate->SetLineColor((i==4) ? 6 : i+1);
13440 MisreconstructedPtRate->DrawClone();
13441 if (i==0) legend2->AddEntry(MisreconstructedPtRate, "2010" , "L");
13443 MisreconstructedPtRate->DrawClone((i == 0) ? "" : "SAME");
13446 h2->GetUEHist(2)->GetMCRecoPtCorrelation()->GetZaxis()->SetRangeUser(100.0/5*i + 0.1,100.0/5*(i+1) - 0.1);
13447 hist = h2->GetUEHist(2)->GetMCRecoPtCorrelation()->Project3D("yx");
13448 TH1* MisreconstructedPtRate2 = h2->GetUEHist(2)->GetMCRecoPtCorrelation()->ProjectionX("MisreconstructedPtRate2");
13449 MisreconstructedPtRate2->Reset();
13450 MisreconstructedPtRate2->GetYaxis()->SetRangeUser(0,1);
13451 for (Int_t x=0; x<=hist->GetNbinsX(); x++)
13453 Float_t ptRec = hist->GetXaxis()->GetBinCenter(x);
13454 Float_t Misreconstructed = 0;
13455 Float_t Reconstructed = 0;
13456 for (Int_t y=0; y<=hist->GetNbinsY(); y++)
13458 Float_t pt = hist->GetYaxis()->GetBinCenter(y);
13459 Reconstructed += hist->GetBinContent(x,y);
13460 if (TMath::Abs(ptRec-pt)/pt > difference)
13461 Misreconstructed += hist->GetBinContent(x,y);
13463 if (Reconstructed!=0) MisreconstructedPtRate2->Fill(ptRec,Misreconstructed/Reconstructed);
13466 MisreconstructedPtRate2->SetLineColor((i==2) ? 12 : i+8);
13467 MisreconstructedPtRate2->DrawClone("SAME");
13468 if (i==0) legend2->AddEntry(MisreconstructedPtRate2, "2011" , "L");
13469 legend2->DrawClone();
13476 void CompareCorrections(const char* fileName1, const char* fileName2)
13480 AliUEHistograms* h1 = (AliUEHistograms*) GetUEHistogram(fileName1);
13481 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
13483 c = new TCanvas("c", "c", 1200, 800);
13485 TLegend* legend = new TLegend(0.7, 0.8, 0.95, 0.95);
13486 legend->SetFillColor(0);
13487 legend->SetTextSize(0.03);
13489 h1->SetEtaRange(-0.89, 0.89);
13490 h2->SetEtaRange(-0.89, 0.89);
13493 // const char* title1[] = {"2010, 0-10%", "2010, 10-20%", "2010, 20-30%", "2010, 30-40%", "2010, 40-50%"};
13494 const char* title1[] = {"FullTPC, 0-10%", "FullTPC, 10-20%", "FullTPC, 20-30%", "FullTPC, 30-40%", "FullTPC, 40-50%"};
13495 const char* title1[] = {"FullTPC, 0-10%", "FullTPC, 10-20%", "FullTPC, 20-30%", "FullTPC, 30-40%", "FullTPC, 40-50%"};
13496 // const char* title2[] = {"2011, 0-10%", "2011, 10-20%", "2011, 20-30%", "2011, 30-40%", "2011, 40-50%"};
13497 const char* title2[] = {"NotFullTPC, 0-10%", "NotFullTPC, 10-20%", "NotFullTPC, 20-30%", "NotFullTPC, 30-40%", "NotFullTPC, 40-50%"};
13499 Int_t colors[16] = { 1, 3, 2, 6, 4, 7, 8, 9, 11, 12, 28, 30, 36, 40, 46 };
13500 Int_t markers[16] = { 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 2, 5};
13502 for (Int_t i=0; i<5; i++)
13504 h1->GetUEHist(2)->SetCentralityRange(100.0/10*i + 0.1, 100.0/10*(i+1) - 0.1);
13505 h2->GetUEHist(2)->SetCentralityRange(100.0/10*i + 0.1, 100.0/10*(i+1) - 0.1);
13508 proj = h1->GetUEHist(2)->GetTrackingEfficiency(1);
13509 proj->SetLineColor(colors[6]);
13510 proj->SetMarkerColor(colors[6]);
13511 proj->SetMarkerStyle(markers[i]);
13512 proj->DrawClone((i == 0) ? "" : "SAME");
13513 legend->AddEntry(proj, title1[i] , "PL");
13515 proj = h2->GetUEHist(2)->GetTrackingEfficiency(1);
13516 proj->SetLineColor(colors[2]);
13517 proj->SetMarkerColor(colors[2]);
13518 proj->SetMarkerStyle(markers[i+5]);
13519 proj->SetMarkerStyle(markers[i]);
13520 proj->DrawClone("SAME");
13521 legend->AddEntry(proj, title2[i] , "PL");
13527 void ComparePPHIMixedEvent(const char* ppFile, const char* pbpbFile)
13531 AliUEHistograms* hpp = (AliUEHistograms*) GetUEHistogram(ppFile);
13532 AliUEHistograms* hpbpb = (AliUEHistograms*) GetUEHistogram(pbpbFile);
13535 hpp->SetPtRange(2, 10);
13536 ppEff = hpp->GetUEHist(2)->GetTrackingEfficiency(0);
13539 hpbpb->SetPtRange(2, 10);
13540 pbpbEff = hpbpb->GetUEHist(2)->GetTrackingEfficiency(0);
13541 pbpbEff->DrawCopy("SAME")->SetLineColor(2);
13544 ppEff2 = hpp->GetUEHist(2)->GetTrackingEfficiency(1);
13547 pbpbEff2 = hpbpb->GetUEHist(2)->GetTrackingEfficiency(1);
13548 pbpbEff2->DrawCopy("SAME")->SetLineColor(2);
13550 mixed = ComparePPHIMixedEventGetMixed(ppEff);
13551 mixed2 = ComparePPHIMixedEventGetMixed(pbpbEff);
13555 mixed2->DrawCopy("SAME")->SetLineColor(2);
13558 mixed->Divide(mixed2);
13562 TH1* ComparePPHIMixedEventGetMixed(TH1* eff)
13564 eff->Fit("pol0", "0W");
13565 Float_t avgEff = eff->GetFunction("pol0")->GetParameter(0);
13567 eff->Fit("pol0", "0W", "", -0.89, 0.89);
13568 Float_t avgEffCenter = eff->GetFunction("pol0")->GetParameter(0);
13569 Printf("Avg is %f and avg in center is %f", avgEff, avgEffCenter);
13571 TH1* mixed = new TH1F("mixed", "", 100, -2, 2);
13573 Float_t etaLimit = 1.0;
13577 for (Int_t i=0; i<n; i++)
13579 Float_t etaTrig = gRandom->Uniform(-etaLimit, etaLimit);
13581 for (Int_t j=0; j<n2; j++)
13583 Float_t etaAssoc = gRandom->Uniform(-etaLimit, etaLimit);
13585 if (gRandom->Uniform(0, 1) > eff->GetBinContent(eff->FindBin(etaAssoc)))
13588 mixed->Fill(etaTrig - etaAssoc);
13592 // mixed->Scale(1.0 / avgEffCenter);
13593 mixed->Scale(1.0 / avgEff);
13595 Printf("We have %f pairs and put in %d", mixed->Integral(), n*n2);
13600 void MACHConeEvolution(const char* fileName, const char* fileNameMixed = 0)
13604 if (!fileNameMixed)
13605 fileNameMixed = fileName;
13607 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13608 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileNameMixed, 0, kTRUE);
13610 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 10.0, 20.0, 40.0 };
13611 Float_t assocPtArr[] = { 1.0, 2.0, 3.0, 6.0, 10.0, 20.0, 40.0 };
13617 gpTMin = assocPtArr[i] + 0.01;
13618 gpTMax = assocPtArr[i+1] - 0.01;
13620 for (Int_t centrBin = 0; centrBin < 5; centrBin++)
13622 Int_t centralityBegin = centrBin;
13623 Int_t centralityEnd = centrBin+1;
13626 SetupRanges(hMixed);
13630 Bool_t scaleToPairs = 0;
13632 GetDistAndFlow(h, hMixed, &hist, 0, step, centralityBegin, centralityEnd, leadingPtArr[j] + 0.01, leadingPtArr[j+1] - 0.01, 11, kTRUE, 0, scaleToPairs);
13633 hist->Rebin(2); hist->Scale(0.5);
13635 copy = hist->DrawCopy((centrBin == 0) ? "" : "SAME");
13636 copy->SetLineColor(centrBin+1);
13640 void PlotTwoTrackEfficiencyControlPlots(const char* fileName)
13643 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13645 Float_t ptRange[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0 };
13647 graph = new TGraphErrors;
13649 for (Int_t ptID = 0; ptID < 7; ptID++)
13651 c = new TCanvas(Form("c%d", ptID), Form("%.0f < pT < %.0f", ptRange[ptID], ptRange[ptID+1]), 800, 400);
13654 for (Int_t i=0; i<2; i++)
13657 h->GetTwoTrackDistance(i)->GetZaxis()->SetRangeUser(ptRange[ptID] + 0.01, ptRange[ptID+1] - 0.01);
13658 p = h->GetTwoTrackDistance(i)->Project3D(Form("yx_%d_%d", i, ptID));
13662 pc = (TH2*) p->Clone("pc");
13665 p->DrawCopy("COLZ");
13669 // reduce to one quadrant
13670 for (Int_t x=1; x<=p->GetNbinsX(); x++)
13671 for (Int_t y=1; y<=p->GetNbinsY(); y++)
13672 pc->Fill(TMath::Abs(p->GetXaxis()->GetBinCenter(x)), TMath::Abs(p->GetYaxis()->GetBinCenter(y)), p->GetBinContent(x, y));
13675 copy = pc->DrawCopy("COLZ");
13676 copy->GetXaxis()->SetRangeUser(0, 10);
13677 copy->GetYaxis()->SetRangeUser(0.00101, 10);
13682 Float_t center = pc->Integral(pc->GetXaxis()->FindBin(0), pc->GetXaxis()->FindBin(0.009999), 1, pc->GetNbinsY());
13683 Float_t outside = pc->Integral(pc->GetXaxis()->FindBin(0.01001), pc->GetXaxis()->FindBin(0.04999), 1, pc->GetNbinsY());
13685 Float_t excess1 = center - outside / 4;
13687 Float_t center = pc->Integral(pc->GetXaxis()->FindBin(0), pc->GetXaxis()->FindBin(0.001999), 1, pc->GetNbinsY());
13688 Float_t outside = pc->Integral(pc->GetXaxis()->FindBin(0.002001), pc->GetXaxis()->FindBin(0.00999), 1, pc->GetNbinsY());
13690 Float_t excess2 = center - outside / 4;
13692 Printf("%d %f %f", ptID, excess1, excess2);
13698 p2 = ((TH2*)pc)->ProjectionX("p2", 52, 52+4);
13699 // p3 = ((TH2*)p)->ProjectionX("p3", 49-4, 49);
13701 //new TCanvas; p2->Draw();
13703 p2->Fit("pol0", "0");
13704 Float_t avg = p2->GetFunction("pol0")->GetParameter(0);
13705 p2->Fit("pol0", "0", "", -0.002, 0.002);
13706 Float_t min = p2->GetFunction("pol0")->GetParameter(0);
13707 Float_t mine = p2->GetFunction("pol0")->GetParError(0);
13711 graph->SetPoint(graph->GetN(), ptRange[ptID], min / avg);
13712 graph->SetPointError(graph->GetN()-1, 0, mine / avg);
13718 c->SaveAs(Form("twotrack_pt_%d_%d.png", (Int_t) ptRange[ptID], (Int_t) ptRange[ptID+1]));
13719 c->SaveAs(Form("twotrack_pt_%d_%d.eps", (Int_t) ptRange[ptID], (Int_t) ptRange[ptID+1]));
13727 void PlotTwoTrackEfficiencyControlPlots2(const char* fileName)
13730 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13732 Float_t ptRange[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0 };
13734 graph = new TGraphErrors;
13736 for (Int_t ptID = 0; ptID < 5; ptID++)
13738 c = new TCanvas(Form("c%d", ptID), Form("%.0f < pT < %.0f", ptRange[ptID], ptRange[ptID+1]), 1200, 400);
13743 for (Int_t i=0; i<3; i++)
13746 gPad->SetRightMargin(0.2);
13750 h->GetTwoTrackDistance(i)->GetZaxis()->SetRangeUser(ptRange[ptID] + 0.01, ptRange[ptID+1] - 0.01);
13751 p = (TH2*) h->GetTwoTrackDistance(i)->Project3D(Form("yx_%d_%d", i, ptID));
13755 // reduce to one quadrant
13756 pc = (TH2*) p->Clone(Form("%s_pc", p->GetName()));
13759 for (Int_t x=1; x<=p->GetNbinsX(); x++)
13760 for (Int_t y=1; y<=p->GetNbinsY(); y++)
13761 pc->Fill(TMath::Abs(p->GetXaxis()->GetBinCenter(x)), TMath::Abs(p->GetYaxis()->GetBinCenter(y)), p->GetBinContent(x, y));
13762 pc->GetXaxis()->SetRangeUser(0, 100);
13763 pc->GetYaxis()->SetRangeUser(0, 100);
13770 p->DrawCopy("COLZ");
13776 proj[0]->Divide(proj[1]);
13777 proj[0]->SetStats(0);
13779 // 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);
13780 Float_t scale = proj[0]->Integral(1, proj[1]->GetNbinsX(), 1, proj[1]->GetNbinsY()) / proj[1]->GetNbinsX() / proj[1]->GetNbinsY();
13781 proj[0]->Scale(1./ scale / 4);
13782 proj[0]->DrawCopy("COLZ");
13788 void PlotTwoTrackEfficiencyControlPlots3(const char* fileName, Int_t histID = 0)
13791 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13792 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
13794 Float_t ptRange[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0 };
13796 graph = new TGraphErrors;
13798 for (Int_t ptID = 0; ptID < 5; ptID++)
13800 c = new TCanvas(Form("c%d", ptID), Form("%.0f < pT < %.0f", ptRange[ptID], ptRange[ptID+1]), 1200, 400);
13805 for (Int_t i=0; i<3; i++)
13808 gPad->SetRightMargin(0.2);
13812 AliUEHistograms* input = ((i == 0) ? h : hMixed);
13813 input->GetTwoTrackDistance(histID)->GetZaxis()->SetRangeUser(ptRange[ptID] + 0.01, ptRange[ptID+1] - 0.01);
13814 p = (TH2*) input->GetTwoTrackDistance(histID)->Project3D(Form("yx_%d_%d", i, ptID));
13818 // reduce to one quadrant
13819 pc = (TH2*) p->Clone(Form("%s_pc", p->GetName()));
13821 // pc->Rebin2D(2, 2);
13822 for (Int_t x=1; x<=p->GetNbinsX(); x++)
13823 for (Int_t y=1; y<=p->GetNbinsY(); y++)
13824 pc->Fill(TMath::Abs(p->GetXaxis()->GetBinCenter(x)), TMath::Abs(p->GetYaxis()->GetBinCenter(y)), p->GetBinContent(x, y));
13825 pc->GetXaxis()->SetRangeUser(0, 100);
13826 pc->GetYaxis()->SetRangeUser(0, 100);
13833 p->DrawCopy("COLZ");
13839 Float_t scale = proj[0]->Integral() / proj[1]->Integral();
13840 proj[0]->Divide(proj[1]);
13841 proj[0]->SetStats(0);
13843 // 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);
13844 // Float_t scale = proj[0]->Integral(1, proj[1]->GetNbinsX(), 1, proj[1]->GetNbinsY()) / proj[1]->GetNbinsX() / proj[1]->GetNbinsY();
13845 proj[0]->Scale(1./ scale);
13846 // proj[0]->Scale(1./ scale / 4);
13847 proj[0]->DrawCopy("COLZ");
13855 void SystematicpTResolution(const char* inputYield, Int_t caseId = 18, Int_t triggerId = 1)
13857 // Study by Jacek comparing TPC only tracks with global tracks for new cuts (crossed rows) (Fwd by Andrew, 07.07.11)
13858 // Resolution from tpc only tracks twice as worse than global tracks
13859 // Parameterization for tpc-only tracks:
13860 // f(pT) = a * pT * sqrt(1+b/(pT^abs(c)))
13861 // a = 0.003; b = 2.08; c = 7.07e-7
13862 Float_t a = 0.003; Float_t b = 2.08; Float_t c = 7.07e-7;
13863 res = new TF1("res", "[0] * x * sqrt(1+[1]/(x**abs([2])))", 0, 15);
13864 res->SetParameters(a, b, c);
13865 // res->Draw(); return;
13867 ReadYields(inputYield);
13869 for (Int_t side = 0; side < 2; side++)
13871 for (Int_t centrality = 0; centrality < 4; centrality++)
13873 TGraphErrors** tmp = yields[side][triggerId][centrality];
13874 graph = tmp[caseId];
13876 // graph->DrawClone("A*");
13878 Float_t axisLimits[20];
13879 for (Int_t i=0; i<graph->GetN(); i++)
13881 axisLimits[i] = graph->GetX()[i] - graph->GetEX()[i];
13882 axisLimits[i+1] = graph->GetX()[i] + graph->GetEX()[i];
13885 hist = new TH1F("hist", "", graph->GetN(), axisLimits);
13887 for (Int_t i=0; i<graph->GetN(); i++)
13889 gaus = new TF1("gaus", "gaus(0)", 0, 15);
13890 Float_t sigma = graph->GetX()[i] * res->Eval(graph->GetX()[i]);
13891 Float_t norm = graph->GetY()[i] / TMath::Sqrt(2 * TMath::Pi()) / sigma;
13892 gaus->SetParameters(norm, graph->GetX()[i], sigma);
13893 // gaus->Draw("SAME");
13894 // Printf("%f %f", graph->GetY()[i], gaus->Integral(0, 20));
13897 for (Int_t j=1; j<=hist->GetNbinsX(); j++)
13898 hist->SetBinContent(j, hist->GetBinContent(j) + gaus->Integral(hist->GetBinLowEdge(j), hist->GetXaxis()->GetBinUpEdge(j)));
13901 // hist->Draw("SAME"); return;
13903 for (Int_t i=0; i<graph->GetN(); i++)
13904 graph->GetY()[i] = hist->GetBinContent(i+1);
13906 // graph->SetMarkerColor(2); graph->DrawClone("*SAME");
13911 void DrawProcessIDPlot(const char* fileName)
13915 TFile::Open(fileName);
13916 list = (TList*) gFile->Get("PWG4_PhiCorrelations/histosPhiCorrelations");
13917 ((TH1*) list->FindObject("processIDs"))->Draw();
13920 void GetExampleDphi(const char* fileName)
13924 Int_t leadingPtOffset = 1;
13926 Int_t maxLeadingPt = 5;
13927 Int_t maxAssocPt = 6;
13930 Float_t leadingPtArr[] = { 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 15.0, 20.0 };
13931 Float_t assocPtArr[] = { 0.15, 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 10.0, 12.0 };
13935 Float_t leadingPtArr[] = { 0.15, 10.0 };
13936 Float_t assocPtArr[] = { 0.15, 10.0 };
13938 leadingPtOffset = 1;
13940 // AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
13941 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
13945 // h->SetZVtxRange(-0.99, 0.99);
13946 hMixed->SetZVtxRange(-0.99, 0.99);
13952 gpTMin = assocPtArr[j] + 0.01;
13953 gpTMax = assocPtArr[j+1] - 0.01;
13956 SetupRanges(hMixed);
13959 bin[0] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(0)->FindBin(0.01);
13960 bin[1] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(1)->FindBin(1.1);
13961 bin[2] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(2)->FindBin(2.1);
13962 bin[3] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(3)->FindBin(5.5);
13963 bin[4] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(4)->FindBin(0);
13964 if (hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5))
13965 bin[5] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5)->FindBin(0);
13966 Printf("tracks: %f +- %f", hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetBinContent(bin), hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetBinError(bin));
13968 bin[0] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(2)->FindBin(2.1);
13969 bin[1] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(3)->FindBin(5.5);
13970 if (hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5))
13971 bin[2] = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(0)->GetGrid()->GetAxis(5)->FindBin(0);
13972 Printf("events: %f +- %f", hMixed->GetUEHist(2)->GetEventHist()->GetGrid(6)->GetGrid()->GetBinContent(bin), hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(6)->GetGrid()->GetBinError(bin));
13976 Int_t stepMixed = 6;
13977 TH2* mixedTwoD = (TH2*) hMixed->GetUEHist(2)->GetUEHist(stepMixed, 0, leadingPtArr[i+leadingPtOffset], leadingPtArr[i+1+leadingPtOffset], 12, 13, 1, kFALSE);
13979 TH1* proj = mixedTwoD->ProjectionX("px", 11, 30);
13985 func = new TF1("func", "gaus(0)", -2, 2);
13986 func->SetParameters(1, 0, 0.5);
13988 hist = new TH1F("hist", "", 100, -2, 2);
13989 hist->FillRandom("func", 10000);
13991 func = new TF1("func", "gaus(0)", -2, 2);
13992 func->SetParLimits(2, 0, 10);
13993 func->FixParameter(1, 0);
13994 func->SetParameters(2, 0, 0.1);
13995 hist->Fit(func, "", "", -1, 1);
13998 func2 = new TF1("func2", "gaus(0)+[3]", -2, 2);
13999 func2->SetParLimits(2, 0, 10);
14000 func2->FixParameter(1, 0);
14001 func2->SetParameters(2, 0, 0.1, 0);
14002 func2->SetLineColor(2);
14003 hist->Fit(func2, "+", "", -1, 1);
14008 constant = new TF1("constant", "1", -2, 2);
14009 hist->Add(constant, -30);
14010 func->SetParameters(2, 0, 0.1);
14011 hist->Fit(func, "", "", -1, 1);
14014 void GaussToyFit2()
14016 func = new TF2("func", "[0]*exp(-0.5*((x/[1])**2+(y/[2])**2))", -2, 2, -2, 2);
14017 func->SetParameters(1, 0.4, 0.6);
14019 hist = new TH2F("hist", "", 100, -2, 2, 100, -2, 2);
14020 hist->FillRandom("func", 100000);
14022 func = new TF2("func", "[0]*exp(-0.5*((x/[1])**2+(y/[2])**2))", -2, 2, -2, 2);
14023 func->SetParameters(1, 0.2, 0.2);
14024 hist->Fit(func, "", "");
14028 hist->ProjectionX()->Fit("gaus");
14031 hist->ProjectionY()->Fit("gaus");
14034 void AcceptanceToy()
14036 // study a la Jan Rak presented in Corr PAG on 06.03.12
14038 hist = new TH1F("hist", "", 200, -1.5, 1.5);
14040 Float_t sigma = 0.3;
14041 for (Int_t i=0; i<1000000; i++)
14044 Float_t mean = gRandom->Uniform(-5, 5);
14046 Float_t trig = gRandom->Gaus(mean, sigma);
14047 Float_t assoc = gRandom->Gaus(mean, sigma);
14049 // Float_t trig = gRandom->Uniform(-5, 5);
14050 // Float_t assoc = gRandom->Uniform(-5, 5);
14052 /* if (trig < 0 && assoc < trig)
14054 if (trig > 0 && assoc > trig)
14057 if (TMath::Abs(trig) < 1 && TMath::Abs(assoc) < 1)
14058 // hist->Fill(trig - assoc);
14059 hist->Fill(trig - assoc, 1.0 / (1.0 - TMath::Abs(trig-assoc) / 2));
14063 hist->Fit("gaus", "", "", -1.5, 1.5);
14064 Printf("%f %f %f", sigma, hist->GetFunction("gaus")->GetParameter(2), hist->GetFunction("gaus")->GetParameter(2) / TMath::Sqrt(2));
14065 hist->GetFunction("gaus")->SetLineColor(2);
14068 void DrawEfficiency(const char* fileName, Int_t step1, Int_t step2)
14075 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14076 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14079 SetupRanges(hMixed);
14084 GetDistAndFlow(h, hMixed, &hist1, 0, step1, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
14085 GetDistAndFlow(h, hMixed, &hist2, 0, step2, 0, 10, 2.01, 3.99, 1, kTRUE, 0, kTRUE);
14087 ((TH2*)hist1)->Rebin2D(2, 2);
14088 ((TH2*)hist2)->Rebin2D(2, 2);
14090 new TCanvas("c", "c", 800, 800);
14091 gPad->SetLeftMargin(0.15);
14092 hist1->SetTitle("");
14093 hist1->GetYaxis()->SetRangeUser(-1.39, 1.39);
14094 hist1->GetXaxis()->SetTitleOffset(1.5);
14095 hist1->GetYaxis()->SetTitleOffset(2);
14096 hist1->SetStats(kFALSE);
14097 hist1->DrawCopy("SURF1");
14099 new TCanvas("c2", "c2", 800, 800);
14100 gPad->SetLeftMargin(0.15);
14101 hist2->SetTitle("");
14102 hist2->GetYaxis()->SetRangeUser(-1.39, 1.39);
14103 hist2->GetXaxis()->SetTitleOffset(1.5);
14104 hist2->GetYaxis()->SetTitleOffset(2);
14105 hist2->SetStats(kFALSE);
14106 hist2->DrawCopy("SURF1");
14108 hist2->Divide(hist1);
14110 new TCanvas("c3", "c3", 800, 800);
14111 gPad->SetLeftMargin(0.15);
14112 hist2->SetTitle("");
14113 hist2->GetYaxis()->SetRangeUser(-1.39, 1.39);
14114 hist2->GetXaxis()->SetTitleOffset(1.5);
14115 hist2->GetYaxis()->SetTitleOffset(2);
14116 hist2->SetStats(kFALSE);
14117 hist2->Draw("SURF1");
14120 void RewriteObjects(const char* fileName)
14124 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14125 Int_t nAxes = ((AliTHn*) h->GetUEHist(2)->GetTrackHist(0)->GetNVar());
14126 Printf("We have %d axes", nAxes);
14128 TString histId; histId.Form("%dR", nAxes-1);
14129 Printf("%s", histId.Data());
14131 AliUEHistograms* hNew = new AliUEHistograms(h->GetName(), histId);
14135 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14136 AliUEHistograms* hMixedNew = new AliUEHistograms(hMixed->GetName(), histId);
14137 hMixedNew->DeepCopy(hMixed);
14140 TString newFileName(fileName);
14141 newFileName.ReplaceAll(".root", "");
14142 newFileName += "_rebinned.root";
14146 list->Add(hMixedNew);
14148 file3 = TFile::Open(newFileName, "RECREATE");
14149 file3->mkdir("PWG4_PhiCorrelations");
14150 file3->cd("PWG4_PhiCorrelations");
14151 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14155 void CondenseCentrality(const char* fileName, Float_t targetValue, Int_t step = 0, Float_t from = 0, Float_t to = -1)
14159 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14160 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14162 h->GetUEHist(2)->CondenseBin(step, 3, 1, targetValue, from, to);
14163 hMixed->GetUEHist(2)->CondenseBin(step, 3, 1, targetValue, from, to);
14165 Float_t events = h->GetCentralityDistribution()->Integral();
14166 h->GetCentralityDistribution()->Reset();
14167 h->GetCentralityDistribution()->Fill(targetValue, events);
14169 events = hMixed->GetCentralityDistribution()->Integral();
14170 hMixed->GetCentralityDistribution()->Reset();
14171 hMixed->GetCentralityDistribution()->Fill(targetValue, events);
14173 TString newFileName(fileName);
14174 newFileName.ReplaceAll(".root", "");
14175 newFileName += "_condensed.root";
14181 file3 = TFile::Open(newFileName, "RECREATE");
14182 file3->mkdir("PWG4_PhiCorrelations");
14183 file3->cd("PWG4_PhiCorrelations");
14184 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14188 void SymmetrizepTBins(const char* fileName)
14190 // copy pt,a < pt,t bins to pt,a > pt,t
14195 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName, &list);
14196 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14198 h->GetUEHist(2)->SymmetrizepTBins();
14199 hMixed->GetUEHist(2)->SymmetrizepTBins();
14201 TString newFileName(fileName);
14202 newFileName.ReplaceAll(".root", "");
14203 newFileName += "_symmetrized.root";
14205 file3 = TFile::Open(newFileName, "RECREATE");
14206 file3->mkdir("PWG4_PhiCorrelations");
14207 file3->cd("PWG4_PhiCorrelations");
14208 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14212 void PtDistributions(Int_t step = 8, Float_t centralityBegin = 1, Float_t centralityEnd = 10)
14216 // 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" };
14218 // const char* fileNames[] = { "LHC10h_AOD086_120411_zvtx_rebinned.root", "LHC10h_AOD086_120411_hybrid_zvtx_rebinned.root", "LHC10h_AOD086_120430_raacuts_zvtx_rebinned.root" };
14219 const char* fileNames[] = { "pt_pos.root", "pt_neg.root" };
14220 // const char* fileNames[] = { "LHC11a10a_bis_AOD090_120406_zvtx.root" };
14222 // Float_t eventCount[] = { 1098234., 1034306., 1369707. };
14223 // Float_t eventCount[] = { 987360.000000, 930278.000000, 1231806.000000 };
14224 Float_t eventCount[] = { 1., 1. };
14229 for (Int_t i=0; i<2; i++)
14231 /* AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileNames[i]);
14233 h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(0.01 + centralityBegin, -0.01 + centralityEnd);
14234 ptDist = h->GetUEHist(2)->GetEventHist()->Project(step, 0);*/
14236 /* eventCount = h->GetEventCount();
14237 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));*/
14238 Float_t events = eventCount[i];
14240 TFile::Open(fileNames[i]);
14241 ptDist = (TH2*) gFile->Get("ptDist");
14243 ptDistProj = ptDist->ProjectionX(Form("ptDistProj_%d", i), ptDist->GetYaxis()->FindBin(0.01 + centralityBegin), ptDist->GetYaxis()->FindBin(-0.01 + centralityEnd));
14245 // new TCanvas; ptDistProj->Draw(); gPad->SetLogy();
14248 ptDistProj->Scale(1.0 / events);
14250 ptDistProj->SetLineColor(i+1);
14251 ptDistProj->DrawCopy((i == 0) ? "" : "SAME");
14253 pt[i] = (TH1*) ptDistProj->Clone(Form("clone_%d", i));
14258 for (Int_t i=1; i<2; i++)
14260 pt[i]->Divide(pt[0]);
14261 pt[i]->DrawCopy((i == 1) ? "" : "SAME");
14265 void test(const char* fileNameESD)
14270 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD);
14274 ptDist = (TH2*) esd->GetUEHist(2)->GetEventHist()->Project(step, 0, 1);
14276 Printf("%f", ptDist->Integral());
14279 void CorrectPtDistribution(const char* fileNameCorrections, const char* fileNameESD, const char* outputFile)
14285 AliUEHistograms* corr = (AliUEHistograms*) GetUEHistogram(fileNameCorrections);
14288 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD, &list);
14293 corr->SetEtaRange(-0.89, 0.89);
14294 corr->ExtendTrackingEfficiency(0);
14296 eff = corr->GetUEHist(2)->GetTrackingEfficiencyCorrectionCentrality();
14297 new TCanvas; eff->Draw("COLZ");
14299 cont = corr->GetUEHist(2)->GetTrackingContaminationCentrality();
14300 new TCanvas; cont->Draw("COLZ");
14302 ptDist = (TH2*) esd->GetUEHist(2)->GetEventHist()->Project(step, 0, 1);
14303 ptDist->SetStats(0);
14304 new TCanvas; ptDist->DrawCopy("COLZ");
14306 for (Int_t x=1; x<=ptDist->GetNbinsX(); x++)
14307 for (Int_t y=1; y<=ptDist->GetNbinsY(); y++)
14309 Float_t factor = eff->GetBinContent(eff->GetXaxis()->FindBin(ptDist->GetXaxis()->GetBinCenter(x)), eff->GetYaxis()->FindBin(ptDist->GetYaxis()->GetBinCenter(y)));
14310 Float_t contFactor = cont->GetBinContent(cont->GetXaxis()->FindBin(ptDist->GetXaxis()->GetBinCenter(x)), cont->GetYaxis()->FindBin(ptDist->GetYaxis()->GetBinCenter(y)));
14312 printf("%f", contFactor);
14313 if (contFactor > 0)
14314 contFactor = 1.0 + 1.1 * (contFactor - 1.0);
14315 printf(" --> %f\n", contFactor);
14317 factor *= contFactor;
14319 ptDist->SetBinContent(x, y, ptDist->GetBinContent(x, y) * factor);
14320 ptDist->SetBinError(x, y, ptDist->GetBinError(x, y) * factor);
14323 new TCanvas; ptDist->DrawCopy("COLZ");
14325 file3 = TFile::Open(outputFile, "RECREATE");
14326 ptDist->Write("ptDist");
14334 void CorrectPtDistributionAll()
14336 CorrectPtDistribution("LHC11a10a_bis_AOD090_120406.root", "LHC10h_AOD086_120411_zvtx_rebinned.root", "ptdist1.root");
14337 CorrectPtDistribution("LHC11a10a_bis_AOD090_120505_zvtx_hybrid.root", "LHC10h_AOD086_120411_hybrid_zvtx_rebinned.root", "ptdist2.root");
14338 CorrectPtDistribution("LHC11a10a_bis_AOD090_120505_zvtx_raa.root", "LHC10h_AOD086_120430_raacuts_zvtx_rebinned.root", "ptdist3.root");
14341 void CreateNormalizationTestObject(Bool_t addRidge = kFALSE)
14344 gSystem->Load("libPWGCFCorrelationsDPhi");
14346 AliUEHistograms* hNew = new AliUEHistograms("AliUEHistogramsSame", "5RC");
14348 // fill 1000 particles in one bin
14349 TObjArray* particles = new TObjArray;
14350 particles->Add(new AliDPhiBasicParticle(0, 0, 3.5, 1));
14351 for (Int_t i=0; i<2000; i++)
14352 particles->Add(new AliDPhiBasicParticle(gRandom->Gaus(0, 0.3), gRandom->Gaus(0, 0.3), 1.75, 1));
14354 hNew->FillCorrelations(61, 0, 8, particles);
14358 for (Int_t i=0; i<10000; i++)
14359 particles->Add(new AliDPhiBasicParticle(gRandom->Uniform(-2, 2), gRandom->Gaus(0, 0.5), 1.75, 1));
14362 hNew->FillCorrelations(0.5, 0, 8, particles);
14364 // fill flat mixed event
14365 AliUEHistograms* hMixedNew = new AliUEHistograms("AliUEHistogramsMixed", "5RC");
14366 THnSparse* sparse = hMixedNew->GetUEHist(2)->GetTrackHist(0)->GetGrid(8)->GetGrid();
14367 for (Int_t x=1; x<=sparse->GetAxis(0)->GetNbins(); x++)
14368 for (Int_t y=1; y<=sparse->GetAxis(4)->GetNbins(); y++)
14371 bin[0] = sparse->GetAxis(0)->GetBinCenter(x);
14372 bin[4] = sparse->GetAxis(4)->GetBinCenter(y);
14394 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14397 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14401 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14404 hMixedNew->GetUEHist(2)->GetEventHist()->GetGrid(8)->GetGrid()->Fill(bin);
14406 ((AliTHn*) hNew->GetUEHist(2)->GetTrackHist(0))->FillParent();
14407 ((AliTHn*) hNew->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
14409 ((AliTHn*) hMixedNew->GetUEHist(2)->GetTrackHist(0))->FillParent();
14410 ((AliTHn*) hMixedNew->GetUEHist(2)->GetTrackHist(0))->DeleteContainers();
14414 list->Add(hMixedNew);
14416 file3 = TFile::Open("norm.root", "RECREATE");
14417 file3->mkdir("PWG4_PhiCorrelations");
14418 file3->cd("PWG4_PhiCorrelations");
14419 list->Write("histosPhiCorrelations", TObject::kSingleKey);
14423 void CompareSumOfRatiosAndDefault(const char* fileName, Int_t bin, Int_t step)
14427 Int_t centralityFrom = 0;
14428 Int_t centralityTo = 20;
14433 Float_t ptTrigBegin = 2.01;
14434 Float_t ptTrigEnd = 3.99;
14438 ptTrigBegin = 1.01;
14445 ptTrigBegin = 0.49;
14449 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14450 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14453 SetupRanges(hMixed);
14457 GetSumOfRatios(h, hMixed, &hist1, step, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, kTRUE);
14458 GetDistAndFlow(h, hMixed, &hist2, 0, step, centralityFrom, centralityTo, ptTrigBegin, ptTrigEnd, 1, kTRUE, 0, kTRUE);
14460 hist1->Rebin2D(2, 2); hist1->Scale(0.25);
14461 hist2->Rebin2D(2, 2); hist2->Scale(0.25);
14463 c = new TCanvas("c", "c", 1000, 1000);
14467 hist1->DrawCopy("SURF1");
14470 hist2->DrawCopy("SURF1");
14473 proj1 = ((TH2*) hist1)->ProjectionY("proj1", hist1->GetXaxis()->FindBin(-0.99), hist1->GetXaxis()->FindBin(0.99));
14475 proj2 = ((TH2*) hist2)->ProjectionY("proj2", hist2->GetXaxis()->FindBin(-0.99), hist2->GetXaxis()->FindBin(0.99));
14476 proj2->SetLineColor(2);
14477 proj2->DrawCopy("SAME");
14480 proj1->Divide(proj1, proj2, 1, 1, "B");
14484 hist1->Divide(hist2);
14485 hist1->DrawCopy("SURF1");
14488 void PtDistribution(const char* fileName, Int_t step, Int_t bin = 0)
14490 Int_t centralityFrom = 0;
14491 Int_t centralityTo = 80;
14493 Float_t ptTrigBegin = 2.01;
14494 Float_t ptTrigEnd = 3.99;
14498 ptTrigBegin = 1.01;
14503 ptTrigBegin = 0.51;
14509 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14511 Int_t centralityBeginBin = 0;
14512 Int_t centralityEndBin = -1;
14514 if (centralityTo >= centralityFrom)
14516 centralityBeginBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(0.01 + centralityFrom);
14517 centralityEndBin = h->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->FindBin(-0.01 + centralityTo);
14520 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);
14521 pt2 = h->GetUEHist(2)->GetPtHist(step, 0, ptTrigBegin, ptTrigEnd, centralityBeginBin, centralityEndBin, -0.5, 0.5, -1.99, 1.99);
14525 pt2->SetLineColor(2);
14526 pt2->DrawCopy("SAME");
14529 // TODO proper subtraction, to get the pT distribution in the peak
14532 void GetRefMultiplicity(const char* fileNameESD, const char* tag = "")
14538 AliUEHistograms* esd = (AliUEHistograms*) GetUEHistogram(fileNameESD, 0, kFALSE, tag);
14540 Float_t centrBins[] = { 0, 20, 40, 60, 100 };
14541 // Float_t centrBins[] = { 0, 100 };
14543 // NOTE Run it on data with limited zvtx range so that there are no empty bins in the corrections!
14545 for (Int_t i=0; i<4; i++)
14547 Float_t centrBegin = centrBins[i] + 0.1;
14548 Float_t centrEnd = centrBins[i+1] - 0.1;
14549 esd->GetUEHist(2)->GetEventHist()->GetGrid(step)->GetGrid()->GetAxis(1)->SetRangeUser(centrBegin, centrEnd);
14551 ptDist = (TH2*) esd->GetUEHist(2)->GetEventHist()->Project(step, 0);
14553 centrDist = esd->GetCentralityDistribution();
14557 // add syst from R_pA
14558 for (Int_t j=1; j<=ptDist->GetNbinsX(); j++)
14559 ptDist->SetBinError(j, TMath::Sqrt(ptDist->GetBinError(j) * ptDist->GetBinError(j) + 0.052 * 0.052 * ptDist->GetBinContent(j) * ptDist->GetBinContent(j)));
14562 Float_t events = centrDist->Integral(centrDist->FindBin(centrBegin), centrDist->FindBin(centrEnd));
14563 Double_t error = 0;
14564 // Float_t integral = ptDist->IntegralAndError(ptDist->FindBin(0.51), ptDist->FindBin(3.99), error);
14565 Float_t integral = ptDist->IntegralAndError(ptDist->FindBin(0.51), ptDist->FindBin(7.99), error);
14566 Printf("%d: %f +- %f %f --> %f +- %F", i, integral, error, events, integral / events, error / events);
14568 ptDist->Scale(1.0 / events);
14569 // ptDist->Scale(1.0 / integral);
14571 // ptDist->Rebin(2);
14573 NormalizeToBinWidth(ptDist);
14574 ptDist->SetLineColor(i + 1);
14575 ptDist->DrawCopy((i == 0) ? "" : "SAME");
14579 TFile::Open("dNdPt_pPb_lab_MinBias_NEW.root");
14580 comparison = (TH1*) gFile->Get("dNdPt_pPb_eta08_stat");
14581 comparison->Scale(1.6); // normalize to my eta range
14582 comparison->SetLineColor(2);
14583 comparison->DrawCopy("SAME");
14586 for (Int_t i=1; i<=comparison->GetNbinsX(); i++)
14588 // multiply by bin width
14589 comparison->SetBinContent(i, comparison->GetBinContent(i) * comparison->GetBinWidth(i));
14590 comparison->SetBinError(i, comparison->GetBinError(i) * comparison->GetBinWidth(i));
14593 Float_t integral = comparison->IntegralAndError(comparison->FindBin(0.51), comparison->FindBin(7.99), error);
14594 Float_t integral2 = comparison->IntegralAndError(comparison->FindBin(0.51), comparison->FindBin(19.99), error);
14595 Printf("%f %f", integral, integral2);
14597 Float_t integral = comparison->IntegralAndError(comparison->FindBin(0.51), comparison->FindBin(7.99), error);
14598 Float_t integral2 = comparison->IntegralAndError(comparison->FindBin(0.61), comparison->FindBin(7.99), error);
14599 Printf("%f %f", integral, integral2);
14601 rebinned = comparison->Rebin(ptDist->GetNbinsX(), "rebinned", ptDist->GetXaxis()->GetXbins()->GetArray());
14604 NormalizeToBinWidth(rebinned);
14605 rebinned->Draw("SAME");
14608 ptDist->Divide(rebinned);
14614 syst = (TH1*) gFile->Get("dNdPt_pPb_eta08_syst");
14618 for (Int_t i=1; i<=syst->GetNbinsX(); i++)
14620 if (syst->GetBinContent(i) > 0)
14621 syst->SetBinContent(i, syst->GetBinError(i) / syst->GetBinContent(i));
14622 syst->SetBinError(i, 0);
14627 void CheckBin(const char* fileName)
14631 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14632 AliUEHistograms* hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14634 sparse = h->GetUEHist(2)->GetTrackHist(0)->GetGrid(8)->GetGrid();
14635 sparse->GetAxis(1)->SetRangeUser(5, 5.1);
14636 sparse->GetAxis(2)->SetRangeUser(7, 7.1);
14637 sparse->GetAxis(3)->SetRangeUser(90, 91);
14638 sparse->GetAxis(4)->SetRangeUser(9, 9.1);
14641 sparse->Projection(0, 4)->Draw("colz");
14643 sparse = hMixed->GetUEHist(2)->GetTrackHist(0)->GetGrid(8)->GetGrid();
14644 sparse->GetAxis(1)->SetRangeUser(5, 5.1);
14645 sparse->GetAxis(2)->SetRangeUser(7, 7.1);
14646 sparse->GetAxis(3)->SetRangeUser(90, 91);
14647 sparse->GetAxis(4)->SetRangeUser(9, 9.1);
14650 sparse->Projection(0, 4)->Draw("colz");
14653 void GetCorrectedYields(const char* fileName, const char* correctionFile, Int_t partSpecies=-1 )
14657 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14659 // centrality, pT, eta
14660 yieldsUncorr = h->GetYield();
14661 new TCanvas; yieldsUncorr->DrawCopy();
14662 // new TCanvas; yieldsUncorr->ProjectionX("x1")->DrawCopy();
14664 // normalize per event
14665 centrDist = h->GetCentralityCorrelation()->ProjectionX();
14666 new TCanvas; centrDist->Draw();
14668 for (Int_t x=1; x<=yieldsUncorr->GetNbinsX(); x++)
14670 Double_t factor = centrDist->GetBinContent(centrDist->FindBin(yieldsUncorr->GetXaxis()->GetBinCenter(x)));
14671 // Printf("%d %f %d %f", x, yieldsUncorr->GetXaxis()->GetBinCenter(x), centrDist->FindBin(yieldsUncorr->GetXaxis()->GetBinCenter(x)), factor);
14675 for (Int_t y=0; y<=yieldsUncorr->GetNbinsY()+1; y++)
14676 for (Int_t z=0; z<=yieldsUncorr->GetNbinsZ()+1; z++)
14678 if (yieldsUncorr->GetBinContent(x, y, z) <= 0)
14680 yieldsUncorr->SetBinContent(x, y, z, yieldsUncorr->GetBinContent(x, y, z) / factor);
14681 yieldsUncorr->SetBinError(x, y, z, yieldsUncorr->GetBinError(x, y, z) / factor);
14685 // new TCanvas; yieldsUncorr->ProjectionX("x2")->DrawCopy(); return;
14687 AliUEHistograms* hCorr = (AliUEHistograms*) GetUEHistogram(correctionFile);
14688 if(partSpecies!=-1){
14689 Double_t epsilon=0.001;
14690 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
14691 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(4)->GetGrid()->GetAxis(2)->SetRangeUser(partSpecies-epsilon,partSpecies+epsilon);
14694 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->GetAxis(4)->SetRangeUser(-1.9, 1.9);
14695 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(2)->GetGrid()->GetAxis(4)->SetRangeUser(-1.9, 1.9);
14696 hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(4)->GetGrid()->GetAxis(4)->SetRangeUser(-1.9, 1.9);
14699 TH2* generated = hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid(0)->GetGrid()->Projection(1, 0);
14700 TH2* measured = hCorr->GetUEHist(2)->GetTrackHistEfficiency()->GetGrid((partSpecies==-1)?2:4)->GetGrid()->Projection(1, 0);
14702 Printf("%f %f", generated->GetEntries(), measured->GetEntries());
14704 new TCanvas; generated->Draw("COLZ");
14705 new TCanvas; measured->Draw("COLZ");
14707 effCorr = (TH2*) generated->Clone("correction");
14708 effCorr->Divide(generated, measured, 1, 1, "B");
14710 new TCanvas; effCorr->Draw("COLZ");
14714 yieldsCorr = (TH3F*) yieldsUncorr->Clone("fYieldsCorr");
14715 yieldsCorr->Reset();
14717 for (Int_t x=1; x<=yieldsUncorr->GetNbinsX(); x++)
14718 for (Int_t y=1; y<=yieldsUncorr->GetNbinsY(); y++)
14719 for (Int_t z=1; z<=yieldsUncorr->GetNbinsZ(); z++)
14721 Double_t factor = effCorr->GetBinContent(effCorr->GetXaxis()->FindBin(yieldsUncorr->GetZaxis()->GetBinCenter(z)), effCorr->GetYaxis()->FindBin(yieldsUncorr->GetYaxis()->GetBinCenter(y)));
14722 yieldsCorr->SetBinContent(x, y, z, yieldsUncorr->GetBinContent(x, y, z) * factor);
14723 yieldsCorr->SetBinError(x, y, z, yieldsUncorr->GetBinError(x, y, z) * factor);
14726 new TCanvas; yieldsCorr->DrawCopy();
14728 TFile::Open("corr_yield.root", "RECREATE");
14729 yieldsCorr->Write();
14732 yieldsUncorr->GetXaxis()->SetRangeUser(1, yieldsUncorr->GetNbinsX());
14734 new TCanvas; yieldsUncorr->Project3D("z1")->DrawCopy()->SetLineColor(1); yieldsCorr->Project3D("z2")->DrawCopy("SAME")->SetLineColor(2);
14736 yieldsUncorr->GetXaxis()->SetRangeUser(0.1, 9.9);
14737 yieldsCorr->GetXaxis()->SetRangeUser(0.1, 9.9);
14738 new TCanvas; yieldsUncorr->Project3D("z3")->DrawCopy()->SetLineColor(1); yieldsCorr->Project3D("z4")->DrawCopy("SAME")->SetLineColor(2);
14739 yieldsUncorr->GetXaxis()->SetRangeUser(60.1, 99.9);
14740 yieldsCorr->GetXaxis()->SetRangeUser(60.1, 99.9);
14741 yieldsUncorr->Project3D("z5")->DrawCopy("SAME")->SetLineColor(3); yieldsCorr->Project3D("z6")->DrawCopy("SAME")->SetLineColor(4);
14744 void PlotPtCentrality()
14746 TFile::Open("corr_yield.root");
14747 yieldsCorr = (TH3F*) gFile->Get("fYieldsCorr");
14749 yieldsCorr->GetZaxis()->SetRangeUser(-0.4999, 0.4999);
14750 yieldsProj = (TH2*) yieldsCorr->Project3D("yx");
14751 Printf("%f", yieldsProj->Integral());
14753 Float_t ptMin[] = { 0.5001, 1.0001, 2.0001 };
14754 Float_t ptMax = 10;
14756 for (Int_t i=0; i<3; i++)
14758 profile = yieldsProj->ProjectionX(Form("x%d", i), yieldsProj->GetYaxis()->FindBin(ptMin[i]), yieldsProj->GetYaxis()->FindBin(ptMax));
14759 profile->SetLineColor(i+1);
14760 profile->Draw((i > 0) ? "SAME" : "");
14764 void ExtractForAllSpecies()
14766 TString baseName = "LHC13b2_fix_1_Train";
14767 const char* suffix[] = { "55_Hadrons_symmetrized", "63_Pions", "63_Kaons", "63_Protons" };
14768 TString baseNameOutput = "dphi_corr_mc_130531_allpt_";
14770 for (Int_t i=0; i<4; i++)
14771 PlotDeltaPhiEtaGap(baseName + suffix[i] + ".root", 0, 0, 0, baseNameOutput + suffix[i] + ".root");
14774 void Compare2D(const char* fileName, const char* fileName2)
14783 AliUEHistograms* h = (AliUEHistograms*) GetUEHistogram(fileName);
14784 hMixed = (AliUEHistograms*) GetUEHistogram(fileName, 0, kTRUE);
14786 AliUEHistograms* h2 = (AliUEHistograms*) GetUEHistogram(fileName2);
14787 hMixed2 = (AliUEHistograms*) GetUEHistogram(fileName2, 0, kTRUE);
14790 SetupRanges(hMixed);
14792 SetupRanges(hMixed2);
14794 // h->SetZVtxRange(0.1, 0.5);
14795 // hMixed->SetZVtxRange(0.1, 0.5);
14796 // h2->SetZVtxRange(0.1, 0.5);
14797 // hMixed2->SetZVtxRange(0.1, 0.5);
14800 GetDistAndFlow(h, 0, &hist1, 0, step, 0, 20, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
14803 GetDistAndFlow(h2, 0, &hist2, 0, step, 0, 20, 1.01, 1.99, 1, kTRUE, 0, kTRUE);
14805 c = new TCanvas("c", "c", 1600, 800);
14808 gPad->SetLeftMargin(0.15);
14810 hist1->DrawCopy("SURF1");
14813 gPad->SetLeftMargin(0.15);
14815 hist2->DrawCopy("SURF1");
14817 Printf("%f %f", hist1->Integral(), hist2->Integral());
14819 new TCanvas("c3", "c3", 800, 800);
14820 gPad->SetLeftMargin(0.15);
14821 hist2->Divide(hist1);
14822 hist2->DrawCopy("COLZ");
14825 //Geant3/Fluka correction for tracking from the spectra analysis
14827 TrackingEff_geantflukaCorrection(Int_t ipart, Int_t icharge)
14830 if (ipart == 3 && icharge == kNegative) {
14831 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "TrackingPtGeantFlukaCorrectionKaMinus(x);p_{T};GF correction", 0., 5.);
14834 else if (ipart == 4 && icharge == kNegative) {
14835 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "TrackingPtGeantFlukaCorrectionPrMinus(x);p_{T};GF correction", 0., 5.);
14838 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "TrackingPtGeantFlukaCorrectionNull(x);p_{T};GF correction", 0., 5.);
14844 TrackingPtGeantFlukaCorrectionNull(Double_t pTmc)
14850 TrackingPtGeantFlukaCorrectionPrMinus(Double_t pTmc)
14852 return (1 - 0.129758 *TMath::Exp(-pTmc*0.679612));
14856 TrackingPtGeantFlukaCorrectionKaMinus(Double_t pTmc)
14858 return TMath::Min((0.972865 + 0.0117093*pTmc), 1.);
14861 //Geant3/Fluka correction for matching from the spectra analysis
14863 TOFmatchMC_geantflukaCorrection(Int_t ipart, Int_t icharge,Int_t ntrd)
14865 if (ipart == 3 && icharge == kNegative) {
14866 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]),Form("MatchingPtGeantFlukaCorrectionKaMinus(x,%d);p_{T};GF correction",ntrd), 0., 5.);
14869 else if (ipart == 4 && icharge == kNegative) {
14870 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]),Form("MatchingPtGeantFlukaCorrectionPrMinus(x,%d);p_{T};GF correction",ntrd), 0., 5.);
14873 TF1 *f = new TF1(Form("fGeantFluka_%s_%s", AliPID::ParticleName(ipart), Sign[icharge]), "MatchingPtGeantFlukaCorrectionNull(x);p_{T};GF correction", 0., 5.);
14880 MatchingPtGeantFlukaCorrectionNull(Double_t pTmc)
14885 MatchingPtGeantFlukaCorrectionKaMinus(Double_t pTmc, Int_t ntrd = 7)//ntrd is 7 in 2010, 10 in 2011, 13 in 2012+2013
14887 Float_t ptTPCoutK=pTmc*(1- 3.37297e-03/pTmc/pTmc - 3.26544e-03/pTmc);
14888 Float_t scale = (ntrd * 0.14638485 + (18 - ntrd) * 0.02406) / 18.;
14889 return TMath::Min((TMath::Power(0.972865 + 0.0117093*ptTPCoutK,scale/0.03471)), 1.);
14892 MatchingPtGeantFlukaCorrectionPrMinus(Double_t pTmc, Int_t ntrd = 7)//ntrd is 7 in 2010, 10 in 2011, 13 in 2012+2013
14894 Float_t ptTPCoutP =pTmc*(1-6.81059e-01*TMath::Exp(-pTmc*4.20094));
14895 Float_t scale = (ntrd * 0.14638485 + (18 - ntrd) * 0.02406) / 18.;
14896 return (TMath::Power(1 - 0.129758*TMath::Exp(-ptTPCoutP*0.679612),scale/0.03471));
14899 void Browse(const char* fileName)
14903 if (!gGrid && TString(fileName).BeginsWith("alien://"))
14904 TGrid::Connect("alien://");
14906 TFile::Open(fileName);