Skip to content

[v640][RF][HS3] Align RooFit HS3 JSON I/O with the current HS3 naming and HistFactory conventions#22804

Merged
guitargeek merged 6 commits into
root-project:v6-40-00-patchesfrom
guitargeek:bp_1
Jul 14, 2026
Merged

[v640][RF][HS3] Align RooFit HS3 JSON I/O with the current HS3 naming and HistFactory conventions#22804
guitargeek merged 6 commits into
root-project:v6-40-00-patchesfrom
guitargeek:bp_1

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

Phmonski and others added 6 commits July 14, 2026 08:38
Align RooFit HS3 JSON I/O with the current HS3 naming and HistFactory conventions.

**Summary**

Align RooFit HS3 JSON I/O with the current HS3 naming and HistFactory conventions.

- Replace `RooBinWidthFunction` HS3 type `binwidth` with:
  - `binvolume` for `divideByBinWidth == false`
  - `inverse_binvolume` for `divideByBinWidth == true`
- Stop exporting `divideByBinWidth` and remove legacy `binwidth` import support.
- Extend generic expression cleanup for `floor`, `ceil`, `abs`, `tan`, `asin`, `acos`, `atan`, `PI`, and `EULER`.
- Treat `PI` and `EULER` as reserved expression constants on import.
- Migrate HistFactory modifier export from `constraint_name` to `constraint`, and omit `constraint_type`.
- Instead of exporting `constraint_type`, `shapesys` modifiers now export the actual per-bin constraint pdf names via a new `constraints` list. This list is parallel to the `parameters` list, so each gamma parameter has a corresponding constraint entry. Entries can also be `null` for parameters without a constraint.
- Keep HistFactory import compatibility for `constraint`, `constraint_name`, and legacy `constraint_type`.
- Export `const: true` for parameters whose `min >= max`.
- Export both `RooHistFunc` and `ParamHistFunc` as `step`.
- Add a `step` importer dispatcher that selects `RooHistFunc` for `data` and `ParamHistFunc` for `parameters`.
- Keep legacy `histogram` import support for old `RooHistFunc` HS3 files.
- Rename the following exporter keys:
  - generic_function -> generic
  - gauss_model_function -> gauss_resolution_model
  - truth_model_function -> delta_resolution_model
  - mixture_model -> mixture_resolution_model
  - fft_conv_pdf -> fft_convolution_dist

**Tests**

Added focused coverage in `testRooFitHS3.cxx` for:

- `binvolume` / `inverse_binvolume` export and import
- fixed-range parameter export as `const: true`
- `step` export/import dispatch for `RooHistFunc` and `ParamHistFunc`
- HistFactory `constraint` export with legacy `constraint_name` import
- generic expression cleanup for new function names and constants

(cherry picked from commit e6d966a)
The `testHS3SimultaneousFit` was pretty small anyway, and having only a
single executable saves linking time.

(cherry picked from commit 9a11185)
Fix math expression replacements to not corrup expressions that are
containing other replaced substriongs as replaced tokens, like
`TMath::Log10` that contains `TMath::Log`.

(cherry picked from commit 51dfa58)
The YAML parser (for the `ryml` backend for RooFit JSON interface) is
dead code for over two years, as it was commented out from the build in
commit 643a73d.

It's better to remove the dead code at this point, and it can always be
brought back or re-implemented if really needed.

(cherry picked from commit ddc6c6f)
This is just a refactor to reduce the code footprint.

(cherry picked from commit 6732eba)
@guitargeek guitargeek self-assigned this Jul 14, 2026
@guitargeek guitargeek requested a review from bellenot as a code owner July 14, 2026 06:44
@github-actions

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 10h 7m 50s ⏱️
 3 860 tests  3 860 ✅ 0 💤 0 ❌
77 129 runs  77 129 ✅ 0 💤 0 ❌

Results for commit e985da3.

@guitargeek guitargeek merged commit a900cad into root-project:v6-40-00-patches Jul 14, 2026
36 of 37 checks passed
@guitargeek guitargeek deleted the bp_1 branch July 14, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants