Skip to content

Commit

Permalink
[EMCAL-670] EMCAL Clusterizer: change behaviour for no gradient cut
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
mhemmer-cern authored and sawenzel committed Nov 1, 2024
1 parent 8b67fc8 commit 42122b5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Detectors/EMCAL/reconstruction/src/Clusterizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ void Clusterizer<InputType>::getClusterFromNeighbours(std::vector<InputwithIndex

if (mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput) {
if (!mCellMask[row + rowDiffs[dir]][column + colDiffs[dir]]) {
if (mDoEnergyGradientCut && not(mInputMap[row + rowDiffs[dir]][column + colDiffs[dir]].mInput->getEnergy() > mInputMap[row][column].mInput->getEnergy() + mGradientCut)) {
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]);
// 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]]);
}
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]);
// 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

0 comments on commit 42122b5

Please sign in to comment.