Fitting the ratio of two models by minimizing the integral

Dear experts,

Suppose I have a binned measurement of the ratio r of two quantities y1 and y2, and I want to fit it to the ratio of two models f1 and f2.
I want to fit the ratio instead of the components because either I don’t have the separate measurements of y1 and y2 or because the error on r is smaller than simply propagating the errors on y1/y2 (some systematics simplify).
Since it’s a binned measurement, the correct approach would be to minimize the difference between r and Integral(f1)/Integral(f2).
If I create a TF1 which compute the ratio f1/f2 and use the integral option in Fit, I’m minimizing the difference between r and Integral(f1/f2), which is not the same.
In my case, with a reasonable choice of parameters and bin widths, the difference between Integral(f1/f2) and Integral(f1)/Integral(f2) is a few percent, so the best fit parameters should not be affected too much, but I was curious anyway to know if such a fit could be implemented in ROOT.
I looked at the code in ROOT::Fit::Fitter and the only solution I found is to write a class derived from ROOT::Fit::Chi2Function which computes the chi2 on its own instead of using FitUtil::EvaluateChi2?
Is this correct?


ROOT Version: 5.34
Platform: linuxx8664
Compiler: gcc

@moneta, I am not sure, maybe you can help?

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