Project

General

Profile

Support #16162

Support #16096: Fix problems found when attempting to build with gcc 6.3.0

dunetpc misleading indentations

Added by Lynn Garren over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
04/11/2017
Due date:
% Done:

100%

Estimated time:
Spent time:
Experiment:
DUNE
Co-Assignees:
Duration:

Description

There are a number of misleading indentations in dunetpc/dune/DetSim/SimWireDUNE10kt_module.cc
When looking at the code, it is not at all certain what the author intended. Please add explicit curly braces and commit the fix to the head of develop.

        if (prepost) {
          for(unsigned int i = 0; i < signalSize; ++i){
            if(view==geo::kU)      { tnoisepre = noise_a_Upre[i]; tnoisepost = noise_a_Upost[i];  }
            else if(view==geo::kV) { tnoisepre = noise_a_Vpre[i]; tnoisepost = noise_a_Vpost[i]; }
            else                   { tnoisepre = noise_a_Zpre[i]; tnoisepost = noise_a_Zpost[i]; }

            tmpfv = tnoisepre + fChargeWorkPreSpill_a[i];
            //allow for ADC saturation
          if ( tmpfv > adcsaturation - ped_mean)
            tmpfv = adcsaturation- ped_mean;
          //don't allow for "negative" saturation
          if ( tmpfv < 0- ped_mean )
            tmpfv = 0- ped_mean;
            adcvecPreSpill_a[i] = (tmpfv >=0) ? (short) (tmpfv+0.5) : (short) (tmpfv-0.5);
            tmpfv = tnoisepost + fChargeWorkPostSpill_a[i];
            //allow for ADC saturation
          if ( tmpfv > adcsaturation - ped_mean)
            tmpfv = adcsaturation- ped_mean;
          //don't allow for "negative" saturation
          if ( tmpfv < 0 - ped_mean)
            tmpfv = 0- ped_mean;
            adcvecPostSpill_a[i] = (tmpfv >=0) ? (short) (tmpfv+0.5) : (short) (tmpfv-0.5);
          }
        }

        if (prepost) {
          for(unsigned int i = 0; i < signalSize; ++i){
            if(view==geo::kU)      { tnoisepre = rGauss_Ind.fire(); tnoisepost = rGauss_Ind.fire(); }
            else if(view==geo::kV) { tnoisepre = rGauss_Ind.fire(); tnoisepost = rGauss_Ind.fire(); }
            else                   { tnoisepre = rGauss_Col.fire(); tnoisepost = rGauss_Col.fire(); }

            tmpfv = tnoisepre + fChargeWorkPreSpill_a[i];
            //allow for ADC saturation
          if ( tmpfv > adcsaturation - ped_mean)
            tmpfv = adcsaturation- ped_mean;
          //don't allow for "negative" saturation
          if ( tmpfv < 0 - ped_mean)
            tmpfv = 0- ped_mean;
            adcvecPreSpill_a[i] = (tmpfv >=0) ? (short) (tmpfv+0.5) : (short) (tmpfv-0.5);
            tmpfv = tnoisepost + fChargeWorkPostSpill_a[i];
            //allow for ADC saturation
          if ( tmpfv > adcsaturation - ped_mean)
            tmpfv = adcsaturation- ped_mean;
          //don't allow for "negative" saturation
          if ( tmpfv < 0 - ped_mean)
            tmpfv = 0- ped_mean;
            adcvecPostSpill_a[i] = (tmpfv >=0) ? (short) (tmpfv+0.5) : (short) (tmpfv-0.5);
          }
        }
      }

History

#2 Updated by Lynn Garren over 3 years ago

  • % Done changed from 0 to 100

#3 Updated by Lynn Garren over 3 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF