I’m regularly using RooSimultaneous to perform extended ML fits over multiple categories of “feature 1” of my data. Each of the categories of this RooSimultaneous holds an extendable RooAddPdf that sums all my signal and background contributions, and at the end of the day I end up with yields for all my signals and backgrounds in each category of “feature 1”.
What I’m aiming for now is to introduce another categorization according to “feature 2” on top of the existing one, and have slightly different pdfs fitted to different “feature 2” categories, preserving the extendedness as simultaneity over categories of “feature 1”. Threfore “feature 2” serves as parameter: it merely chooses which particular pdf shall be used for an event falling into a given “feature 1” category. Strategy I’ve come up with is to replace my signal and background pdfs in each “feature 1” category with RooSimultaneous-es, holding pdf for different categories of “feature 2”. Then I add these sub-RooSimultaneous-es into an extendable RooAddPdf - one for each category of “feature 1”, and perform the simultaneous extended fit over “feature 1” categories.
According to what I’ve tried so far it works fine - I’m getting the corresponding signal and background yields in “feature 1” categories, while the events indeed seem to be picked up by the pdfs corresponding to the relevant “feature 2” category. I would like to make sure this approach is correct and leads to the desired outcome. I’m particularly worried about the extension of the likelihood - whether it’s not being extended two times (once for both “feature 1” and “feature 2”), although it doesn’t seem to be the case.
I’d be grateful if you could confirm whether this approach is healthy, and let me know if you could think of better way to achieve this. Please, find a working example attached (the fit is admittedly not exactly nice, but the macro illustrates the principle I’m after).
simultaneously_simultaneous.cxx (5.6 KB)