From eb2cef598a9e6dc6f9cb8a6fc3c9d5f0c5bab65f Mon Sep 17 00:00:00 2001 From: Jonathan Guiang Date: Thu, 6 Jun 2024 11:38:42 -0700 Subject: [PATCH] added catch --- src/cutflow.cc | 1 - src/histflow.icc | 13 ++++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/cutflow.cc b/src/cutflow.cc index 0cdf5c6..2a2f3f7 100755 --- a/src/cutflow.cc +++ b/src/cutflow.cc @@ -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 diff --git a/src/histflow.icc b/src/histflow.icc index 1f31531..5bee336 100644 --- a/src/histflow.icc +++ b/src/histflow.icc @@ -182,7 +182,18 @@ bool Histflow::recursiveEvaluate(Cut* cut) { // Fill histograms std::vector> 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); }