Skip to content

Add data-driven background param models: ABCD, SmoothABCD, ExtendedABCD, SmoothExtendedABCD#130

Open
davidwalter2 wants to merge 9 commits intoWMass:mainfrom
davidwalter2:260411_abcd
Open

Add data-driven background param models: ABCD, SmoothABCD, ExtendedABCD, SmoothExtendedABCD#130
davidwalter2 wants to merge 9 commits intoWMass:mainfrom
davidwalter2:260411_abcd

Conversation

@davidwalter2
Copy link
Copy Markdown
Collaborator

@davidwalter2 davidwalter2 commented Apr 11, 2026

  • Rename poi_modelparam_model and add explicit npoi/nnui split so models can declare pure nuisances with npoi=0
  • Support multiple --paramModel invocations: each call appends a spec; load_models() wraps them in CompositeParamModel automatically
  • ABCD: data-driven background estimation using 4 regions. Free per-bin parameters a, b, c for regions A, B, C; D predicted as D = A·C/B · mc_factor_D. npoi=0,
    nnui=3·n_bins
  • SmoothABCD: like ABCD but all three free-parameter regions are parameterised with an exponential polynomial along one nominated axis: val(x) = exp(p₀ + p₁·x̃ + …). Reduces
    parameters from 3·n_bins to 3·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_bins
  • SmoothExtendedABCD: 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, exp for smooth variants), MC correction factor absorbs non-unity MC
templates, and they compose freely with Mu or other models via CompositeParamModel.

CLI examples

# Standard ABCD
--paramModel Mu --paramModel ABCD nonprompt ch_A ch_B ch_C ch_D
                                                               
# Log-linear smooth fake rate along pt                                                                                                                                                
--paramModel Mu --paramModel SmoothABCD pt nonprompt ch_A ch_B ch_C ch_D
                                                                                                                                                                                      
# 6-region extended ABCD
--paramModel Mu --paramModel ExtendedABCD nonprompt ch_Ax ch_Bx ch_A ch_B ch_C ch_D
                                                                                   
# Smooth 6-region, quadratic polynomial                                                                                                                                               
--paramModel Mu --paramModel SmoothExtendedABCD pt order:2 nonprompt ch_Ax ch_Bx ch_A ch_B ch_C ch_D                                                                        

Test plan

  • tests/make_abcd_tensor.py and tests/make_extended_abcd_tensor.py produce valid tensors
  • All four models load with correct npoi/nnui/nparams
  • Fits converge with --saveHists for ABCD, SmoothABCD, ExtendedABCD, SmoothExtendedABCD
  • New CI jobs make-abcd-tensors and abcd-fits cover all four models

davidwalter2 and others added 6 commits April 11, 2026 09:31
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>
@davidwalter2 davidwalter2 changed the title Rename 'poi model' to 'param model' and add POI/nuisance configurability Add data-driven background param models: ABCD, SmoothABCD, ExtendedABCD, SmoothExtendedABCD Apr 11, 2026
davidwalter2 and others added 3 commits April 11, 2026 15:07
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant