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

fix check on shrEnergyM0TotalAccum in HCAL-Alpaka kernel #45452

Merged
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
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