Understand the HypoTestInverter scan plot

Dear experts,

I use FrequentistCalculator to get the attached plot. I am having two questions hope you could help:

  • the -2sigma error band is quite spiky, any nice way to reduce the spikes ? I have already used about 3000 toys for each mu.
  • I was thinking on the plot, from left to right the first intersecting point (of the lower boundary of the -2sigma band) with the line (p-value=0.05) would be the same as the number returned from the function GetExpectedUpperLimit(-2), but I find this is not the true. Any one knows why, and how to properly associate the numbers returned from the GetExpectedUpperLimit(int) and the intersecting points on the plots?

HypoTestInverter_Scan_MET300GeV.pdf (34.5 KB)


  • Yes your -2 sigma lower band contains many spikes. This seems a bit normal if you are using 3000 toys. You might want to try by using less points to scan and maybe more toys/point.
    Also you should make sure you are using about the same number of toys for both the null and alternate models.
    By default I think the double number of toys is generated for the null compare to the alternate model. This should be fine, but if you have a factor of 10 then it could be a problem.

  • Yes this is correct, GetExpectedUpperLimit(-2) should be the intersect of the -2 sigma band. However in the calculation some interpolation between th points is done and it could be that in case of so many spikes as shown in the plot, the intersect shown in the plot is not the same that is computed.

Best Regards


Dear Lorenzo

Thanks a lot for the very clear answers! I will try again and will let you know if there are still puzzles.

Best Regards,