Hi,
I have an observable x and its per-event error estimate x_err. The pdf for x is assumed to be a gaussian, its width being a rescale of x_err by a factor S. In other words, I need to define
pdf(x) = gauss(x|mean, S * x_err)
so I try via
[code]// observables
x = new RooRealVar(“x”, “x”, m_minX, m_maxX);
x_err = new RooRealVar(“x_err”, “x_err”, m_minXerr, m_maxXerr);
// ranges
x->setRange(“integration_range”, m_minX, m_maxX);
// parameters
scale_factor = new RooRealVar(“scale_factor”, “per-event error scale factor”, 4, 0.1, 10);
mean = new RooRealVar(“mean”, “mean”, m_initialGuess, m_minMean, m_maxMean);
sigma = new RooProduct(“sigma”,“sigma”, RooArgList(*scale_factor, *x_err));
// signal pdf
gauss = new RooGaussian(“gauss”, “gauss(invMass,mean,sigma)”, *invMass, *mean, *sigma);
// background parameter and pdf
slope = new RooRealVar(“slope”, “slope”, -1, -4., +4.0);
expo = new RooExponential(“expo”, “expo”, *x, *slope);
// sig+bkg mixture parameter
f_gaus_sig = new RooRealVar(“f_gaus_sig”, “gauss signal fraction”, 0.09, 0., 1.);
// composite model and fit
total_pdf = new RooAddPdf(“pdf”, “pdf”, RooArgList(*gauss, *expo), RooArgList(*f_gauss_sig));
total_pdf->fitTo(dataset, RooFit::ConditionalObservables(*x_err), RooFit::Range(“integration_range”));[/code]
but in this way scale_factor seems not to be treated as a fit parameter (and actually the fit returns a lot of errors)…
What is my mistake?