424 if (fObservables ==
NULL) {
425 ooccoutE((TObject*)
NULL,InputArguments) <<
"Observables not set." << endl;
431 if(fPriorNuisance && fNuisancePars && fNuisancePars->getSize() > 0) {
434 nuisValues_ = fPriorNuisance->generate(*fNuisancePars, fNToys);
437 fNuisancePars->snapshot(saveNuis);
439 RooArgSet pars(*fNuisancePars); pars = *
values;
442 RooArgSet observables(*fObservables);
443 if(fGlobalObservables && fGlobalObservables->getSize()) {
444 observables.remove(*fGlobalObservables);
454 if (!_allVars) _allVars = fPdf->getObservables(*fGlobalObservables);
460 if(!fImportanceDensity) {
462 data =
Generate(*fPdf, observables);
464 throw std::runtime_error(
"No importance sampling yet");
466 RooArgSet* allVars = fPdf->getVariables();
467 RooArgSet* allVars2 = fImportanceDensity->getVariables();
468 allVars->add(*allVars2);
469 const RooArgSet* saveVars = (
const RooArgSet*)allVars->snapshot();
476 forceEvents = (int)fPdf->expectedEvents(observables);
477 forceEvents = RooRandom::randomGenerator()->Poisson(forceEvents);
482 if(fImportanceSnapshot) *allVars = *fImportanceSnapshot;
487 data =
Generate(*fImportanceDensity, observables,
NULL, forceEvents);
489 *allVars = *saveVars;
495 if (saveNuis.getSize()) { RooArgSet pars(*fNuisancePars); pars = saveNuis; }
RooAbsData * Generate(RooAbsPdf &pdf, RooArgSet &observables, const RooDataSet *protoData=NULL, int forceEvents=0) const
RooDataSet * globalObsValues_
RooAbsPdf * globalObsPdf_
char data[epos_bytes_allocation]