From 3dada5a0544b5f7a7100c1e49a812ba4ea2b66ff Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Wed, 20 Apr 2022 10:31:03 +0200 Subject: [PATCH] [RF] Remove deprecated version of `createHistogram` to see what happens --- roofit/roofitcore/inc/RooAbsData.h | 8 +--- roofit/roofitcore/src/RooAbsData.cxx | 70 ---------------------------- 2 files changed, 1 insertion(+), 77 deletions(-) diff --git a/roofit/roofitcore/inc/RooAbsData.h b/roofit/roofitcore/inc/RooAbsData.h index 3146eb55a87bf..28f5810217439 100644 --- a/roofit/roofitcore/inc/RooAbsData.h +++ b/roofit/roofitcore/inc/RooAbsData.h @@ -214,17 +214,11 @@ class RooAbsData : public TNamed, public RooPrintable { const RooCmdArg& arg3=RooCmdArg::none(), const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=RooCmdArg::none(), const RooCmdArg& arg6=RooCmdArg::none(), const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none()) const ; - // Developer note: the `binArgX` parameter has no default `none` value, - // because then the signature would be ambiguous with the deprecated bin - // integer overload below. When the deprecated overload is removed, a default - // value must be set (tutorial failures will remind us to do that). TH1 *createHistogram(const char* varNameList, - const RooCmdArg& binArgX, const RooCmdArg& binArgY=RooCmdArg::none(), + const RooCmdArg& binArgX=RooCmdArg::none(), const RooCmdArg& binArgY=RooCmdArg::none(), const RooCmdArg& binArgZ=RooCmdArg::none()) const; /// Create and fill a ROOT histogram TH1,TH2 or TH3 with the values of this dataset. TH1 *createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) const ; - TH1 *createHistogram(const char* varNameList, Int_t xbins=0, Int_t ybins=0, Int_t zbins=0) const - R__DEPRECATED(6, 30, "Use the overload of RooAbsData::createHistogram that takes RooFit command arguments."); TH2F* createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, const char* cuts="", const char *name= "hist") const; TH2F* createHistogram(const RooAbsRealLValue& var1, const RooAbsRealLValue& var2, int nx, int ny, diff --git a/roofit/roofitcore/src/RooAbsData.cxx b/roofit/roofitcore/src/RooAbsData.cxx index 132e8f8713837..c5c3a535b685b 100644 --- a/roofit/roofitcore/src/RooAbsData.cxx +++ b/roofit/roofitcore/src/RooAbsData.cxx @@ -618,76 +618,6 @@ RooPlot* RooAbsData::plotOn(RooPlot* frame, const RooCmdArg& arg1, const RooCmdA return plotOn(frame,l) ; } -//////////////////////////////////////////////////////////////////////////////// -/// Create and fill a ROOT histogram TH1,TH2 or TH3 with the values of this dataset for the variables with given names -/// The range of each observable that is histogrammed is always automatically calculated from the distribution in -/// the dataset. The number of bins can be controlled using the [xyz]bins parameters. For a greater degree of control -/// use the createHistogram() method below with named arguments -/// -/// The caller takes ownership of the returned histogram - -TH1 *RooAbsData::createHistogram(const char* varNameList, Int_t xbins, Int_t ybins, Int_t zbins) const -{ - coutW(DataHandling) << "'RooAbsData::createHistogram' is deprecated and will be removed in ROOT v6.30: " - << "Use the overload of 'RooAbsData::createHistogram' that takes RooFit command arguments." - << std::endl; - - // Parse list of variable names - const auto varNames = ROOT::Split(varNameList, ",:"); - RooLinkedList argList; - RooRealVar* vars[3] = {nullptr, nullptr, nullptr}; - - for (unsigned int i = 0; i < varNames.size(); ++i) { - if (i >= 3) { - coutW(InputArguments) << "RooAbsData::createHistogram(" << GetName() << "): Can only create 3-dimensional histograms. Variable " - << i << " " << varNames[i] << " unused." << std::endl; - continue; - } - - vars[i] = static_cast( get()->find(varNames[i].data()) ); - if (!vars[i]) { - coutE(InputArguments) << "RooAbsData::createHistogram(" << GetName() << ") ERROR: dataset does not contain an observable named " << varNames[i] << std::endl; - return nullptr; - } - } - - if (!vars[0]) { - coutE(InputArguments) << "RooAbsData::createHistogram(" << GetName() << "): No variable to be histogrammed in list '" << varNameList << "'" << std::endl; - return nullptr; - } - - if (xbins<=0 || !vars[0]->hasMax() || !vars[0]->hasMin() ) { - argList.Add(RooFit::AutoBinning(xbins==0?vars[0]->numBins():abs(xbins)).Clone()) ; - } else { - argList.Add(RooFit::Binning(xbins).Clone()) ; - } - - if (vars[1]) { - if (ybins<=0 || !vars[1]->hasMax() || !vars[1]->hasMin() ) { - argList.Add(RooFit::YVar(*vars[1],RooFit::AutoBinning(ybins==0?vars[1]->numBins():abs(ybins))).Clone()) ; - } else { - argList.Add(RooFit::YVar(*vars[1],RooFit::Binning(ybins)).Clone()) ; - } - } - if (vars[2]) { - if (zbins<=0 || !vars[2]->hasMax() || !vars[2]->hasMin() ) { - argList.Add(RooFit::ZVar(*vars[2],RooFit::AutoBinning(zbins==0?vars[2]->numBins():abs(zbins))).Clone()) ; - } else { - argList.Add(RooFit::ZVar(*vars[2],RooFit::Binning(zbins)).Clone()) ; - } - } - - - // Call implementation function - TH1* result = createHistogram(GetName(), *vars[0], argList); - - // Delete temporary list of RooCmdArgs - argList.Delete() ; - - return result ; -} - - TH1 *RooAbsData::createHistogram(const char *name, const RooAbsRealLValue& xvar, 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