Skip to content

Conversation

@will-cern
Copy link
Contributor

This allows non-friends to construct RooFitResults, which allows for the removal of protected->public override in xRooFit for this class.

@phsft-bot
Copy link

Can one of the admins verify this patch?

@bellenot
Copy link
Member

@phsft-bot build

@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, 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.

Hi @will-cern, thank you very much for this PR!

I have made a few comments inline.

In general, is it possible to have the following functions still protected?

  void fillCorrMatrix() ;
   void fillLegacyCorrMatrix() const ;
   void fillPrefitCorrMatrix();

   double correlation(Int_t row, Int_t col) const;
   double covariance(Int_t row, Int_t col) const;

The first three are implementation details and don't make sense to be called by anyone I think, right? They don't even take input arguments.

And the final two are not needed because you can just do things like correlationMatrix()(row, col) instead.

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.

Sorry, pushed the wrong button. I request changes of course.

Also, please remember to code-format the xRooFit.cxx file after implementing the suggestions 👍

@phsft-bot
Copy link

Build failed on mac12/noimt.
Running on macphsft17.dyndns.cern.ch:/Users/sftnight/build/jenkins/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-12T13:11:48.604Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/core/base/src/TDirectory.cxx:1245:7: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Failing tests:

And 63 more

@guitargeek guitargeek changed the title make RooFitResult set methods public [RF] Make RooFitResult set methods public Jan 12, 2023
@will-cern
Copy link
Contributor Author

Thanks for the review - I think all responded to now

@phsft-bot
Copy link

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

Errors:

  • [2023-01-12T14:15:31.306Z] /data/sftnight/workspace/root-pullrequests-build/root/roofit/roofitcore/src/RooMinimizer.cxx:647:51: error: ‘void RooFitResult::fillCorrMatrix(const std::vector<double>&, const TMatrixDSym&, const TMatrixDSym&)’ is protected within this context
  • [2023-01-12T14:15:31.306Z] /data/sftnight/workspace/root-pullrequests-build/root/roofit/roofitcore/src/RooMinimizer.cxx:652:43: error: ‘void RooFitResult::setStatusHistory(std::vector<std::pair<std::__cxx11::basic_string<char>, int> >&)’ is protected within this context
  • [2023-01-12T14:15:31.626Z] /data/sftnight/workspace/root-pullrequests-build/root/roofit/roofitcore/src/RooMinimizer.cxx:922:45: error: ‘void RooFitResult::fillCorrMatrix(const std::vector<double>&, const TMatrixDSym&, const TMatrixDSym&)’ is protected within this context

@phsft-bot
Copy link

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

Errors:

  • [2023-01-12T14:44:52.720Z] FAILED: roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooMinimizer.cxx.o
  • [2023-01-12T14:44:54.105Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/roofit/roofitcore/src/RooMinimizer.cxx:647:15: error: 'fillCorrMatrix' is a protected member of 'RooFitResult'
  • [2023-01-12T14:44:54.105Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/roofit/roofitcore/src/RooMinimizer.cxx:652:12: error: 'setStatusHistory' is a protected member of 'RooFitResult'
  • [2023-01-12T14:44:54.105Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/roofit/roofitcore/src/RooMinimizer.cxx:922:9: error: 'fillCorrMatrix' is a protected member of 'RooFitResult'

@phsft-bot
Copy link

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

Errors:

  • [2023-01-12T14:45:45.656Z] FAILED: roofit/roofitcore/CMakeFiles/RooFitCore.dir/src/RooMinimizer.cxx.o
  • [2023-01-12T14:45:46.689Z] /home/sftnight/build/workspace/root-pullrequests-build/root/roofit/roofitcore/src/RooMinimizer.cxx:647:51: error: ‘void RooFitResult::fillCorrMatrix(const std::vector<double>&, const TMatrixDSym&, const TMatrixDSym&)’ is protected within this context
  • [2023-01-12T14:45:46.689Z] /home/sftnight/build/workspace/root-pullrequests-build/root/roofit/roofitcore/src/RooMinimizer.cxx:652:43: error: ‘void RooFitResult::setStatusHistory(std::vector<std::pair<std::__cxx11::basic_string<char>, int> >&)’ is protected within this context
  • [2023-01-12T14:45:46.689Z] /home/sftnight/build/workspace/root-pullrequests-build/root/roofit/roofitcore/src/RooMinimizer.cxx:922:45: error: ‘void RooFitResult::fillCorrMatrix(const std::vector<double>&, const TMatrixDSym&, const TMatrixDSym&)’ is protected within this context

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.

Hi Will, thanks for the updates!

I just have a few more inline comment. I also tried to compile the code on my machine, and I got a warning in xRooFit line 508 because of the unused bool save = true; variable. can you please remove this line?

Also, sorry for not being clear earlier, but when I asked to make the fillCorrMatrix() protected again, I only meant the overload that doesn't take parameters. Also, you made setStatusHistory protected now, but it should be public.

In other words, these two overloads need to be made public now:

  void fillCorrMatrix(const std::vector<double>& globalCC, const TMatrixDSym& corrs, const TMatrixDSym& covs) ;
  void setStatusHistory(std::vector<std::pair<std::string,int> >& hist) { _statusHistory = hist ; }

One more thing: can you please squash the commit history such that there are again only two commits, one for xroofit and one for roofit? We don't need all the commits for addressing the review comments. Normally I would squash-on-merge, but then I can only squash to one single commit. And it would be nice to keep the history of roofit and xroofit separate.

@will-cern
Copy link
Contributor Author

yes this was my fault for not checking it compiled first before pushing, I should have spotted this!

@phsft-bot
Copy link

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

@will-cern will-cern force-pushed the RooFitResult_publicMethods branch 2 times, most recently from b5b2f77 to eeb1fdf Compare January 12, 2023 15:48
@guitargeek
Copy link
Contributor

@phsft-bot build

@phsft-bot
Copy link

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

@phsft-bot
Copy link

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

Errors:

  • [2023-01-12T16:10:06.262Z] LINK : fatal error LNK1104: cannot open file 'C:\build\workspace\root-pullrequests-build\build\bin\libCore.dll' [C:\build\workspace\root-pullrequests-build\build\core\Core.vcxproj]

@will-cern will-cern force-pushed the RooFitResult_publicMethods branch from eeb1fdf to 203909d Compare January 12, 2023 16:22
@guitargeek
Copy link
Contributor

@phsft-bot build

@phsft-bot
Copy link

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

@phsft-bot
Copy link

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

Errors:

  • [2023-01-12T16:31:32.452Z] LINK : fatal error LNK1104: cannot open file 'C:\build\workspace\root-pullrequests-build\build\bin\libCore.dll' [C:\build\workspace\root-pullrequests-build\build\core\Core.vcxproj]

@phsft-bot
Copy link

Build failed on mac12/noimt.
Running on macphsft17.dyndns.cern.ch:/Users/sftnight/build/jenkins/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2023-01-12T16:31:33.816Z] /Users/sftnight/build/jenkins/workspace/root-pullrequests-build/root/core/base/src/TDirectory.cxx:1245:7: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

Failing tests:

And 63 more

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.

4 participants