[RF] Improve RooStats::HistFactory::PreprocessFunction class#10884
Merged
guitargeek merged 1 commit intoroot-project:masterfrom Jul 4, 2022
Merged
[RF] Improve RooStats::HistFactory::PreprocessFunction class#10884guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek merged 1 commit intoroot-project:masterfrom
Conversation
Some improvements are made to the `PreprocessFunction` class:
* add `const` to all the relevant member functions
* remove the `fCommand` member, because it can be inferred from the
other 3 members and it should not be set independently
* use `std::string` by const-reference when possible
* follow the RooFit coding style of using lower-case vor function
argument names
Furthermore, a bugfix is also done:
* in `PreprocessFunction::PrintXML`, replace the XML special
characters which almost always appear in any formula with the XML
escape codes
The bugfix addresses a problem where it was not possible to read an XML
generated by `Measurement::PrintXML` because the special characters in
the formula expression were not properly escaped.
With all these changes applied, the source files for this class changed
almost completely, and this opportunity was taken to reformat the code
with the ROOT `clang-format` style.
Closes root-project#10840.
|
Starting build on |
lmoneta
approved these changes
Jul 4, 2022
Member
lmoneta
left a comment
There was a problem hiding this comment.
LGTM!
Thank you for the improvement!
16 tasks
20 tasks
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.
Some improvements are made to the
PreprocessFunctionclass:constto all the relevant member functionsfCommandmember, because it can be inferred from theother 3 members and it should not be set independently
std::stringby const-reference when possibleargument names
Furthermore, a bugfix is also done:
PreprocessFunction::PrintXML, replace the XML specialcharacters which almost always appear in any formula with the XML
escape codes
The bugfix addresses a problem where it was not possible to read an XML
generated by
Measurement::PrintXMLbecause the special characters inthe formula expression were not properly escaped.
With all these changes applied, the source files for this class changed
almost completely, and this opportunity was taken to reformat the code
with the ROOT
clang-formatstyle.Closes #10840.