From 88b2fa1fc8da4205e08511bc3f005f7e905a1248 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Tue, 5 Nov 2024 13:23:01 +0100 Subject: [PATCH] [RF] Remove the deprecated RooFit code to be removed in ROOT 6.36 Execute on what was announced in the 6.34 release notes and indicated by deprecation macros and doxygen tags. --- README/ReleaseNotes/v636/index.md | 2 + .../MakeModelAndMeasurementsFast.h | 14 - .../inc/RooStats/HistFactory/Measurement.h | 18 -- roofit/histfactory/src/ConfigParser.cxx | 3 +- .../src/MakeModelAndMeasurementsFast.cxx | 274 +----------------- roofit/roofitcore/inc/RooAbsArg.h | 31 -- roofit/roofitcore/inc/RooPlot.h | 6 - roofit/roofitcore/inc/RooTemplateProxy.h | 50 ---- roofit/roofitcore/src/RooAbsArg.cxx | 19 -- roofit/roofitcore/src/RooPlot.cxx | 40 --- roofit/roostats/inc/RooStats/MarkovChain.h | 28 -- roofit/roostats/src/MarkovChain.cxx | 24 -- 12 files changed, 6 insertions(+), 503 deletions(-) diff --git a/README/ReleaseNotes/v636/index.md b/README/ReleaseNotes/v636/index.md index 366f06bdcc546..be4c4eb54d2d4 100644 --- a/README/ReleaseNotes/v636/index.md +++ b/README/ReleaseNotes/v636/index.md @@ -14,6 +14,8 @@ The following people have contributed to this new version: ## Deprecation and Removal +* The RooFit legacy interfaces that were deprecated in ROOT 6.34 and scheduled for removal in ROOT 6.36 are removed. See the RooFit section in the 6.34 release notes for a full list. + ## Python Interface ## RDataFrame diff --git a/roofit/histfactory/inc/RooStats/HistFactory/MakeModelAndMeasurementsFast.h b/roofit/histfactory/inc/RooStats/HistFactory/MakeModelAndMeasurementsFast.h index 201e27a93967c..34478f20e8456 100644 --- a/roofit/histfactory/inc/RooStats/HistFactory/MakeModelAndMeasurementsFast.h +++ b/roofit/histfactory/inc/RooStats/HistFactory/MakeModelAndMeasurementsFast.h @@ -8,8 +8,6 @@ #include "RooWorkspace.h" #include "RooPlot.h" -#include // for the R__DEPRECATED macro - #include #include #include @@ -24,18 +22,6 @@ namespace RooStats{ HistoToWorkspaceFactoryFast::Configuration const& cfg={} ); - void FormatFrameForLikelihood(RooPlot* frame, std::string xTitle=std::string("#sigma / #sigma_{SM}"), std::string yTitle=std::string("-log likelihood")) -#ifndef ROOFIT_BUILDS_ITSELF - R__DEPRECATED(6,36, "Please write your own plotting code inspired by the hf001 tutorial.") -#endif - ; - void FitModel(RooWorkspace *, std::string data_name="obsData") - R__DEPRECATED(6,36, "Please write your own plotting code inspired by the hf001 tutorial."); - void FitModelAndPlot(const std::string& measurementName, const std::string& fileNamePrefix, RooWorkspace &, std::string, std::string, TFile&, std::ostream&) -#ifndef ROOFIT_BUILDS_ITSELF - R__DEPRECATED(6,36, "Please write your own plotting code inspired by the hf001 tutorial.") -#endif - ; } } diff --git a/roofit/histfactory/inc/RooStats/HistFactory/Measurement.h b/roofit/histfactory/inc/RooStats/HistFactory/Measurement.h index 9ed7d4ebd0dfd..fe89c3d0e554a 100644 --- a/roofit/histfactory/inc/RooStats/HistFactory/Measurement.h +++ b/roofit/histfactory/inc/RooStats/HistFactory/Measurement.h @@ -23,8 +23,6 @@ #include "RooStats/HistFactory/Channel.h" #include "RooStats/HistFactory/Asimov.h" -#include // for the R__DEPRECATED macro - class TFile; namespace RooStats{ @@ -97,22 +95,6 @@ class Measurement : public TNamed { int GetBinLow() { return fBinLow; } int GetBinHigh() { return fBinHigh; } - /// Do not produce any plots or tables, just save the model. - /// - /// \deprecated Will be removed in ROOT 6.36. ExportOnly() == true is the default since ROOT 6.34 and it can't be disabled anymore in 6.36. - void SetExportOnly( bool ExportOnly ) -#ifndef ROOFIT_BUILDS_ITSELF - R__DEPRECATED(6,36, "ExportOnly() == true is the default since ROOT 6.34 and it can't be disabled anymore in 6.36.") -#endif - { fExportOnly = ExportOnly; } - - /// \deprecated Will be removed in ROOT 6.36. ExportOnly() == true is the default since ROOT 6.34 and it can't be disabled anymore in 6.36. - bool GetExportOnly() -#ifndef ROOFIT_BUILDS_ITSELF - R__DEPRECATED(6,36, "ExportOnly() == true is the default since ROOT 6.34 and it can't be disabled anymore in 6.36.") -#endif - { return fExportOnly; } - void PrintTree( std::ostream& = std::cout ); /// Print to a stream void PrintXML( std::string Directory="", std::string NewOutputPrefix="" ); diff --git a/roofit/histfactory/src/ConfigParser.cxx b/roofit/histfactory/src/ConfigParser.cxx index 88e3ca73d1124..b8d01da10c6bd 100644 --- a/roofit/histfactory/src/ConfigParser.cxx +++ b/roofit/histfactory/src/ConfigParser.cxx @@ -380,7 +380,8 @@ HistFactory::Measurement ConfigParser::CreateMeasurementFromDriverNode(TXMLNode } else if (curAttrName == "Mode") { cout << "\n INFO: Mode attribute is deprecated and no longer supported, will ignore\n"; } else if (curAttrName == "ExportOnly") { - measurement.SetExportOnly(CheckTrueFalse(curAttrValue, "Measurement")); + // ignored + cxcoutIHF << "The \"ExportOnly\" attribute is ignored it is always \"true\" for any Measurement." << std::endl; } else { cxcoutEHF << "Found unknown XML attribute in Measurement: " << curAttrName << "\n"; throw hf_exc(); diff --git a/roofit/histfactory/src/MakeModelAndMeasurementsFast.cxx b/roofit/histfactory/src/MakeModelAndMeasurementsFast.cxx index 3e8b93dc31f63..f7558250dfde2 100644 --- a/roofit/histfactory/src/MakeModelAndMeasurementsFast.cxx +++ b/roofit/histfactory/src/MakeModelAndMeasurementsFast.cxx @@ -20,10 +20,6 @@ #include "HFMsgService.h" #include -#include -#include -#include -#include #include #include @@ -32,8 +28,6 @@ #include #include -static void formatFrameForLikelihoodImpl(RooPlot* frame, std::string YTitle); - /** ******************************************************************************************** \ingroup HistFactory @@ -90,7 +84,6 @@ RooStats::HistFactory::MakeModelAndMeasurementFast(RooStats::HistFactory::Measur HistoToWorkspaceFactoryFast::Configuration const &cfg) { std::unique_ptr outFile; - std::ofstream tableFile; auto& msgSvc = RooMsgService::instance(); msgSvc.getStream(1).removeTopic(RooFit::ObjectHandling); @@ -105,8 +98,8 @@ RooStats::HistFactory::MakeModelAndMeasurementFast(RooStats::HistFactory::Measur std::ostringstream parameterMessage; parameterMessage << "fixing the following parameters:" << std::endl; - for(std::vector::iterator itr=measurement.GetConstantParams().begin(); itr!=measurement.GetConstantParams().end(); ++itr){ - parameterMessage << " " << *itr << '\n'; + for (auto const &name : measurement.GetConstantParams()) { + parameterMessage << " " << name << '\n'; } cxcoutIHF << parameterMessage.str(); @@ -142,9 +135,6 @@ RooStats::HistFactory::MakeModelAndMeasurementFast(RooStats::HistFactory::Measur cxcoutIHF << "Creating the output file: " << outputFileName << std::endl; outFile = std::make_unique(outputFileName.c_str(), "recreate"); - // Create the table file, which holds the table of fitted values and errors - tableFile.open(measurement.GetOutputFilePrefix() + "_results.table", std::ios::out | std::ios::app); - cxcoutIHF << "Creating the HistoToWorkspaceFactoryFast factory" << std::endl; HistoToWorkspaceFactoryFast factory{measurement, cfg}; @@ -153,9 +143,6 @@ RooStats::HistFactory::MakeModelAndMeasurementFast(RooStats::HistFactory::Measur cxcoutIHF << "Setting preprocess functions" << std::endl; factory.SetFunctionsToPreprocess( measurement.GetPreprocessFunctions() ); - // for results tables - tableFile << " " << rowTitle << " &"; - // First: Loop to make the individual channels for( unsigned int chanItr = 0; chanItr < measurement.GetChannels().size(); ++chanItr ) { @@ -189,27 +176,6 @@ RooStats::HistFactory::MakeModelAndMeasurementFast(RooStats::HistFactory::Measur cxcoutPHF << "Successfully wrote channel to file" << std::endl; } - // Get the Parameter of Interest as a RooRealVar - RooRealVar* poi = dynamic_cast(ws_single->var(measurement.GetPOI())); - - // do fit unless exportOnly requested - if(! measurement.GetExportOnly()){ - if(!poi) { - cxcoutWHF << "Can't do fit for: " << measurement.GetName() - << ", no parameter of interest" << std::endl; - } else { - if(ws_single->data("obsData")) { - FitModelAndPlot(measurement.GetName(), measurement.GetOutputFilePrefix(), *ws_single, - ch_name, "obsData", *outFile, tableFile); - } else { - FitModelAndPlot(measurement.GetName(), measurement.GetOutputFilePrefix(), *ws_single, - ch_name, "asimovData", *outFile, tableFile); - } - } - } - - tableFile << " & "; - channel_workspaces.emplace_back(std::move(ws_single)); } // End loop over channels @@ -225,9 +191,6 @@ RooStats::HistFactory::MakeModelAndMeasurementFast(RooStats::HistFactory::Measur // Configure that workspace HistoToWorkspaceFactoryFast::ConfigureWorkspaceForMeasurement("simPdf", ws.get(), measurement); - // Get the Parameter of interest as a RooRealVar - RooRealVar* poi = dynamic_cast(ws->var(measurement.GetPOI())); - { std::string CombinedFileName = measurement.GetOutputFilePrefix() + "_combined_" + rowTitle + "_model.root"; @@ -242,240 +205,7 @@ RooStats::HistFactory::MakeModelAndMeasurementFast(RooStats::HistFactory::Measur measurement.writeToFile( combFile.get() ); } - // Fit the combined model - if(! measurement.GetExportOnly()){ - if(!poi) { - cxcoutWHF << "Can't do fit for: " << measurement.GetName() - << ", no parameter of interest" << std::endl; - } - else { - if(ws->data("obsData")){ - FitModelAndPlot(measurement.GetName(), measurement.GetOutputFilePrefix(), *ws,"combined", - "obsData", *outFile, tableFile); - } - else { - FitModelAndPlot(measurement.GetName(), measurement.GetOutputFilePrefix(), *ws,"combined", - "asimovData", *outFile, tableFile); - } - } - } - - tableFile << " \\\\ \n"; - msgSvc.getStream(1).addTopic(RooFit::ObjectHandling); return RooFit::makeOwningPtr(std::move(ws)); } - -/////////////////////////////////////////////// -/// \deprecated Will be removed in ROOT 6.36. Please write your own plotting code inspired by the hf001 tutorial. - -void RooStats::HistFactory::FitModelAndPlot(const std::string &MeasurementName, const std::string &FileNamePrefix, - RooWorkspace &combined, std::string channel, std::string data_name, - TFile &outFile, std::ostream &tableStream) -{ - using namespace RooFit; - - auto combined_config = static_cast(combined.obj("ModelConfig")); - if(!combined_config){ - cxcoutEHF << "Error: no ModelConfig found in Measurement: " - << MeasurementName << std::endl; - throw hf_exc(); - } - - RooAbsData* simData = combined.data(data_name); - if(!simData){ - cxcoutEHF << "Error: Failed to get dataset: " << data_name - << " in measurement: " << MeasurementName << std::endl; - throw hf_exc(); - } - - const RooArgSet* POIs = combined_config->GetParametersOfInterest(); - if(!POIs) { - cxcoutEHF << "Not Fitting Model for measurement: " << MeasurementName - << ", no poi found" << std::endl; - // Should I throw an exception here? - return; - } - - RooAbsPdf* model = combined_config->GetPdf(); - if( model==nullptr ) { - cxcoutEHF << "Error: Failed to find pdf in ModelConfig: " << combined_config->GetName() - << std::endl; - throw hf_exc(); - } - - // Save a Snapshot - RooArgSet PoiPlusNuisance; - if( combined_config->GetNuisanceParameters() ) { - PoiPlusNuisance.add( *combined_config->GetNuisanceParameters() ); - } - PoiPlusNuisance.add( *combined_config->GetParametersOfInterest() ); - combined.saveSnapshot("InitialValues", PoiPlusNuisance); - - /////////////////////////////////////// - // Do the fit - cxcoutPHF << "\n---------------" - << "\nDoing "<< channel << " Fit" - << "\n---------------\n\n" << std::endl; - const int printLevel = RooMsgService::instance().isActive(nullptr, RooFit::HistFactory, RooFit::DEBUG) ? 1 : -1; - model->fitTo(*simData, Minos(true), PrintLevel(printLevel)); - - // If there are no parameters of interest, - // we exit the function here - if( POIs->empty() ) { - cxcoutWHF << "WARNING: No POIs found in measurement: " << MeasurementName << std::endl; - return; - } - - // Loop over all POIs and print their fitted values - for (auto const *poi : static_range_cast(*POIs)) { - cxcoutIHF << "printing results for " << poi->GetName() - << " at " << poi->getVal()<< " high " - << poi->getErrorLo() << " low " - << poi->getErrorHi() << std::endl; - } - - // But we only make detailed plots and tables - // for the 'first' POI - RooRealVar* poi = static_cast(POIs->first()); - - // Print the MINOS errors to the TableFile - const auto oldPrecision = tableStream.precision(); - tableStream.precision(4); - tableStream << " " << poi->getErrorLo() << " / " << poi->getErrorHi() << " "; - tableStream.precision(oldPrecision); - - // Make the Profile Likelihood Plot - std::unique_ptr nll{model->createNLL(*simData)}; - std::unique_ptr profile{nll->createProfile(*poi)}; - - std::unique_ptr frame{poi->frame()}; - - // Draw the likelihood curve - FormatFrameForLikelihood(frame.get()); - { - TCanvas profileLikelihoodCanvas{channel.c_str(), "",800,600}; - nll->plotOn(frame.get(), ShiftToZero(), LineColor(kRed), LineStyle(kDashed)); - profile->plotOn(frame.get()); - frame->SetMinimum(0); - frame->SetMaximum(2.); - frame->Draw(); - std::string profilePlotName = FileNamePrefix+"_"+channel+"_"+MeasurementName+"_profileLR.eps"; - profileLikelihoodCanvas.SaveAs( profilePlotName.c_str() ); - } - - // Now, we save our results to the 'output' file - // (I'm not sure if users actually look into this file, - // but adding additional information and useful plots - // may make it more attractive) - - // Save to the output file - TDirectory* channel_dir = outFile.mkdir(channel.c_str()); - if( channel_dir == nullptr ) { - cxcoutEHF << "Error: Failed to make channel directory: " << channel << std::endl; - throw hf_exc(); - } - TDirectory* summary_dir = channel_dir->mkdir("Summary"); - if( summary_dir == nullptr ) { - cxcoutEHF << "Error: Failed to make Summary directory for channel: " - << channel << std::endl; - throw hf_exc(); - } - summary_dir->cd(); - - // Save a graph of the profile likelihood curve - RooCurve* curve=frame->getCurve(); - Int_t curve_N=curve->GetN(); - double* curve_x=curve->GetX(); - - std::vector x_arr(curve_N); - std::vector y_arr_nll(curve_N); - - for(int i=0; isetVal(f); - x_arr[i]=f; - y_arr_nll[i]=nll->getVal(); - } - - TGraph g{curve_N, x_arr.data(), y_arr_nll.data()}; - g.SetName( (FileNamePrefix +"_nll").c_str() ); - g.Write(); - - // Finally, restore the initial values - combined.loadSnapshot("InitialValues"); - -} - - -/// \deprecated Will be removed in ROOT 6.36. Please write your own plotting code inspired by the hf001 tutorial. - -void RooStats::HistFactory::FitModel(RooWorkspace * combined, std::string data_name ) -{ - using namespace RooFit; - - cxcoutIHF << "In Fit Model" << std::endl; - ModelConfig * combined_config = static_cast(combined->obj("ModelConfig")); - if(!combined_config){ - cxcoutEHF << "no model config " << "ModelConfig" << " exiting" << std::endl; - return; - } - - RooAbsData* simData = combined->data(data_name); - if(!simData){ - cxcoutEHF << "no data " << data_name << " exiting" << std::endl; - return; - } - - const RooArgSet * POIs=combined_config->GetParametersOfInterest(); - if(!POIs){ - cxcoutEHF << "no poi " << data_name << " exiting" << std::endl; - return; - } - - RooAbsPdf* model=combined_config->GetPdf(); - model->fitTo(*simData, Minos(true), PrintLevel(1)); - - } - -void formatFrameForLikelihoodImpl(RooPlot* frame, std::string YTitle) -{ - using namespace RooFit; - - gStyle->SetCanvasBorderMode(0); - gStyle->SetPadBorderMode(0); - // gStyle->SetPadColor(0); - // gStyle->SetCanvasColor(255); - // gStyle->SetTitleFillColor(255); - // gStyle->SetFrameFillColor(0); - // gStyle->SetStatColor(255); - - RooAbsRealLValue* var = frame->getPlotVar(); - double xmin = var->getMin(); - double xmax = var->getMax(); - - frame->SetTitle(""); - // frame->GetXaxis()->SetTitle(XTitle.c_str()); - frame->GetXaxis()->SetTitle(var->GetTitle()); - frame->GetYaxis()->SetTitle(YTitle.c_str()); - frame->SetMaximum(2.); - frame->SetMinimum(0.); - TLine * line = new TLine(xmin,.5,xmax,.5); - line->SetLineColor(kGreen); - TLine * line90 = new TLine(xmin,2.71/2.,xmax,2.71/2.); - line90->SetLineColor(kGreen); - TLine * line95 = new TLine(xmin,3.84/2.,xmax,3.84/2.); - line95->SetLineColor(kGreen); - frame->addObject(line); - frame->addObject(line90); - frame->addObject(line95); -} - -/// \deprecated Will be removed in ROOT 6.36. Please write your own plotting code inspired by the hf001 tutorial. - -void RooStats::HistFactory::FormatFrameForLikelihood(RooPlot* frame, std::string /*XTitle*/, - std::string YTitle) -{ - formatFrameForLikelihoodImpl(frame, YTitle); -} diff --git a/roofit/roofitcore/inc/RooAbsArg.h b/roofit/roofitcore/inc/RooAbsArg.h index c69bfdd0ffc1d..902fa00447b88 100644 --- a/roofit/roofitcore/inc/RooAbsArg.h +++ b/roofit/roofitcore/inc/RooAbsArg.h @@ -29,8 +29,6 @@ #include #include -#include // for the R__DEPRECATED macro - #include #include #include @@ -127,35 +125,6 @@ class RooAbsArg : public TNamed, public RooPrintable { bool overlaps(const RooAbsArg& testArg, bool valueOnly=false) const ; bool hasClients() const { return !_clientList.empty(); } - //////////////////////////////////////////////////////////////////////////// - /// \name Legacy RooFit interface. - /// This is a collection of functions that remain supported, but more elegant - /// interfaces are usually available. - /// @{ - - // --- Obsolete functions for backward compatibility - R__DEPRECATED(6,36, "Use getObservables().") - RooFit::OwningPtr getDependents(const RooArgSet& set) const; - R__DEPRECATED(6,36, "Use getObservables().") - RooFit::OwningPtr getDependents(const RooAbsData* set) const; - R__DEPRECATED(6,36, "Use getObservables().") - RooFit::OwningPtr getDependents(const RooArgSet* depList) const; - /// \deprecated Use observableOverlaps() - R__DEPRECATED(6,36, "Use observableOverlaps().") - inline bool dependentOverlaps(const RooAbsData* dset, const RooAbsArg& testArg) const { return observableOverlaps(dset,testArg) ; } - /// \deprecated Use observableOverlaps() - R__DEPRECATED(6,36, "Use observableOverlaps().") - inline bool dependentOverlaps(const RooArgSet* depList, const RooAbsArg& testArg) const { return observableOverlaps(depList, testArg) ; } - /// \deprecated Use checkObservables() - R__DEPRECATED(6,36, "Use checkObservables().") - inline bool checkDependents(const RooArgSet* nset) const { return checkObservables(nset) ; } - /// \deprecated Use recursiveCheckObservables() - R__DEPRECATED(6,36, "Use recursiveCheckObservables().") - inline bool recursiveCheckDependents(const RooArgSet* nset) const { return recursiveCheckObservables(nset) ; } - // --- End obsolete functions for backward compatibility - /// @} - //////////////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////// /// \anchor clientServerInterface /// \name Client-Server Interface diff --git a/roofit/roofitcore/inc/RooPlot.h b/roofit/roofitcore/inc/RooPlot.h index d120f42ff60bc..17dc6e841e2c0 100644 --- a/roofit/roofitcore/inc/RooPlot.h +++ b/roofit/roofitcore/inc/RooPlot.h @@ -19,8 +19,6 @@ #include "RooPrintable.h" #include "TNamed.h" -#include // for the R__DEPRECATED macro - #include #include @@ -47,12 +45,8 @@ class RooPlot : public TNamed, public RooPrintable { using Items = std::vector>; RooPlot() ; - RooPlot(const char* name, const char* title, const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins) - R__DEPRECATED(6,36, "Use the constructor that doesn't take the name and title, and then call SetName() and SetTitle() on the RooPlot."); RooPlot(const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins); RooPlot(double xmin, double xmax, int nBins=100); - RooPlot(double xmin, double xmax, double ymin, double ymax) - R__DEPRECATED(6,36, "Use RooPlot(double xmin, double xmax); SetMinimum(ymin); SetMaximum(ymax);"); RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2); RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2, double xmin, double xmax, double ymin, double ymax); diff --git a/roofit/roofitcore/inc/RooTemplateProxy.h b/roofit/roofitcore/inc/RooTemplateProxy.h index 558e10ff52f18..854c9e611eaa3 100644 --- a/roofit/roofitcore/inc/RooTemplateProxy.h +++ b/roofit/roofitcore/inc/RooTemplateProxy.h @@ -22,8 +22,6 @@ #include "RooAbsCategory.h" #include "RooMsgService.h" -#include // for the R__DEPRECATED macro - #include /** @@ -176,31 +174,6 @@ class RooTemplateProxy : public RooArgProxy { // not happen. } -#ifndef ROOFIT_MEMORY_SAFE_INTERFACES - /// Constructor with owner. - /// - /// \deprecated Kept for backwards compatibility and will be removed in ROOT 6.36. - /// Either use RooTemplateProxy(const char*, const char*, RooAbsArg*, bool, bool), - /// and transfer the ownership with RooTemplateProxy::putOwnedArg(), - /// or use RooTemplateProxy(const char*, const char*, RooAbsArg*, std::unique_ptr, bool, bool) - /// if you want the proxy to own the argument. - /// depending if you want to transfer ownership or not. - /// - /// \param[in] theName Name of this proxy (for printing). - /// \param[in] desc Description what this proxy should act as. - /// \param[in] owner The object that owns the proxy. This is important for tracking - /// of client-server dependencies. - /// \param[in] valueServer Notify the owner if value changes. - /// \param[in] shapeServer Notify the owner if shape (e.g. binning) changes. - /// \param[in] proxyOwnsArg Proxy will delete the payload if owning. - template::value>> - R__DEPRECATED(6,36, "Use RooTemplateProxy(const char*, const char*, RooAbsArg*, bool, bool) and transfer the ownership with RooTemplateProxy::putOwnedArg().") - RooTemplateProxy(const char* theName, const char* desc, RooAbsArg* owner, - Bool valueServer, bool shapeServer, bool proxyOwnsArg) - : RooArgProxy(theName, desc, owner, valueServer, shapeServer, proxyOwnsArg) - {} -#endif - //////////////////////////////////////////////////////////////////////////////// /// Constructor with owner and proxied object. /// \param[in] theName Name of this proxy (for printing). @@ -214,29 +187,6 @@ class RooTemplateProxy : public RooArgProxy { bool valueServer=true, bool shapeServer=false) : RooArgProxy(theName, desc, owner, const_cast::type&>(ref), valueServer, shapeServer, false) { } -#ifndef ROOFIT_MEMORY_SAFE_INTERFACES - //////////////////////////////////////////////////////////////////////////////// - /// Constructor with owner and proxied object. - /// - /// \deprecated Kept for backwards compatibility and will be removed in ROOT 6.36. - /// Please use RooTemplateProxy(const char*, const char*, RooAbsArg*, std::unique_ptr, bool, bool) - /// or RooTemplateProxy(const char*, const char*, RooAbsArg*, T&, bool, bool), - /// depending if you want to transfer ownership or not. - /// - /// \param[in] theName Name of this proxy (for printing). - /// \param[in] desc Description what this proxy should act as. - /// \param[in] owner The object that owns the proxy. This is important for tracking - /// of client-server dependencies. - /// \param[in] ref Reference to the object that the proxy should hold. - /// \param[in] valueServer Notify the owner if value changes. - /// \param[in] shapeServer Notify the owner if shape (e.g. binning) changes. - /// \param[in] proxyOwnsArg Proxy will delete the payload if owning. - R__DEPRECATED(6,36, "Use constructors without proxyOwnsArg argument, taking the one that accepts a std::unique_ptr if you want to pass ownership.") - RooTemplateProxy(const char* theName, const char* desc, RooAbsArg* owner, T& ref, - bool valueServer, bool shapeServer, bool proxyOwnsArg) : - RooArgProxy(theName, desc, owner, const_cast::type&>(ref), valueServer, shapeServer, proxyOwnsArg) { } -#endif - //////////////////////////////////////////////////////////////////////////////// /// Constructor with owner and proxied object, taking ownership of the proxied object. /// diff --git a/roofit/roofitcore/src/RooAbsArg.cxx b/roofit/roofitcore/src/RooAbsArg.cxx index 5ddf4af4d2ae6..54f91f5dffa3c 100644 --- a/roofit/roofitcore/src/RooAbsArg.cxx +++ b/roofit/roofitcore/src/RooAbsArg.cxx @@ -777,25 +777,6 @@ bool RooAbsArg::getObservables(const RooAbsCollection* dataList, RooArgSet& outp } -/// \deprecated Use getObservables() -RooFit::OwningPtr RooAbsArg::getDependents(const RooArgSet &set) const -{ - return getObservables(set); -} - -/// \deprecated Use getObservables() -RooFit::OwningPtr RooAbsArg::getDependents(const RooAbsData *set) const -{ - return getObservables(set); -} - -/// \deprecated Use getObservables() -RooFit::OwningPtr RooAbsArg::getDependents(const RooArgSet *depList) const -{ - return getObservables(depList); -} - - //////////////////////////////////////////////////////////////////////////////// /// Create a RooArgSet with all components (branch nodes) of the /// expression tree headed by this object. diff --git a/roofit/roofitcore/src/RooPlot.cxx b/roofit/roofitcore/src/RooPlot.cxx index 170bb173f7ef0..0c943516ce979 100644 --- a/roofit/roofitcore/src/RooPlot.cxx +++ b/roofit/roofitcore/src/RooPlot.cxx @@ -106,23 +106,6 @@ RooPlot::RooPlot(double xmin, double xmax, int nBins) } - -//////////////////////////////////////////////////////////////////////////////// -/// Construct of a two-dimensional RooPlot with ranges [xmin,xmax] x [ymin,ymax] - -RooPlot::RooPlot(double xmin, double xmax, double ymin, double ymax) : - _defYmax(0) -{ - _hist = new TH1D(histName(),"A RooPlot",100,xmin,xmax) ; - _hist->Sumw2(false) ; - _hist->GetSumw2()->Set(0) ; - _hist->SetDirectory(nullptr); - - SetMinimum(ymin); - SetMaximum(ymax); - initialize(); -} - namespace { const RooAbsRealLValue& validateFiniteLimits(const RooAbsRealLValue &var) @@ -169,29 +152,6 @@ RooPlot::RooPlot(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2, dou } -//////////////////////////////////////////////////////////////////////////////// -/// Create an 1-dimensional with all properties taken from 'var', but -/// with an explicit range [xmin,xmax] and a default binning of 'nbins' - -RooPlot::RooPlot(const char *name, const char *title, const RooAbsRealLValue &var, double xmin, double xmax, - Int_t nbins) - : _hist(new TH1D(name, title, nbins, xmin, xmax)), - _plotVar(const_cast(&var)), - _normBinWidth((xmax - xmin) / nbins) -{ - _hist->Sumw2(false) ; - _hist->GetSumw2()->Set(0) ; - _hist->SetDirectory(nullptr); - - // In the past, the plot variable was cloned, but there was no apparent reason for doing so. - - TString xtitle= var.getTitle(true); - SetXTitle(xtitle.Data()); - - initialize(); -} - - //////////////////////////////////////////////////////////////////////////////// /// Create an 1-dimensional with all properties taken from 'var', but /// with an explicit range [xmin,xmax] and a default binning of 'nbins' diff --git a/roofit/roostats/inc/RooStats/MarkovChain.h b/roofit/roostats/inc/RooStats/MarkovChain.h index 44ed62d6e7f98..497942cabe6f6 100644 --- a/roofit/roostats/inc/RooStats/MarkovChain.h +++ b/roofit/roostats/inc/RooStats/MarkovChain.h @@ -21,13 +21,6 @@ #include "RooDataHist.h" #include "THnSparse.h" -#include // for the R__DEPRECATED macro - -//#include "RooArgSet.h" -//#include "RooMsgService.h" -//#include "RooRealVar.h" - - namespace RooStats { class MarkovChain : public TNamed { @@ -68,17 +61,6 @@ namespace RooStats { /// all variables (including NLL value and weight); /// Note: caller owns the returned data set virtual RooFit::OwningPtr GetAsDataSet(RooArgSet* whichVars = nullptr) const; - - /// Get a clone of the markov chain on which this interval is based - /// as a RooDataSet. You own the returned RooDataSet* - /// \deprecated Will be removed in ROOT 6.36. - virtual RooFit::OwningPtr GetAsDataSet(const RooCmdArg& arg1, - const RooCmdArg& arg2={}, const RooCmdArg& arg3={}, - const RooCmdArg& arg4={}, const RooCmdArg& arg5={}, - const RooCmdArg& arg6={}, const RooCmdArg& arg7={}, - const RooCmdArg& arg8={} ) const - R__DEPRECATED(6,36, "This functionality can be implemented by calling RooAbsData::reduce on the Markov Chain's RooDataSet* (obtained using MarkovChain::GetAsConstDataSet)"); - virtual const RooDataSet* GetAsConstDataSet() const { return fChain; } /// get this MarkovChain as a RooDataHist whose entries contain the values @@ -87,16 +69,6 @@ namespace RooStats { /// Note: caller owns the returned data hist virtual RooFit::OwningPtr GetAsDataHist(RooArgSet* whichVars = nullptr) const; - /// Get a clone of the markov chain on which this interval is based - /// as a RooDataHist. You own the returned RooDataHist* - /// \deprecated Will be removed in ROOT 6.36. - virtual RooFit::OwningPtr GetAsDataHist(const RooCmdArg & arg1, - const RooCmdArg& arg2={}, const RooCmdArg& arg3={}, - const RooCmdArg& arg4={}, const RooCmdArg& arg5={}, - const RooCmdArg& arg6={}, const RooCmdArg& arg7={}, - const RooCmdArg& arg8={} ) const - R__DEPRECATED(6,36, "This functionality can be implemented by calling RooAbsData::reduce on the Markov Chain's RooDataSet* (obtained using MarkovChain::GetAsConstDataSet) and then obtaining its binned clone."); - /// Get a clone of the markov chain on which this interval is based /// as a sparse histogram. You own the returned THnSparse* virtual THnSparse* GetAsSparseHist(RooAbsCollection* whichVars = nullptr) const; diff --git a/roofit/roostats/src/MarkovChain.cxx b/roofit/roostats/src/MarkovChain.cxx index 4ec7396c7bca0..4e62aa64254f6 100644 --- a/roofit/roostats/src/MarkovChain.cxx +++ b/roofit/roostats/src/MarkovChain.cxx @@ -139,18 +139,6 @@ RooFit::OwningPtr MarkovChain::GetAsDataSet(RooArgSet* whichVars) co return RooFit::makeOwningPtr(std::unique_ptr{fChain->reduce(args)}); } -/// \deprecated Will be removed in ROOT 6.36. Please implement this functionality by calling RooAbsData::reduce on the Markov Chain's RooDataSet* -/// (obtained using MarkovChain::GetAsConstDataSet) - -RooFit::OwningPtr MarkovChain::GetAsDataSet(const RooCmdArg &arg1, const RooCmdArg &arg2, - const RooCmdArg &arg3, const RooCmdArg &arg4, - const RooCmdArg &arg5, const RooCmdArg &arg6, - const RooCmdArg &arg7, const RooCmdArg &arg8) const -{ - return RooFit::makeOwningPtr( - std::unique_ptr{fChain->reduce(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)}); -} - RooFit::OwningPtr MarkovChain::GetAsDataHist(RooArgSet* whichVars) const { RooArgSet args; @@ -166,18 +154,6 @@ RooFit::OwningPtr MarkovChain::GetAsDataHist(RooArgSet* whichVars) return RooFit::makeOwningPtr(std::unique_ptr{static_cast(*data).binnedClone()}); } -/// \deprecated Will be removed in ROOT 6.36. Please implement this functionality by calling RooAbsData::reduce on the Markov Chain's RooDataSet* -/// (obtained using MarkovChain::GetAsConstDataSet), and then obtaining its binned clone. - -RooFit::OwningPtr MarkovChain::GetAsDataHist(const RooCmdArg &arg1, const RooCmdArg &arg2, - const RooCmdArg &arg3, const RooCmdArg &arg4, - const RooCmdArg &arg5, const RooCmdArg &arg6, - const RooCmdArg &arg7, const RooCmdArg &arg8) const -{ - std::unique_ptr data{fChain->reduce(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)}; - return RooFit::makeOwningPtr(std::unique_ptr{static_cast(*data).binnedClone()}); -} - THnSparse* MarkovChain::GetAsSparseHist(RooAbsCollection* whichVars) const { RooArgList axes;