File AdaptiveGridTrackDensity.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

template<int trkGridSize = 15>
class AdaptiveGridTrackDensity
#include <Acts/Vertexing/AdaptiveGridTrackDensity.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. Unlike the GaussianGridTrackDensity, the overall density vector grows adaptively with the tracks densities being added to the grid.

Template Parameters

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 TrackGridVector = Eigen::Matrix<float, trkGridSize, 1>

Public Functions

inline AdaptiveGridTrackDensity(const Config &cfg)
std::pair<int, TrackGridVector> addTrack(const BoundTrackParameters &trk, std::vector<float> &mainGridDensity, std::vector<int> &mainGridZValues) const

Adds a single track to the overall grid density.

Parameters
  • trk – The track to be added

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

  • mainGridZValues – The corresponding z-bin values of the track densities 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(std::vector<float> &mainGridDensity, const std::vector<int> &mainGridZValues) const

Returns the z position of maximum track density.

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

  • mainGridZValues – The corresponding z-bin values of the track densities along the z-axis

Returns

The z position of maximum track density

Result<std::pair<float, float>> getMaxZPositionAndWidth(std::vector<float> &mainGridDensity, const std::vector<int> &mainGridZValues) const

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

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

  • mainGridZValues – The corresponding z-bin values of the track densities along the z-axis

Returns

The z position of maximum track density and width

void removeTrackGridFromMainGrid(int zBin, const TrackGridVector &trkGrid, std::vector<float> &mainGridDensity, const std::vector<int> &mainGridZValues) 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

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

  • mainGridZValues – The corresponding z-bin values of the track densities along the z-axis

Private Functions

TrackGridVector createTrackGrid(int offset, const SymMatrix2 &cov, float distCtrD, float distCtrZ) 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
  • offset – Offset in d0 direction, to account for the 2-dim part of the Gaussian track distribution

  • cov – The track covariance matrix

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

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

Result<float> estimateSeedWidth(const std::vector<float> &mainGridDensity, const std::vector<int> &mainGridZValues, float maxZ) const

Function that estimates the seed width based on the full width at half maximum (FWHM) of the maximum density peak.

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

  • mainGridZValues – The corresponding z-bin values of the track densities along the z-axis

  • maxZ – z-position of the maximum density value

Returns

The width

double getDensitySum(const std::vector<float> &mainGridDensity, const std::vector<int> &mainGridZValues, unsigned int pos) const

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

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

  • mainGridZValues – The corresponding z-bin values of the track densities along the z-axis

  • pos – The center z-bin positon

Returns

The sum

int getHighestSumZPosition(std::vector<float> &mainGridDensity, const std::vector<int> &mainGridZValues) 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
  • mainGridDensity – The main 1-dim density grid along the z-axis

  • mainGridZValues – The corresponding z-bin values of the track densities along the z-axis

Returns

The z-bin position

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

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

Private Members

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

The configuration struct.

Public Functions

inline Config(float binSize_ = 0.1)
Parameters

binSize_ – The binSize in mm

Public Members

float binSize
float maxRelativeDensityDev = 0.01
bool useHighestSumZPosition = false