diff --git a/src/AsimovUtils.cc b/src/AsimovUtils.cc index 7a5d99aec3f..5fd2cd976a6 100644 --- a/src/AsimovUtils.cc +++ b/src/AsimovUtils.cc @@ -20,7 +20,8 @@ RooAbsData *asimovutils::asimovDatasetNominal(RooStats::ModelConfig *mc, double if (verbose>2) { CombineLogger::instance().log("AsimovUtils.cc",__LINE__,"Parameters after fit for asimov dataset",__func__); - for (RooAbsArg *a : *std::unique_ptr{mc->GetPdf()->getParameters((const RooArgSet*) 0)}) { + std::unique_ptr params{mc->GetPdf()->getParameters((const RooArgSet*) 0)}; + for (RooAbsArg *a : *params) { TString varstring = utils::printRooArgAsString(a); CombineLogger::instance().log("AsimovUtils.cc",__LINE__,std::string(Form("%s",varstring.Data())),__func__); } @@ -64,7 +65,8 @@ RooAbsData *asimovutils::asimovDatasetWithFit(RooStats::ModelConfig *mc, RooAbsD if (verbose>2) { CombineLogger::instance().log("AsimovUtils.cc",__LINE__,"Parameters after fit for asimov dataset",__func__); - for (RooAbsArg *a : *std::unique_ptr{mc->GetPdf()->getParameters(realdata)}) { + std::unique_ptr params{mc->GetPdf()->getParameters(realdata)}; + for (RooAbsArg *a : *params) { TString varstring = utils::printRooArgAsString(a); CombineLogger::instance().log("AsimovUtils.cc",__LINE__,std::string(Form("%s",varstring.Data())),__func__); } diff --git a/src/Combine.cc b/src/Combine.cc index bcbcd2ab3c3..425aca0b03c 100644 --- a/src/Combine.cc +++ b/src/Combine.cc @@ -973,7 +973,8 @@ void Combine::run(TString hlfFile, const std::string &dataset, double &limit, do // print the values of the parameters used to generate the toy if (verbose > 2) { CombineLogger::instance().log("Combine.cc",__LINE__, "Generate Asimov toy from parameter values ... ",__func__); - for (RooAbsArg *a : *std::unique_ptr{genPdf->getParameters((const RooArgSet*)0)}) { + std::unique_ptr params{genPdf->getParameters((const RooArgSet*)0)}; + for (RooAbsArg *a : *params) { TString varstring = utils::printRooArgAsString(a); CombineLogger::instance().log("Combine.cc",__LINE__,varstring.Data(),__func__); } @@ -1069,7 +1070,8 @@ void Combine::run(TString hlfFile, const std::string &dataset, double &limit, do std::cout << "Generate toy " << iToy << "/" << nToys << std::endl; if (verbose > 2) { CombineLogger::instance().log("Combine.cc",__LINE__, std::string(Form("Generating toy %d/%d, from parameter values ... ",iToy,nToys)),__func__); - for (RooAbsArg *a : *std::unique_ptr{genPdf->getParameters((const RooArgSet*)0)}) { + std::unique_ptr params{genPdf->getParameters((const RooArgSet*)0)}; + for (RooAbsArg *a : *params) { TString varstring = utils::printRooArgAsString(a); CombineLogger::instance().log("Combine.cc" ,__LINE__,varstring.Data(),__func__); } diff --git a/src/FitterAlgoBase.cc b/src/FitterAlgoBase.cc index 7455028977b..c24fbe8a314 100644 --- a/src/FitterAlgoBase.cc +++ b/src/FitterAlgoBase.cc @@ -151,8 +151,8 @@ bool FitterAlgoBase::run(RooWorkspace *w, RooStats::ModelConfig *mc_s, RooStats: break; } - ; - for (RooAbsArg *a : *std::unique_ptr{mc_s->GetPdf()->getParameters(data)}) { + std::unique_ptr params{mc_s->GetPdf()->getParameters(data)}; + for (RooAbsArg *a : *params) { RooRealVar *rrv = dynamic_cast(a); if (rrv == 0 || rrv->isConstant()) continue; if (profileMode_ == ProfileUnconstrained && mc_s->GetNuisanceParameters()->find(*rrv) != 0) { diff --git a/src/utils.cc b/src/utils.cc index 7b6ecc61e47..e9423a8e5d2 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -387,7 +387,8 @@ bool utils::checkModel(const RooStats::ModelConfig &model, bool throwOnFail) { } } ; - for (RooAbsArg *a : *std::unique_ptr{pdf->getParameters(*model.GetObservables())}) { + std::unique_ptr params{pdf->getParameters(*model.GetObservables())}; + for (RooAbsArg *a : *params) { if (a->getAttribute("flatParam") && a->isConstant()) { ok = false; errors << "ERROR: parameter " << a->GetName() << " is declared as flatParam but is constant.\n"; }