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};
85 void setNThreads(
int n, std::shared_ptr<tbb::task_arena>& arena);
87 virtual bool isGPU() const noexcept {
return false; }
88 virtual const char*
getName() const noexcept {
return "CPU"; }
90 void setMemoryPool(std::shared_ptr<BoundedMemoryResource>& pool) { mMemoryPool = pool; }
98 std::unordered_map<o2::MCCompLabel, size_t> frequency;
99 for (
const auto& element : elements) {
100 ++frequency[composeVtxLabel(element)];
104 for (
const auto& [
key,
count] : frequency) {
110 return std::make_pair(elem,
static_cast<float>(
maxCount) /
static_cast<float>(elements.size()));
120 std::shared_ptr<BoundedMemoryResource> mMemoryPool;
121 std::shared_ptr<tbb::task_arena> mTaskArena;
131 return int2{
utils.getPhiBinIndex(math_utils::getNormalizedPhi(phi - dPhi)),
132 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phi + dPhi))};
135GPUhdi() const
int4 VertexerTraits::getBinsRect(const
Cluster& currentCluster, const
int layerIndex,
136 const
float directionZIntersection,
float maxdeltaz,
float maxdeltaphi,
137 const IndexTableUtils&
utils)
139 const float zRangeMin = directionZIntersection - 2 * maxdeltaz;
140 const float phiRangeMin = currentCluster.phi - maxdeltaphi;
141 const float zRangeMax = directionZIntersection + 2 * maxdeltaz;
142 const float phiRangeMax = currentCluster.phi + maxdeltaphi;
144 if (zRangeMax < -
utils.getLayerZ(layerIndex + 1) ||
145 zRangeMin >
utils.getLayerZ(layerIndex + 1) || zRangeMin > zRangeMax) {
146 return getEmptyBinsRect();
149 return int4{o2::gpu::GPUCommonMath::Max(0,
utils.getZBinIndex(layerIndex + 1, zRangeMin)),
150 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMin)),
151 o2::gpu::GPUCommonMath::Min(
utils.getNzBins() - 1,
utils.getZBinIndex(layerIndex + 1, zRangeMax)),
152 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMax))};
155GPUhdi() const
int4 VertexerTraits::getBinsRect(const
Cluster& currentCluster, const
int layerIndex,
156 const
float directionZIntersection,
float maxdeltaz,
float maxdeltaphi)
158 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
virtual void computeTrackletMatching(const int iteration=0)
void addTruthSeedingVertices()
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
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)