Generator context

Hi guys.

I am trying to understand how generator contexts work. I have read through the class reference documents but I was wondering if there is no additional theory or papers on this concept?

Perhaps @StephanH has a suggestion for additional reading material?

Hi @Xola,

there’s no papers on that. It’s RooFit’s way to set up the generation of events. This all starts from RooAbsGenContext. It provides the method generate, which will return a dataset. All specialised gen contexts derive from this. See the diagram at the bottom of what I linked.

Sometimes, you can do specialised operations to make generation faster (if you are e.g. generating events for the sum of distributions, you throw random numbers to decide which of the terms you sample an event from …), but often, that’s not possible. In this case, the RooGenContext is used, and will run an accept/reject sampling. On that, there’s literature e.g. Wikipedia.

Hi @jblomer and @StephanH thank you so much. I will start by referring to RooAbsGenContext to get some context on the matter

What I actually wanted to find out about is how the constructor creates a list of pdf components from the input pdf when creating a generating context. I noticed that the generateEvent function samples from a particular random number generator based on the pdf component.

I cannot follow. Can you show the constructor?
It also really depends which kind of PDF you are using, because some PDFs have specialised generators.

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