diff --git a/RecoCaloTools/Selectors/test/TestCaloSelectors.cc b/RecoCaloTools/Selectors/test/TestCaloSelectors.cc index ba20a855b4102..f03d0ba3a7c06 100644 --- a/RecoCaloTools/Selectors/test/TestCaloSelectors.cc +++ b/RecoCaloTools/Selectors/test/TestCaloSelectors.cc @@ -5,29 +5,28 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "DataFormats/Common/interface/Handle.h" #include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/InputTag.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" #include -class TestCaloSelectors : public edm::EDAnalyzer { +class TestCaloSelectors : public edm::one::EDAnalyzer<> { public: - TestCaloSelectors(const edm::ParameterSet& ps) : inputTag_(ps.getParameter("inputTag")) {} - virtual void analyze(const edm::Event& evt, const edm::EventSetup& es); + TestCaloSelectors(const edm::ParameterSet& ps) + : token_(consumes(ps.getParameter("inputTag"))), caloToken_(esConsumes()) {} + void analyze(const edm::Event& evt, const edm::EventSetup& es) override; private: - edm::InputTag inputTag_; + edm::EDGetTokenT token_; + edm::ESGetToken caloToken_; }; void TestCaloSelectors::analyze(const edm::Event& evt, const edm::EventSetup& c) { - edm::Handle hbhe; - evt.getByLabel(inputTag_, hbhe); - edm::ESHandle pG; - c.get().get(pG); + edm::ESHandle pG = c.getHandle(caloToken_); - const HBHERecHitCollection& mhbhe = *hbhe; + const HBHERecHitCollection& mhbhe = evt.get(token_); double maxEt = -1; GlobalPoint pMax;