29 : fHistoList_factors()
30 , Correction_factros_all(nullptr)
31 , Correction_factros_two(nullptr)
32 , Correction_factros_onetwo(nullptr) {}
37 std::vector<std::vector<double>>& vect_two,
38 std::vector<std::vector<double>>& vect_onetwo,
43 string Correction_path =
44 string(gSystem->Getenv(
"VMCWORKDIR"))
45 + Form(
"/analysis/conversion2/Correction_pi0_g_OA%i_IM%i_num2.root",
48 cout <<
"file is " << Correction_path << endl;
49 TFile* fcorrection =
new TFile(
53 TH2D* mc = (TH2D*) fcorrection->Get(
54 "conversionKres/General/MC_info/MC_Direct_photons_Pt_vs_rap_est");
55 TH2D* all = (TH2D*) fcorrection->Get(
56 "conversionKres/direct photons/Both/all/Ph_pt_vs_rap_est_all_Both");
57 TH2D* two = (TH2D*) fcorrection->Get(
58 "conversionKres/direct photons/Both/two/Ph_pt_vs_rap_est_two_Both");
59 TH2D* onetwo = (TH2D*) fcorrection->Get(
60 "conversionKres/direct photons/Both/onetwo/Ph_pt_vs_rap_est_onetwo_Both");
62 std::vector<double> rapidity_column;
64 for (
int ix = 1; ix <= 10; ix++) {
65 rapidity_column.clear();
66 for (
int iy = 1; iy <= 30; iy++) {
67 double cont_reco = all->GetBinContent(ix, iy);
68 double mc_cont = mc->GetBinContent(ix, iy);
69 if (mc_cont == 0) mc_cont = 1;
70 double eff = cont_reco / mc_cont;
71 rapidity_column.push_back(eff);
73 if (eff != 0) content = 1 / eff;
78 vect_all.push_back(rapidity_column);
81 for (
int ix = 1; ix <= 10; ix++) {
82 rapidity_column.clear();
83 for (
int iy = 1; iy <= 30; iy++) {
84 double cont_reco = two->GetBinContent(ix, iy);
85 double mc_cont = mc->GetBinContent(ix, iy);
86 if (mc_cont == 0) mc_cont = 1;
87 double eff = cont_reco / mc_cont;
88 rapidity_column.push_back(eff);
90 if (eff != 0) content = 1 / eff;
94 vect_two.push_back(rapidity_column);
97 for (
int ix = 1; ix <= 10; ix++) {
98 rapidity_column.clear();
99 for (
int iy = 1; iy <= 30; iy++) {
100 double cont_reco = onetwo->GetBinContent(ix, iy);
101 double mc_cont = mc->GetBinContent(ix, iy);
102 if (mc_cont == 0) mc_cont = 1;
103 double eff = cont_reco / mc_cont;
104 rapidity_column.push_back(eff);
106 if (eff != 0) content = 1 / eff;
110 vect_onetwo.push_back(rapidity_column);
115 gDirectory->mkdir(
"Correction factors");
116 gDirectory->cd(
"Correction factors");
120 gDirectory->cd(
"..");
125 new TH2D(
"Correction_factros_all",
126 "Correction_factros_all; rapidity y; p_{t} in GeV/c ",
135 new TH2D(
"Correction_factros_two",
136 "Correction_factros_two; rapidity y; p_{t} in GeV/c ",
145 new TH2D(
"Correction_factros_onetwo",
146 "Correction_factros_onetwo; rapidity y; p_{t} in GeV/c ",