From 9b3c04c2e6a15b7c7a6d69c030058c355228a8aa Mon Sep 17 00:00:00 2001 From: Marcel R Date: Wed, 1 Feb 2017 01:52:32 +0100 Subject: [PATCH] Make BadGlobalMuonTagger METFilter compliant. --- RecoMET/METFilters/plugins/BadGlobalMuonTagger.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/RecoMET/METFilters/plugins/BadGlobalMuonTagger.cc b/RecoMET/METFilters/plugins/BadGlobalMuonTagger.cc index b42566185fe98..6e79e5543fd65 100644 --- a/RecoMET/METFilters/plugins/BadGlobalMuonTagger.cc +++ b/RecoMET/METFilters/plugins/BadGlobalMuonTagger.cc @@ -55,6 +55,7 @@ BadGlobalMuonTagger::BadGlobalMuonTagger(const edm::ParameterSet & iConfig) : taggingMode_(iConfig.getParameter ("taggingMode")), verbose_(iConfig.getUntrackedParameter ("verbose",true)) { + produces(); produces>("bad"); } @@ -97,7 +98,7 @@ BadGlobalMuonTagger::filter(edm::Event & iEvent, const edm::EventSetup & iSetup) } } - bool found = false; + bool pass = true; for (unsigned int i = 0, n = muons.size(); i < n; ++i) { if (muons[i].pt() < ptCut_ || goodMuon[i] != 0) continue; if (verbose_) printf("potentially bad muon %d of pt %.1f eta %+.3f phi %+.3f\n", int(i+1), muons[i].pt(), muons[i].eta(), muons[i].phi()); @@ -116,13 +117,15 @@ BadGlobalMuonTagger::filter(edm::Event & iEvent, const edm::EventSetup & iSetup) } } if (bad) { - found = true; + pass = false; out->push_back(muons.ptrAt(i)); } } + iEvent.put(std::auto_ptr(new bool(pass))); iEvent.put(std::move(out), "bad"); - return taggingMode_ || found; + + return taggingMode_ || pass; }