Skip to content

[RF] Refactor C function binding helper code to avoid duplication - #23751

Open
guitargeek wants to merge 2 commits into
root-project:masterfrom
guitargeek:roofit-cfuncs
Open

guitargeek wants to merge 2 commits into
root-project:masterfrom
guitargeek:roofit-cfuncs

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

The RooCFunction classes contain relatively complicated custom streamer code that should better not be be duplicated.

See the commit descriptions for more detail.

The RooCFunction[1-4]Map classes were four copies of the same class,
differing only in the function pointer type. Replace them with a single
`RooFit::Detail::CFunctionMap<Func>` template, keeping the old names as
alias templates so that `RooCFunctionNRef<...>::fmap().add(...)` keeps
working. Argument names are now passed variadically; unnamed arguments
still fall back to x, y, z, w.

The "registered name or hex address" logic of the
RooCFunctionNRef::name() functions is moved into the map as well.

No class layout or persisted class name changes.

πŸ€– Done with the help of AI
The custom `Streamer()` of the RooCFunction[1-4]Ref classes and the
`printArgs()` of the RooCFunction[1-4]Binding and PdfBinding classes
were identical copies. Implement them once in
`RooFit::Detail::streamCFunctionRef()` and
`RooFit::Detail::printCFunctionArgs()`.

The on-file format is unchanged: files written before this change are
read back identically and vice versa.

πŸ€– Done with the help of AI
@guitargeek guitargeek self-assigned this Oct 18, 2026
@guitargeek guitargeek changed the title [RF] Refactor C funciton binding helper code to avoid duplication [RF] Refactor C function binding helper code to avoid duplication Oct 18, 2026
@github-actions

Copy link
Copy Markdown

Test Results

β€‡β€‡β€ˆβ€‡23 filesβ€„β€ƒβ€‡β€‡β€ˆβ€‡23 suites   3d 23h 28m 29s ⏱️
 3β€ˆ889 tests  3β€ˆ886 βœ…β€ƒ0 πŸ’€β€ƒ3 ❌
79β€ˆ435 runsβ€Šβ€ƒ79β€ˆ432 βœ…β€ƒ0 πŸ’€β€ƒ3 ❌

For more details on these failures, see this check.

Results for commit 25017ce.

This branch has not been deployed

No deployments
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.

1 participant