Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added esConsumes to modules in L1Trigger/L1TMuon #30431

Merged
merged 2 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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