Skip to content

Commit

Permalink
report removeRange in check_inf_parameters only for verb >=3
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliya Nigamova committed Jun 11, 2024
1 parent 3af397d commit 79c19dd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion interface/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/Combine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
8 changes: 5 additions & 3 deletions src/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<RooRealVar *>(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();
}
}
Expand Down

0 comments on commit 79c19dd

Please sign in to comment.