Skip to content

Conversation

@guitargeek
Copy link
Contributor

This is a backport of all the relevant RooFit PRs that were recently merged to master to v6-28-00-patches (in the right order, to not have the commit history diverge too much).

  1. [relnotes] Add RooFit contrubutors from 6.28 development cycle #11969
  2. [RF] Avoid code duplication with new private Algorithms.h file #11962
  3. [RF] Make RooAbsArg::recursiveRedirectServers thread safe #11970
  4. [RF] Fix and improvements in testSumW2Error #11966

Related to #11856.

The git commit log was analyzed to accurately extract the names of all
people that contributed to RooFit in the 6.28 development cycle.
The `RooMomentMorphND` and `RooMomentMorphFuncND` classes duplicated
some copy-pasted code from stackoverflow. This is not factored out into
a new private header file to avoid code duplication.
In the implementation of `RooAbsArg::recursiveRedirectServers` a static
variable was used to check for cyclic recursion. This is not thread safe
an should be avoided. The problem is solved by creating a new
`recursiveRedirectServersImpl` function that takes the `callStack`
variable also as an argument, and this variable is instantiated
separately in each `recursiveRedirectServers` call.

Since the code was touched and moved anyway, the implementation of
`recursiveRedirectServers` was formatted with clang-format.
In `testSumW2Error`, a weighted clone of an unweighted dataset is
created, where each event gets the weight `0.5`.

However, in the loop over the original dataset used to fill the new
dataset, `get(i)` is never called, meaning the new weighted dataset is
only filled with the same values. This resulted in an unstable fit,
necessitating careful tweaking of the initial parameters to even get
convergence. That's why it's better to copy the dataset correctly, even
if this is just the test case. I noticed this problem when I was
copy-pasting code to create another new unit test.

Also, the binned dataset is now a binned clone of the unbinned dataset
in the test, reducing the degree of randomness.

Furthermore, some general code improvements are applied to the source
file.
It's better if the individual unit tests don't change the global state
of the `RooMsgService` singleton instance.
@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.
See console output.

@guitargeek
Copy link
Contributor Author

I'll better merge it now and don't accumulate more PRs, otherwise other people might touch also the release notes and I'll have conflicts here...

@guitargeek guitargeek merged commit 66df8b8 into root-project:v6-28-00-patches Jan 6, 2023
@guitargeek guitargeek deleted the v6-28-00-patches_roofit_backports_2 branch January 6, 2023 11:04
@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-09T17:35:37.585Z] CMake Error at /home/sftnight/build/workspace/root-pullrequests-build/rootspi/jenkins/root-build.cmake:1138 (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.

2 participants