Histograming/Sink/Utils.h: Fix calculation of stats for (profile) histograms
Closes lhcb/Gaudi#5
Fixes a number of issues in the calculations of histogram stats :-
- Fix bin values used for profile histograms, that was not taking the correct (weighted) bin values into account.
- Fix a bug in the calculation of the bin central value for profiles, that had an offset of one bin.
- Also adds protection against
sqrt(-ve)
when values are expected to be zero, but due to machine (im)precision could fluctuate below zero.
Edited by Christopher Rob Jones