# RooFit: Constraining RooProduct variables

Hi all,

I was wondering if anyone knows if the following is possible, it runs without errors but does not behave as I expect.

RooRealVar sigmean(“M_{B}”,“B mass”,5282,5277,5284,“MeV/c^{2}”);
RooRealVar sigsigma("#sigma_{B}",“B sigma”,13,0,30,“MeV/c^{2}”);
RooGaussian BSig_RF( “Bsig_RF”, “Signal Gaussian B RF Mass”, Donly_CM_M, sigmean, sigsigma );
// Fix ratio of Gaussians to MC
RooRealVar ratio(“ratio”,“Ratio of widths”,2.0,1.0,3.0);
RooGaussian const_ratio(“const_ratio”,"",ratio,RooFit::RooConst(2.0),RooFit::RooConst(0.1));
RooProduct sigsigma2("#sigma_{B}2",“B sigma2”,RooArgSet(sigsigma,const_ratio));
RooGaussian BSig_RF2( “Bsig_RF2”, “Signal Gaussian B RF Mass”, Donly_CM_M, sigmean, sigsigma2 );

So I have the parameter ratio that is used to calculate sigsigma2, and I wish to constrain the value of ratio. However, when I do this it always stays at the value I set here RooFit::RooConst(2.0).

The fit also contains other components so I assume the likelihood favours changing those rather than taking a penalty from changing const_ratio.

So basically I just wanted to know if anyone has successfully constrained a parameter passed to a RooProduct?

Cheers,

Mark

P.S. I know it isn’t a problem with constraints in general as I also constrain other things in the fit successfully.

Hi,

I don;t understand how you have introduce the Gaussian constraint in the model. You should define as a multiplicative terms in your model, i.e. total_pdf = pdf * constraint_pdf and not use it for transforming the variable.
See for example the tutorials tutorials/roofit/rf604_constraints.C and also my recent post

Lorenzo

Ah of course, many thanks!

Sorry for the noise…