81 return (zCoordinate + mLayerZ[layerIndex]) * mInverseZBinSize[layerIndex];
85GPUhdi()
int IndexTableUtils<nLayers>::getPhiBinIndex(const
float currentPhi)
const
87 return (currentPhi * mInversePhiBinSize);
91GPUhdi()
int IndexTableUtils<nLayers>::getBinIndex(const
int zIndex, const
int phiIndex)
const
93 return o2::gpu::GPUCommonMath::Min(phiIndex * mNzBins + zIndex, (mNzBins * mNphiBins) - 1);
97GPUhdi()
int IndexTableUtils<nLayers>::countRowSelectedBins(const
int* indexTable, const
int phiBinIndex,
98 const
int minZBinIndex, const
int maxZBinIndex)
const
100 const int firstBinIndex{getBinIndex(minZBinIndex, phiBinIndex)};
101 const int maxBinIndex{firstBinIndex + maxZBinIndex - minZBinIndex + 1};
103 return indexTable[maxBinIndex] - indexTable[firstBinIndex];
106template <
int nLayers>
109 printf(
"NzBins: %d, NphiBins: %d, InversePhiBinSize: %f\n", mNzBins, mNphiBins, mInversePhiBinSize);
110 for (
int iLayer{0}; iLayer <
nLayers; ++iLayer) {
111 printf(
"Layer %d: Z: %f, InverseZBinSize: %f\n", iLayer, mLayerZ[iLayer], mInverseZBinSize[iLayer]);
115template <
int nLayers>
117 const
float z1, const
float z2, const
float maxdeltaz, const
float maxdeltaphi,
118 const IndexTableUtils<nLayers>&
utils)
120 const float zRangeMin = o2::gpu::GPUCommonMath::Min(z1, z2) - maxdeltaz;
122 const float zRangeMax = o2::gpu::GPUCommonMath::Max(z1, z2) + maxdeltaz;
125 if (zRangeMax < -
utils.getLayerZ(layerIndex) ||
126 zRangeMin >
utils.getLayerZ(layerIndex) || zRangeMin > zRangeMax) {
127 return int4{0, 0, 0, 0};
130 return int4{o2::gpu::GPUCommonMath::Max(0,
utils.getZBinIndex(layerIndex, zRangeMin)),
131 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMin)),
132 o2::gpu::GPUCommonMath::Min(
utils.getNzBins() - 1,
utils.getZBinIndex(layerIndex, zRangeMax)),
133 utils.getPhiBinIndex(math_utils::getNormalizedPhi(phiRangeMax))};