Add data-driven background param models: ABCD, SmoothABCD, ExtendedABCD, SmoothExtendedABCD#130
Open
davidwalter2 wants to merge 9 commits intoWMass:mainfrom
Open
Add data-driven background param models: ABCD, SmoothABCD, ExtendedABCD, SmoothExtendedABCD#130davidwalter2 wants to merge 9 commits intoWMass:mainfrom
davidwalter2 wants to merge 9 commits intoWMass:mainfrom
Conversation
Rename the poi_models module to param_models throughout (directory, file, classes, attributes, CLI args). Each ParamModel now declares npoi (true POIs), nnui (model nuisances), and nparams = npoi + nnui, enabling future models (e.g. ABCD) where parameters are nuisances rather than POIs. All existing models set nnui=0 so behaviour is unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements the ABCD method as a new ParamModel subclass with npoi=0, nnui=3*n_bins. Free parameters a_i, b_i, c_i scale regions A, B, C per bin; region D is predicted as D_i = a_i*c_i/b_i times an MC correction factor. Positivity is enforced via squaring inside compute(). CLI syntax supports optional per-axis bin selections. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
--paramModel now uses action="append" so it can be specified multiple times. Each invocation defines one model spec; when multiple are given they are automatically combined via CompositeParamModel. Single-model usage and the default (Mu) are fully backward compatible. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SmoothABCD replaces the per-bin free parameters of one nominated axis with an exponential polynomial val(x)=exp(p_0+p_1*x̃+...), reducing 3*n_bins parameters to 3*n_outer*(order+1). Default order=1 (log-linear). Outer bins (remaining axes after the smooth axis) have independent polynomial coefficients. Reuses _get_global_indices from abcd_model.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ExtendedABCD uses 6 regions (Ax, Bx extra sideband + standard A, B, C, D) with log-linear fake rate extrapolation: D = C * Ax * B² / (Bx * A²). Free parameters: a, b, c, ax, bx per bin (npoi=0, nnui=5*n_bins). CI: new make-abcd-tensors and abcd-fits jobs covering ABCD, SmoothABCD, and ExtendedABCD with Mu+ABCD composite fits and --saveHists. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Like ExtendedABCD but all five free-parameter regions (A, B, C, Ax, Bx) are parameterised with an exponential polynomial along one smoothing axis: val_X(x) = exp(p_0 + p_1·x̃ + ...) Reduces parameters from 5·n_bins to 5·n_outer·(order+1). D is still derived from D = C·Ax·B² / (Bx·A²). CLI: SmoothExtendedABCD <axis> [order:N] <process> <ch_Ax> <ch_Bx> <ch_A> <ch_B> <ch_C> <ch_D>. Added to CI abcd-fits job. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously only npoi was subtracted; nnui (unconstrained model nuisances such as per-bin fake rates from ABCD) was not. For ABCD with npoi=0 the ndf was not reduced at all despite having nnui=3*n_bins free parameters. Use nparams (= npoi + nnui) instead. For the traditional Mu model nnui=0 so behaviour is unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
nnui stood for "number of nuisances"; npou stands for "parameters of uninterest", a clearer contrast to npoi (parameters of interest). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Enforces the invariant nparams = npoi + npou without redundant manual assignment. Removes all self.nparams = ... lines from subclasses. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
poi_model→param_modeland add explicitnpoi/nnuisplit so models can declare pure nuisances withnpoi=0--paramModelinvocations: each call appends a spec;load_models()wraps them inCompositeParamModelautomaticallyABCD: data-driven background estimation using 4 regions. Free per-bin parameters a, b, c for regions A, B, C; D predicted asD = A·C/B · mc_factor_D.npoi=0,nnui=3·n_binsSmoothABCD: like ABCD but all three free-parameter regions are parameterised with an exponential polynomial along one nominated axis:val(x) = exp(p₀ + p₁·x̃ + …). Reducesparameters from
3·n_binsto3·n_outer·(order+1). Default order=1 (log-linear)ExtendedABCD: 6-region variant adding extra sideband bins Ax, Bx. Log-linear fake rate extrapolation in the x direction:D = C·Ax·B² / (Bx·A²) · mc_factor_D.npoi=0,nnui=5·n_binsSmoothExtendedABCD: combines smooth parameterisation with the extended 6-region formula. All five free-parameter regions (A, B, C, Ax, Bx) use exponential polynomials.npoi=0,nnui=5·n_outer·(order+1)All four models share the same design principles: positivity guaranteed (squaring for ABCD/ExtendedABCD,
expfor smooth variants), MC correction factor absorbs non-unity MCtemplates, and they compose freely with
Muor other models viaCompositeParamModel.CLI examples
Test plan