diff --git a/RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilder.h b/RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilder.h index 7b53f3d30cc67..f4b205a6803c2 100644 --- a/RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilder.h +++ b/RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilder.h @@ -4,6 +4,7 @@ #include "RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.h" #include "FWCore/Framework/interface/ESWatcher.h" +class TrackingComponentsRecord; class MuonCkfTrajectoryBuilder : public CkfTrajectoryBuilder { public: MuonCkfTrajectoryBuilder(const edm::ParameterSet& conf, edm::ConsumesCollector& iC); @@ -30,6 +31,7 @@ class MuonCkfTrajectoryBuilder : public CkfTrajectoryBuilder { const double theDeltaPhi; const std::string theProximityPropagatorName; const Propagator* theProximityPropagator; + const edm::ESGetToken thePropagatorToken; edm::ESWatcher theEstimatorWatcher; std::unique_ptr theEtaPhiEstimator; }; diff --git a/RecoMuon/L3TrackFinder/src/MuonCkfTrajectoryBuilder.cc b/RecoMuon/L3TrackFinder/src/MuonCkfTrajectoryBuilder.cc index b8934b097e571..74d68df5ac7d5 100644 --- a/RecoMuon/L3TrackFinder/src/MuonCkfTrajectoryBuilder.cc +++ b/RecoMuon/L3TrackFinder/src/MuonCkfTrajectoryBuilder.cc @@ -21,6 +21,7 @@ MuonCkfTrajectoryBuilder::MuonCkfTrajectoryBuilder(const edm::ParameterSet& conf theDeltaPhi(conf.getParameter("deltaPhi")), theProximityPropagatorName(conf.getParameter("propagatorProximity")), theProximityPropagator(nullptr), + thePropagatorToken(iC.esConsumes(edm::ESInputTag("", theProximityPropagatorName))), theEtaPhiEstimator(nullptr) { //and something specific to me ? theUseSeedLayer = conf.getParameter("useSeedLayer"); @@ -32,9 +33,7 @@ MuonCkfTrajectoryBuilder::~MuonCkfTrajectoryBuilder() {} void MuonCkfTrajectoryBuilder::setEvent_(const edm::Event& iEvent, const edm::EventSetup& iSetup) { CkfTrajectoryBuilder::setEvent_(iEvent, iSetup); - edm::ESHandle propagatorProximityHandle; - iSetup.get().get(theProximityPropagatorName, propagatorProximityHandle); - theProximityPropagator = propagatorProximityHandle.product(); + theProximityPropagator = &iSetup.getData(thePropagatorToken); // theEstimator is set for this event in the base class if (theEstimatorWatcher.check(iSetup) && theDeltaEta > 0 && theDeltaPhi > 0)