Hi there,
I’m hoping to use a KEYS distribution to create a PDF for a quick MC study. I’ve noticed that RooFit provides two classes that can help me to do this: RooKeysPdf and RooNDKeysPDF, where RooNDKeysPDF is just a generalization of RooKeysPdf into n-dimensions.
Even though I only need a 1-dimensional PDF, I have to use RooNDKeysPDF because it supports per event weighting (when creating it), which RooKeysPDF does not.
But the problem is that RooNDKeysPDF takes a long time to generate data! It takes about 20 seconds to do so, and this appears to be independent of the number of events requested. I’ve tried to turn of mirroring and per-event weighing, but that did not speed things up. On the other hand, RooKeysPDF takes almost no time…
I’ve added the Verbose() option to generate(), it hangs for a long time andthen quickly prints out the following and finishes.
[quote] — RooGenContext —
Using PDF RooNDKeysPdf::Wmunu_met[ varList=(met) weight=weight weightParams=() ]
Use PDF generator for ()
Use MC sampling generator RooFoamGenerator for (met)[/quote]
My question is, does anyone have experience of using RooNDKeysPdf? And if they do, is it expected to be that slow or am I doing something wrong?
I’ve attached the macro (nd_test) that I use to test this. Also I’ve attached a more simplified macro (nd_test2) where I create a dataset from a Gaussian, and feed that into the keys distribution.
The root tree used to create the distribution contains 5195 events after all of the applied cuts. I’m using ROOT 2.24, compiled by myself for Ubuntu Jaunty. Also, I’ve run the macro in compiled mode (ei: root nd_test.C+).
ndkeys_test2.C (792 Bytes)
ndkeys_test.C (2.44 KB)