From 133035409dc411460d121d66dfb7bd686d6f1b17 Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Tue, 7 Nov 2023 17:25:08 +0100 Subject: [PATCH] catch exception and keep going --- src/ConformalTracking.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ConformalTracking.cc b/src/ConformalTracking.cc index cf6c2c9..26aca9b 100644 --- a/src/ConformalTracking.cc +++ b/src/ConformalTracking.cc @@ -593,7 +593,12 @@ void ConformalTracking::processEvent(LCEvent* evt) { UKDTree nearestNeighbours = nullptr; for (auto const& parameters : _stepParameters) { - runStep(kdClusters, nearestNeighbours, conformalTracks, collectionClusters, parameters); + try { + runStep(kdClusters, nearestNeighbours, conformalTracks, collectionClusters, parameters); + } catch (const TooManyTracksException& e) { + streamlog_out(ERROR) << "Too many tracks in step: " << parameters._step << " skipping further steps" << std::endl; + break; + } streamlog_out(DEBUG9) << "STEP " << parameters._step << ": nr tracks = " << conformalTracks.size() << std::endl; if (streamlog_level(DEBUG9)) { for (auto const& confTrack : conformalTracks) {