Skip to content

[RF] Handle variables having numeric value as name in RooFormula #19414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ban42
Copy link
Contributor

@Ban42 Ban42 commented Jul 19, 2025

This Pull request:

As requested in #11992 changes the way RooFormulaVar performs variable names substitutions.

Changes or fixes:

Before performing a substitution in the formula based on variable name, the code now checks if the variable to be substituted has a number as name.
Variables where the name is a number are now only be matched by index. If there is a variable with a name that is a number that is not a RooConstVar where the value is equal to the name, an exception will be thrown.

Checklist:

  • tested changes locally: Yes, 227 - gtest-roofit-roofitcore-testRooFormula fails, throwing one of the two exceptions I have created. I either have to update it, or double-check for mistakes on my side.
  • updated the docs : Let me know if I should.
  • Add tests: I probably need to add a test for this

This PR fixes #11992

@Ban42 Ban42 requested review from lmoneta and guitargeek as code owners July 19, 2025 12:09
@Ban42
Copy link
Contributor Author

Ban42 commented Jul 19, 2025

Hi @guitargeek ,
This is the solution I have found which should match the specification you described in #11992

The test "227 - gtest-roofit-roofitcore-testRooFormula" fails, which means I have made a mistake or I have to update it. Before doing so, I wanted you to have a quick look and confirm this approach is the desired one.

Thank you :)

@dpiparo
Copy link
Member

dpiparo commented Jul 19, 2025

let's start with the CI, to see where we stand.

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.

[RF] RooFormulaVar is too eager in variable name substitution
3 participants