diff --git a/RecoPixelVertexing/PixelLowPtUtilities/test/ClusterShapeExtractor.cc b/RecoPixelVertexing/PixelLowPtUtilities/test/ClusterShapeExtractor.cc index 8e7d2a6d524ba..5751a4adc365f 100644 --- a/RecoPixelVertexing/PixelLowPtUtilities/test/ClusterShapeExtractor.cc +++ b/RecoPixelVertexing/PixelLowPtUtilities/test/ClusterShapeExtractor.cc @@ -1,6 +1,6 @@ // VI January 2012: needs to be migrated to use cluster directly -#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/Framework/interface/ConsumesCollector.h" @@ -46,12 +46,13 @@ using namespace std; #define ewMax 40 /*****************************************************************************/ -class ClusterShapeExtractor : public edm::EDAnalyzer { +class ClusterShapeExtractor : public edm::one::EDAnalyzer { public: explicit ClusterShapeExtractor(const edm::ParameterSet& pset); ~ClusterShapeExtractor(); virtual void beginRun(const edm::Run& run, const edm::EventSetup& es) override; virtual void analyze(const edm::Event& ev, const edm::EventSetup& es) override; + virtual void endRun(const edm::Run& run, const edm::EventSetup& es) override{}; virtual void endJob() override; private: @@ -81,6 +82,10 @@ class ClusterShapeExtractor : public edm::EDAnalyzer { void analyzeSimHits(const edm::Event& ev, const edm::EventSetup& es); void analyzeRecTracks(const edm::Event& ev, const edm::EventSetup& es); + // member data + edm::ESGetToken geomToken; + edm::ESGetToken clusterShapeToken; + TFile* file; string trackProducer; @@ -105,15 +110,10 @@ class ClusterShapeExtractor : public edm::EDAnalyzer { /*****************************************************************************/ void ClusterShapeExtractor::beginRun(const edm::Run& run, const edm::EventSetup& es) { // Get tracker geometry - edm::ESHandle tracker; - es.get().get(tracker); - theTracker = tracker.product(); + theTracker = &es.getData(geomToken); - // - // theClusterShape = new ClusterShapeHitFilter(es); - edm::ESHandle shape; - es.get().get("ClusterShapeHitFilter", shape); - theClusterShape = shape.product(); + // Get the cluster shape + theClusterShape = &es.getData(clusterShapeToken); // Declare histograms char histName[256]; @@ -156,7 +156,9 @@ void ClusterShapeExtractor::beginRun(const edm::Run& run, const edm::EventSetup& /*****************************************************************************/ ClusterShapeExtractor::ClusterShapeExtractor(const edm::ParameterSet& pset) - : pixelRecHits_token(consumes>(edm::InputTag("siPixelRecHits"))), + : geomToken(esConsumes()), + clusterShapeToken(esConsumes(edm::ESInputTag("", "ClusterShapeHitFilter"))), + pixelRecHits_token(consumes>(edm::InputTag("siPixelRecHits"))), clusterShapeCache_token( consumes(pset.getParameter("clusterShapeCacheSrc"))), trackerHitAssociatorConfig_(pset, consumesCollector()) {