• Keine Ergebnisse gefunden

The conventional Kalman filter method

3.3 Software tools for parallel programming

4.1.1 The conventional Kalman filter method

As a result of track finding the detector measurements are grouped into sets of hits which, ideally, were produced by a specific particle. The task of track fitting is to estimate track parameters and their errors in order to get kinematical properties of particles, which will later allow for reconstruction of short-lived particles, and, finally, for the physics analysis.

Usually track fitting algorithm exploits the so-called track model, which is a theoretical assumption on the equation of motion for charged particles in the volume of a tracking detector. Several effects have an influence on the particle motion, which the track model cannot take into account in a simple way, namely multiple scattering, ionization and radiative energy loss. These effects add per-turbations and affect the reconstruction of the particle kinematical properties.

Their influence on the obtained fitted parameters can be correctly taken into ac-count with a proper track fitting method. The most common algorithm in HEP nowadays, used for track fitting, is the Kalman filter method [77, 78, 79, 80].

In principle the track parameters can be derived from the hit measurements by applying the least squares fit. However, in real life cases it is preferable to use the Kalman filter method, since its recursive nature allows for a computationally simpler and numerically optimized implementation. Namely, the method in its calculations needs to operate with matrices, whose dimension equals to the num-ber of fitted parameters, while the least squares fit operates with a matrix with the dimensionality of the number of measurements in the track.

The Kalman filter method has found a wide range of applications thanks to its features, namely:

• an optimal estimate (unbiased with minimal dispersion) as a result of the fitting procedure,

• its recursive nature, which allows to perform the fitting of a partially re-constructed track during track finding,

• does not need a global track model valid for the entire track length, but a local track model valid only between consecutive measurements.

Let us consider a dynamic system, whose evolution in time is fully described with a state vector rt, consisting of several system parameters. The fitting pro-cedure is supposed to provide as a result an estimate of the state vectorrt based on a set of measurements. The Kalman filter method obtains an optimal es-timate r of the state vector rt based on the measurements of this state vector mk, k = 1. . . n, which may be contaminated with noise. The method starts with an initial approximation r = r0 and improves this estimate in a recursive way, consistently taking into account each measurement, providing as a result the optimal estimate after adding the last measurement.

The estimated state vectorrtcan change from one measurement to the other.

For example, usually measurements are taken at different time and space points.

Therefore before adding the information of k-th measurement to the estimate, the evaluation of the system by this time has to be taken into account. So that the estimate and state vector correspond to the same moment. The estimate r has always some finite precision — the errorξ, defined as the difference between the estimate and the actual value of the estimated state vector. In order to keep the track of the error ξ, let us introduce a covariance matrix as follows:

r =rt+ξ, (4.1a)

C =hξ·ξTi. (4.1b)

The method assumes a linear model of measurements, which means that the state vector should linearly depend on the measured parameters. Thus:

mk =Hkrtkk, (4.2)

where Hk is called measurement model and ηk is an error of the k-th measure-ment.

The Kalman filter method assumes that the error of the measurement and the process noise are unbiased and uncorrelated not only mutually, but also in time (white noise) and their covariance matricesVk and Qk are known:

k >=<ξk > = 0,

k·ηTk > = Vk,

k·ξTk > = Qk.

The conventional Kalman filter method is derived for a linear dynamical sys-tem, which means that the evolution of the system between two consecutive measurements mk−1 and mk is described by a linear equation:

rtk = Fk1rtk−1k, (4.3) whereFk1is a linear propagation operator, which relates the state at step (k−1) to the state at step k, νk is a random process noise between the measurements mk−1 andmk, which cannot be taken into account in the prediction matrixFk−1. The algorithm works in steps: starting with an initial approximation of the state vector and the covariance matrix (initialization stage) it estimates the sys-tem state at the point of the measurement (propagation stage) and corrects this estimate and updates the covariance matrix, taking into account the measure-ment with a certain weight (filtration stage). The algorithm performs in a loop the propagation and the filtration stages until the last measurement is added.

Thus, the equations of Kalman filter fall into 3 groups: initialization, prediction and filtration, as it is shown in Fig. 4.2. Let us consider specific equations for each of the stages.

Initialization: The algorithm starts with initializing the state vector with some initial prediction r0, if one is available, or alternatively with arbitrary val-ues. In this case the covariance matrix reflects low confidence level of the initial estimate r0: C0 =I·inf2, where inf stands for a large number.

Prediction/Propagation: If the state vector is expected to change between two measurements, the estimate and its covariance matrix needs to be changed accordingly. The current estimate of the state vector and the covariance matrix at the measurement mk−1 are propagated to the point of the next measurement, while taking into account the process noise:

rk = Fk1r+k1, (4.4a) Ck= Fk−1Ck+1FkT1+Qk, (4.4b) where r+k1, Ck+1 — the estimate and the error covariance matrix, obtained at the previous measurement,rk,Ck — predicted estimate of the state vector after the influence of the process noise Qk. For the first time the initialization values are propagated, since there are no measurements yet at this point.

Initial approximation r+0, C0+

?

Prediction rk =Fk1r+k1

Ck =Fk1Ck+1FkT1 +Qk

?

Filtering

Kk =CkHkT(Vk+HkCkHkT)1 r+k =rk +Kk(mk−Hkrk) Ck+ = (I−KkHk)·Ck

6

rk, Ck

?

Fitted parameters r+n, Cn+

Process noise Qk

Measurement mk,Hk,Vk

Figure 4.2: The block diagram scheme of the conventional Kalman filter [77].

Filtration/Update: The predicted state vector and the covariance matrix are updated with the information the new measurement brings, in order to get their optimal estimate at this stage. First, correction term — the residual, which is the difference between the estimate and the actual measurement, is calculated:

ζk= mk−Hkrk. (4.5)

The next element of the filtration step is the weight matrixWk, which is calculated as the inverse covariance matrix of the residual:

Wk = (Vk+HkCkHkT)1. (4.6) The weight matrixWkdefines the influence of the k-th measurement in the to-tal χ2-deviation of the obtained estimater+k from the measurementsm1, . . . ,mk:

χ2k= χ2k1Tk ·Wk·ζk. (4.7) The state vector estimate is corrected by a weighted residual:

r+k =rk +Kk·ζk, (4.8) where the weight is defined by the so-called gain matrix Kk:

Kk =CkHkT ·Wk. (4.9)

One notes that since the gain matrix is proportional to the current covariance matrix Ck and weight matrix Wk, the strongest influence on the estimate will have the measurements with higher weights. By contrast, the estimate, which is already precise, and thus, has a small covariance matrix, will not be changed significantly.

At last, the covariance matrix of the estimate is calculated:

Ck+ = (I −KkHk)·Ck. (4.10) The algorithm sequentially repeats the prediction and the filtration steps for each of the n measurements. After filtering the last measurements the vector r+n — the resulting estimate after all the measurements are filtered is the optimal estimate of the state vector rtn with the covariance matrix Cn+.

However, in real life the evolution of a system rtk+1(rtk) and the model of mea-surements mtk(rt) dependencies often cannot be described by a linear function.

Therefore in order to apply the Kalman Filter method in non-linear cases a pro-cedure of linearization has to be performed.

For example, in the case of a non-linear model of measurements the function mk(rtk)≡hk(rtk), the function hk(rtk) needs to be expanded in a Taylor series at the linearization pointrlin:

mk(rtk)≡hk(rtk) +ηk≈hk(rlink ) +Hk(rtk−rlink ) +ηk, (4.11) where Hk is the Jacobian of hk(rk) at rlink :

Hk(ij)= ∂hk(rk)(i)

∂rk(j)

rk=rlink

. (4.12)

In this case the formula to calculate the residual for conventional method (4.5) is changed in the following way:

ζk = mk−(hk(rlink ) +Hk(rk −rlink )).

In the same manner the non-linear extrapolation equation (4.4a) can be lin-earized:

rk ≡ fk(r+k1)≈fk(rlin) +Fk(r+k1−rlink1) (4.13) Fk(ij) = ∂fk(r+k1)(i)

∂r+k−1(j)

r+k−1=rlink−1

. (4.14)

The Kalman filter equations in the case of a system with non-linear evolution or measurement model is called the extended Kalman filter method. The linearized model differs from the original one, therefore the choice of the linearisation point rlin is important. The usual way is to take the current estimator rk as the point of linearization for thek−th measurement.

Unlike its linear version, the extended Kalman filter in a general case is not an optimal estimator. Moreover, if the initial estimate of the state is wrong, or if the

process is modeled incorrectly, the filter may diverge, owing to its linearization.

Having stated this, the extended Kalman filter gives a reasonable performance, and is the standard method for fitting charged particles trajectories in HEP experiments nowadays.