Class Acts::AdaptiveGridTrackDensity
-
template<int trkGridSize = 15>
class AdaptiveGridTrackDensity 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 DensityMap = std::unordered_map<int, float>
Public Functions
-
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 from z bins to corresponding track density.
- Returns
The density map of the track that was added
-
Result<float> getMaxZPosition(DensityMap &densityMap) const
Returns the z position of maximum (surrounding) track density.
- Parameters
densityMap – Map from z bins to corresponding track density
- Returns
The z position of maximum track density
-
Result<std::pair<float, float>> getMaxZPositionAndWidth(DensityMap &densityMap) const
Returns the z position of maximum track density and the estimated width.
- Parameters
densityMap – Map from z bins to corresponding track density
- Returns
The z position of maximum track density and width
-
DensityMap::const_iterator highestDensityEntry(const DensityMap &densityMap) const
Finds the maximum density of a DensityMap.
- Parameters
densityMap – Map between z bins and corresponding density value
- Returns
Iterator of the map entry with the highest density value
-
void subtractTrack(const DensityMap &trackDensityMap, DensityMap &mainDensityMap) const
Removes a track from the overall grid density.
- Parameters
trackDensityMap – Map from z bins to corresponding track density. The track density comes from a single track.
mainDensityMap – Map from z bins to corresponding track density. The track density comes an arbitrary number of tracks.