Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:05

0001 // -*- C++ -*-
0002 //
0003 // Package:     RecoEgamma/EgammaTools
0004 // Class  :     egEnergyCorrectorFactoryFromRootFile
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Christopher Jones
0010 //         Created:  Fri, 03 Sep 2021 18:57:07 GMT
0011 //
0012 
0013 // system include files
0014 #include <TFile.h>
0015 
0016 // user include files
0017 #include "RecoEgamma/EgammaTools/interface/egEnergyCorrectorFactoryFromRootFile.h"
0018 #include "CondFormats/GBRForest/interface/GBRForest.h"
0019 
0020 //
0021 // constants, enums and typedefs
0022 //
0023 
0024 EGEnergyCorrector::Initializer egEnergyCorrectorFactoryFromRootFile(const char *fileName) {
0025   EGEnergyCorrector::Initializer ret;
0026   std::unique_ptr<TFile> fgbr(TFile::Open(fileName, "READ"));
0027   ret.readereb_.reset((GBRForest *)fgbr->Get("EBCorrection"));
0028   ret.readerebvariance_.reset((GBRForest *)fgbr->Get("EBUncertainty"));
0029   ret.readeree_.reset((GBRForest *)fgbr->Get("EECorrection"));
0030   ret.readereevariance_.reset((GBRForest *)fgbr->Get("EEUncertainty"));
0031   fgbr->Close();
0032   return ret;
0033 }