diff --git a/L1Trigger/L1TMuon/plugins/L1TMicroGMTLUTDumper.cc b/L1Trigger/L1TMuon/plugins/L1TMicroGMTLUTDumper.cc index fd51dbba8691b..21b4573ec0d81 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMicroGMTLUTDumper.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMicroGMTLUTDumper.cc @@ -92,6 +92,7 @@ class L1TMicroGMTLUTDumper : public edm::one::EDAnalyzer { std::shared_ptr m_ovlNegSingleMatchQualLUT; std::shared_ptr m_fwdPosSingleMatchQualLUT; std::shared_ptr m_fwdNegSingleMatchQualLUT; + edm::ESGetToken m_microGMTParamsToken; }; // @@ -108,6 +109,7 @@ class L1TMicroGMTLUTDumper : public edm::one::EDAnalyzer { L1TMicroGMTLUTDumper::L1TMicroGMTLUTDumper(const edm::ParameterSet& iConfig) { //now do what ever other initialization is needed m_foldername = iConfig.getParameter("out_directory"); + m_microGMTParamsToken = esConsumes(); microGMTParamsHelper = std::make_unique(); } @@ -153,9 +155,7 @@ void L1TMicroGMTLUTDumper::analyze(const edm::Event& iEvent, const edm::EventSet // ------------ method called when starting to processes a run ------------ void L1TMicroGMTLUTDumper::beginRun(edm::Run const& run, edm::EventSetup const& iSetup) { - const L1TMuonGlobalParamsRcd& microGMTParamsRcd = iSetup.get(); - edm::ESHandle microGMTParamsHandle; - microGMTParamsRcd.get(microGMTParamsHandle); + edm::ESHandle microGMTParamsHandle = iSetup.getHandle(m_microGMTParamsToken); microGMTParamsHelper = std::make_unique(*microGMTParamsHandle.product()); if (!microGMTParamsHelper) { diff --git a/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc b/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc index 989c5a3b11444..66dd43986213f 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc @@ -23,7 +23,6 @@ // user include files #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/ESProducer.h" -#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/ESProducts.h" #include "CondFormats/L1TObjects/interface/L1TMuonGlobalParams.h" diff --git a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc index 775b4cc15b954..580e3b4c0e557 100644 --- a/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc +++ b/L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc @@ -31,6 +31,7 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/ESGetToken.h" #include "L1Trigger/L1TMuon/interface/MicroGMTConfiguration.h" #include "L1Trigger/L1TMuon/interface/MicroGMTRankPtQualLUT.h" @@ -124,6 +125,8 @@ class L1TMuonProducer : public edm::stream::EDProducer<> { edm::EDGetTokenT m_overlapTfInputToken; edm::EDGetTokenT m_endcapTfInputToken; edm::EDGetTokenT m_caloTowerInputToken; + edm::ESGetToken m_microGMTParamsToken; + edm::ESGetToken m_o2oProtoToken; }; // @@ -161,6 +164,8 @@ L1TMuonProducer::L1TMuonProducer(const edm::ParameterSet& iConfig) m_overlapTfInputToken = consumes(m_overlapTfInputTag); m_endcapTfInputToken = consumes(m_endcapTfInputTag); m_caloTowerInputToken = consumes(m_trigTowerTag); + m_microGMTParamsToken = esConsumes(); + m_o2oProtoToken = esConsumes(); //register your products produces(); @@ -524,15 +529,12 @@ void L1TMuonProducer::convertMuons(const edm::Handle(); - edm::ESHandle microGMTParamsHandle; - microGMTParamsRcd.get(microGMTParamsHandle); + edm::ESHandle microGMTParamsHandle = iSetup.getHandle(m_microGMTParamsToken); std::unique_ptr microGMTParams( new L1TMuonGlobalParams_PUBLIC(cast_to_L1TMuonGlobalParams_PUBLIC(*microGMTParamsHandle.product()))); if (microGMTParams->pnodes_.empty()) { - edm::ESHandle o2oProtoHandle; - iSetup.get().get(o2oProtoHandle); + edm::ESHandle o2oProtoHandle = iSetup.getHandle(m_o2oProtoToken); microGMTParamsHelper = std::unique_ptr(new L1TMuonGlobalParamsHelper(*o2oProtoHandle.product())); } else