Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
save_correc_value.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file save_correc_value.C
1 #include <calib_emc_pi0/CaloCalibEmc_Pi0.h>
2 
4  std::string file_prefix = "m_clust_pi0_iter",
5  int n_iter = 23
6  )
7 
8 {
9  R__LOAD_LIBRARY(libcalibCaloEmc_pi0.so)
10 
11  // file location
12  std::string macro_loc = "/sphenix/user/sregmi/WORKING_AREA/PI_0/pi0_calib_m-clust/macros/RESULTS/mult_clus_loop_iter/";
13 
14  // input file
15  std::string ifile = macro_loc + file_prefix + std::to_string(n_iter) + "_combined.root";
16 
17  // output file
18  std::string ofile = macro_loc + file_prefix + std::to_string(n_iter) + "_combined_fitted.root";
19 
20  std::string infilent = ""; // used for first iteration ONLY
21  if (n_iter > 1)
22  {infilent = macro_loc + file_prefix + std::to_string(n_iter-1) + "_combined_fitted.root";}
23 
24  std::cout << "input file , " << ifile << std::endl;
25  std::cout << "output file , " << ofile << std::endl;
26  std::cout << "incorrect file , " << infilent << std::endl;
27 
28 
29  CaloCalibEmc_Pi0 calo_obj("CaloCalibEmc_Pi0" /* this name goes to SubsysReco */, ofile.c_str());
30  // calo_obj.InitRun(0); // to declare the eta_hist[96]
31  calo_obj.Get_Histos(ifile.c_str() , ofile.c_str()); // open the fun4al file and Get eta_hist[96] histos
32  calo_obj.Fit_Histos_Etas96(infilent.c_str()); // do fittings
33  calo_obj.End(0); // save the output file
34  std::cout << "All Done" << std::endl;
35  gSystem->Exit(0);
36 }
37