Skip to content
Snippets Groups Projects
Commit 86faf3ff authored by Jonas Rembser's avatar Jonas Rembser
Browse files

[RF] Make RooAbsTestStatistic error out if multiple ranges are passed

The RooFit test statistic classes give wrong results if they are
constructed from multiple comma-separated ranges. This can cause errors,
such as the one reported in Jira issue ROOT-10038.

This commit suggests to throw an exception if multiple comma-separated
ranges are detected.
parent 1d8b6a7d
No related branches found
No related tags found
No related merge requests found
......@@ -104,6 +104,16 @@ RooAbsTestStatistic::RooAbsTestStatistic(const char *name, const char *title, Ro
{
// Register all parameters as servers
_paramSet.add(*std::unique_ptr<RooArgSet>{real.getParameters(&data)});
if (cfg.rangeName.find(',') != std::string::npos) {
auto errorMsg = std::string("Ranges ") + cfg.rangeName
+ " were passed to the RooAbsTestStatistic with name \"" + name + "\", "
+ "but it doesn't support multiple comma-separated fit ranges!\n" +
+ "Instead, one should combine multiple RooAbsTestStatistic objects "
+ "(see RooAbsPdf::createNLL for an example with RooNLLVar).";
coutE(InputArguments) << errorMsg << std::endl;
throw std::invalid_argument(errorMsg);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment