21template <
typename Operation,
typename... Containers>
22void applyToContainers(Operation&&
operation, Containers&... containers)
28void TimeFrameScratch::clearResizeEdgeStorage(std::size_t nEdges)
30 auto clearResize = [
this, nEdges](
auto& container) {
37void TimeFrameScratch::clearResizeCellStorage(std::size_t nCells)
39 auto clearResize = [
this, nCells](
auto& container) {
50 clearResizeEdgeStorage(nEdges);
51 clearResizeCellStorage(nCells);
64 applyToContainers([](
auto& container) { container.clear(); },
76 mMemoryPool = std::move(pool);
77 applyToContainers([
this](
auto& container) {
deepVectorClear(container, mMemoryPool.get()); },
105 result += neighbours.size();
111 gsl::span<const std::size_t> trackletLookupSizes)
113 if (nEdges > mNEdges || nCells > mNCells || trackletLookupSizes.size() != nEdges) {
114 throw std::logic_error{
"TimeFrameScratch::beginIteration(): requested storage exceeds configured capacity"};
117 clearResizeCellStorage(nCells);
118 clearResizeEdgeStorage(nEdges);
120 for (std::size_t edge = 0; edge < nEdges; ++edge) {
Runtime-plan-owned, detector-neutral CA workspace.
size_t getNumberOfTracklets() const
std::vector< bounded_vector< o2::MCCompLabel > > mTrackletLabels
std::vector< bounded_vector< int > > mCellsLookupTable
std::vector< bounded_vector< Triplet > > mCells
std::vector< bounded_vector< int > > mTrackletsLookupTable
void beginIteration(std::size_t nEdges, std::size_t nCells, gsl::span< const std::size_t > trackletLookupSizes)
void setMemoryPool(std::shared_ptr< BoundedMemoryResource > pool)
Reseat allocator-backed containers.
bounded_vector< float > mEdgePhiCuts
size_t getNumberOfNeighbours() const
std::vector< bounded_vector< int > > mCellsNeighboursLUT
std::vector< bounded_vector< int > > mCellsNeighbours
size_t getNumberOfCells() const
std::vector< bounded_vector< int > > mCellsNeighboursTopology
std::vector< bounded_vector< Tracklet > > mTracklets
void configureStorage(std::size_t nEdges, std::size_t nCells)
Size reusable edge and cell storage; setMemoryPool() comes first.
void reset()
Clear iteration state without changing plan sizes.
bounded_vector< float > mEdgeMSAngles
std::vector< bounded_vector< o2::MCCompLabel > > mCellLabels
void clearStorage() noexcept
Release plan-sized storage while preserving this object's identity.
void deepVectorClear(std::vector< T > &vec)
void clearResizeBoundedVector(bounded_vector< T > &vec, size_t sz, std::pmr::memory_resource *mr=nullptr, T def=T())
uint32_t trackClusterIndicesSize noexcept
std::vector< Cell > cells
std::vector< Tracklet64 > tracklets