Useless check/bug in TH1::Smooth

Hi, I’ve been looking at the TH1::Smooth function (and the associated TH1::SmoothArray for smoothing some of my histograms. In this line of the smoothing procedure in the source code, I noticed there seems to be a useless check of the absolute value of the same variable, tmp0, compared to itself. I’ve taken a look at the associated references here and here but I can’t find exactly where this routine is referenced. I would guess it should be comparing tmp0 with tmp1, but I’m not sure.

Maybe @moneta can comment on this

Thanks for spotting that !!
This was a bug introduced here: [hist] Code improvements to `TH1::SmoothArray()` · root-project/root@9ef86d5 · GitHub

A PR to fix this is underway: [hist] fix smootharray bug by ferdymercury · Pull Request #18099 · root-project/root · GitHub

1 Like

Thank you!