310 const string& option)
312 string hElProjName = name +
"_yProjEl";
313 string hBgProjName = name +
"_yProjBg";
314 TH1D* el = hEl->ProjectionY(hElProjName.c_str(), 1, hEl->GetXaxis()->GetNbins(),
"");
315 TH1D* bg = hBg->ProjectionY(hBgProjName.c_str(), 1, hBg->GetXaxis()->GetNbins(),
"");
316 TH2D* rat = (TH2D*) hEl->Clone();
319 const string hName = name +
"_sign";
320 const string cName =
"Significance/" + name;
327 hEl->GetZaxis()->SetRangeUser(minZ, maxZ);
331 hBg->GetZaxis()->SetRangeUser(minZ, maxZ);
337 DrawH1({el, bg}, {
"Electrons",
"Other"},
kLinear,
kLog,
true, 0.75, 0.75, 0.91, 0.91);
341 double maxX = -999999.;
342 double maxY = -999999.;
343 for (
int iB = 1; iB <= sign->GetNbinsX(); iB++) {
344 if (option ==
"right" && sign->GetBinContent(iB) >= maxY) {
345 maxX = sign->GetBinCenter(iB);
346 maxY = sign->GetBinContent(iB);
348 if (option ==
"left" && sign->GetBinContent(iB) > maxY) {
349 maxX = sign->GetBinCenter(iB);
350 maxY = sign->GetBinContent(iB);
658 for (
size_t iP = 1; iP < 4; iP++) {
674 vector<TLine*> lines {
new TLine(0., 0.01, 1.3, 0.01),
new TLine(1.3, 0.01, 2.5, 0.022)};
679 hEl->GetXaxis()->SetRangeUser(minX, maxX);
680 hEl->GetYaxis()->SetRangeUser(minY, maxY);
681 hEl->GetZaxis()->SetRangeUser(minZ, maxZ);
684 for (
size_t i = 0; i < lines.size(); i++) {
685 lines[i]->SetLineWidth(2.);
689 hBg->GetXaxis()->SetRangeUser(minX, maxX);
690 hBg->GetYaxis()->SetRangeUser(minY, maxY);
691 hBg->GetZaxis()->SetRangeUser(minZ, maxZ);
694 for (
size_t i = 0; i < lines.size(); i++) {
695 lines[i]->SetLineWidth(2.);
708 vector<TLine*> lines {
new TLine(0., 0.01, 1.3, 0.01),
new TLine(1.3, 0.01, 2.5, 0.022)};
712 for (
size_t iP = 1; iP < 4; iP++) {
725 hEl->GetXaxis()->SetRangeUser(minX, maxX);
726 hEl->GetYaxis()->SetRangeUser(minY, maxY);
727 hEl->GetZaxis()->SetRangeUser(minZ, maxZ);
730 for (
size_t i = 0; i < lines.size(); i++) {
731 lines[i]->SetLineWidth(2.);
735 hBg->GetXaxis()->SetRangeUser(minX, maxX);
736 hBg->GetYaxis()->SetRangeUser(minY, maxY);
737 hBg->GetZaxis()->SetRangeUser(minZ, maxZ);
740 for (
size_t i = 0; i < lines.size(); i++) {
741 lines[i]->SetLineWidth(2.);
750 double x[200],
y[200];
756 for (
int i = 0; i < n; i++) {
759 std::sqrt(2 * m2 * TMath::Exp(2 *
x[i]) - m2 * TMath::Exp(4 *
x[i]) + 4 * p2 * TMath::Exp(2 *
x[i]) - m2);
760 double denom = std::sqrt(1 + 2 * TMath::Exp(2 *
x[i]) + TMath::Exp(4 *
x[i]));
764 auto pLine =
new TGraph(n,
x,
y);
766 for (
const string& cat : {
"hPtY",
"hTofM2"}) {
771 string cName = cat +
"/globalTracks/all";
777 string hName = cat +
"_gTracks_" + ptcl;
779 h->GetZaxis()->SetRangeUser(min, max);
782 if (cat ==
"hPtY") pLine->Draw(
"C");
788 if (cat ==
"hTofM2") {
791 string cName = cat +
"/globalTracks/all_zoom";
797 string hName = cat +
"_gTracks_" + ptcl;
799 h->GetXaxis()->SetRangeUser(0., 2.5);
800 h->GetYaxis()->SetRangeUser(-0.05, 0.05);
801 h->GetZaxis()->SetRangeUser(min, max);
810 double min = (cat ==
"hPtY") ? 1e-7 : 1e-8;
811 double max = (cat ==
"hPtY") ? 10 : 10;
814 string cName = cat +
"/candidates/" + ptcl +
"_misid";
819 if (cat ==
"hTofM2") {
820 hTrue->GetXaxis()->SetRangeUser(0., 2.5);
821 hTrue->GetYaxis()->SetRangeUser(-0.05, 0.05);
823 hTrue->GetZaxis()->SetRangeUser(min, max);
826 if (cat ==
"hPtY") pLine->Draw(
"C");
830 if (cat ==
"hTofM2") {
831 hMis->GetXaxis()->SetRangeUser(0., 2.5);
832 hMis->GetYaxis()->SetRangeUser(-0.05, 0.05);
834 hMis->GetZaxis()->SetRangeUser(min, max);
837 if (cat ==
"hPtY") pLine->Draw(
"C");
842 if (cat ==
"hTofM2") {
843 hRat->GetXaxis()->SetRangeUser(0., 2.5);
844 hRat->GetYaxis()->SetRangeUser(-0.05, 0.05);
846 hRat->GetZaxis()->SetRangeUser(1e-5, 1);
847 hRat->GetZaxis()->SetTitle(
"Ratio #misid./#not misid.");
850 if (cat ==
"hPtY") pLine->Draw(
"C");
856 double min = (cat ==
"hPtY") ? 2e-8 : 2e-8;
857 double max = (cat ==
"hPtY") ? 5e-3 : 5e-3;
860 string cName = cat +
"/candidates/" + ptcl +
"_misid_steps";
867 string hName = cat +
"_cands_" + ptcl;
869 if (cat ==
"hTofM2") {
870 h->GetXaxis()->SetRangeUser(0., 2.5);
871 h->GetYaxis()->SetRangeUser(-0.05, 0.05);
873 h->GetZaxis()->SetRangeUser(min, max);
876 if (cat ==
"hPtY") pLine->Draw(
"C");
929 vector<string> yLabel = {
"e^{#pm}_{PLUTO}",
"e^{#pm}_{UrQMD}",
"#pi^{#pm}",
"p",
"K^{+}",
"o."};
936 h->GetZaxis()->SetRangeUser(5e-7, 1e-2);
938 for (
size_t y = 1;
y <= yLabel.size();
y++) {
939 h->GetYaxis()->SetBinLabel(
y, yLabel[
y - 1].c_str());
941 double nEl =
h->Integral(1,
h->GetXaxis()->GetNbins(), 2, 2);
942 double purity = (nEl /
h->Integral(1,
h->GetXaxis()->GetNbins(), 2,
h->GetYaxis()->GetNbins())) * 100;
949 int nBins =
fHMean.
H2(
"hCandPdgVsMom_elid")->GetXaxis()->GetNbins();
950 double xMin =
fHMean.
H2(
"hCandPdgVsMom_elid")->GetXaxis()->GetXmin();
951 double xMax =
fHMean.
H2(
"hCandPdgVsMom_elid")->GetXaxis()->GetXmax();
952 TH1D* purity =
new TH1D(
"purity_Mom",
"purity_Mom; P [GeV/c]; Purity [%]", nBins, xMin, xMax);
953 for (
int i = 1; i <= purity->GetNbinsX(); i++) {
956 ->Integral(i, i, 2,
fHMean.
H2(
"hCandPdgVsMom_elid")->GetYaxis()->GetNbins());
957 double val = (nAll != 0) ? 100 * nEl / nAll : 0.;
958 purity->SetBinContent(i, val);
961 purity->Scale(1. / 5.);
968 vector<string> yLabel = {
"#pi^{+}",
"#pi^{-}",
"p",
"K^{+}",
"K^{-}",
"o."};
975 TH2D* rich2 =
fHMean.
H2Clone(
"hPdgVsMom_gTracks_rich_complete");
976 TH2D* trd2 =
fHMean.
H2Clone(
"hPdgVsMom_gTracks_trd_complete");
977 TH2D* tof2 =
fHMean.
H2Clone(
"hPdgVsMom_gTracks_tof_complete");
979 rich1->GetZaxis()->SetRangeUser(min, max);
980 trd1->GetZaxis()->SetRangeUser(min, max);
981 tof1->GetZaxis()->SetRangeUser(min, max);
982 rich2->GetZaxis()->SetRangeUser(min, max);
983 trd2->GetZaxis()->SetRangeUser(min, max);
984 tof2->GetZaxis()->SetRangeUser(min, max);
986 for (
size_t y = 1;
y <= yLabel.size();
y++) {
987 rich1->GetYaxis()->SetBinLabel(
y, yLabel[
y - 1].c_str());
988 trd1->GetYaxis()->SetBinLabel(
y, yLabel[
y - 1].c_str());
989 tof1->GetYaxis()->SetBinLabel(
y, yLabel[
y - 1].c_str());
990 rich2->GetYaxis()->SetBinLabel(
y, yLabel[
y - 1].c_str());
991 trd2->GetYaxis()->SetBinLabel(
y, yLabel[
y - 1].c_str());
992 tof2->GetYaxis()->SetBinLabel(
y, yLabel[
y - 1].c_str());
995 TCanvas* c1 =
fHMean.
fHM.
CreateCanvas(
"Misid/misid_gTracks_all",
"Misid/misid_gTracks_all", 2400, 800);
1010 TCanvas* c2 =
fHMean.
fHM.
CreateCanvas(
"Misid/misid_gTracks_complete",
"Misid/misid_gTracks_complete", 2400, 800);
1059 vector<string> xLabel = {
"0",
"1",
"2",
"3"};
1060 vector<string> yLabel = {
"true-ID",
"mis-ID"};
1061 fHMean.
DrawAllGTracks(2,
"hMatchId_gTracks",
"hMatchId_gTracks", {xLabel}, {yLabel}, 1e-7, 1e3);
1065 fHMean.
DrawAllGTracks(2,
"hRichRingTrackDist/gTracks_all",
"hRichRingTrackDist_gTracks", {
""}, {
""}, 1e-7,
1071 double minXY = 1e-6;
1072 double maxXY = 1e-3;
1075 for (
const string& cat : {
"trueid",
"misid",
"truematch",
"mismatch"}) {
1076 fHMean.
DrawAllGTracks(2,
"ToF/HitTrackDist/HitPointDist_" + cat,
"hTofHitTrackDist_gTracks_" + cat, {
""}, {
""},
1078 fHMean.
DrawAllGTracks(2,
"ToF/HitXY/PointXY_" + cat,
"hTofPointXY_" + cat, {
""}, {
""}, minXY, maxXY);
1079 fHMean.
DrawAllGTracks(2,
"ToF/HitXY/HitXY_" + cat,
"hTofHitXY_" + cat, {
""}, {
""}, minXY, maxXY);
1080 fHMean.
DrawAllGTracks(1,
"ToF/HitXY/HitPointDist_" + cat,
"hTofHitPointDist_" + cat, {
""}, {
""}, minD, maxD);
1082 fHMean.
DrawAllCands(2,
"ToF/Time/HitTrackDist_cands",
"hTofHitTrackDist_cands", {
""}, {
""}, 1e-9, 1.);
1083 fHMean.
DrawAllCands(2,
"ToF/Time/TimeVsMom_",
"hTofTimeVsMom_cands", {
""}, {
""}, 1e-9, 1e-2);
1085 {
"true-ID",
"mis-ID",
"truematch",
"mismatch"}, 1e-9, 10);
1087 TCanvas* c1 =
fHMean.
fHM.
CreateCanvas(
"ToF/HitXY/HitPointDist_all",
"ToF/HitXY/HitPointDist_all", 2400, 2400);
1094 string text = (iP <= 3) ?
"true-ID" :
"mis-ID";
1096 h->GetYaxis()->SetRangeUser(minD, maxD);
1097 h->Fit(
"gaus",
"Q",
"", 0., 2.);
1101 TF1* func =
h->GetFunction(
"gaus");
1102 double mean = (func !=
nullptr) ? func->GetParameter(
"Mean") : 0.;
1108 for (
const string& match : {
"truematch",
"mismatch"}) {
1109 for (
const string& cat : {
"all",
"complete"}) {
1110 for (
const string& det : {
"rich",
"trd",
"tof"}) {
1111 string cName =
"hChi2/" + match +
"_" + det +
"_" + cat;
1112 string hName =
"hChi2_" + match +
"_" + cat +
"_" + det;
1123 vector<TH2D*> xyz {
fHMean.
H2(
"hVertexXZ_misidTof", step),
fHMean.
H2(
"hVertexYZ_misidTof", step),
1124 fHMean.
H2(
"hVertexXY_misidTof", step)};
1128 for (
size_t i = 0; i < xyz.size(); i++) {
1131 xyz[i]->SetMinimum(min);
1132 gPad->SetLogz(
true);
1135 TCanvas* cZoom =
fHMean.
fHM.
CreateCanvas((cName +
"_zoom").c_str(), (cName +
"_zoom").c_str(), 1800, 600);
1136 cZoom->Divide(3, 1);
1137 for (
size_t i = 0; i < xyz.size(); i++) {
1138 TH2D* hZoom = (TH2D*) xyz[i]->Clone();
1141 hZoom->GetXaxis()->SetRangeUser(-10., 10.);
1142 hZoom->GetYaxis()->SetRangeUser(-10., 10.);
1145 hZoom->GetXaxis()->SetRangeUser(
fZ - 1.,
fZ + 10.);
1146 hZoom->GetYaxis()->SetRangeUser(-10., 10.);
1149 hZoom->SetMinimum(min);
1150 gPad->SetLogz(
true);
1155 hRZ->SetMinimum(min);
1169 double minMism = 1e-4;
1170 double maxMism = 100.;
1172 vector<string> xLabelDet = {
"STS_{all}",
"RICH_{all}",
"RICH_{mis}",
"TRD_{all}",
1173 "TRD_{mis}",
"ToF_{all}",
"ToF_{mis}"};
1174 fHMean.
DrawAllGTracks(1,
"Mismatches/hNofMismatches_all",
"hNofMismatches_gTracks_all", xLabelDet, {
""}, minMism,
1176 fHMean.
DrawAllGTracks(1,
"Mismatches/hNofMismatches_complete",
"hNofMismatches_gTracks_complete", xLabelDet, {
""},
1179 vector<string> xLabelSeg = {
"0",
"1",
"2",
"3"};
1180 fHMean.
DrawAllGTracks(1,
"Mismatches/hNofMismatchedTrackSegments_all",
"hNofMismatchedTrackSegments_all", xLabelSeg,
1181 {
""}, minMism, maxMism);
1182 fHMean.
DrawAllGTracks(1,
"Mismatches/hNofMismatchedTrackSegments_complete",
"hNofMismatchedTrackSegments_complete",
1183 xLabelSeg, {
""}, minMism, maxMism);
1217 TH1D* sbg =
static_cast<TH1D*
>(bg->Clone());
1220 double binWidth = bg->GetBinWidth(1);
1225 sHist->Scale(1. /
H(signal)->H1(
"hEventNumber")->GetEntries());
1227 sHist->Scale(1. / binWidth);
1228 sHists[
static_cast<int>(signal)] = sHist;
1231 vector<LmvmDrawMinvData> drawData;
1233 drawData.emplace_back(sbg, kBlack, kBlack, 1, -1,
"Cocktail+BG");
1234 drawData.emplace_back(bg, kGray, kBlack, 1, 3001,
"Background");
1237 drawData.emplace_back(pi0, kGreen - 3, kGreen + 3, 2, -1,
"#pi^{0} #rightarrow #gammae^{+}e^{-}");
1238 drawData.emplace_back(eta, kRed - 4, kRed + 2, 2, -1,
"#eta #rightarrow #gammae^{+}e^{-}");
1239 drawData.emplace_back(sHists[
static_cast<int>(
ELmvmSignal::OmegaD)], kCyan + 2, kCyan + 4, 2, -1,
1240 "#omega #rightarrow #pi^{0}e^{+}e^{-}");
1241 drawData.emplace_back(sHists[
static_cast<int>(
ELmvmSignal::Omega)], kOrange + 7, kOrange + 4, 2, -1,
1242 "#omega #rightarrow e^{+}e^{-}");
1243 drawData.emplace_back(sHists[
static_cast<int>(
ELmvmSignal::Phi)], kAzure + 2, kAzure + 3, 2, -1,
1244 "#phi #rightarrow e^{+}e^{-}");
1245 drawData.emplace_back(sHists[
static_cast<int>(
ELmvmSignal::Qgp)], kOrange - 2, kOrange - 3, 4, 3112,
"QGP radiation");
1246 drawData.emplace_back(sHists[
static_cast<int>(
ELmvmSignal::Inmed)], kMagenta - 3, kMagenta - 2, 4, 3018,
1248 drawData.emplace_back(cocktail, -1, kRed + 2, 4, -1,
"Cocktail");
1249 drawData.emplace_back(cb, -1, kCyan + 2, 4, -1,
"CB");
1251 double min = std::numeric_limits<Double_t>::max();
1252 double max = std::numeric_limits<Double_t>::min();
1254 TLegend* leg =
new TLegend(0.7, 0.57, 0.99, 0.97);
1255 for (
size_t i = 0; i < drawData.size(); i++) {
1256 const auto& d = drawData[i];
1257 d.fH->GetYaxis()->SetLabelSize(0.05);
1259 if (d.fFillColor != -1) d.fH->SetFillColor(d.fFillColor);
1260 if (d.fFillStyle != -1) d.fH->SetFillStyle(d.fFillStyle);
1261 leg->AddEntry(d.fH, d.fLegend.c_str(),
"f");
1262 DrawH1(d.fH,
kLinear,
kLinear, (h0 ==
nullptr) ?
"hist" :
"hist,same", d.fLineColor, d.fLineWidth, 0);
1263 if (h0 ==
nullptr) h0 = d.fH;
1265 max = std::max(d.fH->GetMaximum(), max);
1267 if (min == 0.) min = std::min(1e-4, max * 1e-7);
1268 if (h0 !=
nullptr) h0->SetMinimum(min);
1269 if (h0 !=
nullptr) h0->SetMaximum(1.1 * max);
1271 leg->SetFillColor(kWhite);
1273 gPad->SetLogy(
true);
1329 double ChangeValue = 1.2;
1331 int binChange =
h->GetXaxis()->FindBin(ChangeValue);
1332 double bW =
h->GetXaxis()->GetBinWidth(1);
1333 const int nBins = (int) binChange + (
h->GetNbinsX() - binChange) / f;
1334 vector<double> binEdges(nBins + 1, 0.);
1336 for (
int iB = 1; iB <= nBins; iB++) {
1337 binEdges[iB] = (iB < binChange) ? binEdges[iB - 1] + bW : binEdges[iB - 1] + f * bW;
1339 binEdges[nBins + 1] =
h->GetBinCenter(
h->GetNbinsX()) + bW / f;
1349 TH1D* h_npm =
new TH1D(
"h_npm",
"h_npm", nBins, binEdges.data());
1350 TH1D* h_bc =
new TH1D(
"h_bc",
"h_bc", nBins, binEdges.data());
1351 TH1D* h_coc =
new TH1D(
"h_coc",
"h_coc", nBins, binEdges.data());
1352 TH1D* h_eta =
new TH1D(
"h_eta",
"h_eta", nBins, binEdges.data());
1353 TH1D* h_pi0 =
new TH1D(
"h_pi0",
"h_pi0", nBins, binEdges.data());
1354 TH1D* h_inmed =
new TH1D(
"h_inmed",
"h_inmed", nBins, binEdges.data());
1355 TH1D* h_qgp =
new TH1D(
"h_qgp",
"h_qgp", nBins, binEdges.data());
1356 TH1D* h_omega =
new TH1D(
"h_omega",
"h_omega", nBins, binEdges.data());
1357 TH1D* h_omegaD =
new TH1D(
"h_omegaD",
"h_omegaD", nBins, binEdges.data());
1358 TH1D* h_phi =
new TH1D(
"h_phi",
"h_phi", nBins, binEdges.data());
1372 hInmed0->Scale(1. / (nofInmed * bW));
1373 hQgp0->Scale(1. / (nofQgp * bW));
1374 hOmega0->Scale(1. / (nofOmega * bW));
1375 hOmegaD0->Scale(1. / (nofOmegaD * bW));
1376 hPhi0->Scale(1. / (nofPhi * bW));
1378 for (
int iB = 1; iB <=
h->GetNbinsX(); iB++) {
1379 if (iB < binChange) {
1380 h_npm->SetBinContent(iB,
fHMean.
H1(
"hMinvCombPM_sameEv", step)->GetBinContent(iB));
1381 h_bc->SetBinContent(iB,
fHMean.
H1(
"hMinvCombBg", step)->GetBinContent(iB));
1385 h_inmed->SetBinContent(iB, hInmed0->GetBinContent(iB));
1386 h_qgp->SetBinContent(iB, hQgp0->GetBinContent(iB));
1387 h_omega->SetBinContent(iB, hOmega0->GetBinContent(iB));
1388 h_omegaD->SetBinContent(iB, hOmegaD0->GetBinContent(iB));
1389 h_phi->SetBinContent(iB, hPhi0->GetBinContent(iB));
1392 int iB2 = (int) binChange + (iB - binChange) / f;
1393 h_npm->SetBinContent(iB2,
1394 h_npm->GetBinContent(iB2) +
fHMean.
H1(
"hMinvCombPM_sameEv", step)->GetBinContent(iB) / f);
1395 h_bc->SetBinContent(iB2, h_bc->GetBinContent(iB2) +
fHMean.
H1(
"hMinvCombBg", step)->GetBinContent(iB) / f);
1396 h_coc->SetBinContent(iB2, h_coc->GetBinContent(iB2) +
GetCocktailMinvH1(
"hMinv", step)->GetBinContent(iB) / f);
1397 h_eta->SetBinContent(iB2, h_eta->GetBinContent(iB2)
1399 h_pi0->SetBinContent(iB2, h_pi0->GetBinContent(iB2)
1401 h_inmed->SetBinContent(iB2, h_inmed->GetBinContent(iB2) + hInmed0->GetBinContent(iB) / f);
1402 h_qgp->SetBinContent(iB2, h_qgp->GetBinContent(iB2) + hQgp0->GetBinContent(iB) / f);
1403 h_omega->SetBinContent(iB2, h_omega->GetBinContent(iB2) + hOmega0->GetBinContent(iB) / f);
1404 h_omegaD->SetBinContent(iB2, h_omegaD->GetBinContent(iB2) + hOmegaD0->GetBinContent(iB) / f);
1405 h_phi->SetBinContent(iB2, h_phi->GetBinContent(iB2) + hPhi0->GetBinContent(iB) / f);
1411 for (
int iB = 1; iB <= h_npm->GetNbinsX(); iB++) {
1412 double bW2 = h_npm->GetBinLowEdge(iB + 1) - h_npm->GetBinLowEdge(iB);
1414 h_npm->SetBinError(iB, std::sqrt(h_npm->GetBinContent(iB) * bW2 * nEv) / (bW2 * nEv));
1415 h_bc->SetBinError(iB, std::sqrt(h_bc->GetBinContent(iB) * bW2 * nEv) / (bW2 * nEv));
1418 TH1D* h_sum = (TH1D*) h_eta->Clone();
1420 h_sum->Add(h_inmed);
1422 h_sum->Add(h_omega);
1423 h_sum->Add(h_omegaD);
1426 TH1D* h_sum2 = (TH1D*) h_sum->Clone();
1428 fHMean.
SetOptH1(h_npm,
"#font[52]{M}_{ee} [GeV/#font[52]{c}^{2}]",
1429 "1/N_{ev} dN/d#font[52]{M}_{ee} [GeV/#font[52]{c}^{2}]^{-1}", 510, 21, 1.3, kPink,
"marker");
1430 fHMean.
SetOptH1(h_bc,
"#font[52]{M}_{ee} [GeV/#font[52]{c}^{2}]",
1431 "1/N_{ev} dN/d#font[52]{M}_{ee} [GeV/#font[52]{c}^{2}]^{-1}", 510, 22, 1.3, kBlue - 2,
"marker");
1432 fHMean.
SetOptH1(h_sum,
"#font[52]{M}_{ee} [GeV/#font[52]{c}^{2}]",
1433 "1/N_{ev} dN/d#font[52]{M}_{ee} [GeV/#font[52]{c}^{2}]^{-1}", 510, 20, 1.1, kBlack,
"marker");
1441 fHMean.
SetOptH1(h_omegaD,
"",
"", 510, 1, 1, kGreen + 3,
"line");
1445 h_npm->GetYaxis()->SetRangeUser(1e-9, 10);
1453 h_npm->Draw(
"peist");
1454 h_bc->Draw(
"peistsame");
1455 h_sum->Draw(
"phistsame");
1457 h_sum2->Draw(
"histsame");
1458 h_eta->Draw(
"histsame");
1459 h_pi0->Draw(
"histsame");
1460 h_inmed->Draw(
"histsame");
1461 h_qgp->Draw(
"histsame");
1462 h_omega->Draw(
"histsame");
1463 h_omegaD->Draw(
"histsame");
1464 h_phi->Draw(
"histsame");
1466 vector<LmvmLegend> legend3;
1467 legend3.emplace_back(h_npm,
"N^{#pm}_{same}",
"p");
1468 legend3.emplace_back(h_bc,
"CB_{calc}",
"p");
1469 legend3.emplace_back(h_sum,
"MC Cocktail",
"p");
1471 vector<LmvmLegend> legend8;
1472 legend8.emplace_back(h_sum2,
"MC Cocktail",
"l");
1473 legend8.emplace_back(h_eta,
"#eta#rightarrow#gammae^{+}e^{-}",
"l");
1474 legend8.emplace_back(h_pi0,
"#pi^{0}#rightarrow#gammae^{+}e^{-}",
"l");
1475 legend8.emplace_back(h_omegaD,
"#omega#rightarrow#pi^{0}e^{+}e^{-}",
"l");
1476 legend8.emplace_back(h_omega,
"#omega#rightarrowe^{+}e^{-}",
"l");
1477 legend8.emplace_back(h_phi,
"#phi#rightarrowe^{+}e^{-}",
"l");
1478 legend8.emplace_back(h_inmed,
"Rapp in-medium SF",
"l");
1479 legend8.emplace_back(h_qgp,
"Rapp QGP",
"l");
1484 TLatex* tex =
new TLatex(0.15, 2.5,
"CBM Simulations");
1485 tex->SetTextColor(1);
1486 tex->SetTextSize(0.035);
1487 tex->SetTextFont(42);
1489 TLatex* tex2 =
new TLatex(0.15, 0.7,
"0 fm Au+Au, #sqrt{s_{NN}}=4.1 GeV");
1490 tex2->SetTextColor(1);
1491 tex2->SetTextSize(0.035);
1492 tex2->SetTextFont(42);
1514 TH1D* pi0pi0 =
fHMean.
H1Clone(
"hMinvBgSource2_elid_pi0pi0");
1524 physBg->Add(
fHMean.
H1(
"hMinvBgSource2_elid_gpi0"));
1525 physBg->Add(
fHMean.
H1(
"hMinvBgSource2_elid_pi0pi0"));
1540 vector<LmvmDrawMinvData> drawData;
1542 drawData.emplace_back(gpi0, kBlack, kBlack, 1, -1,
"#gamma - #pi^{0}");
1543 drawData.emplace_back(pi0pi0, kGray + 1, kGray + 1, 1, -1,
"#pi^{0} - #pi^{0}");
1544 drawData.emplace_back(gg, kCyan + 2, kCyan + 4, 2, -1,
"#gamma - #gamma");
1545 drawData.emplace_back(pipi0, kGreen - 3, kGreen + 3, 2, -1,
"#pi^{#pm}_{misid} - #pi^{0}");
1546 drawData.emplace_back(pi0o, kRed - 4, kRed + 2, 1, -1,
"#pi^{0} - o.");
1547 drawData.emplace_back(gpi, kOrange + 7, kOrange + 4, 2, -1,
"#gamma - #pi^{#pm}_{misid}");
1548 drawData.emplace_back(go, kAzure + 2, kAzure + 3, 2, -1,
"#gamma - o.");
1549 drawData.emplace_back(pipi, kOrange - 2, kOrange - 3, 4, 3112,
"#pi^{#pm}_{misid} - #pi^{#pm}_{misid}");
1550 drawData.emplace_back(pio, kMagenta - 3, kMagenta - 2, 4, 3018,
"#pi^{#pm}_{misid} - o.");
1551 drawData.emplace_back(oo, -1, kRed + 2, 4, -1,
"o. - o.");
1553 string cName =
"minvBgSrc/minvBgSrc";
1557 TLegend* leg =
new TLegend(0.65, 0.55, 0.95, 0.95);
1558 for (
size_t i = 0; i < drawData.size(); i++) {
1559 const auto& d = drawData[i];
1560 d.fH->GetYaxis()->SetLabelSize(0.05);
1562 if (d.fFillColor != -1) d.fH->SetFillColor(d.fFillColor);
1563 if (d.fFillStyle != -1) d.fH->SetFillStyle(d.fFillStyle);
1564 leg->AddEntry(d.fH, d.fLegend.c_str(),
"f");
1565 DrawH1(d.fH,
kLinear,
kLinear, (h0 ==
nullptr) ?
"hist" :
"hist,same", d.fLineColor, d.fLineWidth, 0);
1566 if (h0 ==
nullptr) h0 = d.fH;
1569 leg->SetFillColor(kWhite);
1571 gPad->SetLogy(
true);
1574 DrawH1({physBg, cPi, rest}, {
"Phys. BG",
"BG w. misid. #pi^{#pm}",
"Rest"},
kLinear,
kLog,
true, 0.7, 0.8, 0.95, 0.91,
1579 TH1D* bgRat =
static_cast<TH1D*
>(physBg->Clone());
1583 int nBins = bgRat->GetNbinsX();
1584 for (
int i = 1; i <= nBins; i++) {
1588 bgRat->SetBinContent(i, r);
1592 bgRat->SetMinimum(0.9);
1593 bgRat->SetMaximum(2.1);
1595 fHMean.
fHM.
CreateCanvas((cName +
"_compWithBg").c_str(), (cName +
"_compWithBg").c_str(), 800, 800);
1610 string folder =
"CombinatorialBackground/";
1611 string folderUAll = folder +
"UrQMD/All/";
1612 string folderUEl = folder +
"UrQMD/Electrons/";
1616 for (
const string& cat : {
"",
"_urqmdEl",
"_urqmdAll"}) {
1617 for (
const string& ev : {
"sameEv",
"mixedEv"}) {
1618 string cName = (cat ==
"_urqmdAll") ? folderUAll +
"PairYields_" + ev
1619 : (cat ==
"_urqmdEl") ? folderUEl +
"PairYields_" + ev
1620 : folder +
"PairYields_" + ev;
1627 TH1D* pp =
fHMean.
H1Clone(
"hMinvCombPP" + cat +
"_" + ev, step);
1628 TH1D* mm =
fHMean.
H1Clone(
"hMinvCombMM" + cat +
"_" + ev, step);
1629 TH1D* pm =
fHMean.
H1Clone(
"hMinvCombPM" + cat +
"_" + ev, step);
1630 pm->GetYaxis()->SetTitle(
"Yield");
1631 if (ev ==
"sameEv") pm->GetYaxis()->SetRangeUser(1e-6, 2e-2);
1632 DrawH1({pm, pp, mm}, {
"e+e-",
"e+e+",
"e-e-"},
kLinear,
kLog,
true, 0.85, 0.7, 0.99, 0.99,
"HIST");
1641 for (
const string& cat : {
"",
"_urqmdEl"}) {
1642 string cName = (cat ==
"_urqmdEl") ? folderUEl : folder;
1643 TCanvas* c =
fHMean.
fHM.
CreateCanvas(cName +
"RatioMMPP_same", cName +
"RatioMMPP_same", 1800, 1800);
1649 TH1D* pp =
fHMean.
H1Clone(
"hMinvCombPP" + cat +
"_sameEv", step);
1650 TH1D* mm =
fHMean.
H1Clone(
"hMinvCombMM" + cat +
"_sameEv", step);
1652 mm->GetYaxis()->SetTitle(
"Ratio e^{-}e^{-}/e^{+}e^{+}");
1661 for (
const string& cat : {
"",
"_urqmdEl",
"_urqmdAll"}) {
1662 string cName = (cat ==
"_urqmdAll") ? folderUAll : (cat ==
"_urqmdEl") ? folderUEl : folder;
1669 TH1D* same =
fHMean.
H1Clone(
"hMinvCombGeom" + cat +
"_sameEv", step);
1670 TH1D* mixed =
fHMean.
H1Clone(
"hMinvCombGeom" + cat +
"_mixedEv", step);
1671 int minBin = same->FindBin(0.4);
1672 int maxBin = same->FindBin(0.7);
1673 double scale = same->Integral(minBin, maxBin) / mixed->Integral(minBin, maxBin);
1674 mixed->Scale(scale);
1675 same->GetXaxis()->SetTitle(
"M_{ee} [GeV/c^{2}]");
1676 same->SetMinimum(1e-8);
1677 mixed->SetMinimum(1e-8);
1678 DrawH1({same, mixed}, {
"geom. mean (same)",
"geom. mean (mixed)"},
kLinear,
kLog,
true, 0.52, 0.8, 0.99, 0.99,
1692 DrawH1({kAll, kUAll, kUEl}, {
"k (all)",
"k (UrQMD all)",
"k (UrQMD El"},
kLinear,
kLinear,
true, 0.65, 0.8, 0.99,
1694 kAll->GetYaxis()->SetTitle(
"k Factor");
1695 kAll->GetYaxis()->SetRangeUser(0.8, 1.2);
1703 for (
const string& cat : {
"",
"_urqmdEl",
"_urqmdAll"}) {
1704 string cName = (cat ==
"_urqmdAll") ? folderUAll : (cat ==
"_urqmdEl") ? folderUEl : folder;
1707 TH1D* npm =
fHMean.
H1Clone(
"hMinvCombPM" + cat +
"_sameEv", step);
1711 TH1D* sbg =
static_cast<TH1D*
>(bg->Clone());
1713 TH1D* ratS = (TH1D*) npm->Clone();
1715 TH1D* ratB = (TH1D*) cb->Clone();
1718 npm->GetYaxis()->SetRangeUser(1e-6, 2e-2);
1719 DrawH1({npm, sbg, cb, bg}, {
"N^{+-}_{same}",
"BG + Cocktail",
"CB_{calc}",
"Background"},
kLinear,
kLog,
true,
1720 0.7, 0.7, 0.99, 0.95,
"p");
1723 ratS->GetYaxis()->SetTitle(
"Ratio");
1724 ratS->GetYaxis()->SetRangeUser(0., 2.);
1725 ratB->GetYaxis()->SetRangeUser(0., 2.);
1726 DrawH1({ratS, ratB}, {
"N^{+-}_{same} / BG+Coc",
"CB_{calc} / BG"},
kLinear,
kLinear,
true, 0.7, 0.8, 0.99, 0.95,
1736 TH1D* rsUAll =
fHMean.
H1Clone(
"hMinvCombPM_urqmdAll_sameEv", step);
1737 TH1D* rsUEl =
fHMean.
H1Clone(
"hMinvCombPM_urqmdEl_sameEv", step);
1746 rsAll->Divide(cbgAll);
1747 rsUAll->Divide(cbgUAll);
1748 rsUEl->Divide(cbgUEl);
1751 TH1D* rbUAll =
fHMean.
H1Clone(
"hMinvCombBg_urqmdAll", step);
1758 rsAll->GetYaxis()->SetTitle(
"N^{+-}_{same} / BG+Coc");
1759 rsAll->GetYaxis()->SetRangeUser(0., 2.);
1760 rbAll->GetYaxis()->SetTitle(
"CB_{calc} / BG");
1761 rbAll->GetYaxis()->SetRangeUser(0., 2.);
1766 DrawH1({rsAll, rsUAll, rsUEl}, {
"UrQMD + PLUTO",
"UrQMD",
"UrQMD electrons"},
kLinear,
kLinear,
true, 0.55, 0.78,
1767 0.99, 0.95,
"hist");
1770 DrawH1({rbAll, rbUAll, rbUEl}, {
"UrQMD + PLUTO",
"UrQMD",
"UrQMD electrons"},
kLinear,
kLinear,
true, 0.55, 0.78,
1771 0.99, 0.95,
"hist");
1785 DrawH1({cb, cbU}, {
"B_{C}",
"B_{C} from UrQMD electrons"},
kLinear,
kLog,
true, 0.55, 0.8, 0.99, 0.95);
1792 for (
const string& cat : {
"",
"_urqmdEl",
"_urqmdAll"}) {
1793 string cName = (cat ==
"_urqmdEl") ? folderUEl : (cat ==
"_urqmdAll") ? folderUAll : folder;
1800 TH1D* pmSame =
fHMean.
H1Clone(
"hMinvCombPM" + cat +
"_sameEv", step);
1802 TH1D* combSignalNpm =
fHMean.
H1Clone(
"hMinvCombSignalNpm" + cat, step);
1804 pmSame->SetMaximum(1e-2);
1805 pmSame->SetMinimum(4e-9);
1806 DrawH1({pmSame, combBg, combSignalNpm, cocktail},
1807 {
"N_{same}^{+-}",
"B_{c}",
"Signal (N_{same}^{+-} - B_{c})",
"Cocktail"},
kLinear,
kLog,
true, 0.53,
1808 0.75, 0.99, 0.92,
"p");
1816 for (
const string& cat : {
"",
"_urqmdEl",
"_urqmdAll"}) {
1817 string cName = (cat ==
"_urqmdEl") ? folderUEl : (cat ==
"_urqmdAll") ? folderUAll : folder;
1818 TCanvas* c =
fHMean.
fHM.
CreateCanvas(cName +
"CbVsInput_cocBg", cName +
"CbVsInput_cocBg", 1800, 1800);
1827 TH1D* sBgSignal =
fHMean.
H1Clone(
"hMinvCombSignalMc" + cat, step);
1828 sbg2->SetMaximum(2e-2);
1829 sbg2->SetMinimum(4e-9);
1831 DrawH1({sbg2, combBg, sBgSignal, cocktail}, {
"Cocktail + BG",
"B_{C}",
"Signal (Cock+BG - B_{C})",
"Cocktail"},
1832 kLinear,
kLog,
true, 0.53, 0.72, 0.99, 0.92,
"p");
1868 for (
const string& cat : {
"",
"_urqmdEl",
"_urqmdAll"}) {
1872 for (
const string& ev : {
"_sameEv",
"_mixedEv"}) {
1875 TH1D* geom =
fHMean.
CreateHByClone<TH1D>(
"hMinvCombMM" + cat + ev,
"hMinvCombGeom" + cat + ev, step);
1877 for (
int i = 1; i <= geom->GetNbinsX(); i++) {
1878 double cpp = pp->GetBinContent(i);
1879 double cmm = mm->GetBinContent(i);
1880 double content = std::sqrt(cpp * cmm);
1881 geom->SetBinContent(i, content);
1886 TH1D* k =
fHMean.
CreateHByClone<TH1D>(
"hMinvCombPM" + cat +
"_mixedEv",
"hMinvCombK" + cat, step);
1887 k->Divide(
fHMean.
H1(
"hMinvCombGeom" + cat +
"_mixedEv", step));
1892 TH1D* hGeomSame =
fHMean.
H1(
"hMinvCombGeom" + cat +
"_sameEv", step);
1893 TH1D* hGeomMixed =
fHMean.
H1(
"hMinvCombGeom" + cat +
"_mixedEv", step);
1894 int minBin = hGeomSame->FindBin(0.3);
1895 int maxBin = hGeomSame->FindBin(1.0);
1896 double normGM = hGeomSame->Integral(minBin, maxBin) / hGeomMixed->Integral(minBin, maxBin);
1899 TH1D* hBc =
fHMean.
CreateHByClone<TH1D>(
"hMinvCombGeom" + cat +
"_sameEv",
"hMinvCombBg" + cat, step);
1900 for (
int i = 0; i <= hBc->GetNbinsX(); i++) {
1901 double val = (i <= minBin) ? 2 *
fHMean.
H1(
"hMinvCombK" + cat, step)->GetBinContent(i)
1902 *
fHMean.
H1(
"hMinvCombGeom" + cat +
"_sameEv", step)->GetBinContent(i)
1903 : normGM *
fHMean.
H1(
"hMinvCombPM" + cat +
"_mixedEv", step)->GetBinContent(i);
1904 hBc->SetBinContent(i, val);
1909 TH1D* hSigNpm =
fHMean.
CreateHByClone<TH1D>(
"hMinvCombPM" + cat +
"_sameEv",
"hMinvCombSignalNpm" + cat, step);
1910 hSigNpm->Add(
fHMean.
H1(
"hMinvCombBg" + cat, step), -1.);
1913 TH1D* hSigCoc =
fHMean.
CreateHByClone<TH1D>(
"hMinv" + cat +
"_bg",
"hMinvCombSignalMc" + cat, step);
1915 hSigCoc->Add(
fHMean.
H1(
"hMinvCombBg" + cat, step), -1.);
1919 double bW =
fHMean.
H1(
"hMinvCombPM" + cat +
"_sameEv", step)->GetBinWidth(1);
1920 int nofBins =
fHMean.
H1(
"hMinvCombPM" + cat +
"_sameEv", step)->GetNbinsX();
1921 for (
int i = 1; i <= nofBins; i++) {
1923 double s_pm =
fHMean.
H1(
"hMinvCombPM" + cat +
"_sameEv", step)->GetBinContent(i) * nofEvents * bW;
1924 double s_pp =
fHMean.
H1(
"hMinvCombPP" + cat +
"_sameEv", step)->GetBinContent(i) * nofEvents * bW;
1925 double s_mm =
fHMean.
H1(
"hMinvCombMM" + cat +
"_sameEv", step)->GetBinContent(i) * nofEvents * bW;
1926 double m_pm =
fHMean.
H1(
"hMinvCombPM" + cat +
"_mixedEv", step)->GetBinContent(i) * nofEvents * bW;
1927 double m_pp =
fHMean.
H1(
"hMinvCombPP" + cat +
"_mixedEv", step)->GetBinContent(i) * nofEvents * bW;
1928 double m_mm =
fHMean.
H1(
"hMinvCombMM" + cat +
"_mixedEv", step)->GetBinContent(i) * nofEvents * bW;
1931 double d_m_pm = std::sqrt(s_pp * s_mm / (m_pp * m_mm));
1932 double d_m_pp = -0.5 * m_pm * m_mm * std::sqrt(s_pp * s_mm) / (std::pow(std::sqrt(m_pp * m_mm), 3));
1933 double d_m_mm = -0.5 * m_pm * m_pp * std::sqrt(s_pp * s_mm) / (std::pow(std::sqrt(m_pp * m_mm), 3));
1934 double d_s_pp = 0.5 * m_pm * s_mm / std::sqrt(m_pp * m_mm * s_pp * s_mm);
1935 double d_s_mm = 0.5 * m_pm * s_pp / std::sqrt(m_pp * m_mm * s_pp * s_mm);
1938 double f_m_pm = std::pow(d_m_pm * std::sqrt(m_pm), 2);
1939 double f_m_pp = std::pow(d_m_pp * std::sqrt(m_pp), 2);
1940 double f_m_mm = std::pow(d_m_mm * std::sqrt(m_mm), 2);
1941 double f_s_pp = std::pow(d_s_pp * std::sqrt(s_pp), 2);
1942 double f_s_mm = std::pow(d_s_mm * std::sqrt(s_mm), 2);
1945 double errorBc = std::sqrt(f_m_pm + f_m_pp + f_m_mm + f_s_pp + f_s_mm) / (nofEvents * bW);
1946 double errorBc2 = normGM * std::sqrt(m_pm) / (nofEvents * bW);
1947 double errorSig = std::sqrt(s_pm + std::pow(errorBc, 2)) / (nofEvents * bW);
1948 double errorSig2 = std::sqrt(s_pm + std::pow(errorBc2, 2)) / (nofEvents * bW);
1950 if (i <= minBin)
fHMean.
H1(
"hMinvCombBg" + cat, step)->SetBinError(i, errorBc);
1951 if (i > minBin)
fHMean.
H1(
"hMinvCombBg" + cat, step)->SetBinError(i, errorBc2);
1952 if (i <= minBin)
fHMean.
H1(
"hMinvCombSignalNpm" + cat, step)->SetBinError(i, errorSig);
1953 if (i > minBin)
fHMean.
H1(
"hMinvCombSignalNpm" + cat, step)->SetBinError(i, errorSig2);
1954 if (i <= minBin)
fHMean.
H1(
"hMinvCombSignalMc" + cat, step)->SetBinError(i, errorSig);
1955 if (i > minBin)
fHMean.
H1(
"hMinvCombSignalMc" + cat, step)->SetBinError(i, errorSig2);