diff --git a/BuildFile.xml b/BuildFile.xml
index 2c7d964614d..ba007c0a13d 100644
--- a/BuildFile.xml
+++ b/BuildFile.xml
@@ -9,6 +9,7 @@
+
diff --git a/src/AtlasPdfs.cxx b/src/AtlasPdfs.cxx
index 2e463c89de7..abb70dc22b6 100644
--- a/src/AtlasPdfs.cxx
+++ b/src/AtlasPdfs.cxx
@@ -1461,7 +1461,8 @@ RooStarMomentMorph::CacheElem* RooStarMomentMorph::getCache(const RooArgSet* /*n
mypos[j] = new RooAddition(myposName.c_str(),myposName.c_str(),meanList,coefList2);
myrms[j] = new RooAddition(myrmsName.c_str(),myrmsName.c_str(),rmsList,coefList3);
- ownedComps.add(RooArgSet(*myrms[j],*mypos[j])) ;
+ ownedComps.add(*myrms[j]) ;
+ ownedComps.add(*mypos[j]) ;
}
}
@@ -1486,18 +1487,23 @@ RooStarMomentMorph::CacheElem* RooStarMomentMorph::getCache(const RooArgSet* /*n
std::string slopeName = Form("%s_slope_%d_%d", GetName(),i,j);
std::string offsetName = Form("%s_offset_%d_%d",GetName(),i,j);
- slope[sij(i,j)] = _useHorizMorph ?
- (RooAbsReal*)new RooFormulaVar(slopeName.c_str(),"@0/@1",
- RooArgList(*sigmarv[sij(i,j)],*myrms[j])) :
- (RooAbsReal*)new RooConstVar(slopeName.c_str(),slopeName.c_str(),1.0); //
-
-
- offsetVar[sij(i,j)] = _useHorizMorph ?
- (RooAbsReal*)new RooFormulaVar(offsetName.c_str(),"@0-(@1*@2)",
- RooArgList(*meanrv[sij(i,j)],*mypos[j],*slope[sij(i,j)])) :
- (RooAbsReal*)new RooConstVar(offsetName.c_str(),offsetName.c_str(),0.0); //
+ if (_useHorizMorph) {
+ RooArgList slopeInputs;
+ slopeInputs.add(*sigmarv[sij(i,j)]);
+ slopeInputs.add(*myrms[j]);
+ slope[sij(i,j)] = new RooFormulaVar(slopeName.c_str(),"@0/@1", slopeInputs);
+ RooArgList offsetInputs;
+ offsetInputs.add(*meanrv[sij(i,j)]);
+ offsetInputs.add(*mypos[j]);
+ offsetInputs.add(*slope[sij(i,j)]);
+ offsetVar[sij(i,j)] = new RooFormulaVar(offsetName.c_str(),"@0-(@1*@2)", offsetInputs);
+ } else {
+ slope[sij(i,j)] = new RooConstVar(slopeName.c_str(),slopeName.c_str(),1.0);
+ offsetVar[sij(i,j)] = new RooConstVar(offsetName.c_str(),offsetName.c_str(),0.0);
+ }
- ownedComps.add(RooArgSet(*slope[sij(i,j)],*offsetVar[sij(i,j)])) ;
+ ownedComps.add(*slope[sij(i,j)]);
+ ownedComps.add(*offsetVar[sij(i,j)]);
// linear transformations, so pdf can be renormalized easily
RooRealVar *var = (RooRealVar*)(_obsList[j]);
diff --git a/src/CMSHistErrorPropagator.cc b/src/CMSHistErrorPropagator.cc
index a2fee8b5701..cf9f27ea8fa 100644
--- a/src/CMSHistErrorPropagator.cc
+++ b/src/CMSHistErrorPropagator.cc
@@ -385,7 +385,10 @@ RooArgList * CMSHistErrorPropagator::setupBinPars(double poissonThreshold) {
RooRealVar *var = new RooRealVar(TString::Format("%s_bin%i_%s", this->GetName(), j, proc.c_str()), "", n_p_r, rmin, rmax);
RooConstVar *cvar = new RooConstVar(TString::Format("%g", 1. / n_p_r), "", 1. / n_p_r);
RooProduct *prod = new RooProduct(TString::Format("%s_prod", var->GetName()), "", RooArgList(*var, *cvar));
- var->addOwnedComponents(RooArgSet(*prod, *cvar));
+ RooArgSet ownedComps;
+ ownedComps.add(*prod);
+ ownedComps.add(*cvar);
+ var->addOwnedComponents(ownedComps);
var->setAttribute("createPoissonConstraint");
res->addOwned(*var);
binpars_.add(*prod);
diff --git a/src/CMSHistFunc.cc b/src/CMSHistFunc.cc
index 6beb68168f2..49cbfeb228f 100644
--- a/src/CMSHistFunc.cc
+++ b/src/CMSHistFunc.cc
@@ -713,6 +713,7 @@ void CMSHistFunc::updateMomentFractions(double m) const {
case SineLinear:
mfrac = TMath::Sin(TMath::PiOver2() * mfrac);
+ [[fallthrough]];
// now fall through to Linear case
case Linear:
diff --git a/src/CMSHistSum.cc b/src/CMSHistSum.cc
index b7dd582fd60..0f53d6bdfa9 100644
--- a/src/CMSHistSum.cc
+++ b/src/CMSHistSum.cc
@@ -611,7 +611,10 @@ RooArgList * CMSHistSum::setupBinPars(double poissonThreshold) {
RooRealVar *var = new RooRealVar(TString::Format("%s_bin%i_%s", this->GetName(), j, proc.c_str()), "", n_p_r, rmin, rmax);
RooConstVar *cvar = new RooConstVar(TString::Format("%g", 1. / n_p_r), "", 1. / n_p_r);
RooProduct *prod = new RooProduct(TString::Format("%s_prod", var->GetName()), "", RooArgList(*var, *cvar));
- var->addOwnedComponents(RooArgSet(*prod, *cvar));
+ RooArgSet ownedComps;
+ ownedComps.add(*prod);
+ ownedComps.add(*cvar);
+ var->addOwnedComponents(ownedComps);
var->setAttribute("createPoissonConstraint");
res->addOwned(*var);
binpars_.add(*prod);
diff --git a/src/CachingNLL.cc b/src/CachingNLL.cc
index 04f2bedf2c3..a754bb9d86e 100644
--- a/src/CachingNLL.cc
+++ b/src/CachingNLL.cc
@@ -863,6 +863,7 @@ cacheutils::CachingSimNLL::CachingSimNLL(RooSimultaneous *pdf, RooAbsData *data,
}
cacheutils::CachingSimNLL::CachingSimNLL(const CachingSimNLL &other, const char *name) :
+ RooAbsReal{other, name},
pdfOriginal_(other.pdfOriginal_),
dataOriginal_(other.dataOriginal_),
nuis_(other.nuis_),
diff --git a/src/FitDiagnostics.cc b/src/FitDiagnostics.cc
index d633ff9ecdb..2204f59c786 100644
--- a/src/FitDiagnostics.cc
+++ b/src/FitDiagnostics.cc
@@ -646,8 +646,8 @@ void FitDiagnostics::getShapesAndNorms(RooAbsPdf *pdf, const RooArgSet &obs, std
if (!normProd) {
RooAbsReal* integral = shape->createIntegral(*myobs);
normProd = new RooProduct(normProdName, "", RooArgList(*integral, *coeff));
- normProd->addOwnedComponents(RooArgSet(*integral));
- coeff->addOwnedComponents(RooArgSet(*normProd));
+ normProd->addOwnedComponents(*integral);
+ coeff->addOwnedComponents(*normProd);
}
ns.norm = normProd;
diff --git a/src/FnTimer.cc b/src/FnTimer.cc
index ad9bf6aa0f3..06dfb75ce49 100644
--- a/src/FnTimer.cc
+++ b/src/FnTimer.cc
@@ -19,8 +19,7 @@ std::string GetQualififedName(std::string const& str) {
++apos;
}
}
- std::string cpy = str.substr(apos, bpos - apos);
- return cpy;
+ return str.substr(apos, bpos - apos);
}
diff --git a/src/GoodnessOfFit.cc b/src/GoodnessOfFit.cc
index ae51bd0cf96..507c6ec8ec4 100644
--- a/src/GoodnessOfFit.cc
+++ b/src/GoodnessOfFit.cc
@@ -146,11 +146,11 @@ bool GoodnessOfFit::runSaturatedModel(RooWorkspace *w, RooStats::ModelConfig *mc
if (constraints.getSize() > 0) {
RooArgList terms(constraints); terms.add(*saturatedPdfi);
RooProdPdf *prodpdf = new RooProdPdf(TString::Format("%s_constr", saturatedPdfi->GetName()), "", terms);
- prodpdf->addOwnedComponents(RooArgSet(*saturatedPdfi));
+ prodpdf->addOwnedComponents(*saturatedPdfi);
saturatedPdfi = prodpdf;
}
satsim->addPdf(*saturatedPdfi, cat->getLabel());
- satsim->addOwnedComponents(RooArgSet(*saturatedPdfi));
+ satsim->addOwnedComponents(*saturatedPdfi);
}
// Transfer the channel masks manually
RooSimultaneousOpt* satsimopt = dynamic_cast(satsim);
@@ -164,7 +164,7 @@ bool GoodnessOfFit::runSaturatedModel(RooWorkspace *w, RooStats::ModelConfig *mc
if (constraints.getSize() > 0) {
RooArgList terms(constraints); terms.add(*saturatedPdfi);
RooProdPdf *prodpdf = new RooProdPdf(TString::Format("%s_constr", saturatedPdfi->GetName()), "", terms);
- prodpdf->addOwnedComponents(RooArgSet(*saturatedPdfi));
+ prodpdf->addOwnedComponents(*saturatedPdfi);
saturatedPdfi = prodpdf;
}
saturated.reset(saturatedPdfi);
@@ -426,8 +426,8 @@ RooAbsPdf * GoodnessOfFit::makeSaturatedPdf(RooAbsData &data) {
RooConstVar *norm = new RooConstVar(TString::Format("%s_norm", data.GetName()), "", data.sumEntries());
// we use RooAddPdf because this works with CachingNLL
RooAddPdf *ret = new RooAddPdf(TString::Format("%s_saturated", data.GetName()), "", RooArgList(*hpdf), RooArgList(*norm));
- ret->addOwnedComponents(RooArgSet(*norm));
- ret->addOwnedComponents(RooArgSet(*hpdf));
+ ret->addOwnedComponents(*norm);
+ ret->addOwnedComponents(*hpdf);
return ret;
}
diff --git a/src/HZZ4L_RooCTauPdf_1D.cc b/src/HZZ4L_RooCTauPdf_1D.cc
index 76034e7a72c..5b8d26f6a63 100755
--- a/src/HZZ4L_RooCTauPdf_1D.cc
+++ b/src/HZZ4L_RooCTauPdf_1D.cc
@@ -123,7 +123,7 @@ Double_t HZZ4L_RooCTauPdf_1D::evaluate() const
}
Int_t HZZ4L_RooCTauPdf_1D::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const
{
- if (matchArgs(allVars,analVars,RooArgSet(*kd.absArg()))) return 1;
+ if (matchArgs(allVars,analVars,kd)) return 1;
return 0 ;
}
Double_t HZZ4L_RooCTauPdf_1D::analyticalIntegral(Int_t code, const char* rangeName) const
diff --git a/src/HZZ4L_RooCTauPdf_1D_Expanded.cc b/src/HZZ4L_RooCTauPdf_1D_Expanded.cc
index ae443264f9b..77aead281bb 100755
--- a/src/HZZ4L_RooCTauPdf_1D_Expanded.cc
+++ b/src/HZZ4L_RooCTauPdf_1D_Expanded.cc
@@ -299,7 +299,7 @@ Double_t HZZ4L_RooCTauPdf_1D_Expanded::evaluate() const
}
Int_t HZZ4L_RooCTauPdf_1D_Expanded::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const
{
- if (matchArgs(allVars,analVars,RooArgSet(*kd.absArg()))) return 1;
+ if (matchArgs(allVars,analVars,kd)) return 1;
return 0 ;
}
Double_t HZZ4L_RooCTauPdf_1D_Expanded::analyticalIntegral(Int_t code, const char* rangeName) const
diff --git a/src/HZZ4L_RooCTauPdf_2D.cc b/src/HZZ4L_RooCTauPdf_2D.cc
index 2981755b410..2609f05dc14 100755
--- a/src/HZZ4L_RooCTauPdf_2D.cc
+++ b/src/HZZ4L_RooCTauPdf_2D.cc
@@ -124,7 +124,7 @@ Double_t HZZ4L_RooCTauPdf_2D::evaluate() const
}
Int_t HZZ4L_RooCTauPdf_2D::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const
{
- if (matchArgs(allVars,analVars,RooArgSet(*kd.absArg(), *ksmd.absArg()))) return 1;
+ if (matchArgs(allVars,analVars,kd, ksmd)) return 1;
return 0 ;
}
Double_t HZZ4L_RooCTauPdf_2D::analyticalIntegral(Int_t code, const char* rangeName) const
diff --git a/src/HZZ4L_RooSpinZeroPdf.cc b/src/HZZ4L_RooSpinZeroPdf.cc
index 2e2231256e2..34c01e1db4e 100755
--- a/src/HZZ4L_RooSpinZeroPdf.cc
+++ b/src/HZZ4L_RooSpinZeroPdf.cc
@@ -80,7 +80,7 @@ ClassImp(HZZ4L_RooSpinZeroPdf)
Int_t HZZ4L_RooSpinZeroPdf::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const
{
- if (matchArgs(allVars,analVars,RooArgSet(*kd.absArg(), *kdint.absArg(), *ksmd.absArg()))) return 4 ;
+ if (matchArgs(allVars,analVars,kd, kdint, ksmd)) return 4 ;
//if (matchArgs(allVars,analVars,kd)) return 1 ;
//if (matchArgs(allVars,analVars,kdint)) return 2 ;
//if (matchArgs(allVars,analVars,ksmd)) return 3 ;
diff --git a/src/HZZ4L_RooSpinZeroPdf_1D.cc b/src/HZZ4L_RooSpinZeroPdf_1D.cc
index 6b9e7d4c092..c60051cf8ec 100644
--- a/src/HZZ4L_RooSpinZeroPdf_1D.cc
+++ b/src/HZZ4L_RooSpinZeroPdf_1D.cc
@@ -75,7 +75,7 @@ ClassImp(HZZ4L_RooSpinZeroPdf_1D)
Int_t HZZ4L_RooSpinZeroPdf_1D::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const
{
-// if (matchArgs(allVars,analVars,RooArgSet(*kd.absArg(), *kdint.absArg(), *ksmd.absArg()))) return 4 ;
+// if (matchArgs(allVars,analVars,kd, kdint, ksmd)) return 4 ;
if (matchArgs(allVars,analVars,kd)) return 4 ;
//if (matchArgs(allVars,analVars,kdint)) return 2 ;
//if (matchArgs(allVars,analVars,ksmd)) return 3 ;
diff --git a/src/HZZ4L_RooSpinZeroPdf_2D.cc b/src/HZZ4L_RooSpinZeroPdf_2D.cc
index 2cc39dffcad..4c76b49bedd 100755
--- a/src/HZZ4L_RooSpinZeroPdf_2D.cc
+++ b/src/HZZ4L_RooSpinZeroPdf_2D.cc
@@ -123,7 +123,7 @@ ClassImp(HZZ4L_RooSpinZeroPdf_2D)
Int_t HZZ4L_RooSpinZeroPdf_2D::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const
{
- if (matchArgs(allVars,analVars,RooArgSet(*kd.absArg(), *kdint.absArg(), *ksmd.absArg()))) return 4 ;
+ if (matchArgs(allVars,analVars,kd, kdint, ksmd)) return 4 ;
//if (matchArgs(allVars,analVars,kd)) return 1 ;
//if (matchArgs(allVars,analVars,kdint)) return 2 ;
//if (matchArgs(allVars,analVars,ksmd)) return 3 ;
diff --git a/src/HZZ4L_RooSpinZeroPdf_phase.cc b/src/HZZ4L_RooSpinZeroPdf_phase.cc
index 2853ed3f801..efd394dc3e0 100755
--- a/src/HZZ4L_RooSpinZeroPdf_phase.cc
+++ b/src/HZZ4L_RooSpinZeroPdf_phase.cc
@@ -82,7 +82,7 @@ ClassImp(HZZ4L_RooSpinZeroPdf_phase)
Int_t HZZ4L_RooSpinZeroPdf_phase::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const
{
- if (matchArgs(allVars,analVars,RooArgSet(*kd.absArg(), *kdint.absArg(), *ksmd.absArg()))) return 4 ;
+ if (matchArgs(allVars,analVars,kd, kdint, ksmd)) return 4 ;
//if (matchArgs(allVars,analVars,kd)) return 1 ;
//if (matchArgs(allVars,analVars,kdint)) return 2 ;
//if (matchArgs(allVars,analVars,ksmd)) return 3 ;
diff --git a/src/MultiDimFit.cc b/src/MultiDimFit.cc
index fb4f10266f4..f1cd176f0b4 100644
--- a/src/MultiDimFit.cc
+++ b/src/MultiDimFit.cc
@@ -779,7 +779,8 @@ void MultiDimFit::doGrid(RooWorkspace *w, RooAbsReal &nll)
deltaY = (pmax[1] - pmin[1]) / nY;
spacingOffsetY = 0.5;
}
- unsigned int ipoint = 0, nprint = ceil(0.005 * nTotal);
+ unsigned int ipoint = 0;
+ // unsigned int nprint = ceil(0.005 * nTotal);
// loop through the grid
for (unsigned int i = 0; i < nX; ++i) {
diff --git a/src/SimpleCacheSentry.cc b/src/SimpleCacheSentry.cc
index 31b9627d856..6f434166992 100644
--- a/src/SimpleCacheSentry.cc
+++ b/src/SimpleCacheSentry.cc
@@ -25,6 +25,7 @@ SimpleCacheSentry::SimpleCacheSentry(const RooAbsArg &func, const RooArgSet *obs
}
SimpleCacheSentry::SimpleCacheSentry(const SimpleCacheSentry &other, const char *newname) :
+ RooAbsArg{other, newname},
_deps("deps",this,other._deps)
{
}
diff --git a/src/SimpleProdPdf.cc b/src/SimpleProdPdf.cc
index 0d2fb1bbd99..a5944ceb66d 100644
--- a/src/SimpleProdPdf.cc
+++ b/src/SimpleProdPdf.cc
@@ -97,7 +97,7 @@ RooAbsReal* SimpleProdPdf::createIntegral(const RooArgSet& iset, const RooArgSet
RooAbsReal *iInt = pdfVec.at(i)->createIntegral(*iVarsVec.at(i), nset, cfg, rangeName);
iInt->SetName(intName);
if (dynamic_cast(pdfVec.at(i))) {
- pdfVec.at(i)->addOwnedComponents(RooArgSet(*iInt));
+ pdfVec.at(i)->addOwnedComponents(*iInt);
}
terms.add(*iInt);
}
diff --git a/src/TH1Keys.cc b/src/TH1Keys.cc
index aee24040f61..cf6043674cf 100644
--- a/src/TH1Keys.cc
+++ b/src/TH1Keys.cc
@@ -21,7 +21,6 @@ TH1Keys::TH1Keys(const char *name,const char *title,Int_t nbinsx,Double_t xlow,D
x_(new RooRealVar("x", "x", min_, max_)),
w_(new RooRealVar("w", "w", 1.0)),
point_(*x_),
- dataset_(new RooDataSet(name, title, RooArgSet(*x_, *w_), "w")),
underflow_(0.0), overflow_(0.0),
globalScale_(1.0),
options_(options),
@@ -29,6 +28,11 @@ TH1Keys::TH1Keys(const char *name,const char *title,Int_t nbinsx,Double_t xlow,D
cache_(new TH1F("",title,nbinsx,xlow,xup)),
isCacheGood_(true)
{
+ RooArgSet vars;
+ vars.add(*x_);
+ vars.add(*w_);
+ dataset_ = new RooDataSet(name, title, vars, "w");
+
cache_->SetDirectory(0);
fDimension = 1;
x_->setBins(nbinsx);
@@ -40,7 +44,6 @@ TH1Keys::TH1Keys(const char *name,const char *title,Int_t nbinsx,const Float_t
x_(new RooRealVar("x", "x", min_, max_)),
w_(new RooRealVar("w", "w", 1.0)),
point_(*x_),
- dataset_(new RooDataSet(name, title, RooArgSet(*x_, *w_), "w")),
underflow_(0.0), overflow_(0.0),
globalScale_(1.0),
options_(options),
@@ -48,6 +51,11 @@ TH1Keys::TH1Keys(const char *name,const char *title,Int_t nbinsx,const Float_t
cache_(new TH1F("",title,nbinsx,xbins)),
isCacheGood_(true)
{
+ RooArgSet vars;
+ vars.add(*x_);
+ vars.add(*w_);
+ dataset_ = new RooDataSet(name, title, vars, "w");
+
cache_->SetDirectory(0);
fDimension = 1;
std::vector boundaries(nbinsx+1);
@@ -61,7 +69,6 @@ TH1Keys::TH1Keys(const char *name,const char *title,Int_t nbinsx,const Double_t
x_(new RooRealVar("x", "x", min_, max_)),
w_(new RooRealVar("w", "w", 1.0)),
point_(*x_),
- dataset_(new RooDataSet(name, title, RooArgSet(*x_, *w_), "w")),
underflow_(0.0), overflow_(0.0),
globalScale_(1.0),
options_(options),
@@ -69,6 +76,11 @@ TH1Keys::TH1Keys(const char *name,const char *title,Int_t nbinsx,const Double_t
cache_(new TH1F("",title,nbinsx,xbins)),
isCacheGood_(true)
{
+ RooArgSet vars;
+ vars.add(*x_);
+ vars.add(*w_);
+ dataset_ = new RooDataSet(name, title, vars, "w");
+
cache_->SetDirectory(0);
fDimension = 1;
x_->setBinning(RooBinning(nbinsx, xbins));
@@ -81,7 +93,6 @@ TH1Keys::TH1Keys(const TH1Keys &other) :
x_(new RooRealVar("x", "x", min_, max_)),
w_(new RooRealVar("w", "w", 1.0)),
point_(*x_),
- dataset_(new RooDataSet(other.GetName(), other.GetTitle(), RooArgSet(*x_, *w_), "w")),
underflow_(other.underflow_), overflow_(other.overflow_),
globalScale_(other.globalScale_),
options_(other.options_),
@@ -89,6 +100,11 @@ TH1Keys::TH1Keys(const TH1Keys &other) :
cache_((TH1*)other.cache_->Clone()),
isCacheGood_(other.isCacheGood_)
{
+ RooArgSet vars;
+ vars.add(*x_);
+ vars.add(*w_);
+ dataset_ = new RooDataSet(other.GetName(), other.GetTitle(), vars, "w");
+
other.Copy(*this);
fDimension = 1;
x_->setBinning(other.x_->getBinning());
diff --git a/src/VBFHZZ4L_RooSpinZeroPdf.cc b/src/VBFHZZ4L_RooSpinZeroPdf.cc
index d1846a5f8e8..bf39997e0aa 100755
--- a/src/VBFHZZ4L_RooSpinZeroPdf.cc
+++ b/src/VBFHZZ4L_RooSpinZeroPdf.cc
@@ -95,7 +95,7 @@ ClassImp(VBFHZZ4L_RooSpinZeroPdf)
Int_t VBFHZZ4L_RooSpinZeroPdf::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const
{
- if (matchArgs(allVars,analVars,RooArgSet(*kd.absArg(), *kdint.absArg(), *ksmd.absArg()))) return 4 ;
+ if (matchArgs(allVars,analVars,kd, kdint, ksmd)) return 4 ;
return 0 ;
diff --git a/src/VerticalInterpHistPdf.cc b/src/VerticalInterpHistPdf.cc
index fca0b99a668..13c67b9473f 100644
--- a/src/VerticalInterpHistPdf.cc
+++ b/src/VerticalInterpHistPdf.cc
@@ -829,7 +829,7 @@ FastVerticalInterpHistPdf2Base::initBase() const
}
FastVerticalInterpHistPdf2::FastVerticalInterpHistPdf2(const char *name, const char *title, const RooRealVar &x, const TList & funcList, const RooArgList& coefList, Double_t smoothRegion, Int_t smoothAlgo) :
- FastVerticalInterpHistPdf2Base(name,title,RooArgSet(x),funcList,coefList,smoothRegion,smoothAlgo),
+ FastVerticalInterpHistPdf2Base(name,title,x,funcList,coefList,smoothRegion,smoothAlgo),
_x("x","Independent variable",this,const_cast(x)),
_cache(), _cacheNominal(), _cacheNominalLog()
{
@@ -841,8 +841,19 @@ FastVerticalInterpHistPdf2::FastVerticalInterpHistPdf2(const char *name, const c
}
}
+namespace {
+
+RooArgSet createRooArgSet(RooAbsArg const& arg1, RooAbsArg const& arg2) {
+ RooArgSet out;
+ out.add(arg1);
+ out.add(arg2);
+ return out;
+}
+
+} // namespace
+
FastVerticalInterpHistPdf2D2::FastVerticalInterpHistPdf2D2(const char *name, const char *title, const RooRealVar &x, const RooRealVar &y, bool conditional, const TList & funcList, const RooArgList& coefList, Double_t smoothRegion, Int_t smoothAlgo) :
- FastVerticalInterpHistPdf2Base(name,title,RooArgSet(x,y),funcList,coefList,smoothRegion,smoothAlgo),
+ FastVerticalInterpHistPdf2Base(name,title,createRooArgSet(x, y),funcList,coefList,smoothRegion,smoothAlgo),
_x("x","Independent variable",this,const_cast(x)),
_y("y","Independent variable",this,const_cast(y)),
_conditional(conditional),
@@ -864,7 +875,7 @@ FastVerticalInterpHistPdf2::FastVerticalInterpHistPdf2(const FastVerticalInterpH
_cache(), _cacheNominal(), _cacheNominalLog()
{
initBase();
- other.getVal(RooArgSet(_x.arg()));
+ other.getVal(_x.arg());
_morphs = other._morphs;
_cache = other._cache;
_cacheNominal = other._cacheNominal;
@@ -880,7 +891,10 @@ FastVerticalInterpHistPdf2D2::FastVerticalInterpHistPdf2D2(const FastVerticalInt
_cache(), _cacheNominal(), _cacheNominalLog()
{
initBase();
- other.getVal(RooArgSet(_x.arg(), _y.arg()));
+ RooArgSet normSet;
+ normSet.add(_x.arg());
+ normSet.add(_y.arg());
+ other.getVal(normSet);
_morphs = other._morphs;
_cache = other._cache;
_cacheNominal = other._cacheNominal;