We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fbdf4f6 commit 0bc4c78Copy full SHA for 0bc4c78
1 file changed
evio/src/main/java/org/hps/evio/RfFitterDriver.java
@@ -143,8 +143,16 @@ private double fitPulse(FADCGenericHit hit) {
143
}
144
145
int jj = 0;
146
+ int ik = 1;
147
// Choose peak closest to center of window (second peak, ik=1)
- final int ik = 1;
148
+ if( iz >=2 ) {
149
+ ik = 1;
150
+ }else if( iz == 1){
151
+ ik = 0; // Only one peak found.
152
+ }else{
153
+ return 0;
154
+ }
155
+
156
pedVal[ik] = (adcSamples[peakBin[ik] - 6] + adcSamples[peakBin[ik] - 7] + adcSamples[peakBin[ik] - 8] + adcSamples[peakBin[ik] - 9]) / 4.0;
157
fitThresh[ik] = (adcSamples[peakBin[ik]] + pedVal[ik]) / 3.0;
158
0 commit comments