Skip to content

[RF] Improve RooStats::HistFactory::PreprocessFunction class#10884

Merged
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:histfactory_1
Jul 4, 2022
Merged

[RF] Improve RooStats::HistFactory::PreprocessFunction class#10884
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:histfactory_1

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

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 #10840.

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.
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac1015/cxx17, mac11/cxx14, windows10/cxx14
How to customize builds

Copy link
Copy Markdown
Member

@lmoneta lmoneta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thank you for the improvement!

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.

[RF] HistFactory PreprocessFunction::PrintXML() needs to escape special characters to produce valid XML

3 participants