Skip to content

Commit

Permalink
added catch
Browse files Browse the repository at this point in the history
  • Loading branch information
jkguiang committed Jun 6, 2024
1 parent 6eff31f commit eb2cef5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/cutflow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ void Cutflow::recursivePrint(std::string tabs, Cut* cut, Direction direction, bo
if (direction == Right) { identical_yield = (cut->n_pass == cut->parent->n_pass); }
else { identical_yield = (cut->n_pass == cut->parent->n_fail); }
}
if (direction == Right)
if (has_parent || !identical_yield)
{
// Print cut info
Expand Down
13 changes: 12 additions & 1 deletion src/histflow.icc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,18 @@ bool Histflow::recursiveEvaluate(Cut* cut)
{
// Fill histograms
std::vector<std::function<void(double)>> fill_lambdas = fill_schedule[cut->name];
for (auto& fill : fill_lambdas) { fill(weight); }
for (auto& fill : fill_lambdas)
{
try
{
fill(weight);
}
catch(...)
{
std::cout << "Histogram filler after Cut '" << cut->name << "' raised an exception:" << std::endl;
throw;
}
}
}
if (cut->right == nullptr) { return true; }
else { return recursiveEvaluate(cut->right); }
Expand Down

0 comments on commit eb2cef5

Please sign in to comment.