Upper Limit calculation

The constraint term looks correct. Would you just also “.Print("")gEff and Eff to check that their ranges and const-ness are configured correctly? Eff should be allowed to vary while gEff should be constant.

The parameter of the likelihood model should not be a global observable. An observable is something that has been measured using data or MC (the target efficiency), and a parameter is something that changes the likelihood model. Therefore, gEff = globObs, Eff = parameter.
It is important to not mix up those two because the fitter touches the parameters, but it leaves the global observables untouched.

That’s the problem. It’s correct to multiply the likelihood with the constraint terms, but you also need to tell RooFit to actually apply the constraints. Check the tutorial I posted above to see this working.
[If you use a ModelConfig (I’m not sure you do) and set global observables and parameters correctly, the constraints will be switched on automatically.]

Probably that’s not correct. It’s a bit hard to decode what’s what from the factory syntax, but I guess it’s this:

  • eff_MC is a double. RooFit cannot interpret doubles
  • gEff is global observable that should be constant, and is has the value of the monte carlo efficiency
  • Eff is a parameter that changes the likelihood model, and it is constrained to be close to the value of gEff by means of the constraint term.
1 Like