Skip to content

Commit 42122b5

Browse files
mhemmer-cernsawenzel
authored andcommitted
[EMCAL-670] EMCAL Clusterizer: change behaviour for no gradient cut
- Changed `getClusterFromNeighbours` so that when gradient gut is off, it now still adds neighbouring cells. Before this change when gradient cut was set to `false` all clusters were single cell cluster made only from the seed cell.
1 parent 8b67fc8 commit 42122b5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Detectors/EMCAL/reconstruction/src/Clusterizer.cxx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,13 @@ void Clusterizer<InputType>::getClusterFromNeighbours(std::vector<InputwithIndex
6868

6969
if (mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput) {
7070
if (!mCellMask[row + rowDiffs[dir]][column + colDiffs[dir]]) {
71-
if (mDoEnergyGradientCut && not(mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput->getEnergy() > mInputMap[row][column].mInput->getEnergy() + mGradientCut)) {
72-
if (not(TMath::Abs(mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput->getTimeStamp() - mInputMap[row][column].mInput->getTimeStamp()) > mTimeCut)) {
73-
getClusterFromNeighbours(clusterInputs, row + rowDiffs[dir], column + colDiffs[dir]);
74-
// Add the cell/digit to the current cluster -- if we end up here, the selected cluster fulfills the condition
75-
clusterInputs.emplace_back(mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]]);
76-
}
71+
if (mDoEnergyGradientCut && (mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput->getEnergy() > mInputMap[row][column].mInput->getEnergy() + mGradientCut)) {
72+
continue;
73+
}
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]);
76+
// Add the cell/digit to the current cluster -- if we end up here, the selected cluster fulfills the condition
77+
clusterInputs.emplace_back(mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]]);
7778
}
7879
}
7980
}

0 commit comments

Comments
 (0)