diff --git a/RecoParticleFlow/PFRecHitProducer/plugins/alpaka/PFRecHitTopologyESProducer.cc b/RecoParticleFlow/PFRecHitProducer/plugins/alpaka/PFRecHitTopologyESProducer.cc index f94db2aecc362..33abb62375707 100644 --- a/RecoParticleFlow/PFRecHitProducer/plugins/alpaka/PFRecHitTopologyESProducer.cc +++ b/RecoParticleFlow/PFRecHitProducer/plugins/alpaka/PFRecHitTopologyESProducer.cc @@ -104,6 +104,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { for (auto const detId : geom.getValidDetIds(CAL::kDetectorId, subdet)) { const uint32_t denseId = CAL::detId2denseId(detId); for (uint32_t n = 0; n < 8; n++) { + if (view.neighbours(denseId)[n] == 0xffffffff) + continue; const ::reco::PFRecHitsTopologyNeighbours& neighboursOfNeighbour = view.neighbours(view.neighbours(denseId)[n]); if (std::find(neighboursOfNeighbour.begin(), neighboursOfNeighbour.end(), denseId) ==