16#ifndef O2_ITS_TRACKING_VERTEXER_TRAITS_H_
17#define O2_ITS_TRACKING_VERTEXER_TRAITS_H_
37#include <oneapi/tbb/task_arena.h>
63 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;
124 void debugComputeTracklets(
int iteration);
125 void debugComputeTrackletMatching(
int iteration);
126 void debugComputeVertices(
int iteration);
129template <
int nLayers>
132 mTimeFrame->initialise(0, trackingParams, 3, (
bool)(!iteration));
135template <
int nLayers>
138 return int2{
utils.getPhiBinIndex(math_utils::getNormalizedPhi(phi - dPhi)),
139 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phi + dPhi))};
142template <
int nLayers>
143GPUhdi() const
int4 VertexerTraits<nLayers>::getBinsRect(const
Cluster& currentCluster, const
int layerIndex,
144 const
float directionZIntersection,
float maxdeltaz,
float maxdeltaphi,
145 const IndexTableUtilsN&
utils)
147 const float zRangeMin = directionZIntersection - 2 * maxdeltaz;
148 const float phiRangeMin = currentCluster.phi - maxdeltaphi;
149 const float zRangeMax = directionZIntersection + 2 * maxdeltaz;
150 const float phiRangeMax = currentCluster.phi + maxdeltaphi;
152 if (zRangeMax < -
utils.getLayerZ(layerIndex + 1) ||
153 zRangeMin >
utils.getLayerZ(layerIndex + 1) || zRangeMin > zRangeMax) {
154 return getEmptyBinsRect();
157 return int4{o2::gpu::GPUCommonMath::Max(0,
utils.getZBinIndex(layerIndex + 1, zRangeMin)),
158 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMin)),
159 o2::gpu::GPUCommonMath::Min(
utils.getNzBins() - 1,
utils.getZBinIndex(layerIndex + 1, zRangeMax)),
160 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMax))};
163template <
int nLayers>
164GPUhdi() const
int4 VertexerTraits<nLayers>::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);
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()
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
void setMemoryPool(std::shared_ptr< BoundedMemoryResource > &pool)
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