Skip to content
Merged
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
4 changes: 1 addition & 3 deletions Detectors/EMCAL/base/include/EMCALBase/Geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,15 +429,13 @@ class Geometry
/// \return Position (0 - phi, 1 - eta) of the cell inside teh supermodule
std::tuple<int, int> GetCellPhiEtaIndexInSModule(int supermoduleID, int moduleID, int phiInModule, int etaInModule) const;


/// \brief Get topological row and column of cell in SM (same as for clusteriser with artifical gaps)
/// \param supermoduleID super module number
/// \param moduleID module number
/// \param phiInModule index in phi direction in module
/// \param etaInModule index in phi direction in module
/// \return tuple with (row, column) of the cell, which is global numbering scheme
std::tuple<int,int> GetTopologicalRowColumn(int supermoduleID, int moduleID, int phiInModule, int etaInModule) const;

std::tuple<int, int> GetTopologicalRowColumn(int supermoduleID, int moduleID, int phiInModule, int etaInModule) const;

/// \brief Adapt cell indices in supermodule to online indexing
/// \param supermoduleID super module number of the channel/cell
Expand Down
19 changes: 10 additions & 9 deletions Detectors/EMCAL/base/src/ClusterFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -504,33 +504,34 @@ void ClusterFactory<InputType>::evalNExMax(gsl::span<const int> inputsIndices, A
int column;
double energy;
};

std::vector<CellInfo> cellInfos;
cellInfos.reserve(inputsIndices.size());

for (auto iInput : inputsIndices) {
auto [nSupMod, nModule, nIphi, nIeta] = mGeomPtr->GetCellIndex(mInputsContainer[iInput].getTower());

// get a nice topological indexing that is done in exactly the same way as used by the clusterizer
// this way we can handle the shared cluster cases correctly
auto [row, column] = mGeomPtr->GetTopologicalRowColumn(nSupMod, nModule, nIphi, nIeta);
cellInfos.push_back({row, column, mInputsContainer[iInput].getEnergy()});
}

// Now find local maxima using pre-computed data
int nExMax = 0;
for (size_t i = 0; i < cellInfos.size(); i++) {
// this cell is assumed to be local maximum unless we find a higher energy cell in the neighborhood
bool isExMax = true;

// loop over all other cells in cluster
for (size_t j = 0; j < cellInfos.size(); j++) {
if (i == j) continue;

if (i == j)
continue;

// adjacent cell is any cell with adjacent phi or eta index
if (std::abs(cellInfos[i].row - cellInfos[j].row) <= 1 &&
if (std::abs(cellInfos[i].row - cellInfos[j].row) <= 1 &&
std::abs(cellInfos[i].column - cellInfos[j].column) <= 1) {

// if there is a cell with higher energy than the current cell, it is not a local maximum
if (cellInfos[j].energy > cellInfos[i].energy) {
isExMax = false;
Expand Down