Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip invalid channels in the GPU HCAL RecHit producer [12.5.x] #39739

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions RecoLocalCalo/HcalRecProducers/src/HcalCPURecHitsProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,18 @@ void HcalCPURecHitsProducer::produce(edm::Event& event, edm::EventSetup const& s
// did not set size with ctor as there is no setter for did
recHitsLegacy->reserve(tmpRecHits_.did.size());
for (uint32_t i = 0; i < tmpRecHits_.did.size(); i++) {
// skip bad channels
if (tmpRecHits_.chi2[i] < 0)
continue;

// build a legacy rechit with the computed detid and MAHI energy
recHitsLegacy->emplace_back(HcalDetId{tmpRecHits_.did[i]},
tmpRecHits_.energy[i],
0 // timeRising
);

// update newly pushed guy
(*recHitsLegacy)[i].setChiSquared(tmpRecHits_.chi2[i]);
(*recHitsLegacy)[i].setRawEnergy(tmpRecHits_.energyM0[i]);
// update the legacy rechit with the Chi2 and M0 values
recHitsLegacy->back().setChiSquared(tmpRecHits_.chi2[i]);
recHitsLegacy->back().setRawEnergy(tmpRecHits_.energyM0[i]);
}

// put the legacy collection
Expand Down
12 changes: 12 additions & 0 deletions RecoLocalCalo/HcalRecProducers/src/MahiGPU.cu
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ namespace hcal {
method0Time[gch] = 0;
outputEnergy[gch] = 0;
outputChi2[gch] = 0;
soiSamples[gch] = -1;
}

#ifdef HCAL_MAHI_GPUDEBUG
Expand Down Expand Up @@ -265,6 +266,16 @@ namespace hcal {
int32_t const soi = gch < nchannelsf01HE
? soiSamples[gch]
: (gch < nchannelsf015 ? npresamplesf5HB[gch - nchannelsf01HE] : soiSamples[gch]);

bool badSOI = (soi < 0 or soi >= nsamplesForCompute);
if (badSOI and sampleWithinWindow == 0) {
#ifdef GPU_DEBUG
printf("Found HBHE channel %d with invalid SOI %d\n", gch, soi);
#endif
// mark the channel as bad
outputChi2[gch] = -9999.f;
}

//int32_t const soi = gch >= nchannelsf01HE
// ? npresamplesf5HB[gch - nchannelsf01HE]
// : soiSamples[gch];
Expand Down Expand Up @@ -365,6 +376,7 @@ namespace hcal {
__syncthreads();

// NOTE: must take soi, as values for that thread are used...
// NOTE: does not run if soi is bad, because it does not match any sampleWithinWindow
if (sampleWithinWindow == soi) {
auto const method0_energy = shrMethod0EnergyAccum[lch];
auto const val = shrMethod0EnergySamplePair[lch];
Expand Down