Skip to content
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

[RF] Fixes evaluate() function in RooRealL #9456

Merged
merged 5 commits into from
Jan 20, 2022

Conversation

Zeff020
Copy link
Contributor

@Zeff020 Zeff020 commented Dec 16, 2021

This Pull request:

Changes or fixes:

The evaluate() function on the RooFit::TestStatistics::RooRealL class was not functional. This PR fixes it by adding a RooArgSet member to RooRealL called vars_obs_ which initially contains the same variables as the RooArgProxy and ensures that the proxy variables are properly transferred to the internal variables of the likelihood (contained in the RooArgSet vars_obs_) before evaluation.

This change was made with the help of @wverkerke

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

This PR fixes #

@phsft-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@egpbos
Copy link
Contributor

egpbos commented Dec 16, 2021

@guitargeek This is a redo of #9402, now rebased on master.

@guitargeek
Copy link
Contributor

@phsft-bot build

@phsft-bot
Copy link
Collaborator

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

@phsft-bot
Copy link
Collaborator

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

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu2004/soversion.
Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-performance-centos8-multicore/default.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

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

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on mac11/cxx17.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on mac1015/python3.
Running on macitois22.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Collaborator

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

@Zeff020
Copy link
Contributor Author

Zeff020 commented Dec 17, 2021

I see why it failed, that stressRooFit test that failed was passed on my pc so when updating the reference file with all the plots the relevant plot was not included. I will add it manually and commit

@Axel-Naumann
Copy link
Member

Is test/stressRooFit_ref.root meant to end up on https://root.cern? If so, should the file be removed from this PR?

@Zeff020
Copy link
Contributor Author

Zeff020 commented Dec 17, 2021

@Axel-Naumann The file was already there, I just modified it. I am not sure how it would end up on https://root.cern.

@Axel-Naumann
Copy link
Member

Sorry, I confused this file with a different RooFit test file, all good!

@Zeff020
Copy link
Contributor Author

Zeff020 commented Dec 17, 2021

No problem!

@guitargeek I fixed the bug that was causing the tests to fail

@egpbos
Copy link
Contributor

egpbos commented Dec 20, 2021

@phsft-bot build

@phsft-bot
Copy link
Collaborator

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

@phsft-bot
Copy link
Collaborator

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

Errors:

  • [2021-12-20T09:34:23.358Z] stderr: error: Failed to merge in the changes.
  • [2021-12-20T09:34:29.686Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

Build failed on mac11/cxx17.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-12-20T09:34:38.527Z] CMake Error at /Users/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-performance-centos8-multicore/default.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-12-20T09:34:38.941Z] CMake Error at /data/sftnight/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

Build failed on mac1015/python3.
Running on macitois19.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-12-20T09:35:10.761Z] stderr: error: Failed to merge in the changes.
  • [2021-12-20T09:35:15.945Z] CMake Error at /Volumes/HDD2/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

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

Errors:

  • [2021-12-20T09:36:08.367Z] stderr: error: Failed to merge in the changes.
  • [2021-12-20T09:36:15.074Z] CMake Error at /mnt/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu2004/soversion.
Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-12-20T09:41:17.499Z] stderr: error: Failed to merge in the changes.
  • [2021-12-20T09:41:23.141Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@@ -6456,4 +6456,4 @@ class TestBasic804 : public RooUnitTest

return kTRUE ;
}
} ;
} ;
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to touch that file.

@guitargeek
Copy link
Contributor

Hi @Zeff020, thanks for the quick followup! I have made a few more change requests, they are a bit minute but I hope to teach you some of the good practices we use here for the future :)

Also, if you introduce any new source file to RooFit, please format it with clang-format using the official ROOT style file. You will see that the right style was used if your sources are indented with three spaces. In this PR, this testPlot.cpp should be formatted.

When you have done the formatting and implemented my comments, we can test and merge.

@guitargeek
Copy link
Contributor

@phsft-bot build

@phsft-bot
Copy link
Collaborator

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

@guitargeek
Copy link
Contributor

@phsft-bot build

@phsft-bot
Copy link
Collaborator

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

Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR and addressing the review comments!

Comment on lines +70 to +71
std::shared_ptr<RooFit::TestStatistics::RooRealL> likelihood_real(
new RooFit::TestStatistics::RooRealL("likelihood", "", likelihood));
Copy link
Contributor

@guitargeek guitargeek Jan 20, 2022

Choose a reason for hiding this comment

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

Suggested change
std::shared_ptr<RooFit::TestStatistics::RooRealL> likelihood_real(
new RooFit::TestStatistics::RooRealL("likelihood", "", likelihood));
auto likelihood_real = std::make_shared<RooFit::TestStatistics::RooRealL>("likelihood", "", likelihood);

Just for the next time: you should use make_shared to create objects directly wrapped by shared pointers, and you can use auto to automatically deduce type when it's clear to the reader what the type is anyway (here it would be clear because of the type in make_shared).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, will do!

@guitargeek guitargeek merged commit 9090854 into root-project:master Jan 20, 2022
@phsft-bot
Copy link
Collaborator

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2022-01-20T13:15:54.707Z] stderr: error: Failed to merge in the changes.
  • [2022-01-20T13:16:35.415Z] CMake Error at C:/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu2004/soversion.
Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2022-01-20T14:51:45.743Z] stderr: error: Failed to merge in the changes.
  • [2022-01-20T14:51:50.918Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

rahulgrit pushed a commit to rahulgrit/root that referenced this pull request Jan 25, 2022
guitargeek pushed a commit to guitargeek/root that referenced this pull request Jan 26, 2022
@guitargeek guitargeek changed the title Fixes evaluate() function in rooRealL [RF] Fixes evaluate() function in RooRealL Jan 26, 2022
@phsft-bot
Copy link
Collaborator

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

@phsft-bot
Copy link
Collaborator

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

Errors:

  • [2022-01-26T18:45:42.278Z] stderr: error: Failed to merge in the changes.
  • [2022-01-26T18:45:53.527Z] CMake Error at /mnt/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

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

Errors:

  • [2022-01-26T19:27:41.254Z] stderr: error: Failed to merge in the changes.
  • [2022-01-26T19:27:48.924Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-performance-centos8-multicore/default.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Errors:

  • [2022-01-26T20:17:42.482Z] CMake Error at /data/sftnight/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

Build failed on mac1015/python3.
Running on macitois21.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2022-01-27T00:07:06.204Z] stderr: error: Failed to merge in the changes.
  • [2022-01-27T00:07:18.112Z] CMake Error at /Volumes/HD2/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2022-01-27T08:16:48.852Z] stderr: error: Failed to merge in the changes.
  • [2022-01-27T08:19:20.837Z] CMake Error at C:/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

Build failed on mac11/cxx17.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2022-01-27T12:55:29.970Z] CMake Error at /Users/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (message):

@phsft-bot
Copy link
Collaborator

Build failed on ROOT-ubuntu2004/soversion.
Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2022-01-27T14:26:27.786Z] stderr: error: Failed to merge in the changes.
  • [2022-01-27T14:26:33.316Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1064 (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.

6 participants