I created a RooNDKeysPDF object with low statistics, so it has some spikes and all. I noticed, however, that if i generate a new dataset based on this PDF, there are differences between the following:
generating a RooDataSet with generate() and then creating the binnedClone()
generating a RooDataHist with generateBinned()
The former seems to be more precise, but more time consuming.
I’m guessing this has something to do with the internal integrator. I tried to play around with the RooFoamGenerator and setting some parameters, but with no luck.
There is difference between generate and generateBinned. Generate use the full pdf to generate the data, while generateBinned makes first an histogram using the bin centre of the pdf (and not its integral in the bin) and then generate the data from the obtained histogram. If you have spikes within a bin it is clear that there will be differences and the first one will be more accurate, but more CPU time consuming