RooStats Feldman Cousins: Error in <TRint::HandleTermInput()>: std::out_of_range caught: vector::_M_range_check

Hi all:

I am trying to create a toy Feldman-Cousins confidence limits demo from the two sample scripts at
https://root.cern.ch/root/html/tutorials/roostats/rs101_limitexample.C.html
and
https://root.cern.ch/root/html/tutorials/roostats/StandardFeldmanCousinsDemo.C.html

So far I am able to generate a confidence belt successfully, but I get an error

Error in <TRint::HandleTermInput()>: std::out_of_range caught: vector::_M_range_check
at line 118 of my attached code fc_demo.C (5.4 KB)

double arMax = belt->GetAcceptanceRegionMax(*tmpPoint);

and I’m not quite sure what line in the GetAcceptanceRegionMax function is causing the bug as I’ve checked that tmpPoint is well-defined and nonempty.

Thank you!

@StephanH @moneta can you give a hand with this one?

Hi

I can look into this. @rrm : if you have a single parameter of interest (i.e. your problem is one-dimensional) it is recommended to use for FC the StandardHypoTestInvDemo,C , see
(notice also the update link to the doc, you are using the old , obsolete documentation)
https://root.cern.ch/doc/master/StandardHypoTestInvDemo_8C.html

with the parameter for FeldmanCousins:

  • type = 0 (Frequentist calculator)
  • testStatType = 3 ( 2-sided profile likelihood test statistics: this is what defines FC)
  • useCLS = false ( the interval is computed using the CL(S+B) and not CL(S+B)/CL(B) as in the CLs case )

Lorenzo

A little addition:
It wasn’t well documented (I’m fixing that now), but you need to add

 fc.CreateConfBelt(true);

to the FeldmanCousins config if you need a ConfidenceBelt.

1 Like

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