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

75X backport assign muon PDG id using PFMuon charge #11841

Merged
merged 1 commit into from Oct 20, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions RecoMuon/MuonIdentification/plugins/MuonProducer.cc
Expand Up @@ -364,10 +364,12 @@ void MuonProducer::produce(edm::Event& event, const edm::EventSetup& eventSetup)
// search for the corresponding pf candidate
MuToPFMap::iterator iter = muToPFMap.find(muRef);
if(iter != muToPFMap.end()){
outMuon.setPFP4(pfCandidates->at(iter->second).p4());
outMuon.setP4(pfCandidates->at(iter->second).p4());//PF is the default
outMuon.setCharge(pfCandidates->at(iter->second).charge());//PF is the default
outMuon.setBestTrack(pfCandidates->at(iter->second).bestMuonTrackType());
const auto& pfMu = pfCandidates->at(iter->second);
outMuon.setPFP4(pfMu.p4());
outMuon.setP4(pfMu.p4());//PF is the default
outMuon.setCharge(pfMu.charge());//PF is the default
outMuon.setPdgId(-13*pfMu.charge());
outMuon.setBestTrack(pfMu.bestMuonTrackType());
muToPFMap.erase(iter);
dout << "MuonRef: " << muRef.id() << " " << muRef.key()
<< " Is it PF? " << outMuon.isPFMuon()
Expand Down