Repository navigation
WeightMin/WeightMax - #70
Open
jedori0228 wants to merge 1 commit into
Open
jedori0228 wants to merge 1 commit into
jedori0228 wants to merge 1 commit into
Conversation
…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>
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.
Summary
Replaces the per-tool weight-limit options with the per-parameter
WeightMin/WeightMaxlimits added toSystParamHeaderin systematicstools, and applies the clamp inresponse_helper.Requires the systematicstools PR
feature/YAML_WeightLimit→feature/YAML(commita9ecff5); 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>_WeightMaxoverride them for one dial. Both default to-inf/+inf(no clamping).The limits are written into the generated parameter headers as
weightMin/weightMax(only when set).For dependent dials (e.g. GENIE
ZExpA*CCQE, MINERvAE2p2hE2p2h_A/Bwithoutignore_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_helpercallsClampWeightResponses(fromsysttools::ISystProviderTool) right after each provider call:GetEventResponses(ev)andGetEventResponses(ev, i): absolute weights are clamped.GetEventVariationAndCVResponse(ev): bothparamCVWeightandparamCVWeight * tweak_responseend up within the limits.GetEventWeightResponseis not clamped (it is a product over several parameters, so no single header's limits apply).DumpConfiguredTweaksNuSystcalls the provider directly (for its per-channel skip), so it gets the same one-line clamp afterGetEventVariationAndCVResponse. Calling a provider's methods directly still returns raw, unclamped weights (e.g.DumpDialResponseNuSyst).Removed per-tool limits
LimitWeightsLimitWeightsMnv2p2hGaussEnhancement_LimitWeightsWeightLimitsinMECResponse_input_manifestWeightLimitsinCCQEXSecCorr_input_manifestMECq0q3ResponseCalc/MECq0q3ResponseCalc3Dno longer take or apply weight limits. The old options are now ignored.GENIEReWeightParamConfig,MINERvAE2p2handBeRPAWeightpass their tool YAML to the newFinalizeAndValidateDependentParameterssignature.Config files
Old per-tool limits are moved to tool-level
WeightMin/WeightMaxwith 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
weightMin/weightMaxand load unclamped; regenerate them from the updated tool configs.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:WeightMax: 1.05: b1–b4 capped at 1.05 (up to 6.36 without limits); withb2_WeightMax: 2.0, b2 capped at 2.0 and the others at 1.05.WeightMin > WeightMax: rejected at generation.ZExpA1/A2CCQE: jointZExpAVariationResponseweight capped at 1.05 (up to 9.0 without limits).b1_central_value: 1, limits[0.8, 1.0]):paramCVWeightandparamCVWeight * tweak_responsewithin[0.8, 1.0].weightMin: 0.1/weightMax: 1000on all 4 dial headers.Open question
When the clamped CV is 0 (only with
WeightMin <= 0and a negative raw CV), the entry is left unclamped. UsingWeightMin > 0avoids this. Behaviour for this case is still to be decided.🤖 Generated with Claude Code