Beam Alignment - Requirements
1. Speed: update measured
beam position every 1-10 seconds
2. Accuracy: < 10
microns
3. Robustness: can survive
any kind of bad data
4. Running all the time:
results updated continuosly on ACNET and Web page
5. Written in ANSI-C
for portability
-
VxWorks vs. Unix or Linux
Beam finding algorithm
Basic math
SVXII is subdivided along z into six "half ladders". By using SVT tracks
that only have hits in one of the six "z segments", we can isolate samples
of tracks coming from primary vertices with different ranges of z coordinates.
In this way, even though SVT reconstructs tracks only in the r-phi projection,
information on the x-y position of the beam spot at six different average
z positions can be used to obtain an estimate of the three-dimensional
position of the luminous region.
The x-y position of the beam spot is obtained, as usual, by fitting
the d-phi distribution with a sine wave:
d = -x*sin(phi) + y*cos(phi)
assuming the same error for all the tracks, the best fit is given
by the solution of the following linear system:
x*(Ssin^2(phi))
- y*(Ssin(phi)cos(phi)) = - Sd*sin(phi)
-x*(Ssin(phi)cos(phi)) + y*(Scos^2(phi))
= Sd*cos(phi)
where the unknowns as x and y
and the coefficients are obtained as sums over all tracks.
phi is the azimuthal angle at the point closest
to the origin, and d is the impact parameter.
In order to obtain the residual beam witdh (with respect to the corrected
beam center) we also need to accumulate Sd^2:
sigma^2 = Sd^2 + x^2*(Ssin^2(phi))
+ y^2*(Scos^2(phi)) + 2x*(Sd*sin(phi))
- 2y*(Sd*cos(phi)) - 2xy*(Ssin(phi)cos(phi))
sigma^2 is also needed to compute the covariance
matrix of x,y
Looking up trig functions
One of our goals is execution speed. All the math outlined above is pretty
fast except for the calculation of trigonometric functions. Luckily enough
the phi from the Track Fitters is only 13 bit wide so a few 8k words look-up
tables will do the trick in no time.
Cutting the tails
The beam profile distribution is gaussian with some long flat tails. To
obtain a good estimate of the beam center coordinates one needs to cut
the tails symmetrically at a reasonable distance from the center (~3-4
standard deviations). If cuts are not placed correctly there might be a
significant systematic error due to the tails "pulling" the averages. So
we choose to base our algorithm on a successive approximation strategy:
-
Start with very wide cuts (~1cm) around the "nominal" beam position (0,0)
-
Use these tracks to find a first approximation of x,y
-
Tighten the cuts around the new value of x,y
-
Iterate using the new x,y value and tightening the cuts every time
We have tested this algorithm using SVT tracks from the Commissioning
Run and we obtained satisfactory results with five iteration steps with
cuts going from +-1cm to +- 200 microns. One thousand tracks where used
for each iteration step.
Pipelining iteration steps
Subsequent iteration steps are not performed using the same tracks over
and over, instead a fresh new track sample is used at every step. In this
way there is no need to store tracks: each track is used once and then
discarded. So the subsequent iteration steps happen sequentially in time
using distinct but statistically equivalent track samples (we assume the
beam does not change appreciably from one iteration step to the next).
In order to minimize execution time, we pipeline iteration steps so that
when a 1st order beam position is obtained we start a 2nd order iteration
with tightened cuts and, at the same time, a new 1st order iteration with
wide cuts and so on. So, at any given time, we have all iteration levels
going at the same time with different cuts and different (in principle)
beam centers. The situation for the case of five iteration levels is depicted
in the sketch below where time is going from left to right and the different
iteration levels are shown one on top of the other. The center of the beam
for iteration n.m comes from iteration n.(m-1). The width
of the cut depends only on m.
time --->
------------------------------------------------------------------
Iter 1.1 Iter 2.1 Iter 3.1 Iter 4.1 Iter 5.1
Iter 6.1 ...
Iter 1.2
Iter 2.2 Iter 3.2 Iter 4.2 Iter 5.2 ...
Iter 1.3 Iter 2.3 Iter 3.3 Iter 4.3 ...
Iter 1.4 Iter 2.4 Iter 3.4 ...
Iter 1.5 Iter 2.5 ...
------------------------------------------------------------------
So, any given track, is fed to all active iteration levels and then
discarded.
The result of "Iter n.5" is used as the "current" beam position
and is updated after every iteration cycle is complete.
One of the good features of this algorithm is its finite memory in
time. This means that, though it uses a successive approximation strategy,
the result at any given time depends only on the last N tracks, where N
is large but finite. This guarantees that even if fed very bad data for
some time, it will never end up stuck in a bad state from where it will
not be able to recover. It is guaranteed to recover from any
state after being fed N good tracks. N will probably be of the order of
50,000.
Beam position
The result of the beam fit is defined to be the six x,y coordinates and
covariance matrices of the center of the beam spot (one per z segment),
plus the four coordinates of the three-dimensional beam spot axis and the
corresponding four by four covariance matrix:
float x_z[6], y_z[6]; /* beam position */
float sx_z[6], sy_z[6], sxy_z[6]; /* covariance
matrix */
float x_3D, y_3D; /* beam intercept at z=0
*/
float dx_3D, dy_3D; /* slopes */
float cov_3D[4][4];/* covariance matrix */
Performance of SVTbeam algorithm
-
input data is from Commissioning Run in TF output format
-
does not include readout of data from VME
-
algorithm was run on different machines
b0dau30: ~ 830,000 tracks/second
b0dap22: ~ 1,250,000 tracks/second
cdfsga: ~ 500,000 tracks/second
b0svt02: ~ 500,000 tracks/second
Statistical error on beam position
err_x ~ err_y ~ 2*sigma_beam/sqrt(Ntracks)
if sigma_beam ~ 50 microns then with 10,000 tracks
err_x ~ err_y ~ 1 micron
1 Hz update rate costs < 2%
of CPU time
SVTbeam strategy
run on b0svt06 in Track Fitter crate
run all the time
periodically send SmartSocket message with beam position
information
different "consumers" subscribe the message and perform different
tasks:
-
update web page
-
send data to Acnet
-
...
must be coordinated with SPYMON in TF crate
-
read Spy Buffers once and use for both SPYMON and SVTbeam
Timescale
-
March 1st 2001:
-
working demo with simulated data (no VME)
-
April 1st 2001:
-
working prototype with data from Spy Buffers
-
requires data flow through TF's
and coordination with SPYMON