2 #include <litecaloeval/LiteCaloEval.h>
8 R__LOAD_LIBRARY(libLiteCaloEvalTowSlope.so)
9 R__LOAD_LIBRARY(libcdbobjects)
13 void mergeCDBTTrees(const
char * infile1, const
char * infile2, const
char * outputfile);
15 void doTscFit(const std::
string &hist_fname = "base/combine_out/out1.
root", const std::
string &calib_fname = "base/local_calib_copy.root")
19 string fitoutfile =
"tsc_fitout.root";
23 modlce.
Get_Histos(hist_fname.c_str(),fitoutfile.c_str());
33 mergeCDBTTrees(
"tsc_output_cdb.root",calib_fname.c_str(),calib_fname.c_str());
35 size_t pos = calib_fname.find_last_of(
'.');
36 string f_calib_save_name = calib_fname;
37 f_calib_save_name.insert(pos,
"_postTSC");
39 TFile* f_calib_mod =
new TFile(calib_fname.c_str());
40 f_calib_mod->Cp(f_calib_save_name.c_str());
46 void mergeCDBTTrees(
const char * infile1,
const char * infile2,
const char * outputfile)
53 string m_fieldname =
"Femc_datadriven_qm1_correction";
55 for(
int i = 0;
i < 96 ;
i++)
57 for(
int j = 0;
j < 256;
j++)
78 bool chk4file = gSystem->AccessPathName(infile);
83 f =
new TFile(infile,
"READ");
87 std::cout <<
"File " << infile <<
" cant be found in current directory." << std::endl;
95 TH2F *cp = (TH2F *)f->Get(
"corrPat");
97 for(
int i = 0;
i < 96 ;
i++)
99 for(
int j = 0;
j < 256;
j++)
102 float gain = (1.0 / cp->GetBinContent(
i+1,
j+1) );
103 if (cp->GetBinContent(
i+1,
j+1)==0) gain = 0;
104 if (isnan(cp->GetBinContent(
i+1,
j+1))) {gain = 0; cout <<
i <<
"," <<
j << endl;}
105 cdbttree->
SetFloatValue(key,
"Femc_datadriven_qm1_correction",gain);