Commit 1db29015 authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

add a protection to check that each nuisance parameter is used in likelihoods

parent a8013733
......@@ -305,13 +305,26 @@ Chi2Factory::gimeChi2(Parser& parser){
//check index table
comb->dumpIndex();
vector<string> all_nui=comb->requires();
vector<string>::const_iterator it;
//single print
Variables upar(parser.vars());
cout << "it | " ;
for (size_t i=0;i<upar.Params().size();i++) cout << upar.Name(i) <<" | ";
for (size_t i=0;i<upar.Params().size();i++) {
cout << upar.Name(i) <<" | ";
//if nuisance check it is usefull
if (upar.isNui(i)) {
it=find(all_nui.begin(),all_nui.end(),upar.Name(i));
planck_assert(it!=all_nui.end(),string("Parameter ")+upar.Name(i)+" not used in likelihoods: comment or remove it");
}
}
cout << "status | chi2 | ptime"<<endl;
//check no parameter
return comb;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment