# The Gaussian-Sum filter

Complete:

Contents:

## Overview

The Gaussian-Sum filter (GSF) is a fitter which is able to take non-Gaussian distributions of measurement errors better into account than a standard Kalman filter. A detailed description has been published in Computer Physics Communications, 174, 935 (2006). In this method, the distributions of the errors of both the measurements (the track parameters in the case of vertex reconstruction) and the estimated quantities are modelled by mixtures of multi-variate Gaussians probability density functions. The main component of the mixtures describes the core of the distributions, and the tails are described by one or several additional Gaussians.

The fitter is implemented in the package RecoVertex/GaussianSumVertexFit

The GSF requires that the distributions of the errors of the track parameters be modelled by mixtures of Gaussians, and this is at present only the case for electrons reconstructed with the track-reconstruction GSF. The persistent multi-component tracks are of type reco::GsfTracks. The TransientTracks which are then needed for the vertex fitter, is built using the TransientTrackBuilder in exactly the same way as for regular tracks.

## Usage

An easy way to use the GSF is through the GsfVertexFitter. It automatically instantiates a SequentialVertexFitter with all the classes required, without the user having to specify anything except the PSet with the parameters to steer the fitter. As it is a VertexFitter, it is then to be used as such. Example:

```GsfVertexFitter fitter(pSet);
TransientVertex myVertex = fitter.vertex(vectorOfRecTracks);=
```

## Parameters

The PSet needed for the configuration has the following structure

```GSFParameters = cms.PSet(
maxDistance = cms.double(0.01),
maxNbrOfIterations = cms.int32(10),
limitComponents = cms.bool(True),
smoothTracks = cms.bool(True),
GsfMergerParameters = cms.PSet(
maxNbrComponents= cms.int32(4),
merger = cms.string("CloseComponentsMerger"),
distance = cms.string("KullbackLeiblerDistance")
)
)
```

The parameters are the following:

Parameter Name Description Default
maxDistance Convergence criterion (maximum transverse distance between vertex computed in the previous and the current iterations) 0.01
maxNbrOfIterations Maximum number of iterations to perform 10
smoothTracks Specifies whether the tracks have to be smoothed at the end of the fit false
limitComponents Specifies whether the number of components has to be limited to a maximum number during the fit. true
maxNbrComponents Maximum number of components to keep 4
merger Strategy used to limit the number of components CloseComponentsMerger
distance Distance measurement between components KullbackLeiblerDistance

## Limitation of the number of components

It has to be kept in mind that without limitation of the number of components during the fit, these will increase exponentially, and the computing time will increase likewise! The merger indicated is the most useful. The other implemented merger is the LargestWeightsStateMerger. Little difference in performance is seen between the two distance measurements implemented, the KullbackLeiblerDistance and the MahalanobisDistance.

## Vertex validity and exceptions

The vertex returned may not be valid in some cases. An invalid vertex is returned when the maximum number of iterations is exceeded or the fitted position is out of the tracker bounds. An error message is printed in the log, which for the two above-mentionned cases is:

```       The maximum number of steps has been exceeded. Returned vertex is invalid.
Fitted position is out of tracker bounds. Returned vertex is invalid.
```
and the user had to check the validity of the vertex with the method `isValid()`.

It may also happen that one of the tracks is very far from the other tracks, or of very bad quality. It may then happen that the weights of all the components is 0. An exception is thrown in this case. It may then be better to use the AdaptiveGsfVertexFitter, which should be able to downweigh the outlying track.