Hi,
I got a strange questions. I use createIntegral to compute 2D integral of my PDF, but when I specify some range for one of the two observables, the integral becomes very very slow, why? My code is like this:
RooNDKeysPdf *pdfTrain = new RooNDKeysPdf(pdfNomTrain.c_str(), pdfNomTrain.c_str(), *varListTrain, *dataTrain, option.c_str());
RooNDKeysPdf *pdfTest = new RooNDKeysPdf(pdfNomTest.c_str(), pdfNomTest.c_str(), *varListTest, *dataTest, option.c_str());
// product conditional pdf
RooRealVar *varConditional = (RooRealVar*)varListTrain->at(0);
RooProdPdf *pdfConditional = new RooProdPdf("Conditional", "Conditional", *pdfTest, Conditional(*pdfTrain, *varConditional));
//pdfConditional->Print("v");
varConditional->setRange("inte", 10, 50) ;
RooArgSet *varSetTrain = new RooArgSet(*varListTrain);
pdfConditional->forceAnalyticalInt(*varConditional);
RooAbsReal *predicTest = pdfConditional->createIntegral(*varSetTrain, NormSet(*varSetTrain), Range("inte"));
If the range "inte" is removed, the integral is very very quick. But adding the range, the integral becomes very very slow, Can anyone tell me the reason and how to fix this? Many thanks!!