16#ifndef O2_ITS_TRACKING_VERTEXER_TRAITS_H_
17#define O2_ITS_TRACKING_VERTEXER_TRAITS_H_
37#include <oneapi/tbb/task_arena.h>
58 return int4{0, 0, 0, 0};
80 void setNThreads(
int n, std::shared_ptr<tbb::task_arena>& arena);
82 virtual bool isGPU() const noexcept {
return false; }
83 virtual const char*
getName() const noexcept {
return "CPU"; }
85 void setMemoryPool(std::shared_ptr<BoundedMemoryResource> pool) { mMemoryPool = pool; }
93 std::unordered_map<o2::MCCompLabel, size_t> frequency;
94 for (
const auto& element : elements) {
95 ++frequency[composeVtxLabel(element)];
99 for (
const auto& [
key,
count] : frequency) {
105 return std::make_pair(elem,
static_cast<float>(
maxCount) /
static_cast<float>(elements.size()));
115 std::shared_ptr<BoundedMemoryResource> mMemoryPool;
116 std::shared_ptr<tbb::task_arena> mTaskArena;
119 void debugComputeTracklets(
int iteration);
120 void debugComputeTrackletMatching(
int iteration);
121 void debugComputeVertices(
int iteration);
124template <
int nLayers>
127 mTimeFrame->initialise(0, trackingParams, 3, (
bool)(!iteration));
130template <
int nLayers>
133 return int2{
utils.getPhiBinIndex(math_utils::getNormalizedPhi(phi - dPhi)),
134 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phi + dPhi))};
137template <
int nLayers>
138GPUhdi() const
int4 VertexerTraits<nLayers>::getBinsRect(const
Cluster& currentCluster, const
int layerIndex,
139 const
float directionZIntersection,
float maxdeltaz,
float maxdeltaphi,
140 const IndexTableUtilsN&
utils)
142 const float zRangeMin = directionZIntersection - 2 * maxdeltaz;
143 const float phiRangeMin = currentCluster.phi - maxdeltaphi;
144 const float zRangeMax = directionZIntersection + 2 * maxdeltaz;
145 const float phiRangeMax = currentCluster.phi + maxdeltaphi;
147 if (zRangeMax < -
utils.getLayerZ(layerIndex + 1) ||
148 zRangeMin >
utils.getLayerZ(layerIndex + 1) || zRangeMin > zRangeMax) {
149 return getEmptyBinsRect();
152 return int4{o2::gpu::GPUCommonMath::Max(0,
utils.getZBinIndex(layerIndex + 1, zRangeMin)),
153 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMin)),
154 o2::gpu::GPUCommonMath::Min(
utils.getNzBins() - 1,
utils.getZBinIndex(layerIndex + 1, zRangeMax)),
155 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMax))};
158template <
int nLayers>
159GPUhdi() const
int4 VertexerTraits<nLayers>::getBinsRect(const
Cluster& currentCluster, const
int layerIndex,
160 const
float directionZIntersection,
float maxdeltaz,
float maxdeltaphi)
162 return VertexerTraits::getBinsRect(currentCluster, layerIndex, directionZIntersection, maxdeltaz, maxdeltaphi, mIndexTableUtils);
static constexpr int maxTrackID()
HMPID cluster implementation.
virtual void computeTracklets(const int iteration=0)
static std::pair< o2::MCCompLabel, float > computeMain(const bounded_vector< o2::MCCompLabel > &elements)
virtual ~VertexerTraits()=default
const const float float const IndexTableUtilsN float deltaPhi
virtual bool usesMemoryPool() const noexcept
virtual const char * getName() const noexcept
virtual void initialise(const TrackingParameters &trackingParams, const int iteration=0)
auto & getVertexingParameters()
void setMemoryPool(std::shared_ptr< BoundedMemoryResource > pool)
auto getVertexingParameters() const
const const float maxdeltaz
virtual void computeVertices(const int iteration=0)
GPUhdi() static const eval int4 getEmptyBinsRect()
void addTruthSeedingVertices()
const const float float maxdeltaphi
const const float float const IndexTableUtilsN & GPUhd() static const int2 getPhiBins(float phi
IndexTableUtilsN mIndexTableUtils
void setNThreads(int n, std::shared_ptr< tbb::task_arena > &arena)
void setVertexingParameters(std::vector< VertexingParameters > &vertParams)
virtual bool isGPU() const noexcept
std::vector< VertexingParameters > mVrtParams
virtual void computeTrackletMatching(const int iteration=0)
virtual void adoptTimeFrame(TimeFrameN *tf) noexcept
virtual void updateVertexingParameters(const std::vector< VertexingParameters > &vrtPar, const TimeFrameGPUParameters &gpuTfPar)
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