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

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.

Expect the 73X version of this to come shortly.