Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
doFitAndCalibUpdate.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file doFitAndCalibUpdate.C
1 #ifndef FUN4ALL_YEAR1_C
2 #define FUN4ALL_YEAR1_C
3 
4 #include <caloreco/CaloTowerCalib.h>
5 #include <caloreco/RawClusterBuilderTemplate.h>
6 #include <caloreco/RawClusterDeadHotMask.h>
7 #include <caloreco/RawClusterPositionCorrection.h>
8 #include <caloreco/TowerInfoDeadHotMask.h>
9 
10 #include <ffamodules/FlagHandler.h>
11 #include <ffamodules/HeadReco.h>
12 #include <ffamodules/SyncReco.h>
13 
15 
20 #include <fun4all/Fun4AllServer.h>
21 #include <fun4all/Fun4AllUtils.h>
22 #include <fun4all/SubsysReco.h>
23 
25 #include <mbd/MbdReco.h>
26 
27 #include <phool/recoConsts.h>
28 
29 #include <cdbobjects/CDBTTree.h> // for CDBTTree
31 #include <GlobalVariables.C>
32 
33 R__LOAD_LIBRARY(libcdbobjects)
34 
35 R__LOAD_LIBRARY(libfun4all.so)
36 R__LOAD_LIBRARY(libfun4allraw.so)
37 R__LOAD_LIBRARY(libcalo_reco.so)
38 R__LOAD_LIBRARY(libffamodules.so)
39 R__LOAD_LIBRARY(libmbd.so)
40 R__LOAD_LIBRARY(libglobalvertex.so)
41 
42 #include <caloana/CaloAna.h>
43 R__LOAD_LIBRARY(libcaloana.so)
44 
45 
46 void doFitAndCalibUpdate(const std::string &hist_fname = "parallel_test/combine_out/out1.root", const std::string &calib_fname = "parallel_test/local_cdb_copy.root" ,int iter = 3)
47 {
48 
49 
51  se->Verbosity(0);
52 
53  CaloAna *caFit = new CaloAna("calomodulename", "bla.root");
54  caFit->fitEtaSlices(hist_fname.c_str(), Form("fitout_iter%d.root", iter), calib_fname.c_str());
55 
56  size_t pos = calib_fname.find_last_of('.');
57  string f_calib_save_name = calib_fname;
58  f_calib_save_name.insert(pos,Form("_iter%d",iter));
59 
60  TFile* f_calib_mod = new TFile(calib_fname.c_str());
61  f_calib_mod->Cp(f_calib_save_name.c_str());
62 
63  gSystem->Exit(0);
64 }
65 
66 
67 #endif