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();