Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize > Class Template Reference

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. More...

#include <acts/blob/sPHENIX/Core/include/Acts/Vertexing/AdaptiveGridTrackDensity.hpp>

+ Collaboration diagram for Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >:

Classes

struct  Config
 The configuration struct. More...
 

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 Member Functions

 AdaptiveGridTrackDensity (const Config &cfg)
 
DensityMap::const_iterator highestDensityEntry (const DensityMap &densityMap) const
 Finds the maximum density of a DensityMap.
 
Result< ZTPositiongetMaxZTPosition (DensityMap &densityMap) const
 Returns the z and t coordinate of maximum (surrounding) track density.
 
Result< ZTPositionAndWidthgetMaxZTPositionAndWidth (DensityMap &densityMap) const
 Returns the z-t position of maximum track density and the estimated z-width of the maximum.
 
DensityMap addTrack (const BoundTrackParameters &trk, DensityMap &mainDensityMap) const
 Adds a single track to the overall grid density.
 
void subtractTrack (const DensityMap &trackDensityMap, DensityMap &mainDensityMap) const
 Removes a track from the overall grid density.
 

Static Public Member Functions

static float getBinCenter (int bin, float binExtent)
 Calculates the bin center from the bin number.
 
static int getBin (float value, float binExtent)
 Calculates the bin number corresponding to a d, z, or time value.
 

Private Member 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.
 
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.
 
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.
 
float getDensitySum (const DensityMap &densityMap, const Bin &bin) const
 Calculates the density sum of a bin and its two neighboring bins in z direction.
 

Static Private Member 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.
 

Private Attributes

Config m_cfg
 

Detailed Description

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

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.

Template Parameters
spatialTrkGridSizeNumber of bins per track in z direction
temporalTrkGridSizeNumber of bins per track in t direction
Note
In total, a track is represented by a grid of size spatialTrkGridSize * temporalTrkGridSize

Definition at line 37 of file AdaptiveGridTrackDensity.hpp.

View newest version in sPHENIX GitHub at line 37 of file AdaptiveGridTrackDensity.hpp

Member Typedef Documentation

template<int spatialTrkGridSize = 15, int temporalTrkGridSize = 1>
using Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::Bin = std::pair<int, int>

Definition at line 44 of file AdaptiveGridTrackDensity.hpp.

View newest version in sPHENIX GitHub at line 44 of file AdaptiveGridTrackDensity.hpp

template<int spatialTrkGridSize = 15, int temporalTrkGridSize = 1>
using Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::DensityMap = std::unordered_map<Bin, float, boost::hash<Bin>>

Definition at line 46 of file AdaptiveGridTrackDensity.hpp.

View newest version in sPHENIX GitHub at line 46 of file AdaptiveGridTrackDensity.hpp

template<int spatialTrkGridSize = 15, int temporalTrkGridSize = 1>
using Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::ZTPosition = std::pair<float, float>

Definition at line 49 of file AdaptiveGridTrackDensity.hpp.

View newest version in sPHENIX GitHub at line 49 of file AdaptiveGridTrackDensity.hpp

template<int spatialTrkGridSize = 15, int temporalTrkGridSize = 1>
using Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::ZTPositionAndWidth = std::pair<ZTPosition, float>

Definition at line 51 of file AdaptiveGridTrackDensity.hpp.

View newest version in sPHENIX GitHub at line 51 of file AdaptiveGridTrackDensity.hpp

Constructor & Destructor Documentation

template<int spatialTrkGridSize = 15, int temporalTrkGridSize = 1>
Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::AdaptiveGridTrackDensity ( const Config cfg)
inline

Definition at line 99 of file AdaptiveGridTrackDensity.hpp.

View newest version in sPHENIX GitHub at line 99 of file AdaptiveGridTrackDensity.hpp

Member Function Documentation

template<int spatialTrkGridSize, int temporalTrkGridSize>
Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::DensityMap Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::addTrack ( const BoundTrackParameters trk,
DensityMap mainDensityMap 
) const

Adds a single track to the overall grid density.

Parameters
trkThe track to be added
mainDensityMapMap between bins and corresponding density
Returns
The density map of the track that was added

Definition at line 98 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 98 of file AdaptiveGridTrackDensity.ipp

References Acts::Test::cov, Acts::GenericBoundTrackParameters< particle_hypothesis_t >::impactParameterCovariance(), Acts::GenericBoundTrackParameters< particle_hypothesis_t >::impactParameters(), and m_cfg().

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<int spatialTrkGridSize, int temporalTrkGridSize>
Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::DensityMap Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::createTrackGrid ( const Acts::Vector3 impactParams,
const Bin centralBin,
const Acts::SquareMatrix3 cov 
) const
private

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

Parameters
impactParamsvector containing d0, z0, and t0 of the track
centralBinCentral z and t bin of the track (where its density is the highest)
cov3x3 impact parameter covariance matrix

Definition at line 151 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 151 of file AdaptiveGridTrackDensity.ipp

References Acts::Test::cov, i, j, m_cfg(), t, and physmon_track_finding_ttbar::z.

+ Here is the call graph for this function:

template<int spatialTrkGridSize, int temporalTrkGridSize>
Acts::Result< float > Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::estimateSeedWidth ( const DensityMap densityMap,
const ZTPosition maxZT 
) const
private

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
densityMapMap from bins to corresponding track density
maxZTz-t position of the maximum density value
Returns
The width

Definition at line 193 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 193 of file AdaptiveGridTrackDensity.ipp

References m_cfg(), and width.

+ Here is the call graph for this function:

template<int spatialTrkGridSize, int temporalTrkGridSize>
int Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::getBin ( float  value,
float  binExtent 
)
static

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

Parameters
valued, z, or time value
binExtentBin extent
Returns
Bin number

Definition at line 22 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 22 of file AdaptiveGridTrackDensity.ipp

template<int spatialTrkGridSize, int temporalTrkGridSize>
float Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::getBinCenter ( int  bin,
float  binExtent 
)
static

Calculates the bin center from the bin number.

Parameters
binBin number
binExtentBin extent
Returns
Bin center

Definition at line 15 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 15 of file AdaptiveGridTrackDensity.ipp

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

template<int spatialTrkGridSize, int temporalTrkGridSize>
float Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::getDensitySum ( const DensityMap densityMap,
const Bin bin 
) const
private

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

Parameters
densityMapMap between bins and corresponding density values
binBin whose neighbors in z we want to sum up
Returns
The density sum

Definition at line 328 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 328 of file AdaptiveGridTrackDensity.ipp

References sum().

+ Here is the call graph for this function:

template<int spatialTrkGridSize, int temporalTrkGridSize>
Acts::Result< typename Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::ZTPosition > Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::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
densityMapMap between bins and corresponding density values
Returns
The z and t coordinates of maximum track density

Definition at line 44 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 44 of file AdaptiveGridTrackDensity.ipp

References m_cfg(), and maxZ.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<int spatialTrkGridSize, int temporalTrkGridSize>
Acts::Result< typename Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::ZTPositionAndWidth > Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::getMaxZTPositionAndWidth ( DensityMap densityMap) const

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

Parameters
densityMapMap between bins and corresponding density values
Returns
The z-t position of the maximum track density and its width

Definition at line 76 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 76 of file AdaptiveGridTrackDensity.ipp

References width.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

template<int spatialTrkGridSize, int temporalTrkGridSize>
Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::DensityMap::const_iterator Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::highestDensityEntry ( const DensityMap densityMap) const

Finds the maximum density of a DensityMap.

Parameters
densityMapMap between bins and corresponding density values
Returns
Iterator of the map entry with the highest density

Definition at line 31 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 31 of file AdaptiveGridTrackDensity.ipp

References parse_cmake_options::begin, and end.

template<int spatialTrkGridSize, int temporalTrkGridSize>
Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::Bin Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::highestDensitySumBin ( DensityMap densityMap) const
private

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
densityMapMap between bins and corresponding density values
Returns
The bin corresponding to the highest surrounding density

Definition at line 277 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 277 of file AdaptiveGridTrackDensity.ipp

References m_cfg().

+ Here is the call graph for this function:

template<int spatialTrkGridSize, int temporalTrkGridSize>
template<unsigned int nDim>
float Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::multivariateGaussian ( const Acts::ActsVector< nDim > &  args,
const Acts::ActsSquareMatrix< nDim > &  cov 
)
staticprivate

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

Note
The constant prefactor (2 * pi)^(- nDim / 2) is discarded
Parameters
argsCoordinates where the Gaussian should be evaluated
Note
args must be in a coordinate system with origin at the mean values of the Gaussian
Parameters
covCovariance matrix
Returns
Multivariate Gaussian evaluated at args

Definition at line 266 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 266 of file AdaptiveGridTrackDensity.ipp

References check_smearing_config::args, and Acts::safeExp().

+ Here is the call graph for this function:

template<int spatialTrkGridSize, int temporalTrkGridSize>
void Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::subtractTrack ( const DensityMap trackDensityMap,
DensityMap mainDensityMap 
) const

Removes a track from the overall grid density.

Parameters
trackDensityMapMap between bins and corresponding density
Note
The track density comes from a single track
Parameters
mainDensityMapMap between bins and corresponding density
Note
The track density comes from an arbitrary number of tracks

Definition at line 140 of file AdaptiveGridTrackDensity.ipp.

View newest version in sPHENIX GitHub at line 140 of file AdaptiveGridTrackDensity.ipp

References it.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the caller graph for this function:

Member Data Documentation

template<int spatialTrkGridSize = 15, int temporalTrkGridSize = 1>
Config Acts::AdaptiveGridTrackDensity< spatialTrkGridSize, temporalTrkGridSize >::m_cfg
private

Definition at line 218 of file AdaptiveGridTrackDensity.hpp.

View newest version in sPHENIX GitHub at line 218 of file AdaptiveGridTrackDensity.hpp


The documentation for this class was generated from the following files: