Skip to content

Commit d5d30e7

Browse files
committed
ITS: rename away from beam for the track follower
1 parent 2a2b4b9 commit d5d30e7

10 files changed

Lines changed: 46 additions & 46 deletions

File tree

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TimeFrameGPU.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class TimeFrameGPU : public TimeFrame<NLayers>
9191
void createNeighboursDevice(const unsigned int layer);
9292
void createNeighboursLUTDevice(const int, const unsigned int);
9393
void createTrackITSExtDevice(const size_t);
94-
void createTrackExtensionScratchDevice(const int nThreads, const int beamWidth);
94+
void createTrackExtensionScratchDevice(const int nThreads, const int maxHypotheses);
9595
void downloadTrackITSExtDevice();
9696
void downloadCellsNeighboursDevice(std::vector<bounded_vector<CellNeighbour>>&, const int);
9797
void downloadNeighboursLUTDevice(bounded_vector<int>&, const int);

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TrackingKernels.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ void computeTrackSeedHandler(TrackSeed<NLayers>* trackSeeds,
247247
const bool shiftRefToCluster,
248248
const int nLayers,
249249
const int phiBins,
250-
const int beamWidth,
250+
const int maxHypotheses,
251251
const bool extendTop,
252252
const bool extendBot,
253253
const float nSigmaCutPhi,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,10 +583,10 @@ void TimeFrameGPU<NLayers>::createTrackITSExtDevice(const size_t nSeeds)
583583
}
584584

585585
template <int NLayers>
586-
void TimeFrameGPU<NLayers>::createTrackExtensionScratchDevice(const int nThreads, const int beamWidth)
586+
void TimeFrameGPU<NLayers>::createTrackExtensionScratchDevice(const int nThreads, const int maxHypotheses)
587587
{
588588
GPUTimer timer("reserving track extension scratch");
589-
const size_t nHypotheses = static_cast<size_t>(std::max(1, nThreads)) * std::max(1, beamWidth);
589+
const size_t nHypotheses = static_cast<size_t>(std::max(1, nThreads)) * std::max(1, maxHypotheses);
590590
GPULog("gpu-allocation: reserving {} track extension hypotheses per scratch buffer, for {:.2f} MB each.", nHypotheses, nHypotheses * sizeof(o2::its::TrackExtensionHypothesis<NLayers>) / constants::MB);
591591
mActiveTrackExtensionHypothesesDevice = nullptr;
592592
mNextTrackExtensionHypothesesDevice = nullptr;

Detectors/ITSMFT/ITS/tracking/GPU/cuda/TrackerTraitsGPU.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ void TrackerTraitsGPU<NLayers>::findRoads(const int iteration)
371371
mTimeFrameGPU->getFrameworkAllocator());
372372
mTimeFrameGPU->createTrackITSExtDevice(trackSeeds.size());
373373
if (extendTracks) {
374-
mTimeFrameGPU->createTrackExtensionScratchDevice(trackExtensionLaunchThreads, this->mTrkParams[iteration].TrackFollowerBeamWidth);
374+
mTimeFrameGPU->createTrackExtensionScratchDevice(trackExtensionLaunchThreads, this->mTrkParams[iteration].TrackFollowerMaxHypotheses);
375375
}
376376
computeTrackSeedHandler(mTimeFrameGPU->getDeviceTrackSeeds(),
377377
mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
@@ -400,7 +400,7 @@ void TrackerTraitsGPU<NLayers>::findRoads(const int iteration)
400400
this->mTrkParams[iteration].ShiftRefToCluster,
401401
this->mTrkParams[iteration].NLayers,
402402
this->mTrkParams[iteration].PhiBins,
403-
this->mTrkParams[iteration].TrackFollowerBeamWidth,
403+
this->mTrkParams[iteration].TrackFollowerMaxHypotheses,
404404
extendTop,
405405
extendBot,
406406
this->mTrkParams[iteration].TrackFollowerNSigmaCutPhi,

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ GPUg() void __launch_bounds__(256, 1) fitTrackSeedsKernel(
206206
const bool shiftRefToCluster,
207207
const int nLayers,
208208
const int phiBins,
209-
const int beamWidthConfig,
209+
const int maxHypothesesConfig,
210210
const bool extendTop,
211211
const bool extendBot,
212212
const float nSigmaCutPhi,
@@ -236,10 +236,10 @@ GPUg() void __launch_bounds__(256, 1) fitTrackSeedsKernel(
236236
repeatRefitOut);
237237
if (refitSuccess) {
238238
if ((extendTop || extendBot) && activeHypothesesScratch && nextHypothesesScratch) {
239-
const int beamWidth = o2::gpu::CAMath::Max(beamWidthConfig, 1);
239+
const int maxHypotheses = o2::gpu::CAMath::Max(maxHypothesesConfig, 1);
240240
const int threadIndex = blockIdx.x * blockDim.x + threadIdx.x;
241-
auto* activeHypotheses = activeHypothesesScratch + threadIndex * beamWidth;
242-
auto* nextHypotheses = nextHypothesesScratch + threadIndex * beamWidth;
241+
auto* activeHypotheses = activeHypothesesScratch + threadIndex * maxHypotheses;
242+
auto* nextHypotheses = nextHypothesesScratch + threadIndex * maxHypotheses;
243243
const auto backupPattern = temporaryTrack.getPattern();
244244
auto best = temporaryTrack;
245245
uint32_t bestDiff{0};
@@ -266,7 +266,7 @@ GPUg() void __launch_bounds__(256, 1) fitTrackSeedsKernel(
266266
layerxX0,
267267
nLayers,
268268
phiBins,
269-
beamWidth,
269+
maxHypotheses,
270270
bz,
271271
maxChi2ClusterAttachment,
272272
maxChi2NDF,
@@ -301,7 +301,7 @@ GPUg() void __launch_bounds__(256, 1) fitTrackSeedsKernel(
301301
layerxX0,
302302
nLayers,
303303
phiBins,
304-
beamWidth,
304+
maxHypotheses,
305305
bz,
306306
maxChi2ClusterAttachment,
307307
maxChi2NDF,
@@ -337,7 +337,7 @@ GPUg() void __launch_bounds__(256, 1) fitTrackSeedsKernel(
337337
layerxX0,
338338
nLayers,
339339
phiBins,
340-
beamWidth,
340+
maxHypotheses,
341341
bz,
342342
maxChi2ClusterAttachment,
343343
maxChi2NDF,
@@ -370,7 +370,7 @@ GPUg() void __launch_bounds__(256, 1) fitTrackSeedsKernel(
370370
layerxX0,
371371
nLayers,
372372
phiBins,
373-
beamWidth,
373+
maxHypotheses,
374374
bz,
375375
maxChi2ClusterAttachment,
376376
maxChi2NDF,
@@ -1343,7 +1343,7 @@ void computeTrackSeedHandler(TrackSeed<NLayers>* trackSeeds,
13431343
const bool shiftRefToCluster,
13441344
const int nLayers,
13451345
const int phiBins,
1346-
const int beamWidth,
1346+
const int maxHypotheses,
13471347
const bool extendTop,
13481348
const bool extendBot,
13491349
const float nSigmaCutPhi,
@@ -1382,7 +1382,7 @@ void computeTrackSeedHandler(TrackSeed<NLayers>* trackSeeds,
13821382
shiftRefToCluster, // bool
13831383
nLayers, // int
13841384
phiBins, // int
1385-
beamWidth, // int
1385+
maxHypotheses, // int
13861386
extendTop, // bool
13871387
extendBot, // bool
13881388
nSigmaCutPhi, // float
@@ -1584,7 +1584,7 @@ template void computeTrackSeedHandler(TrackSeed<7>* trackSeeds,
15841584
const bool shiftRefToCluster,
15851585
const int nLayers,
15861586
const int phiBins,
1587-
const int beamWidth,
1587+
const int maxHypotheses,
15881588
const bool extendTop,
15891589
const bool extendBot,
15901590
const float nSigmaCutPhi,
@@ -1784,7 +1784,7 @@ template void computeTrackSeedHandler(TrackSeed<11>* trackSeeds,
17841784
const bool shiftRefToCluster,
17851785
const int nLayers,
17861786
const int phiBins,
1787-
const int beamWidth,
1787+
const int maxHypotheses,
17881788
const bool extendTop,
17891789
const bool extendBot,
17901790
const float nSigmaCutPhi,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct TrackingParameters {
9898
bool CreateArtefactLabels{false};
9999
float TrackFollowerNSigmaCutZ = 1.f;
100100
float TrackFollowerNSigmaCutPhi = 1.f;
101-
int TrackFollowerBeamWidth = 1;
101+
int TrackFollowerMaxHypotheses = 1;
102102
bool PrintMemory = false; // print allocator usage in epilog report
103103
size_t MaxMemory = std::numeric_limits<size_t>::max();
104104
bool DropTFUponFailure = false;

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
/// \file TrackFollower.h
13-
/// \brief Beam search used by CPU and GPU track extension.
13+
/// \brief Hypothesis search used by CPU and GPU track extension.
1414

1515
#ifndef TRACKINGITSU_INCLUDE_TRACKFOLLOWER_H_
1616
#define TRACKINGITSU_INCLUDE_TRACKFOLLOWER_H_
@@ -31,24 +31,24 @@ namespace o2::its
3131
{
3232

3333
template <int NLayers>
34-
GPUhdi() void addTrackExtensionHypothesisToBeam(const TrackExtensionHypothesis<NLayers>& hypo,
35-
TrackExtensionHypothesis<NLayers>* beam,
36-
int& nBeam,
37-
const int beamWidth)
34+
GPUhdi() void keepTrackExtensionHypothesis(const TrackExtensionHypothesis<NLayers>& hypo,
35+
TrackExtensionHypothesis<NLayers>* keptHypotheses,
36+
int& nKeptHypotheses,
37+
const int maxHypotheses)
3838
{
39-
if (nBeam < beamWidth) {
40-
beam[nBeam++] = hypo;
39+
if (nKeptHypotheses < maxHypotheses) {
40+
keptHypotheses[nKeptHypotheses++] = hypo;
4141
return;
4242
}
4343

4444
int worst{0};
45-
for (int i{1}; i < nBeam; ++i) {
46-
if (track::isBetter(beam[worst].nClusters, beam[worst].chi2, beam[i].nClusters, beam[i].chi2)) {
45+
for (int i{1}; i < nKeptHypotheses; ++i) {
46+
if (track::isBetter(keptHypotheses[worst].nClusters, keptHypotheses[worst].chi2, keptHypotheses[i].nClusters, keptHypotheses[i].chi2)) {
4747
worst = i;
4848
}
4949
}
50-
if (track::isBetter(hypo.nClusters, hypo.chi2, beam[worst].nClusters, beam[worst].chi2)) {
51-
beam[worst] = hypo;
50+
if (track::isBetter(hypo.nClusters, hypo.chi2, keptHypotheses[worst].nClusters, keptHypotheses[worst].chi2)) {
51+
keptHypotheses[worst] = hypo;
5252
}
5353
}
5454

@@ -86,7 +86,7 @@ GPUhdi() bool followTrackExtensionDirection(const TrackExtensionHypothesis<NLaye
8686
const float* layerxX0,
8787
const int nLayers,
8888
const int phiBins,
89-
const int beamWidthConfig,
89+
const int maxHypothesesConfig,
9090
const float bz,
9191
const float maxChi2ClusterAttachment,
9292
const float maxChi2NDF,
@@ -101,7 +101,7 @@ GPUhdi() bool followTrackExtensionDirection(const TrackExtensionHypothesis<NLaye
101101
{
102102
const int step = outward ? 1 : -1;
103103
const int end = outward ? nLayers - 1 : 0;
104-
const int beamWidth = o2::gpu::CAMath::Max(beamWidthConfig, 1);
104+
const int maxHypotheses = o2::gpu::CAMath::Max(maxHypothesesConfig, 1);
105105
int nActive{1};
106106
int nNext{0};
107107
activeHypotheses[0] = startHypothesis;
@@ -191,11 +191,11 @@ GPUhdi() bool followTrackExtensionDirection(const TrackExtensionHypothesis<NLaye
191191
++updated.nClusters;
192192
updated.edgeLayer = iLayer;
193193
updated.time += rofOverlaps.getLayer(iLayer).getROFTimeBounds(rof, true);
194-
addTrackExtensionHypothesisToBeam(updated, nextHypotheses, nNext, beamWidth);
194+
keepTrackExtensionHypothesis(updated, nextHypotheses, nNext, maxHypotheses);
195195
}
196196
}
197197
}
198-
addTrackExtensionHypothesisToBeam(hypo, nextHypotheses, nNext, beamWidth);
198+
keepTrackExtensionHypothesis(hypo, nextHypotheses, nNext, maxHypotheses);
199199
}
200200
if (nNext == 0) {
201201
break;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ struct TrackerParamConfig : public o2::conf::ConfigurableParamHelper<TrackerPara
100100
bool trackFollowerBot[constants::MaxIter] = {};
101101
float trackFollowerNSigmaCutZ = 1.f;
102102
float trackFollowerNSigmaCutPhi = 1.f;
103-
int trackFollowerBeamWidth = 1;
103+
int trackFollowerMaxHypotheses = 1;
104104

105105
int nThreads = 1;
106106
bool printMemory = false;
107107
size_t maxMemory = std::numeric_limits<size_t>::max();
108108
bool dropTFUponFailure = false;
109-
bool fataliseUponFailure = true; // granular management of the fatalisation in async mode
109+
bool fataliseUponFailure = true; // granular management of the fatalisation in async mode
110110

111111
// Selections on tracks sharing clusters
112-
bool allowSharingFirstCluster = false; // allow first cluster sharing among tracks
112+
bool allowSharingFirstCluster = false; // allow first cluster sharing among tracks
113113
float sharedClusterMaxDeltaPhi = 0.05f; // Maximum allowed delta phi at the cluster position
114114
float sharedClusterMaxDeltaEta = 0.03f; // Maximum allowed delta eta at the cluster position
115115
bool sharedClusterOppositeSign = false; // Require opposite sign of the tracklets

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ std::string TrackingParameters::asString() const
6565
top && bot ? "mix" : (top ? "top" : "bot"),
6666
TrackFollowerNSigmaCutZ,
6767
TrackFollowerNSigmaCutPhi);
68-
if (TrackFollowerBeamWidth > 1) {
69-
str += std::format(" Beam:{}", TrackFollowerBeamWidth);
68+
if (TrackFollowerMaxHypotheses > 1) {
69+
str += std::format(" MaxHypotheses:{}", TrackFollowerMaxHypotheses);
7070
}
7171
}
7272
if (std::numeric_limits<size_t>::max() != MaxMemory) {
@@ -218,7 +218,7 @@ std::vector<TrackingParameters> TrackingMode::getTrackingParameters(TrackingMode
218218
p.CreateArtefactLabels = tc.createArtefactLabels;
219219
p.TrackFollowerNSigmaCutZ = tc.trackFollowerNSigmaCutZ;
220220
p.TrackFollowerNSigmaCutPhi = tc.trackFollowerNSigmaCutPhi;
221-
p.TrackFollowerBeamWidth = std::max(1, tc.trackFollowerBeamWidth);
221+
p.TrackFollowerMaxHypotheses = std::max(1, tc.trackFollowerMaxHypotheses);
222222

223223
p.PrintMemory = tc.printMemory;
224224
p.MaxMemory = tc.maxMemory;

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -994,12 +994,12 @@ void TrackerTraits<NLayers>::markTracks(int iteration)
994994
template <int NLayers>
995995
bool TrackerTraits<NLayers>::trackFollowing(TrackITSInternal<NLayers>* track, bool outward, const int iteration, TrackFollowerScratch& scratch)
996996
{
997-
const int beamWidth = std::max(1, mTrkParams[iteration].TrackFollowerBeamWidth);
998-
if (static_cast<int>(scratch.activeHypotheses.size()) < beamWidth) {
999-
scratch.activeHypotheses.resize(beamWidth);
997+
const int maxHypotheses = std::max(1, mTrkParams[iteration].TrackFollowerMaxHypotheses);
998+
if (static_cast<int>(scratch.activeHypotheses.size()) < maxHypotheses) {
999+
scratch.activeHypotheses.resize(maxHypotheses);
10001000
}
1001-
if (static_cast<int>(scratch.nextHypotheses.size()) < beamWidth) {
1002-
scratch.nextHypotheses.resize(beamWidth);
1001+
if (static_cast<int>(scratch.nextHypotheses.size()) < maxHypotheses) {
1002+
scratch.nextHypotheses.resize(maxHypotheses);
10031003
}
10041004

10051005
const Cluster* clustersPtrs[NLayers]{};
@@ -1031,7 +1031,7 @@ bool TrackerTraits<NLayers>::trackFollowing(TrackITSInternal<NLayers>* track, bo
10311031
mTrkParams[iteration].LayerxX0.data(),
10321032
mTrkParams[iteration].NLayers,
10331033
mTrkParams[iteration].PhiBins,
1034-
beamWidth,
1034+
maxHypotheses,
10351035
mBz,
10361036
mTrkParams[iteration].MaxChi2ClusterAttachment,
10371037
mTrkParams[iteration].MaxChi2NDF,

0 commit comments

Comments
 (0)