RooAbsPdf's prepareMutliGen always produces no events


I’m using the following commands to generate some events from a RooAbsPdf:

RooAbsPdf::GenSpec* genspec = test_fit_model->prepareMultiGen(RooArgSet(*var),RooFit::Extended(),RooFit::Name("Energy"));
RooDataSet *data_model;
data_model = test_fit_model->generate(*genspec);

When I do this, however, it seems that it will always give me a data set with zero events. I’ve verified that test_fit_model has a nonzero expectedEvents(), but I still get zero events. There doesn’t seem to be any error messages even when I turn the verbose on for the prepareMultiGen, does anyone have ideas of what to do?

Thanks in Advance,
Lenny Evans
CompareGrid.c (1.63 KB)