Impossible to use RooFrame or RooCurve chiSquare method if data histogram has option XErrorSize(0)

I am trying to get chi2/ndf of a fit performed using RooFit. My data points are drawn with XErrorSize(0) option, and this prevents .chiSquare method from compiling.

In more detail, for each plotted data point, the code [1] finds an average of the fit function inside the interval {x[i] - exl[i], x[i] + exh[i]}

(where x is coordinate, exl and exh are low and high errors)

If these errors are set to zero, the RooCurve::average function returns an error

0 ERROR:InputArguments – RooCurve::average invalid range

since the interval length is zero.

I see two possible solutions:

(a) fix ‘average’ method, introducing a check {if (lo==hi) return interpolate(lo,1e-10) }

(b) fix ‘chiSquare’ method, introducing a check if XErrorSize is set to 0, then use function value, not use ‘average’ method.

Can this be fixed ?
I have already reported to Jira, but I got no answer [2]

With best regards,

Sergey

[1] https://root.cern.ch/doc/master/RooCurve_8cxx_source.html#l00546
[2] https://sft.its.cern.ch/jira/browse/ROOT-9204

@moneta maybe you can help here?

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