Skip to content

WeightMin/WeightMax - #70

Open
jedori0228 wants to merge 1 commit into
feature/YAMLfrom
feature/YAML_WeightLimit
Open

jedori0228 wants to merge 1 commit into
feature/YAMLfrom
feature/YAML_WeightLimit

Conversation

@jedori0228

Copy link
Copy Markdown
Contributor

Summary

Replaces the per-tool weight-limit options with the per-parameter WeightMin / WeightMax limits added to SystParamHeader in systematicstools, and applies the clamp in response_helper.

Requires the systematicstools PR feature/YAML_WeightLimit → feature/YAML (commit a9ecff5); this branch does not build without it.

Configuration

Limits are set in the tool configuration. Tool-level keys apply to every dial of the tool, and <DIAL>_WeightMin / <DIAL>_WeightMax override them for one dial. Both default to -inf / +inf (no clamping).

CCQEXSecCorr_Tool_Config:
  tool_type: CCQEXSecCorr
  WeightMin: 0.0
  WeightMax: 30.0
  # CCQEXSecCorr_WeightMax: 10.0   # optional per-dial override
  ...

The limits are written into the generated parameter headers as weightMin / weightMax (only when set).

For dependent dials (e.g. GENIE ZExpA*CCQE, MINERvAE2p2h E2p2h_A/B without ignore_parameter_dependence), the dials combine into one weight held by the response dial (e.g. ZExpAVariationResponse), so only the tool-level limits apply, on the response dial.

Where the clamp is applied

response_helper calls ClampWeightResponses (from systtools::ISystProviderTool) right after each provider call:

  • GetEventResponses(ev) and GetEventResponses(ev, i): absolute weights are clamped.
  • GetEventVariationAndCVResponse(ev): both paramCVWeight and paramCVWeight * tweak_response end up within the limits.
  • GetEventWeightResponse is not clamped (it is a product over several parameters, so no single header's limits apply).

DumpConfiguredTweaksNuSyst calls the provider directly (for its per-channel skip), so it gets the same one-line clamp after GetEventVariationAndCVResponse. Calling a provider's methods directly still returns raw, unclamped weights (e.g. DumpDialResponseNuSyst).

Removed per-tool limits

Tool Removed option Previous behaviour
MINERvAE2p2h LimitWeights clamped each weight (B dial clamped before dividing by the CV)
FSILikeEAvailSmearing LimitWeights clamped each weight
MINERvAq0q3Weighting Mnv2p2hGaussEnhancement_LimitWeights clamped the 2p2h weights
MECq0q3InterpWeighting WeightLimits in MECResponse_input_manifest clamped each Enu-plane weight, the blended CV and each variation
CCQEXSecCorr WeightLimits in CCQEXSecCorr_input_manifest clamped each Enu-plane weight and the blended weight

MECq0q3ResponseCalc / MECq0q3ResponseCalc3D no longer take or apply weight limits. The old options are now ignored.

GENIEReWeightParamConfig, MINERvAE2p2h and BeRPAWeight pass their tool YAML to the new FinalizeAndValidateDependentParameters signature.

Config files

Old per-tool limits are moved to tool-level WeightMin / WeightMax with the same values:

  • CCQEXSecCorr.ToolConfig.yaml: [0.0, 30.0]
  • MECq0q3InterpWeighting/SuSAv2To*_MEC_*_all.ToolConfig.yaml (4 files): [0.1, 1000.0]
  • DUNE_TDRv1/{FSILikeEAvailSmearing, MINERvAE2p2h, MINERvAq0q3Weighting}.ToolConfig.yaml: [0, 1e6]
  • Ar23+_knobs.ToolConfig.yaml: CCQEXSecCorr block [0.0, 30.0], both MEC blocks [0.1, 1000.0]

fcl/ is not changed.

Behaviour changes

  • MECq0q3InterpWeighting and CCQEXSecCorr no longer clamp inside the calculation (per-Enu-plane weights before blending; MEC ±σ variations built from the clamped CV). Only the final weights are clamped, so results can differ slightly.
  • MINERvAE2p2h's B dial is now clamped after the CV division, not before.
  • Parameter-header files generated before this change have no weightMin / weightMax and load unclamped; regenerate them from the updated tool configs.
  • With a range that excludes 1 (e.g. WeightMin: 1.2), events a provider does not apply to (weight 1) are clamped too.

Testing

Built against the systematicstools branch (including the DUNE_TDRv1 tools), then ran on a 2000-event GENIE CCQE sample through GenerateSystProviderConfigNuSyst + DumpConfiguredTweaksNuSyst:

  • No limits: weights identical to before and parameter headers byte-identical (same md5).
  • ZExpPCAWeighter, tool-level WeightMax: 1.05: b1–b4 capped at 1.05 (up to 6.36 without limits); with b2_WeightMax: 2.0, b2 capped at 2.0 and the others at 1.05.
  • WeightMin > WeightMax: rejected at generation.
  • GENIE dependent ZExpA1/A2CCQE: joint ZExpAVariationResponse weight capped at 1.05 (up to 9.0 without limits).
  • CV form (b1_central_value: 1, limits [0.8, 1.0]): paramCVWeight and paramCVWeight * tweak_response within [0.8, 1.0].
  • MEC q0-binned config: weightMin: 0.1 / weightMax: 1000 on all 4 dial headers.

Open question

When the clamped CV is 0 (only with WeightMin <= 0 and a negative raw CV), the entry is left unclamped. Using WeightMin > 0 avoids this. Behaviour for this case is still to be decided.

🤖 Generated with Claude Code

…headers

Weight limits now live on each SystParamHeader (weightMin/weightMax,
systematicstools a9ecff5) and are set in the tool configuration with
tool-level WeightMin/WeightMax, optionally overridden per dial with
<DIAL>_WeightMin/<DIAL>_WeightMax. Defaults are -inf/+inf (no clamp).

The clamp is applied in response_helper right after each provider call
(GetEventResponses and GetEventVariationAndCVResponse) and in
DumpConfiguredTweaksNuSyst. For the CV form, both paramCVWeight and
paramCVWeight * tweak_response end up within the limits. Calling a
provider directly still returns raw weights.

- Remove the per-tool clamps and their options: LimitWeights
  (MINERvAE2p2h, FSILikeEAvailSmearing),
  Mnv2p2hGaussEnhancement_LimitWeights (MINERvAq0q3Weighting), and
  WeightLimits in the MECq0q3InterpWeighting / CCQEXSecCorr manifests,
  including the per-Enu-plane clamp in MECq0q3ResponseCalc. Old keys are
  now ignored.
- Pass the tool YAML to FinalizeAndValidateDependentParameters so the
  response dial of dependent dials gets the tool-level limits.
- Move the old limits in config/ to tool-level WeightMin/WeightMax.
- Document the behaviour in doc/CLI_TOOLS.md.

Co-Authored-By: Claude Opus 5.5 <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