Skip to content

Commit

Permalink
Merge pull request #11841 from jhgoh/SetMuonPdgIdFromPFCharge75
Browse files Browse the repository at this point in the history
 75X backport assign muon PDG id using PFMuon charge
  • Loading branch information
cmsbuild committed Oct 20, 2015
2 parents 47b8f13 + 6148fca commit d3887b3
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit d3887b3

Please sign in to comment.