[RF] Convert stressRooStats suite to googletest - #23303
Open
guitargeek wants to merge 2 commits into
Open
Conversation
Rewrite the RooStats S.T.R.E.S.S. suite in place as a googletest suite,
following the precedent of the stressRooFit conversions. All 48 test
configurations of the original suite are kept, with the same models,
calculator configurations, random seeds and tolerances, and the
RooUnitTest semantics are reproduced (seed 12345 reset per test, failure
on logged RooFit ERROR messages).
Instead of comparing against the references stored in
stressRooStats_ref.root, the references are now self-contained:
- analytic references are computed inline in the same test (profile
likelihood intervals on Gaussian/Poisson models, Bayesian central
intervals via gamma quantiles)
- published values from the Cousins et al. papers stay hardcoded
- for the pure regression tests, the frozen values from the last
stressRooStats_ref.root are hardcoded at full precision
The AsymptoticCalculator test now checks both the live
ProfileLikelihoodCalculator and AsymptoticCalculator significances
against the frozen reference, which is strictly more coverage than the
original comparison against the frozen PLC value only.
The tests are parameterized over the RooFit evaluation backends via the
shared gtest_wrapper.h macros, matching the backend coverage of the
removed per-backend ctest invocations; on cuda builds the gtest entry
takes the GPU resource lock that the dedicated cuda invocation used to
declare, and both ctest entries get an explicit one-hour timeout since
the backends now run serially in one process. The fixtures save and
restore the global default evaluation backend so it does not leak
between tests.
Unlike the original suite, the default minimizer is now Minuit2 instead
of Minuit. Coverage of the old minimizer is kept by a separate ctest
that runs the same binary with STRESSROOSTATS_MINIMIZER=Minuit,
restricted to the legacy and cpu backends like the original
non-default-minimizer invocations.
With the reference file and the RooUnitTest classes gone,
stressRooStats_ref.root and stressRooStats_tests.h are removed
(stressRooStats_models.h is still used). Also dropped: the write mode,
the verbose-mode plotting code, the benchmark scaffolding, the
TestHypoTestCalculator class that was never registered in any suite,
and the test statistic types that were only reachable from it.
🤖 Done with the help of AI
Convert the RooFit::TestStatistics plotting test to a reference-free
gtest, following the precedent of the other stress test conversions. The
model, parallel minimization setup and likelihood plotting are
unchanged, but instead of comparing the RooPlot against the reference in
TestStatistics_ref.root via RooUnitTest::regPlot, the test now checks:
- the fitted parameter against the analytic maximum likelihood
estimate (with a tolerance at the scale of the Minuit convergence
criterion)
- every point of the plotted curve against a direct evaluation of the
likelihood at that parameter value
- the likelihood shape against the analytically known Poisson -log L
(up to the constant offset)
The TestStatistics_ref.root file had no other users, so it is removed
together with the COPY_TO_BUILDDIR of the ctest registration.
🤖 Done with the help of AI
dpiparo
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Translate more
RooUnitTesttests to gtest.The overarching motivation for this is the following: the
RooUnitTestinfrastructure requires the RooFit plotting classes to be serializable to disk for reference results. On the long term I want to avoid this, so we can have a discussion on whether the RooFit plotting primitives should support IO at all.🤖 Done with the help of AI