From d5aeb69263a1afa35249d3258bb136d2a31fb16c Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Tue, 7 Apr 2026 17:07:11 +0200 Subject: [PATCH] [RF][RS] Deprecate RooStats::HybridPlot The `RooStats::HybridPlot` class is a helper class for plotting of fit results, but we are moving towards removing these helpers out of RooFit because plotting code is better written by the user directly, for better customizability of the plots. This is similar to the deprecation and removal of HistFactory plotting features (see 59da6b1 and 88b2fa1). --- README/ReleaseNotes/v640/index.md | 2 ++ roofit/roostats/inc/RooStats/HybridPlot.h | 6 +++++- roofit/roostats/inc/RooStats/HybridResult.h | 3 ++- roofit/roostats/src/HypoTestInverter.cxx | 1 - roofit/roostats/src/HypoTestInverterPlot.cxx | 1 - roofit/roostats/src/HypoTestInverterResult.cxx | 1 - 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README/ReleaseNotes/v640/index.md b/README/ReleaseNotes/v640/index.md index 12e79400493d6..a6d243e642357 100644 --- a/README/ReleaseNotes/v640/index.md +++ b/README/ReleaseNotes/v640/index.md @@ -51,6 +51,8 @@ The following people have contributed to this new version: * The overloads of `RooAbsReal::createChi2()` and `RooAbsReal::chi2FitTo()` that take unbinned **RooDataSet** data objects are deprecated and will be removed in ROOT 6.42. These methods implemented a specialized chi-square fit for x-y-data with errors in y and optional errors in x, which is conceptually different from the standard histogram-based chi-square in the **RooDataHist** case and can lead to ambiguous results. To fit 2D data with errors in and `x` and `y`, use specialized tools like `TGraphErrors::Fit()`, or build an explicit likelihood model if you want to stay with RooFit. +* The **RooStats::HybridPlot** class and the related **HybridResult::GetPlot** method are deprecated and will be removed in ROOT 6.42. + We kindly ask users to write their own ROOT-based plotting code, possibly based on the source code of the deprecated **HybridPlot** class, as pre-existing plot helpers are usually failing to be flexible enough for large-scale adoption. ## Removals diff --git a/roofit/roostats/inc/RooStats/HybridPlot.h b/roofit/roostats/inc/RooStats/HybridPlot.h index 6f6c703764b6a..b80b51bc55113 100644 --- a/roofit/roostats/inc/RooStats/HybridPlot.h +++ b/roofit/roostats/inc/RooStats/HybridPlot.h @@ -119,7 +119,11 @@ namespace RooStats { bool fVerbose; ///< verbosity flag ClassDefOverride(HybridPlot,0) // Provides the plots for an HybridResult - }; + } +#ifndef ROOFIT_BUILDS_ITSELF + R__DEPRECATED(6, 42, "Please write your own ROOT-based plotting code, possibly based on the source code of the deprecated HybridPlot class.") +#endif + ; } #endif diff --git a/roofit/roostats/inc/RooStats/HybridResult.h b/roofit/roostats/inc/RooStats/HybridResult.h index 097bec5a2156c..ebdeeab6bb5cf 100644 --- a/roofit/roostats/inc/RooStats/HybridResult.h +++ b/roofit/roostats/inc/RooStats/HybridResult.h @@ -45,7 +45,8 @@ namespace RooStats { void Add(HybridResult* other); - HybridPlot* GetPlot(const char* name,const char* title, int n_bins); + HybridPlot* GetPlot(const char* name,const char* title, int n_bins) + R__DEPRECATED(6, 42, "Please write your own ROOT-based plotting code, possibly based on the source code of the deprecated HybridPlot class."); void PrintMore(const char* options); diff --git a/roofit/roostats/src/HypoTestInverter.cxx b/roofit/roostats/src/HypoTestInverter.cxx index 97ed1706101f0..f74d544a319ec 100644 --- a/roofit/roostats/src/HypoTestInverter.cxx +++ b/roofit/roostats/src/HypoTestInverter.cxx @@ -44,7 +44,6 @@ call HypoTestInverter::UseCLs(). #include "RooStats/ToyMCSampler.h" #include "RooStats/HypoTestPlot.h" #include "RooStats/HypoTestInverterPlot.h" -#include "RooStats/HybridResult.h" #include "RooAbsData.h" #include "RooRealVar.h" diff --git a/roofit/roostats/src/HypoTestInverterPlot.cxx b/roofit/roostats/src/HypoTestInverterPlot.cxx index ee2e910e597e3..557fb7efb6417 100644 --- a/roofit/roostats/src/HypoTestInverterPlot.cxx +++ b/roofit/roostats/src/HypoTestInverterPlot.cxx @@ -23,7 +23,6 @@ hypotheses. #include "RooStats/HypoTestInverterPlot.h" // include other header files -#include "RooStats/HybridResult.h" #include "RooStats/HypoTestInverterResult.h" #include "RooStats/HypoTestPlot.h" #include "RooStats/SamplingDistribution.h" diff --git a/roofit/roostats/src/HypoTestInverterResult.cxx b/roofit/roostats/src/HypoTestInverterResult.cxx index d535239dda795..d24859387d07d 100644 --- a/roofit/roostats/src/HypoTestInverterResult.cxx +++ b/roofit/roostats/src/HypoTestInverterResult.cxx @@ -22,7 +22,6 @@ Some contributions to this class have been written by Matthias Wolf (error estim // include header file of this class #include "RooStats/HypoTestInverterResult.h" -#include "RooStats/HybridResult.h" #include "RooStats/SamplingDistribution.h" #include "RooStats/AsymptoticCalculator.h" #include "RooMsgService.h"