diff --git a/RecoLocalCalo/Castor/src/CastorTowerProducer.cc b/RecoLocalCalo/Castor/src/CastorTowerProducer.cc index eb0f442382575..000fb8b7da7bf 100644 --- a/RecoLocalCalo/Castor/src/CastorTowerProducer.cc +++ b/RecoLocalCalo/Castor/src/CastorTowerProducer.cc @@ -31,6 +31,7 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/ESGetToken.h" #include "DataFormats/Math/interface/Point3D.h" // Castor Object include @@ -66,6 +67,7 @@ class CastorTowerProducer : public edm::stream::EDProducer<> { typedef std::vector CastorTowerCollection; typedef edm::RefVector CastorRecHitRefVector; edm::EDGetTokenT tok_input_; + edm::ESGetToken tok_channelQuality_; double towercut_; double mintime_; double maxtime_; @@ -88,6 +90,7 @@ CastorTowerProducer::CastorTowerProducer(const edm::ParameterSet& iConfig) mintime_(iConfig.getParameter("mintime")), maxtime_(iConfig.getParameter("maxtime")) { tok_input_ = consumes(iConfig.getParameter("inputprocess")); + tok_channelQuality_ = esConsumes(); //register your products produces(); //now do what ever other initialization is needed @@ -146,8 +149,7 @@ void CastorTowerProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe } // retrieve the channel quality lists from database - edm::ESHandle p; - iSetup.get().get(p); + edm::ESHandle p = iSetup.getHandle(tok_channelQuality_); std::vector channels = p->getAllChannels(); // loop over rechits to build castortowerarray[4][16] and castorusedrechits[16]