[Math] Avoid using std::map in Math::FitResult and fix logic#20722
Merged
Conversation
Avoid using `std::map` in Math::FitResult and fix the logic to set whether a parameter is fixed or bound. Before, these flags were only changed from `false` to `true`, but not the other way around, which can also happen if the user releases a parameter in the configuration object. A unit test that covers this case was also implemented. Closes root-project#20703.
This is to keep the net number of added lines of code below zero, when combining with the previous commit.
498e815 to
919a780
Compare
Test Results 21 files 21 suites 3d 20h 41m 54s ⏱️ For more details on these failures, see this check. Results for commit 919a780. |
lmoneta
approved these changes
Dec 16, 2025
Member
lmoneta
left a comment
There was a problem hiding this comment.
LGTM!
Thank you Jonas for fixing this issue.
I guess it is anyway better not using the std::map for efficiency, considering that in RooFit all the parameters are bounded.
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.
Avoid using
std::mapin Math::FitResult and fix the logic to set whether a parameter is fixed or bound. Before, these flags were only changed fromfalsetotrue, but not the other way around, which can also happen if the user releases a parameter in the configuration object.A unit test that covers this case was also implemented.
A second commit in this PR does some code modernization and cleanup, to keep the net number of added lines of code in this PR below zero.
Closes #20703.