cms-sw/cmssw — pull request #5970 by Sam-Harper (2014-10-23 18:23:27+00:00)
Title: fixing bug where brem var was NaN which causes out of bound array access

73X edition of https://github.com/cms-sw/cmssw/pull/5959

From 72X description:

This pull request fixes an out of bounds array access in the EcalEnergy uncertainty function which occurs when the etaWidth of the supercluster is zero. These are single crystal superclusters and are basically junk, any energy correction uncertainty will be junk for them so we just set it to use the first bin of the energy correction, not caring too much what this value actually is.

We achieve this by setting the brem variable (phiWidth/etaWidth) to zero in the case etaWidth is zero.

I also reviewed the rest of the code just to check if there would be any knock on effects and I found something which was counter intuitive to me so added a comment explaining it to others once I had figured it out.