ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::CartesianSpacePointGrid Class Reference

A cartesian space point grid used for seeding in a cartesian detector geometry. More...

#include <Acts/Seeding2/CartesianSpacePointGrid.hpp>

Classes

struct  Config
 Configuration parameters for the cartesian space point grid. More...

Public Types

using BinnedGroupType = BinnedGroup<GridType>
 Type alias for binned group over the cartesian grid.
using BinType = std::vector<SpacePointIndex>
 Type alias for bin container holding space point indices.
using GridType = Grid<BinType, XAxisType, YAxisType, ZAxisType>
 cartesian space point grid type, which is a grid over BinType with axes defined by XAxisType, YAxisType, and ZAxisType.
using SpacePointIndex = std::uint32_t
 Space point index type used in the grid.
using XAxisType = Axis<AxisType::Equidistant, AxisBoundaryType::Open>
 Type alias for x axis with equidistant binning and open boundaries.
using YAxisType = Axis<AxisType::Equidistant, AxisBoundaryType::Open>
 Type alias for y axis with equidistant binning and open boundaries.
using ZAxisType = Axis<AxisType::Equidistant, AxisBoundaryType::Open>
 Type alias for z axis with equidistant binning and open boundaries.

Public Member Functions

 CartesianSpacePointGrid (const Config &config, std::unique_ptr< const Logger > logger=getDefaultLogger("CartesianSpacePointGrid", Logging::Level::INFO))
 Construct a cartesian space point grid with the given configuration and an optional logger.
BinTypeat (std::size_t index)
 Mutable bin access by index.
const BinTypeat (std::size_t index) const
 Const bin access by index.
std::optional< std::size_t > binIndex (const Vector3 &position) const
 Get the bin index for a space point given its x-, y-, and z-coordinate.
std::optional< std::size_t > binIndex (float x, float y, float z) const
 Get the bin index for a space point given its azimuthal angle, radial distance, and z-coordinate.
const BinnedGroupTypebinnedGroup () const
 Access to the binned group.
void clear ()
 Clear the grid and drop all state.
Range1D< float > computeCoordRange (const SpacePointContainer2 &spacePoints) const
 Compute the range of the sorting coordinates in the grid.
void extend (const SpacePointContainer2::ConstRange &spacePoints)
 Fill the grid with space points from the container.
GridTypegrid ()
 Mutable grid access.
const GridTypegrid () const
 Const grid access.
std::optional< std::size_t > insert (const ConstSpacePointProxy2 &sp)
 Insert a space point into the grid.
std::optional< std::size_t > insert (SpacePointIndex index, float x, float y, float z)
 Insert a space point into the grid.
std::size_t numberOfBins () const
 Get the number of bins in the grid.
std::size_t numberOfSpacePoints () const
 Get the number of space points in the grid.
void sortBinsByCoord (const SpacePointContainer2 &spacePoints)
 Sort the bins in the grid by the space point sorting-coordinate, which is required by some algorithms that operate on the grid.

Detailed Description

A cartesian space point grid used for seeding in a cartesian detector geometry.

The grid is defined in cartesian coordinates (x,y,z).

Member Typedef Documentation

◆ GridType

cartesian space point grid type, which is a grid over BinType with axes defined by XAxisType, YAxisType, and ZAxisType.

The grid is a 3D grid with the axes representing azimuthal angle (phi), z-coordinate, and radial distance (r).

Constructor & Destructor Documentation

◆ CartesianSpacePointGrid()

Acts::CartesianSpacePointGrid::CartesianSpacePointGrid ( const Config & config,
std::unique_ptr< const Logger > logger = getDefaultLogger("CartesianSpacePointGrid", Logging::Level::INFO) )
explicit

Construct a cartesian space point grid with the given configuration and an optional logger.

Parameters
configConfiguration for the cartesian grid
loggerOptional logger instance for debugging output

Member Function Documentation

◆ at() [1/2]

BinType & Acts::CartesianSpacePointGrid::at ( std::size_t index)

Mutable bin access by index.

Parameters
indexThe index of the bin to access
Returns
Mutable reference to the bin at the specified index

◆ at() [2/2]

const BinType & Acts::CartesianSpacePointGrid::at ( std::size_t index) const

Const bin access by index.

Parameters
indexThe index of the bin to access
Returns
Const reference to the bin at the specified index

◆ binIndex() [1/2]

std::optional< std::size_t > Acts::CartesianSpacePointGrid::binIndex ( const Vector3 & position) const

Get the bin index for a space point given its x-, y-, and z-coordinate.

Parameters
positionThe position of the space point in (x,y,z) coordinates
Returns
The index of the bin in which the space point is located, or std::nullopt if the space point is outside the grid bounds.

◆ binIndex() [2/2]

std::optional< std::size_t > Acts::CartesianSpacePointGrid::binIndex ( float x,
float y,
float z ) const

Get the bin index for a space point given its azimuthal angle, radial distance, and z-coordinate.

Parameters
xThe x-coordinate of the space point
yThe y-coordinate of the space point
zThe z-coordinate of the space point
Returns
The index of the bin in which the space point is located, or std::nullopt if the space point is outside the grid bounds.

◆ binnedGroup()

const BinnedGroupType & Acts::CartesianSpacePointGrid::binnedGroup ( ) const

Access to the binned group.

Returns
Reference to the binned group

◆ clear()

void Acts::CartesianSpacePointGrid::clear ( )

Clear the grid and drop all state.

The object will behave like a newly constructed one.

◆ computeCoordRange()

Range1D< float > Acts::CartesianSpacePointGrid::computeCoordRange ( const SpacePointContainer2 & spacePoints) const

Compute the range of the sorting coordinates in the grid.

This requires the grid to be filled with space points and sorted by coordinate. The sorting can be done with the sortBinsByY method.

Parameters
spacePointsThe space point container to compute the y-range
Returns
The range of y-values in the grid

◆ extend()

void Acts::CartesianSpacePointGrid::extend ( const SpacePointContainer2::ConstRange & spacePoints)

Fill the grid with space points from the container.

Parameters
spacePointsThe space point container to fill the grid with

◆ grid() [1/2]

GridType & Acts::CartesianSpacePointGrid::grid ( )

Mutable grid access.

Returns
Mutable reference to the grid

◆ grid() [2/2]

const GridType & Acts::CartesianSpacePointGrid::grid ( ) const

Const grid access.

Returns
Const reference to the grid

◆ insert() [1/2]

std::optional< std::size_t > Acts::CartesianSpacePointGrid::insert ( const ConstSpacePointProxy2 & sp)

Insert a space point into the grid.

Parameters
spThe space point to insert
Returns
The index of the bin in which the space point was inserted, or std::nullopt if the space point is outside the grid bounds.

◆ insert() [2/2]

std::optional< std::size_t > Acts::CartesianSpacePointGrid::insert ( SpacePointIndex index,
float x,
float y,
float z )

Insert a space point into the grid.

Parameters
indexThe index of the space point to insert
xThe x-coordinate the space point
yThe y-coordinate the space point
zThe z-coordinate the space point
Returns
The index of the bin in which the space point was inserted, or std::nullopt if the space point is outside the grid bounds.

◆ numberOfBins()

std::size_t Acts::CartesianSpacePointGrid::numberOfBins ( ) const

Get the number of bins in the grid.

Returns
The number of bins in the grid

◆ numberOfSpacePoints()

std::size_t Acts::CartesianSpacePointGrid::numberOfSpacePoints ( ) const

Get the number of space points in the grid.

Returns
The number of space points in the grid

◆ sortBinsByCoord()

void Acts::CartesianSpacePointGrid::sortBinsByCoord ( const SpacePointContainer2 & spacePoints)

Sort the bins in the grid by the space point sorting-coordinate, which is required by some algorithms that operate on the grid.

Parameters
spacePointsThe space point container to sort the bins by the configured coordinate