Skip to content

Commit

Permalink
Fixed incorrect use of consumesCollector in FastTSGFromL2Muon
Browse files Browse the repository at this point in the history
The function can ony be called in the constructor.
  • Loading branch information
Dr15Jones committed Sep 17, 2021
1 parent e44a0d4 commit 002868b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions FastSimulation/Muons/plugins/FastTSGFromL2Muon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <set>

FastTSGFromL2Muon::FastTSGFromL2Muon(const edm::ParameterSet& cfg) : theConfig(cfg) {
FastTSGFromL2Muon::FastTSGFromL2Muon(const edm::ParameterSet& cfg) {
produces<L3MuonTrajectorySeedCollection>();

edm::ParameterSet serviceParameters = cfg.getParameter<edm::ParameterSet>("ServiceParameters");
Expand All @@ -28,15 +28,14 @@ FastTSGFromL2Muon::FastTSGFromL2Muon(const edm::ParameterSet& cfg) : theConfig(c
theSeedCollectionLabels = cfg.getParameter<std::vector<edm::InputTag> >("SeedCollectionLabels");
theSimTrackCollectionLabel = cfg.getParameter<edm::InputTag>("SimTrackCollectionLabel");
// useTFileService_ = cfg.getUntrackedParameter<bool>("UseTFileService",false);
edm::ParameterSet regionBuilderPSet = cfg.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder");
theRegionBuilder = std::make_unique<MuonTrackingRegionBuilder>(regionBuilderPSet, consumesCollector());
}

FastTSGFromL2Muon::~FastTSGFromL2Muon() {}

void FastTSGFromL2Muon::beginRun(edm::Run const& run, edm::EventSetup const& es) {
//region builder
edm::ParameterSet regionBuilderPSet = theConfig.getParameter<edm::ParameterSet>("MuonTrackingRegionBuilder");
edm::ConsumesCollector iC = consumesCollector();
theRegionBuilder = new MuonTrackingRegionBuilder(regionBuilderPSet, iC);

/*
if(useTFileService_) {
Expand Down
3 changes: 1 addition & 2 deletions FastSimulation/Muons/plugins/FastTSGFromL2Muon.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class FastTSGFromL2Muon : public edm::stream::EDProducer<> {
const SimTrack& theSimTrack);

private:
edm::ParameterSet theConfig;
edm::InputTag theSimTrackCollectionLabel;
edm::InputTag theL2CollectionLabel;
std::vector<edm::InputTag> theSeedCollectionLabels;
Expand All @@ -46,7 +45,7 @@ class FastTSGFromL2Muon : public edm::stream::EDProducer<> {

MuonServiceProxy* theService;
double thePtCut;
MuonTrackingRegionBuilder* theRegionBuilder;
std::unique_ptr<MuonTrackingRegionBuilder> theRegionBuilder;

// TH1F* h_nSeedPerTrack;
// TH1F* h_nGoodSeedPerTrack;
Expand Down

0 comments on commit 002868b

Please sign in to comment.