File GaussianGridTrackDensity.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

template<int mainGridSize = 2000, int trkGridSize = 15>
class GaussianGridTrackDensity
#include <Acts/Vertexing/GaussianGridTrackDensity.hpp>

Implements a 1-dim density grid to be filled with track Gaussian distributions.

Each single track is modelled as a 2(!)-dim Gaussian distribution grid in the d0-z0 plane, but only the overlap with the z-axis (i.e. a 1-dim density vector) needs to be calculated. The position of the highest track density (of either a single bin or the sum of a certain region) can be determined. Single tracks can be cached and removed from the overall density.

Template Parameters
  • mainGridSize – The size of the z-axis 1-dim main density grid

  • trkGridSize – The 2(!)-dim grid size of a single track, i.e. a single track is modelled as a (trkGridSize x trkGridSize) grid in the d0-z0 plane. Note: trkGridSize has to be an odd value.

Public Types

using MainGridVector = Eigen::Matrix<float, mainGridSize, 1>
using TrackGridVector = Eigen::Matrix<float, trkGridSize, 1>

Public Functions

inline GaussianGridTrackDensity(const Config &cfg)
std::pair<int, TrackGridVector> addTrack(const BoundTrackParameters &trk, MainGridVector &mainGrid) const

Adds a single track to the overall grid density.

Parameters
  • trk – The track to be added

  • mainGrid – The main 1-dim density grid along the z-axis

Returns

A pair storing information about the z-bin position the track was added (int) and the 1-dim density contribution of the track itself

Result<float> getMaxZPosition(MainGridVector &mainGrid) const

Returns the z position of maximum track density.

Parameters

mainGrid – The main 1-dim density grid along the z-axis

Returns

The z position of maximum track density

Result<std::pair<float, float>> getMaxZPositionAndWidth(MainGridVector &mainGrid) const

Returns the z position of maximum track density and the estimated width.

Parameters

mainGrid – The main 1-dim density grid along the z-axis

Returns

The z position of maximum track density and width

void removeTrackGridFromMainGrid(int zBin, const TrackGridVector &trkGrid, MainGridVector &mainGrid) const

Removes a track from the overall grid density.

Parameters
  • zBin – The center z-bin position the track needs to be removed from

  • trkGrid – The 1-dim density contribution of the track

  • mainGrid – The main 1-dim density grid along the z-axis

Private Functions

void addTrackGridToMainGrid(int zBin, const TrackGridVector &trkGrid, MainGridVector &mainGrid) const

Helper function that actually adds the track to the main density grid.

Parameters
  • zBin – The center z-bin position the track

  • trkGrid – The 1-dim density contribution of the track

  • mainGrid – The main 1-dim density grid along the z-axis

TrackGridVector createTrackGrid(float d0, float distCtrZ, const Acts::SquareMatrix2 &cov) const

Function that creates a 1-dim track grid (i.e.

a vector) with the correct density contribution of a track along the z-axis

Parameters
  • d0 – Transverse impact parameter

  • distCtrZ – The distance in z0 from the track position to its bin center in the 2-dim grid

  • cov – The track covariance matrix

Result<float> estimateSeedWidth(MainGridVector &mainGrid, float maxZ) const

Function that estimates the seed width based on the FWHM of the maximum density peak.

Note

This only works if the maximum is sufficiently isolated since overlapping neighboring peaks might lead to an overestimation of the seed width.

Parameters
  • mainGrid – The main 1-dim density grid along the z-axis

  • maxZ – z-position of the maximum density value

Returns

The width

double getDensitySum(const MainGridVector &mainGrid, int pos) const

Calculates the density sum of a z-bin and its two neighboring bins as needed for ‘getHighestSumZPosition’.

Parameters
  • mainGrid – The main 1-dim density grid along the z-axis

  • pos – The center z-bin position

Returns

The sum

int getHighestSumZPosition(MainGridVector &mainGrid) const

Checks the (up to) first three density maxima (only those that have a maximum relative deviation of ‘relativeDensityDev’ from the main maximum) and take the z-bin of the maximum with the highest surrounding density.

Parameters

mainGrid – The main 1-dim density grid along the z-axis

Returns

The z-bin position

void modifyMainGridWithTrackGrid(int zBin, const TrackGridVector &trkGrid, MainGridVector &mainGrid, int modifyModeSign) const

Helper function that modifies the main density grid (either adds or removes a track)

Parameters
  • zBin – The center z-bin position the track

  • trkGrid – The 1-dim density contribution of the track

  • mainGrid – The main 1-dim density grid along the z-axis

  • modifyModeSign – Sign that determines the mode of modification, +1 for adding a track, -1 for removing a track

float normal2D(float d, float z, const SquareMatrix2 &cov) const

Helper to retrieve values according to a 2-dim normal distribution.

Note

This function is defined in coordinate system centered around d0 and z0

Private Members

Config m_cfg
struct Config
#include <Acts/Vertexing/GaussianGridTrackDensity.hpp>

The configuration struct.

Public Functions

inline Config(float zMinMax_ = 100)

Note

The value of zMinMax_ together with mainGridSize determines the overall bin size to be used as seen below

Parameters

zMinMax_ – The minimum and maximum z-values (in mm) that should be covered by the main 1-dim density grid along the z-axis

Public Members

float binSize
float maxRelativeDensityDev = 0.01
bool useHighestSumZPosition = false
float zMinMax