16#ifndef O2_ITS_TRACKING_VERTEXER_TRAITS_H_
17#define O2_ITS_TRACKING_VERTEXER_TRAITS_H_
37#include <oneapi/tbb/task_arena.h>
53 static constexpr int NLayers{7};
62 return int4{0, 0, 0, 0};
78 gsl::span<const o2::its::Line>&,
81 std::array<float, 2>&,
86 const int iteration = 0);
89 const std::array<int, 4>& selectedBinsRect,
97 void setNThreads(
int n, std::shared_ptr<tbb::task_arena>& arena);
99 virtual bool isGPU() const noexcept {
return false; }
100 virtual const char*
getName() const noexcept {
return "CPU"; }
102 void setMemoryPool(std::shared_ptr<BoundedMemoryResource>& pool) { mMemoryPool = pool; }
110 std::unordered_map<o2::MCCompLabel, size_t> frequency;
111 for (
const auto& element : elements) {
112 ++frequency[composeVtxLabel(element)];
116 for (
const auto& [
key,
count] : frequency) {
122 return std::make_pair(elem,
static_cast<float>(
maxCount) /
static_cast<float>(elements.size()));
132 std::shared_ptr<BoundedMemoryResource> mMemoryPool;
133 std::shared_ptr<tbb::task_arena> mTaskArena;
143 return int2{
utils.getPhiBinIndex(math_utils::getNormalizedPhi(phi - dPhi)),
144 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phi + dPhi))};
147GPUhdi() const
int4 VertexerTraits::getBinsRect(const
Cluster& currentCluster, const
int layerIndex,
148 const
float directionZIntersection,
float maxdeltaz,
float maxdeltaphi,
149 const IndexTableUtils&
utils)
151 const float zRangeMin = directionZIntersection - 2 * maxdeltaz;
152 const float phiRangeMin = currentCluster.phi - maxdeltaphi;
153 const float zRangeMax = directionZIntersection + 2 * maxdeltaz;
154 const float phiRangeMax = currentCluster.phi + maxdeltaphi;
156 if (zRangeMax < -
utils.getLayerZ(layerIndex + 1) ||
157 zRangeMin >
utils.getLayerZ(layerIndex + 1) || zRangeMin > zRangeMax) {
158 return getEmptyBinsRect();
161 return int4{o2::gpu::GPUCommonMath::Max(0,
utils.getZBinIndex(layerIndex + 1, zRangeMin)),
162 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMin)),
163 o2::gpu::GPUCommonMath::Min(
utils.getNzBins() - 1,
utils.getZBinIndex(layerIndex + 1, zRangeMax)),
164 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMax))};
167GPUhdi() const
int4 VertexerTraits::getBinsRect(const
Cluster& currentCluster, const
int layerIndex,
168 const
float directionZIntersection,
float maxdeltaz,
float maxdeltaphi)
170 return VertexerTraits::getBinsRect(currentCluster, layerIndex, directionZIntersection, maxdeltaz, maxdeltaphi, mIndexTableUtils);
static constexpr int maxTrackID()
HMPID cluster implementation.
auto getVertexingParameters() const
const const float float const IndexTableUtils float deltaPhi
bounded_vector< std::pair< int, int > > selectClusters(const int *indexTable, const std::array< int, 4 > &selectedBinsRect, const IndexTableUtils &utils)
virtual void computeTrackletMatching(const int iteration=0)
virtual void computeTracklets(const int iteration=0)
void setNThreads(int n, std::shared_ptr< tbb::task_arena > &arena)
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
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)
static std::pair< o2::MCCompLabel, float > computeMain(const bounded_vector< o2::MCCompLabel > &elements)
void dumpVertexerTraits()
void setMemoryPool(std::shared_ptr< BoundedMemoryResource > &pool)
const const float maxdeltaz
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)