Skip to content

Commit 776aa96

Browse files
authored
Merge pull request #45604 from mmusich/mm_dev_PFRecHitProducerKerne
skip bad channels in `PFRecHitProducerKernelConstruct<T>::applyCuts`
2 parents 3244058 + 2155a8b commit 776aa96

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

RecoParticleFlow/PFRecHitProducer/plugins/alpaka/CalorimeterDefinitions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::particleFlowRecHitProducer {
111111
if (subdet == HcalEndcap)
112112
return detId2denseIdHE(detId);
113113

114-
printf("invalid detId: %u\n", detId);
114+
printf("invalid Hcal detId: %u\n", detId);
115115
return kInvalidDenseId;
116116
}
117117
};
@@ -197,7 +197,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::particleFlowRecHitProducer {
197197
if (subdet == EcalEndcap)
198198
return Barrel::kSize + Endcap::denseIndex(detId);
199199

200-
printf("invalid detId: %u\n", detId);
200+
printf("invalid Ecal detId: %u\n", detId);
201201
return kInvalidDenseId;
202202
}
203203

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)