File indexing completed on 2024-04-06 12:25:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
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
0023
0024
0025
0026
0027
0028
0029
0030
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
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
0056