It is implemented as:
RooAddition constrSum("add","add", RooArgList(*f_WZLL,*f_WZLT,*f_WZTL,*f_WZTT));
RooRealVar targetSum("target", "target", 1.00);
RooRealVar constrStrength("strength","strength", 0.005); // Can adjust impact of constraint here
RooGaussian constraint("constraint","constraint", constrSum, targetSum, constrStrength);
const RooArgList constraintset(constraint);
return pdf->fitTo(*data, ExternalConstraints(constraintset), Save(),
I tested this for different values of “constrStrength”. For 1 i obviously get poor values and large uncertainties. For 0.1 and 0.01 i get slightly off values and decent uncertainties. For values even smaller i get the errors above.
I know that Non-differentiable functions are bad for this. However i do need pretty hard constrains for that because that is the physics behind this that the fraction can not be negative and i want to reproduce the results of the fit using “mus” where this is all true by default. So i would need a very strong constraint on the Sum of the remaining fractions to be lower than 1.
Some results from the different fits:
fit with 3 fraction parameters (f_TT removed)(nominal values recalculated from Ntot and f_X values)
fit with 3 fraction parameters (f_LTremoved)(nominal values recalculated from Ntot and f_X values)
fit with 4 fraction parameters (gauss constraint on Sum=1 with strength=0.008)(nominal values recalculated from Ntot and f_X values)
(1-Sum of fractions=-0.0001)
We can see that using the 3 Parameter fit removing f_TT gives results very close to the mu fit(i would still like them to agree more to be honest) but that the one where i remove LT gives fairly worse results. The one with the gaussian constraint also gives significantly worse values compared to the nominal fit.
For the first fraction fit it might be enough to increase the fit precision a bit (can that be done?) while for the second one i think the Sum(3 fractions)<1 is necessary. For the last one i do not know what to do.