Hi everybody,
I am having trouble evaluating the error of one component of a “RooAddPdf” model with a fit result. The GetVal is correct but the error returns always 0. Providing a reproducible example would be a bit tedious, so I will try to first explain what I do with a few lines as probably it is just something stupid from my side.
Firstly, I build two pdfs out of a respective histogram:
RooHistPdf hist_pdf_sig("hist_pdf_sig", "hist_pdf_sig", x, hist_sig, 0);
RooHistPdf hist_pdf_bkg("hist_pdf_bkg", "hist_pdf_bkg", x, hist_bkg, 0);
Secondly, I add an amplitude to each pdf and add them together to build my model, which I then fit to some data (histogram):
RooRealVar N_sig("N_{sig}", "N_{sig}", 1, 0, 2000);
RooRealVar N_bkg("N_{bkg}", "N_{bkg}", 1, 0, 1e+08);
RooExtendPdf extended_pdf_sig("extended_pdf_sig", "extended_pdf_sig", hist_pdf_sig, N_sig);
RooExtendPdf extended_pdf_bkg("extended_pdf_bkg", "extended_pdf_bkg", hist_pdf_bkg, N_bkg);
RooAddPdf model("model", "model", RooArgList(extended_pdf_bkg, extended_pdf_sig), RooArgList(N_bkg, N_sig));
RooFitResult *fit_result_data = model.fitTo(hist_data, Range("fullRange"), Save(), PrintLevel(-1));
And then lastly, I would like to extract the integral of only one component pdf in a given range with the correct error:
RooAbsReal *integral_bkg = extended_pdf_bkg.createIntegral(x, NormSet(x), Range("signal"));
Double_t integral_bkg_value = integral_bkg->getVal();
Double_t integral_bkg_value_error = integral_bkg->getPropagatedError(*fit_result_data, x);
cout << " Background Integral: " << integral_bkg_value << " +/- " << integral_bkg_value_error << endl;
This always return me “xyz ± 0”. From a control experiment I know that the getVal “xyz” is correct. However, I do not understand why the getPropagatedError is always 0? My best guess is that the model has two parameters and the fit-result contains a 2x2 covariance matrix, but since I fit only one component pdf (with just one parameter) maybe this confuses the error propagation? But I also though that the call to “fitTo” would set all the parameters in the model correctly and also in the components “RooExtendPdf” (so the amplitude N_sig). What am I doing wrong? Or how does one extract the propagated error correctly? For a model consisting only of one RooExtendPdf I get the right result this way. Thanks a lot for the help.
Oh and also as a random question. I have been reading through the RooFit Users Manual (v2.91). I really appreciate this great manual and it help me a lot in understanding how RooFit/RooStat works. Is there already a rough timeline set when the rest of the chapters will be filled? Especially chs. 12-14 would interest me very much. Or is it possible to get a non-polished early version or so, if available? That would help me out a ton
Thanks a lot