Skip to content

Commit 9d31659

Browse files
committed
[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.
1 parent 1b917c4 commit 9d31659

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎Detectors/EMCAL/reconstruction/include/EMCALReconstruction/Clusterizer.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ class Clusterizer
143143
/// \param[in,out] clusterInputs Cells/digits of prototype cluster
144144
/// \param row Row number from neighbor search in recursion step
145145
/// \param column Column number for neighbor search in recursion step
146-
void getClusterFromNeighbours(std::vector<InputwithIndex>& clusterInputs, int row, int column);
146+
/// \param seedTime Timestamp of the seed cell, used as fixed reference for the time cut
147+
void getClusterFromNeighbours(std::vector<InputwithIndex>& clusterInputs, int row, int column, double seedTime);
147148

148149
/// \brief Get row (phi) and column (eta) of a cell/digit, values corresponding to topology
149150
/// \param input Input object (cell/digit)

‎Detectors/EMCAL/reconstruction/src/Clusterizer.cxx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void Clusterizer<InputType>::initialize(double timeCut, double timeMin, double t
4545

4646
//____________________________________________________________________________
4747
template <class InputType>
48-
void Clusterizer<InputType>::getClusterFromNeighbours(std::vector<InputwithIndex>& clusterInputs, int row, int column)
48+
void Clusterizer<InputType>::getClusterFromNeighbours(std::vector<InputwithIndex>& clusterInputs, int row, int column, double seedTime)
4949
{
5050
// Recursion 0, add seed cell/digit to cluster
5151
if (!clusterInputs.size()) {
@@ -71,8 +71,8 @@ void Clusterizer<InputType>::getClusterFromNeighbours(std::vector<InputwithIndex
7171
if (mDoEnergyGradientCut && (mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput->getEnergy() > mInputMap[row][column].mInput->getEnergy() + mGradientCut)) {
7272
continue;
7373
}
74-
if (not(TMath::Abs(mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput->getTimeStamp() - mInputMap[row][column].mInput->getTimeStamp()) > mTimeCut)) {
75-
getClusterFromNeighbours(clusterInputs, row + rowDiffs[dir], column + colDiffs[dir]);
74+
if (not(TMath::Abs(mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput->getTimeStamp() - seedTime) > mTimeCut)) {
75+
getClusterFromNeighbours(clusterInputs, row + rowDiffs[dir], column + colDiffs[dir], seedTime);
7676
// Add the cell/digit to the current cluster -- if we end up here, the selected cluster fulfills the condition
7777
clusterInputs.emplace_back(mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]]);
7878
}
@@ -182,7 +182,8 @@ void Clusterizer<InputType>::findClusters(const gsl::span<InputType const>& inpu
182182

183183
// Seed is found, form cluster recursively
184184
std::vector<InputwithIndex> clusterInputs;
185-
getClusterFromNeighbours(clusterInputs, row, column);
185+
double seedTime = mInputMap[row][column].mInput->getTimeStamp();
186+
getClusterFromNeighbours(clusterInputs, row, column, seedTime);
186187

187188
// Add cells/digits for current cluster to cell/digit index vector
188189
int inputIndexStart = mInputIndices.size();

0 commit comments

Comments
 (0)