diff --git a/Validation/SiOuterTrackerV/plugins/OuterTrackerMonitorTrackingParticles.cc b/Validation/SiOuterTrackerV/plugins/OuterTrackerMonitorTrackingParticles.cc index 420c30848ef36..fc9dc92ad0cd6 100644 --- a/Validation/SiOuterTrackerV/plugins/OuterTrackerMonitorTrackingParticles.cc +++ b/Validation/SiOuterTrackerV/plugins/OuterTrackerMonitorTrackingParticles.cc @@ -38,7 +38,7 @@ // constructors and destructor // OuterTrackerMonitorTrackingParticles::OuterTrackerMonitorTrackingParticles(const edm::ParameterSet &iConfig) - : conf_(iConfig) { + : m_topoToken(esConsumes()), conf_(iConfig) { topFolderName_ = conf_.getParameter("TopFolderName"); trackingParticleToken_ = consumes>(conf_.getParameter("trackingParticleToken")); @@ -80,9 +80,7 @@ void OuterTrackerMonitorTrackingParticles::analyze(const edm::Event &iEvent, con iEvent.getByToken(ttStubMCTruthToken_, MCTruthTTStubHandle); // Geometries - edm::ESHandle tTopoHandle; - iSetup.get().get(tTopoHandle); - const TrackerTopology *const tTopo = tTopoHandle.product(); + const TrackerTopology *const tTopo = &iSetup.getData(m_topoToken); // Loop over tracking particles int this_tp = 0; diff --git a/Validation/SiOuterTrackerV/plugins/OuterTrackerMonitorTrackingParticles.h b/Validation/SiOuterTrackerV/plugins/OuterTrackerMonitorTrackingParticles.h index e4c402c56a114..dde2474ccdd23 100644 --- a/Validation/SiOuterTrackerV/plugins/OuterTrackerMonitorTrackingParticles.h +++ b/Validation/SiOuterTrackerV/plugins/OuterTrackerMonitorTrackingParticles.h @@ -97,6 +97,7 @@ class OuterTrackerMonitorTrackingParticles : public DQMEDAnalyzer { MonitorElement *resd0_eta2to2p4 = nullptr; private: + const edm::ESGetToken m_topoToken; edm::ParameterSet conf_; edm::EDGetTokenT> trackingParticleToken_; edm::EDGetTokenT> diff --git a/Validation/TrackerDigis/plugins/SiPixelDigiValid.cc b/Validation/TrackerDigis/plugins/SiPixelDigiValid.cc index dbd1bdf27bff5..42665a7756930 100644 --- a/Validation/TrackerDigis/plugins/SiPixelDigiValid.cc +++ b/Validation/TrackerDigis/plugins/SiPixelDigiValid.cc @@ -15,7 +15,6 @@ #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "Geometry/TrackerGeometryBuilder/interface/RectangularPixelTopology.h" -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" #include "SiPixelDigiValid.h" @@ -23,7 +22,9 @@ // using namespace edm; SiPixelDigiValid::SiPixelDigiValid(const edm::ParameterSet &ps) - : outputFile_(ps.getUntrackedParameter("outputFile", "pixeldigihisto.root")), + : m_geomToken(esConsumes()), + m_topoToken(esConsumes()), + outputFile_(ps.getUntrackedParameter("outputFile", "pixeldigihisto.root")), runStandalone(ps.getParameter("runStandalone")), dbe_(nullptr), edmDetSetVector_PixelDigi_Token_(consumes>(ps.getParameter("src"))) {} @@ -32,7 +33,7 @@ SiPixelDigiValid::~SiPixelDigiValid() {} void SiPixelDigiValid::bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &es) { dbe_ = edm::Service().operator->(); - es.get().get(tracker); + tracker = &es.getData(m_geomToken); if (dbe_) { ibooker.setCurrentFolder("TrackerDigisV/TrackerDigis/Pixel"); @@ -274,9 +275,7 @@ void SiPixelDigiValid::bookHistograms(DQMStore::IBooker &ibooker, const edm::Run void SiPixelDigiValid::analyze(const edm::Event &e, const edm::EventSetup &c) { // Retrieve tracker topology from geometry - edm::ESHandle tTopoHandle; - c.get().get(tTopoHandle); - const TrackerTopology *const tTopo = tTopoHandle.product(); + const TrackerTopology *const tTopo = &c.getData(m_topoToken); // Number of blades and ladders. // TODO: other Geometry-Dependent quantities, e.g. num layers. int nblades = tracker->posPixelForwardLayers()[0]->components().size(); @@ -332,9 +331,6 @@ void SiPixelDigiValid::analyze(const edm::Event &e, const edm::EventSetup &c) { // LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << // e.id().event(); - edm::ESHandle tracker; - c.get().get(tracker); - // string digiProducer = "siPixelDigis"; edm::Handle> pixelDigis; e.getByToken(edmDetSetVector_PixelDigi_Token_, pixelDigis); diff --git a/Validation/TrackerDigis/plugins/SiPixelDigiValid.h b/Validation/TrackerDigis/plugins/SiPixelDigiValid.h index ced20c48615ea..b47fc01552b15 100644 --- a/Validation/TrackerDigis/plugins/SiPixelDigiValid.h +++ b/Validation/TrackerDigis/plugins/SiPixelDigiValid.h @@ -5,6 +5,7 @@ #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Frameworkfwd.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h" #include "DQMServices/Core/interface/DQMStore.h" @@ -27,6 +28,9 @@ class SiPixelDigiValid : public DQMEDAnalyzer { void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &es) override; private: + const edm::ESGetToken m_geomToken; + const edm::ESGetToken m_topoToken; + std::string outputFile_; bool runStandalone; @@ -259,6 +263,6 @@ class SiPixelDigiValid : public DQMEDAnalyzer { DQMStore *dbe_; edm::EDGetTokenT> edmDetSetVector_PixelDigi_Token_; - edm::ESHandle tracker; + const GeometricSearchTracker *tracker; }; #endif diff --git a/Validation/TrackerDigis/plugins/SiStripDigiValid.cc b/Validation/TrackerDigis/plugins/SiStripDigiValid.cc index 9478462379347..d3d479c7da05e 100644 --- a/Validation/TrackerDigis/plugins/SiStripDigiValid.cc +++ b/Validation/TrackerDigis/plugins/SiStripDigiValid.cc @@ -21,7 +21,8 @@ #include "SiStripDigiValid.h" SiStripDigiValid::SiStripDigiValid(const edm::ParameterSet &ps) - : dbe_(nullptr), + : m_topoToken(esConsumes()), + dbe_(nullptr), runStandalone(ps.getParameter("runStandalone")), outputFile_(ps.getUntrackedParameter("outputFile", "stripdigihisto.root")), edmDetSetVector_SiStripDigi_Token_( @@ -325,9 +326,7 @@ void SiStripDigiValid::bookHistograms(DQMStore::IBooker &ibooker, const edm::Run void SiStripDigiValid::analyze(const edm::Event &e, const edm::EventSetup &c) { // Retrieve tracker topology from geometry - edm::ESHandle tTopoHandle; - c.get().get(tTopoHandle); - const TrackerTopology *const tTopo = tTopoHandle.product(); + const TrackerTopology *const tTopo = &c.getData(m_topoToken); int ndigilayertibzp[4]; int ndigilayertibzm[4]; @@ -363,8 +362,6 @@ void SiStripDigiValid::analyze(const edm::Event &e, const edm::EventSetup &c) { // LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << // e.id().event(); - edm::ESHandle tracker; - c.get().get(tracker); std::string digiProducer = "siStripDigis"; edm::Handle> stripDigis; diff --git a/Validation/TrackerDigis/plugins/SiStripDigiValid.h b/Validation/TrackerDigis/plugins/SiStripDigiValid.h index 5e914422d2161..ecc203ea17e4b 100644 --- a/Validation/TrackerDigis/plugins/SiStripDigiValid.h +++ b/Validation/TrackerDigis/plugins/SiStripDigiValid.h @@ -24,6 +24,7 @@ class SiStripDigiValid : public DQMEDAnalyzer { void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &es) override; private: + const edm::ESGetToken m_topoToken; // TIB ADC MonitorElement *meAdcTIBLayer1Extzp_[3]; MonitorElement *meAdcTIBLayer2Extzp_[3]; diff --git a/Validation/TrackerHits/interface/TrackerHitAnalyzer.h b/Validation/TrackerHits/interface/TrackerHitAnalyzer.h index a863923cc072b..fefb4b1ab4283 100644 --- a/Validation/TrackerHits/interface/TrackerHitAnalyzer.h +++ b/Validation/TrackerHits/interface/TrackerHitAnalyzer.h @@ -11,12 +11,15 @@ #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "SimDataFormats/Track/interface/SimTrackContainer.h" #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h" #include "DQMServices/Core/interface/DQMStore.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" + #include class TrackerHitAnalyzer : public DQMEDAnalyzer { @@ -36,6 +39,7 @@ class TrackerHitAnalyzer : public DQMEDAnalyzer { // void BookTestHistos(Char_t sname, int nbin, float *xmin, float *xmax); private: + const edm::ESGetToken tGeomEsToken_; bool verbose_; edm::EDGetTokenT edmPSimHitContainer_pxlBrlLow_Token_, edmPSimHitContainer_pxlBrlHigh_Token_; diff --git a/Validation/TrackerHits/interface/TrackerHitProducer.h b/Validation/TrackerHits/interface/TrackerHitProducer.h index 18b63edb04240..c2078aeb6ce5f 100644 --- a/Validation/TrackerHits/interface/TrackerHitProducer.h +++ b/Validation/TrackerHits/interface/TrackerHitProducer.h @@ -2,7 +2,7 @@ #define TrackerHitProducer_h // framework & common header files -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/one/EDProducer.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -18,7 +18,7 @@ namespace edm { } class PTrackerSimHit; -class TrackerHitProducer : public edm::EDProducer { +class TrackerHitProducer : public edm::one::EDProducer<> { public: typedef std::vector FloatVector; typedef std::vector IntegerVector; diff --git a/Validation/TrackerHits/src/TrackerHitAnalyzer.cc b/Validation/TrackerHits/src/TrackerHitAnalyzer.cc index 41c1f36180a81..97fdd5885b7cc 100644 --- a/Validation/TrackerHits/src/TrackerHitAnalyzer.cc +++ b/Validation/TrackerHits/src/TrackerHitAnalyzer.cc @@ -17,8 +17,6 @@ #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" // data in edm::event #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" @@ -38,7 +36,8 @@ #include TrackerHitAnalyzer::TrackerHitAnalyzer(const edm::ParameterSet &ps) - : verbose_(ps.getUntrackedParameter("Verbosity", false)), + : tGeomEsToken_(esConsumes()), + verbose_(ps.getUntrackedParameter("Verbosity", false)), edmPSimHitContainer_pxlBrlLow_Token_( consumes(ps.getParameter("PxlBrlLowSrc"))), edmPSimHitContainer_pxlBrlHigh_Token_( @@ -457,9 +456,7 @@ void TrackerHitAnalyzer::analyze(const edm::Event &e, const edm::EventSetup &c) } // Get geometry information - - edm::ESHandle tracker; - c.get().get(tracker); + const auto &tracker = &c.getData(tGeomEsToken_); int ir = -100; edm::SimTrackContainer::const_iterator itTrk; diff --git a/Validation/TrackerRecHits/interface/SiPixelRecHitsValid.h b/Validation/TrackerRecHits/interface/SiPixelRecHitsValid.h index 62e8a486f117b..6e6a9f18ea012 100644 --- a/Validation/TrackerRecHits/interface/SiPixelRecHitsValid.h +++ b/Validation/TrackerRecHits/interface/SiPixelRecHitsValid.h @@ -15,6 +15,8 @@ #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" #include "DQMServices/Core/interface/DQMStore.h" +#include "Geometry/Records/interface/TrackerTopologyRcd.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include @@ -23,6 +25,7 @@ class PSimHit; class PixelGeomDetUnit; class SiPixelRecHit; class TrackerTopology; +class TrackerGeometry; class SiPixelRecHitsValid : public DQMEDAnalyzer { public: @@ -40,6 +43,10 @@ class SiPixelRecHitsValid : public DQMEDAnalyzer { void fillBarrel(const SiPixelRecHit&, const PSimHit&, DetId, const PixelGeomDetUnit*, const TrackerTopology* tTopo); void fillForward(const SiPixelRecHit&, const PSimHit&, DetId, const PixelGeomDetUnit*, const TrackerTopology* tTopo); + // Es Tokens + const edm::ESGetToken tTopoEsToken; + const edm::ESGetToken tGeomEsToken; + //Clusters BPIX MonitorElement* clustYSizeModule[8]; MonitorElement* clustXSizeLayer[3]; diff --git a/Validation/TrackerRecHits/interface/SiStripRecHitsValid.h b/Validation/TrackerRecHits/interface/SiStripRecHitsValid.h index 1fc27374f0698..d0bae5290eff3 100644 --- a/Validation/TrackerRecHits/interface/SiStripRecHitsValid.h +++ b/Validation/TrackerRecHits/interface/SiStripRecHitsValid.h @@ -7,6 +7,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Utilities/interface/EDGetToken.h" +#include "FWCore/Framework/interface/ESWatcher.h" //only mine #include "DataFormats/Common/interface/Handle.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -34,6 +35,12 @@ #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h" #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetType.h" +// -- for es tokens +#include "CalibTracker/Records/interface/SiStripDetCablingRcd.h" +#include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "Geometry/Records/interface/TrackerTopologyRcd.h" + #include #include //For RecHit @@ -123,6 +130,12 @@ class SiStripRecHitsValid : public DQMEDAnalyzer { void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, const edm::EventSetup& es) override; private: + const edm::ESGetToken m_geomToken; + const edm::ESGetToken m_topoToken, m_topoTokenBR; + const edm::ESGetToken m_SiStripDetCablingToken; + + edm::ESWatcher watchSiStripDetCablingRcd_; + TotalMEs totalMEs; bool switchNumTotrphi; @@ -210,7 +223,6 @@ class SiStripRecHitsValid : public DQMEDAnalyzer { edm::ParameterSet conf_; TrackerHitAssociator::Config trackerHitAssociatorConfig_; - unsigned long long m_cacheID_; //const StripTopology* topol; /* static const int MAXHIT = 1000; */ diff --git a/Validation/TrackerRecHits/src/SiPixelRecHitsValid.cc b/Validation/TrackerRecHits/src/SiPixelRecHitsValid.cc index 48a80414b803d..ab1e48a8245f8 100644 --- a/Validation/TrackerRecHits/src/SiPixelRecHitsValid.cc +++ b/Validation/TrackerRecHits/src/SiPixelRecHitsValid.cc @@ -33,8 +33,6 @@ #include "Geometry/CommonDetUnit/interface/GeomDetType.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonTopologies/interface/PixelTopology.h" -#include "Geometry/Records/interface/TrackerTopologyRcd.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h" #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" @@ -46,7 +44,9 @@ #include SiPixelRecHitsValid::SiPixelRecHitsValid(const edm::ParameterSet& ps) - : trackerHitAssociatorConfig_(ps, consumesCollector()), + : tTopoEsToken(esConsumes()), + tGeomEsToken(esConsumes()), + trackerHitAssociatorConfig_(ps, consumesCollector()), siPixelRecHitCollectionToken_(consumes(ps.getParameter("src"))) {} SiPixelRecHitsValid::~SiPixelRecHitsValid() {} @@ -274,9 +274,7 @@ void SiPixelRecHitsValid::bookHistograms(DQMStore::IBooker& ibooker, const edm:: void SiPixelRecHitsValid::analyze(const edm::Event& e, const edm::EventSetup& es) { //Retrieve tracker topology from geometry - edm::ESHandle tTopoHand; - es.get().get(tTopoHand); - const TrackerTopology* tTopo = tTopoHand.product(); + const TrackerTopology* tTopo = &es.getData(tTopoEsToken); edm::LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event(); if (e.id().event() % 1000 == 0) @@ -287,21 +285,20 @@ void SiPixelRecHitsValid::analyze(const edm::Event& e, const edm::EventSetup& es e.getByToken(siPixelRecHitCollectionToken_, recHitColl); //Get event setup - edm::ESHandle geom; - es.get().get(geom); - const TrackerGeometry& theTracker(*geom); + const TrackerGeometry* theTracker = &es.getData(tGeomEsToken); TrackerHitAssociator associate(e, trackerHitAssociatorConfig_); //iterate over detunits - for (TrackerGeometry::DetContainer::const_iterator it = geom->dets().begin(); it != geom->dets().end(); it++) { - DetId detId = ((*it)->geographicalId()); + //for (TrackerGeometry::DetContainer::const_iterator it = geom->dets().begin(); it != geom->dets().end(); it++) { + for (const auto& it : theTracker->dets()) { + DetId detId = it->geographicalId(); unsigned int subid = detId.subdetId(); if (!((subid == 1) || (subid == 2))) continue; - const PixelGeomDetUnit* theGeomDet = dynamic_cast(theTracker.idToDet(detId)); + const PixelGeomDetUnit* theGeomDet = dynamic_cast(theTracker->idToDet(detId)); SiPixelRecHitCollection::const_iterator pixeldet = recHitColl->find(detId); if (pixeldet == recHitColl->end()) diff --git a/Validation/TrackerRecHits/src/SiStripRecHitsValid.cc b/Validation/TrackerRecHits/src/SiStripRecHitsValid.cc index 7e006d2258baf..d5f045867ae84 100644 --- a/Validation/TrackerRecHits/src/SiStripRecHitsValid.cc +++ b/Validation/TrackerRecHits/src/SiStripRecHitsValid.cc @@ -1,17 +1,13 @@ #include "Validation/TrackerRecHits/interface/SiStripRecHitsValid.h" //needed for the geometry: -#include "CalibTracker/Records/interface/SiStripDetCablingRcd.h" -#include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h" #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "DataFormats/TrackerCommon/interface/SiStripSubStructure.h" #include "DQM/SiStripCommon/interface/SiStripFolderOrganizer.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "DataFormats/GeometryVector/interface/LocalPoint.h" #include "DataFormats/GeometryVector/interface/GlobalPoint.h" #include "DQM/SiStripCommon/interface/SiStripHistoId.h" -#include "Geometry/Records/interface/TrackerTopologyRcd.h" //--- for RecHit #include "DataFormats/SiStripCluster/interface/SiStripCluster.h" @@ -26,9 +22,12 @@ using namespace edm; //Constructor SiStripRecHitsValid::SiStripRecHitsValid(const ParameterSet& ps) - : conf_(ps), - trackerHitAssociatorConfig_(ps, consumesCollector()), - m_cacheID_(0) + : m_geomToken(esConsumes()), + m_topoToken(esConsumes()), + m_topoTokenBR(esConsumes()), + m_SiStripDetCablingToken(esConsumes()), + conf_(ps), + trackerHitAssociatorConfig_(ps, consumesCollector()) // matchedRecHits_( ps.getParameter("matchedRecHits") ), // rphiRecHits_( ps.getParameter("rphiRecHits") ), // stereoRecHits_( ps.getParameter("stereoRecHits") ) @@ -162,9 +161,7 @@ SiStripRecHitsValid::~SiStripRecHitsValid() {} //-------------------------------------------------------------------------------------------- void SiStripRecHitsValid::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, const edm::EventSetup& es) { - unsigned long long cacheID = es.get().cacheIdentifier(); - if (m_cacheID_ != cacheID) { - m_cacheID_ = cacheID; + if (watchSiStripDetCablingRcd_.check(es)) { edm::LogInfo("SiStripRecHitsValid") << "SiStripRecHitsValid::beginRun: " << " Creating MEs for new Cabling "; @@ -176,9 +173,7 @@ void SiStripRecHitsValid::analyze(const edm::Event& e, const edm::EventSetup& es LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event(); //Retrieve tracker topology from geometry - edm::ESHandle tTopoHandle; - es.get().get(tTopoHandle); - const TrackerTopology* const tTopo = tTopoHandle.product(); + const TrackerTopology* const tTopo = &es.getData(m_topoToken); // Step A: Get Inputs edm::Handle rechitsmatched; @@ -198,9 +193,7 @@ void SiStripRecHitsValid::analyze(const edm::Event& e, const edm::EventSetup& es TrackerHitAssociator associate(e, trackerHitAssociatorConfig_); - edm::ESHandle pDD; - es.get().get(pDD); - const TrackerGeometry& tracker(*pDD); + const TrackerGeometry& tracker = es.getData(m_geomToken); SiStripHistoId hidmanager; SiStripFolderOrganizer fold_organ; @@ -406,6 +399,10 @@ void SiStripRecHitsValid::rechitanalysis(SiStripRecHit2D const rechit, closest = &m; } } + + if (!closest) + return; + rechitpro.bunch = closest->eventId().bunchCrossing(); rechitpro.event = closest->eventId().event(); rechitpro.resx = rechitpro.x - closest->localPosition().x(); @@ -516,12 +513,10 @@ void SiStripRecHitsValid::rechitanalysis_matched(SiStripMatchedRecHit2D const re //-------------------------------------------------------------------------------------------- void SiStripRecHitsValid::createMEs(DQMStore::IBooker& ibooker, const edm::EventSetup& es) { //Retrieve tracker topology from geometry - edm::ESHandle tTopoHandle; - es.get().get(tTopoHandle); - const TrackerTopology* const tTopo = tTopoHandle.product(); + const TrackerTopology* const tTopo = &es.getData(m_topoTokenBR); // take from eventSetup the SiStripDetCabling object - here will use SiStripDetControl later on - es.get().get(SiStripDetCabling_); + const auto& SiStripDetCabling_ = &es.getData(m_SiStripDetCablingToken); // get list of active detectors from SiStripDetCabling std::vector activeDets;