46 std::vector<std::vector<double>>& vect_two,
47 std::vector<std::vector<double>>& vect_onetwo,
double OA,
double IM)
51 string Correction_path = string(gSystem->Getenv(
"VMCWORKDIR"))
52 + Form(
"/analysis/conversion2/Correction_pi0_g_OA%i_IM%i_num2.root", (
int) OA,
54 cout <<
"file is " << Correction_path << endl;
57 TFile* oldFile = gFile;
58 TDirectory* oldDir = gDirectory;
60 TFile* fcorrection =
new TFile(
61 Correction_path.c_str());
63 LOG_IF(fatal, !fcorrection) <<
"Could not open file " << Correction_path.c_str();
64 TH2D* mc = fcorrection->Get<TH2D>(
"conversionKres/General/MC_info/MC_Direct_photons_Pt_vs_rap_est");
65 LOG_IF(fatal, !mc) <<
"Could not read histogram MC_Direct_photons_Pt_vs_rap_est from file "
66 << Correction_path.c_str();
68 TH2D* all = fcorrection->Get<TH2D>(
"conversionKres/direct photons/Both/all/Ph_pt_vs_rap_est_all_Both");
69 LOG_IF(fatal, !all) <<
"Could not read histogram Ph_pt_vs_rap_est_all_Both from file " << Correction_path.c_str();
71 TH2D* two = fcorrection->Get<TH2D>(
"conversionKres/direct photons/Both/two/Ph_pt_vs_rap_est_two_Both");
72 LOG_IF(fatal, !two) <<
"Could not read histogram Ph_pt_vs_rap_est_two_Both from file " << Correction_path.c_str();
74 TH2D* onetwo = fcorrection->Get<TH2D>(
"conversionKres/direct photons/Both/onetwo/Ph_pt_vs_rap_est_onetwo_Both");
75 LOG_IF(fatal, !onetwo) <<
"Could not read histogram Ph_pt_vs_rap_est_onetwo_Both from file "
76 << Correction_path.c_str();
78 std::vector<double> rapidity_column;
80 for (
int ix = 1; ix <= 10; ix++) {
81 rapidity_column.clear();
82 for (
int iy = 1; iy <= 30; iy++) {
83 double cont_reco = all->GetBinContent(ix, iy);
84 double mc_cont = mc->GetBinContent(ix, iy);
85 if (mc_cont == 0) mc_cont = 1;
86 double eff = cont_reco / mc_cont;
87 rapidity_column.push_back(eff);
89 if (eff != 0) content = 1 / eff;
94 vect_all.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 = two->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_two.push_back(rapidity_column);
113 for (
int ix = 1; ix <= 10; ix++) {
114 rapidity_column.clear();
115 for (
int iy = 1; iy <= 30; iy++) {
116 double cont_reco = onetwo->GetBinContent(ix, iy);
117 double mc_cont = mc->GetBinContent(ix, iy);
118 if (mc_cont == 0) mc_cont = 1;
119 double eff = cont_reco / mc_cont;
120 rapidity_column.push_back(eff);
122 if (eff != 0) content = 1 / eff;
126 vect_onetwo.push_back(rapidity_column);