Skip to content

Commit

Permalink
Merge pull request #45453 from missirol/devel_hcalAlpaka_fixShrEnergy…
Browse files Browse the repository at this point in the history
…M0TotalAccum_14_0_11

fix check on `shrEnergyM0TotalAccum` in HCAL-Alpaka kernel [`14_0_X`]
  • Loading branch information
cmsbuild authored Jul 17, 2024
2 parents efd8e8c + 57e9df5 commit b770785
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions RecoLocalCalo/HcalRecProducers/plugins/alpaka/Mahi.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
outputGPU.chi2()[gch] = -9999.f;

// check as in cpu version if mahi is not needed
// FIXME: KNOWN ISSUE: observed a problem when rawCharge and pedestal
// are basically equal and generate -0.00000...
// needs to be treated properly
if (!(shrEnergyM0TotalAccum[lch] > 0 && energym0_per_ts_gain0 > ts4Thresh)) {
// do not need to run mahi minimization
//outputEnergy[gch] = 0; energy already inited to 0
// (use "not" and ">", instead of "<=", to ensure that a NaN value will pass the check, and the hit be flagged as invalid)
if (not(energym0_per_ts_gain0 > ts4Thresh)) {
outputGPU.chi2()[gch] = -9999.f;
}
}
Expand Down Expand Up @@ -701,6 +697,15 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
outputGPU.energyM0()[gch] = method0_energy;
outputGPU.timeM0()[gch] = time;

// check as in cpu version if mahi is not needed
// FIXME: KNOWN ISSUE: observed a problem when rawCharge and pedestal
// are basically equal and generate -0.00000...
// needs to be treated properly
// (use "not" and ">", instead of "<=", to ensure that a NaN value will pass the check, and the hit be flagged as invalid)
if (not(shrEnergyM0TotalAccum[lch] > 0)) {
outputGPU.chi2()[gch] = -9999.f;
}

#ifdef HCAL_MAHI_GPUDEBUG
printf("tsTOT = %f tstrig = %f ts4Thresh = %f\n",
shrEnergyM0TotalAccum[lch],
Expand Down

0 comments on commit b770785

Please sign in to comment.