LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
util::GridContainerIndicesBase2D< DIMS > Class Template Reference

Index manager for a container of data arranged on a >=2-dim grid. More...

#include "GridContainerIndices.h"

Inheritance diagram for util::GridContainerIndicesBase2D< DIMS >:
util::GridContainerIndicesBase1D< DIMS > util::details::GridContainerIndicesBase< DIMS > util::GridContainerIndicesBase3D< DIMS >

Public Types

using CellIndex_t = typename IndexManager_t::LinIndex_t
 type of index for direct access to the cell More...
 
using CellIndexOffset_t = std::ptrdiff_t
 type of difference between indices More...
 
using CellDimIndex_t = CellIndexOffset_t
 type of difference between indices along a dimension More...
 
using CellID_t = std::array< CellDimIndex_t, dims()>
 type of cell coordinate (x, y, z) More...
 

Public Member Functions

Grid structure
bool hasY (typename Base_t::CellDimIndex_t index) const
 Returns whether the specified y index is valid. More...
 
size_t sizeY () const
 Returns the number of cells on the y axis of the grid. More...
 
Grid structure
bool hasX (typename Base_t::CellDimIndex_t index) const
 Returns whether the specified x index is valid. More...
 
size_t sizeX () const
 Returns the number of cells on the x axis of the grid. More...
 
Grid structure
bool has (CellIndexOffset_t index) const
 Returns whether the specified index is valid. More...
 
size_t size () const
 Returns the number of cells in the grid. More...
 
Indexing
CellIndex_t operator[] (CellID_t id) const
 Returns the index of the element from its cell coordinates (no check!) More...
 
CellIndexOffset_t offset (CellID_t const &origin, CellID_t const &cellID) const
 Returns the difference in index of cellID respect to origin. More...
 

Static Public Member Functions

static constexpr unsigned int dims ()
 Returns the number of dimensions in this object. More...
 

Protected Member Functions

CellIndex_t index (CellID_t id) const
 Returns the index of the element from its cell coordinates (no check!) More...
 

Protected Attributes

IndexManager_t indices
 the actual worker More...
 

Private Types

using Base_t = GridContainerIndicesBase1D< DIMS >
 

Detailed Description

template<unsigned int DIMS = 2U>
class util::GridContainerIndicesBase2D< DIMS >

Index manager for a container of data arranged on a >=2-dim grid.

Definition at line 128 of file GridContainerIndices.h.

Member Typedef Documentation

template<unsigned int DIMS = 2U>
using util::GridContainerIndicesBase2D< DIMS >::Base_t = GridContainerIndicesBase1D<DIMS>
private

Definition at line 132 of file GridContainerIndices.h.

template<unsigned int DIMS>
using util::details::GridContainerIndicesBase< DIMS >::CellDimIndex_t = CellIndexOffset_t
inherited

type of difference between indices along a dimension

Definition at line 50 of file GridContainerIndices.h.

template<unsigned int DIMS>
using util::details::GridContainerIndicesBase< DIMS >::CellID_t = std::array<CellDimIndex_t, dims()>
inherited

type of cell coordinate (x, y, z)

Definition at line 53 of file GridContainerIndices.h.

template<unsigned int DIMS>
using util::details::GridContainerIndicesBase< DIMS >::CellIndex_t = typename IndexManager_t::LinIndex_t
inherited

type of index for direct access to the cell

Definition at line 44 of file GridContainerIndices.h.

template<unsigned int DIMS>
using util::details::GridContainerIndicesBase< DIMS >::CellIndexOffset_t = std::ptrdiff_t
inherited

type of difference between indices

Definition at line 47 of file GridContainerIndices.h.

Member Function Documentation

template<unsigned int DIMS>
static constexpr unsigned int util::details::GridContainerIndicesBase< DIMS >::dims ( )
inlinestaticinherited

Returns the number of dimensions in this object.

Definition at line 41 of file GridContainerIndices.h.

41 { return DIMS; }
template<unsigned int DIMS>
bool util::details::GridContainerIndicesBase< DIMS >::has ( CellIndexOffset_t  index) const
inlineinherited

Returns whether the specified index is valid.

Definition at line 64 of file GridContainerIndices.h.

References util::TensorIndices< RANK >::hasLinIndex(), and util::details::GridContainerIndicesBase< DIMS >::indices.

65  { return indices.hasLinIndex(index); }
CellIndex_t index(CellID_t id) const
Returns the index of the element from its cell coordinates (no check!)
IndexManager_t indices
the actual worker
bool hasLinIndex(LinIndex_t linIndex) const
Returns whether the specified linear index is valid in this tensor.
template<unsigned int DIMS = 1U>
bool util::GridContainerIndicesBase1D< DIMS >::hasX ( typename Base_t::CellDimIndex_t  index) const
inlineinherited

Returns whether the specified x index is valid.

Definition at line 115 of file GridContainerIndices.h.

References util::details::GridContainerIndicesBase< DIMS >::index(), and geo::vect::indices().

116  { return Base_t::indices.template hasIndex<0>(index); }
CellIndex_t index(CellID_t id) const
Returns the index of the element from its cell coordinates (no check!)
IndexManager_t indices
the actual worker
template<unsigned int DIMS = 2U>
bool util::GridContainerIndicesBase2D< DIMS >::hasY ( typename Base_t::CellDimIndex_t  index) const
inline

Returns whether the specified y index is valid.

Definition at line 142 of file GridContainerIndices.h.

References util::details::GridContainerIndicesBase< DIMS >::index(), and geo::vect::indices().

143  { return Base_t::indices.template hasIndex<1>(index); }
CellIndex_t index(CellID_t id) const
Returns the index of the element from its cell coordinates (no check!)
IndexManager_t indices
the actual worker
template<unsigned int DIMS>
CellIndex_t util::details::GridContainerIndicesBase< DIMS >::index ( CellID_t  id) const
inlineprotectedinherited

Returns the index of the element from its cell coordinates (no check!)

Definition at line 89 of file GridContainerIndices.h.

References evd::details::begin(), and util::details::GridContainerIndicesBase< DIMS >::indices.

Referenced by util::GridContainerIndicesBase1D< DIMS >::hasX(), util::GridContainerIndicesBase2D< DIMS >::hasY(), util::GridContainerIndicesBase3D< DIMS >::hasZ(), util::details::GridContainerIndicesBase< DIMS >::offset(), and util::details::GridContainerIndicesBase< DIMS >::operator[]().

90  { return indices(id.begin()); }
IndexManager_t indices
the actual worker
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
template<unsigned int DIMS>
CellIndexOffset_t util::details::GridContainerIndicesBase< DIMS >::offset ( CellID_t const &  origin,
CellID_t const &  cellID 
) const
inlineinherited

Returns the difference in index of cellID respect to origin.

Definition at line 80 of file GridContainerIndices.h.

References util::details::GridContainerIndicesBase< DIMS >::index().

Referenced by lar::example::PointIsolationAlg< Coord >::buildNeighborhood(), and util::details::GridContainerIndicesBase< DIMS >::operator[]().

81  { return index(cellID) - index(origin); }
CellIndex_t index(CellID_t id) const
Returns the index of the element from its cell coordinates (no check!)
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:230
template<unsigned int DIMS>
CellIndex_t util::details::GridContainerIndicesBase< DIMS >::operator[] ( CellID_t  id) const
inlineinherited

Returns the index of the element from its cell coordinates (no check!)

Definition at line 76 of file GridContainerIndices.h.

References util::details::GridContainerIndicesBase< DIMS >::index(), and util::details::GridContainerIndicesBase< DIMS >::offset().

76 { return index(id); }
CellIndex_t index(CellID_t id) const
Returns the index of the element from its cell coordinates (no check!)
template<unsigned int DIMS>
size_t util::details::GridContainerIndicesBase< DIMS >::size ( ) const
inlineinherited

Returns the number of cells in the grid.

Definition at line 68 of file GridContainerIndices.h.

References util::details::GridContainerIndicesBase< DIMS >::indices, and util::TensorIndices< RANK >::size().

68 { return indices.size(); }
IndexManager_t indices
the actual worker
DimSize_t size() const
Returns the size of the minor tensor.
template<unsigned int DIMS = 1U>
size_t util::GridContainerIndicesBase1D< DIMS >::sizeX ( ) const
inlineinherited

Returns the number of cells on the x axis of the grid.

Definition at line 119 of file GridContainerIndices.h.

References geo::vect::indices().

119 { return Base_t::indices.template dim<0>(); }
IndexManager_t indices
the actual worker
template<unsigned int DIMS = 2U>
size_t util::GridContainerIndicesBase2D< DIMS >::sizeY ( ) const
inline

Returns the number of cells on the y axis of the grid.

Definition at line 146 of file GridContainerIndices.h.

References geo::vect::indices().

146 { return Base_t::indices.template dim<1>(); }
IndexManager_t indices
the actual worker

Member Data Documentation


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