Skip to content

Commit dc5ee3b

Browse files
committed
Update settings
1 parent f0da3fe commit dc5ee3b

2 files changed

Lines changed: 48 additions & 4 deletions

File tree

‎GPU/GPUTracking/Definitions/GPUSettingsList.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ AddOptionRTC(dEdxClusterRejectionFlagMaskAlt, int8_t, o2::gpu::GPUTPCGMMergedTra
168168
AddOptionRTC(rejectEdgeClustersInSeeding, int8_t, 0, "", 0, "Reject edge clusters based on uncorrected track Y during seeding")
169169
AddOptionRTC(rejectEdgeClustersInTrackFit, int8_t, 0, "", 0, "Reject edge clusters based on uncorrected track Y during track fit")
170170
AddOptionRTC(useNNClusterDirection, int8_t, 0, "", 0, "Use TPC NN cluster direction estimate in track seeding")
171+
AddOptionRTC(useRandomClusterDirection, int8_t, 0, "", 0, "Use random cluster direction estimate in track seeding")
171172
AddOptionRTC(tubeExtraProtectMinRow, uint8_t, 20, "", 0, "Increase Protection, decrease removal by factor 2, when below this row")
172173
AddOptionRTC(tubeExtraProtectEdgePads, uint8_t, 2, "", 0, "Increase Protection, decrease removal by factor 2, when on this number of pads from the edge")
173174

‎GPU/GPUTracking/SectorTracker/GPUTPCNeighboursFinder.cxx‎

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,46 @@ GPUdii() void GPUTPCNeighboursFinder::Thread<0>(int32_t /*nBlocks*/, int32_t nTh
122122
const float z = z0 + hitData.y * stepZ;
123123
float nnDydx = 0.f, nnDzdx = 0.f;
124124
const bool useNNDir = tracker.Param().rec.tpc.useNNClusterDirection && tracker.HitNNDirection(row, ih, nnDydx, nnDzdx) && CAMath::Abs(nnDydx) < 10.f && CAMath::Abs(nnDzdx) < 10.f;
125+
const bool useRandDir = tracker.Param().rec.tpc.useRandomClusterDirection && !useNNDir;
126+
127+
// Reproducible GPU-compatible uniform random directions for this sector/hit.
128+
// Change randomSeed to repeat the experiment with a different realization.
129+
constexpr uint32_t randomSeed = 0x12345678u;
130+
float randomDirections[4];
131+
if(useRandDir) {
132+
for (uint32_t draw = 0; draw < 4; draw++) {
133+
uint32_t randomBits = randomSeed ^ (tracker.ISector() * 0x9e3779b9u) ^
134+
(static_cast<uint32_t>(lHitNumberOffset + ih) * 0x85ebca6bu) ^
135+
((draw + 1u) * 0xc2b2ae35u);
136+
randomBits ^= randomBits >> 16;
137+
randomBits *= 0x7feb352du;
138+
randomBits ^= randomBits >> 15;
139+
randomBits *= 0x846ca68bu;
140+
randomBits ^= randomBits >> 16;
141+
randomDirections[draw] = -5.f + 10.f * static_cast<float>(randomBits >> 8) / 16777215.f;
142+
}
143+
}
125144

126145
uint32_t nNeighUp = 0;
127146
float minZ, maxZ, minY, maxY;
128147
int32_t binYmin, binYmax, binZmin, binZmax;
129148
int32_t nY;
130149

131150
{ // area in the upper row
132-
const float yy = useNNDir ? y + nnDydx * s.mUpDx : y * s.mUpTx;
133-
const float zz = useNNDir ? z + nnDzdx * s.mUpDx : z * kAreaSlopeZUp;
151+
float yy = y;
152+
float zz = z;
153+
if (useRandDir) {
154+
const float randFloatDyDx = randomDirections[0];
155+
const float randFloatDzDx = randomDirections[1];
156+
yy += randFloatDyDx * s.mUpDx;
157+
zz += randFloatDzDx * s.mUpDx;
158+
} else if (useNNDir) {
159+
yy += nnDydx * s.mUpDx;
160+
zz += nnDzdx * s.mUpDx;
161+
} else {
162+
yy *= s.mUpTx;
163+
zz *= kAreaSlopeZUp;
164+
}
134165
minZ = zz - kAreaSizeZUp;
135166
maxZ = zz + kAreaSizeZUp;
136167
minY = yy - kAreaSizeY;
@@ -198,8 +229,20 @@ GPUdii() void GPUTPCNeighboursFinder::Thread<0>(int32_t /*nBlocks*/, int32_t nTh
198229
}
199230

200231
{ // area in the lower row
201-
const float yy = useNNDir ? y + nnDydx * s.mDnDx : y * s.mDnTx;
202-
const float zz = useNNDir ? z + nnDzdx * s.mDnDx : z * kAreaSlopeZDn;
232+
float yy = y;
233+
float zz = z;
234+
if (useRandDir) {
235+
const float randFloatDyDx = randomDirections[2];
236+
const float randFloatDzDx = randomDirections[3];
237+
yy += randFloatDyDx * s.mDnDx;
238+
zz += randFloatDzDx * s.mDnDx;
239+
} else if (useNNDir) {
240+
yy += nnDydx * s.mDnDx;
241+
zz += nnDzdx * s.mDnDx;
242+
} else {
243+
yy *= s.mDnTx;
244+
zz *= kAreaSlopeZDn;
245+
}
203246
minZ = zz - kAreaSizeZDn;
204247
maxZ = zz + kAreaSizeZDn;
205248
minY = yy - kAreaSizeY;

0 commit comments

Comments
 (0)