From 79c19dd1508232bb81579a52a1bde3c3b30d2288 Mon Sep 17 00:00:00 2001 From: Aliya Nigamova Date: Tue, 11 Jun 2024 14:57:41 +0200 Subject: [PATCH] report removeRange in check_inf_parameters only for verb >=3 --- interface/utils.h | 2 +- src/Combine.cc | 4 ++-- src/utils.cc | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/interface/utils.h b/interface/utils.h index 473e0021adc..38b137b5d35 100644 --- a/interface/utils.h +++ b/interface/utils.h @@ -112,7 +112,7 @@ namespace utils { void setModelParameters( const std::string & setPhysicsModelParameterExpression, const RooArgSet & params); // Set range of physics model parameters void setModelParameterRanges( const std::string & setPhysicsModelParameterRangeExpression, const RooArgSet & params); - void check_inf_parameters(const RooArgSet & params); + void check_inf_parameters(const RooArgSet & params, int verbosity); bool isParameterAtBoundary( const RooRealVar &); bool anyParameterAtBoundaries( const RooArgSet &, int verbosity); diff --git a/src/Combine.cc b/src/Combine.cc index c84c15cdccf..4cf64dd0974 100644 --- a/src/Combine.cc +++ b/src/Combine.cc @@ -483,7 +483,7 @@ void Combine::run(TString hlfFile, const std::string &dataset, double &limit, do } // look for parameters ranged [-1e+30, 1e+30], corresponding to the old definition of unlimited parameters, // since ROOT v6.30 have to removeRange() to keep them unlimited - utils::check_inf_parameters(w->allVars()); + utils::check_inf_parameters(w->allVars(), verbose); } else { std::cerr << "HLF not validated" << std::endl; @@ -527,7 +527,7 @@ void Combine::run(TString hlfFile, const std::string &dataset, double &limit, do if (setPhysicsModelParameterExpression_ != "") { utils::setModelParameters( setPhysicsModelParameterExpression_, w->allVars()); } - utils::check_inf_parameters(w->allVars()); + utils::check_inf_parameters(w->allVars(), verbose); } gSystem->cd(pwd); diff --git a/src/utils.cc b/src/utils.cc index b5d64b1617a..95adf0bd321 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -886,14 +886,16 @@ void utils::setModelParameterRanges( const std::string & setPhysicsModelParamete } -void utils::check_inf_parameters(const RooArgSet & params) { +void utils::check_inf_parameters(const RooArgSet & params, int verbosity) { double infinity_root626 = 1.0e30; for (RooAbsArg *arg : params) { RooRealVar *p = dynamic_cast(arg); if (p->getRange().first <= -infinity_root626 || p->getRange().second >= +infinity_root626){ - std::cout << "Found a parameter named "<< p->GetName() - << " infinite in ROOT versions < 6.30, going to removeRange()" << endl; + if ( verbosity > 2 ) { + std::cout << "Found a parameter named "<< p->GetName() + << " infinite in ROOT versions < 6.30, going to removeRange()" << endl; + } p->removeRange(); } }