From 9d316593c4a489108567c86b269a47cb448fefe3 Mon Sep 17 00:00:00 2001 From: Marvin Hemmer Date: Fri, 18 Sep 2026 13:08:43 +0200 Subject: [PATCH] [EMCAL-1157] Update clusterizer algorithm to use relative time window always relative to seed cell - Update clusterizer algorithm to use relative time window always relative to seed cell instead of the current cell during clusterization. So right now when looking for another cell to add to the cluster the relative time check is always done in respect to the time of the new cell and the cell from which this new cell would be added (so +-1 in eta or +-1 in phi direction). Most clusters arent that big and thus this change should only have minor consequences to the resulting clusters. --- .../include/EMCALReconstruction/Clusterizer.h | 3 ++- Detectors/EMCAL/reconstruction/src/Clusterizer.cxx | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Detectors/EMCAL/reconstruction/include/EMCALReconstruction/Clusterizer.h b/Detectors/EMCAL/reconstruction/include/EMCALReconstruction/Clusterizer.h index 4d8620bd0db08..7cdbd9afc9dde 100644 --- a/Detectors/EMCAL/reconstruction/include/EMCALReconstruction/Clusterizer.h +++ b/Detectors/EMCAL/reconstruction/include/EMCALReconstruction/Clusterizer.h @@ -143,7 +143,8 @@ class Clusterizer /// \param[in,out] clusterInputs Cells/digits of prototype cluster /// \param row Row number from neighbor search in recursion step /// \param column Column number for neighbor search in recursion step - void getClusterFromNeighbours(std::vector& clusterInputs, int row, int column); + /// \param seedTime Timestamp of the seed cell, used as fixed reference for the time cut + void getClusterFromNeighbours(std::vector& clusterInputs, int row, int column, double seedTime); /// \brief Get row (phi) and column (eta) of a cell/digit, values corresponding to topology /// \param input Input object (cell/digit) diff --git a/Detectors/EMCAL/reconstruction/src/Clusterizer.cxx b/Detectors/EMCAL/reconstruction/src/Clusterizer.cxx index 96541aaff09f4..6372de5242fdc 100644 --- a/Detectors/EMCAL/reconstruction/src/Clusterizer.cxx +++ b/Detectors/EMCAL/reconstruction/src/Clusterizer.cxx @@ -45,7 +45,7 @@ void Clusterizer::initialize(double timeCut, double timeMin, double t //____________________________________________________________________________ template -void Clusterizer::getClusterFromNeighbours(std::vector& clusterInputs, int row, int column) +void Clusterizer::getClusterFromNeighbours(std::vector& clusterInputs, int row, int column, double seedTime) { // Recursion 0, add seed cell/digit to cluster if (!clusterInputs.size()) { @@ -71,8 +71,8 @@ void Clusterizer::getClusterFromNeighbours(std::vectorgetEnergy() > mInputMap[row][column].mInput->getEnergy() + mGradientCut)) { continue; } - if (not(TMath::Abs(mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput->getTimeStamp() - mInputMap[row][column].mInput->getTimeStamp()) > mTimeCut)) { - getClusterFromNeighbours(clusterInputs, row + rowDiffs[dir], column + colDiffs[dir]); + if (not(TMath::Abs(mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput->getTimeStamp() - seedTime) > mTimeCut)) { + getClusterFromNeighbours(clusterInputs, row + rowDiffs[dir], column + colDiffs[dir], seedTime); // Add the cell/digit to the current cluster -- if we end up here, the selected cluster fulfills the condition clusterInputs.emplace_back(mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]]); } @@ -182,7 +182,8 @@ void Clusterizer::findClusters(const gsl::span& inpu // Seed is found, form cluster recursively std::vector clusterInputs; - getClusterFromNeighbours(clusterInputs, row, column); + double seedTime = mInputMap[row][column].mInput->getTimeStamp(); + getClusterFromNeighbours(clusterInputs, row, column, seedTime); // Add cells/digits for current cluster to cell/digit index vector int inputIndexStart = mInputIndices.size();