Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-10 10:03:06

0001 // -*- C++ -*-
0002 //
0003 // Package:     RecoEgamma/EgammaTools
0004 // Class  :     EGEnergyCorrectorFactoryFromEventSetup
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Christopher Jones
0010 //         Created:  Fri, 03 Sep 2021 18:55:05 GMT
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "RecoEgamma/EgammaTools/interface/EGEnergyCorrectorFactoryFromEventSetup.h"
0017 
0018 #include "CondFormats/DataRecord/interface/GBRWrapperRcd.h"
0019 #include "FWCore/Framework/interface/ESHandle.h"
0020 
0021 //
0022 // constants, enums and typedefs
0023 //
0024 
0025 //
0026 // static data member definitions
0027 //
0028 
0029 //
0030 // constructors and destructor
0031 //
0032 EGEnergyCorrectorFactoryFromEventSetup::EGEnergyCorrectorFactoryFromEventSetup(edm::ConsumesCollector cc,
0033                                                                                std::string const& regweigths)
0034     : ebCorrectionTag_(cc.esConsumes(edm::ESInputTag("", regweigths + "_EBCorrection"))),
0035       ebUncertaintyTag_(cc.esConsumes(edm::ESInputTag("", regweigths + "_EBUncertainty"))),
0036       eeCorrectionTag_(cc.esConsumes(edm::ESInputTag("", regweigths + "_EECorrection"))),
0037       eeUncertaintyTag_(cc.esConsumes(edm::ESInputTag("", regweigths + "_EEUncertainty"))) {}
0038 
0039 //
0040 // const member functions
0041 //
0042 EGEnergyCorrector::Initializer EGEnergyCorrectorFactoryFromEventSetup::build(edm::EventSetup const& iSetup) const {
0043   EGEnergyCorrector::Initializer ret;
0044   auto no_del = [](void const*) {};
0045 
0046   ret.readereb_ = std::shared_ptr<GBRForest const>(&iSetup.getData(ebCorrectionTag_), no_del);
0047   ret.readerebvariance_ = std::shared_ptr<GBRForest const>(&iSetup.getData(ebUncertaintyTag_), no_del);
0048   ret.readeree_ = std::shared_ptr<GBRForest const>(&iSetup.getData(eeCorrectionTag_), no_del);
0049   ret.readereevariance_ = std::shared_ptr<GBRForest const>(&iSetup.getData(eeUncertaintyTag_), no_del);
0050 
0051   return ret;
0052 }
0053 
0054 //
0055 // static member functions
0056 //