diff --git a/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducertT.cc b/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducertT.cc index b18a5249d972c..3eb1383713615 100644 --- a/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducertT.cc +++ b/RecoEgamma/EgammaTools/plugins/DRNCorrectionProducertT.cc @@ -124,6 +124,9 @@ class DRNCorrectionProducerT : public TritonEDProducer<> { edm::InputTag EBRecHitsName_, EERecHitsName_, ESRecHitsName_; edm::EDGetTokenT EBRecHitsToken_, EERecHitsToken_, ESRecHitsToken_; + edm::ESGetToken pedToken_; + edm::ESGetToken geomToken_; + size_t nPart_, nValidPart_; bool isEB(const T& part); @@ -132,8 +135,8 @@ class DRNCorrectionProducerT : public TritonEDProducer<> { }; template -DRNCorrectionProducerT::DRNCorrectionProducerT(const edm::ParameterSet& iConfig) - : TritonEDProducer<>(iConfig, "DRNCorrectionProducerT"), +DRNCorrectionProducerT::DRNCorrectionProducerT(const edm::ParameterSet& iConfig) : + TritonEDProducer<>(iConfig), particleSource_{iConfig.getParameter("particleSource")}, particleToken_(consumes(particleSource_)), rhoName_{iConfig.getParameter("rhoName")}, @@ -143,8 +146,9 @@ DRNCorrectionProducerT::DRNCorrectionProducerT(const edm::ParameterSet& iConf ESRecHitsName_{iConfig.getParameter("reducedEcalRecHitsES")}, EBRecHitsToken_(consumes(EBRecHitsName_)), EERecHitsToken_(consumes(EERecHitsName_)), - ESRecHitsToken_(consumes(ESRecHitsName_)) -{ + ESRecHitsToken_(consumes(ESRecHitsName_)), + pedToken_(esConsumes()), + geomToken_(esConsumes()){ produces>>(); } @@ -179,12 +183,9 @@ void DRNCorrectionProducerT::acquire(edm::Event const& iEvent, edm::EventSetu edm::Handle EERecHits = iEvent.getHandle(EERecHitsToken_); edm::Handle ESRecHits = iEvent.getHandle(ESRecHitsToken_); - edm::ESHandle ped; - edm::ESHandle pG; + const auto& ped = &iSetup.getData(pedToken_); + const auto& geo = &iSetup.getData(geomToken_); - iSetup.get().get(ped); - iSetup.get().get(pG); - const CaloGeometry* geo = pG.product(); const CaloSubdetectorGeometry* ecalEBGeom = static_cast(geo->getSubdetectorGeometry(DetId::Ecal, EcalBarrel)); const CaloSubdetectorGeometry* ecalEEGeom = diff --git a/RecoEgamma/EgammaTools/plugins/EGRegressionModifierDRN.cc b/RecoEgamma/EgammaTools/plugins/EGRegressionModifierDRN.cc index e1b731144b280..2e29db5f7e28f 100644 --- a/RecoEgamma/EgammaTools/plugins/EGRegressionModifierDRN.cc +++ b/RecoEgamma/EgammaTools/plugins/EGRegressionModifierDRN.cc @@ -161,7 +161,7 @@ void EGRegressionModifierDRN::modifyObject(reco::GsfElectron& ele) const { throw cms::Exception("EGRegressionModifierDRN") << "Electron energy corrections not fully implemented yet:" << std::endl - << "Still need E/p combination" << std::endl; + << "Still need E/p combination" << std::endl << "Do not enable DRN for electrons" << std::endl; const std::pair trackerCombo(1.0, 1.0); //TODO: compute E/p combination @@ -183,7 +183,7 @@ void EGRegressionModifierDRN::modifyObject(pat::Electron& ele) const { throw cms::Exception("EGRegressionModifierDRN") << "Electron energy corrections not fully implemented yet:" << std::endl - << "Still need E/p combination" << std::endl; + << "Still need E/p combination" << std::endl << "Do not enable DRN for electrons" << std::endl; const std::pair trackerCombo(1.0, 1.0); //TODO: compute E/p combination