I’m having many issues with getting all this newfangled RooWorkspace/RooSimWSTool working. It doesn’t help that there’s basically no documentation and the bulk of the tutorials that deal with these things don’t actually do anything practical like generate/plot/fit.
[#0] ERROR:Generation – RooSimGenContext::ctor(model_sim) ERROR: Need either extended mode or prototype data to calculate number of events per category
[#0] ERROR:Generation – RooAbsPdf::generate(model_sim) cannot create a valid context
if c varies within the events generated:
RooDataSet *data = model_sim->generate(RooArgSet(x,c),100);
But as the error message says RooFit doesn’t know how many events to generate you you need to make an extended PDF if it is not already; you can use RooExtendPdf
Unfortunately, I am not knowledgeable on the Roo1DTable. Providing your ROOT version might also help Wouter to give a more complete answer.
The workspace and factory are a new way to create pdfs. Once a
pdf exists, they can be used the same way as before, and functionality
that is demonstrated in the tutorial macros still applies in the same way.
Concerning the crash of rf512, what ROOT release are you using?
These should work fine in 5.26.
macro rf504 demonstrates a tool to create simultaneous pdfs
that care clones of each other, e.g you can take an existing
which turns Gauss_a if idx==a and Gauss_b if idx==b, so this
is now a pdf of 2 observables: x and idx
The point to keep in mind with simultaneous pdfs (regardless of
how they are made) is thay they don’t make a prediction of the distribution of idx, this is a feature. You should see it as a conditional pdf F(x|idx).
Therefore you can also not request that it generates a distribution
in idx (or x and idx) as that information is not contained in the pdf.
What is possible is
Generate the distribution in x for a given value of idx
idx.setLabel(“a”) ;
sim_pdf.generate(x,1000) ;
Generate the distribution of (x,idx) given an external input
for the distribution of idx (in the form of a dataset D(idx))
sim_pdf.generate(x,ProtoData(D)) ;
Some more use examples of simultaneous pdfs are given in rf501
Concerning your question on rf513: you can do with model_sim what
you can do with any simultaneous pdf: fitting, plotting event generation
(with the above mentioned restrictions). Macro rf501 demonstrates
some of this functionality.