RooStats strange result when poi has no range

I was trying to run the StandardHypoTestDemo.C on my workspace and I noticed that result are wrong when the poi has no range.

You can see the complete code here:

nbviewer.ipython.org/gist/wiso/0 … 66000a78d5

If i define my poi with a range

nsig = ws.factory('nsig[100, 0, 1000]')   # POI has range

I get the correct result (as data I am using an bkg only asimov)

Results HypoTestAsymptotic_result: 
 - Null p-value = 0.5
 - Significance = -0
 - CL_b: 0.5
 - CL_s+b: 0.999998
 - CL_s: 2
Asymptotic results 
 Expected p -value and significance at -2 sigma = 0.00515873 significance 2.565 sigma 
 Expected p -value and significance at -1 sigma = 0.000181925 significance 3.565 sigma 
 Expected p -value and significance at 0 sigma = 2.49742e-06 significance 4.565 sigma 
 Expected p -value and significance at 1 sigma = 1.31073e-08 significance 5.565 sigma 
 Expected p -value and significance at 2 sigma = 2.60157e-11 significance 6.565 sigma 

but if I define the poi without a range I get other numbers:

Results HypoTestAsymptotic_result: 
 - Null p-value = 5.60319e-06
 - Significance = 4.39248
 - CL_b: 5.60319e-06
 - CL_s+b: 0.973967
 - CL_s: 173824
Asymptotic results 
 Expected p -value and significance at -2 sigma = 7.28557e-06 significance 4.33507 sigma 
 Expected p -value and significance at -1 sigma = 4.77529e-08 significance 5.33507 sigma 
 Expected p -value and significance at 0 sigma = 1.18614e-10 significance 6.33507 sigma 
 Expected p -value and significance at 1 sigma = 1.108e-13 significance 7.33507 sigma 
 Expected p -value and significance at 2 sigma = 3.8725e-17 significance 8.33507 sigma 

Hi,
I cannot reproduce the problem using the latest ROOT version.
How did you define exactly the variable ‘sig’ without the range ?
I did

nsig = ws.factory('nsig[100]')
nsig.setConstant(0)

Also which ROTO version are you using ?

Lorenzo

I create the poi without range as a constant:

nsig = ws.factory('nsig[100]')

maybe this is the problem. By the way should the macro check that the poi is not a constant and vary it?

Hi,

I think this is the problem. I could make this check in the macro, but it does not make much sense to define a model with a POI constant, so you should add in your code nsig.setConstant(0), if you define it as constant.

Best Regards

Lorenzo