Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<InputwithIndex>& clusterInputs, int row, int column);
/// \param seedTime Timestamp of the seed cell, used as fixed reference for the time cut
void getClusterFromNeighbours(std::vector<InputwithIndex>& 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)
Expand Down
9 changes: 5 additions & 4 deletions Detectors/EMCAL/reconstruction/src/Clusterizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void Clusterizer<InputType>::initialize(double timeCut, double timeMin, double t

//____________________________________________________________________________
template <class InputType>
void Clusterizer<InputType>::getClusterFromNeighbours(std::vector<InputwithIndex>& clusterInputs, int row, int column)
void Clusterizer<InputType>::getClusterFromNeighbours(std::vector<InputwithIndex>& clusterInputs, int row, int column, double seedTime)
{
// Recursion 0, add seed cell/digit to cluster
if (!clusterInputs.size()) {
Expand All @@ -71,8 +71,8 @@ void Clusterizer<InputType>::getClusterFromNeighbours(std::vector<InputwithIndex
if (mDoEnergyGradientCut && (mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput->getEnergy() > 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]]);
}
Expand Down Expand Up @@ -182,7 +182,8 @@ void Clusterizer<InputType>::findClusters(const gsl::span<InputType const>& inpu

// Seed is found, form cluster recursively
std::vector<InputwithIndex> 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();
Expand Down
Loading