Problems plotting individual components with RooFit/HistFactory

Dear experts,

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?

Cheers,

Veronica

text.txt (9.6 KB)

Maybe @jonas would have an idea of what is going on?

I’m sure @jonas can help!

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

Hi @Veronica_Solund_Kirs, thank a lot for reporting this bug!

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.

Let me know if I can do anything else to help!

Cheers,
Jonas

Hi Jonas,

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! :slight_smile:

Cheers,

Veronica