From af8239506e73795a8a59419a1786d4a8a30ea608 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 bdf54c4..31c7a95 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) {