Skip to content

Commit

Permalink
Merge pull request #45611 from mmusich/mm_dev_PFRecHitProducerKernel_…
Browse files Browse the repository at this point in the history
…14_0_X

[14.0.X] skip bad channels in `PFRecHitProducerKernelConstruct<T>::applyCuts`
  • Loading branch information
cmsbuild committed Aug 1, 2024
2 parents 90cc17a + bc2c4d9 commit 555f4a3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::particleFlowRecHitProducer {
if (subdet == HcalEndcap)
return detId2denseIdHE(detId);

printf("invalid detId: %u\n", detId);
printf("invalid Hcal detId: %u\n", detId);
return kInvalidDenseId;
}
};
Expand Down Expand Up @@ -197,7 +197,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::particleFlowRecHitProducer {
if (subdet == EcalEndcap)
return Barrel::kSize + Endcap::denseIndex(detId);

printf("invalid detId: %u\n", detId);
printf("invalid Ecal detId: %u\n", detId);
return kInvalidDenseId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,19 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
const uint32_t detId = rh.detId();
const uint32_t depth = HCAL::getDepth(detId);
const uint32_t subdet = getSubdet(detId);

// skip bad channels
if (rh.chi2() < 0)
return false;

if (topology.cutsFromDB()) {
threshold = topology.noiseThreshold()[HCAL::detId2denseId(detId)];
const auto& denseId = HCAL::detId2denseId(detId);
if (denseId != HCAL::kInvalidDenseId) {
threshold = topology.noiseThreshold()[denseId];
} else {
printf("Encountered invalid denseId for detId %u (subdetector %u)!", detId, subdet);
return false;
}
} else {
if (subdet == HcalBarrel) {
threshold = params.energyThresholds()[depth - 1];
Expand Down

0 comments on commit 555f4a3

Please sign in to comment.