16#ifndef O2_ITS_TRACKING_VERTEXER_TRAITS_H_
17#define O2_ITS_TRACKING_VERTEXER_TRAITS_H_
36#include <oneapi/tbb/task_arena.h>
54 static constexpr int NLayers{7};
63 return int4{0, 0, 0, 0};
79 gsl::span<const o2::its::Line>&,
82 std::array<float, 2>&,
87 const int iteration = 0);
90 const std::array<int, 4>& selectedBinsRect,
100 virtual bool isGPU() const noexcept {
return false; }
101 virtual const char*
getName() const noexcept {
return "CPU"; }
103 void setMemoryPool(std::shared_ptr<BoundedMemoryResource>& pool) { mMemoryPool = pool; }
105 template <
typename T = o2::MCCompLabel>
110 for (
auto& element : elements) {
111 size_t count = std::count(elements.begin(), elements.end(), element);
117 return std::make_pair(elem,
static_cast<float>(
maxCount) / elements.size());
129 std::shared_ptr<BoundedMemoryResource> mMemoryPool;
130 tbb::task_arena mTaskArena;
140 return int2{
utils.getPhiBinIndex(math_utils::getNormalizedPhi(phi - dPhi)),
141 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phi + dPhi))};
144GPUhdi() const
int4 VertexerTraits::getBinsRect(const
Cluster& currentCluster, const
int layerIndex,
145 const
float directionZIntersection,
float maxdeltaz,
float maxdeltaphi,
146 const IndexTableUtils&
utils)
148 const float zRangeMin = directionZIntersection - 2 * maxdeltaz;
149 const float phiRangeMin = currentCluster.phi - maxdeltaphi;
150 const float zRangeMax = directionZIntersection + 2 * maxdeltaz;
151 const float phiRangeMax = currentCluster.phi + maxdeltaphi;
153 if (zRangeMax < -
utils.getLayerZ(layerIndex + 1) ||
154 zRangeMin >
utils.getLayerZ(layerIndex + 1) || zRangeMin > zRangeMax) {
155 return getEmptyBinsRect();
158 return int4{o2::gpu::GPUCommonMath::Max(0,
utils.getZBinIndex(layerIndex + 1, zRangeMin)),
159 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMin)),
160 o2::gpu::GPUCommonMath::Min(
utils.getNzBins() - 1,
utils.getZBinIndex(layerIndex + 1, zRangeMax)),
161 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMax))};
164GPUhdi() const
int4 VertexerTraits::getBinsRect(const
Cluster& currentCluster, const
int layerIndex,
165 const
float directionZIntersection,
float maxdeltaz,
float maxdeltaphi)
167 return VertexerTraits::getBinsRect(currentCluster, layerIndex, directionZIntersection, maxdeltaz, maxdeltaphi, mIndexTableUtils);
HMPID cluster implementation.
auto getVertexingParameters() const
const const float float const IndexTableUtils float deltaPhi
virtual void computeTrackletMatching(const int iteration=0)
virtual void computeTracklets(const int iteration=0)
auto & getVertexingParameters()
GPUhdi() static const eval int4 getEmptyBinsRect()
void setVertexingParameters(std::vector< VertexingParameters > &vertParams)
virtual bool isGPU() const noexcept
virtual void initialise(const TrackingParameters &trackingParams, const int iteration=0)
virtual void computeVertices(const int iteration=0)
const const float float const IndexTableUtils & GPUhd() static const int2 getPhiBins(float phi
virtual void adoptTimeFrame(TimeFrame7 *tf) noexcept
virtual ~VertexerTraits()=default
virtual const char * getName() const noexcept
static std::pair< T, float > computeMain(const bounded_vector< T > &elements)
const const float float maxdeltaphi
std::vector< VertexingParameters > mVrtParams
IndexTableUtils mIndexTableUtils
void computeVerticesInRof(int, gsl::span< const o2::its::Line > &, bounded_vector< bool > &, bounded_vector< o2::its::ClusterLines > &, std::array< float, 2 > &, bounded_vector< Vertex > &, bounded_vector< int > &, TimeFrame7 *, bounded_vector< o2::MCCompLabel > *, const int iteration=0)
virtual bool usesMemoryPool() const noexcept
virtual void updateVertexingParameters(const std::vector< VertexingParameters > &vrtPar, const TimeFrameGPUParameters &gpuTfPar)
void dumpVertexerTraits()
void setMemoryPool(std::shared_ptr< BoundedMemoryResource > &pool)
const const float maxdeltaz
const bounded_vector< std::pair< int, int > > selectClusters(const int *indexTable, const std::array< int, 4 > &selectedBinsRect, const IndexTableUtils &utils)
constexpr int LayersNumberVertexer
std::pmr::vector< T > bounded_vector
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Common utility functions.
std::unique_ptr< GPUReconstructionTimeframe > tf
void initialise(const int iteration, const TrackingParameters &trkParam, const int maxLayers=7, bool resetVertices=true)