RooFit: drawing events from a RooHistPdf

Hi all,

I want to perform an embedded toy MC study in RooFit. I have samples of full MC (detector simulation, etc) at hand, from which I want to generate toy datasets. My idea is to create a binned PDF from the full MC samples, from which I then can sample as many toys as I need. I have this code working, however, sampling takes forever (~2h).

Is there any clever way to speed up the Accept/Reject?

My RooHistPdf has 3 dimensions plus 3 categories with 4 slices in total. I also need a factoring fourth variable, so I’m calling generate() from a RooProdPdf of the above RooHistPdf and a RooGenericPdf. I’m drawing some 10k events.

Any input is appreciated!

  • Moritz