Class Acts::AdaptiveGridTrackDensity

template<int spatialTrkGridSize = 15, int temporalTrkGridSize = 1>
class AdaptiveGridTrackDensity

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

struct Config

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