root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.7k stars 1.28k forks source link

[RF] Off-by-one error in Roofit/Histfactory/HistoToWorkspaceFactoryFast #12704

Closed CoffeeIntoScience closed 1 year ago

CoffeeIntoScience commented 1 year ago

There is an error here that was introduced in dc65afe:

https://github.com/root-project/root/blob/6abb8e90d9bea276269f375a67855c4065813343/roofit/histfactory/src/HistoToWorkspaceFactoryFast.cxx#L760-L762

This error should only be thrown when the number of observables is not 1, 2 or 3, but currently fires if the number is equal to 3.

See the change from dc65afe here where the mistake is evident:

https://github.com/root-project/root/commit/dc65afe00ec72d18ebc5d31e7b2d6b50c6a20423#diff-42ea09980f1ed2bacde4381f212c35d78be6ddedccf746953dc99d6455525d8aL1256-R1221

The conditional should be if (fObsNameVec.empty() || fObsNameVec.size() > 3)

guitargeek commented 1 year ago

Thank you very much for reporting this!

I fixed this for the upcoming 6.30 and for the next patch releases 6.26.12 and 6.28.04 (this bug also affects 6.26).

The 6.28.04 patch release will probably come out this week.