diff --git a/SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h b/SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h index 82fbba6d154e2..55a955d4cef10 100644 --- a/SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h +++ b/SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h @@ -16,11 +16,9 @@ ************************************************************/ //#include -#include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "DataFormats/Common/interface/Handle.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Utilities/interface/EDGetToken.h" diff --git a/SimTracker/TrackerHitAssociation/test/TestAssociator.cc b/SimTracker/TrackerHitAssociation/test/TestAssociator.cc index 0dd62191c9872..3b4eefe4da74d 100644 --- a/SimTracker/TrackerHitAssociation/test/TestAssociator.cc +++ b/SimTracker/TrackerHitAssociation/test/TestAssociator.cc @@ -11,9 +11,6 @@ #include "SimTracker/TrackerHitAssociation/test/TestAssociator.h" -//--- framework stuff -#include "FWCore/Framework/interface/ESHandle.h" - //--- for Geometry: #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" diff --git a/SimTracker/TrackerHitAssociation/test/TestAssociator.h b/SimTracker/TrackerHitAssociation/test/TestAssociator.h index d0212f66a6a40..e3a80136596d3 100644 --- a/SimTracker/TrackerHitAssociation/test/TestAssociator.h +++ b/SimTracker/TrackerHitAssociation/test/TestAssociator.h @@ -8,14 +8,14 @@ * ************************************************************/ -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" -class TestAssociator : public edm::EDAnalyzer { +class TestAssociator : public edm::one::EDAnalyzer<> { public: explicit TestAssociator(const edm::ParameterSet& conf); diff --git a/SimTracker/TrackerHitAssociation/test/myTrackAnalyzer.cc b/SimTracker/TrackerHitAssociation/test/myTrackAnalyzer.cc index 1658d1dada4d8..765fe65105ddd 100644 --- a/SimTracker/TrackerHitAssociation/test/myTrackAnalyzer.cc +++ b/SimTracker/TrackerHitAssociation/test/myTrackAnalyzer.cc @@ -13,7 +13,8 @@ myTrackAnalyzer::myTrackAnalyzer(edm::ParameterSet const& conf) : trackerHitAssociatorConfig_(conf, consumesCollector()), doPixel_(conf.getParameter("associatePixel")), doStrip_(conf.getParameter("associateStrip")), - trackCollectionTag_(conf.getParameter("trackCollectionTag")) {} + trackCollectionTag_(conf.getParameter("trackCollectionTag")), + tokGeo_(esConsumes()) {} myTrackAnalyzer::~myTrackAnalyzer() {} @@ -21,8 +22,7 @@ void myTrackAnalyzer::analyze(const edm::Event& event, const edm::EventSetup& se // // extract tracker geometry // - edm::ESHandle theG; - setup.get().get(theG); + auto const& theG = setup.getHandle(tokGeo_); using namespace std; diff --git a/SimTracker/TrackerHitAssociation/test/myTrackAnalyzer.h b/SimTracker/TrackerHitAssociation/test/myTrackAnalyzer.h index dc0f780bee839..fe3c25c0be18e 100644 --- a/SimTracker/TrackerHitAssociation/test/myTrackAnalyzer.h +++ b/SimTracker/TrackerHitAssociation/test/myTrackAnalyzer.h @@ -4,17 +4,15 @@ #include #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Utilities/interface/InputTag.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" @@ -39,7 +37,7 @@ class SiStripHitAssociator; -class myTrackAnalyzer : public edm::EDAnalyzer { +class myTrackAnalyzer : public edm::one::EDAnalyzer<> { public: typedef std::map sim_id_map; sim_id_map SimIdMap; @@ -52,8 +50,9 @@ class myTrackAnalyzer : public edm::EDAnalyzer { private: TrackerHitAssociator::Config trackerHitAssociatorConfig_; - bool doPixel_, doStrip_; - edm::InputTag trackCollectionTag_; + const bool doPixel_, doStrip_; + const edm::InputTag trackCollectionTag_; + const edm::ESGetToken tokGeo_; }; #endif