Skip to content

[RF] Check that no two distinct input pdfs have same name in RooAddPdf and general RooAddPdf modernization#8004

Merged
guitargeek merged 5 commits intoroot-project:masterfrom
guitargeek:issue-8000
Jul 5, 2021
Merged

[RF] Check that no two distinct input pdfs have same name in RooAddPdf and general RooAddPdf modernization#8004
guitargeek merged 5 commits intoroot-project:masterfrom
guitargeek:issue-8000

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

@guitargeek guitargeek commented Apr 26, 2021

This addresses #8000.

The actual check is introduced in the 4th commit, all other commits contain general RooAddPdf code modernization.

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@guitargeek guitargeek linked an issue May 4, 2021 that may be closed by this pull request
@root-project root-project deleted a comment from phsft-bot May 26, 2021
@root-project root-project deleted a comment from phsft-bot May 26, 2021
@root-project root-project deleted a comment from phsft-bot May 26, 2021
@root-project root-project deleted a comment from phsft-bot May 26, 2021
@guitargeek
Copy link
Copy Markdown
Contributor Author

@phsft-bot build

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

Comment on lines 49 to 50
virtual Bool_t forceAnalyticalInt(const RooAbsArg& /*dep*/) const {
// Force RooRealIntegral to offer all observables for internal integration
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When you find this kind of old-style docs, move them above the function and replace // --> /// for doxygen to find it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay!

RooArgList partinCoefList ;

Bool_t first(kTRUE) ;
Bool_t first(true) ;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you go towards standard c++ using kTRUE --> true, I would also use Bool_t --> bool.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay!

_recursive(kFALSE)
RooAddPdf(name,title)
{
_allExtendable = true;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Consider moving this in member initialiser list?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This would give a warning: mem-initializer for ‘RooAddPdf::_allExtendable’ follows constructor delegation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, I missed that it's a delegating constructor! 👍

* migrate Bool_t to bool

* migrate Double_t to double outside of function signatures and member
  variables

* replace `RooAbsCollection::getSize()` with STL-compatible `size()`
  and `empty()`

* replace `TString` with `std::string`

* update documentation of `RooAddPdf::forceAnalyticalInt` to doxygen
  format
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@ghost
Copy link
Copy Markdown

ghost commented Jul 5, 2021

DeepCode's analysis on #3c2f25 found:

  • ℹ️ 1 minor issue. 👇

Top issues

Description Example fixes
Equals comparison of floating point numbers. Floating point numbers are only considered equal if their bit representation is equal. Consider using an epsilon comparison instead. Occurrences: 🔧 Example fixes

👉 View analysis in DeepCode’s Dashboard | Configure the bot

👉 The DeepCode service and API will be deprecated in August, 2021. Here is the information how to migrate. Thank you for using DeepCode 🙏 ❤️ !

If you are using our plugins, you might be interested in their successors: Snyk's JetBrains plugin and Snyk's VS Code plugin.

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-ubuntu16/nortcxxmod.
Running on sft-ubuntu-1604-4.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Failing tests:

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.

Looks good to me !
I have only the comments about getParameters/getObservables, which could if you wish be changed later in a different PR if you prefer


// Retrieve the combined set of dependents of this PDF ;
RooArgSet *fullDepList = getObservables(nset) ;
auto fullDepList = std::unique_ptr<RooArgSet>{getObservables(nset)} ;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi,
Since you are moving to use unique pointer, would not be better to use instead the new functions which do not build the set, but they fill it::

RooArgSet fullDepList;
getObservables(nset, fullDepList);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea! I'll make these changes in a separate PR that uses the new functions also in more new places than RooAddPdf.

@guitargeek guitargeek merged commit 85d1c5d into root-project:master Jul 5, 2021
@guitargeek guitargeek deleted the issue-8000 branch July 5, 2021 13:58
@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-debian10-i386/cxx14.
Running on pcepsft10.dyndns.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-07-05T17:04:10.665Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1045 (message):

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] RooAddPdf fails if pdfs have the same name

4 participants