ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::HoughTransformUtils::HoughPlane< identifier_t > Class Template Reference

Representation of the hough plane - the histogram used for the hough transform with methods to fill and evaluate the histogram. More...

#include <Acts/Seeding/HoughTransformUtils.hpp>

Public Types

using Axis
 hough histogram representation as a 2D-indexable vector of hough cells
using HoughHist = Grid<HoughCell<identifier_t>, Axis, Axis>
 Type alias for Hough histogram grid.
using Index = typename HoughHist::index_t
 Type alias for histogram index type.

Public Member Functions

 HoughPlane (const HoughPlaneConfig &cfg)
 instantiate the (empty) hough plane
Index axisBins (std::size_t globalBin) const
 get the coordinates of the bin given the global bin index
template<class PointType>
void fill (const PointType &measurement, const HoughAxisRanges &axisRanges, LineParametrisation< PointType > linePar, LineParametrisation< PointType > widthPar, const identifier_t &identifier, unsigned layer=0, YieldType weight=1.0f)
 fill and reset methods to modify the grid content
void fillBin (std::size_t binX, std::size_t binY, const identifier_t &identifier, unsigned layer, double w=1.0f)
 Helper method to fill a bin of the hough histogram.
const std::unordered_set< std::size_t > & getNonEmptyBins () const
 get the list of cells with non-zero content.
std::size_t globalBin (Index indexBin) const
 get the globalBin index given the coordinates of the bin
std::span< const identifier_t, std::dynamic_extent > hitIds (std::size_t xBin, std::size_t yBin) const
 get the identifiers of all hits in one cell of the histogram
std::span< const unsigned, std::dynamic_extent > layers (std::size_t xBin, std::size_t yBin) const
 get the layers with hits in one cell of the histogram
std::pair< std::size_t, std::size_t > locMaxHits () const
 get the bin indices of the cell containing the largest number of (weighted) hits across the entire histogram
std::pair< std::size_t, std::size_t > locMaxLayers () const
 get the bin indices of the cell containing the largest number of (weighted) layers with hits across the entire histogram
YieldType maxHits () const
 get the maximum number of (weighted) hits seen in a single cell across the entire histrogram.
YieldType maxLayers () const
 get the maximum number of (weighted) layers with hits seen in a single cell across the entire histrogram.
std::size_t nBinsX () const
 get the number of bins on the first coordinate
std::size_t nBinsY () const
 get the number of bins on the second coordinate
YieldType nHits (std::size_t globalBin) const
 access the (weighted) number of hits in one cell of the histogram from globalBin index
YieldType nHits (std::size_t xBin, std::size_t yBin) const
 access the (weighted) number of hits in one cell of the histogram from bin's coordinates
YieldType nLayers (std::size_t xBin, std::size_t yBin) const
 get the (weighted) number of layers with hits in one cell of the histogram
void reset ()
 resets the contents of the grid.
std::unordered_set< const identifier_t > uniqueHitIds (std::size_t xBin, std::size_t yBin) const
 get the identifiers of all hits in one cell of the histogram

Detailed Description

template<class identifier_t>
class Acts::HoughTransformUtils::HoughPlane< identifier_t >

Representation of the hough plane - the histogram used for the hough transform with methods to fill and evaluate the histogram.

Templated to a class used as identifier for the hits

Member Typedef Documentation

◆ Axis

template<class identifier_t>
using Acts::HoughTransformUtils::HoughPlane< identifier_t >::Axis
Initial value:
calculate bin indices from a given binning structure
Definition AxisDefinitions.hpp:147

hough histogram representation as a 2D-indexable vector of hough cells

◆ HoughHist

template<class identifier_t>
using Acts::HoughTransformUtils::HoughPlane< identifier_t >::HoughHist = Grid<HoughCell<identifier_t>, Axis, Axis>

Type alias for Hough histogram grid.

◆ Index

template<class identifier_t>
using Acts::HoughTransformUtils::HoughPlane< identifier_t >::Index = typename HoughHist::index_t

Type alias for histogram index type.

Constructor & Destructor Documentation

◆ HoughPlane()

template<class identifier_t>
Acts::HoughTransformUtils::HoughPlane< identifier_t >::HoughPlane ( const HoughPlaneConfig & cfg)
explicit

instantiate the (empty) hough plane

Parameters
cfgconfiguration

Member Function Documentation

◆ axisBins()

template<class identifier_t>
Index Acts::HoughTransformUtils::HoughPlane< identifier_t >::axisBins ( std::size_t globalBin) const

get the coordinates of the bin given the global bin index

Parameters
globalBinGlobal bin index to convert to coordinates
Returns
Local bin coordinates (x,y) corresponding to global bin index

◆ fill()

template<class identifier_t>
template<class PointType>
void Acts::HoughTransformUtils::HoughPlane< identifier_t >::fill ( const PointType & measurement,
const HoughAxisRanges & axisRanges,
LineParametrisation< PointType > linePar,
LineParametrisation< PointType > widthPar,
const identifier_t & identifier,
unsigned layer = 0,
YieldType weight = 1.0f )

fill and reset methods to modify the grid content

add one measurement to the hough plane

Template Parameters
PointTypeType of the objects to use when adding measurements (e.g. experiment EDM object)
Parameters
measurementThe measurement to add
axisRangesRanges of the hough axes, used to map the bin numbers to parameter values
lineParThe function y(x) parametrising the hough space line for a given measurement
widthParThe function dy(x) parametrising the width of the y(x) curve for a given measurement
identifierThe unique identifier for the given hit
layerA layer index for this hit
weightAn optional weight to assign to this hit

◆ fillBin()

template<class identifier_t>
void Acts::HoughTransformUtils::HoughPlane< identifier_t >::fillBin ( std::size_t binX,
std::size_t binY,
const identifier_t & identifier,
unsigned layer,
double w = 1.0f )

Helper method to fill a bin of the hough histogram.

Updates the internal helper data structures (maximum tracker etc).

Parameters
binXbin number along x
binYbin number along y
identifierhit identifier
layerlayer index
woptional hit weight

◆ getNonEmptyBins()

template<class identifier_t>
const std::unordered_set< std::size_t > & Acts::HoughTransformUtils::HoughPlane< identifier_t >::getNonEmptyBins ( ) const

get the list of cells with non-zero content.

Useful for peak-finders in sparse data to avoid looping over all cells

Returns
Reference to set of global bin indices with non-zero content

◆ globalBin()

template<class identifier_t>
std::size_t Acts::HoughTransformUtils::HoughPlane< identifier_t >::globalBin ( Index indexBin) const

get the globalBin index given the coordinates of the bin

Parameters
indexBinBin coordinates to convert to global index
Returns
Global bin index corresponding to local bin coordinates

◆ hitIds()

template<class identifier_t>
std::span< const identifier_t, std::dynamic_extent > Acts::HoughTransformUtils::HoughPlane< identifier_t >::hitIds ( std::size_t xBin,
std::size_t yBin ) const

get the identifiers of all hits in one cell of the histogram

Parameters
xBinbin index in the first coordinate
yBinbin index in the second coordinate
Returns
the list of identifiers of the hits for this cell Can include duplicates if a hit was filled more than once
Exceptions
outof range if indices are not within plane limits

◆ layers()

template<class identifier_t>
std::span< const unsigned, std::dynamic_extent > Acts::HoughTransformUtils::HoughPlane< identifier_t >::layers ( std::size_t xBin,
std::size_t yBin ) const

get the layers with hits in one cell of the histogram

Parameters
xBinbin index in the first coordinate
yBinbin index in the second coordinate
Returns
the layer indices that have hits for this cell
Exceptions
outof range if indices are not within plane limits

◆ locMaxHits()

template<class identifier_t>
std::pair< std::size_t, std::size_t > Acts::HoughTransformUtils::HoughPlane< identifier_t >::locMaxHits ( ) const

get the bin indices of the cell containing the largest number of (weighted) hits across the entire histogram

Returns
Pair of (x,y) bin indices where maximum hits are found

◆ locMaxLayers()

template<class identifier_t>
std::pair< std::size_t, std::size_t > Acts::HoughTransformUtils::HoughPlane< identifier_t >::locMaxLayers ( ) const

get the bin indices of the cell containing the largest number of (weighted) layers with hits across the entire histogram

Returns
Pair of (x,y) bin indices where maximum layers are found

◆ maxHits()

template<class identifier_t>
YieldType Acts::HoughTransformUtils::HoughPlane< identifier_t >::maxHits ( ) const

get the maximum number of (weighted) hits seen in a single cell across the entire histrogram.

Returns
Maximum number of hits found in any single cell

◆ maxLayers()

template<class identifier_t>
YieldType Acts::HoughTransformUtils::HoughPlane< identifier_t >::maxLayers ( ) const

get the maximum number of (weighted) layers with hits seen in a single cell across the entire histrogram.

Returns
Maximum number of layers found in any single cell

◆ nBinsX()

template<class identifier_t>
std::size_t Acts::HoughTransformUtils::HoughPlane< identifier_t >::nBinsX ( ) const

get the number of bins on the first coordinate

Returns
Number of bins in the X direction

◆ nBinsY()

template<class identifier_t>
std::size_t Acts::HoughTransformUtils::HoughPlane< identifier_t >::nBinsY ( ) const

get the number of bins on the second coordinate

Returns
Number of bins in the Y direction

◆ nHits() [1/2]

template<class identifier_t>
YieldType Acts::HoughTransformUtils::HoughPlane< identifier_t >::nHits ( std::size_t globalBin) const

access the (weighted) number of hits in one cell of the histogram from globalBin index

Parameters
globalBinglobal bin index
Returns
the (weighted) number of hits for this cell

◆ nHits() [2/2]

template<class identifier_t>
YieldType Acts::HoughTransformUtils::HoughPlane< identifier_t >::nHits ( std::size_t xBin,
std::size_t yBin ) const

access the (weighted) number of hits in one cell of the histogram from bin's coordinates

Parameters
xBinbin index in the first coordinate
yBinbin index in the second coordinate
Returns
the (weighted) number of hits for this cell
Exceptions
outof range if indices are not within plane limits

◆ nLayers()

template<class identifier_t>
YieldType Acts::HoughTransformUtils::HoughPlane< identifier_t >::nLayers ( std::size_t xBin,
std::size_t yBin ) const

get the (weighted) number of layers with hits in one cell of the histogram

Parameters
xBinbin index in the first coordinate
yBinbin index in the second coordinate
Returns
the (weighed) number of layers that have hits for this cell
Exceptions
outof range if indices are not within plane limits

◆ reset()

template<class identifier_t>
void Acts::HoughTransformUtils::HoughPlane< identifier_t >::reset ( )

resets the contents of the grid.

Can be used to avoid reallocating the histogram when switching regions / (sub)detectors

◆ uniqueHitIds()

template<class identifier_t>
std::unordered_set< const identifier_t > Acts::HoughTransformUtils::HoughPlane< identifier_t >::uniqueHitIds ( std::size_t xBin,
std::size_t yBin ) const

get the identifiers of all hits in one cell of the histogram

Parameters
xBinbin index in the first coordinate
yBinbin index in the second coordinate
Returns
the list of identifiers of the hits for this cell Guaranteed to not duplicate identifiers
Exceptions
outof range if indices are not within plane limits