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

74X backport assign muon PDG id using PFMuon charge #11840

Closed
wants to merge 1 commit into from
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
10 changes: 6 additions & 4 deletions RecoMuon/MuonIdentification/plugins/MuonProducer.cc
Original file line number Diff line number Diff line change
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