[RooStats] FactorizePdf crahses with missing categories

Hi all,

I want to use the HybridCalculator to test a hypothesis, but it crashes in the constructor, in the FactorizePdf method.
My pdf is a RooSimultaneous with a RooSupercategory as the index.
The RooSupercategory is the product of 2 different RooCategory’s, but I don’t use all the different combinations of indexes.
To make a simplified example, I’d define and use the following:


so I don’t have the {etacat_1;bdtcat_1} category.
Now, the fit goes well, but the HybridCalculator crashes.
I think I found the line: it is in FactorizePdf, in RooStatsUtils.cxx, line 63:
there, it tries to factorize the pdf of each index even when the pdf is not defined for the given index.

Can this be checked?

Thank you,

ps meanwhile I’ll try to merge my two categories in one single category, but this in not very handy

Hi Luca,

Yes, you are right, an extra check for the presence of a pdf for each combination of categories should fix this issue. I will commit the patch today. Let me know if this solves your problem.