Skip to content

Commit

Permalink
Merge pull request #30431 from JamminJones/fixL1TriggerL1TMuon
Browse files Browse the repository at this point in the history
added esConsumes to modules in L1Trigger/L1TMuon
  • Loading branch information
cmsbuild authored Jul 7, 2020
2 parents cca619b + e0efad4 commit e2b8f25
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions L1Trigger/L1TMuon/plugins/L1TMicroGMTLUTDumper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class L1TMicroGMTLUTDumper : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
std::shared_ptr<MicroGMTMatchQualLUT> m_ovlNegSingleMatchQualLUT;
std::shared_ptr<MicroGMTMatchQualLUT> m_fwdPosSingleMatchQualLUT;
std::shared_ptr<MicroGMTMatchQualLUT> m_fwdNegSingleMatchQualLUT;
edm::ESGetToken<L1TMuonGlobalParams, L1TMuonGlobalParamsRcd> m_microGMTParamsToken;
};

//
Expand All @@ -108,6 +109,7 @@ class L1TMicroGMTLUTDumper : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
L1TMicroGMTLUTDumper::L1TMicroGMTLUTDumper(const edm::ParameterSet& iConfig) {
//now do what ever other initialization is needed
m_foldername = iConfig.getParameter<std::string>("out_directory");
m_microGMTParamsToken = esConsumes<L1TMuonGlobalParams, L1TMuonGlobalParamsRcd, edm::Transition::BeginRun>();

microGMTParamsHelper = std::make_unique<L1TMuonGlobalParamsHelper>();
}
Expand Down Expand Up @@ -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<L1TMuonGlobalParamsRcd>();
edm::ESHandle<L1TMuonGlobalParams> microGMTParamsHandle;
microGMTParamsRcd.get(microGMTParamsHandle);
edm::ESHandle<L1TMuonGlobalParams> microGMTParamsHandle = iSetup.getHandle(m_microGMTParamsToken);

microGMTParamsHelper = std::make_unique<L1TMuonGlobalParamsHelper>(*microGMTParamsHandle.product());
if (!microGMTParamsHelper) {
Expand Down
1 change: 0 additions & 1 deletion L1Trigger/L1TMuon/plugins/L1TMuonGlobalParamsESProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 7 additions & 5 deletions L1Trigger/L1TMuon/plugins/L1TMuonProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -124,6 +125,8 @@ class L1TMuonProducer : public edm::stream::EDProducer<> {
edm::EDGetTokenT<MicroGMTConfiguration::InputCollection> m_overlapTfInputToken;
edm::EDGetTokenT<MicroGMTConfiguration::InputCollection> m_endcapTfInputToken;
edm::EDGetTokenT<MicroGMTConfiguration::CaloInputCollection> m_caloTowerInputToken;
edm::ESGetToken<L1TMuonGlobalParams, L1TMuonGlobalParamsRcd> m_microGMTParamsToken;
edm::ESGetToken<L1TMuonGlobalParams, L1TMuonGlobalParamsO2ORcd> m_o2oProtoToken;
};

//
Expand Down Expand Up @@ -161,6 +164,8 @@ L1TMuonProducer::L1TMuonProducer(const edm::ParameterSet& iConfig)
m_overlapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_overlapTfInputTag);
m_endcapTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(m_endcapTfInputTag);
m_caloTowerInputToken = consumes<MicroGMTConfiguration::CaloInputCollection>(m_trigTowerTag);
m_microGMTParamsToken = esConsumes<L1TMuonGlobalParams, L1TMuonGlobalParamsRcd, edm::Transition::BeginRun>();
m_o2oProtoToken = esConsumes<L1TMuonGlobalParams, L1TMuonGlobalParamsO2ORcd, edm::Transition::BeginRun>();

//register your products
produces<MuonBxCollection>();
Expand Down Expand Up @@ -524,15 +529,12 @@ void L1TMuonProducer::convertMuons(const edm::Handle<MicroGMTConfiguration::Inpu

// ------------ method called when starting to processes a run ------------
void L1TMuonProducer::beginRun(edm::Run const& run, edm::EventSetup const& iSetup) {
const L1TMuonGlobalParamsRcd& microGMTParamsRcd = iSetup.get<L1TMuonGlobalParamsRcd>();
edm::ESHandle<L1TMuonGlobalParams> microGMTParamsHandle;
microGMTParamsRcd.get(microGMTParamsHandle);
edm::ESHandle<L1TMuonGlobalParams> microGMTParamsHandle = iSetup.getHandle(m_microGMTParamsToken);

std::unique_ptr<L1TMuonGlobalParams_PUBLIC> microGMTParams(
new L1TMuonGlobalParams_PUBLIC(cast_to_L1TMuonGlobalParams_PUBLIC(*microGMTParamsHandle.product())));
if (microGMTParams->pnodes_.empty()) {
edm::ESHandle<L1TMuonGlobalParams> o2oProtoHandle;
iSetup.get<L1TMuonGlobalParamsO2ORcd>().get(o2oProtoHandle);
edm::ESHandle<L1TMuonGlobalParams> o2oProtoHandle = iSetup.getHandle(m_o2oProtoToken);
microGMTParamsHelper =
std::unique_ptr<L1TMuonGlobalParamsHelper>(new L1TMuonGlobalParamsHelper(*o2oProtoHandle.product()));
} else
Expand Down

0 comments on commit e2b8f25

Please sign in to comment.