Get the correct pdf shape before plotting

Hello everyone,

I have a RooBCPGenDecay PDF called bcp, which depends for example on the flavor q which is a RooCategory (“B0” or “B0bar”).

When I want to plot the function for a specific flavor, bcp.plotOn(frame, Slice=(q, "B0")) works very well.

Is it possible to get bcp_B0, which is the PDF of bcp on the slice q=“B0”, so that doing bcp_B0.plotOn(frame + some renormalization) is the same as doing bcp.plotOn(frame, Slice=(q, "B0"))? This would allow the users to get the correct PDF values using bcp_B0.getVal() for the “B0” flavor.
More generally, what does Slice do to the PDF to get the correct 1D PDF?

I guess @jonas can help you.

1 Like

When you use the Slice argument in plotOn, it effectively reduces the multi-dimensional PDF to a 1D PDF by fixing the category to a certain state, like “B0”. To get bcp_B0 as a standalone PDF, you’d typically create a conditional PDF with respect to the “B0” category.

However, RooFit might not directly expose a method to create a 1D PDF from a Slice. Instead, it internally handles the slicing when plotting.

For bcp_B0.getVal(), you’ll need to set the category q to “B0” before evaluating the PDF. The Slice operation essentially integrates out all other categories except for the one specified.

Alright, that’s not a really precise solution but hope it helps somehow.

1 Like

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