Gaussian constraint with HistFactory

Hi,

I have troubles adding a gaussian constraint in my model built using HistFactory.
Let’s suppose I have a parameter “efficiency” which has a central value “eff_value” know from simulation with a given error “eff_error”. To add this parameter to the fit with an associated gaussian constraint I’m confused between four possibilities:

mysample.AddNormFactor("efficiency", eff_value, eff_value - 3*eff_error, eff_value + 3*eff_error)
mymeasurement.AddConstantParam("efficiency")
mysample.AddOverallSys("eff_constraint", 1-eff_error/eff_value, 1+eff_error/eff_value)
mysample.AddNormFactor("efficiency", eff_value, eff_value - 3*eff_error, eff_value + 3*eff_error)
mysample.AddOverallSys("eff_constraint", 1-eff_error/eff_value, 1+eff_error/eff_value)
mysample.AddNormFactor("efficiency", eff_value, eff_value - 3*eff_error, eff_value + 3*eff_error)
mymeasurement.AddConstantParam("efficiency")
mysample.AddOverallSys("efficiency", 1-eff_error/eff_value, 1+eff_error/eff_value)
mysample.AddNormFactor("efficiency", eff_value, eff_value - 3*eff_error, eff_value + 3*eff_error)
mysample.AddOverallSys("efficiency", 1-eff_error/eff_value, 1+eff_error/eff_value)

Is one of these options correct or should I do something different?

Thanks
Jacopo

1 Like

Hi,

I think 1,3 are fine and will give same results. It changes only the name of parameters in the workspace.
As described in the HistFactory documentation (page 7-8), AddNormFactor will introduce an overall normalisation parameter, that by default is not constant. If you want to add a constraint term you need to use AddOverallSys. AddOverallSys("efficiency",...) will introduce a parameter with a Gaussian constraint called alpha_efficiency. So 1 and 3 are equivalent, only that in 1 you have the parameter called alpha_eff_constraint.

2 and 4 instead will have the parameter efficiency floating and not constraint explicitly. This is OK if you want to fit that parameter on the data

Hope it is clear now
Cheers

Lorenzo

1 Like

Thanks.
If I choose for example option 3 then I get the following error:

[#2] ERROR:HistFactory -- could not corresponding auxiliary measurement  nom_efficiency

Has this something to do with the constraint?

Jacopo

I don’t understand this error, can you maybe add a printout of your workspace and also code to generate it (or xml file) ?
The workspace should not have a nom_efficiency variable, but an alpha_nom_efficiency.
It could be also that the error is not important

Lorenzo

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.