Repository navigation
Multiply splines that share a binning before migrating them to the fit binning - #625
Draft
leehagaman wants to merge 1 commit into
Draft
leehagaman wants to merge 1 commit into
leehagaman wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In binned mode, a spline defined in a different binning from the one being filled (e.g. free-flux splines in true E_ν, filled into reco E) is migrated through the (spline bin, reco bin) event histogram. Previously each spline was migrated separately and the migrated factors were multiplied. That's only correct to first order in the shifts. It fails badly for binned_unconstrained (free-flux) splines, where each spline scales a disjoint set of true bins by up to 10×. A reco bin fed by several true bins then gets scaled by every spline's averaged factor: ∏_i (1 + x_i w_i) instead of the correct 1 + Σ_i x_i w_i. For example, with all free-flux knobs at 9 (10×), binned mode predicted 39–392× CV, where event-by-event gives ≤10×.
This change multiplies the per-bin factors of all splines that share a binning first, then migrates the product once. The binning's first spline carries the product, and the others contribute 1. That's exact for free flux. For other splines binned outside the fit variable it removes the second-order error, and splines binned in the fit variable are unchanged. It's applied in the uncached binned fill, the cached fill (full and incremental), and the analytic gradient. Pre-migration flux splines in visible-decay models are left on their own path.
Tested on the GUMP Oct13 free-flux XML with random throws of all 95 splines. Binned now matches event-by-event within 0.16%, the same agreement as configs with no free-flux splines. The cached and incremental fills match the uncached fill to about 1e-6, and the analytic gradient matches finite differences. Free-flux surfaces made with binned mode before this fix should be rerun.
(PR text generated by Claude)