I am using histFactory with ROOT 6.28 to perform a simple 1D fit with one signal and one background histogram. However, when I try to plot the fit result, the signal (blue) and the total pdf (green) are completely overlapping as you can see in the attached plot “obs_x_BMCORR”. However, the shape of the signal histogram is different from the total pdf as you can see in the attached plot “signal_histogram”. In addition to this, the normalisation of the background is not correct, i.e. it seems like it is normalised to the sum of all events.
The code that I use to generate the histograms and perform the fit is attached as “toyModel_simple.C.txt” (or maybe it is showed here as “text.txt”).
Do anyone know why this happens and how it can be solved?
In fact, there were two separate bugs leading to this problem, and this PR that I will merge tomorrow to ROOT master will fix both:
Unfortunately, there is no easy workaround, and your options are to either wait for the next ROOT release 6.30 in a few weeks, building ROOT master from source, or use the ROOT nightly once the patch has landed in the nightlies:
Sorry again it took so long to fix this. It was quite an intricate problem.
Thank you so much for fixing these bugs. I just ran the ‘toyModel_simple.C’ script (a slightly modified version that uses ‘RooMinimizer’ instead of 'RooMinuit) with the latest ROOT nightly, and now the plotting seems to work, so that is super nice. Again, thanks a lot!