Dear experts,
I have the following problem. I can not really understand how to plug Gaussian constraints in a ML fit using a workspace with roostats. I have done it with roofit and it goes like this:
First you make the Gaussian constrain, then you multiply the gaussian with your model and finally you proceed to the fit including the constraint term as presented below:
1) RooGaussian const ("const","const",constrain, RooConst(mean),RooConst(sigma));
2) RooProdPdf model_const("model_const","model with constraints",RooArgSet(model, const));
3) result_c = model_const.fitTo(data, Constrain(const), Save());[/code]
The same thing for roostats starts:
[code]
1)w.factory("Gaussian: const (.... , ... , ...)");
2)w.factory("PROD:model (pdf, const)");
RooAbsPdf * pdf = w.pdf("model");[/code]
but when it comes for the fit if I try:
[code]3) RooFitResult * result = pdf->fitTo(data, RooFit::Save(true), RooFit::Minimizer("Minuit2","Migrad"));
[/code]
it excludes the constraint and if I try the same as before:
[code]3) RooFitResult * result = pdf->fitTo(data, Constrain(const), RooFit::Save(true), RooFit::Minimizer("Minuit2","Migrad"));
it doesn’t work
Are there any ideas of tackling the problem?
Thank you in advance,
Stergios