Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-09 08:12:16

0001 #include "../PreparedNdEtaEach.h"
0002 
0003 R__LOAD_LIBRARY(../libPreparedNdEtaEach.so)
0004 
0005 
0006 std::map<std::string, TH1D*> GetAlphaCorrectionH1DMap(std::string alpha_correction_input_directory, std::vector<std::string> map_name_in){
0007   
0008   TFile * file_in = TFile::Open(alpha_correction_input_directory.c_str());
0009   std::map<std::string, TH1D*> h1D_alpha_correction_map; h1D_alpha_correction_map.clear();
0010   
0011   
0012   for (TObject* keyAsObj : *file_in->GetListOfKeys()){
0013     auto key = dynamic_cast<TKey*>(keyAsObj);
0014     std::string hist_name  = key->GetName();
0015     std::string class_name = key->GetClassName();
0016 
0017     if (class_name != "TH1D") {continue;}
0018     if (std::find(map_name_in.begin(), map_name_in.end(), hist_name) == map_name_in.end()) {continue;}
0019 
0020     h1D_alpha_correction_map.insert(
0021       std::make_pair(
0022         hist_name,
0023         (TH1D*)file_in->Get(hist_name.c_str())
0024       )
0025     );
0026   }
0027 
0028   for (auto &pair : h1D_alpha_correction_map){
0029     // pair.second->SetDirectory(0);
0030     std::cout << "alpha correction name : " << pair.first << std::endl;
0031   }
0032 
0033   return h1D_alpha_correction_map;
0034 }
0035 
0036 
0037 std::map<std::string, TH2D*> GetGeoAccCorrH2DMap(std::string GeoAccCorr_input_directory, std::vector<std::string> map_name_in){
0038   
0039   TFile * file_in = TFile::Open(GeoAccCorr_input_directory.c_str());
0040   std::map<std::string, TH2D*> h2D_GeoAccCorr_map; h2D_GeoAccCorr_map.clear();
0041   
0042   
0043   for (TObject* keyAsObj : *file_in->GetListOfKeys()){
0044     auto key = dynamic_cast<TKey*>(keyAsObj);
0045     std::string hist_name  = key->GetName();
0046     std::string class_name = key->GetClassName();
0047 
0048     if (class_name != "TH2D") {continue;}
0049     if (std::find(map_name_in.begin(), map_name_in.end(), hist_name) == map_name_in.end()) {continue;}
0050 
0051     h2D_GeoAccCorr_map.insert(
0052       std::make_pair(
0053         hist_name,
0054         (TH2D*)file_in->Get(hist_name.c_str())
0055       )
0056     );
0057   }
0058 
0059   for (auto &pair : h2D_GeoAccCorr_map){
0060     // pair.second->SetDirectory(0);
0061     std::cout << "Geo Acc Corr map name : " << pair.first << std::endl;
0062   }
0063 
0064   if (h2D_GeoAccCorr_map.size() == 0){
0065     std::cout << "Error : h2D_GeoAccCorr_map.size() == 0" << std::endl;
0066     exit(1);
0067   }
0068 
0069   return h2D_GeoAccCorr_map;
0070 }
0071 
0072 
0073 string Run_PreparedNdEtaEach(
0074   int process_id,
0075   int run_num,
0076   string input_directory,
0077   string input_filename,
0078   string output_directory,
0079   
0080   // todo : modify here
0081   std::string output_file_name_suffix, 
0082 
0083   bool ApplyAlphaCorr,
0084   bool ApplyGeoAccCorr,
0085 
0086   bool isTypeA,
0087   std::pair<double,double> cut_INTTvtxZ,
0088   int SelectedMbin,
0089 
0090   std::pair<bool, std::pair<double,double>> setBkgRotated_DeltaPhi_Signal_range,
0091   std::pair<bool, std::pair<double,double>> setEtaRange,
0092   string GeoAccCorr_input_directory = "no_map",
0093   string alpha_correction_input_directory = "no_map"
0094 )
0095 {
0096 
0097   PreparedNdEtaEach * PNEE = new PreparedNdEtaEach(
0098     process_id,
0099     run_num,
0100     input_directory,
0101     input_filename,
0102     output_directory,
0103 
0104     output_file_name_suffix,
0105 
0106     ApplyAlphaCorr,
0107     ApplyGeoAccCorr,
0108 
0109     isTypeA,
0110     cut_INTTvtxZ,
0111     SelectedMbin
0112   );
0113 
0114   if (ApplyGeoAccCorr && GeoAccCorr_input_directory != "no_map")
0115   {
0116     PNEE -> SetGeoAccCorrH2DMap(
0117       GetGeoAccCorrH2DMap(
0118         GeoAccCorr_input_directory,
0119         PNEE->GetGeoAccCorrNameMap()
0120       )
0121     );
0122   }
0123 
0124   if (ApplyAlphaCorr && alpha_correction_input_directory != "no_map")
0125   {
0126     PNEE -> SetAlphaCorrectionH1DMap(
0127       GetAlphaCorrectionH1DMap(
0128         alpha_correction_input_directory,
0129         PNEE->GetAlphaCorrectionNameMap()
0130       )
0131     );
0132   }
0133 
0134   if (setEtaRange.first) {PNEE -> SetSelectedEtaRange(setEtaRange.second);}
0135 
0136   if (setBkgRotated_DeltaPhi_Signal_range.first)
0137   {
0138     PNEE -> SetBkgRotated_DeltaPhi_Signal_range(setBkgRotated_DeltaPhi_Signal_range.second);
0139   }
0140 
0141   std::vector<std::string> final_output_file_name = PNEE->GetOutputFileName();
0142   for (auto filename : final_output_file_name){
0143     cout<<"final_output_file_name: "<<filename<<endl;
0144     system(Form("if [ -f %s/completed/%s ]; then rm %s/completed/%s; fi;", output_directory.c_str(), filename.c_str(), output_directory.c_str(), filename.c_str()));  
0145   }
0146   
0147   std::cout<<000<<endl;
0148   PNEE -> PrepareStacks();
0149   std::cout<<111<<endl;
0150   PNEE -> DoFittings();
0151   std::cout<<222<<endl;
0152   PNEE -> PrepareMultiplicity();
0153   std::cout<<333<<endl;
0154   PNEE -> PreparedNdEtaHist();
0155   std::cout<<444<<endl;
0156   PNEE -> DeriveAlphaCorrection();
0157   std::cout<<555<<endl;
0158   PNEE -> EndRun();
0159 
0160     string dNdEta_file_out;
0161 
0162   for (auto filename : final_output_file_name){
0163     system(Form("mv %s/%s %s/completed", output_directory.c_str(), filename.c_str(), output_directory.c_str()));
0164 
0165     if (filename.find("_dNdEta.root") != std::string::npos){
0166       dNdEta_file_out = output_directory + "/completed/" + filename;
0167     }
0168   }
0169 
0170   std::cout<<"dNdEta_file_out: "<<dNdEta_file_out<<std::endl;
0171 
0172   return dNdEta_file_out;
0173 }
0174 
0175 int DataMcComp(string data_directory_in, string MC_directory_in, string output_directory_in, string output_filename_in)
0176 {
0177     TFile * file_in_data = TFile::Open(data_directory_in.c_str());
0178     TFile * file_in_mc = TFile::Open(MC_directory_in.c_str());
0179 
0180     TH1D * data_h1D_BestPair_RecoTrackletEtaPerEvt = (TH1D*)file_in_data->Get("h1D_BestPair_RecoTrackletEtaPerEvt");
0181     TH1D * data_h1D_RotatedBkg_RecoTrackletEtaPerEvt = (TH1D*)file_in_data->Get("h1D_RotatedBkg_RecoTrackletEtaPerEvt");
0182     TH1D * data_h1D_BestPair_RecoTrackletEtaPerEvtPostAC = (TH1D*)file_in_data->Get("h1D_BestPair_RecoTrackletEtaPerEvtPostAC");
0183     TH1D * data_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC = (TH1D*)file_in_data->Get("h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC");
0184 
0185     data_h1D_BestPair_RecoTrackletEtaPerEvt -> SetMarkerColor(1);
0186     data_h1D_BestPair_RecoTrackletEtaPerEvt -> SetLineColor(1);
0187 
0188     data_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> SetMarkerColor(1);
0189     data_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> SetLineColor(1);
0190 
0191     data_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> SetMarkerColor(1);
0192     data_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> SetLineColor(1);
0193 
0194     data_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> SetMarkerColor(1);
0195     data_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> SetLineColor(1);
0196 
0197 
0198 
0199     TH1D * MC_h1D_BestPair_RecoTrackletEtaPerEvt = (TH1D*)file_in_mc->Get("h1D_BestPair_RecoTrackletEtaPerEvt");
0200     TH1D * MC_h1D_RotatedBkg_RecoTrackletEtaPerEvt = (TH1D*)file_in_mc->Get("h1D_RotatedBkg_RecoTrackletEtaPerEvt");
0201     TH1D * MC_h1D_BestPair_RecoTrackletEtaPerEvtPostAC = (TH1D*)file_in_mc->Get("h1D_BestPair_RecoTrackletEtaPerEvtPostAC");
0202     TH1D * MC_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC = (TH1D*)file_in_mc->Get("h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC");
0203 
0204     MC_h1D_BestPair_RecoTrackletEtaPerEvt -> SetMarkerColor(2); // note : red
0205     MC_h1D_BestPair_RecoTrackletEtaPerEvt -> SetLineColor(2);
0206 
0207     MC_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> SetMarkerColor(2);
0208     MC_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> SetLineColor(2);
0209 
0210     MC_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> SetMarkerColor(2);
0211     MC_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> SetLineColor(2);
0212 
0213     MC_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> SetMarkerColor(2);
0214     MC_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> SetLineColor(2);
0215 
0216     
0217 
0218     TH1D * h1D_TruedNdEta = (TH1D*)file_in_mc->Get("h1D_TruedNdEta");
0219     h1D_TruedNdEta -> SetLineColor(3); // note : green 
0220 
0221 
0222     TFile * file_out = new TFile(Form("%s/%s",output_directory_in.c_str(), output_filename_in.c_str()), "RECREATE");
0223     TCanvas * c1 = new TCanvas("c1", "c1", 800, 600);
0224 
0225     c1 -> cd();
0226     data_h1D_BestPair_RecoTrackletEtaPerEvt -> Draw("ep");
0227     MC_h1D_BestPair_RecoTrackletEtaPerEvt -> Draw("hist same");
0228     c1 -> Write("h1D_BestPair_RecoTrackletEtaPerEvt");
0229     c1 -> Clear();
0230 
0231     c1 -> cd();
0232     data_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> Draw("ep");
0233     MC_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> Draw("hist same");
0234     c1 -> Write("h1D_RotatedBkg_RecoTrackletEtaPerEvt");
0235     c1 -> Clear();
0236 
0237     c1 -> cd();
0238     data_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> Draw("ep");
0239     MC_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> Draw("hist same");
0240     h1D_TruedNdEta -> SetFillColorAlpha(2,0);
0241     h1D_TruedNdEta -> Draw("hist same");
0242     c1 -> Write("h1D_BestPair_RecoTrackletEtaPerEvtPostAC");
0243     c1 -> Clear();
0244 
0245     c1 -> cd();
0246     data_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> Draw("ep");
0247     MC_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> Draw("hist same");
0248     h1D_TruedNdEta -> Draw("hist same");
0249     
0250     c1 -> Write("h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC");
0251     c1 -> Clear();
0252 
0253     file_out -> Close();
0254 
0255     
0256 
0257     return 0;
0258 }
0259 
0260 int McMcComp(string MC1_directory_in, string MC2_directory_in, string output_directory_in, string output_filename_in)
0261 {
0262     TFile * file_in_mc1 = TFile::Open(MC1_directory_in.c_str());
0263     TFile * file_in_mc2 = TFile::Open(MC2_directory_in.c_str());
0264 
0265     TH1D * MC1_h1D_BestPair_RecoTrackletEtaPerEvt = (TH1D*)file_in_mc1->Get("h1D_BestPair_RecoTrackletEtaPerEvt");
0266     TH1D * MC1_h1D_RotatedBkg_RecoTrackletEtaPerEvt = (TH1D*)file_in_mc1->Get("h1D_RotatedBkg_RecoTrackletEtaPerEvt");
0267     TH1D * MC1_h1D_BestPair_RecoTrackletEtaPerEvtPostAC = (TH1D*)file_in_mc1->Get("h1D_BestPair_RecoTrackletEtaPerEvtPostAC");
0268     TH1D * MC1_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC = (TH1D*)file_in_mc1->Get("h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC");
0269 
0270     MC1_h1D_BestPair_RecoTrackletEtaPerEvt -> SetMarkerColor(1);
0271     MC1_h1D_BestPair_RecoTrackletEtaPerEvt -> SetLineColor(1);
0272 
0273     MC1_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> SetMarkerColor(1);
0274     MC1_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> SetLineColor(1);
0275 
0276     MC1_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> SetMarkerColor(1);
0277     MC1_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> SetLineColor(1);
0278 
0279     MC1_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> SetMarkerColor(1);
0280     MC1_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> SetLineColor(1);
0281 
0282     TH1D * MC1_h1D_TruedNdEta = (TH1D*)file_in_mc1->Get("h1D_TruedNdEta");
0283     MC1_h1D_TruedNdEta -> SetFillColorAlpha(1,0);
0284     MC1_h1D_TruedNdEta -> SetLineColor(4); // note : blue
0285 
0286 
0287 
0288     TH1D * MC2_h1D_BestPair_RecoTrackletEtaPerEvt = (TH1D*)file_in_mc2->Get("h1D_BestPair_RecoTrackletEtaPerEvt");
0289     TH1D * MC2_h1D_RotatedBkg_RecoTrackletEtaPerEvt = (TH1D*)file_in_mc2->Get("h1D_RotatedBkg_RecoTrackletEtaPerEvt");
0290     TH1D * MC2_h1D_BestPair_RecoTrackletEtaPerEvtPostAC = (TH1D*)file_in_mc2->Get("h1D_BestPair_RecoTrackletEtaPerEvtPostAC");
0291     TH1D * MC2_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC = (TH1D*)file_in_mc2->Get("h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC");
0292 
0293     MC2_h1D_BestPair_RecoTrackletEtaPerEvt -> SetMarkerColor(2);
0294     MC2_h1D_BestPair_RecoTrackletEtaPerEvt -> SetLineColor(2);
0295 
0296     MC2_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> SetMarkerColor(2);
0297     MC2_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> SetLineColor(2);
0298 
0299     MC2_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> SetMarkerColor(2);
0300     MC2_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> SetLineColor(2);
0301 
0302     MC2_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> SetMarkerColor(2);
0303     MC2_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> SetLineColor(2);
0304 
0305     
0306 
0307     TH1D * MC2_h1D_TruedNdEta = (TH1D*)file_in_mc2->Get("h1D_TruedNdEta");
0308     MC2_h1D_TruedNdEta -> SetFillColorAlpha(2,0);
0309     MC2_h1D_TruedNdEta -> SetLineColor(3); // note : green
0310 
0311 
0312     TFile * file_out = new TFile((output_directory_in+"/"+output_filename_in).c_str(), "RECREATE");
0313     TCanvas * c1 = new TCanvas("c1", "c1", 800, 600);
0314 
0315     c1 -> cd();
0316     MC1_h1D_BestPair_RecoTrackletEtaPerEvt -> Draw("ep");
0317     MC2_h1D_BestPair_RecoTrackletEtaPerEvt -> Draw("hist same");
0318     c1 -> Write("h1D_BestPair_RecoTrackletEtaPerEvt");
0319     c1 -> Clear();
0320 
0321     c1 -> cd();
0322     MC1_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> Draw("ep");
0323     MC2_h1D_RotatedBkg_RecoTrackletEtaPerEvt -> Draw("hist same");
0324     c1 -> Write("h1D_RotatedBkg_RecoTrackletEtaPerEvt");
0325     c1 -> Clear();
0326 
0327     c1 -> cd();
0328     MC1_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> Draw("ep");
0329     MC2_h1D_BestPair_RecoTrackletEtaPerEvtPostAC -> Draw("hist same");
0330     MC2_h1D_TruedNdEta -> Draw("hist same");
0331     MC1_h1D_TruedNdEta -> Draw("hist same");
0332     c1 -> Write("h1D_BestPair_RecoTrackletEtaPerEvtPostAC");
0333     c1 -> Clear();
0334 
0335     c1 -> cd();
0336     MC1_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> Draw("ep");
0337     MC2_h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC -> Draw("hist same");
0338     MC2_h1D_TruedNdEta -> Draw("hist same");
0339     MC1_h1D_TruedNdEta -> Draw("hist same");
0340     c1 -> Write("h1D_RotatedBkg_RecoTrackletEtaPerEvtPostAC");
0341     c1 -> Clear();
0342 
0343     c1 -> cd();
0344     MC2_h1D_TruedNdEta -> Draw("hist");
0345     MC1_h1D_TruedNdEta -> Draw("ep same");
0346     c1 -> Write("h1D_TruedNdEta");
0347     c1 -> Clear();
0348 
0349     file_out -> Close();
0350 
0351     
0352 
0353     return 0;
0354 }
0355 
0356 int CombinedMacro_2()
0357 {   
0358 
0359   // note : for all common
0360     std::string output_file_name_suffix = ""; 
0361 
0362     bool ApplyGeoAccCorr = true;
0363     bool isTypeA = false;
0364     std::pair<double,double> cut_INTTvtxZ = {-10, 10};
0365     int SelectedMbin = 70;
0366     std::pair<double,double> cut_EtaRange = {-1.9, 1.9};
0367     std::pair<bool, std::pair<double,double>> cut_BkgRotated_DeltaPhi_Signal_range = {false, {-0.018, 0.018}};
0368     string output_directory     = "/sphenix/tg/tg01/commissioning/INTT/work/cwshih/seflgendata/run_54280_HR_Dec042024/completed/Run3/EvtVtxZ/TrackHist/completed/dNdEta_MCMergeError4"; // note : folder_auto_creation
0369     string GeoAccCorr_directory = "/sphenix/tg/tg01/commissioning/INTT/work/cwshih/seflgendata/run_54280_HR_Dec042024/completed/Run3/EvtVtxZ/GeoAcc_RandZ10cm_FineBin_GoodCol/completed/Maps/completed/GeoAccepMap_Mbin70.root";
0370 
0371     // Division : ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0372     string output_suffix = "dNdEta";
0373     output_suffix += (isTypeA) ? "_TypeA" : "_AllSensor";
0374     output_suffix += (ApplyGeoAccCorr) ? "_GeoAccCorr" : "";
0375     output_suffix += Form("_VtxZ%d_Mbin%d", (int)cut_INTTvtxZ.second, SelectedMbin);
0376 
0377     string final_output_directory = output_directory + "/" + output_suffix;
0378     // Division : ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0379     
0380     // string alpha_correction_input_directory = "/sphenix/user/ChengWei/sPH_dNdeta/Run24AuAuMC/Sim_Ntuple_HIJING_ana443_20241102/Run24NewCode_dNdEta/completed/MC_PreparedNdEtaEach_AllSensor_VtxZ10_Mbin70_SecondRun_00001_dNdEta.root";    
0381     
0382     // note : MC common
0383     string MC_input_directory = "/sphenix/user/ChengWei/sPH_dNdeta/Run24AuAuMC/Sim_Ntuple_HIJING_ana443_20241102/Run3/EvtVtxZ/TrackHist/segmentation_variation_4";
0384     string MC_output_directory = final_output_directory;
0385 
0386     // note : MC1 deriving the alpha corrections
0387     string MC1_input_filename = "MC_TrackHist_vtxZReweight_VtxZQA_ClusQAAdc35PhiSize500_ColMulMask_merged_001.root";
0388     int    MC1_process_id = 1;
0389     int    MC1_run_num = -1;
0390     bool   MC1_ApplyAlphaCorr = false;
0391     std::pair<bool, std::pair<double,double>> MC1_setEtaRange = {false, cut_EtaRange};
0392 
0393     // note : MC2 applying the alpha corrections
0394     string MC2_input_filename = "MC_TrackHist_vtxZReweight_VtxZQA_ClusQAAdc35PhiSize500_ColMulMask_merged_002.root";
0395     int    MC2_process_id = 2;
0396     int    MC2_run_num = -1;
0397     bool   MC2_ApplyAlphaCorr = true;
0398     std::pair<bool, std::pair<double,double>> MC2_setEtaRange = {true, cut_EtaRange};
0399     
0400     // Division : ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0401 
0402     // note : for data
0403     string data_input_directory  = "/sphenix/tg/tg01/commissioning/INTT/work/cwshih/seflgendata/run_54280_HR_Dec042024/completed/Run3/EvtVtxZ/TrackHist/completed";
0404     string data_input_filename   = "Data_TrackHist_BcoFullDiffCut_VtxZQA_ClusQAAdc35PhiSize500_ColMulMask_00054280_merged.root";
0405     string data_output_directory = final_output_directory;
0406     int    data_process_id = 0;
0407     int    data_run_num = 54280;
0408     bool   data_ApplyAlphaCorr = true;
0409     std::pair<bool, std::pair<double,double>> data_setEtaRange = {true, cut_EtaRange};
0410 
0411     system(Form("if [ ! -d %s/completed ]; then mkdir -p %s/completed; fi;", final_output_directory.c_str(), final_output_directory.c_str())); 
0412 
0413     
0414     
0415     string MC1_dNdeta_file = Run_PreparedNdEtaEach(
0416         MC1_process_id,
0417         MC1_run_num,
0418         MC_input_directory,
0419         MC1_input_filename,
0420         MC_output_directory,
0421 
0422         output_file_name_suffix,
0423 
0424         MC1_ApplyAlphaCorr,
0425         ApplyGeoAccCorr,
0426 
0427         isTypeA,
0428         cut_INTTvtxZ,
0429         SelectedMbin,
0430 
0431         cut_BkgRotated_DeltaPhi_Signal_range,
0432         {false, {-2.7, 2.7}},
0433         GeoAccCorr_directory,
0434         "no_map"
0435     );
0436 
0437     string alpha_correction_input_directory = MC1_dNdeta_file;
0438 
0439 
0440     string MC2_dNdeta_file = Run_PreparedNdEtaEach(
0441         MC2_process_id,
0442         MC2_run_num,
0443         MC_input_directory,
0444         MC2_input_filename,
0445         MC_output_directory,
0446 
0447         output_file_name_suffix,
0448 
0449         MC2_ApplyAlphaCorr,
0450         ApplyGeoAccCorr,
0451 
0452         isTypeA,
0453         cut_INTTvtxZ,
0454         SelectedMbin,
0455 
0456         cut_BkgRotated_DeltaPhi_Signal_range,
0457         MC2_setEtaRange,
0458         GeoAccCorr_directory,
0459         alpha_correction_input_directory
0460     );
0461 
0462 
0463     string data_dNdeta_file = Run_PreparedNdEtaEach(
0464         data_process_id,
0465         data_run_num,
0466         data_input_directory,
0467         data_input_filename,
0468         data_output_directory,
0469 
0470         output_file_name_suffix,
0471 
0472         data_ApplyAlphaCorr,
0473         ApplyGeoAccCorr,
0474 
0475         isTypeA,
0476         cut_INTTvtxZ,
0477         SelectedMbin,
0478 
0479         cut_BkgRotated_DeltaPhi_Signal_range,
0480         data_setEtaRange,
0481         GeoAccCorr_directory, 
0482         alpha_correction_input_directory
0483     );
0484 
0485     // Division : ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0486 
0487     DataMcComp(data_dNdeta_file, MC1_dNdeta_file, final_output_directory, "DataMc1Comp.root");
0488     DataMcComp(data_dNdeta_file, MC2_dNdeta_file, final_output_directory, "DataMc2Comp.root");
0489     McMcComp(MC1_dNdeta_file, MC2_dNdeta_file, final_output_directory, "McMcComp.root");
0490 
0491   return 0;
0492 }