37 const string& fileNameInmed,
38 const string& fileNameQgp,
39 const string& fileNameOmega,
40 const string& fileNamePhi,
41 const string& fileNameOmegaDalitz,
42 const string& outputDir,
44 fOutputDir = outputDir;
46 fDrawQgp = (fileNameQgp !=
"");
49 vector<string> fileNames = {fileNameInmed,
55 fHM.resize(fNofSignals);
56 for (
int i = 0;
i < fNofSignals;
i++) {
58 if (!fDrawQgp &&
i ==
kQgp)
continue;
59 TFile* file =
new TFile(fileNames[
i].c_str());
60 fHM[
i]->ReadFromFile(file);
61 Int_t nofEvents = (int) H1(
i,
"fh_event_number")->GetEntries();
62 fHM[
i]->ScaleByPattern(
".*", 1. / nofEvents);
63 cout <<
"nofEvents = " << nofEvents << endl;
77 CalcCutEffRange(0.0, 0.2);
78 CalcCutEffRange(0.2, 0.6);
79 CalcCutEffRange(0.6, 1.2);
91 return (TH1D*) fHM[signalType]->H1(name);
95 return (TH2D*) fHM[signalType]->H1(name);
112 TH1D* sEta = fh_mean_eta_minv[step];
113 TH1D* sPi0 = fh_mean_pi0_minv[step];
118 TH1D* coctail = (TH1D*) sInmed->Clone();
119 if (fDrawQgp) coctail->Add(sQgp);
120 coctail->Add(sOmega);
124 coctail->Add(sOmegaDalitz);
130 fHM[0]->CreateCanvas(
"minv_all_mc",
"minv_all_mc", 800, 800);
133 fHM[0]->CreateCanvas(
"minv_all_acc",
"minv_all_acc", 800, 800);
136 fHM[0]->CreateCanvas(
"minv_all_ptcut",
"minv_all_ptcut", 800, 800);
139 fHM[0]->CreateCanvas(
"minv_all_ttcut",
"minv_all_ttcut", 800, 800);
142 fHM[0]->CreateCanvas(
"minv_all_elid",
"minv_all_elid", 800, 800);
160 TH1D* bg = (TH1D*) fh_mean_bg_minv[step]->Clone();
161 TH1D* sEta = (TH1D*) fh_mean_eta_minv[step]->Clone();
162 TH1D* sPi0 = (TH1D*) fh_mean_pi0_minv[step]->Clone();
167 TH1D* coctail = GetCoctailMinv(step);
169 TH1D* sbg = (TH1D*) bg->Clone();
171 if (fDrawQgp) sbg->Add(sQgp);
176 sbg->Add(sOmegaDalitz);
181 coctail->Rebin(nRebin);
185 sOmegaDalitz->Rebin(nRebin);
186 sOmega->Rebin(nRebin);
187 sInmed->Rebin(nRebin);
188 if (fDrawQgp) sQgp->Rebin(nRebin);
202 double binWidth = sbg->GetBinWidth(1);
203 sbg->Scale(1. / binWidth);
204 coctail->Scale(1. / binWidth);
205 bg->Scale(1. / binWidth);
206 sPi0->Scale(1. / binWidth);
207 sEta->Scale(1. / binWidth);
208 sOmegaDalitz->Scale(1. / binWidth);
209 sOmega->Scale(1. / binWidth);
210 sInmed->Scale(1. / binWidth);
211 if (fDrawQgp) sQgp->Scale(1. / binWidth);
212 sPhi->Scale(1. / binWidth);
215 sbg->SetMinimum(5e-8);
216 sbg->SetMaximum(2e-2);
217 sbg->GetXaxis()->SetRangeUser(0, 2.);
218 bg->GetXaxis()->SetRangeUser(0, 2.);
219 coctail->GetXaxis()->SetRangeUser(0, 2.);
220 sPi0->GetXaxis()->SetRangeUser(0, 2.);
221 sEta->GetXaxis()->SetRangeUser(0, 2.);
222 sOmegaDalitz->GetXaxis()->SetRangeUser(0, 2.);
223 sOmega->GetXaxis()->SetRangeUser(0, 2.);
224 sInmed->GetXaxis()->SetRangeUser(0, 2.);
225 if (fDrawQgp) sQgp->GetXaxis()->SetRangeUser(0, 2.);
226 sPhi->GetXaxis()->SetRangeUser(0, 2.);
240 DrawH1({coctail, sPi0, sEta, sOmegaDalitz, sOmega, sInmed, sQgp, sPhi},
241 {
"",
"",
"",
"",
"",
"",
"",
""},
251 DrawH1({coctail, sPi0, sEta, sOmegaDalitz, sOmega, sInmed, sPhi},
252 {
"",
"",
"",
"",
"",
"",
""},
274 {
"",
"",
"",
"",
"",
"",
"",
"",
"",
""},
284 DrawH1({sbg, bg, coctail, sPi0, sEta, sOmegaDalitz, sOmega, sInmed, sPhi},
285 {
"",
"",
"",
"",
"",
"",
"",
"",
""},
297 string yTitle =
"dN/dM_{ee} [GeV/c^{2}]^{-1}";
298 coctail->GetYaxis()->SetTitle(yTitle.c_str());
299 sbg->GetYaxis()->SetTitle(yTitle.c_str());
300 coctail->GetYaxis()->SetLabelSize(0.05);
301 sbg->GetYaxis()->SetLabelSize(0.05);
303 sInmed->SetFillColor(kMagenta - 3);
304 sInmed->SetLineColor(kMagenta - 2);
305 sInmed->SetLineStyle(0);
306 sInmed->SetLineWidth(3);
307 sInmed->SetFillStyle(3344);
310 sQgp->SetFillColor(kOrange - 2);
311 sQgp->SetLineColor(kOrange - 3);
312 sQgp->SetLineStyle(0);
313 sQgp->SetLineWidth(3);
314 sQgp->SetFillStyle(3444);
318 sOmega->SetFillColor(kOrange + 7);
319 sOmega->SetLineColor(kOrange + 4);
320 sOmega->SetLineStyle(0);
321 sOmega->SetLineWidth(2);
323 sPhi->SetFillColor(kAzure + 2);
324 sPhi->SetLineColor(kAzure + 3);
325 sPhi->SetLineStyle(0);
326 sPhi->SetLineWidth(2);
327 sPhi->SetFillStyle(3112);
328 gStyle->SetHatchesLineWidth(1);
329 gStyle->SetHatchesSpacing(1.);
332 bg->SetFillColor(kGray);
333 bg->SetLineColor(kBlack);
338 sEta->SetFillColor(kRed - 4);
339 sEta->SetLineColor(kRed + 2);
340 sEta->SetLineStyle(0);
341 sEta->SetLineWidth(2);
344 sPi0->SetFillColor(kGreen - 3);
345 sPi0->SetLineColor(kGreen + 3);
346 sPi0->SetLineStyle(0);
347 sPi0->SetLineWidth(2);
349 sOmegaDalitz->SetFillColor(kCyan + 2);
350 sOmegaDalitz->SetLineColor(kCyan + 4);
351 sOmegaDalitz->SetLineStyle(0);
352 sOmegaDalitz->SetLineWidth(2);
354 sbg->SetFillColor(kBlack);
355 sbg->SetLineColor(kBlack);
356 sbg->SetLineStyle(0);
357 sbg->SetLineWidth(1);
359 coctail->SetLineColor(kRed + 2);
360 coctail->SetFillStyle(0);
361 coctail->SetLineWidth(3);
364 TLegend* legend =
new TLegend(0.7, 0.6, 0.99, 0.99);
365 legend->SetFillColor(kWhite);
366 legend->SetTextSize(0.04);
367 legend->AddEntry(sOmega,
"#omega #rightarrow e^{+}e^{-}",
"f");
368 legend->AddEntry(sOmegaDalitz,
"#omega #rightarrow #pi^{0}e^{+}e^{-}",
"f");
369 legend->AddEntry(sPhi,
"#phi #rightarrow e^{+}e^{-}",
"f");
370 legend->AddEntry(sInmed,
"in-medium #rho",
"f");
371 if (fDrawQgp) legend->AddEntry(sQgp,
"QGP radiation",
"f");
372 legend->AddEntry(sEta,
"#eta #rightarrow #gammae^{+}e^{-}",
"f");
373 legend->AddEntry(sPi0,
"#pi^{0} #rightarrow #gammae^{+}e^{-}",
"f");
374 legend->AddEntry(coctail,
"Coctail",
"f");
375 legend->AddEntry(bg,
"Background",
"f");
376 legend->AddEntry(sbg,
"Coctail+BG",
"f");
379 TLegend* legend =
new TLegend(0.7, 0.7, 0.99, 0.99);
380 legend->SetFillColor(kWhite);
381 legend->SetTextSize(0.04);
382 legend->AddEntry(sOmega,
"#omega #rightarrow e^{+}e^{-}",
"f");
383 legend->AddEntry(sOmegaDalitz,
"#omega #rightarrow #pi^{0}e^{+}e^{-}",
"f");
384 legend->AddEntry(sPhi,
"#phi #rightarrow e^{+}e^{-}",
"f");
385 legend->AddEntry(sInmed,
"in-medium #rho",
"f");
386 if (fDrawQgp) legend->AddEntry(sQgp,
"QGP radiation",
"f");
387 legend->AddEntry(sEta,
"#eta #rightarrow #gammae^{+}e^{-}",
"f");
388 legend->AddEntry(sPi0,
"#pi^{0} #rightarrow #gammae^{+}e^{-}",
"f");
389 legend->AddEntry(coctail,
"Coctail",
"f");
398 TH1D* bg = (TH1D*) fh_mean_bg_minv[
kTtCut]->Clone();
399 TH1D* coctail = GetCoctailMinv(
kTtCut);
400 fh_mean_sbg_vs_minv[
kTtCut] =
403 +
";M_{ee} [GeV/c^{2}];Cocktail/Background")
406 bg->GetXaxis()->GetXmin(),
407 bg->GetXaxis()->GetXmax());
408 fh_mean_sbg_vs_minv[
kTtCut]->Divide(coctail, bg, 1., 1.,
"B");
409 fh_mean_sbg_vs_minv[
kTtCut]->Rebin(20);
410 fh_mean_sbg_vs_minv[
kTtCut]->Scale(1. / 20.);
411 fh_mean_sbg_vs_minv[
kTtCut]->GetXaxis()->SetRangeUser(0, 2.);
413 bg = (TH1D*) fh_mean_bg_minv[
kPtCut]->Clone();
414 coctail = GetCoctailMinv(
kPtCut);
415 fh_mean_sbg_vs_minv[
kPtCut] =
418 +
";M_{ee} [GeV/c^{2}];Cocktail/Background")
421 bg->GetXaxis()->GetXmin(),
422 bg->GetXaxis()->GetXmax());
423 fh_mean_sbg_vs_minv[
kPtCut]->Divide(coctail, bg, 1., 1.,
"B");
424 fh_mean_sbg_vs_minv[
kPtCut]->Rebin(20);
425 fh_mean_sbg_vs_minv[
kPtCut]->Scale(1. / 20.);
426 fh_mean_sbg_vs_minv[
kPtCut]->GetXaxis()->SetRangeUser(0, 2.);
428 fHM[0]->CreateCanvas(
"lmvm_sbg_vs_minv",
"lmvm_sbg_vs_minv", 800, 800);
430 {
"Without Pt cut",
"With Pt cut"},
442 fHM[0]->CreateCanvas(
"minv_pt_ptcut",
"minv_pt_ptcut", 800, 800);
464 TH2D* sEta = fh_mean_eta_minv_pt[step];
465 TH2D* sPi0 = fh_mean_pi0_minv_pt[step];
467 TH2D* coctail = (TH2D*) sInmed->Clone();
468 if (fDrawQgp) coctail->Add(sQgp);
469 coctail->Add(sOmega);
471 coctail->Add(sOmegaDalitz);
480 for (
int iS = 0; iS < fNofSignals; iS++) {
481 if (!fDrawQgp && iS ==
kQgp)
continue;
483 fh_mean_bg_minv[step] =
485 fh_mean_eta_minv[step] =
488 fh_mean_pi0_minv[step] =
491 fh_mean_eta_minv_pt[step] =
494 fh_mean_pi0_minv_pt[step] =
498 fh_mean_bg_minv[step]->Add(
501 fh_mean_eta_minv[step]->Add(
504 fh_mean_pi0_minv[step]->Add(
507 fh_mean_eta_minv_pt[step]->Add(
510 fh_mean_pi0_minv_pt[step]->Add(
516 fh_mean_bg_minv[step]->Scale(1. / (
double) fNofSignals);
517 fh_mean_eta_minv[step]->Scale(1. / (
double) fNofSignals);
518 fh_mean_pi0_minv[step]->Scale(1. / (
double) fNofSignals);
519 fh_mean_eta_minv_pt[step]->Scale(1. / (
double) fNofSignals);
520 fh_mean_pi0_minv_pt[step]->Scale(1. / (
double) fNofSignals);
525 if (fOutputDir !=
"") {
526 gSystem->mkdir(fOutputDir.c_str(),
true);
527 TFile*
f = TFile::Open(
string(fOutputDir +
"/draw_all_hist.root").c_str(),
530 fh_mean_bg_minv[
i]->Write();
531 fh_mean_eta_minv[
i]->Write();
532 fh_mean_pi0_minv[
i]->Write();
534 fh_mean_sbg_vs_minv[
kTtCut]->Write();
535 fh_mean_sbg_vs_minv[
kPtCut]->Write();
542 fh_sum_s_minv[step] =
546 fh_sum_s_minv[step]->Add(
549 fh_sum_s_minv[step]->Add(
552 fh_sum_s_minv[step]->Add(
555 fh_sum_s_minv[step]->Add(
558 fh_sum_s_minv[step]->Add((TH1D*) fh_mean_eta_minv[step]->Clone());
559 fh_sum_s_minv[step]->Add((TH1D*) fh_mean_pi0_minv[step]->Clone());
566 ss1 << minMinv <<
"_" << maxMinv;
567 TH1D* grS =
new TH1D((
"grS_" + ss1.str()).c_str(),
568 ";Analysis step;Efficiency [%]",
572 TH1D* grB =
new TH1D((
"grB_" + ss1.str()).c_str(),
573 ";Analysis step;Efficiency [%]",
580 Int_t x1 = fh_sum_s_minv[step]->FindBin(minMinv);
581 Int_t x2 = fh_sum_s_minv[step]->FindBin(maxMinv);
583 double yS = 100. * fh_sum_s_minv[step]->Integral(x1, x2)
584 / fh_sum_s_minv[
kElId]->Integral(x1, x2);
585 double yB = 100. * fh_mean_bg_minv[step]->Integral(x1, x2)
586 / fh_mean_bg_minv[
kElId]->Integral(x1, x2);
589 grB->SetBinContent(
x, yB);
590 grS->SetBinContent(
x, yS);
594 grB->GetXaxis()->SetLabelSize(0.06);
595 grB->GetXaxis()->SetRange(1,
x - 1);
596 grS->GetXaxis()->SetRange(1,
x - 1);
599 ss <<
"lmvm_cut_eff_" << minMinv <<
"_" << maxMinv;
600 fHM[0]->CreateCanvas(ss.str().c_str(), ss.str().c_str(), 700, 700);
602 {grB, grS}, {
"BG",
"Signal"},
kLinear,
kLinear,
true, 0.75, 0.85, 1.0, 1.0);
603 grS->SetLineWidth(4);
604 grB->SetLineWidth(4);
606 grB->SetMaximum(105);
609 ss2 << minMinv <<
"<M [GeV/c^2]<" << maxMinv;
610 TText* t =
new TText(0.5, 110, ss2.str().c_str());
617 ss <<
"lmvm_s_bg_region_" <<
min <<
"_" <<
max;
618 TH1D* h_s_bg =
new TH1D(ss.str().c_str(),
619 string(ss.str() +
";Analysis steps;S/BG").c_str(),
623 h_s_bg->GetXaxis()->SetLabelSize(0.06);
627 Int_t bin1 = fh_sum_s_minv[step]->FindBin(
min);
628 Int_t bin2 = fh_sum_s_minv[step]->FindBin(
max);
629 double y = fh_sum_s_minv[step]->Integral(bin1, bin2)
630 / fh_mean_bg_minv[step]->Integral(bin1, bin2);
632 h_s_bg->GetXaxis()->SetBinLabel(
x,
634 h_s_bg->SetBinContent(
x,
y);
636 string str = ss.str();
637 for (string::iterator it = str.begin(); it < str.end(); it++) {
638 if (*it ==
'.') *it =
'_';
642 h_s_bg->GetXaxis()->SetRange(1,
x - 1);
647 TH1D* h_00_02 = SBgRange(0.0, 0.2);
648 TH1D* h_02_06 = SBgRange(0.2, 0.6);
649 TH1D* h_06_12 = SBgRange(0.6, 1.2);
651 fHM[0]->CreateCanvas(
"lmvm_s_bg_ranges",
"lmvm_s_bg_ranges", 700, 700);
653 {h_00_02, h_02_06, h_06_12},
654 {
"0.0<M [GeV/c^{2}]<0.2",
"0.2<M [GeV/c^{2}]<0.6",
"0.6<M [GeV/c^{2}]<1.2"},
663 h_00_02->SetMinimum(1e-3);
664 h_00_02->SetMaximum(3);
665 h_00_02->SetLineWidth(4);
666 h_02_06->SetLineWidth(4);
667 h_06_12->SetLineWidth(4);
669 TH1D* h_05_06 = SBgRange(0.5, 0.6);
670 fHM[0]->CreateCanvas(
671 "lmvm_s_bg_ranges_05_06",
"lmvm_s_bg_ranges_05_06", 700, 700);
673 h_05_06->SetMinimum(1e-3);
674 h_05_06->SetMaximum(2e-2);
675 h_05_06->SetLineWidth(4);
681 fHM[0]->CreateCanvas(
"lmvm_signal_fit",
"lmvm_signal_fit", 600, 600);
682 TCanvas* cDashboard =
683 fHM[0]->CreateCanvas(
"lmvm_dashboard",
"lmvm_dashboard", 1000, 900);
685 TLatex* latex =
new TLatex();
686 latex->SetTextSize(0.03);
687 latex->DrawLatex(0.05, 0.95,
"signal");
688 latex->DrawLatex(0.2, 0.95,
"step");
689 latex->DrawLatex(0.4, 0.95,
"eff, %");
690 latex->DrawLatex(0.55, 0.95,
"S/BG");
691 latex->DrawLatex(0.7, 0.95,
"mean");
692 latex->DrawLatex(0.85, 0.95,
"sigma");
694 for (
int iF = 0; iF < fNofSignals - 1; iF++) {
695 if (!fDrawQgp && iF ==
kQgp)
continue;
697 cout <<
"Signal: " << signalName << endl;
699 ss <<
"lmvm_s_bg_cuts_" << signalName;
701 TH1D* h_s_bg =
new TH1D(ss.str().c_str(),
702 string(ss.str() +
";Analysis steps;S/BG").c_str(),
706 h_s_bg->GetXaxis()->SetLabelSize(0.06);
707 h_s_bg->SetLineWidth(4);
711 if (step <
kElId)
continue;
716 TH1D* bg = (TH1D*) fh_mean_bg_minv[step]->Clone();
719 if (s->GetEntries() > 0) s->Fit(
"gaus",
"Q",
"", 0.95, 1.05);
720 }
else if (iF ==
kOmega) {
721 if (s->GetEntries() > 0) s->Fit(
"gaus",
"Q",
"", 0.69, 0.81);
723 if (s->GetEntries() > 0) s->Fit(
"gaus",
"Q");
726 TF1* func = s->GetFunction(
"gaus");
727 Double_t mean = (func != NULL) ? func->GetParameter(
"Mean") : 0.;
728 Double_t sigma = (func != NULL) ? func->GetParameter(
"Sigma") : 0.;
729 Int_t minInd = s->FindBin(mean - 2. * sigma);
730 Int_t maxInd = s->FindBin(mean + 2. * sigma);
732 Double_t sumSignal = 0.;
734 for (Int_t
i = minInd + 1;
i <= maxInd - 1;
i++) {
735 sumSignal += s->GetBinContent(
i);
736 sumBg += bg->GetBinContent(
i);
738 Double_t sbg = sumSignal / sumBg;
744 bool isOmegaOrPhi = (iF ==
kPhi || iF ==
kOmega);
746 latex->DrawLatex(0.05, 1.0 - iDash * 0.033, signalName.c_str());
749 str.Form(
"%.2f", eff);
750 latex->DrawLatex(0.4, 1.0 - iDash * 0.033, str.Data());
751 str.Form(
"%.3f", sumSignal / sumBg);
753 0.55, 1.0 - iDash * 0.033, (isOmegaOrPhi) ? str.Data() :
"-");
754 str.Form(
"%.1f", 1000. * mean);
756 0.7, 1.0 - iDash * 0.033, (isOmegaOrPhi) ? str.Data() :
"-");
757 str.Form(
"%.1f", 1000. * sigma);
759 0.85, 1.0 - iDash * 0.033, (isOmegaOrPhi) ? str.Data() :
"-");
761 h_s_bg->GetXaxis()->SetBinLabel(
763 if (sbg < 1000.) h_s_bg->SetBinContent(
x, sbg);
767 h_s_bg->GetXaxis()->SetRange(1,
x - 1);
768 fHM[0]->CreateCanvas(ss.str().c_str(), ss.str().c_str(), 800, 800);
770 h_s_bg->SetLineWidth(4);
777 cout <<
"Images output dir:" << fOutputDir << endl;
778 fHM[0]->SaveCanvasToImage(fOutputDir,
"eps;png");