Home | News | Documentation | Download

Exception on TH1

Hello guys,

I’d like to raise your attention to this issue that appeared in CMSSW:



Protect TH1::Add() with a catch

by schneiml on 09:48AM - 09 May 19 UTC

1 commits changed 1 files with 20 additions and 15 deletions .

Questions for the ROOT team are:

  • Was this behaviour recently changed? I could browse the history myself, but maybe somebody remembers.
  • Shouldn’t TMath::AreEqualAbs use a less-than-or-equal comparison, so that epsilon=0 can still succeed?
  • Any suggestions on how to check the compatibility of histograms for add/merge? Catching the exception is sort-of ok, but discouraged; the helpers like CheckConsistency are not public.


Hi @gogoalshop,
thank you for the report! @moneta, our TH1 expert, is currently on holidays.

We’ll take a look as soon as possible and reply to questions 1 to 3 :smile:


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.


A new PR has been created for fixing the problem with TMath::AreEqualAbs when eps=0.
The check should not then fail when the bin histogram width is zero.
See https://github.com/root-project/root/pull/4378

Sorry for the delay in addressing this issue