Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
createLocalEMCalCalibFile.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file createLocalEMCalCalibFile.C
1 #include <GlobalVariables.C>
2 #include <cdbobjects/CDBTTree.h> // for CDBTTree
4 
5 R__LOAD_LIBRARY(libcdbobjects)
6 
7 
8 void createLocalEMCalCalibFile(const string fname,int runNumber){
9 
10  string default_time_independent_calib = "cemc_pi0_twrSlope_v1_default";
11  string m_calibName = "cemc_pi0_twrSlope_v1";
12 
13  string calibdir = CDBInterface::instance()->getUrl(m_calibName);
14  string filePath;
15 
16  if (!calibdir.empty())
17  {
18  filePath = calibdir;
19  //cdbttree = new CDBTTree(calibdir);
20  }
21  else
22  {
23  calibdir = CDBInterface::instance()->getUrl(default_time_independent_calib);
24 
25  if (calibdir.empty())
26  {
27  std::cout << "No EMCal Calibration NOT even a default" << std::endl;
28  exit(1);
29  }
30  filePath = calibdir;
31  //cdbttree = new CDBTTree(calibdir);
32  std::cout << "No specific file for " << m_calibName << " found, using default calib " << default_time_independent_calib << std::endl;
33  }
34 
35  TFile* f_cdb = new TFile(filePath.c_str());
36  f_cdb->Cp(fname.c_str());
37 
38  delete f_cdb;
39 }