EFT interference samples - negative bins
TRExFitter Version: v4.17 and Commit Hash:cb494adb
Description
When running over histograms with negative bins, they're all set to a small +ve value. For our EFT analysis, with many negative bins for the linear/interference histograms, we need these bins to retain their values for the calculation of the full EFT sample. We have been able to mitigate this issue mostly by bypassing any checks for negative bins, but this is then also applied to the sm samples.
The envelope calculation is also showing strange behaviour when used with negative bins, as the lowest (signed) value is taken for the down variation, when we would want the smallest (in magnitude) value to be taken, and vice versa. Using the envelope function also removes the negative bins after the calculation.
Reproducer Configuration
Attached is a minimal config that should reproduce the issue, along with the root file
Ideas to Resolve
Bypassing the -ve bin checks fixed most of the issues but was not ideal, a flag for EFT or similar files (where -ve bins are expected) that disables these checks would probably work well.
For the envelope calculation, changing the diff_up calculation to include std::abs on the bin content, but this assumes that the sign in the bin never flips, which may not be a solid assumption in all cases