diff --git a/README/ReleaseNotes/v642/index.md b/README/ReleaseNotes/v642/index.md index 512aba2f3c274..09b581d652779 100644 --- a/README/ReleaseNotes/v642/index.md +++ b/README/ReleaseNotes/v642/index.md @@ -51,6 +51,7 @@ The following people have contributed to this new version: * The conversion from Python set to **RooArgSet** is deprecated and won't work anymore in ROOT 6.44. The problem is that Python sets are unordered while RooArgSets are ordered, and this mismatch can lead to subtle problems later on. Prefer conversion from Python lists or tuples, which are ordered too. * The ROOT IO capability for the `TMVA::Experimental::SOFIE::RModel` has been removed. Users should not be encouraged to serialize models in experimental classes. For the serialization of ONNX models one can already use ONNX directly, and even serialize the ONNX bytes to a ROOT file if required. * The **JsMVA** feature for interactive TMVA training in Jupyter notebooks is now removed. It was not functional for years and was therefore already excluded from ROOT 6.38. This also removes the `TMVA::IPythonInteractive` class and the related interactive-training interfaces from the TMVA method and fitter classes, such as `MethodBase::ExitFromTraining()` or `FitterBase::SetIPythonInteractive()`. +* The **RooStats::DebuggingSampler** and **RooStats::DebuggingTestStat** classes are removed. They were mock implementations of the `TestStatSampler` and `TestStatistic` interfaces that returned uniform random numbers independent of the data, only meant for debugging the RooStats framework itself during its initial development. ## Python Interface diff --git a/roofit/roostats/CMakeLists.txt b/roofit/roostats/CMakeLists.txt index b51d6b718a8c8..6f3d676a1ff8c 100644 --- a/roofit/roostats/CMakeLists.txt +++ b/roofit/roostats/CMakeLists.txt @@ -22,8 +22,6 @@ ROOT_STANDARD_LIBRARY_PACKAGE(RooStats RooStats/CombinedCalculator.h RooStats/ConfidenceBelt.h RooStats/ConfInterval.h - RooStats/DebuggingSampler.h - RooStats/DebuggingTestStat.h RooStats/DetailedOutputAggregator.h RooStats/FeldmanCousins.h RooStats/FrequentistCalculator.h diff --git a/roofit/roostats/inc/LinkDef.h b/roofit/roostats/inc/LinkDef.h index 228d8a3671d60..5efdb30d3fba6 100644 --- a/roofit/roostats/inc/LinkDef.h +++ b/roofit/roostats/inc/LinkDef.h @@ -54,12 +54,10 @@ #pragma link C++ class RooStats::DetailedOutputAggregator+; #pragma link C++ class RooStats::TestStatSampler+; // interface, not concrete -#pragma link C++ class RooStats::DebuggingSampler+; #pragma link C++ class RooStats::ToyMCSampler+; #pragma link C++ class RooStats::ToyMCImportanceSampler+; #pragma link C++ class RooStats::TestStatistic+; // interface -#pragma link C++ class RooStats::DebuggingTestStat+; #pragma link C++ class RooStats::ProfileLikelihoodTestStat+; #pragma link C++ class RooStats::RatioOfProfiledLikelihoodsTestStat+; #pragma link C++ class RooStats::NumEventsTestStat+; diff --git a/roofit/roostats/inc/RooStats/DebuggingSampler.h b/roofit/roostats/inc/RooStats/DebuggingSampler.h deleted file mode 100644 index c62b77fc40e2d..0000000000000 --- a/roofit/roostats/inc/RooStats/DebuggingSampler.h +++ /dev/null @@ -1,113 +0,0 @@ -// @(#)root/roostats:$Id$ -// Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke -/************************************************************************* - * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * - * All rights reserved. * - * * - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#ifndef ROOSTATS_DebuggingSampler -#define ROOSTATS_DebuggingSampler - -/** \class DebuggingSampler - \ingroup Roostats - -DebuggingSampler is a simple implementation of the DistributionCreator interface used for debugging. -The sampling distribution is uniformly random between [0,1] and is INDEPENDENT of the data. So it is not useful -for true statistical tests, but it is useful for debugging. - -*/ - -#include "Rtypes.h" - -#include - -#include "RooStats/TestStatSampler.h" -#include "RooStats/SamplingDistribution.h" - -#include "RooRealVar.h" -#include "TRandom.h" - -namespace RooStats { - - class DebuggingSampler: public TestStatSampler { - - public: - DebuggingSampler() : - fTestStatistic{new RooRealVar("UniformTestStatistic","UniformTestStatistic",0,0,1)}, - fRand{new TRandom()} - {} - ~DebuggingSampler() override { - delete fRand; - delete fTestStatistic; - } - - /// Main interface to get a ConfInterval, pure virtual - SamplingDistribution* GetSamplingDistribution(RooArgSet& paramsOfInterest) override { - (void)paramsOfInterest; // avoid warning - // normally this method would be complex, but here it is simple for debugging - std::vector testStatVec; - testStatVec.reserve(1000); -for(Int_t i=0; i<1000; ++i){ - testStatVec.push_back( fRand->Uniform() ); - } - return new SamplingDistribution("UniformSamplingDist", "for debugging", testStatVec ); - } - - /// Main interface to evaluate the test statistic on a dataset - double EvaluateTestStatistic(RooAbsData& /*data*/, RooArgSet& /*paramsOfInterest*/) override { - // data = data; // avoid warning - // paramsOfInterest = paramsOfInterest; // avoid warning - return fRand->Uniform(); - } - - /// Get the TestStatistic - TestStatistic* GetTestStatistic() const override { - std::cout << "GetTestStatistic() IS NOT IMPLEMENTED FOR THIS SAMPLER. Returning nullptr." << std::endl; - return nullptr; /*fTestStatistic;*/ - } - - /// Get the Confidence level for the test - double ConfidenceLevel() const override {return 1.-fSize;} - - /// Common Initialization - void Initialize(RooAbsArg& /* testStatistic */, RooArgSet& /* paramsOfInterest */, RooArgSet& /* nuisanceParameters */ ) override { - } - - /// Set the Pdf, add to the workspace if not already there - void SetPdf(RooAbsPdf&) override {} - - /// specify the parameters of interest in the interval - virtual void SetParameters(RooArgSet&) {} - /// specify the nuisance parameters (eg. the rest of the parameters) - void SetNuisanceParameters(const RooArgSet&) override {} - /// specify the values of parameters used when evaluating test statistic - void SetParametersForTestStat(const RooArgSet& ) override {} - /// specify the conditional observables - void SetGlobalObservables(const RooArgSet& ) override {} - - - /// set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval) - void SetTestSize(double size) override {fSize = size;} - /// set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval) - void SetConfidenceLevel(double cl) override {fSize = 1.-cl;} - - /// Set the TestStatistic (want the argument to be a function of the data & parameter points - void SetTestStatistic(TestStatistic* /*testStatistic*/) override { - std::cout << "SetTestStatistic(...) IS NOT IMPLEMENTED FOR THIS SAMPLER" << std::endl; - } - - private: - double fSize; - RooRealVar* fTestStatistic; - TRandom* fRand; - - protected: - ClassDefOverride(DebuggingSampler,1) // A simple implementation of the DistributionCreator interface - }; -} - - -#endif diff --git a/roofit/roostats/inc/RooStats/DebuggingTestStat.h b/roofit/roostats/inc/RooStats/DebuggingTestStat.h deleted file mode 100644 index 13f1dc89f34a0..0000000000000 --- a/roofit/roostats/inc/RooStats/DebuggingTestStat.h +++ /dev/null @@ -1,67 +0,0 @@ -// @(#)root/roostats:$Id$ -// Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke -/************************************************************************* - * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * - * All rights reserved. * - * * - * For the licensing terms see $ROOTSYS/LICENSE. * - * For the list of contributors see $ROOTSYS/README/CREDITS. * - *************************************************************************/ - -#ifndef ROOSTATS_DebuggingTestStat -#define ROOSTATS_DebuggingTestStat - -/** \class DebuggingTestStat - \ingroup Roostats - -DebuggingTestStat is a simple implementation of the DistributionCreator interface used for debugging. -The sampling distribution is uniformly random between [0,1] and is INDEPENDENT of the data. So it is not useful -for true statistical tests, but it is useful for debugging. - -*/ - -#include "Rtypes.h" - -#include "RooStats/TestStatistic.h" -#include "RooStats/ToyMCSampler.h" - -#include "RooAbsPdf.h" -#include "RooArgSet.h" -#include "RooRealVar.h" -#include "RooDataSet.h" -#include "SamplingDistribution.h" -#include "TRandom.h" - -namespace RooStats { - - class DebuggingTestStat : public TestStatistic { - - public: - DebuggingTestStat() : - fTestStatistic{new RooRealVar("UniformTestStatistic","UniformTestStatistic",0,0,1)}, - fRand{new TRandom()} - {} - - /// Main interface to evaluate the test statistic on a dataset - double Evaluate(RooAbsData& /*data*/, RooArgSet& /*paramsOfInterest*/) override { - //data = data; // avoid warning - //paramsOfInterest = paramsOfInterest; //avoid warning - return fRand->Uniform(); - } - - - - - private: - - RooRealVar* fTestStatistic; - TRandom* fRand; - - protected: - ClassDefOverride(DebuggingTestStat,1) // A concrete implementation of the TestStatistic interface, useful for debugging. - }; - -} - - -#endif