@@ -617,12 +617,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
617617 outputGPU.chi2 ()[gch] = -9999 .f ;
618618
619619 // check as in cpu version if mahi is not needed
620- // FIXME: KNOWN ISSUE: observed a problem when rawCharge and pedestal
621- // are basically equal and generate -0.00000...
622- // needs to be treated properly
623- if (!(shrEnergyM0TotalAccum[lch] > 0 && energym0_per_ts_gain0 > ts4Thresh)) {
624- // do not need to run mahi minimization
625- // outputEnergy[gch] = 0; energy already inited to 0
620+ // (use "not" and ">", instead of "<=", to ensure that a NaN value will pass the check, and the hit be flagged as invalid)
621+ if (not (energym0_per_ts_gain0 > ts4Thresh)) {
626622 outputGPU.chi2 ()[gch] = -9999 .f ;
627623 }
628624 }
@@ -701,6 +697,15 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
701697 outputGPU.energyM0 ()[gch] = method0_energy;
702698 outputGPU.timeM0 ()[gch] = time;
703699
700+ // check as in cpu version if mahi is not needed
701+ // FIXME: KNOWN ISSUE: observed a problem when rawCharge and pedestal
702+ // are basically equal and generate -0.00000...
703+ // needs to be treated properly
704+ // (use "not" and ">", instead of "<=", to ensure that a NaN value will pass the check, and the hit be flagged as invalid)
705+ if (not (shrEnergyM0TotalAccum[lch] > 0 )) {
706+ outputGPU.chi2 ()[gch] = -9999 .f ;
707+ }
708+
704709#ifdef HCAL_MAHI_GPUDEBUG
705710 printf (" tsTOT = %f tstrig = %f ts4Thresh = %f\n " ,
706711 shrEnergyM0TotalAccum[lch],
0 commit comments