diff --git a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.cc b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.cc index 91c3a44cc8643..a276af79b0945 100644 --- a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.cc +++ b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.cc @@ -21,7 +21,9 @@ using namespace pixeltrackfitting; using edm::ParameterSet; -PixelTrackProducer::PixelTrackProducer(const ParameterSet& cfg) : theReconstruction(cfg, consumesCollector()) { +PixelTrackProducer::PixelTrackProducer(const ParameterSet& cfg) + : theReconstruction(cfg, consumesCollector()), + htTopoToken_(esConsumes()) { edm::LogInfo("PixelTrackProducer") << " construction..."; produces(); produces(); @@ -44,9 +46,8 @@ void PixelTrackProducer::produce(edm::Event& ev, const edm::EventSetup& es) { TracksWithTTRHs tracks; theReconstruction.run(tracks, ev, es); - edm::ESHandle httopo; - es.get().get(httopo); + auto htTopo = es.getData(htTopoToken_); // store tracks - storeTracks(ev, tracks, *httopo); + storeTracks(ev, tracks, htTopo); } diff --git a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.h b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.h index c38fd44c0d7f5..0d492f979f3aa 100644 --- a/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.h +++ b/RecoPixelVertexing/PixelTrackFitting/plugins/PixelTrackProducer.h @@ -3,6 +3,7 @@ #include "FWCore/Framework/interface/stream/EDProducer.h" #include "RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackReconstruction.h" +#include "Geometry/Records/interface/TrackerTopologyRcd.h" namespace edm { class Event; @@ -24,6 +25,7 @@ class PixelTrackProducer : public edm::stream::EDProducer<> { private: PixelTrackReconstruction theReconstruction; + const edm::ESGetToken htTopoToken_; }; #endif // RecoPixelVertexing_PixelTrackFitting_plugins_PixelTrackProducer_h