Author: [log in to unmask] Date: Mon Nov 23 07:17:40 2015 New Revision: 3975 Log: cleaned up function code comments Modified: java/trunk/users/src/main/java/org/hps/users/baltzell/RfFitFunction.java Modified: java/trunk/users/src/main/java/org/hps/users/baltzell/RfFitFunction.java ============================================================================= --- java/trunk/users/src/main/java/org/hps/users/baltzell/RfFitFunction.java (original) +++ java/trunk/users/src/main/java/org/hps/users/baltzell/RfFitFunction.java Mon Nov 23 07:17:40 2015 @@ -4,10 +4,10 @@ /* * Function for fitting the leading edge of the RF waveform. + * Straight line fit */ public class RfFitFunction extends AbstractIFunction { protected double intercept=0; - //protected double time=0; protected double slope=0; public RfFitFunction() { this(""); @@ -15,25 +15,21 @@ public RfFitFunction(String title) { super(); this.variableNames=new String[]{"time"}; - //this.parameterNames=new String[]{"intercept","time","slope"}; this.parameterNames=new String[]{"intercept","slope"}; init(title); } public double value(double [] v) { - //return intercept + (v[0]-time)*slope; return intercept + (v[0])*slope; } public void setParameters(double[] pars) throws IllegalArgumentException { super.setParameters(pars); intercept=pars[0]; - //time=pars[1]; slope=pars[1]; } public void setParameter(String key,double value) throws IllegalArgumentException{ super.setParameter(key,value); if (key.equals("intercept")) intercept=value; - //else if (key.equals("time")) time=value; else if (key.equals("slope")) slope=value; } }