Skip to content

Commit ba0d932

Browse files
committed
ITS: fix rare valid lookup at the edge of acceptance
Technically, bin (0,0,0,0) is a valid result for the phi-z cluster query. Note though, that this if at all a super rare case and in local tests this did only showed up in the number of tracklets. So more a consistency fix than anything. Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 99dcab5 commit ba0d932

5 files changed

Lines changed: 5 additions & 39 deletions

File tree

Detectors/ITSMFT/ITS/tracking/GPU/cuda/TrackingKernels.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ GPUg() void __launch_bounds__(256, 1) computeLayerTrackletsMultiROFKernel(
408408
const float sqInverseDeltaZ0{1.f / (math_utils::Sq(currentCluster.zCoordinate - primaryVertex.getZ()) + constants::Tolerance)}; /// protecting from overflows adding the detector resolution
409409
const float sigmaZ{o2::gpu::CAMath::Sqrt(math_utils::Sq(resolution) * math_utils::Sq(tanLambda) * ((math_utils::Sq(inverseR0) + sqInverseDeltaZ0) * math_utils::Sq(meanDeltaR) + 1.f) + math_utils::Sq(meanDeltaR * MSAngle))};
410410
const int4 selectedBinsRect{o2::its::getBinsRect(currentCluster, layerIndex + 1, zAtRmin, zAtRmax, sigmaZ * NSigmaCut, phiCut, *utils)};
411-
if (selectedBinsRect.x == 0 && selectedBinsRect.y == 0 && selectedBinsRect.z == 0 && selectedBinsRect.w == 0) {
411+
if (selectedBinsRect.x < 0) {
412412
continue;
413413
}
414414
int phiBinsNum{selectedBinsRect.w - selectedBinsRect.y + 1};

Detectors/ITSMFT/ITS/tracking/include/ITStracking/IndexTableUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ GPUhdi() int4 getBinsRect(const Cluster& currentCluster, const int layerIndex,
124124

125125
if (zRangeMax < -utils.getLayerZ(layerIndex) ||
126126
zRangeMin > utils.getLayerZ(layerIndex) || zRangeMin > zRangeMax) {
127-
return int4{0, 0, 0, 0};
127+
return int4{-1, -1, -1, -1};
128128
}
129129

130130
return int4{o2::gpu::GPUCommonMath::Max(0, utils.getZBinIndex(layerIndex, zRangeMin)),

Detectors/ITSMFT/ITS/tracking/include/ITStracking/VertexerTraits.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ class VertexerTraits
5353
VertexerTraits() = default;
5454
virtual ~VertexerTraits() = default;
5555

56-
GPUhdi() static consteval int4 getEmptyBinsRect()
57-
{
58-
return int4{0, 0, 0, 0};
59-
}
60-
GPUhd() const int4 getBinsRect(const Cluster&, const int, const float, float maxdeltaz, float maxdeltaphi);
61-
GPUhd() static const int4 getBinsRect(const Cluster&, const int, const float, float maxdeltaz, float maxdeltaphi, const IndexTableUtilsN&);
6256
GPUhd() static const int2 getPhiBins(float phi, float deltaPhi, const IndexTableUtilsN&);
6357
GPUhd() const int2 getPhiBins(float phi, float deltaPhi) { return getPhiBins(phi, deltaPhi, mIndexTableUtils); }
6458

@@ -134,34 +128,6 @@ GPUhdi() const int2 VertexerTraits<NLayers>::getPhiBins(float phi, float dPhi, c
134128
utils.getPhiBinIndex(math_utils::getNormalizedPhi(phi + dPhi))};
135129
}
136130

137-
template <int NLayers>
138-
GPUhdi() const int4 VertexerTraits<NLayers>::getBinsRect(const Cluster& currentCluster, const int layerIndex,
139-
const float directionZIntersection, float maxdeltaz, float maxdeltaphi,
140-
const IndexTableUtilsN& utils)
141-
{
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;
146-
147-
if (zRangeMax < -utils.getLayerZ(layerIndex + 1) ||
148-
zRangeMin > utils.getLayerZ(layerIndex + 1) || zRangeMin > zRangeMax) {
149-
return getEmptyBinsRect();
150-
}
151-
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))};
156-
}
157-
158-
template <int NLayers>
159-
GPUhdi() const int4 VertexerTraits<NLayers>::getBinsRect(const Cluster& currentCluster, const int layerIndex,
160-
const float directionZIntersection, float maxdeltaz, float maxdeltaphi)
161-
{
162-
return VertexerTraits::getBinsRect(currentCluster, layerIndex, directionZIntersection, maxdeltaz, maxdeltaphi, mIndexTableUtils);
163-
}
164-
165131
} // namespace its
166132
} // namespace o2
167133
#endif

Detectors/ITSMFT/ITS/tracking/src/TrackerTraits.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void TrackerTraits<NLayers>::computeLayerTracklets(const int iteration, int iVer
114114
const auto bins = o2::its::getBinsRect(currentCluster, iLayer + 1, zAtRmin, zAtRmax,
115115
sigmaZ * mTrkParams[iteration].NSigmaCut, mTimeFrame->getPhiCut(iLayer),
116116
mTimeFrame->getIndexTableUtils());
117-
if (bins.x == 0 && bins.y == 0 && bins.z == 0 && bins.w == 0) {
117+
if (bins.x < 0) {
118118
continue;
119119
}
120120
int phiBinsNum = bins.w - bins.y + 1;

Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ void trackleterKernelHost(
5858
for (int iCurrentLayerClusterIndex = 0; iCurrentLayerClusterIndex < clustersCurrentLayer.size(); ++iCurrentLayerClusterIndex) {
5959
int storedTracklets{0};
6060
const Cluster& currentCluster{clustersCurrentLayer[iCurrentLayerClusterIndex]};
61-
const int4 selectedBinsRect{VertexerTraits<NLayers>::getBinsRect(currentCluster, (int)Mode, 0.f, 50.f, phiCut / 2, utils)};
62-
if (selectedBinsRect.x != 0 || selectedBinsRect.y != 0 || selectedBinsRect.z != 0 || selectedBinsRect.w != 0) {
61+
const int4 selectedBinsRect{o2::its::getBinsRect(currentCluster, (int)Mode + 1, 0.f, 0.f, 100.f, phiCut / 2, utils)};
62+
if (selectedBinsRect.x >= 0) {
6363
int phiBinsNum{selectedBinsRect.w - selectedBinsRect.y + 1};
6464
if (phiBinsNum < 0) {
6565
phiBinsNum += PhiBins;

0 commit comments

Comments
 (0)