Track and vertex fitting in an inhomogeneous magnetic field

18
Nuclear Instruments and Methods in PhysicsResearch 220 (1984) 309-326 309 North-Holland, Amsterdam TRACK AND VERTEX FITFING IN AN INHOMOGENEOUS MAGNETIC FIELD J.C. HART and D.H. SAXON Rutherford Appleton laboratory, Chilton, Dicot, Oxon OXl l OQX, England Received 10 August 1983 Methods have been developed for fitting tracks and vertices in an inhomogeneousmagnetic field for the PT55 Experiment at Nimrod. Details of the methods, including the correction for E × B effects,are given. 1. Introduction This report describes the methods developed for the reconstruction of particle tracks and decay vertices in the PT55 Experiment, Nimrod proposal 166 [1]. The experiment was the third in a sequence to study the reaction ~r-p ~ K°A in the resonance region [2], and used a polarized proton target in order to measure the polarization parameters for the reaction. For the purpose of this report, the significant feature of the experiment was the large axially-symmetric inhomogeneous fringe field of the polarizing magnet which necessitated the adoption of new algorithms for finding and fitting tracks and vertices. The principal detectors were multi-gap optical spark chambers viewed by vidicon cameras. In outline, the basic steps in event reconstruction were as follows: (1) Correction of 2-dimensional spark coordinates for optical distortions and non-linearity of the vidicon cameras. (2) Reconstruction of spark positions in three dimensions by combining information from three or four cameras viewing the spark chambers at different angles. (3) Correction of these spark coordinates for the drift of ions under the influence of crossed electric and magnetic fields in the time between the occurrence of an event and the formation of the spark (the E × B correction). (4) Trackfinding, i.e. the recognition of curved particle trajectories through the corrected spark posi- tions. At this stage it was also possible to associate with the tracks some of the original 2-dimensional coordinates which had not been identified with sparks in three dimensions. (5) Fitting of track parameters, and estimation of their errors. Tracks were described by the coordinates and direction at one point and by the inverse momentum. (6) Fitting of vertex parameters (coordinates of the vertex and directions and momenta of the two tracks) for the K ° and A decay vertices. (7) Kinematic fitting, which involved the imposition of the additional geometric and kinematic constraints implied by the reaction ~r-p ~ K°A, and the calculation of such parameters as the cm scattering angle. Steps (1), (2) and (4) are described elsewhere [3]. Step (3) is discussed in section 3 of this report after a description of the apparatus in section 2. The fitting of tracks and vertices (steps (5) and (6) for the subjects of sections 5 and 6 respectively. Both involve the propagation of tracks through the magnetic field; this is therefore discussed in section 4. 2. Outline of the apparatus The apparatus is illustrated in fig. 1. A ~r- beam was incident on the target at the centre of the polarizing coil. Outgoing tracks were observed in two optical spark chambers with a total of 18 gaps viewed by six 016%5087/84/$03.00 © Elsevier Science Publishers B.V. (North-Holland Physics Publishiag Division)

Transcript of Track and vertex fitting in an inhomogeneous magnetic field

Page 1: Track and vertex fitting in an inhomogeneous magnetic field

Nuclear Instruments and Methods in Physics Research 220 (1984) 309-326 309 North-Holland, Amsterdam

TRACK AND VERTEX FITFING IN AN I N H O M O G E N E O U S MAGNETIC FIELD

J.C. HART and D.H. SAXON Rutherford Appleton laboratory, Chilton, Dicot, Oxon OXl l OQX, England

Received 10 August 1983

Methods have been developed for fitting tracks and vertices in an inhomogeneous magnetic field for the PT55 Experiment at Nimrod. Details of the methods, including the correction for E × B effects, are given.

1. Introduction

This report describes the methods developed for the reconstruction of particle tracks and decay vertices in the PT55 Experiment, Nimrod proposal 166 [1]. The experiment was the third in a sequence to study the reaction ~r-p ~ K°A in the resonance region [2], and used a polarized proton target in order to measure the polarization parameters for the reaction. For the purpose of this report, the significant feature of the experiment was the large axially-symmetric inhomogeneous fringe field of the polarizing magnet which necessitated the adoption of new algorithms for finding and fitting tracks and vertices. The principal detectors were multi-gap optical spark chambers viewed by vidicon cameras.

In outline, the basic steps in event reconstruction were as follows: (1) Correction of 2-dimensional spark coordinates for optical distortions and non-linearity of the

vidicon cameras. (2) Reconstruction of spark positions in three dimensions by combining information from three or four

cameras viewing the spark chambers at different angles. (3) Correction of these spark coordinates for the drift of ions under the influence of crossed electric and

magnetic fields in the time between the occurrence of an event and the formation of the spark (the E × B correction).

(4) Trackfinding, i.e. the recognition of curved particle trajectories through the corrected spark posi- tions. At this stage it was also possible to associate with the tracks some of the original 2-dimensional coordinates which had not been identified with sparks in three dimensions.

(5) Fitting of track parameters, and estimation of their errors. Tracks were described by the coordinates and direction at one point and by the inverse momentum.

(6) Fitting of vertex parameters (coordinates of the vertex and directions and momenta of the two tracks) for the K ° and A decay vertices.

(7) Kinematic fitting, which involved the imposition of the additional geometric and kinematic constraints implied by the reaction ~r-p ~ K°A, and the calculation of such parameters as the cm scattering angle.

Steps (1), (2) and (4) are described elsewhere [3]. Step (3) is discussed in section 3 of this report after a description of the apparatus in section 2. The fitting of tracks and vertices (steps (5) and (6) for the subjects of sections 5 and 6 respectively. Both involve the propagation of tracks through the magnetic field; this is therefore discussed in section 4.

2. Outline of the apparatus

The apparatus is illustrated in fig. 1. A ~r- beam was incident on the target at the centre of the polarizing coil. Outgoing tracks were observed in two optical spark chambers with a total of 18 gaps viewed by six

016%5087/84/$03.00 © Elsevier Science Publishers B.V. (North-Holland Physics Publishiag Division)

Page 2: Track and vertex fitting in an inhomogeneous magnetic field

310 J.C. Hart, D.H. S a x o n / Track and vertexfitting

LEAO OXIDE VtOICON . ~

OUTLINE OF CAMERA ROOM

\ \ toP VIEW MIRROR

\

\ _ 12 METRE AND 2,25 METRE - ~ . OPTICAL SPARS CHAMOERK % ~ ' ~ " TIME OF FLIGHT

, OODOSCORE

I METRE MULTI WIRE PROPORTIONAL COUNTER

)5 METRE MAGNETOSTR~TIVE SPARS CHAMBERS

? ,

~' ~ i MAGNET LOW MASS MADNETOSTR~TIVE 1 VETO COUNTER SPARK CHAMBERS

HALO COUNTER

OOWNSTREAM HOOOSCOPE

Fig. 1. Overall view of the PT55 experiment apparatus.

lead-oxide vidicon cameras giving a positional resolution of - 0.6 mm. Fig. 2 shows these chambers in more detail. The first had an active area 1 m square with 10 gaps spaced at 1 cm intervals. The second was 2.2 m square with 8 gaps at 3 cm intervals. [They are referred to as the small optical chamber (SOC) and the large optical chamber (LOC) respectively.] Additionally in order to obtain track measurements close to the K ° and A decay vertices, eight planes of magnetostictive readout, low mass, circular spark chambers (LMCs) were placed in the exit cone of the magnet. These each gave one coordinate with a spatial accuracy of 0.6 mm. The momentum of forward going particles was measured in a conventional spectrometer magnet with an integrated field of 0.5 Tm.

The design of the polarizing magnet [4] was dictated by two considerations. First a field of 2.5 T was required parallel to the incident beam and uniform to better than 1 part in 10 4 o v e r the target volume of 32 cm 3. Secondly, a large angular region (cone half-angle 60 °) on the exit side had to be left free of material to permit the escape of particles. As a consequence of these requirements, a large fringe field was produced over the rest of the apparatus, as indicated in fig. 3. Two points should be noticed. Since, the field varied rapidly over the optical chambers, exceeding 1.0 T over much of the volume, and was generally at an angle of less than 20 ° to the particle tracks, momentum measurements were difficult. However the "corkscrewing" of the tracks in the strong central field had to be taken into account in finding the vertex coordinates.

Away from the beam axis the field had a component at right angles to the electric field between the spark chamber planes and therefore gave rise to the need for the E × B correction. The electric field was a combination of the fixed clearing field of 50-100 V / c m , imposed to sweep away ions from old tracks, and

Page 3: Track and vertex fitting in an inhomogeneous magnetic field

J.C. Hart, D.H. Saxon / Track and vertex fitting 311

Time of flight /'-7 counter-~.//

Optical spark I I chambers\, J/

Remote- readout sp c hambers

1ram pitch ( ~

Ta

Solenoid / cryostat Veto counter

2ram pitch MWPC$

r t ~ c t rometer

F]

Fig. 2. Schematic cross-section of the main features of the detection system. A typical event, with the magnetic field off, is shown superimposed.

of the rising edge of the high voltage pulse prior to spark formation. These were applied in opposite directions to minimise the E x B displacement.

3. Displacements of sparks due to crossed electric and magnetic fields

In any spark chamber there is a delay between the deposition of ionisation by the passage of a particle and the striking of the spark, because of the need to form a trigger (300 ns in this experiment). During this time the ions move under the influence of the E and B fields in which they are situated.

The E × B displacements may be modelled as follows. The motion of an ion drift is given by

e(E+vxB)-eS(v )v=O,

where eS(v) represents a "viscous" drag on the ion by the gas. The solution is

v= (82E+(E'B)B + 8E × B ) / [ 8 ( 8 2 + B2)].

In neon gas, as used in these spark chambers, 8 is independent of Ivl for field of the magnitude of the clearing fields [5]. This is certainly not a valid approximation during the time that an EHT pulse voltage is rising on the chamber. Nevertheless we make the approximation that 8 is a constant in an individual chamber, but can differ between chambers with different EHT pulse characteristics. (8 has the dimensions of a magnetic field.) We set

do = - ~ - ' f e d t .

Page 4: Track and vertex fitting in an inhomogeneous magnetic field

312 J.C. Hart, D.H. Saxon / Track and vertex fitting

/

TOFD

\

- _~

~ o ~ /

/

J

f J

f J

\ \

Fig. 3. The magnetic field configuration. Magnetic field lines are shown superimposed on a cross-section of the magnet, low-mass chambers (LMCs), small optical chamber (SOC), large optical chamber (LOC), time of flight detector (TOFD) and multi-wire proportional chamber (MWPC). The field is 2.5 T at the magnet centre.

Then the displacement vector D is given by

O = - [82a0 + ( n . d o ) n + 8d o x n ] / ( 8 2 + B2).

For our apparatus we take advantage of the axial symmetry of the magnet. Choosing cylindrical polar co-ordinates with z-axis along the symmetry line, noting that E has z-components only, and setting

do~ = Zo, we find

19, = - zoB~B, / (82 + B2), Do = - zoSB , / (82 + B2),

z), = -Zo(82 + B : ) / ( 8 2 + 82) .

The position of the spark is related to the location of the ion trail at a point near the anode of the chamber. In fig. 4a the initial ionisation is along the line AB. The displacement vector D is along the line AC so that

Page 5: Track and vertex fitting in an inhomogeneous magnetic field

J.C. Hart, D.H. S a x o n / Track and vertex fitting 313

\ \

\ \ \

a \\ C ~ CATHODE

~ ,t.D ~ i ' ~ 7 - - ' ~ INITIAL IO N I SAT ' O N

, S P A R K ~ ANODE

BX X \

\

PARTICLE TRAJECTORY

\ \

\ \

\

b \\ A

S P A R K ~ B", \

\ \

CATHODE INITIAL IONISATION

ANODE

PARTICLE TRAJECTORY

Fig. 4. g × B displacements showing the initial ionisation along the particle trajectory, and the spark location for (a) a spark reconstructed in three dimensions, (b) a spark reconstructed in two dimensions.

at spark formation time the ion trail lies along CE. The spark originates from a point, E, on this ion trail close to the anode plane. The program located it at D, the mid-point of the gap. To find a point on the true trajectory one must allow for the ion drift in E, B and also for the fact that the spark ori~nates from a point near to the anode plane on the trail of ionisation. Hence we make a shift, L, along D F = D E - AC.

Setting D E = d, we find

L, = oB B#(8 + = +

L= = d + Zo(8 2 + 2 + B 2 ) .

When B = 0, L , = L o, L~ = d + Zo, the so-called "clearing field" shift. The parameters d, Zo, 8 were obtained empirically. The spark chamber gaps were arranged with electric fields (static and pulsed) reversed in alternative gaps. Straight-track data were taken (B = 0) and these readily yield the combination d + z 0. The other parameters were determined by centring and minimising the residuals to "helix" fits as described in section 4. The results are given in table 1 for the optical chambers. Typical displacements were 2 mm in r, 0 and 3 mm in z giving r, 0 residuals of standard deviation 0.7 mm. Consistent results were found with field on and field off. The above formalism was used directly in the case of a three-dimensional spark.

In the case where only a two-dimensional reconstruction was possible, (always so in the LMCs, occasionally so in the optical chambers as a result of close tracks or confusion), the formalism may easily be adapted, but the direction of the three-dimensional track associated with the measurement ("ray") is needed. In fig. 4b, let D be the measured spark position and AB be the true ionisation trail. From the helix fit to neighbouring gaps the position G on the ionisation at gap-centre is estimated. The displacement L

Page 6: Track and vertex fitting in an inhomogeneous magnetic field

314 J.C. Hart, D.H. Saxon / Track and vertex fitting

Table 1 E x B correct ions in the opt ical chambers . (Hel ix fit r e s idua l s )x ( s ign of z-displacement) in mm.

SOC SOC LOC LOC

uncorrected corrected uncorrected corrected

Radia l componen t

mean

SD Az imutha l componen t

mean

SD

z-shift (B = 0) F i t parameters

d (mm)

z o (mm) 8 (T)

2 . 0 9 0 . 0 1 - 1 . 8 1 0.00

1.40 0.73 1.57 0.75

- 0.53 0.00 - 1.25 - 0.02

0.93 0.62 0.90 0.57

- 1 . 2 - 3 . 2

3.5 4.0

- 4 . 7 - 7 . 4

0.125 0.58

(DF) for the point G is calculated and applied to the point D. We then find the displacement L' (DG) in the x - y plane such that

L" = Lx - L z d x / d z , L'y = L~. - L z d y / d z , L'. = 0,

where d x / d z , d y / d z are the gradients of the track AB. A ray at a given z-coordinate is represented by the pair (s, 8), where the normal to the ray from the

point x = y = 0 is of length s and at angle 8 to the x-axis. The final displacement due to E × B effects is given by

P As = L ' x cos 8 + Ly sin 8.

4. Track propagation through a magnetic field

A track fitting algorithm was required which would allow for extrapolation outside the region of measurement (e.g. to the vertex), form the basis for a vertex fitting procedure and provide a reliable output error matrix. For these reasons, and because of the rapidly varying magnetic field, it was not appropriate to use methods based on quintic splines or parametrization methods [6]. Instead, a method of propagating of the track through the field by numerical integration was used. The propagation and vertex fitting algorithms were based on the work of Myrheim and Bugge [7], but are described fully here since there were some differences in detail.

As our apparatus consisted of a sequence of parallel measuring planes, we required a formalism to propagate a track in steps in the z-direction. Because of the magnet coil we had no interest in tracks that turned back on themselves, and could therefore assume that z increased monotonically along a track. (Even so, care had to be taken as unphysical trajectories could be encountered during iterative fitting.)

With an obvious notation, the motion of a charged particle in a magnetic field is given by

at, =e(vxB). dt c

Then

dt~ - - = X v X B , d/

Page 7: Track and vertex fitting in an inhomogeneous magnetic field

J.C. Hart, D.H. S a x o n / Track and vertex fitting 315

where X = e / ( p c ) and I is the distance along the trajectory. Hence v. d v / d l = 0 and Ivl is a constant of the

motion. Denot ing derivatives with respect to z by primes, and setting

S 2 ~ 1 + x '2 +y,2,

we define

f ( x , y , x ' , y ' , z )=- s [x ' y 'B x - ( 1 + x'Z)By + y'Bz],

g (x , y , x ' , y ' , z ) - s[(1 + y ' Z l B x - x ' y ' B y - x'Bz].

Then

x " = X f ( x , y , x ' , y ' , z ) , y " = X g ( x , y , x ' , y ' , z ) .

For the iterative fit, the following derivatives are also needed together with the equivalent derivatives of g.

- ~ x = S [ x y ~ x - ( 1 + --~-x + y ' ,

of [ aBx x,2)OBy --=SOy x ' y ' - ~ y - ( 1 + ~ + y ' ,

Of = x , s _ l [ x , y , B x _ ( 1 + x,2)Bv + y,Bz] + s ( y , B x _ 2x'By), OX !

Of =y,s_ 1 [x,y ,B x _ (1 + x'2)By + y'Bz] + s ( x 'B x + B~). Oy'

The propagat ion algorithm used follows closely on that of Whit taker [8]. The trajectory is defined by a vector, [10] txio taken at a reference plane, z = z o.

We need to propagate this to the planes atz = z 1, z 2, z 3 • • •, where measurements exist. For the moment , consider propagat ion from z = z. to z = zn+ 1 in a single step of size

h n = zn+ 1 ~ zn"

First we calculate the second derivatives from the equations of motion,

x" = X f ( x n , y , , x'~,y~, z . ) ,

and similarly for y" . We make estimates of x .+ l, Y.+1, x'.+~, Y'+l :

, i , , . 2 ' = x ' . + h . x ' ~ ' . Xn+ 1 = X n " b X n h n " b ~ x n n n , Xn+ 1

tp tt . Then we estimate x .+ l , Y,;+I.

" = T t f ( x . ' ' ), X n + l +l,Yn+l~ X n + l , Y n + l , Z n + l

Page 8: Track and vertex fitting in an inhomogeneous magnetic field

316 J .C Hart, D.H. S a x o n / Track and vertex fitting

! t t t t t and make better estimates of x .+ l , y .+ l , x~÷l, y.÷~, x .+ l , y.+~:

, 1 Ztx,, 2x~), X n + l = x n + x n h n + g h n ~ n + l ~ tt

' ' ' " + X " ) , X n + 1 = X n q - ~h,,(x,,+~ X It ! t n+l =Xf(xn+l,Y.+l, X.+I ,Y.+I , z .+ l ) -

These estimates of x . + 1, Y. + 1 are correct to order h 3. For fitting purposes the derivatives of the vector v.+~ are also required. Let d V.+l be displacements of

the vector v.+ 1 corresponding to the displacements dv 0 in the defining vector %. Then

dv.+ 1 = M . + l . . d v . ,

where M is a 5 × 5 matrix and

dr , = M"'°dv0, M "'° = M"'"-IM "- l ' ' - z " • M 1'°.

We define f ,+l = ½(f, +f~+l) , and g similarly.

M n + l , n

Then

(l +½h2)~of/Ox) (h+½h2)~of/Ox) ½ h 2 ) ~ o f / O y ½h2)~of/Oy ' ½h2f

h)~Of/Ox (1 + h)~Of/Ox ) h)~Of/Oy h)~Of/Oy' hf ½h2)~Og/Ox ½h2)~Og/Ox (1 + ½h2)~Og/Oy) (h + ½h2)~Og/Oy) ½h2g

h)~Og/Ox hXaf/Ox' hXag/Oy (1 + hXOg/Oy) hg 0 0 0 0 1

where the suffices have been suppressed for clarity. When two measurement planes are well separated, an error may be introduced by the coarseness of the

step h, even though calculation is made to order h 3 in position. Studies were made to investigate such errors using the Monte Carlo program of Whittaker [8]. It was found that if a step was subdivided whenever the angle turned through exceeded 5 mrad, then this error was less than 0.5 mm at entry to the LOC for 98.5% of tracks.

In the event reconstruction, the distance between two measurements was divided into steps in z of 10-15 mm (or 30 mm in the large optical chamber) and subdivided further if the angle turned through in 15 mm exceeded 20 mrad. The computer time used dependent critically on the value chosen for this cut. It was verified, however, that the pass rates and discrepancies in Monte Carlo between fitted and generated quantities were fairly insensitive to the value of this cut.

5. Track fitting in the inhomogeneous field

This section describes the fitting of particle trajectories (" helices") through measured points by means of the track propagation algorithm discussed above. Reconstruction of the space points, and trackfinding (i.e. the identification of space points as belonging to a "chain" of points coming from a single particle trajectory) are described elsewhere [3]. It is assumed here that E × B corrections have been applied, and trackfinding performed, although some isolated bad measurements cannot be identified until after track fitting.

In the optical chamber most sparks have been reconstructed as space points (x'f, yi m, z,). In the low-mass chambers, and for some sparks in the optical chambers, only two coordinates are known and the ray formalism (s m, 0,, z~), introduced in section 2.2, is used.

The measured points are ordered in z (z~+ 1 >z , for all i). The helix is then found by iterative minimisation of X 2. As a starting point we take the straight line joining the first and last space points on

Page 9: Track and vertex fitting in an inhomogeneous magnetic field

J.C. Hart, D.H. Saxon / Track and vertex fitting 317

the chain and set the inverse momentum, ~, to zero. In the case where momentum is measured in the downstream spectrometer we use the measured value of X and hold it fixed throughout the fit, since the error on ~ from the spectrometer measurement is - 0.02 GeV -1, whereas the error from the helix fit is of order 0.9 GeV-1.

The helix parameters are given at a z-coordinate, z0, which, for convenience, is chosen to correspond to the most upstream measurement (z 0 = zl). For each iteration the helix vector v and the matrix M (see section 3) are propagated to the z of each measurement.

A X 2 for the goodness of fit is defined by

xE _ y , " x ~ - - x i + Yi - Z + s~ - xs cos Oi - yi s in O ~

"7 • o~i % ] %

where o~, Or,, o~i represent the measurement errors. The sum is to be understood as running over the measurements that exist.

We define a vector g, by

g~ - OX2/~)v, , ,

and for plane i we define X 2 derivatives, A~ and B~, by

1 0X 2 x ~ - x~

Ai ~ 2 Ox i o2i

1 3X 2 y[" - y~

B i = 2 Oy i Oy2i 1- o2i

Then

(s,m - x, cos 0 i - Yi sin 0 i ) - - + COS 0 i, o),

( s m - x i cos 6 i - y , sin 6i) sin 9 i.

go= - 2 E A , M / ° + B,M; ° i

The 2nd derivative matrix, G, is given by

02X 2 GaB - avoOv~

We make the approximation of linearity in the expansion of G ~ , i.e. we ignore terms in OExJOv~Ov~ and 02yi/Ov~Ov/s. This is further justified :as the coefficients of these terms, A~ and Bi, are on average zero in the neighbourhood of the solution. We obtain

G,,a = 2E/a,c'o~,A/o 3,,,.3a~Oy i + 0.72 _ . , , ,_ . ,B(o;2 +0,72 c0s28,) + M , O , . i o l -2 sin28i) i

[ ,~,o a.,o ~L,t*o ;~t,o) ~ 2 cos O, sin 0,].

This expression for the second derivative matrix may be used to minimise X 2 by Newton's method. Expansion of X 2 in terms of the helix parameters v about the current solution v N (Nth iteration) gives

X2(V) = X2N + g" (V-- V N) + I ( V - - oN)TG(~)-- vN).

From this equation we obtain an improved set of helix parameters,

v U * l = v u _ C - l g .

At this new approximation to the minimum, the value of X 2 is predicted to be

X2+, = X 2 - l g r G - l g '

Page 10: Track and vertex fitting in an inhomogeneous magnetic field

318 J.C Hart, D.H. Saxon / Track and vertex fitting

and the error matrix on the parameters v, is 2 G - 1 This procedure is repeated until convergence is obtained or a limit of 6 iterations is reached. The convergence criterion is chosen as

(X2N - X~C_I)/(XZN_1 + NDF) < 0.03,

( X 2 + 1 - - X ~ ) / ( X 2 N + NDF) < 0.01,

after iteration N. In the second case step N + 1 is taken and the procedure terminated, but without the need for track propagation and the consequent expenditure of computer time. If the limit of six iterations is reached without convergence, the fit is accepted provided that X62/NDF < 2.0, where N D F is the number of degrees of freedom. (Typically N D F - 25.)

If X 2 increases significantly after any step of the iteration (other than the first) the step is replaced by one with half the step length. The step length is also cut if it exceeds a certain size, either 12.0 GeV-1 in X, or 12.0 in x ' and y' . This action avoids the singularity associated with tracks at 90 ° to the z-axis. After a step cut due an increase in X 2, the number of allowed iterations is raised by two.

In our analysis the average number of steps taken before convergence was 1.44 and the pass rate 99.8% for Monte Carlo tracks (including the effects of decay) and 94.6% for real data, including the effects of bad measurements.

If after fitting, the X 2 confidence level is very low (below 0.03%) a search is made for bad points. Although the worst fitted point is not necessarily the worst measured point, studies showed that there is a strong correlation. Points are therefore ranked according to their contribution to the final X 2. For each of the worst few points a new fit is made without that point, and the point whose deletion gives the best fit rejected. This process may be repeated several times. Deletion of one point often produced a dramatic reduction in X 2 (up to 1000 for 25 degrees of freedom) which shows that the track fit is very sensitive to errors in track recognition and point reconstruction. Studies indicated that the rejected point was the worst fitted point 90% and next worse 8% of the time. In practice, therefore, the search was made only over the two worst-fitted points at each stage of deletion.

If the final value of x 2 / N D F exceeds 2, the error on the measured points are inflated by a factor [ X 2 / ( N D F - 1)] 1/2 before vertex fitting.

After tracks had been fitted to the points in the optical chambers, the helices were extrapolated upstream into the LMC chambers, and LMC points associated with them. Details are given elsewhere [9].

6. Vertex finding and fittinl~

Vertex making proceeds in two stages. The first stage is the identification of candidate vees and the second stage is vertex fitting.

To find candidate vees all pairs of helices are examined. The vertex must lie in the z interval between the most upstream spark on the helices and the ~veto counter (see fig. 2). Fitted helices are therefore extrapolated upstream from the first measured point in the optical chamber to a point 2 cm upstream of the veto counter in steps of 1.5 cm, using the methods described in section 4. At each point the separation, d, of the two helices is calculated and the lowest value found. A parabolic fit is made to d as a function of z to estimate the distance of closest approach, dmin, and the corresponding z-coordinate. If this is upstream of the last search point, which is often the case for false vees, dmi n is set to the value of d at this point. The distribution of dmi n for Monte Carlo events with measuring error, multiple scattering,and decay, is shown in fig. 5. We make a cut at d~ni . < 60 mm, and for a two vee event we demand also that at least one dm~ . be below 25 mm. The results of this fit provide a starting point for vertex fitting. LMC measurements upstream of the point of closest approach (or within 2.5 cm downstream) are rejected as spurious.

The procedure used for vertex fitting is similar to that used for track fitting, except that two tracks are involved, and the vertex z-coordinate is a variable of the fit.

Page 11: Track and vertex fitting in an inhomogeneous magnetic field

J.C. Hart, D.H. Saxon / Track and vertex fitting 319

50

50

b FALSE VERTICES

n n ~ n 6 0

i i 0 60

dmin (ram)

Fig. 5. Distribution of the distance, dmin, of closest approach of helices for (a) true, (b) false vertices for Monte Carlo K°A events including the effects of measurement error, multiple scattering, and decay. (Same number of events contributing to the two distributions.)

By analogy with track fitting, we define a two-prong vertex vector

i / =

U 1

U 2 U 3

U 4

//5

//6

U 7

U8

_U 9

X Y Z x l I

'1 X2 }

.X'

vertex pos i t ion

t rack I at vertex

t rack 2 at vertex

Let the index a denote the track number (a = 1, 2) and the index i denote a measuring plane. As for track fitting, we define

a i - x a i "] l) 1

ai x tai 02

19ai .~_ U3 at = ya i

O~i y ,a i

al )ka _ U 5 _

I t is impor t an t to clar i fy our nota t ion . Let the suffix /~ (or 1,) denote an e lement of the vertex vector u (# = 1, 9). Let ct (or r ) denote an e lement of the t rack vector v ~i ( a = 1, 5 see below). Then there is a

Page 12: Track and vertex fitting in an inhomogeneous magnetic field

320 J.C. Hart, D.H. Saxon / Track and vertex fitting

cor respondence between the physical quant i t ies and these indices as follows:

Quantity p, (or v) a (or r ) track index, a

x o 1 1 1, 2 yo 2 3 1,2 z o 3 6 1, 2 x '1 4 2 1 ya 5 4 1 ~ 6 5 1

,2 7 2 2 x y,2 8 4 2 ~2 9 5 2

We also define, for each z~ and each track, a 5 × 6 mat r ix of derivatives, N ~, which has the pa r t i t ioned

form

N~i [ M ' O ! ~ v ~` = / : ~Zo ]"

We define X 2 as for helix fitting, summed over the two tracks. Let the first and second derivat ive matr ices with respect to the vertex pa ramete r s be g and G. Again, ei ther inverse momen tum, M, may be half f ixed if

measured in the spec t rometer magnet . To evaluate these terms, each t rack is p ropaga t ed f rom the vertex point , z = z 0, to the measurement

p lanes as before. This gives the t rack vectors, v% at each z~ and hence the X 2. The matr ix M ~'~-1 is then calculated, and hence M ~°, which forms the first five columns of N % To find

the sixth co lumn of N ~, we follow the me thod of Myrhe im and Bugge [7]. F o r small A, the t rack specified

by

X p y ' at z, is ident ical to

x - - x ' A ] x ' -- x " A [

y ' -- y " A I a t z + A .

This leads to the relat ion

x f u h N ~ - ,a ai ,, ai t a a i a ai -- X oNe1 - - y oNe3 - )kgN~4.

The coefficients, f o and g~, are evaluated at the vertex coordinate , z = z o. In par t icu la r N~6' = 0. Let the X 2 derivat ives at each p lane by A,~ and B, , as for helix fitting.

Then

g = - 2 ~ _ , A N ~ ' + B N ~ a i lot al 3or,

a , i

and

o, a, -2 2 -2 . , o , . , a , i - 2 + s i n % o ~ ) Gu = 2 ~_, [ N l ~ N ~ ( Oxa i + c o s Oaiosa i ) + ~V~MV3~1%ai a , i

o , o , o , o , + (N, oN~e + N;.N;B) sin 0o, cos

where the cor respondence be tween the values of ~, v and a , /3 , a is as given above. A n i terat ive fit is fo rmed as for t rack fitting. The s tar t ing po in t for the vertex coord ina tes (x 0, Y0, z0) is de te rmined from vertex finding, and the s tar t ing poin ts for ~, x ' , y ' for each t rack are taken f rom the helix fits p ropa ga t e d to

Page 13: Track and vertex fitting in an inhomogeneous magnetic field

7-

! !

! !

! I

I |

7~

I

q !

s s

- -

w

x G

4-

:3

x 3

4-

x I

I

2 x

xx

x

x

p.+

(~

ii |

• @

" I

i ~c

IIK

x x

~i

a b

".

; I,

,- -

I l

! I

: ;

"7-

--

I I

I !

t I

: :

7~

1

e 1

2 3

4 S

6 1

e I

a 3

4 ~;

G

I I

I I

I !

I O

N m

o

4'~

" X

x

N

M

K

x x

x~

mt

~x

x

x al

!Io :

l I

I l

I 1

0 I

I 3

4 S

G

Fig

. 6.

Dis

play

s o

f re

cons

truc

ted

even

ts s

ho

win

g d

igit

isin

gs a

nd

rec

on

stru

cted

vee

s. (

a) a

nd

(b)

are

tw

o v

iew

s o

f th

e sa

me

dat

a ev

ent.

(c)

an

d (

d) a

re t

wo

vie

ws

of

the

sam

e M

on

te

Car

lo e

vent

. T

he g

ener

ated

tra

ck d

irec

tion

s ar

e sh

ow

n h

ere

as l

ong

stra

ight

lin

es.

Das

hed

lin

es i

ndic

ate

neu

tral

tra

cks.

Th

e ta

rget

is

indi

cate

d b

y a

box

, an

d t

he s

cale

s ar

e m

ark

ed i

n

un

its

of

10 c

m.

~t

.4

-x.

0~

Page 14: Track and vertex fitting in an inhomogeneous magnetic field

322 J.C. Hart, D.H. Saxon / Track and vertex fitting

z = z 0. Step cutt ing is performed if necessary as in helix fitting, In addition, if a step in z of more than 200 m m is taken, the fit is immediately rejected.

Fig. 6 shows reconstructed vees in data and Monte Carlo events. The beam enters from the left in each case. (a) and (b) are two views of the same data event. Reconstructed digit±sings are shown as ( + ) in the low-mass chambers and ( x ) in the optical chambers if l inked into tracks or ( + ) if not linked, The fitted decay vertex is shown as a small vee. In fig. 6b one notices a large rotat ion of one track around the field, away from its fitted direction. Two tracks lie very close together in this view. Figs. 6c and d are two views

of the same Monte Carlo event showing in addi t ion the generated track vectors at the decay vertex as long straight lines. In fig. 6d the fitted vees are indist inguishable from the generated ones.

A measure of the goodness of fit is given by

A X 2 = X2(vertex) - X~ - X 2 ,

which is the addit ional X 2 due to the vertex constraint on the two helix fits. (Care must be taken in interpret ing this if helix errors have been inflated.) We find excellent confidence level dis tr ibut ions for AX2

for both Monte Carlo and real data, with means 0.46 and 0.42 respectively, even without allowance for the effect of false vees. The number of steps taken in fitting is less than 3 on average.

The pass rates, which reflect the physical input and the dm~ . cut, are 97% and 84% respectively, the lower figure for data indicat ing con tamina t ion from spurious triggers.

7. Checks on the method

The vertex fits are required as input to kinematic fits for the reaction

~r-p ~ K ° + A

L~r+Tr L ~ r p

All the measurement and magnetic field informat ion is t ransmit ted via the vertex fits and their error

matrices. It is therefore necessary to check that the vertex fits find the correct solut ion reliably and

efficiently, that the error matrices produced represent accurately the X<space in the ne ighbourhood of the correct solution, and that the values of X 2 are reasonable in the presence of mult iple scattering. Since vertex

fitting involves extrapolat ion from measured points, substantial correlations between posi t ion and angle variables are expected.

The routines were developed with the aid of Monte carlo events where the " t rue" solutions were known. We show in table 2 the discrepancies between generated and fitted values, normalised by the error on the

Table 2 Discrepancies between Monte Carlo generated and fitted quantities, in units of the quoted error.

Perfect Measuring errors Scattering, decay, input and inefficiencies meas. err., ±neff. mean _+ SD mean _+ SD mean ± SD

Helix X: ~r + 0.00 + 0.09 0.00 + 0.96 - 0.07 ± 1.21 ~r- from K 0.00+0.04 -0.01 _+0.97 -0.01 + 1.05 p 0.00 ± 0.03 - 0.03 ± 0.96 0.10 _+ 0.82 ~r- from A 0.00 +_ 0.05 0.00 + 1.00 0.20 ± 1.87

Vertex: x, y 0.00 + 0.02 0.02 -+ 1.00 - 0.01 + 1.85 z - 0.01 + 0.02 0.02 _+ 1.01 0.00 _+ 1.96 x', y' 0.00 ± 0.02 0.00 ± 1.04 0.01 _+ 1.81

0.01 _+ 0.02 0.07 ± 0.92 0.08 ± 1.58

Page 15: Track and vertex fitting in an inhomogeneous magnetic field

J.C. Hart, D.H. Saxon / Track and oertex fitting 323

50 50C

50 0"///'~ 500 Fig. 7. Scatter plots for Monte Carlo simulated events of the 9-constraint X 2 for the discrepancy between the generated and fitted vertex parameters, plotted against the sum of X 2 for the agreement of the simulated detectors coordinates with the generated trajectories minus the X 2 for the agreement of the simulated detector coordinates with the fitted trajectories.

fitted quantity. These should have Gaussian distributions with mean zero and unit variance. Three data sets are shown: - "Perfect" Monte Carlo events (with no scattering, decay or measurement errors). - Monte Carlo with detector inefficiency and measuring errors only. - "Realis t ic" Monte Carlo with inefficiency, measuring errors, multiple scattering and pion decays.

Inspection of table 2 shows the expected result in the first two cases, both for helix and vee fitting. The agreement in the third case is worse. This is to be expected since the degrading effects of scattering and pion decay were ignored in the fit.

An additional check was obtained by defining a 9-constraint X 2 for the discrepancy between Monte Carlo generated and fitted values for a vertex, using the full error matrix. The mean value of X 2 was 9, as expected f rom the number of degrees of freedom. However, inspection of the 45 terms contr ibuting to this X 2 showed large cancellations, since the fitted values were highly correlated. Such correlations are expected as a result of extrapolating often highly curved tracks through the field to a vertex. Under these circumstances the value of X 2 can exceed 1000 in the presence of multiple scattering. A crucial question than arose. Did the error matrix ellipsoid truly represent the X 2 distribution in the parameter space around the solution out to these high values, or were higher terms, not calculated in this method, important? This was tested by compar ing the 9-C X 2, with the X 2 obtained for the discrepancies between the reconstructed coordinates and the Monte Carlo generated tracks, after subtracting the sum of the X 2 from the two helix fits. If the error matrix is valid the two should agree. Fig. 7 shows scatter plots to verify this agreement over a wide range of X 2. We conclude that the error matrix describes the fit well in the ne ighbourhood of the true solution.

8 . M u l t i p l e s c a t t e r i n g

In order to take account of multiple scattering in subsequent kinematic fitting, two actions were taken. First, the errors on measured points in the optical chamber are increased by adding a term rising linearly f rom zero to 1 m m 2 with z-coordinate. (The quality of helix fit was insufficient to support a momentum-de- pendent term.) Secondly, after vertex fitting, the output error matrix had an "error floor" added to it, which represented scattering in the material upstream of the optical chambers (1.5% radiation length). The form of this error floor was arrived at as follows.

Page 16: Track and vertex fitting in an inhomogeneous magnetic field

324 J .C Hart, D.H. S a x o n / Track and oertex fitting

For a track of momentum ~- 1, which has traversed a distance l from the fitted vertex to the first optical spark chamber gap, the rms scattering angle is

(a0 2) = (0.0asx//3)2(l/t0),

where/3 is the velocity of the particle (pion or proton) and l 0 is the radiation length of the composite medium (gas, glue and wires) in this region.

This gives rise to a position uncertainty

( ax 2) = t2(a0 )/3,

and a correlation term

( a x a O ) = - l ( a 0 2 ) / 2 .

(The negative sign comes from the sense of the extrapolation.) In practice the correlation term was not needed. The vertex position is determined from the intersection of two helices and therefore has additional errors

( a x 2 ) = ( A y 2 ) = ~ l (1 / (AOZ~) + 1/(A02Z)) - ' , and ( a z 2) = 2(Ax2) .

An empirical momentum error (AX 2) = 0.04X 2 was also added. In addition a small error floor ( - 10% of the typical errors) was added to the diagonal terms in the error matrix. Although this affected the errors only slightly, it dramatically reduced the correlations. For events generated with multiple scattering and pion decay, the average 9-C X 2 for the K-vertex fell from 27000 to 41 on addition of this term. The resulting distributions of the 9-C X z for K and A vertices are shown in fig. 8. It was verified that these

25 1_ K VERTEX

L 5O

25 L A VERTEX

L

50 FIT v. MONTE CARLO 9c-X 2

Fig. 8. Distr ibut ion of the 9-constraint X 2 for the same data set as in fig. 7, after al lowing for mult iple scattering. The ~ - and p from

the A-decay have lower velocities than the particles from the K-decay.

Page 17: Track and vertex fitting in an inhomogeneous magnetic field

J.C. Hart, D.H. Saxon / Track and vertex fitting 325

w

1] 01/p (GeVIc)'I

i , ~ J lip .L_--__ I

5

VERTEX FITS TO DATA

~ G e n l t C ) ~ n ~ .

5 Io

100

. 0 ,

i i i t J i i i 0 /

2 2

Fig. 9. Distributions of 1 / p ( = ~), and of the error on 1 / p , x' , y' , x, y, z from vertex fits to data, for events with ~,- p --, K°A kinematic fits. 1 / p is shown negative if the kinematic fit has reversed the charge of the track.

corrections were of the correct magni tude insofar as no significant improvement in the 9-C X 2 w a s obtained by increasing them further.

Fig. 9 shows the distributions of ~,, and of the errors on fitted parameters, for vertex fits to data at 2000 M e V / c , Events with ~r-p ~ K°A kinematic fits were selected. )~ is shown negative if the kinematic fit reversed the sign of the charge.

The median errors were as follows:

Quant i ty )k x , y x ' , y ' z;

M e d i a n o 0.9 ( G e V / c ) - l 1 . 6 m m 0.026 2.3 mm.

Helix fit errors were similar for )~, but smaller for x, y, x ' and y ' since no extrapolat ion was involved.

9. Final comments

The methods described above have been used successfully in an experiment to observe the reaction ,r-p--- , K°A, where bo th K ° and A decays took place in a region of high and very inhomogeneous magnetic field [1]. Events were kinematically fitted, using the vertex fits and error matrices as input, and gave a X 2 distribution which peaked around the number of degrees of freedom. (There were nine constraints in all for a fit with both kinematic and geometric constraints.) A total of about two million triggers were processed, and a sample of events fitting the hypothesis , r - p ---, K°A, with an interaction on a free pro ton in the propanediol (C3HsO2) target, was isolated.

The need to minimise computer time was an impor tant consideration. For data, the time used depended crucially on the background fraction. Processing of Monte Carlo events with four tracks, and an average of 28 measurements per track, took 510 m s / e v e n t on an IBM 360/195 when all calculations were performed

Page 18: Track and vertex fitting in an inhomogeneous magnetic field

326 J.C. Hart, D.H. Saxon / Track and vertex fitting

in d o u b l e prec is ion . T h e ver tex f ind ing p r o c e d u r e r e d u c e d the n u m b e r o f ver t ices to be f i t ted f rom 6 to an

ave rage of 2.8 per event .

References

[1] K.W. Bell et al., Nucl. Phys B222 (1983) 389. [2] R.D. Baker et al., Nucl Phys B141 (1978) 29;

D.H. Saxon et al., Nucl Phys B162 (1980) 522. [3] R. Maybury and H.M. Daley, Rutherford Reports RL-82-085, RL-82-087 (1983). [4] M. Ball et al., Proc. 5th Int. Conf. on Magnet technology, Rome, eds., N. Sacchetti et al., (1975) p. 606. [5] See, for example: I. Lehraus et al., Nucl. Instr. and Meth. 200 (1982) 199. [6] H. Eichinger and M. Regler, CERN 81-06 (1981). [7] J. Myrheim and L. Bugge, Nucl. Instr. and Meth. 160 (1979) 43. [8] J.B. Whittaker, Rutherford Report RL-80-101 (1981). [9] H.M. Daley, Rutherford Report RL-82-086 (1983).