diff --git a/Detectors/EMCAL/base/include/EMCALBase/Geometry.h b/Detectors/EMCAL/base/include/EMCALBase/Geometry.h index 87ff092f5abcd..a0adbc39b43ba 100644 --- a/Detectors/EMCAL/base/include/EMCALBase/Geometry.h +++ b/Detectors/EMCAL/base/include/EMCALBase/Geometry.h @@ -429,15 +429,13 @@ class Geometry /// \return Position (0 - phi, 1 - eta) of the cell inside teh supermodule std::tuple 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 GetTopologicalRowColumn(int supermoduleID, int moduleID, int phiInModule, int etaInModule) const; - + std::tuple 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 diff --git a/Detectors/EMCAL/base/src/ClusterFactory.cxx b/Detectors/EMCAL/base/src/ClusterFactory.cxx index 1bfceb0d6a82d..9c0a3d48efa0a 100644 --- a/Detectors/EMCAL/base/src/ClusterFactory.cxx +++ b/Detectors/EMCAL/base/src/ClusterFactory.cxx @@ -504,33 +504,34 @@ void ClusterFactory::evalNExMax(gsl::span inputsIndices, A int column; double energy; }; - + std::vector 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;