From 5b7ec186f47c48d72e4a1daf87ce95e03b52c106 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 17 Sep 2021 13:17:43 -0500 Subject: [PATCH 1/7] Removed unnecessary includes --- RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc b/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc index 038494b706d04..2badae6a61c24 100644 --- a/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc +++ b/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc @@ -31,8 +31,6 @@ #include "RecoTracker/TkMSParametrization/interface/PixelRecoRange.h" #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" -#include "RecoMuon/TrackerSeedGenerator/interface/TrackerSeedGenerator.h" -#include "RecoMuon/TrackerSeedGenerator/interface/TrackerSeedGeneratorFactory.h" using namespace std; using namespace edm; From daaa11d24cd0c66a60660ea785d55549bf4e4213 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 17 Sep 2021 14:04:20 -0500 Subject: [PATCH 2/7] Use esConsumes in FastTSGFromPropagation Also simplified some of the logic. --- .../Muons/plugins/FastTSGFromPropagation.cc | 33 ++++--------------- .../Muons/plugins/FastTSGFromPropagation.h | 15 ++++++--- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/FastSimulation/Muons/plugins/FastTSGFromPropagation.cc b/FastSimulation/Muons/plugins/FastTSGFromPropagation.cc index 4b336ea86d502..2b9f331f48ebd 100644 --- a/FastSimulation/Muons/plugins/FastTSGFromPropagation.cc +++ b/FastSimulation/Muons/plugins/FastTSGFromPropagation.cc @@ -52,7 +52,6 @@ FastTSGFromPropagation::FastTSGFromPropagation(const edm::ParameterSet& iConfig, const MuonServiceProxy* service, edm::ConsumesCollector& iC) : theCategory("FastSimulation|Muons|FastTSGFromPropagation"), - theTracker(), theNavigation(), theService(service), theUpdator(), @@ -65,7 +64,10 @@ FastTSGFromPropagation::FastTSGFromPropagation(const edm::ParameterSet& iConfig, iC.consumes(theConfig.getParameter("HitProducer"))), beamSpot_(iC.consumes(iConfig.getParameter("beamSpot"))), theMeasurementTrackerEventToken_( - iC.consumes(iConfig.getParameter("MeasurementTrackerEvent"))) {} + iC.consumes(iConfig.getParameter("MeasurementTrackerEvent"))), + theGeometryToken(iC.esConsumes()), + theTTRHBuilderToken(iC.esConsumes(edm::ESInputTag("", "WithTrackAngle"))), + theTrackerToken(iC.esConsumes()) {} FastTSGFromPropagation::~FastTSGFromPropagation() { LogTrace(theCategory) << " FastTSGFromPropagation dtor called "; } @@ -320,8 +322,6 @@ void FastTSGFromPropagation::init(const MuonServiceProxy* service) { theEstimator = std::make_unique(theMaxChi2); - theCacheId_MT = 0; - theCacheId_TG = 0; thePropagatorName = theConfig.getParameter("Propagator"); @@ -347,14 +347,9 @@ void FastTSGFromPropagation::init(const MuonServiceProxy* service) { theErrorMatrixAdjuster.reset(); } - theService->eventSetup().get().get(theTracker); - theNavigation = std::make_unique(theTracker); - - edm::ESHandle geometry; - theService->eventSetup().get().get(geometry); - theGeometry = &(*geometry); + theGeometry = &theService->eventSetup().getData(theGeometryToken); - theService->eventSetup().get().get("WithTrackAngle", theTTRHBuilder); + theTTRHBuilder = theService->eventSetup().getHandle(theTTRHBuilderToken); } void FastTSGFromPropagation::setEvent(const edm::Event& iEvent) { @@ -364,30 +359,16 @@ void FastTSGFromPropagation::setEvent(const edm::Event& iEvent) { iEvent.getByToken(theSimTrackCollectionToken_, theSimTracks); iEvent.getByToken(recHitCombinationsToken_, recHitCombinations); - unsigned long long newCacheId_MT = theService->eventSetup().get().cacheIdentifier(); - - if (theUpdateStateFlag && newCacheId_MT != theCacheId_MT) { - LogTrace(theCategory) << "Measurment Tracker Geometry changed!"; - theCacheId_MT = newCacheId_MT; - theService->eventSetup().get().get(theMeasTracker); - } - if (theUpdateStateFlag) { iEvent.getByToken(theMeasurementTrackerEventToken_, theMeasTrackerEvent); } - bool trackerGeomChanged = false; - unsigned long long newCacheId_TG = theService->eventSetup().get().cacheIdentifier(); if (newCacheId_TG != theCacheId_TG) { LogTrace(theCategory) << "Tracker Reco Geometry changed!"; theCacheId_TG = newCacheId_TG; - theService->eventSetup().get().get(theTracker); - trackerGeomChanged = true; - } - - if (trackerGeomChanged && theTracker.product()) { + auto theTracker = theService->eventSetup().getHandle(theTrackerToken); theNavigation = std::make_unique(theTracker); } } diff --git a/FastSimulation/Muons/plugins/FastTSGFromPropagation.h b/FastSimulation/Muons/plugins/FastTSGFromPropagation.h index 0ebc8ba23216e..5f812d6ff5830 100644 --- a/FastSimulation/Muons/plugins/FastTSGFromPropagation.h +++ b/FastSimulation/Muons/plugins/FastTSGFromPropagation.h @@ -44,6 +44,9 @@ struct TrajectoryStateTransform; class SimTrack; class TrackerGeometry; class TrackerTopology; +class TransientRecHitRecord; +class CkfComponentsRecord; +class TrackerRecoGeometryRecord; class FastTSGFromPropagation : public TrackerSeedGenerator { public: @@ -123,15 +126,10 @@ class FastTSGFromPropagation : public TrackerSeedGenerator { } }; - unsigned long long theCacheId_MT; unsigned long long theCacheId_TG; std::string theCategory; - edm::ESHandle theTracker; - - edm::ESHandle theMeasTracker; - std::unique_ptr theNavigation; const TrackerGeometry* theGeometry; @@ -175,6 +173,13 @@ class FastTSGFromPropagation : public TrackerSeedGenerator { edm::Handle recHitCombinations; edm::Handle theMeasTrackerEvent; edm::ESHandle theTTRHBuilder; + + //from init + edm::ESGetToken theGeometryToken; + edm::ESGetToken theTTRHBuilderToken; + + //from setEvent + edm::ESGetToken theTrackerToken; }; #endif From d1a2075793519fba5f8bd5ab434e648fca2f177f Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 17 Sep 2021 14:25:02 -0500 Subject: [PATCH 3/7] Add esConsumes to TSGForRoadSearch Removed unneeded member data as well --- .../TrackerSeedGenerator/plugins/TSGForRoadSearch.cc | 11 +++-------- .../TrackerSeedGenerator/plugins/TSGForRoadSearch.h | 5 ++--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/RecoMuon/TrackerSeedGenerator/plugins/TSGForRoadSearch.cc b/RecoMuon/TrackerSeedGenerator/plugins/TSGForRoadSearch.cc index 611c97465479b..f48d10b07839c 100644 --- a/RecoMuon/TrackerSeedGenerator/plugins/TSGForRoadSearch.cc +++ b/RecoMuon/TrackerSeedGenerator/plugins/TSGForRoadSearch.cc @@ -23,7 +23,8 @@ #include #include "TrackingTools/GeomPropagators/interface/StateOnTrackerBound.h" -TSGForRoadSearch::TSGForRoadSearch(const edm::ParameterSet &par, edm::ConsumesCollector &iC) { +TSGForRoadSearch::TSGForRoadSearch(const edm::ParameterSet &par, edm::ConsumesCollector &iC) + : theGeometricSearchTrackerToken(iC.esConsumes()) { theOption = par.getParameter("option"); theCopyMuonRecHit = par.getParameter("copyMuonRecHit"); @@ -69,13 +70,7 @@ void TSGForRoadSearch::init(const MuonServiceProxy *service) { theProxyService = void TSGForRoadSearch::setEvent(const edm::Event &event) { //get the measurementtracker - if (theManySeeds) { - theProxyService->eventSetup().get().get(theMeasurementTracker); - if (!theMeasurementTracker.isValid()) /*abort*/ { - edm::LogError(theCategory) << "measurement tracker geometry not found "; - } - } - theProxyService->eventSetup().get().get(theGeometricSearchTracker); + theGeometricSearchTracker = theProxyService->eventSetup().getHandle(theGeometricSearchTrackerToken); edm::Handle data; event.getByToken(theMeasurementTrackerEventToken, data); diff --git a/RecoMuon/TrackerSeedGenerator/plugins/TSGForRoadSearch.h b/RecoMuon/TrackerSeedGenerator/plugins/TSGForRoadSearch.h index eef9a85b6ba54..b9bb2f3a5b52a 100644 --- a/RecoMuon/TrackerSeedGenerator/plugins/TSGForRoadSearch.h +++ b/RecoMuon/TrackerSeedGenerator/plugins/TSGForRoadSearch.h @@ -41,6 +41,7 @@ class TrackingRegion; class MuonServiceProxy; class TrajectoryStateUpdator; class TrackerTopology; +class TrackerRecoGeometryRecord; class TSGForRoadSearch : public TrackerSeedGenerator { public: @@ -88,8 +89,8 @@ class TSGForRoadSearch : public TrackerSeedGenerator { std::vector &result) const; edm::ParameterSet theConfig; - edm::ESHandle theMeasurementTracker; edm::ESHandle theGeometricSearchTracker; + edm::ESGetToken theGeometricSearchTrackerToken; edm::InputTag theMeasurementTrackerEventTag; edm::EDGetTokenT theMeasurementTrackerEventToken; @@ -102,9 +103,7 @@ class TSGForRoadSearch : public TrackerSeedGenerator { bool theCopyMuonRecHit; bool theManySeeds; std::string thePropagatorName; - edm::ESHandle theProp; std::string thePropagatorCompatibleName; - edm::ESHandle thePropCompatible; Chi2MeasurementEstimator *theChi2Estimator; std::string theCategory; From a3783c847052d9808c7174be968b3778e1a6a32e Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 17 Sep 2021 14:47:59 -0500 Subject: [PATCH 4/7] Added esConsumes to TSGFromPropagation Also removed unused code --- .../plugins/TSGFromPropagation.cc | 25 +++---------------- .../plugins/TSGFromPropagation.h | 7 ++---- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/RecoMuon/TrackerSeedGenerator/plugins/TSGFromPropagation.cc b/RecoMuon/TrackerSeedGenerator/plugins/TSGFromPropagation.cc index 28b03405f1051..eb1d3622bcd66 100644 --- a/RecoMuon/TrackerSeedGenerator/plugins/TSGFromPropagation.cc +++ b/RecoMuon/TrackerSeedGenerator/plugins/TSGFromPropagation.cc @@ -33,7 +33,6 @@ TSGFromPropagation::TSGFromPropagation(const edm::ParameterSet& iConfig, edm::ConsumesCollector& iC, const MuonServiceProxy* service) : theCategory("Muon|RecoMuon|TSGFromPropagation"), - theMeasTrackerName(iConfig.getParameter("MeasurementTrackerName")), theService(service), theMaxChi2(iConfig.getParameter("MaxChi2")), theFixedErrorRescaling(iConfig.getParameter("ErrorRescaling")), @@ -61,7 +60,8 @@ TSGFromPropagation::TSGFromPropagation(const edm::ParameterSet& iConfig, theErrorMatrixPset(iConfig.getParameter("errorMatrixPset")), theBeamSpotToken(iC.consumes(iConfig.getParameter("beamSpot"))), theMeasurementTrackerEventToken( - iC.consumes(iConfig.getParameter("MeasurementTrackerEvent"))) {} + iC.consumes(iConfig.getParameter("MeasurementTrackerEvent"))), + theTrackerToken(iC.esConsumes()) {} TSGFromPropagation::~TSGFromPropagation() { LogTrace(theCategory) << " TSGFromPropagation dtor called "; } @@ -157,8 +157,6 @@ void TSGFromPropagation::init(const MuonServiceProxy* service) { theEstimator = std::make_unique(theMaxChi2); - theCacheId_MT = 0; - theCacheId_TG = 0; theService = service; @@ -168,38 +166,21 @@ void TSGFromPropagation::init(const MuonServiceProxy* service) { if (theResetMethod == ResetMethod::matrix && !theErrorMatrixPset.empty()) { theErrorMatrixAdjuster = std::make_unique(theErrorMatrixPset); } - - theService->eventSetup().get().get(theTracker); - theNavigation = std::make_unique(theTracker); } void TSGFromPropagation::setEvent(const edm::Event& iEvent) { iEvent.getByToken(theBeamSpotToken, beamSpot); - unsigned long long newCacheId_MT = theService->eventSetup().get().cacheIdentifier(); - - if (theUpdateStateFlag && newCacheId_MT != theCacheId_MT) { - LogTrace(theCategory) << "Measurment Tracker Geometry changed!"; - theCacheId_MT = newCacheId_MT; - theService->eventSetup().get().get(theMeasTrackerName, theMeasTracker); - } - if (theUpdateStateFlag) { iEvent.getByToken(theMeasurementTrackerEventToken, theMeasTrackerEvent); } - bool trackerGeomChanged = false; - unsigned long long newCacheId_TG = theService->eventSetup().get().cacheIdentifier(); if (newCacheId_TG != theCacheId_TG) { LogTrace(theCategory) << "Tracker Reco Geometry changed!"; theCacheId_TG = newCacheId_TG; - theService->eventSetup().get().get(theTracker); - trackerGeomChanged = true; - } - - if (trackerGeomChanged && (theTracker.product() != nullptr)) { + edm::ESHandle theTracker = theService->eventSetup().getHandle(theTrackerToken); theNavigation = std::make_unique(theTracker); } } diff --git a/RecoMuon/TrackerSeedGenerator/plugins/TSGFromPropagation.h b/RecoMuon/TrackerSeedGenerator/plugins/TSGFromPropagation.h index 584806bd8a8e8..d4c35c52f7f52 100644 --- a/RecoMuon/TrackerSeedGenerator/plugins/TSGFromPropagation.h +++ b/RecoMuon/TrackerSeedGenerator/plugins/TSGFromPropagation.h @@ -29,6 +29,7 @@ class GeometricSearchTracker; class DirectTrackerNavigation; struct TrajectoryStateTransform; class TrackerTopology; +class TrackerRecoGeometryRecord; class TSGFromPropagation : public TrackerSeedGenerator { public: @@ -105,15 +106,10 @@ class TSGFromPropagation : public TrackerSeedGenerator { } }; - unsigned long long theCacheId_MT; unsigned long long theCacheId_TG; const std::string theCategory; - edm::ESHandle theTracker; - - const std::string theMeasTrackerName; - edm::ESHandle theMeasTracker; edm::Handle theMeasTrackerEvent; std::unique_ptr theNavigation; @@ -150,6 +146,7 @@ class TSGFromPropagation : public TrackerSeedGenerator { edm::Handle beamSpot; const edm::EDGetTokenT theBeamSpotToken; const edm::EDGetTokenT theMeasurementTrackerEventToken; + const edm::ESGetToken theTrackerToken; }; #endif From e44a0d4c59edcef4394c1726fea2c82a00ffd366 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 17 Sep 2021 15:03:53 -0500 Subject: [PATCH 5/7] Added esConsumes to TrackerSeedCleaner --- RecoMuon/TrackerSeedGenerator/interface/TrackerSeedCleaner.h | 3 +++ RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RecoMuon/TrackerSeedGenerator/interface/TrackerSeedCleaner.h b/RecoMuon/TrackerSeedGenerator/interface/TrackerSeedCleaner.h index 748beb80134ff..55824812654f5 100644 --- a/RecoMuon/TrackerSeedGenerator/interface/TrackerSeedCleaner.h +++ b/RecoMuon/TrackerSeedGenerator/interface/TrackerSeedCleaner.h @@ -16,6 +16,7 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h" #include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h" +#include "TrackingTools/Records/interface/TransientRecHitRecord.h" #include "RecoTracker/TkTrackingRegions/interface/RectangularEtaPhiTrackingRegion.h" #include "RecoMuon/TrackerSeedGenerator/interface/RedundantSeedCleaner.h" #include "DataFormats/BeamSpot/interface/BeamSpot.h" @@ -47,6 +48,7 @@ class TrackerSeedCleaner { usePt_Cleaner = pset.getParameter("ptCleaner"); cleanBySharedHits = pset.getParameter("cleanerFromSharedHits"); beamspotToken_ = iC.consumes(theBeamSpotTag); + theTTRHBuilderToken = iC.esConsumes(edm::ESInputTag("", builderName_)); } ///intizialization @@ -70,6 +72,7 @@ class TrackerSeedCleaner { std::string builderName_; edm::ESHandle theTTRHBuilder; + edm::ESGetToken theTTRHBuilderToken; bool useDirection_Cleaner, usePt_Cleaner, cleanBySharedHits; }; diff --git a/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc b/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc index 2badae6a61c24..bc747b9875e3e 100644 --- a/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc +++ b/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc @@ -24,7 +24,6 @@ #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" #include "TrackingTools/PatternTools/interface/TSCBLBuilderNoMaterial.h" -#include "TrackingTools/Records/interface/TransientRecHitRecord.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" #include "RecoTracker/TkTrackingRegions/interface/RectangularEtaPhiTrackingRegion.h" #include "RecoTracker/TkTrackingRegions/interface/TkTrackingRegionsMargin.h" @@ -59,7 +58,7 @@ void TrackerSeedCleaner::clean(const reco::TrackRef& muR, if (cleanBySharedHits) theRedundantCleaner->define(seeds); - theProxyService->eventSetup().get().get(builderName_, theTTRHBuilder); + theTTRHBuilder = theProxyService->eventSetup().getHandle(theTTRHBuilderToken); LogDebug("TrackerSeedCleaner") << seeds.size() << " trajectory seeds to the events before cleaning" << endl; From 002868bf1de68e93b08c518fc4b851b7e0492c0a Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 17 Sep 2021 15:22:43 -0500 Subject: [PATCH 6/7] Fixed incorrect use of consumesCollector in FastTSGFromL2Muon The function can ony be called in the constructor. --- FastSimulation/Muons/plugins/FastTSGFromL2Muon.cc | 7 +++---- FastSimulation/Muons/plugins/FastTSGFromL2Muon.h | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/FastSimulation/Muons/plugins/FastTSGFromL2Muon.cc b/FastSimulation/Muons/plugins/FastTSGFromL2Muon.cc index 23256f54071f1..624d09739ea33 100644 --- a/FastSimulation/Muons/plugins/FastTSGFromL2Muon.cc +++ b/FastSimulation/Muons/plugins/FastTSGFromL2Muon.cc @@ -17,7 +17,7 @@ #include -FastTSGFromL2Muon::FastTSGFromL2Muon(const edm::ParameterSet& cfg) : theConfig(cfg) { +FastTSGFromL2Muon::FastTSGFromL2Muon(const edm::ParameterSet& cfg) { produces(); edm::ParameterSet serviceParameters = cfg.getParameter("ServiceParameters"); @@ -28,15 +28,14 @@ FastTSGFromL2Muon::FastTSGFromL2Muon(const edm::ParameterSet& cfg) : theConfig(c theSeedCollectionLabels = cfg.getParameter >("SeedCollectionLabels"); theSimTrackCollectionLabel = cfg.getParameter("SimTrackCollectionLabel"); // useTFileService_ = cfg.getUntrackedParameter("UseTFileService",false); + edm::ParameterSet regionBuilderPSet = cfg.getParameter("MuonTrackingRegionBuilder"); + theRegionBuilder = std::make_unique(regionBuilderPSet, consumesCollector()); } FastTSGFromL2Muon::~FastTSGFromL2Muon() {} void FastTSGFromL2Muon::beginRun(edm::Run const& run, edm::EventSetup const& es) { //region builder - edm::ParameterSet regionBuilderPSet = theConfig.getParameter("MuonTrackingRegionBuilder"); - edm::ConsumesCollector iC = consumesCollector(); - theRegionBuilder = new MuonTrackingRegionBuilder(regionBuilderPSet, iC); /* if(useTFileService_) { diff --git a/FastSimulation/Muons/plugins/FastTSGFromL2Muon.h b/FastSimulation/Muons/plugins/FastTSGFromL2Muon.h index 26a618c3a8e72..ffb56f5b4c11c 100644 --- a/FastSimulation/Muons/plugins/FastTSGFromL2Muon.h +++ b/FastSimulation/Muons/plugins/FastTSGFromL2Muon.h @@ -37,7 +37,6 @@ class FastTSGFromL2Muon : public edm::stream::EDProducer<> { const SimTrack& theSimTrack); private: - edm::ParameterSet theConfig; edm::InputTag theSimTrackCollectionLabel; edm::InputTag theL2CollectionLabel; std::vector theSeedCollectionLabels; @@ -46,7 +45,7 @@ class FastTSGFromL2Muon : public edm::stream::EDProducer<> { MuonServiceProxy* theService; double thePtCut; - MuonTrackingRegionBuilder* theRegionBuilder; + std::unique_ptr theRegionBuilder; // TH1F* h_nSeedPerTrack; // TH1F* h_nGoodSeedPerTrack; From 7c96d7eaa8e5a78cb445f7bf82840df855e0f49d Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Fri, 17 Sep 2021 15:37:25 -0500 Subject: [PATCH 7/7] Added esConsumes to TSGFromL2Muon --- RecoMuon/TrackerSeedGenerator/plugins/TSGFromL2Muon.cc | 6 +++--- RecoMuon/TrackerSeedGenerator/plugins/TSGFromL2Muon.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RecoMuon/TrackerSeedGenerator/plugins/TSGFromL2Muon.cc b/RecoMuon/TrackerSeedGenerator/plugins/TSGFromL2Muon.cc index 684de272ea147..2fd0c81c68ed5 100644 --- a/RecoMuon/TrackerSeedGenerator/plugins/TSGFromL2Muon.cc +++ b/RecoMuon/TrackerSeedGenerator/plugins/TSGFromL2Muon.cc @@ -42,6 +42,8 @@ TSGFromL2Muon::TSGFromL2Muon(const edm::ParameterSet& cfg) { //L2 collection theL2CollectionLabel = cfg.getParameter("MuonCollectionLabel"); l2muonToken = consumes(theL2CollectionLabel); + + theTTopoToken = esConsumes(); } TSGFromL2Muon::~TSGFromL2Muon() = default; @@ -59,9 +61,7 @@ void TSGFromL2Muon::produce(edm::Event& ev, const edm::EventSetup& es) { auto result = std::make_unique(); //Retrieve tracker topology from geometry - edm::ESHandle tTopoHand; - es.get().get(tTopoHand); - const TrackerTopology* tTopo = tTopoHand.product(); + const TrackerTopology* tTopo = &es.getData(theTTopoToken); //intialize tools theService->update(es); diff --git a/RecoMuon/TrackerSeedGenerator/plugins/TSGFromL2Muon.h b/RecoMuon/TrackerSeedGenerator/plugins/TSGFromL2Muon.h index 6544b32737cea..a701fbe33ceb9 100644 --- a/RecoMuon/TrackerSeedGenerator/plugins/TSGFromL2Muon.h +++ b/RecoMuon/TrackerSeedGenerator/plugins/TSGFromL2Muon.h @@ -17,6 +17,7 @@ class MuonServiceProxy; class TrackerSeedGenerator; class MuonTrackingRegionBuilder; class TrackerSeedCleaner; +class TrackerTopologyRcd; // // Generate tracker seeds from L2 muons @@ -37,5 +38,6 @@ class TSGFromL2Muon : public edm::stream::EDProducer<> { std::unique_ptr theTkSeedGenerator; std::unique_ptr theSeedCleaner; edm::EDGetTokenT l2muonToken; + edm::ESGetToken theTTopoToken; }; #endif