Problems fitting Simultaneous pdf fit in subranges

Dear experts,

I’m performing a fit using a RooSimultaneous PDF over two categories. The fit is intended to be restricted to a subrange of the observable (e.g., a “blind” mass region). However, I’m encountering inconsistent results depending on how the range is specified.

If I pass Range("range-name") to functions like fitTo() or createNLL(), the fit yields appear inconsistent. On the other hand, if I explicitly define the subrange via observable.setRange("range-name", low, high) before the fit if behaves as expected (or at least it does not give inconsistent results).

However, I’m not entirely confident whether this approach properly handles PDF normalization, especially in the context of extended fits with a RooSimultaneous. Specifically, I’m unsure whether the PDF normalization and event counting are consistently treated across all categories and observables when working with subranges.

Could you please clarify the correct and robust way to perform a simultaneous extended fit restricted to a specific range of an observable, ensuring both the likelihood and normalization are treated correctly?

Many thanks in advance for your help!

Best regards,
Elia

Here is a code to reproduce the issue:
rf_simultaneous_runA_runB.C (11.9 KB)

I guess @jonas can help you.

Hi @Elia_Giulio_Grandoni!

Looks like this is a regression with the new RooFit likelihood evaluation backend, which is the default since ROOT 6.32:

Thanks for the reproducer! I have simplified it even more and opened a GitHub issue with it, to remind myself to fix that issue:

In the meantime, can you try if it works by passing EvalBackend("cpu") to the fitTo() call?

Cheers,
Jonas

Dear @jonas,

Thank you for your response.

As you mentioned in the GitHub issue, using EvalBackend("legacy") and not "cpu" resolves the problem on my end as well.

Just as a note for debugging: when the above fitTo() specification is omitted, the constant values returned from the fit appear to correspond to the lower bounds of the two background parameters. I hope this detail proves helpful.

Best regards,
Elia

PS: I have a follow-up (a bit more complex because it also includes Constraint() and GlobalObservables() in the fitTo() function), where it seems that the "cpu"/"legacy" option seems not to affect the result of the fit.

rf_simultaneous_runA_runB.C (11.3 KB)

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