Status
From APEXwiki
Contents |
April 16th, 10
I have implemented a 3-parameter fit into the VDC Cluster tracking code in the Analyzer software. First, I will address how the fit works:
Fitting algorithm
I have implemented a Gauss - Newton fitting algorithm that does a least squares regression. A functional form is provided with unknown parameters which require an initial "guess".
The basic function I am using is:
y = m*(x + x0) + b
Where y is the wire position, x is the drift distance, x0 = t0*DriftVelocity, and b is the intercept.
My initial guesses are
m_0 = (y[last] - y[first])/(x[last] - x[first]) b_0 = -1.0 t0_0 = -1.0E-09
The first / last notation above corresponds to the two most positionally distant wires in a cluster with the two greatest drift times. I choose the b_0 was chosen arbitrarily, but the t0_0 was chosen as negative because my test data was mostly positive t0... In other words, I wanted to make sure my fit was giving reasonable results, and iterating from negative to positive correctly.
The iterative process involves solving for b in
J^T J b = J^T r
Where J is the Jacobian matrix with dimensions of (n of cluster hits)X(n of parameters in fit). J^T is the Jacobian's transpose, r is the vector of the sum of squares, and b is a vector containing the iterative adjustment to be made to the fit parameters.
Some Comparisons
I have processed 10000 events for one ep elastic scattering event from my thesis (Experiment e03104, run 1047). The electron and proton are detected in coincidence, and I have plotted the calculated missing Energy from both the simple 2-parameter calculation and the 3-parameter fit below:
And now with the 3-parameter fit:
I also have the missing transverse momentum for the 2-parameter calculation [1], and the 3-parameter fit [2].
The 3-parameter fit usually converges in ~4 iterations.
The time to analyze these same 10000 events are:
2-parameter calc: Tracking : Real Time = 0.34 seconds Cpu Time = 0.34 seconds 3-parameter fit: Tracking : Real Time = 15.63 seconds Cpu Time = 15.82 seconds
Here's a few output lines to see how the 2-parameter calc and the 3-parameter fit compare:
2-parm calc- m: 0.59994 b: -0.391813 2-parm-calc- m: 0.595642 b: -0.391208 3-parm fit- r: 2.38445e-05 m: 0.679953 m_init: 0.728562 b: -0.390504 t0: -5.1947e-08 it_conv: 4 3-parm fit- r: 4.43636e-11 m: 0.588742 m_init: 0.728562 b: -0.391197 t0: 2.12367e-09 it_conv: 4 3-parm fit- r: 1.91814e-06 m: 0.787639 m_init: 0.728562 b: -0.391328 t0: -4.9091e-08 it_conv: 4 3-parm fit- r: 7.9447e-05 m: 0.416289 m_init: 0.728562 b: -1 t0: 2.95753e-05 it_conv: 4
2-parm calc- m: 0.799215 b: 0.0421269 2-parm calc- m: 0.805859 b: 0.0420217 3-parm fit- r: 8.56512e-05 m: 0.287817 m_init: 0.933519 b: 0.0455402 t0: 1.98799e-07 it_conv: 4 3-parm fit- r: 4.32118e-06 m: 0.801151 m_init: 0.933519 b: 0.0420393 t0: 1.01897e-09 it_conv: 4 3-parm fit- r: 5.01798e-08 m: 0.628181 m_init: 0.933519 b: 0.0421143 t0: 5.43537e-08 it_conv: 4 3-parm fit- r: 1.74321e-05 m: 0.819345 m_init: 0.933519 b: 0.0418019 t0: -8.27862e-09 it_conv: 4
In the first case the 2-parameter and the 3-parameter fit would choose a very similar slope. In the second case, it is very different.
t0
Ok, lets look at what the fit t0 looks like:
Now we can look at the comparison per arm in the u and v planes:
A different fit
One possibility is to fit the distance calculation (a 3rd order slope parametrization) at the same time as fitting the 3-parameter linear fit. This allows distance correction to be a function of t0 as well, and the slope to be represented more accurately in the distance correction.
Currently the fitting algorithm takes ~100 iterations to converge. This could be improved with a faster converging algorithm, like the Levenberg–Marquardt algorithm.
I have fitted this function and recieved the following results:
Here is the t0 for the right arm:
