Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-07 08:12:22

0001 #include "gaus_func.h"
0002 #include "../sPhenixStyle.C"
0003 
0004 double get_dist_offset(TH1F * hist_in, int check_N_bin) // note : check_N_bin 1 to N bins of hist
0005 {
0006     if (check_N_bin < 0 || check_N_bin > hist_in -> GetNbinsX()) {cout<<" wrong check_N_bin "<<endl; exit(1);}
0007     double total_entry = 0;
0008     for (int i = 0; i < check_N_bin; i++)
0009     {
0010         total_entry += hist_in -> GetBinContent(i+1); // note : 1, 2, 3.....
0011         total_entry += hist_in -> GetBinContent(hist_in -> GetNbinsX() - i);
0012     }
0013 
0014     return total_entry/double(2. * check_N_bin);
0015 }
0016 
0017 void eta_closer()
0018 {
0019     // todo : change the centrality bin if needed
0020     
0021     double signal_region = 1.; // note : unit : degree
0022     string run_type = "MC";
0023     string plot_text = (run_type == "MC") ? "Simulation" : "Work-in-progress";
0024 
0025     string input_directory = "/sphenix/user/ChengWei/sPH_dNdeta/HIJING_ana398_xvtx-0p04cm_yvtx0p24cm_zvtx-20cm_dummyAlignParams/CodeTest1_combine_FullZ_TrackEta_MC_ZF_RECO_zvtx";
0026     string input_file_name = "INTT_final_hist_info.root";
0027     string out_folder_directory = input_directory + "/eta_closer_out";
0028     system(Form("mkdir %s",out_folder_directory.c_str()));
0029 
0030     TFile * file_in = TFile::Open(Form("%s/%s",input_directory.c_str(), input_file_name.c_str()));
0031 
0032     SetsPhenixStyle();
0033     TCanvas * c1 = new TCanvas("","",950,800);
0034     c1 -> cd();
0035 
0036     // note : key is the eta bin ID, value is the vector 
0037     // note : the full map
0038     vector<pair<int,vector<int>>> included_eta_z_map = {
0039         {15,{7,8}},        // note : eta bin 15: -0.2 to 0.0
0040         {16,{6,7,8}},      // note : eta bin 16: 0.0  to 0.2
0041         {17,{6,7,8}},      // note : eta bin 17: 0.2  to 0.4
0042         {18,{6,7,8}},      // note : eta bin 18: 0.4  to 0.6
0043         {19,{5,6,7,8}},    // note : eta bin 19: 0.6  to 0.8
0044         {20,{5,6,7,8}},    // note : eta bin 20: 0.8  to 1.0
0045         {21,{4,5,6,7,8}},  // note : eta bin 21: 1.0  to 1.2
0046         {22,{4,5,6,7,8}},  // note : eta bin 22: 1.2  to 1.4
0047         {23,{4,5,6,7,8}},  // note : eta bin 23: 1.4  to 1.6
0048         {24,{4,5,6,7,8}},  // note : eta bin 24: 1.6  to 1.8
0049         {25,{4,5,6}},      // note : eta bin 25: 1.8  to 2.0
0050         // {26,{}},        // note : eta bin 26: 2.0  to 2.2
0051     };
0052 
0053     // note : focus on the zvtx peak region
0054     // vector<pair<int,vector<int>>> included_eta_z_map = {
0055     //     // {15,{6}},  // note : eta bin 15: -0.2 to 0.0
0056     //     {16,{6}},  // note : eta bin 16: 0.0  to 0.2
0057     //     {17,{6}},  // note : eta bin 17: 0.2  to 0.4
0058     //     {18,{6}},  // note : eta bin 18: 0.4  to 0.6
0059     //     {19,{6}},  // note : eta bin 19: 0.6  to 0.8
0060     //     {20,{6}},  // note : eta bin 20: 0.8  to 1.0
0061     //     {21,{6}},  // note : eta bin 21: 1.0  to 1.2
0062     //     {22,{6}},  // note : eta bin 22: 1.2  to 1.4
0063     //     {23,{6}},  // note : eta bin 23: 1.4  to 1.6
0064     //     {24,{6}},  // note : eta bin 24: 1.6  to 1.8
0065     //     {25,{6}},  // note : eta bin 25: 1.8  to 2.0
0066     //     // {26,{}},  // note : eta bin 26: 2.0  to 2.2
0067     // };
0068 
0069     int eta_correction = included_eta_z_map[0].first - 1; // todo : the eta bin starts from 15, so the correction is 14
0070 
0071     vector<string> centrality_region = {
0072         "0-5%",
0073         "5-15%",
0074         "15-25%",
0075         "25-35%",
0076         "35-45%",
0077         "45-55%",
0078         "55-65%",
0079         "65-75%",
0080         "75-85%",
0081         "85-95%",
0082         "0-95%"
0083     };
0084     int N_centrality_bin = centrality_region.size();
0085 
0086 
0087     string color_code[5] = {"#fedc97", "#b5b682", "#7c9885", "#28666e", "#033f63"};
0088     
0089     // note : the histograms of the number of tracklets in the signal region for both methods
0090     // note : the 1D vector is for different centrality bins
0091     vector<TH2F * > SignalNTrack_eta_z_Multi_2D; SignalNTrack_eta_z_Multi_2D.clear();
0092     vector<TH2F * > SignalNTrack_eta_z_Single_2D; SignalNTrack_eta_z_Single_2D.clear();
0093     for (int Mbin = 0; Mbin < N_centrality_bin; Mbin++)
0094     {
0095         SignalNTrack_eta_z_Multi_2D.push_back((TH2F *) file_in -> Get(Form("Reco_SignalNTracklet_Multi_MBin%i",Mbin)));
0096         SignalNTrack_eta_z_Single_2D.push_back((TH2F *) file_in -> Get(Form("Reco_SignalNTracklet_Single_MBin%i",Mbin)));
0097     }
0098 
0099     // note : the 1D histograms of the DeltaPhi distributions of each centrality-eta-z bin (the multi method, for the background subtraction)
0100     // note : the format of the key is "MBin_EtaBin_ZBin"
0101     map<string,TH1F * > DeltaPhi_Multi_1D; DeltaPhi_Multi_1D.clear();
0102     for (int Mbin = 0; Mbin < N_centrality_bin; Mbin++) // note : centrality bin
0103     {
0104         for (auto eta_z : included_eta_z_map) // note : eta bin
0105         {
0106             for(int zbin = 0; zbin < eta_z.second.size(); zbin++) // note :  Z bin
0107             {
0108                 DeltaPhi_Multi_1D[Form("%i_%i_%i",Mbin,eta_z.first,eta_z.second[zbin])] = (TH1F *) file_in -> Get(Form("Reco_DeltaPhi1D_Multi_MBin%i_Eta%i_Z%i",Mbin,eta_z.first,eta_z.second[zbin]));
0109                 DeltaPhi_Multi_1D[Form("%i_%i_%i",Mbin,eta_z.first,eta_z.second[zbin])] -> SetFillColor(TColor::GetColor(color_code[zbin].c_str()));
0110             }
0111         }
0112     }
0113 
0114     // note : the histograms of the number of True track from the MC
0115     // note : the 1D vector is for different centrality bins
0116     vector<TH2F * > TrueNtrack_eta_z_MC_2D; TrueNtrack_eta_z_MC_2D.clear();
0117     for (int Mbin = 0; Mbin < N_centrality_bin; Mbin++)
0118     {
0119         TrueNtrack_eta_z_MC_2D.push_back((TH2F *) file_in -> Get(Form("NTrueTrack_MBin%i",Mbin)));
0120     }
0121 
0122     // note : the centrality Z map, to keep the N event counting
0123     // TH2F * centrality_Z_map = (TH2F *) file_in -> Get("Z_MBin_evt_map"); 
0124     TH2F * centrality_Z_map = (TH2F *) file_in -> Get("MBin_Z_evt_map"); // todo : the correct name should be "MBin_Z_evt_map", correct next time
0125 
0126     // note : the reference map of Eta-Z 2D histogram
0127     TH2F * eta_z_ref = (TH2F *) file_in -> Get("Eta_Z_reference");
0128 
0129     // note : --------------------------------------------------- done with the histogram reading from the file ---------------------------------------------------
0130     
0131     
0132     TF1 * bkg_fit_pol2 = new TF1("bkg_fit_pol2",bkg_pol2_func,-5,5,5);
0133     bkg_fit_pol2 -> SetLineWidth(2);
0134     bkg_fit_pol2 -> SetLineColor(2);
0135     bkg_fit_pol2 -> SetNpx(1000);
0136 
0137     TF1 * draw_pol2_line = new TF1("draw_pol2_line",full_pol2_func,-5,5,4);
0138     draw_pol2_line -> SetLineWidth(2);
0139     draw_pol2_line -> SetLineColor(2);
0140     draw_pol2_line -> SetNpx(1000);
0141 
0142     TLine * coord_line = new TLine();
0143     coord_line -> SetLineWidth(1);
0144     coord_line -> SetLineColor(16);
0145     coord_line -> SetLineStyle(2);
0146 
0147     TLatex * ltx = new TLatex();
0148     ltx->SetNDC();
0149     ltx->SetTextSize(0.045);
0150     ltx->SetTextAlign(31);
0151 
0152     TLatex * draw_text = new TLatex();
0153     draw_text -> SetNDC();
0154     draw_text -> SetTextSize(0.03);
0155 
0156     vector<TH1F * > dNdeta_1D_MC; dNdeta_1D_MC.clear();
0157     vector<TH1F * > dNdeta_1D_reco_single; dNdeta_1D_reco_single.clear();
0158     vector<TH1F * > dNdeta_1D_reco_multi; dNdeta_1D_reco_multi.clear();
0159     for (int i = 0; i < N_centrality_bin; i++)
0160     {
0161         dNdeta_1D_MC.push_back(new TH1F("","",included_eta_z_map.size(), eta_z_ref -> GetXaxis() ->GetBinLowEdge(included_eta_z_map[0].first), eta_z_ref -> GetXaxis() ->GetBinCenter(included_eta_z_map[included_eta_z_map.size() - 1].first) + eta_z_ref -> GetXaxis() ->GetBinWidth(included_eta_z_map[included_eta_z_map.size() - 1].first) / 2.));
0162         dNdeta_1D_MC[i] -> SetMarkerStyle(20);
0163         dNdeta_1D_MC[i] -> SetMarkerSize(0.8);
0164         dNdeta_1D_MC[i] -> SetMarkerColor(TColor::GetColor("#1A3947"));
0165         dNdeta_1D_MC[i] -> SetLineColor(TColor::GetColor("#1A3947"));
0166         dNdeta_1D_MC[i] -> SetLineWidth(2);
0167         dNdeta_1D_MC[i] -> GetYaxis() -> SetTitle("dN_{ch}/d#eta");
0168         dNdeta_1D_MC[i] -> GetXaxis() -> SetTitle("#eta");
0169         // dNdeta_1D_MC[i] -> GetYaxis() -> SetRangeUser(0,50);
0170         dNdeta_1D_MC[i] -> SetTitleSize(0.06, "X");
0171         dNdeta_1D_MC[i] -> SetTitleSize(0.06, "Y");
0172         dNdeta_1D_MC[i] -> GetXaxis() -> SetTitleOffset (0.71);
0173         dNdeta_1D_MC[i] -> GetYaxis() -> SetTitleOffset (1.1);
0174         dNdeta_1D_MC[i] -> GetXaxis() -> CenterTitle(true);
0175         dNdeta_1D_MC[i] -> GetYaxis() -> CenterTitle(true);
0176 
0177         dNdeta_1D_reco_single.push_back(new TH1F("","",included_eta_z_map.size(), eta_z_ref -> GetXaxis() ->GetBinLowEdge(included_eta_z_map[0].first), eta_z_ref -> GetXaxis() ->GetBinCenter(included_eta_z_map[included_eta_z_map.size() - 1].first) + eta_z_ref -> GetXaxis() ->GetBinWidth(included_eta_z_map[included_eta_z_map.size() - 1].first) / 2.));
0178         dNdeta_1D_reco_single[i] -> SetMarkerStyle(20);
0179         dNdeta_1D_reco_single[i] -> SetMarkerSize(0.8);
0180         dNdeta_1D_reco_single[i] -> SetMarkerColor(TColor::GetColor("#1A3947"));
0181         dNdeta_1D_reco_single[i] -> SetLineColor(TColor::GetColor("#1A3947"));
0182         dNdeta_1D_reco_single[i] -> SetLineWidth(2);
0183         dNdeta_1D_reco_single[i] -> GetYaxis() -> SetTitle("dN_{ch}/d#eta");
0184         dNdeta_1D_reco_single[i] -> GetXaxis() -> SetTitle("#eta");
0185         // dNdeta_1D_reco_single[i] -> GetYaxis() -> SetRangeUser(0,50);
0186         dNdeta_1D_reco_single[i] -> SetTitleSize(0.06, "X");
0187         dNdeta_1D_reco_single[i] -> SetTitleSize(0.06, "Y");
0188         dNdeta_1D_reco_single[i] -> GetXaxis() -> SetTitleOffset (0.71);
0189         dNdeta_1D_reco_single[i] -> GetYaxis() -> SetTitleOffset (1.1);
0190         dNdeta_1D_reco_single[i] -> GetXaxis() -> CenterTitle(true);
0191         dNdeta_1D_reco_single[i] -> GetYaxis() -> CenterTitle(true);
0192 
0193         dNdeta_1D_reco_multi.push_back(new TH1F("","",included_eta_z_map.size(), eta_z_ref -> GetXaxis() ->GetBinLowEdge(included_eta_z_map[0].first), eta_z_ref -> GetXaxis() ->GetBinCenter(included_eta_z_map[included_eta_z_map.size() - 1].first) + eta_z_ref -> GetXaxis() ->GetBinWidth(included_eta_z_map[included_eta_z_map.size() - 1].first) / 2.));
0194         dNdeta_1D_reco_multi[i] -> SetMarkerStyle(20);
0195         dNdeta_1D_reco_multi[i] -> SetMarkerSize(0.8);
0196         dNdeta_1D_reco_multi[i] -> SetMarkerColor(TColor::GetColor("#c48045"));
0197         dNdeta_1D_reco_multi[i] -> SetLineColor(TColor::GetColor("#c48045"));
0198         dNdeta_1D_reco_multi[i] -> SetLineWidth(2);
0199         dNdeta_1D_reco_multi[i] -> GetYaxis() -> SetTitle("dN_{ch}/d#eta");
0200         dNdeta_1D_reco_multi[i] -> GetXaxis() -> SetTitle("#eta");
0201         // dNdeta_1D_reco_multi[i] -> GetYaxis() -> SetRangeUser(0,50);
0202         dNdeta_1D_reco_multi[i] -> SetTitleSize(0.06, "X");
0203         dNdeta_1D_reco_multi[i] -> SetTitleSize(0.06, "Y");
0204         dNdeta_1D_reco_multi[i] -> GetXaxis() -> SetTitleOffset (0.71);
0205         dNdeta_1D_reco_multi[i] -> GetYaxis() -> SetTitleOffset (1.1);
0206         dNdeta_1D_reco_multi[i] -> GetXaxis() -> CenterTitle(true);
0207         dNdeta_1D_reco_multi[i] -> GetYaxis() -> CenterTitle(true);
0208     }
0209 
0210     // note : to count the number of reco tracklets in the signal region with the selected eta bin and z bin, for each centrality bin
0211     // note : for both methods
0212     // note : to increase the statistic, try to stack the DeltaPhi distributions with same eta bin but different z bin
0213     // note : the key is "MBin_EtaBin"
0214     // note : for each eta bin and each centrality bin, count the number of event. (Each eta bin has different selected z region, so the number of event is different for each eta bin)
0215     c1 -> cd();
0216     c1 -> Print(Form("%s/Reco_DeltaPhi_Multi_Stack.pdf(", out_folder_directory.c_str())); 
0217     map<string, THStack *> DeltaPhi_Multi_Stack; DeltaPhi_Multi_Stack.clear();
0218     map<string, int> SignalNTrack_Single; SignalNTrack_Single.clear(); 
0219     map<string, int> SignalNTrack_Multi; SignalNTrack_Multi.clear();
0220     vector<vector<int>> N_event_counting(N_centrality_bin, vector<int>(included_eta_z_map.size(),0));
0221     for (int Mbin = 0; Mbin < N_centrality_bin; Mbin++) // note : centrality bin
0222     {
0223         for (auto eta_z : included_eta_z_map) // note : eta bin
0224         {
0225             DeltaPhi_Multi_Stack[Form("%i_%i",Mbin,eta_z.first)] = new THStack(Form("DeltaPhi_Multi_Stack_MBin%i_Eta%i",Mbin,eta_z.first),Form("DeltaPhi_Multi_Stack_MBin%i_Eta%i",Mbin,eta_z.first));
0226             for(int zbin : eta_z.second) // note :  Z bin
0227             {
0228                 // note : the key to the map: "MBin_EtaBin"
0229                 DeltaPhi_Multi_Stack[Form("%i_%i",Mbin,eta_z.first)] -> Add(DeltaPhi_Multi_1D[Form("%i_%i_%i",Mbin,eta_z.first,zbin)]);
0230                 SignalNTrack_Single[Form("%i_%i",Mbin,eta_z.first)] += SignalNTrack_eta_z_Single_2D[Mbin] -> GetBinContent(eta_z.first, zbin); // note : the signal counting for the single method
0231                 SignalNTrack_Multi[Form("%i_%i",Mbin,eta_z.first)]  +=  SignalNTrack_eta_z_Multi_2D[Mbin] -> GetBinContent(eta_z.first, zbin); // note : the signal counting for the multi method
0232 
0233                 // note : to count the TrueNTtrack in the true level information
0234                 dNdeta_1D_MC[Mbin]->SetBinContent(eta_z.first - eta_correction, TrueNtrack_eta_z_MC_2D[Mbin] -> GetBinContent(eta_z.first, zbin) + dNdeta_1D_MC[Mbin]->GetBinContent(eta_z.first - eta_correction));
0235 
0236                 N_event_counting[Mbin][eta_z.first - eta_correction - 1] += centrality_Z_map -> GetBinContent(Mbin + 1, zbin);
0237             }
0238 
0239             // note : Background fit on the DeltaPhi distributions, to know the background level
0240             // note : print the DeltaPhi distributions for each centrality bin adn each eta bin, after stacking
0241             TH1F * temp_hist = (TH1F *) DeltaPhi_Multi_Stack[Form("%i_%i",Mbin,eta_z.first)] -> GetStack() -> Last();
0242             double hist_offset = get_dist_offset(temp_hist, 15);
0243 
0244             bkg_fit_pol2 -> SetParameters(hist_offset, 0, -0.2, 0, signal_region);
0245             bkg_fit_pol2 -> FixParameter(4, signal_region);
0246             bkg_fit_pol2 -> SetParLimits(2, -100, 0);
0247             temp_hist -> Fit(bkg_fit_pol2,"NQ");
0248             // note : extract the background region (which includes the signal region also)
0249             draw_pol2_line -> SetParameters(bkg_fit_pol2 -> GetParameter(0), bkg_fit_pol2 -> GetParameter(1), bkg_fit_pol2 -> GetParameter(2), bkg_fit_pol2 -> GetParameter(3));
0250 
0251             DeltaPhi_Multi_Stack[Form("%i_%i",Mbin,eta_z.first)] -> SetMinimum(0);
0252             DeltaPhi_Multi_Stack[Form("%i_%i",Mbin,eta_z.first)] -> SetMaximum( temp_hist -> GetBinContent(temp_hist -> GetMaximumBin()) * 1.5);
0253             DeltaPhi_Multi_Stack[Form("%i_%i",Mbin,eta_z.first)] -> Draw(); 
0254 
0255             draw_pol2_line -> Draw("lsame");
0256             
0257             double pol2_bkg_integral = fabs(draw_pol2_line -> Integral( -1. * signal_region, signal_region )) / temp_hist -> GetBinWidth(1);
0258             // cout<<i<<" "<<i1<<" pol2_bkg integral: "<<pol2_bkg_integral<<endl;
0259 
0260             // note : for the multi method, count the number of tracklets after the back subtraction
0261             dNdeta_1D_reco_multi[Mbin]  -> SetBinContent(eta_z.first - eta_correction, SignalNTrack_Multi[Form("%i_%i",Mbin,eta_z.first)] - pol2_bkg_integral);
0262             dNdeta_1D_reco_single[Mbin] -> SetBinContent(eta_z.first - eta_correction, SignalNTrack_Single[Form("%i_%i",Mbin,eta_z.first)]);
0263 
0264             coord_line -> DrawLine(-1*signal_region, 0, -1 * signal_region, temp_hist -> GetBinContent(temp_hist -> GetMaximumBin()) * 1.5);
0265             coord_line -> DrawLine(signal_region, 0, signal_region, temp_hist -> GetBinContent(temp_hist -> GetMaximumBin()) * 1.5);
0266             
0267             ltx->DrawLatex(1 - gPad->GetRightMargin(), 1 - gPad->GetTopMargin() + 0.01, Form("#it{#bf{sPHENIX INTT}} %s", plot_text.c_str()));
0268             
0269             draw_text -> DrawLatex(0.21, 0.90, Form("Centrality : %s, #eta: %.2f ~ %.2f",centrality_region[Mbin].c_str(), 
0270                 eta_z_ref -> GetXaxis() -> GetBinCenter(eta_z.first) - eta_z_ref -> GetXaxis() -> GetBinWidth(eta_z.first)/2., 
0271                 eta_z_ref -> GetXaxis() -> GetBinCenter(eta_z.first) + eta_z_ref -> GetXaxis() -> GetBinWidth(eta_z.first)/2.)
0272             );
0273             
0274             draw_text -> DrawLatex(0.21, 0.85, Form("MBin: %i, #eta bin: %i", Mbin, eta_z.first));
0275             draw_text -> DrawLatex(0.21, 0.80, Form("pol2: %.2f + %.2f(x-%.2f) + %.2f(x-%.2f)^{2}", bkg_fit_pol2 -> GetParameter(0), bkg_fit_pol2 -> GetParameter(1), bkg_fit_pol2 -> GetParameter(3), bkg_fit_pol2 -> GetParameter(2), bkg_fit_pol2 -> GetParameter(3)));
0276 
0277             c1 -> Print(Form("%s/Reco_DeltaPhi_Multi_Stack.pdf", out_folder_directory.c_str()));
0278             c1 -> Clear();
0279         }
0280     }
0281     c1 -> Print(Form("%s/Reco_DeltaPhi_Multi_Stack.pdf)", out_folder_directory.c_str()));
0282     c1 -> Clear();
0283     
0284     
0285     // note : make the final result 
0286     c1 -> cd();
0287     c1 -> Print(Form("%s/dNdeta_combine_final_no_correction.pdf(", out_folder_directory.c_str()));
0288     for (int Mbin = 0; Mbin < N_centrality_bin; Mbin++)
0289     {   
0290         // // note : check the ratio of the bin error to the bin content of the three histograms
0291         // for (int i = 0; i < included_eta_z_map.size(); i++)
0292         // {
0293         //     cout<<" "<<endl;
0294         //     cout<<"1MBin: "<<Mbin<<" eta bin: "<<i<<" MC: "<<dNdeta_1D_MC[Mbin] -> GetBinError(i+1) / dNdeta_1D_MC[Mbin] -> GetBinContent(i+1)<<" reco_single: "<<dNdeta_1D_reco_single[Mbin] -> GetBinError(i+1) / dNdeta_1D_reco_single[Mbin] -> GetBinContent(i+1)<<" reco_multi: "<<dNdeta_1D_reco_multi[Mbin] -> GetBinError(i+1) / dNdeta_1D_reco_multi[Mbin] -> GetBinContent(i+1)<<endl;
0295         // }
0296 
0297         dNdeta_1D_MC[Mbin] -> Scale(1./double(dNdeta_1D_MC[Mbin] -> GetBinWidth(1) ));
0298         dNdeta_1D_reco_single[Mbin] -> Scale(1./double(dNdeta_1D_reco_single[Mbin] -> GetBinWidth(1) ));
0299         dNdeta_1D_reco_multi[Mbin] -> Scale(1./double(dNdeta_1D_reco_multi[Mbin] -> GetBinWidth(1) ));
0300 
0301         // // note : check the ratio of the bin error to the bin content of the three histograms
0302         // for (int i = 0; i < included_eta_z_map.size(); i++)
0303         // {
0304         //     cout<<" "<<endl;
0305         //     cout<<"2MBin: "<<Mbin<<" eta bin: "<<i<<" MC: "<<dNdeta_1D_MC[Mbin] -> GetBinError(i+1) / dNdeta_1D_MC[Mbin] -> GetBinContent(i+1)<<" reco_single: "<<dNdeta_1D_reco_single[Mbin] -> GetBinError(i+1) / dNdeta_1D_reco_single[Mbin] -> GetBinContent(i+1)<<" reco_multi: "<<dNdeta_1D_reco_multi[Mbin] -> GetBinError(i+1) / dNdeta_1D_reco_multi[Mbin] -> GetBinContent(i+1)<<endl;
0306         // }
0307 
0308         for (int i = 0; i < included_eta_z_map.size(); i++)
0309         {
0310             dNdeta_1D_MC[Mbin] -> SetBinContent(i+1, dNdeta_1D_MC[Mbin] -> GetBinContent(i+1) / double(N_event_counting[Mbin][i]));
0311             dNdeta_1D_MC[Mbin] -> SetBinError(i+1, dNdeta_1D_MC[Mbin] -> GetBinError(i+1) / double(N_event_counting[Mbin][i]));
0312 
0313             dNdeta_1D_reco_single[Mbin] -> SetBinContent(i+1, dNdeta_1D_reco_single[Mbin] -> GetBinContent(i+1) / double(N_event_counting[Mbin][i]));
0314             dNdeta_1D_reco_single[Mbin] -> SetBinError(i+1, dNdeta_1D_reco_single[Mbin] -> GetBinError(i+1) / double(N_event_counting[Mbin][i]));
0315 
0316             dNdeta_1D_reco_multi[Mbin]  -> SetBinContent(i+1, dNdeta_1D_reco_multi[Mbin] -> GetBinContent(i+1) / double(N_event_counting[Mbin][i]));
0317             dNdeta_1D_reco_multi[Mbin]  -> SetBinError(i+1, dNdeta_1D_reco_multi[Mbin] -> GetBinError(i+1) / double(N_event_counting[Mbin][i]));
0318 
0319         }
0320         
0321         // note : check the bin content of the three histograms
0322         // note : and check the bin error of the three histograms
0323         // for (int i = 0; i < included_eta_z_map.size(); i++)
0324         // {
0325         //     cout<<" "<<endl;
0326         //     cout<<"3MBin: "<<Mbin<<" eta bin: "<<i<<" MC: "<<dNdeta_1D_MC[Mbin] -> GetBinContent(i+1)<<" reco_single: "<<dNdeta_1D_reco_single[Mbin] -> GetBinContent(i+1)<<" reco_multi: "<<dNdeta_1D_reco_multi[Mbin] -> GetBinContent(i+1)<<endl;
0327         //     cout<<"3MBin: "<<Mbin<<" eta bin: "<<i<<" MC: "<<dNdeta_1D_MC[Mbin] -> GetBinError(i+1)<<" reco_single: "<<dNdeta_1D_reco_single[Mbin] -> GetBinError(i+1)<<" reco_multi: "<<dNdeta_1D_reco_multi[Mbin] -> GetBinError(i+1)<<endl;
0328         // }
0329 
0330         // // note : check the ratio of the bin error to the bin content of the three histograms
0331         // for (int i = 0; i < included_eta_z_map.size(); i++)
0332         // {
0333         //     cout<<" "<<endl;
0334         //     cout<<"3MBin: "<<Mbin<<" eta bin: "<<i<<" MC: "<<dNdeta_1D_MC[Mbin] -> GetBinError(i+1) / dNdeta_1D_MC[Mbin] -> GetBinContent(i+1)<<" reco_single: "<<dNdeta_1D_reco_single[Mbin] -> GetBinError(i+1) / dNdeta_1D_reco_single[Mbin] -> GetBinContent(i+1)<<" reco_multi: "<<dNdeta_1D_reco_multi[Mbin] -> GetBinError(i+1) / dNdeta_1D_reco_multi[Mbin] -> GetBinContent(i+1)<<endl;
0335         // }
0336 
0337         dNdeta_1D_MC[Mbin] -> GetYaxis() -> SetRangeUser(0, dNdeta_1D_MC[Mbin] -> GetMaximum() * 1.5);
0338 
0339         dNdeta_1D_MC[Mbin] -> Draw("hist");
0340         dNdeta_1D_reco_single[Mbin] -> Draw("p same");
0341         dNdeta_1D_reco_multi[Mbin]  -> Draw("p same");
0342 
0343         ltx->DrawLatex(1 - gPad->GetRightMargin(), 1 - gPad->GetTopMargin() + 0.01, Form("#it{#bf{sPHENIX INTT}} %s", plot_text.c_str()));
0344         draw_text -> DrawLatex(0.21, 0.90, Form("Centrality : %s",centrality_region[Mbin].c_str()));
0345        
0346         c1 -> Print(Form("%s/dNdeta_combine_final_no_correction.pdf", out_folder_directory.c_str()));
0347         c1 -> Clear();
0348     }
0349     c1 -> Print(Form("%s/dNdeta_combine_final_no_correction.pdf)", out_folder_directory.c_str()));
0350 
0351 
0352 
0353     // note : calculate the final correction factor, for each centrality bin and eta bin
0354 
0355 
0356     // note : make the correction map
0357 
0358 
0359 }