File AdaptiveGridTrackDensity.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

template<int spatialTrkGridSize = 15, int temporalTrkGridSize = 1>
class AdaptiveGridTrackDensity
#include <Acts/Vertexing/AdaptiveGridTrackDensity.hpp>

Implements a 1D (no time seeding) / 2D (time seeding) grid that is filled with track densities.

Each track is modelled by a 2D / 3D Gaussian distribution in the d0-z0 / d0-z0-t0 plane, which is evaluated at d0=0. Therefore, each track effectively lives in 1D / 2D. 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 in the GaussianGridTrackDensity, the overall density map grows adaptively when tracks densities are added to the grid.

Note

In total, a track is represented by a grid of size spatialTrkGridSize * temporalTrkGridSize

Template Parameters
  • spatialTrkGridSize – Number of bins per track in z direction

  • temporalTrkGridSize – Number of bins per track in t direction

Public Types

using Bin = std::pair<int, int>
using DensityMap = std::unordered_map<Bin, float, boost::hash<Bin>>
using ZTPosition = std::pair<float, float>
using ZTPositionAndWidth = std::pair<ZTPosition, float>

Public Functions

inline AdaptiveGridTrackDensity(const Config &cfg)
DensityMap addTrack(const BoundTrackParameters &trk, DensityMap &mainDensityMap) const

Adds a single track to the overall grid density.

Parameters
  • trk – The track to be added

  • mainDensityMap – Map between bins and corresponding density

Returns

The density map of the track that was added

Result<ZTPosition> getMaxZTPosition(DensityMap &densityMap) const

Returns the z and t coordinate of maximum (surrounding) track density.

Note

if time vertex seeding is not enabled, the t coordinate will be set to 0.

Parameters

densityMap – Map between bins and corresponding density values

Returns

The z and t coordinates of maximum track density

Result<ZTPositionAndWidth> getMaxZTPositionAndWidth(DensityMap &densityMap) const

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

Parameters

densityMap – Map between bins and corresponding density values

Returns

The z-t position of the maximum track density and its width

DensityMap::const_iterator highestDensityEntry(const DensityMap &densityMap) const

Finds the maximum density of a DensityMap.

Parameters

densityMap – Map between bins and corresponding density values

Returns

Iterator of the map entry with the highest density

void subtractTrack(const DensityMap &trackDensityMap, DensityMap &mainDensityMap) const

Removes a track from the overall grid density.

Note

The track density comes from a single track

Note

The track density comes from an arbitrary number of tracks

Parameters
  • trackDensityMap – Map between bins and corresponding density

  • mainDensityMap – Map between bins and corresponding density

Public Static Functions

static int getBin(float value, float binExtent)

Calculates the bin number corresponding to a d, z, or time value.

Parameters
  • value – d, z, or time value

  • binExtent – Bin extent

Returns

Bin number

static float getBinCenter(int bin, float binExtent)

Calculates the bin center from the bin number.

Parameters
  • bin – Bin number

  • binExtent – Bin extent

Returns

Bin center

Private Functions

DensityMap createTrackGrid(const Acts::Vector3 &impactParams, const Bin &centralBin, const Acts::SquareMatrix3 &cov) const

Function that creates a track density map, i.e., a map from bins to the corresponding density values for a single track.

Parameters
  • impactParams – vector containing d0, z0, and t0 of the track

  • centralBin – Central z and t bin of the track (where its density is the highest)

  • cov – 3x3 impact parameter covariance matrix

Result<float> estimateSeedWidth(const DensityMap &densityMap, const ZTPosition &maxZT) const

Function that estimates the seed width in z direction based on the full width at half maximum (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
  • densityMap – Map from bins to corresponding track density

  • maxZT – z-t position of the maximum density value

Returns

The width

float getDensitySum(const DensityMap &densityMap, const Bin &bin) const

Calculates the density sum of a bin and its two neighboring bins in z direction.

Parameters
  • densityMap – Map between bins and corresponding density values

  • bin – Bin whose neighbors in z we want to sum up

Returns

The density sum

Bin highestDensitySumBin(DensityMap &densityMap) const

Checks (up to) first three density maxima that have a maximum relative deviation of ‘relativeDensityDev’ from the global maximum.

Returns the bin of the maximum that has the highest surrounding density in z direction.

Parameters

densityMap – Map between bins and corresponding density values

Returns

The bin corresponding to the highest surrounding density

Private Members

Config m_cfg

Private Static Functions

template<unsigned int nDim>
static float multivariateGaussian(const Acts::ActsVector<nDim> &args, const Acts::ActsSquareMatrix<nDim> &cov)

Helper to retrieve values of an nDim-dimensional normal distribution.

Note

The constant prefactor (2 * pi)^(- nDim / 2) is discarded

Note

args must be in a coordinate system with origin at the mean values of the Gaussian

Parameters
  • args – Coordinates where the Gaussian should be evaluated

  • cov – Covariance matrix

Returns

Multivariate Gaussian evaluated at args

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

The configuration struct.

Public Functions

inline Config(float spatialBinExtent_)
Parameters

spatialBinExtent_ – The spatial extent of a bin in mm

inline Config(float spatialBinExtent_, float temporalBinExtent_)

Note

The speed of light is set to 1, hence the unit.

Parameters
  • spatialBinExtent_ – The spatial extent of a bin in mm

  • temporalBinExtent_ – The temporal extent of a bin in mm

Public Members

float maxRelativeDensityDev = 0.01
float spatialBinExtent = 0.
float temporalBinExtent = 0.
bool useHighestSumZPosition = false