diff --git a/DQM/BeamMonitor/plugins/BeamConditionsMonitor.cc b/DQM/BeamMonitor/plugins/BeamConditionsMonitor.cc index 0c2890c1fa565..5862923b8cf21 100644 --- a/DQM/BeamMonitor/plugins/BeamConditionsMonitor.cc +++ b/DQM/BeamMonitor/plugins/BeamConditionsMonitor.cc @@ -29,7 +29,7 @@ BeamConditionsMonitor::BeamConditionsMonitor(const ParameterSet& ps) : countEvt_ monitorName_ = parameters_.getUntrackedParameter("monitorName", "YourSubsystemName"); bsSrc_ = parameters_.getUntrackedParameter("beamSpot"); debug_ = parameters_.getUntrackedParameter("Debug"); - + beamSpotToken_ = esConsumes(); dbe_ = Service().operator->(); if (!monitorName_.empty()) @@ -66,9 +66,7 @@ void BeamConditionsMonitor::beginLuminosityBlock(const LuminosityBlock& lumiSeg, // ---------------------------------------------------------- void BeamConditionsMonitor::analyze(const Event& iEvent, const EventSetup& iSetup) { countEvt_++; - ESHandle beamhandle; - iSetup.get().get(beamhandle); - condBeamSpot = *beamhandle; + condBeamSpot = iSetup.getData(beamSpotToken_); } //-------------------------------------------------------- diff --git a/DQM/BeamMonitor/plugins/BeamConditionsMonitor.h b/DQM/BeamMonitor/plugins/BeamConditionsMonitor.h index 421eb740f7a88..c6277331a6212 100644 --- a/DQM/BeamMonitor/plugins/BeamConditionsMonitor.h +++ b/DQM/BeamMonitor/plugins/BeamConditionsMonitor.h @@ -22,7 +22,7 @@ // // class declaration // - +class BeamSpotObjectsRcd; class BeamConditionsMonitor : public edm::EDAnalyzer { public: BeamConditionsMonitor(const edm::ParameterSet&); @@ -56,6 +56,7 @@ class BeamConditionsMonitor : public edm::EDAnalyzer { edm::ParameterSet parameters_; std::string monitorName_; edm::InputTag bsSrc_; // beam spot + edm::ESGetToken beamSpotToken_; bool debug_; DQMStore* dbe_; diff --git a/DQM/Physics/src/ExoticaDQM.cc b/DQM/Physics/src/ExoticaDQM.cc index e9780a6281ee3..eaccd7e05f576 100644 --- a/DQM/Physics/src/ExoticaDQM.cc +++ b/DQM/Physics/src/ExoticaDQM.cc @@ -57,6 +57,7 @@ ExoticaDQM::ExoticaDQM(const edm::ParameterSet& ps) { JetCorrectorToken_ = consumes(ps.getParameter("jetCorrector")); + magFieldToken_ = esConsumes(); //Cuts - MultiJets jetID = new reco::helper::JetIDHelper(ps.getParameter("JetIDParams"), consumesCollector()); @@ -797,14 +798,13 @@ GlobalVector ExoticaDQM::getGenParticleTrajectoryAtBeamline(const edm::EventSetu //=== approach to the beam-line. // Get the magnetic field - edm::ESHandle theMagField; - iSetup.get().get(theMagField); + const MagneticField* theMagField = &iSetup.getData(magFieldToken_); // Make FreeTrajectoryState of this gen particle FreeTrajectoryState fts(GlobalPoint(gen->vx(), gen->vy(), gen->vz()), GlobalVector(gen->px(), gen->py(), gen->pz()), gen->charge(), - theMagField.product()); + theMagField); // Get trajectory closest to beam line TSCBLBuilderNoMaterial tscblBuilder; diff --git a/DQM/Physics/src/ExoticaDQM.h b/DQM/Physics/src/ExoticaDQM.h index 8950afe955d3a..462035d37fe66 100644 --- a/DQM/Physics/src/ExoticaDQM.h +++ b/DQM/Physics/src/ExoticaDQM.h @@ -195,6 +195,9 @@ class ExoticaDQM : public DQMEDAnalyzer { edm::EDGetTokenT GenParticleToken_; edm::Handle GenCollection_; + //ES tokens + edm::ESGetToken magFieldToken_; + /////////////////////////// // Parameters /////////////////////////// diff --git a/DQM/Physics/src/QcdLowPtDQM.cc b/DQM/Physics/src/QcdLowPtDQM.cc index d883de11df519..cdc9960e86b38 100644 --- a/DQM/Physics/src/QcdLowPtDQM.cc +++ b/DQM/Physics/src/QcdLowPtDQM.cc @@ -45,7 +45,9 @@ bool compareTracklets(const QcdLowPtDQM::Tracklet &a, const QcdLowPtDQM::Trackle //-------------------------------------------------------------------------------------------------- QcdLowPtDQM::QcdLowPtDQM(const ParameterSet ¶meters) - : hltResName_(parameters.getUntrackedParameter("hltTrgResults", "TriggerResults")), + : tkGeomToken_(esConsumes()), + tTopoToken_(esConsumes()), + hltResName_(parameters.getUntrackedParameter("hltTrgResults", "TriggerResults")), pixelName_(parameters.getUntrackedParameter("pixelRecHits", "siPixelRecHits")), clusterVtxName_(parameters.getUntrackedParameter("clusterVertices", "")), ZVCut_(parameters.getUntrackedParameter("ZVertexCut", 10)), @@ -690,9 +692,7 @@ void QcdLowPtDQM::analyze(const Event &iEvent, const EventSetup &iSetup) { // Analyze the given event. // get tracker geometry - ESHandle trackerHandle; - iSetup.get().get(trackerHandle); - tgeo_ = trackerHandle.product(); + tgeo_ = &iSetup.getData(tkGeomToken_); if (!tgeo_) { print(3, "QcdLowPtDQM::analyze -- Could not obtain pointer to " @@ -1058,9 +1058,7 @@ void QcdLowPtDQM::fillPixels(const Event &iEvent, const edm::EventSetup &iSetup) } // Retrieve tracker topology from geometry - edm::ESHandle tTopoHandle; - iSetup.get().get(tTopoHandle); - const TrackerTopology *const tTopo = tTopoHandle.product(); + const TrackerTopology *const tTopo = &iSetup.getData(tTopoToken_); const SiPixelRecHitCollection *hits = hRecHits.product(); for (SiPixelRecHitCollection::DataContainer::const_iterator hit = hits->data().begin(), end = hits->data().end(); diff --git a/DQM/Physics/src/QcdLowPtDQM.h b/DQM/Physics/src/QcdLowPtDQM.h index 3e4de8f305d6d..c3eb651799980 100644 --- a/DQM/Physics/src/QcdLowPtDQM.h +++ b/DQM/Physics/src/QcdLowPtDQM.h @@ -15,6 +15,9 @@ #include class TrackerGeometry; +class TrackerDigiGeometryRecord; +class TrackerTopology; +class TrackerTopologyRcd; class TH1F; class TH2F; class TH3F; @@ -217,6 +220,8 @@ class QcdLowPtDQM : public DQMOneEDAnalyzer &pix) const; void yieldAlphaHistogram(int which = 12); + edm::ESGetToken tkGeomToken_; + edm::ESGetToken tTopoToken_; std::string hltResName_; // HLT trigger results name std::vector hltProcNames_; // HLT process name(s) std::vector hltTrgNames_; // HLT trigger name(s) diff --git a/DQM/PhysicsObjectsMonitoring/interface/PhysicsObjectsMonitor.h b/DQM/PhysicsObjectsMonitoring/interface/PhysicsObjectsMonitor.h index 765464b93c5ba..cc4c186bfd107 100644 --- a/DQM/PhysicsObjectsMonitoring/interface/PhysicsObjectsMonitor.h +++ b/DQM/PhysicsObjectsMonitoring/interface/PhysicsObjectsMonitor.h @@ -26,6 +26,8 @@ namespace edm { class TFile; class TH1F; class TH2F; +class MagneticField; +class IdealMagneticFieldRecord; class PhysicsObjectsMonitor : public DQMEDAnalyzer { public: @@ -65,5 +67,6 @@ class PhysicsObjectsMonitor : public DQMEDAnalyzer { // define Token(-s) edm::EDGetTokenT theSTAMuonToken_; + edm::ESGetToken magFiledToken_; }; #endif diff --git a/DQM/PhysicsObjectsMonitoring/src/PhysicsObjectsMonitor.cc b/DQM/PhysicsObjectsMonitoring/src/PhysicsObjectsMonitor.cc index 76736ee48da66..a7ea87f50bf92 100644 --- a/DQM/PhysicsObjectsMonitoring/src/PhysicsObjectsMonitor.cc +++ b/DQM/PhysicsObjectsMonitoring/src/PhysicsObjectsMonitor.cc @@ -32,7 +32,7 @@ PhysicsObjectsMonitor::PhysicsObjectsMonitor(const ParameterSet &pset) { theSTAMuonLabel = pset.getUntrackedParameter("StandAloneTrackCollectionLabel"); theSeedCollectionLabel = pset.getUntrackedParameter("MuonSeedCollectionLabel"); theDataType = pset.getUntrackedParameter("DataType"); - + magFiledToken_ = esConsumes(); if (theDataType != "RealData" && theDataType != "SimData") edm::LogInfo("PhysicsObjectsMonitor") << "Error in Data Type!!" << endl; @@ -80,8 +80,7 @@ void PhysicsObjectsMonitor::analyze(const Event &event, const EventSetup &eventS Handle staTracks; event.getByToken(theSTAMuonToken_, staTracks); - ESHandle theMGField; - eventSetup.get().get(theMGField); + const auto &theMGField = eventSetup.getHandle(magFiledToken_); double recPt = 0.; double simPt = 0.; diff --git a/DQM/PixelLumi/plugins/PixelLumiDQM.cc b/DQM/PixelLumi/plugins/PixelLumiDQM.cc index 5b6ca2cc9a298..6ce7046875a7e 100644 --- a/DQM/PixelLumi/plugins/PixelLumiDQM.cc +++ b/DQM/PixelLumi/plugins/PixelLumiDQM.cc @@ -47,6 +47,7 @@ const unsigned int PixelLumiDQM::lastBunchCrossing; PixelLumiDQM::PixelLumiDQM(const edm::ParameterSet &iConfig) : fPixelClusterLabel(consumes>( iConfig.getUntrackedParameter("pixelClusterLabel", edm::InputTag("siPixelClusters")))), + tkGeomToken_(esConsumes()), fIncludePixelClusterInfo(iConfig.getUntrackedParameter("includePixelClusterInfo", true)), fIncludePixelQualCheckHistos(iConfig.getUntrackedParameter("includePixelQualCheckHistos", true)), fResetIntervalInLumiSections(iConfig.getUntrackedParameter("resetEveryNLumiSections", 1)), @@ -98,12 +99,9 @@ void PixelLumiDQM::analyze(const edm::Event &iEvent, const edm::EventSetup &iSet std::map::iterator it = fNumPixelClusters.find(fBXNo); if (it == fNumPixelClusters.end()) fNumPixelClusters[fBXNo] = PixelClusterCount(); - + // Find tracker geometry. + const TrackerGeometry *trackerGeo = &iSetup.getData(tkGeomToken_); if (fIncludePixelClusterInfo) { - // Find tracker geometry. - edm::ESHandle trackerGeo; - iSetup.get().get(trackerGeo); - // Find pixel clusters. edm::Handle> pixelClusters; iEvent.getByToken(fPixelClusterLabel, pixelClusters); @@ -170,10 +168,6 @@ void PixelLumiDQM::analyze(const edm::Event &iEvent, const edm::EventSetup &iSet // Fill some pixel cluster quality check histograms if requested. if (fIncludePixelQualCheckHistos) { - // Find tracker geometry. - edm::ESHandle trackerGeo; - iSetup.get().get(trackerGeo); - // Find pixel clusters. edm::Handle> pixelClusters; iEvent.getByToken(fPixelClusterLabel, pixelClusters); diff --git a/DQM/PixelLumi/plugins/PixelLumiDQM.h b/DQM/PixelLumi/plugins/PixelLumiDQM.h index 092420ea40b28..37e8e6649ed5c 100644 --- a/DQM/PixelLumi/plugins/PixelLumiDQM.h +++ b/DQM/PixelLumi/plugins/PixelLumiDQM.h @@ -36,7 +36,8 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" class ConfigurationDescriptions; - +class TrackerGeometry; +class TrackerDigiGeometryRecord; class PixelLumiDQM : public DQMOneEDAnalyzer { public: explicit PixelLumiDQM(const edm::ParameterSet &); @@ -112,6 +113,7 @@ class PixelLumiDQM : public DQMOneEDAnalyzer { }; edm::EDGetTokenT> fPixelClusterLabel; + edm::ESGetToken tkGeomToken_; UInt_t fRunNo; UInt_t fEvtNo; diff --git a/DQMOffline/JetMET/interface/BeamHaloAnalyzer.h b/DQMOffline/JetMET/interface/BeamHaloAnalyzer.h index 042dc4116d616..950ea0b880896 100644 --- a/DQMOffline/JetMET/interface/BeamHaloAnalyzer.h +++ b/DQMOffline/JetMET/interface/BeamHaloAnalyzer.h @@ -134,8 +134,6 @@ #include "TLegend.h" //Standard C++ classes -#include -#include #include #include #include @@ -186,9 +184,10 @@ class BeamHaloAnalyzer : public DQMEDAnalyzer { edm::EDGetTokenT IT_HcalHaloData; edm::EDGetTokenT IT_GlobalHaloData; edm::EDGetTokenT IT_BeamHaloSummary; - edm::EDGetTokenT IT_CSCTimeMapToken; + edm::ESGetToken cscGeomToken_; + //Output File std::string OutputFileName; std::string TextFileName; diff --git a/DQMOffline/JetMET/interface/ECALRecHitAnalyzer.h b/DQMOffline/JetMET/interface/ECALRecHitAnalyzer.h index 4c20807b334cd..dcb05dee360b2 100644 --- a/DQMOffline/JetMET/interface/ECALRecHitAnalyzer.h +++ b/DQMOffline/JetMET/interface/ECALRecHitAnalyzer.h @@ -68,6 +68,7 @@ class DetId; //class HcalTopology; class CaloGeometry; class CaloSubdetectorGeometry; +class CaloGeometryRecord; //class CaloTowerConstituentsMap; //class CaloRecHit; @@ -92,7 +93,8 @@ class ECALRecHitAnalyzer : public DQMEDAnalyzer { // Inputs from Configuration edm::EDGetTokenT EBRecHitsLabel_; edm::EDGetTokenT EERecHitsLabel_; - + edm::ESGetToken caloGeomToken_; + const CaloGeometry* caloGeom_; bool debug_; bool finebinning_; std::string FolderName_; diff --git a/DQMOffline/JetMET/interface/HCALRecHitAnalyzer.h b/DQMOffline/JetMET/interface/HCALRecHitAnalyzer.h index 42e48a1050235..46bab115a303d 100644 --- a/DQMOffline/JetMET/interface/HCALRecHitAnalyzer.h +++ b/DQMOffline/JetMET/interface/HCALRecHitAnalyzer.h @@ -21,7 +21,8 @@ #include #include - +class CaloGeometry; +class CaloGeometryRecord; class HCALRecHitAnalyzer : public DQMEDAnalyzer { public: explicit HCALRecHitAnalyzer(const edm::ParameterSet&); @@ -37,6 +38,7 @@ class HCALRecHitAnalyzer : public DQMEDAnalyzer { edm::EDGetTokenT hBHERecHitsLabel_; edm::EDGetTokenT hFRecHitsLabel_; edm::EDGetTokenT hORecHitsLabel_; + edm::ESGetToken caloGeomToken_; bool debug_; bool finebinning_; std::string FolderName_; diff --git a/DQMOffline/JetMET/interface/JetAnalyzer.h b/DQMOffline/JetMET/interface/JetAnalyzer.h index 2d2603b5d320d..bdd51534ec89c 100644 --- a/DQMOffline/JetMET/interface/JetAnalyzer.h +++ b/DQMOffline/JetMET/interface/JetAnalyzer.h @@ -131,6 +131,7 @@ class JetAnalyzer : public DQMEDAnalyzer { edm::InputTag inputJetIDValueMap; edm::EDGetTokenT> jetID_ValueMapToken_; + edm::ESGetToken l1gtTrigMenuToken_; //Cleaning parameters edm::ParameterSet cleaningParameters_; diff --git a/DQMOffline/JetMET/interface/METAnalyzer.h b/DQMOffline/JetMET/interface/METAnalyzer.h index b441182326764..f930b98a54ce9 100644 --- a/DQMOffline/JetMET/interface/METAnalyzer.h +++ b/DQMOffline/JetMET/interface/METAnalyzer.h @@ -201,6 +201,8 @@ class METAnalyzer : public DQMOneEDAnalyzer<> { edm::InputTag inputJetIDValueMap; edm::EDGetTokenT> jetID_ValueMapToken_; + edm::ESGetToken l1gtTrigMenuToken_; + JetIDSelectionFunctor jetIDFunctorLoose; PFJetIDSelectionFunctor pfjetIDFunctorLoose; diff --git a/DQMOffline/JetMET/src/BeamHaloAnalyzer.cc b/DQMOffline/JetMET/src/BeamHaloAnalyzer.cc index 8f8ff9a01aee5..658ae913b5573 100644 --- a/DQMOffline/JetMET/src/BeamHaloAnalyzer.cc +++ b/DQMOffline/JetMET/src/BeamHaloAnalyzer.cc @@ -1,6 +1,5 @@ #include "DQMOffline/JetMET/interface/BeamHaloAnalyzer.h" #include "FWCore/ServiceRegistry/interface/Service.h" - //author : Ronny Remington, University of Florida //date : 11/11/09 @@ -61,6 +60,8 @@ BeamHaloAnalyzer::BeamHaloAnalyzer(const edm::ParameterSet& iConfig) { IT_GlobalHaloData = consumes(iConfig.getParameter("GlobalHaloDataLabel")); IT_BeamHaloSummary = consumes(iConfig.getParameter("BeamHaloSummaryLabel")); + cscGeomToken_ = esConsumes(); + edm::InputTag CosmicSAMuonLabel = iConfig.getParameter("CosmicStandAloneMuonLabel"); IT_CSCTimeMapToken = consumes(edm::InputTag(CosmicSAMuonLabel.label(), std::string("csc"))); FolderName = iConfig.getParameter("folderName"); @@ -326,13 +327,8 @@ void BeamHaloAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& edm::RunNumber_t Run = iEvent.run(); //Get CSC Geometry - edm::ESHandle TheCSCGeometry; - iSetup.get().get(TheCSCGeometry); - - //Get CaloGeometry - edm::ESHandle TheCaloGeometry; - iSetup.get().get(TheCaloGeometry); - + const auto& TheCSCGeometry = iSetup.getHandle(cscGeomToken_); + //Note - removed getting calogeometry since it was unused //Get Stand-alone Muons from Cosmic Muon Reconstruction edm::Handle TheCosmics; iEvent.getByToken(IT_CosmicStandAloneMuon, TheCosmics); diff --git a/DQMOffline/JetMET/src/ECALRecHitAnalyzer.cc b/DQMOffline/JetMET/src/ECALRecHitAnalyzer.cc index 22dc05fbb8068..c8a01f1bf5d84 100644 --- a/DQMOffline/JetMET/src/ECALRecHitAnalyzer.cc +++ b/DQMOffline/JetMET/src/ECALRecHitAnalyzer.cc @@ -16,6 +16,7 @@ ECALRecHitAnalyzer::ECALRecHitAnalyzer(const edm::ParameterSet& iConfig) { // Retrieve Information from the Configuration File EBRecHitsLabel_ = consumes(iConfig.getParameter("EBRecHitsLabel")); EERecHitsLabel_ = consumes(iConfig.getParameter("EERecHitsLabel")); + caloGeomToken_ = esConsumes(); FolderName_ = iConfig.getUntrackedParameter("FolderName"); debug_ = iConfig.getParameter("Debug"); // EBRecHitsLabel_= consumes(edm::InputTag(EBRecHitsLabel_)); @@ -24,6 +25,7 @@ ECALRecHitAnalyzer::ECALRecHitAnalyzer(const edm::ParameterSet& iConfig) { void ECALRecHitAnalyzer::dqmbeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { CurrentEvent = -1; + caloGeom_ = &iSetup.getData(caloGeomToken_); // Fill the geometry histograms FillGeometry(iSetup); } @@ -196,13 +198,9 @@ void ECALRecHitAnalyzer::bookHistograms(DQMStore::IBooker& ibooker, edm::Run con void ECALRecHitAnalyzer::FillGeometry(const edm::EventSetup& iSetup) { // Fill geometry histograms using namespace edm; - //int b=0; - edm::ESHandle pG; - iSetup.get().get(pG); - const CaloGeometry cG = *pG; - + //const auto& cG = iSetup.getData(caloGeomToken_); //----Fill Ecal Barrel----// - const CaloSubdetectorGeometry* EBgeom = cG.getSubdetectorGeometry(DetId::Ecal, 1); + const CaloSubdetectorGeometry* EBgeom = caloGeom_->getSubdetectorGeometry(DetId::Ecal, 1); int n = 0; std::vector EBids = EBgeom->getValidDetIds(DetId::Ecal, 1); for (std::vector::iterator i = EBids.begin(); i != EBids.end(); i++) { @@ -225,7 +223,7 @@ void ECALRecHitAnalyzer::FillGeometry(const edm::EventSetup& iSetup) { DEBUG(" "); } //----Fill Ecal Endcap----------// - const CaloSubdetectorGeometry* EEgeom = cG.getSubdetectorGeometry(DetId::Ecal, 2); + const CaloSubdetectorGeometry* EEgeom = caloGeom_->getSubdetectorGeometry(DetId::Ecal, 2); n = 0; std::vector EEids = EEgeom->getValidDetIds(DetId::Ecal, 2); for (std::vector::iterator i = EEids.begin(); i != EEids.end(); i++) { @@ -308,9 +306,6 @@ void ECALRecHitAnalyzer::WriteECALRecHits(const edm::Event& iEvent, const edm::E iEvent.getByToken(EERecHitsLabel_, EERecHits); DEBUG("Got ECALRecHits"); - edm::ESHandle pG; - iSetup.get().get(pG); - const CaloGeometry cG = *pG; //const CaloSubdetectorGeometry* EBgeom=cG.getSubdetectorGeometry(DetId::Ecal,1); //const CaloSubdetectorGeometry* EEgeom=cG.getSubdetectorGeometry(DetId::Ecal,2); DEBUG("Got Geometry"); diff --git a/DQMOffline/JetMET/src/HCALRecHitAnalyzer.cc b/DQMOffline/JetMET/src/HCALRecHitAnalyzer.cc index 65af300bab8e1..a8152bb65f0c9 100644 --- a/DQMOffline/JetMET/src/HCALRecHitAnalyzer.cc +++ b/DQMOffline/JetMET/src/HCALRecHitAnalyzer.cc @@ -54,7 +54,7 @@ HCALRecHitAnalyzer::HCALRecHitAnalyzer(const edm::ParameterSet& iConfig) { hBHERecHitsLabel_ = consumes(iConfig.getParameter("HBHERecHitsLabel")); hORecHitsLabel_ = consumes(iConfig.getParameter("HORecHitsLabel")); hFRecHitsLabel_ = consumes(iConfig.getParameter("HFRecHitsLabel")); - + caloGeomToken_ = esConsumes(); debug_ = iConfig.getParameter("Debug"); finebinning_ = iConfig.getUntrackedParameter("FineBinning"); FolderName_ = iConfig.getUntrackedParameter("FolderName"); @@ -239,8 +239,7 @@ void HCALRecHitAnalyzer::FillGeometry(const edm::EventSetup& iSetup) { // Retrieve! // ========================================================== - edm::ESHandle pG; - iSetup.get().get(pG); + const auto& pG = iSetup.getHandle(caloGeomToken_); if (!pG.isValid()) { edm::LogInfo("OutputInfo") << "Failed to retrieve an Event Setup Handle, Aborting Task " diff --git a/DQMOffline/JetMET/src/JetAnalyzer.cc b/DQMOffline/JetMET/src/JetAnalyzer.cc index 5f7442e4247d6..a548f8aaa1eea 100644 --- a/DQMOffline/JetMET/src/JetAnalyzer.cc +++ b/DQMOffline/JetMET/src/JetAnalyzer.cc @@ -260,6 +260,8 @@ JetAnalyzer::JetAnalyzer(const edm::ParameterSet& pSet) ptThresholdUnc_ = parameters_.getParameter("ptThresholdUnc"); asymmetryThirdJetCut_ = parameters_.getParameter("asymmetryThirdJetCut"); balanceThirdJetCut_ = parameters_.getParameter("balanceThirdJetCut"); + + l1gtTrigMenuToken_ = esConsumes(); } // *********************************************************** @@ -2233,9 +2235,7 @@ void JetAnalyzer::dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetu } } - edm::ESHandle menuRcd; - iSetup.get().get(menuRcd); - const L1GtTriggerMenu* menu = menuRcd.product(); + const L1GtTriggerMenu* menu = &iSetup.getData(l1gtTrigMenuToken_); for (CItAlgo techTrig = menu->gtTechnicalTriggerMap().begin(); techTrig != menu->gtTechnicalTriggerMap().end(); ++techTrig) { if ((techTrig->second).algoName() == m_l1algoname_) { diff --git a/DQMOffline/JetMET/src/METAnalyzer.cc b/DQMOffline/JetMET/src/METAnalyzer.cc index 4834e6345a51a..32688cb35a317 100644 --- a/DQMOffline/JetMET/src/METAnalyzer.cc +++ b/DQMOffline/JetMET/src/METAnalyzer.cc @@ -181,6 +181,8 @@ METAnalyzer::METAnalyzer(const edm::ParameterSet& pSet) { verbose_ = parameters.getParameter("verbose"); FolderName_ = parameters.getUntrackedParameter("FolderName"); + + l1gtTrigMenuToken_ = esConsumes(); } // *********************************************************** @@ -1178,9 +1180,7 @@ void METAnalyzer::bookMonitorElement(std::string DirName, // *********************************************************** void METAnalyzer::dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { - edm::ESHandle menuRcd; - iSetup.get().get(menuRcd); - const L1GtTriggerMenu* menu = menuRcd.product(); + const L1GtTriggerMenu* menu = &iSetup.getData(l1gtTrigMenuToken_); for (CItAlgo techTrig = menu->gtTechnicalTriggerMap().begin(); techTrig != menu->gtTechnicalTriggerMap().end(); ++techTrig) { if ((techTrig->second).algoName() == m_l1algoname_) {