Relative sub-shape yields in generate(Extended)

If I call generate(Extended) on a composite model, e.g.,

ws.factory(
    'SUM::model('
    'nsig[50, 0, 100]*SUM::sig(f1[0.74, 0, 1] * Gaussian::g1(x, mg[0, -10, 10], o1[3, 0, 5]), Gaussian::g2(x, mg, o2[3, 0, 5])),'
    'nbkg[10, 0, 100]*Chebychev::bkg(x, {c11[-0.33, -1, 1], c12[-0.33, -1, 0]}),'
    ')'
)
data = ws.pdf('model').generate(
    ROOT.RooArgSet(ws.var('x')), 
    ROOT.RooFit.NumEvent(1000),
    ROOT.RooFit.Extended(),
)

will data contain a number of sig entries equal to 5 times the number of bkg entries?

Hi @mwilkins,

Extended and NumEvent are mutually exclusive. The documentation is outdated (and will be fixed soon), and what actually happens is this:

  • NumEvent(int nevt) Generate specified number of events
  • Extended() If no number of events to be generated is given, use expected number of events from extended likelihood term. This evidently only works for extended PDFs.

As to how many events are being generated per PDF, the RooAddGenContext has the answer:
It randomly switches between the PDFs with a probability proportional to the relative size of the coefficients.

Thank you for your thorough reply. I have a follow-on question that seemed to deserve its own topic, if you have any input on it as well:

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