Skip to content

Commit

Permalink
Mark as bad channels with an invalid SOI
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Oct 14, 2022
1 parent 825e451 commit ac7fe33
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions RecoLocalCalo/HcalRecProducers/src/MahiGPU.cu
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ namespace hcal {
method0Time[gch] = 0;
outputEnergy[gch] = 0;
outputChi2[gch] = 0;
soiSamples[gch] = -1;
;
}

#ifdef HCAL_MAHI_GPUDEBUG
Expand Down Expand Up @@ -265,6 +267,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 +377,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

0 comments on commit ac7fe33

Please sign in to comment.