Skip to content

Commit 1f4e262

Browse files
committed
skip bad channels in PFRecHitProducerKernelConstruct<T>::applyCuts
- as implemented in HcalRecHitSoAToLegacy - also check denseId validity before retrieving PF threshold
1 parent 980d337 commit 1f4e262

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

RecoParticleFlow/PFRecHitProducer/plugins/alpaka/PFRecHitProducerKernel.dev.cc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,19 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
5959
const uint32_t detId = rh.detId();
6060
const uint32_t depth = HCAL::getDepth(detId);
6161
const uint32_t subdet = getSubdet(detId);
62+
63+
// skip bad channels
64+
if (rh.chi2() < 0)
65+
return false;
66+
6267
if (topology.cutsFromDB()) {
63-
threshold = topology.noiseThreshold()[HCAL::detId2denseId(detId)];
68+
const auto& denseId = HCAL::detId2denseId(detId);
69+
if (denseId != HCAL::kInvalidDenseId) {
70+
threshold = topology.noiseThreshold()[denseId];
71+
} else {
72+
printf("Encountered invalid denseId for detId %u (subdetector %u)!", detId, subdet);
73+
return false;
74+
}
6475
} else {
6576
if (subdet == HcalBarrel) {
6677
threshold = params.energyThresholds()[depth - 1];

0 commit comments

Comments
 (0)