22 : fReferenceInd(-1), fDrawReference(false), fHM(nullptr), fOutputDir(
"") {}
27 vector<string> geoTestOmega3Pathes,
28 vector<string> geoTestOmega8Pathes,
29 vector<string> urqmdTestPathes,
30 vector<string> recoQaBoxPathes,
31 vector<string> recoQaUrqmdPathes) {
70 const string& histName) {
72 if (path ==
"")
return make_pair(0., 0.);
73 TFile* file =
new TFile(path.c_str(),
"READ");
74 if (file ==
nullptr)
return make_pair(0., 0.);
75 TH1D* hist = (TH1D*) file->Get(histName.c_str());
76 if (hist ==
nullptr)
return make_pair(0., 0.);
77 double mean = hist->GetMean();
78 double rms = hist->GetRMS();
81 return make_pair(mean, rms);
87 const string& histName) {
89 if (path ==
"")
return make_pair(0., 0.);
90 TFile* file =
new TFile(path.c_str(),
"READ");
91 if (file ==
nullptr)
return make_pair(0., 0.);
92 TH2D* hist = (TH2D*) file->Get(histName.c_str());
93 if (hist ==
nullptr)
return make_pair(0., 0.);
94 TH1D* py = hist->ProjectionY((histName + to_string(iFile) +
"_py").c_str());
95 double mean = py->GetMean();
96 double rms = py->GetRMS();
99 return make_pair(mean, rms);
104 const string& histName) {
106 if (path ==
"")
return 0.;
107 TFile* file =
new TFile(path.c_str(),
"READ");
108 if (file ==
nullptr)
return 0.;
109 TH1* hist = (TH1*) file->Get(histName.c_str());
110 if (hist ==
nullptr)
return 0.;
111 double entries = hist->GetEntries();
119 const string& histName,
121 const string& titleY,
126 string canvasName =
"richgeoopt_sim_" +
GetFileEnumName(fileEnum) +
"_"
127 + histName + to_string(nofParts);
130 vector<string> legend;
131 double refValue = 0.;
132 for (
int iP = 0; iP < nofParts; iP++) {
133 string histNameInd =
GetFileEnumName(fileEnum) +
"_sim_" + histName +
"_"
134 + to_string(nofParts) +
"_" + to_string(iP);
136 histNameInd +
";Geometry;" + titleY,
140 for (
int iF = 0; iF < nofFilesPart; iF++) {
142 int ind = iP * nofFilesPart + iF;
144 value =
H1MeanRms(fileEnum, ind, histName).first;
146 value =
H1MeanRms(fileEnum, ind, histName).second;
153 HEntries(fileEnum, ind, histName) / 1000.;
156 fHM->
H1(histNameInd)->SetBinContent(iF + 1, value);
158 hists.push_back(
fHM->
H1(histNameInd));
159 legend.push_back(to_string(iP));
168 const string& histName1,
169 const string& histName2,
170 const string& titleY,
176 string canvasName =
"richgeoopt_sim_" +
GetFileEnumName(fileEnum) +
"_"
177 + histName1 +
"_" + histName2 + to_string(nofParts);
180 vector<string> legend;
181 double refValue = 0.;
182 for (
int iP = 0; iP < nofParts; iP++) {
183 string histEffName =
GetFileEnumName(fileEnum) +
"_sim_" + histName1 +
"_"
184 + histName2 +
"_" + to_string(nofParts) +
"_"
188 histEffName +
";Geometry;" + titleY,
192 for (
int iF = 0; iF < nofFilesPart; iF++) {
193 int ind = iP * nofFilesPart + iF;
194 double entries1 =
HEntries(fileEnum, ind, histName1);
195 double entries2 =
HEntries(fileEnum, ind, histName2);
196 double value = (entries2 != 0) ? effCoeff * entries1 / entries2 : 0.;
198 fHM->
H1(histEffName)->SetBinContent(iF + 1, value);
200 hists.push_back(
fHM->
H1(histEffName));
201 legend.push_back(to_string(iP));
208 const string& histName,
210 const string& titleZ,
215 "richgeoopt_sim_" +
GetFileEnumName(fileEnum) +
"_" + histName +
"_2d";
218 vector<string> camTilt = {
219 "0 deg",
"3 deg",
"6 deg",
"9 deg",
"12 deg",
"15 deg",
"18 deg",
"21 deg"};
220 int nofParts = camTilt.size();
224 double shift = 0.5 * 200. / 10.;
225 double refBinCenterX = -1., refBinCenterY = -1.;
226 double refBinWidthX = -1., refBinWidthY = -1.;
227 for (
int iP = 0; iP < nofParts; iP++) {
228 string histNameInd =
GetFileEnumName(fileEnum) +
"_sim_" + histName +
"_"
229 + to_string(iP) +
"_2d";
231 histNameInd +
";Shift CamY [mm];Shift CamZ [mm];"
239 for (
int iX = 0; iX < nofX; iX++) {
240 for (
int iY = 0; iY < nofY; iY++) {
242 int ind = iP * nofFilesPart + iX * nofX + iY;
245 value =
H1MeanRms(fileEnum, ind, histName).first;
247 value =
H1MeanRms(fileEnum, ind, histName).second;
254 HEntries(fileEnum, ind, histName) / 1000.;
257 fHM->
H2(histNameInd)->GetXaxis()->GetBinCenter(iX + 1);
259 fHM->
H2(histNameInd)->GetYaxis()->GetBinCenter(iY + 1);
260 refBinWidthX =
fHM->
H2(histNameInd)->GetXaxis()->GetBinWidth(iX + 1);
261 refBinWidthY =
fHM->
H2(histNameInd)->GetYaxis()->GetBinWidth(iY + 1);
263 fHM->
H2(histNameInd)->SetBinContent(iX + 1, iY + 1, value);
269 fHM->
H2(histNameInd)->GetZaxis()->SetRangeUser(minZ, maxZ);
270 fHM->
H2(histNameInd)->SetMarkerSize(1.2);
272 if (refBinWidthX > 0. && refBinWidthY > 0.) {
274 refBinCenterX, refBinCenterY, refBinWidthX, refBinWidthY);
282 const string& histName1,
283 const string& histName2,
284 const string& titleZ,
289 string canvasName =
"richgeoopt_sim_" +
GetFileEnumName(fileEnum) +
"_"
290 + histName1 +
"_" + histName2 +
"_2d";
293 vector<string> camTilt = {
294 "0 deg",
"3 deg",
"6 deg",
"9 deg",
"12 deg",
"15 deg",
"18 deg",
"21 deg"};
295 int nofParts = camTilt.size();
299 double shift = 0.5 * 200. / 10.;
300 double refBinCenterX = -1., refBinCenterY = -1.;
301 double refBinWidthX = -1., refBinWidthY = -1.;
302 for (
int iP = 0; iP < nofParts; iP++) {
303 string histNameInd =
GetFileEnumName(fileEnum) +
"_sim_" + histName1 +
"_"
304 + histName2 +
"_" + to_string(iP) +
"_2d";
306 histNameInd +
";Shift CamY [mm];Shift CamZ [mm];"
314 for (
int iX = 0; iX < nofX; iX++) {
315 for (
int iY = 0; iY < nofY; iY++) {
316 int ind = iP * nofFilesPart + iX * nofX + iY;
318 double entries1 =
HEntries(fileEnum, ind, histName1);
319 double entries2 =
HEntries(fileEnum, ind, histName2);
320 double value = (entries2 != 0) ? effCoeff * entries1 / entries2 : 0.;
323 fHM->
H2(histNameInd)->GetXaxis()->GetBinCenter(iX + 1);
325 fHM->
H2(histNameInd)->GetYaxis()->GetBinCenter(iY + 1);
326 refBinWidthX =
fHM->
H2(histNameInd)->GetXaxis()->GetBinWidth(iX + 1);
327 refBinWidthY =
fHM->
H2(histNameInd)->GetYaxis()->GetBinWidth(iY + 1);
329 fHM->
H2(histNameInd)->SetBinContent(iX + 1, iY + 1, value);
335 fHM->
H2(histNameInd)->SetMarkerSize(1.2);
336 fHM->
H2(histNameInd)->GetZaxis()->SetRangeUser(minZ, maxZ);
338 if (refBinWidthX > 0. && refBinWidthY > 0.) {
340 refBinCenterX, refBinCenterY, refBinWidthX, refBinWidthY);
348 for (
int i = 1;
i <=
h->GetNbinsX();
i++) {
349 for (
int j = 1; j <=
h->GetNbinsY(); j++) {
351 h->GetXaxis()->GetBinCenter(
i),
352 h->GetYaxis()->GetBinCenter(j),
357 t->SetTextColor(kBlack);
364 const vector<string>& legend,
367 vector<string> camTilt = {
368 "0 deg",
"3 deg",
"6 deg",
"9 deg",
"12 deg",
"15 deg",
"18 deg",
"21 deg"};
369 bool drawLegend = (hist.size() == 1) ?
false :
true;
371 (hist.size() == camTilt.size()) ? camTilt : legend,
379 gPad->SetLeftMargin(0.1);
380 gPad->SetRightMargin(0.01);
381 hist[0]->GetYaxis()->SetTitleOffset(0.8);
382 hist[0]->GetYaxis()->SetRangeUser(minY, maxY);
390 double nMinY = minY + 0.8 * (maxY - minY);
394 for (
int i = 1;
i <= 72;
i++) {
395 TLine* line =
new TLine(
i * 9 + .5, nMinY,
i * 9 + .5, nMaxY);
396 line->SetLineColor(kGreen + 2);
397 line->SetLineWidth(2);
404 for (
int i = 1;
i <= 8;
i++) {
405 TLine* line =
new TLine(
i * 81 + .5, nMinY,
i * 81 + .5, nMaxY);
406 line->SetLineColor(kBlue + 2);
407 line->SetLineWidth(2);
416 TLine* line =
new TLine(0., value, 1e5, value);
417 line->SetLineColor(kGreen + 4);
418 line->SetLineWidth(1);
428 TBox* box =
new TBox(centerX - 0.5 * widthX,
429 centerY - 0.5 * widthY,
430 centerX + 0.5 * widthX,
431 centerY + 0.5 * widthY);
432 box->SetLineColor(kGreen + 4);
433 box->SetLineWidth(2);
434 box->SetFillStyle(0);
453 nofFilesPartCamTilt);
455 "fhBoverAVsMom_points",
461 nofFilesPartCamTilt);
469 nofFilesPartCamTilt);
477 nofFilesPartCamTilt);
481 "Geometrical acceptance [%]",
488 "fh_nof_hits_per_event",
490 "Nof hits per event",
494 nofFilesPartCamTilt);
496 "fh_gamma_nontarget_mom",
498 "e^{#pm}_{not target} from #gamma per event",
502 nofFilesPartCamTilt);
504 "hte_Rich_Rich_Electron_Rec_p",
505 "hte_Rich_Rich_Electron_Acc_p",
506 "Ring reco efficiency [%]",
513 "hte_StsRich_StsRich_Electron_Rec_p",
514 "hte_StsRich_StsRich_Electron_Acc_p",
515 "STS-RICH matching efficiency [%]",
522 "hte_Rich_Rich_Electron_Rec_p",
523 "hte_Rich_Rich_Electron_Acc_p",
524 "Ring reco efficiency [%]",
531 "hte_StsRich_StsRich_Electron_Rec_p",
532 "hte_StsRich_StsRich_Electron_Acc_p",
533 "STS-RICH matching efficiency [%]",
540 "hps_Rich_All_RecPions_p",
541 "hps_Rich_All_Rec_p",
542 "Pion Suppression (RICH)",
549 "hpe_StsRich_StsRich_Electron_Rec_p",
550 "hpe_StsRich_StsRich_Electron_Acc_p",
560 "Geometrical acceptance [%]",
569 "Geometrical acceptance [%]",
580 "fhBoverAVsMom_points",
598 "Geometrical acceptance [%]",
604 "fh_nof_hits_per_event",
606 "Nof hits per event",
611 "fh_gamma_nontarget_mom",
613 "e^{#pm}_{not target} from #gamma per event",
618 "hte_Rich_Rich_Electron_Rec_p",
619 "hte_Rich_Rich_Electron_Acc_p",
620 "Ring reco efficiency [%]",
626 "hte_StsRich_StsRich_Electron_Rec_p",
627 "hte_StsRich_StsRich_Electron_Acc_p",
628 "STS-RICH matching efficiency [%]",
634 "hte_Rich_Rich_Electron_Rec_p",
635 "hte_Rich_Rich_Electron_Acc_p",
636 "Ring reco efficiency [%]",
642 "hte_StsRich_StsRich_Electron_Rec_p",
643 "hte_StsRich_StsRich_Electron_Acc_p",
644 "STS-RICH matching efficiency [%]",
650 "hps_Rich_All_RecPions_p",
651 "hps_Rich_All_Rec_p",
652 "Pion Suppression (RICH)",
658 "hpe_StsRich_StsRich_Electron_Rec_p",
659 "hpe_StsRich_StsRich_Electron_Acc_p",
668 "Geometrical acceptance [%]",
676 "Geometrical acceptance [%]",