Skip to content

Commit

Permalink
Merge pull request cms-analysis#805 from Dominic-Stafford/102x
Browse files Browse the repository at this point in the history
Allow ChannelCompatibilityCheck to skip channels with no signal templates
  • Loading branch information
ajgilbert authored Jan 12, 2023
2 parents b34142c + abb232a commit 8cfc616
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ChannelCompatibilityCheck.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ bool ChannelCompatibilityCheck::runSpecific(RooWorkspace *w, RooStats::ModelConf
}
for (std::map<std::string,std::string>::const_iterator it = rs.begin(), ed = rs.end(); it != ed; ++it) {
RooRealVar *ri = (RooRealVar*) result_freeform->floatParsFinal().find(it->second.c_str());
if (runMinos_ && do95_) {
if (ri == NULL){
printf("Parameter %s not found in channel %s. Does this region contain signal templates?\n", r->GetName(), it->first.c_str());
} else if (runMinos_ && do95_) {
printf("Alternate fit: %s = %7.4f %+6.4f/%+6.4f (68%% CL) in channel %s\n", r->GetName(), ri->getVal(), ri->getAsymErrorLo(), ri->getAsymErrorHi(), it->first.c_str());
printf(" %s = %7.4f %+6.4f/%+6.4f (95%% CL) in channel %s\n", r->GetName(), ri->getVal(), ri->getMin("err95")-ri->getVal(), ri->getMax("err95")-ri->getVal(), it->first.c_str());
} else if (runMinos_) {
Expand Down
1 change: 1 addition & 0 deletions src/FitterAlgoBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ RooFitResult *FitterAlgoBase::doFit(RooAbsPdf &pdf, RooAbsData &data, const RooA
rfloat = ret->constPars().find(r.GetName());
if (!rfloat) {
fprintf(sentry.trueStdOut(), "Skipping %s. Parameter not found in the RooFitResult.\n",r.GetName());
continue ;
}
}
//rfloat->Print("V");
Expand Down

0 comments on commit 8cfc616

Please sign in to comment.