Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-18 09:22:10

0001 #include <calib_emc_pi0/pi0EtaByEta.h>
0002 
0003 #include <Rtypes.h>
0004 #include <TFile.h>
0005 #include <TSystem.h>
0006 
0007 #include <format>
0008 
0009 R__LOAD_LIBRARY(libcalibCaloEmc_pi0.so)
0010 
0011 void doFitAndCalibUpdate(const std::string &hist_fname = "OUTHIST_iter4_DST_CALO_run2pp_new_2024p003-00046754-00000.root", const std::string &calib_fname = "base/local_calib_copy.root" ,int iter = 2)
0012 {
0013 
0014 
0015   pi0EtaByEta *caFit = new pi0EtaByEta("calomodulename", "bla.root");
0016   //caFit->fitEtaSlices(hist_fname.c_str(), Form("fitout_iter%d.root", iter), calib_fname.c_str());
0017   caFit->Init(nullptr);
0018   caFit->SetTargetMass(0.1375);  
0019   caFit->Split3DHist(hist_fname,"split.root");
0020   caFit->fitEtaPhiTowers("split.root", std::format("fitout_iter{}.root", iter), calib_fname);
0021 
0022   size_t pos = calib_fname.find_last_of('.'); 
0023   std::string f_calib_save_name = calib_fname;
0024   f_calib_save_name.insert(pos,std::format("_iter{}",iter));
0025 
0026   TFile* f_calib_mod = new TFile(calib_fname.c_str());
0027   f_calib_mod->Cp(f_calib_save_name.c_str());
0028 
0029   gSystem->Exit(0);
0030 }