Skip to content

[RF][HS3] Parameters with a fixed value as domain axes (HS3 #131) - #24099

Merged
guitargeek merged 1 commit into
root-project:masterfrom
cburgard:hs3-fixed-value
Nov 12, 2026
Merged

guitargeek merged 1 commit into
root-project:masterfrom
cburgard:hs3-fixed-value

Conversation

@cburgard

@cburgard cburgard commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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.

"domains": [{"name": "default_domain", "type": "product_domain", "axes": [
   {"name": "x", "min": 80.0, "max": 100.0},
   {"name": "mZ", "value": 91.188}
]}]

Background

Since #22283 (July 2026, not released), RooFit has written a named RooConstVar as a parameter without a domain, and read every parameter without a domain back as a RooConstVar (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:

What How
Export A named RooConstVar is written as a fixed domain axis {"name": ..., "value": <value>} in the default domain, and no longer to the parameter points. Constant RooRealVars are unchanged: a range in the domain, "const": true in the parameter points. Literal RooConstVars are still written as numbers.
Import A fixed axis gives a RooConstVar, whichever domain has it. It needs no entry in a parameter point.
Errors The axis also has min, max, nbins, edges or categories; 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": false stays the same as no "const".
Parameters without domain Read as RooRealVar, as before #22283: constant with "const": true, otherwise free, with a warning that HS3 requires a domain or "const": true. config().importNoDomainParametersAsRooConstVars is removed.
Older files ROOT versions before #22283 marked named RooConstVars with the attribute is_const_var in misc.ROOT_internal. Such parameters are read as RooConstVar again (#22283 had dropped this).

Tests

  • New FixedDomainAxis: import as RooConstVar, 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, RooConstVarCollectionProxyExport and ConstRooRealVarStaysDistinctFromRooConstVar expect the fixed axis instead of a missing domain.
  • ParametersOnlyInParameterPoints expects parameters without domain and without "const": true to be free, with the warning, instead of constant.
  • The tests that switched importNoDomainParametersAsRooConstVars off now run with the default behaviour.

Behaviour changes users may notice

  • Named RooConstVars appear as fixed domain axes instead of "const": true entries in the parameter points.
  • A parameter without domain is read as a RooRealVar, not as a RooConstVar. Documents written by ROOT master since [HS3] Bugfixes to HS3 histfactoy_dist handling and other minor bugs #22283 rely on the implicit rule; their RooConstVars come back as constant RooRealVars.
  • RooJSONFactoryWSTool::config().importNoDomainParametersAsRooConstVars no longer exists.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

Tests run (Linux, Ubuntu 26.04, GCC 15.2, RelWithDebInfo, -Droofit=ON -Dtesting=ON): testRooFitHS3 113 → 114 tests (1 new), testHistFactory 60, 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

…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 cburgard changed the title [RF][HS3] Parameters with a single value as domain axes (HS3 #131) [RF][HS3] Parameters with a fixed value as domain axes (HS3 #131) Nov 12, 2026
@cburgard
cburgard marked this pull request as ready for review November 12, 2026 09:28

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@guitargeek
guitargeek merged commit 0953478 into root-project:master Nov 12, 2026
27 of 31 checks passed
@guitargeek
guitargeek deleted the hs3-fixed-value branch November 12, 2026 11:42
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.

2 participants