diff --git a/src/Ecal/EcalVetoProcessor.cxx b/src/Ecal/EcalVetoProcessor.cxx index 167b3c4..715a2bc 100644 --- a/src/Ecal/EcalVetoProcessor.cxx +++ b/src/Ecal/EcalVetoProcessor.cxx @@ -910,7 +910,7 @@ void EcalVetoProcessor::fillIsolatedHitMap( // these ideas are only cell/module (must ignore layer) std::vector cellNbrIds = geometry_->getNN(id); - for (int k = 0; k < 6; k++) { + for (int k = 0; k < cellNbrIds.size(); k++) { // update neighbor ID to the current layer cellNbrIds[k] = ldmx::EcalID(id.layer(), cellNbrIds[k].module(), cellNbrIds[k].cell());