Hi,
I’d just like some confirmation if I’m doing this the right way. I’m fitting a PDF which has a fixed parameter. For this parameter I need to propagate its error into the ift result.
So I defined a Gaussian PDF for this parameter and fed it into the ExternalConstraints() modifier of the fitTo() function. I also released the parameter so it’s no longer fixed (setConstant(false)). The fit indeed reports larger errors on the remaining parameters, however not so much as I expected.
Is this the way to go?
And just for my education: What does the ExternalConstraints() modifier exaclty do to the likelihood function?
I’m fitting a signal shape, z2+3*x^2, over a fixed, flat background. Obviously I can’t float the background level because it’s 100% correlated with z2.
Here is the code:
//
// PDF
//
RooRealVar z2 ("z2", "z2", 0.5, -2.0, 2.0);
RooRealVar nsig("nsig", "nsig", 1000., -1000.0, 2000000.0);
RooRealVar nbkg("nbkg", "nbkg", nBkg, -100, 200);
RooGenericPdf om("om", "om", "@0+3.*@1^2", RooArgList(z2,var));
RooPolynomial p("p", "p", var, RooConst(0));
RooAddPdf sum("sum", "sum", RooArgSet(om, p), RooArgSet(nsig, nbkg));
RooArgSet* pars = sum.getParameters(data);
//
// constraint PDF to propagate error on nBkg
//
RooGaussian nBkgPdf("nBkgPdf", "nBkgPdf", nbkg, RooConst(nBkg), RooConst(nBkgErr));
//
// fit
//
sum.fitTo(*data, Minos(kTRUE), Save(kTRUE), Extended(kTRUE), ExternalConstraints(nBkgPdf));
Cheers,
- Moritz