Different normalization between standard RooFit and HistFactory?

Dear experts,

I’m trying to perform a binned maximum likelihood fit on the same dataset using the standard RooFit configuration and HistFactory. You can find attached a small script with two workspaces in order to reproduce the results. The results of the two fits are almost identical (there are small differences but I ignore the source, since the two datasets are identical), but when plotting, the signal distribution changes dramatically. The one with standard RooFit looks ok, but the one obtained with HistFactory is clearly wrong. The central value is much higher and the error is too small. I’ve tried to modify the script in such a way to normalize the signal component to the number of fitted signal events (Nsig in the script) and the result looks ok-ish for the central value (but it’s a bit above the one with RooFit) but the error is still wrong. Is there a dirrefent behavior with HistFactory? Am I doing something wrong?

I am using RooFit v3.60 with python 3.6.11.
You can run the examples with python fitter_debug.py workspace_xx.root


fitter_debug.py (4.5 KB)
workspace_histfactory.root (55.9 KB)
workspace_roofit.root (24.1 KB)

@moneta or @jonas Can you help?

Which ROOT version are you using ? We consider ROOT versions and not RooFit ones.

For me it seems the results are very close, I see similar fitted values between the two.
histfactory results:

  Floating Parameter    FinalValue +/-  Error   
  --------------------  --------------------------
                    BR    1.0391e-04 +/-  2.11e-04
          bkg_ratio_11    4.5733e-01 +/-  4.78e-02
          bkg_ratio_12    4.7520e-01 +/-  3.41e-02
          bkg_ratio_15    6.2042e-01 +/-  6.48e-02
          bkg_ratio_16    5.2810e-01 +/-  1.97e-02
          bkg_ratio_17    5.1526e-01 +/-  1.78e-02
          bkg_ratio_18    5.4177e-01 +/-  1.75e-02

and roofit results:

   Floating Parameter    FinalValue +/-  Error   
  --------------------  --------------------------
             Signal_BR    1.0305e-04 +/-  2.11e-04
    bkgRatio_3pi3pi_11    4.5726e-01 +/-  4.78e-02
    bkgRatio_3pi3pi_12    4.7516e-01 +/-  3.41e-02
    bkgRatio_3pi3pi_15    6.2037e-01 +/-  6.48e-02
    bkgRatio_3pi3pi_16    5.2807e-01 +/-  1.97e-02
    bkgRatio_3pi3pi_17    5.1524e-01 +/-  1.78e-02
    bkgRatio_3pi3pi_18    5.4175e-01 +/-  1.75e-02


Hi Lorenzo,

I’m using ROOT 6.22/02
The results are indeed very close, what bothers me is instead the normalization and the error of the signal shape in the plot (the output files plot_debug_roofit.pdf or plot_debug_histfactory.pdf), which seem ok for roofit but wrong for histfactory.


Looking at the plots it seems there is a plotting issue in the normalization. The signal curve (green) are very different from roofit and histfactory. The roofit curve seems to be the correct one.
The errors on the signal are not visualized, this is probably due to this known issue, see Normalization of RooSimultaneous - #4 by moneta
I will investigate the plotting problem



Is there any news about this problem?


not yet, I am sorry for this, but it might take some time. If you can open a GitHub issue will be great so it is not forgotten.
We have already a JIRA item open for the normalisation error visualization.


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