umd-lhcb / root-curated

A curated software root (foundation) for most of our analysis repos
BSD 2-Clause "Simplified" License
3 stars 0 forks source link

Omission of a fix from Phoebe's HistFactory patch #12

Closed yipengsun closed 1 year ago

yipengsun commented 1 year ago

Phoebe discovered that our nix version of ROOT 5.34 produces slightly different fit results than her local copy of ROOT 5.34. This is due to the patch to nix version doesn't include a fix to use interpolation codes in a consistent way.

We should port this change for all supported ROOT versions:

FYI @manuelfs @CoffeeIntoScience

yipengsun commented 1 year ago

More technical details:

In PiecewiseInterpolation, when evaluating the the interpolated value or filling the value to cache, each associated paramater need to be evaluated, with the correct interpolation code which determines the interpolation function to use. For example icode == 0 mean a piece-wise linear interpolation.

The bug makes the association between parameter and its interpolation code inconsistent.

While it's definitely a bug, it is problematic for DDX templates only as they contain parameters of different interpolation codes. All other shape variations use icode == 2 exclusively and are unaffected by this bug.

yipengsun commented 1 year ago

Another comment on generating patch:

The 6.16 and 5.34 branches have auxiliary nix files to aid development. We don't want them to be part of the patch. So the patch should be generated this way, take 6.16 for example:

git diff v6-16-00 ':!nix' ':!flake.*' ':!.envrc'
yipengsun commented 1 year ago

Updated patches and tested in the https://github.com/umd-lhcb/histfactory-fitter-demo project.

One problem for 6.24 is that the simple combinatorial background fit doesn't work anymore. Switch back to 6.16 it worked fine again.

yipengsun commented 1 year ago

ROOT 6.24 is still problematic in running the fit as it gets stuck on the pre-control fit for 5+hrs. We'll stick w/ ROOT 6.16 for now.