File indexing completed on 2025-08-06 08:21:00
0001 #include <GlobalVariables.C>
0002 #include <cdbobjects/CDBTTree.h> // for CDBTTree
0003 #include <ffamodules/CDBInterface.h>
0004 #include <phool/recoConsts.h>
0005 #include "TowerInfo.h"
0006 #include "TowerInfoDefs.h"
0007
0008 R__LOAD_LIBRARY(libLiteCaloEvalTowSlope.so)
0009
0010 R__LOAD_LIBRARY(libcdbobjects)
0011 R__LOAD_LIBRARY(libphool.so)
0012 R__LOAD_LIBRARY(libcalo_reco.so)
0013 R__LOAD_LIBRARY(libcalo_io.so)
0014
0015 void mergeCDBTTrees(const char * infile1, const char * infile2, const char * outputfile)
0016 {
0017
0018 CDBTTree *cdbttree1 = new CDBTTree(infile1);
0019 CDBTTree *cdbttree2 = new CDBTTree(infile2);
0020 CDBTTree *cdbttreeOut = new CDBTTree(outputfile);
0021
0022 string m_fieldname = "Femc_datadriven_qm1_correction";
0023
0024 for(int i = 0; i < 96 ; i++)
0025 {
0026 for(int j = 0; j < 256; j++)
0027 {
0028 unsigned int key = TowerInfoDefs::encode_emcal(i,j);
0029 float val1 = cdbttree1->GetFloatValue(key, m_fieldname);
0030 float val2 = cdbttree2->GetFloatValue(key, m_fieldname);
0031 cdbttreeOut->SetFloatValue(key,m_fieldname,val1*val2);
0032 }
0033 }
0034
0035 cdbttreeOut->Commit();
0036 cdbttreeOut->WriteCDBTTree();
0037 delete cdbttreeOut;
0038 delete cdbttree1;
0039 delete cdbttree2;
0040
0041 }