ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::CellContainer< coordinates_t, NDIM, index_t > Struct Template Reference

temporary cell container suitable for the in-place clusterization More...

#include <CellContainer.h>

Collaboration diagram for ActsTrk::CellContainer< coordinates_t, NDIM, index_t >:

Classes

struct  ClusterRange
struct  ModuleRangeGuard

Public Types

using Cell = CellTmpl<coordinates_t, NDIM, index_t>

Public Member Functions

 CellContainer (unsigned int n_modules, unsigned int n_cluster_total, unsigned int n_cells_total)
void reserve (unsigned int n_modules, unsigned int n_cluster_total, unsigned int n_cells_total)
 reserve storage for the cell and cluster data
std::size_t nClustersTotal () const
std::size_t nModules () const
std::size_t nCellsTotal () const
std::size_t size () const
ModuleRangeGuard startNewModule (unsigned int id_hash)
void emplace_back_cell (const std::array< coordinates_t, NDIM > &the_coordinates, index_t src_index)
void registerNewCluster (index_t cell_begin_idx, index_t cell_end_idx)
void registerClustersForNewModule (const ClusterRange &a_range)
const ClusterRangemoduleClusterRange (unsigned int module_i) const

Public Attributes

std::vector< Cellm_cells
std::vector< index_t > m_relativeClusterCellIndex
std::vector< ClusterRangem_moduleClusterRange

Detailed Description

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
struct ActsTrk::CellContainer< coordinates_t, NDIM, index_t >

temporary cell container suitable for the in-place clusterization

Definition at line 29 of file CellContainer.h.

Member Typedef Documentation

◆ Cell

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
using ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::Cell = CellTmpl<coordinates_t, NDIM, index_t>

Definition at line 56 of file CellContainer.h.

Constructor & Destructor Documentation

◆ CellContainer()

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::CellContainer ( unsigned int n_modules,
unsigned int n_cluster_total,
unsigned int n_cells_total )
inline

Definition at line 32 of file CellContainer.h.

temporary cell container suitable for the in-place clusterization
void reserve(unsigned int n_modules, unsigned int n_cluster_total, unsigned int n_cells_total)
reserve storage for the cell and cluster data

Member Function Documentation

◆ emplace_back_cell()

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
void ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::emplace_back_cell ( const std::array< coordinates_t, NDIM > & the_coordinates,
index_t src_index )
inline

Definition at line 112 of file CellContainer.h.

112 {
113 m_cells.emplace_back(the_coordinates, src_index);
114 }
std::vector< Cell > m_cells

◆ moduleClusterRange()

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
const ClusterRange & ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::moduleClusterRange ( unsigned int module_i) const
inline

Definition at line 134 of file CellContainer.h.

134 {
137 }
std::vector< ClusterRange > m_moduleClusterRange

◆ nCellsTotal()

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
std::size_t ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::nCellsTotal ( ) const
inline

Definition at line 53 of file CellContainer.h.

53{ return m_cells.size(); }

◆ nClustersTotal()

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
std::size_t ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::nClustersTotal ( ) const
inline

Definition at line 48 of file CellContainer.h.

48 {
51 }
std::size_t nModules() const
std::vector< index_t > m_relativeClusterCellIndex

◆ nModules()

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
std::size_t ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::nModules ( ) const
inline

Definition at line 52 of file CellContainer.h.

52{ return m_moduleClusterRange.size(); }

◆ registerClustersForNewModule()

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
void ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::registerClustersForNewModule ( const ClusterRange & a_range)
inline

Definition at line 124 of file CellContainer.h.

124 {
125 // @TODO for debugging
127
128 assert( a_range.clusterRangeEndIndex <= m_relativeClusterCellIndex.size() );
129 assert( a_range.clusterRangeEndIndex >0u );
130 assert( a_range.cellBeginIndex + m_relativeClusterCellIndex[a_range.clusterRangeEndIndex-1] <= m_cells.size() );
131
132 m_moduleClusterRange.push_back(a_range);
133 }

◆ registerNewCluster()

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
void ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::registerNewCluster ( index_t cell_begin_idx,
index_t cell_end_idx )
inline

Definition at line 115 of file CellContainer.h.

115 {
116 assert(!m_relativeClusterCellIndex.empty()); // startNewModule should have added a zero
117 assert( m_relativeClusterCellIndex.back() == cell_begin_idx); // clusters must be added in order
118 assert(cell_begin_idx < cell_end_idx); // a cluster must not be empty
119 // @TODO for debugging
121
123 }

◆ reserve()

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
void ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::reserve ( unsigned int n_modules,
unsigned int n_cluster_total,
unsigned int n_cells_total )
inline

reserve storage for the cell and cluster data

Parameters
n_modulesthe total number of modules i.e. independent invokations of the clusterization
n_cluster_totalthe expected number of clusters of all modules (best guess likely, one cluster per cell)
n_cells_totalthe total number of the cells of all modules to be clustered.

Definition at line 40 of file CellContainer.h.

42 {
44 m_relativeClusterCellIndex.reserve(n_cluster_total+n_modules); // will contain per module i n_cluster_i+1 indices
45 m_cells.reserve(n_cells_total);
46 }

◆ size()

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
std::size_t ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::size ( ) const
inline

Definition at line 54 of file CellContainer.h.

54{ return nModules(); }

◆ startNewModule()

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
ModuleRangeGuard ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::startNewModule ( unsigned int id_hash)
inline

Definition at line 104 of file CellContainer.h.

104 {
105 // relative cluster cell indices will always start with 0, will contain n_cluster+1 indices, where
106 // the last index will be the last relative index of the last cell.
107 // below test size+1 because there should also be space for at least the end index
110 return ModuleRangeGuard(*this, id_hash);
111 }

Member Data Documentation

◆ m_cells

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
std::vector<Cell> ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::m_cells

Definition at line 139 of file CellContainer.h.

◆ m_moduleClusterRange

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
std::vector<ClusterRange> ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::m_moduleClusterRange

Definition at line 142 of file CellContainer.h.

◆ m_relativeClusterCellIndex

template<typename coordinates_t, std::size_t NDIM, std::unsigned_integral index_t>
std::vector<index_t> ActsTrk::CellContainer< coordinates_t, NDIM, index_t >::m_relativeClusterCellIndex

Definition at line 140 of file CellContainer.h.


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