Hi,
apparently it is not possible to generate 4-dimensional distributions using accept/reject in RooFit. When trying I’m getting this warning:
[#0] WARNING:Generation – pdf_AccRej::RooAcceptReject: WARNING: generating 4 variables with accept-reject may not be accurate
What’s the reason for this? Besides performance considerations, I don’t see a reason why acc/rej wouldn’t be accurate in 4 dimensions?
This piece of test code shows what I mean:
[code] RooRealVar x1(“x1”, “x1”, 0, -10, 10);
RooRealVar x2(“x2”, “x2”, 0, -10, 10);
RooRealVar x3(“x3”, “x3”, 0, -10, 10);
RooRealVar x4(“x4”, “x4”, 0, -10, 10);
// will terminate with "Abort" if not restricting bins
x1.setBins(10);
x2.setBins(10);
x3.setBins(10);
x4.setBins(10);
RooArgSet variables(x1, x2, x3, x4);
// read ASCII dataset which contains more than 4 columns
RooMsgService::instance().setGlobalKillBelow(RooMsgService::ERROR);
RooDataSet* dataset = RooDataSet::read("dat/glwFinalFitter-toy-fdm1.dat", variables, "");
RooMsgService::instance().reset();
dataset->Print("v");
// drop "blindState", otherwise RooHistPdf complains
dataset = new RooDataSet("data_clean", "data_clean", dataset, variables);
dataset->Print("v");
RooDataHist* hist = dataset->binnedClone("hist");
hist->Print("v");
RooHistPdf pdf ("pdf", "pdf", variables, *hist);
RooDataSet* toy = pdf.generate(variables, 1000);[/code]
Cheers,
- Mo