From 38178aba838f4066085cfa47403eb2f8674a594a Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Tue, 26 May 2026 18:12:59 +0200 Subject: [PATCH] TOF: pre-filter hypotheses in getStartTimeInSet to reduce combinatorial search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The |starttime - refT0| < 2000 ps cut depends only on (track, hypothesis), not on other tracks' assignments. Evaluate it once per track upfront and enumerate only valid hypothesis combinations, reducing the search space from 3^N to ∏(nValid_i). --- Detectors/TOF/base/src/EventTimeMaker.cxx | 62 +++++++++++++++++++---- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/Detectors/TOF/base/src/EventTimeMaker.cxx b/Detectors/TOF/base/src/EventTimeMaker.cxx index 132bd26fcfe52..458946e4db47b 100644 --- a/Detectors/TOF/base/src/EventTimeMaker.cxx +++ b/Detectors/TOF/base/src/EventTimeMaker.cxx @@ -279,28 +279,68 @@ int getStartTimeInSet(const std::vector& tracks, std::vector 0) { average += starttime[itrk] * weighttime[itrk]; sumweights += weighttime[itrk]; ngood++; } } + if (ngood < 2) { + continue; + } + average /= sumweights; // compute chi2 @@ -313,7 +353,7 @@ int getStartTimeInSet(const std::vector& tracks, std::vector