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

Make BadGlobalMuonTagger METFilter compliant. #13

Closed
Closed
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
9 changes: 6 additions & 3 deletions RecoMET/METFilters/plugins/BadGlobalMuonTagger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ BadGlobalMuonTagger::BadGlobalMuonTagger(const edm::ParameterSet & iConfig) :
taggingMode_(iConfig.getParameter<bool> ("taggingMode")),
verbose_(iConfig.getUntrackedParameter<bool> ("verbose",true))
{
produces<bool>();
produces<edm::PtrVector<reco::Muon>>("bad");
}

Expand Down Expand Up @@ -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());
Expand All @@ -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<bool>(new bool(pass)));
iEvent.put(std::move(out), "bad");
return taggingMode_ || found;

return taggingMode_ || pass;
}


Expand Down