Skip to content

Update the reweight tool for z expension model - #1

Open
LiangLiu212 wants to merge 65 commits into
devfrom
feature/uncertainty-zexp
Open

LiangLiu212 wants to merge 65 commits into
devfrom
feature/uncertainty-zexp

Conversation

@LiangLiu212

Copy link
Copy Markdown
Owner
  • add the reweight for z expension axial form factor
  • update the reweight for z expension vector form factor

Using the error propagation formula to scale the cross-section to get the weight.

LiangLiu212 pushed a commit that referenced this pull request Feb 18, 2026
…tions

Apply Gray's fixes to FSI model variation reweighting
LiangLiu212 and others added 23 commits March 13, 2026 14:56
…enabled actual reweighting to the 2p-2h Martini model by inputting MartiniEricsonChanfrayMarteauMECPXSec2024 into placeholder for XSecShape_CCMEC_Martini dial
…onsidering the 2p2h Martini model and added normalsation for DecayAngMEC parameter with two tweak dials
…cia model and the energy transfer cut-off in the Martini model
…ecShape_CCMEC and XSecShape_CCMEC_Martini dials
…Martini-Ericson_Chanfray-Marteau model is input as default
…ied instead of divided (input default model gets up- or down-reweighted according to renormalised cross section ratio being greater or smaller to 1.)
…ng hard-coded xsec ratio tables to it reading the xsecs directly from the user's input cross-section spline xml-file. The user can now input multiple xml-files via the cross-sections option of grwght1p.
…RwghtNCorrelatedParams.cxx (matches original implementation)
…s may

be supplied via the --cross-sections command-line option
LiangLiu212 and others added 30 commits July 21, 2026 13:23
…EZAFF.xml

The central-difference step in XSecPartialDerivative (fraction of the
per-coefficient 1-sigma) was hard-coded to 0.1. Read it from
config/GReWeightNuXSecCCQEZAFF.xml (registered in reweight_master_config.xml,
loaded through the standard AlgConfigPool/GENIE_REWEIGHT machinery), with a
0.1 fallback when the config is absent, a fatal on non-positive values, and a
SetFiniteDiffDelta() programmatic override.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GReWeightNuXSecCCQEELFF::Init() (and the same latent pattern in
GReWeightNuXSecCCQEZAFF) read ZExp*@CovarianceMatrix from the FF model
registry unconditionally, before checking fModelIsZExp. On any tune whose
EL/axial FF model lacks the covariance params this hits a missing Registry
key FATAL during construction — and since grwght1p adopts the full
calculator roster, it broke every dial, not just the zexp ones. Move the
covariance lookup+read inside the fModelIsZExp block in both calculators;
also drops two full-config debug dumps (conf_pool/gpl Print) from ELFF Init.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reweight-tool numerical settings do not belong in the tune/config-XML
machinery (that configures physics models). Drop the config-XML lookup added
earlier; delta is a built-in 0.1 default in the calculator with a
SetFiniteDiffDelta() override, now exposed per job as grwght1p --fd-delta
(validated > 0 at parse time and again at first use).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ELFF uses the same covariance-propagation scheme as ZAFF, over the 4 stacked
coefficient blocks (AP,BP,AN,BN) x Kmax. Apply the same fixes:
- dimension cross-checks in Init(): 4*Kmax vs ZExpELFF@CovarianceMatrix
  dimension, and each QEL-Z_{AP,BP,AN,BN} vec-double length vs Kmax
- finite-difference delta: built-in 0.1 default + SetFiniteDiffDelta(),
  >0 guard at first use; grwght1p --fd-delta now applies to ELFF too

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- GReWeightNuXSecCCQEZAFF::Init read QEL-Gep0/Gmp0/Gen0/Gmn0 from the AXIAL
  form factor model config. Those are electric-FF parameters (copied from the
  ELFF calculator), absent from ZExpAxialFormFactorModel.xml, and unused by
  the axial weight calculation - the read fataled the first time the full
  Init path ran under the shipped AR23 configs (grwght1p --tune AR23...).
- reweight_master_config.xml still referenced the removed
  GReWeightNuXSecCCQEZAFF.xml (bad earlier revert via git checkout), causing
  AlgConfigPool load errors; drop the entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Without a table entry OneSigmaErr(kXSecTwkDial_ZExpZAFF) is 0 (table
default), so fZExp_Scale = dial x 0 and every ZAFF weight came out exactly
1. Unity scale mirrors the existing holistic ZExpELFFCCQE entry - the
propagated covariance already carries the physics scale.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Second selectable method for the xsec 1-sigma alongside the analytic error
propagation (the mode the original header comments anticipated): throw
N correlated coefficient universes a' = a + L*z using the cached Cholesky
factor of the covariance (genie::utils::math::CholeskyDecomposition /
CholeskyGenerateCorrelatedParamVariations, as in grwghtnp) and take the
sample std dev of the recomputed differential xsec. Reproducible through
RandomGen (--seed). Default remains propagation; universes default 1000.
Driver options: grwght1p --sigma-method propagation|cholesky, --n-universes.
Retires the unused fIsSinglePara/fIsAllPara placeholders. ZAFF only for now;
ELFF mirror to follow after validation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Same machinery as ZAFF: ESigmaEstimator enum, cached Cholesky factor of the
validated 4*Kmax covariance, universe sampler over the stacked (AP,BP,AN,BN)
coefficient blocks, sample-std-dev sigma. grwght1p --sigma-method /
--n-universes now apply to the ELFF instance as well. Retires the unused
fIsSinglePara/fIsAllPara placeholders in ELFF.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Caching L unconditionally in Init made even the propagation estimator (which
never needs L) fail when the covariance is not positive-definite - exactly
what happens with the current 16x16 ELZExpFF.dat (TDecompChol finds a small
negative eigenvalue, L(3,3)^2 ~ -3e-5). Compute L on first kSigmaCholesky
use via TDecompChol, with a clean pFATAL naming the matrix and suggesting
--sigma-method propagation as the fallback. Applied to both ZAFF and ELFF.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Update README to reflect current collaboration list
fix distclean of Apps; had wrong wildcarding pattern
Add reweighting of pion fate fractions from hA2018 to hA2025
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.

5 participants