Beam Alignment - Requirements

 


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:
  1. Start with very wide cuts (~1cm) around the "nominal" beam position (0,0)
  2. Use these tracks to find a first approximation of x,y
  3. Tighten the cuts around the new value of x,y
  4. 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

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:
    1. update web page
    2. send data to Acnet
    3. ...
  • must be coordinated with SPYMON in TF crate
  • Timescale