Skip to content

Commit

Permalink
Merge pull request #11302 from slava77/CMSSW_7_4_12/PFAlgo-NaN-ecalE-…
Browse files Browse the repository at this point in the history
…postPhoton

pick ecal fraction of 0 for a candidate with trackMomentum 0
  • Loading branch information
cmsbuild committed Oct 20, 2015
2 parents 8558d04 + 66af8e0 commit b7d39b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RecoParticleFlow/PFProducer/src/PFAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ void PFAlgo::processBlock( const reco::PFBlockRef& blockref,
// Skip muons
if ( (*pfCandidates_)[tmpi[ic]].particleId() == reco::PFCandidate::mu ) continue;

double fraction = (*pfCandidates_)[tmpi[ic]].trackRef()->p()/trackMomentum;
double fraction = trackMomentum > 0 ? (*pfCandidates_)[tmpi[ic]].trackRef()->p()/trackMomentum : 0;
double ecalCal = bNeutralProduced ?
(calibEcal-neutralEnergy*slopeEcal)*fraction : calibEcal*fraction;
double ecalRaw = totalEcal*fraction;
Expand Down

0 comments on commit b7d39b4

Please sign in to comment.