Hi Wouter,
I suspect you’re right.
I have a 4d fit. One of the pdfs needs a conditional observable.
I build my 4d model with a RooProdPdf. Using the RooFit::Conditional parameter. Just to make sure: It takes the pdf and the variables that are supposed to be normalized, unlike ConditionalObservables, which takes the Variables that are not normalized, right?
Then I have five components, each a 4d RooProdPdf, but only one of them is created with the aforementioned Conditional parameter.
I add them in a RooAddPdf.
I create a RooMCStudy:
RooMCStudy manager(bf.pdf
, bf.observables.getAllObservables()
, RooFit::FitOptions(RooFit::Extended(kTRUE)
, RooFit::Minos(kFALSE)
, RooFit::Save(kTRUE)
, RooFit::ConditionalObservables(bf.observables.endpoint)
, RooFit::ProtoData(*dataset, kTRUE)
, RooFit::InitialHesse(kTRUE))
, RooFit::Extended(kTRUE)
, RooFit::ConditionalObservables(bf.observables.endpoint)
, RooFit::ProtoData(*dataset, kTRUE)
);
And call it with the following lines:
// This gives reasonable pulls
//manager.generateAndFit(1000, 5200+120+140+20+20, kTRUE, “work/atest%04d.data”);
// this doesn’t
manager.fit(10, “EmbeddedToys/test%04d.data”);
I think I found the source of the generate problem. I have a dataset that contains RooRealVars with the same names as the dependent variables of my pdf and it appears that RooFit takes all variables from the dataset instead of only the ones that are not part of the RooArgSet parameter to RooAbsPdf::generate.
(The variables have the same names, but different labels, maybe that’s the reason?)
Changing the var names in my pdf then creates of course a larger dataset, but it appears that the vars generated from the pdf are indeed within the specified range.
I am using ROOT 5.14e with the default version of RooFit (2.10).
Please let me know if you need more information.
Thanks,
Jan