Skip to content

Commit eb2cef5

Browse files
committed
added catch
1 parent 6eff31f commit eb2cef5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/cutflow.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ void Cutflow::recursivePrint(std::string tabs, Cut* cut, Direction direction, bo
497497
if (direction == Right) { identical_yield = (cut->n_pass == cut->parent->n_pass); }
498498
else { identical_yield = (cut->n_pass == cut->parent->n_fail); }
499499
}
500-
if (direction == Right)
501500
if (has_parent || !identical_yield)
502501
{
503502
// Print cut info

src/histflow.icc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,18 @@ bool Histflow::recursiveEvaluate(Cut* cut)
182182
{
183183
// Fill histograms
184184
std::vector<std::function<void(double)>> fill_lambdas = fill_schedule[cut->name];
185-
for (auto& fill : fill_lambdas) { fill(weight); }
185+
for (auto& fill : fill_lambdas)
186+
{
187+
try
188+
{
189+
fill(weight);
190+
}
191+
catch(...)
192+
{
193+
std::cout << "Histogram filler after Cut '" << cut->name << "' raised an exception:" << std::endl;
194+
throw;
195+
}
196+
}
186197
}
187198
if (cut->right == nullptr) { return true; }
188199
else { return recursiveEvaluate(cut->right); }

0 commit comments

Comments
 (0)