Skip to content

RooStats::HypoTestInverterResult::FindIndex fails if xvalue == 1 #8641

@aemerman

Description

@aemerman
  • Checked for duplicates

Describe the bug

In RooStats::HypoTestInverterResult::FindIndex( x ), if x == 1 then the return value is always -1 rather than the index of that xvalue. The problem is on L571-573 (in current master) of HypoTestInverterResult.cxx where the following if statement is used:

if ( (std::abs(xvalue) > 1 && TMath::AreEqualRel( xvalue, xpoint, tol) ) ||
     (std::abs(xvalue) < 1 && TMath::AreEqualAbs( xvalue, xpoint, tol) ) )
  return i; 

Please change the first piece of one of these two statements to include xvalue==1 (i.e. from > to ≥ or < to ≤). I don't think it matters which is changed.

Expected behavior

FindIndex should return the index of requested xvalue in the internal results array.

To Reproduce

Setup

I am using ROOT 6.22/00 from LCG_98python3 but this is still in issue in the master branch (per online documentation).

Additional context

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions