Repository navigation
[RF][HS3] Parameters with a fixed value as domain axes (HS3 #131) - #24099
Merged
Merged
Conversation
cburgard
force-pushed
the
hs3-fixed-value
branch
from
November 11, 2026 13:23
a566780 to
f11e011
Compare
…ect#131) HS3 root-project#131 adds fixed domain axes: a parameter that only takes a single value says so in its domain, with an axis {"name": ..., "value": <value>}. This replaces the implicit rule of root-project#22283 (not released) that a parameter without a domain is constant. The key is defined once, as fixedValueKey. - Export: a named RooConstVar is written as a fixed axis in the default domain, and no longer to the parameter points. Constant RooRealVars keep their range and "const": true. - Import: a fixed axis gives a RooConstVar. It is an error if the axis also has min, max, nbins, edges or categories, if the value is not a number, if two domains disagree about the parameter, or if a parameter point gives it another value. - A parameter without domain is a RooRealVar again, as before root-project#22283: constant with "const": true, otherwise free, with a warning that HS3 requires a domain or "const": true. The option config().importNoDomainParametersAsRooConstVars is removed. - The attribute "is_const_var", with which ROOT versions before root-project#22283 marked named RooConstVars, is read again. Test: FixedDomainAxis; the RooConstVar tests expect the fixed axis instead of a missing domain; ParametersOnlyInParameterPoints expects parameters without domain and "const" to be free, with a warning. Assisted-by: claude-code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cburgard
force-pushed
the
hs3-fixed-value
branch
from
November 12, 2026 09:28
f11e011 to
e086bf0
Compare
cburgard
marked this pull request as ready for review
November 12, 2026 09:28
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.
Note
Implements HS3 PR #131, merged on 2026-11-12: fixed domain axes with the key
value.This Pull request:
Writes and reads parameters that only take a single value, e.g. a named constant like the Z mass, as a fixed domain axis with that value (HS3 #131). It replaces the implicit rule that a parameter without a domain is constant.
Background
Since #22283 (July 2026, not released), RooFit has written a named
RooConstVaras a parameter without a domain, and read every parameter without a domain back as aRooConstVar(config().importNoDomainParametersAsRooConstVars). HS3 #131 originally proposed to make this the standard: a parameter not listed in any domain is constant. In the review, the HS3 maintainers preferred an explicit construction, which is what #131 was merged with: a parameter that only takes one value says so in its domain with a fixed axis, and leaving out a domain doesn't make a parameter constant. Since no ROOT release has the implicit rule, no compatibility with it is kept.Changes or fixes:
RooConstVaris written as a fixed domain axis{"name": ..., "value": <value>}in the default domain, and no longer to the parameter points. ConstantRooRealVars are unchanged: a range in the domain,"const": truein the parameter points. LiteralRooConstVars are still written as numbers.RooConstVar, whichever domain has it. It needs no entry in a parameter point.min,max,nbins,edgesorcategories; the value is not a number; two domains give the parameter different single values, or one a single value and another a range; a parameter point gives the parameter a different value. The same value in a parameter point is accepted, and"const": falsestays the same as no"const".RooRealVar, as before #22283: constant with"const": true, otherwise free, with a warning that HS3 requires a domain or"const": true.config().importNoDomainParametersAsRooConstVarsis removed.RooConstVars with the attributeis_const_varinmisc.ROOT_internal. Such parameters are read asRooConstVaragain (#22283 had dropped this).Tests
FixedDomainAxis: import asRooConstVar, export and stable round trip, the same value in a parameter point, every error above, a parameter without domain (constant, or free with a warning), and the legacy attribute.RooGaussianConstVarSigmaExport,RooConstVarCollectionProxyExportandConstRooRealVarStaysDistinctFromRooConstVarexpect the fixed axis instead of a missing domain.ParametersOnlyInParameterPointsexpects parameters without domain and without"const": trueto be free, with the warning, instead of constant.importNoDomainParametersAsRooConstVarsoff now run with the default behaviour.Behaviour changes users may notice
RooConstVars appear as fixed domain axes instead of"const": trueentries in the parameter points.RooRealVar, not as aRooConstVar. Documents written by ROOT master since [HS3] Bugfixes to HS3 histfactoy_dist handling and other minor bugs #22283 rely on the implicit rule; theirRooConstVars come back as constantRooRealVars.RooJSONFactoryWSTool::config().importNoDomainParametersAsRooConstVarsno longer exists.Checklist:
Tests run (Linux, Ubuntu 26.04, GCC 15.2, RelWithDebInfo,
-Droofit=ON -Dtesting=ON):testRooFitHS3113 → 114 tests (1 new),testHistFactory60, all passing. clang-format clean.AI assistance: Claude Code (claude-opus-5-5) implemented the changes, the tests and this description under review of the author. The commit carries
Assisted-by: claude-code:claude-opus-5-5.🤖 Generated with Claude Code