Commit in hps-java/src/main/java/org/lcsim/hps/recon/tracking on MAIN | |||
DumbShaperFit.java | +14 | -3 | 1.2 -> 1.3 |
Somewhat less DumbShaperFit...now takes a weighted average of hits to get t0 [really the peak time].
diff -u -r1.2 -r1.3 --- DumbShaperFit.java 25 Apr 2012 18:01:32 -0000 1.2 +++ DumbShaperFit.java 25 Apr 2012 20:21:24 -0000 1.3 @@ -16,14 +16,25 @@
public HPSShapeFitParameters fitShape(RawTrackerHit rth, ChannelConstants constants) { HPSShapeFitParameters fitresults = new HPSShapeFitParameters(); short[] adcVals=rth.getADCValues();
+ double[] pedSub={-99.0,-99.0,-99.0,-99.0,-99.0,-99.0};
double maxADC=-99999;
+ int iMax=-1;
double t0=-999; for(int i=0;i<6;i++){
- if(adcVals[i]>maxADC){ - maxADC=adcVals[i]; - t0=24.0*i;
+ pedSub[i]=adcVals[i]-constants.getPedestal(); + if(pedSub[i]>maxADC){ + maxADC=pedSub[i]; + iMax=i;
} }
+ if(iMax>0&&iMax<5){ + t0 = (pedSub[iMax-1]*24.0*(iMax-1)+pedSub[iMax]*24.0*(iMax)+pedSub[iMax+1]*24.0*(iMax+1))/(pedSub[iMax-1]+pedSub[iMax]+pedSub[iMax+1]); + }else if(iMax==0){ + t0 =(pedSub[iMax]*24.0*(iMax)+pedSub[iMax+1]*24.0*(iMax+1))/(pedSub[iMax]+pedSub[iMax+1]) ; + }else if(iMax==5){ + t0 =(pedSub[iMax]*24.0*(iMax)+pedSub[iMax-1]*24.0*(iMax-1))/(pedSub[iMax-1]+pedSub[iMax]) ; + } +
fitresults.setAmp(maxADC); fitresults.setT0(t0); return fitresults;
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1