Relative sub-shape yields in generate(Extended)

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.