Skip to content

Commit 11b2171

Browse files
committed
ITS: second round of comments
1 parent b74614f commit 11b2171

4 files changed

Lines changed: 16 additions & 19 deletions

File tree

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,6 @@ void TrackerTraitsGPU<NLayers>::findRoads(const int iteration)
308308
const bool extendTop = this->mTrkParams[iteration].PassFlags[IterationStep::TrackFollowerTop];
309309
const bool extendBot = this->mTrkParams[iteration].PassFlags[IterationStep::TrackFollowerBot];
310310
const bool extendTracks = extendTop || extendBot;
311-
const auto nonSeedingLayerMask = this->mTrkParams[iteration].getNonSeedingLayerMask();
312-
const auto minSeedingClusters = this->mTrkParams[iteration].getMinSeedingClusters();
313311
for (int startLevel{this->mTrkParams[iteration].CellsPerRoad()}; startLevel >= this->mTrkParams[iteration].CellMinimumLevel(); --startLevel) {
314312
bounded_vector<TrackSeed<NLayers>> trackSeeds(this->getMemoryPool().get());
315313
for (int startCellTopologyId{0}; startCellTopologyId < hostTopology.nCells; ++startCellTopologyId) {
@@ -333,9 +331,9 @@ void TrackerTraitsGPU<NLayers>::findRoads(const int iteration)
333331
this->mTrkParams[iteration].MaxChi2ClusterAttachment,
334332
this->mTrkParams[iteration].MaxChi2NDF,
335333
this->mTrkParams[iteration].MaxHoles,
336-
minSeedingClusters,
334+
this->mTrkParams[iteration].getMinSeedingClusters(),
337335
this->mTrkParams[iteration].HoleLayerMask,
338-
nonSeedingLayerMask,
336+
this->mTrkParams[iteration].getNonSeedingLayerMask(),
339337
this->mTrkParams[iteration].LayerxX0,
340338
mTimeFrameGPU->getDevicePropagator(),
341339
this->mTrkParams[iteration].CorrType,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ void processNeighboursHandler(const int startLevel,
10941094
}
10951095
GPUChkErrS(cudaStreamSynchronize(gpu::Stream::DefaultStream));
10961096
thrust::device_vector<TrackSeed<NLayers>, gpu::TypedAllocator<TrackSeed<NLayers>>> outSeeds(updatedCellSeed.size(), allocTrackSeed);
1097-
auto end = thrust::copy_if(nosync_policy, updatedCellSeed.begin(), updatedCellSeed.end(), outSeeds.begin(), track::TrackSeedSelector<NLayers>{1.e3f, maxChi2NDF, startLevel, maxHoles, minSeedingClusters, holeLayerMask, nonSeedingLayerMask});
1097+
auto end = thrust::copy_if(nosync_policy, updatedCellSeed.begin(), updatedCellSeed.end(), outSeeds.begin(), track::TrackSeedSelector<NLayers>{constants::MaxTrackSeedQ2Pt, maxChi2NDF, startLevel, maxHoles, minSeedingClusters, holeLayerMask, nonSeedingLayerMask});
10981098
auto s{end - outSeeds.begin()};
10991099
seedsHost.reserve(seedsHost.size() + s);
11001100
thrust::copy(outSeeds.begin(), outSeeds.begin() + s, std::back_inserter(seedsHost));

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ constexpr bool DoTimeBenchmarks = true;
2929
constexpr bool SaveTimeBenchmarks = false;
3030
constexpr float Tolerance = 1e-12; // numerical tolerance
3131
constexpr int ClustersPerCell = 3; // number of clusters for a cell
32+
constexpr float MaxTrackSeedQ2Pt = 1.e3f; // maximum q/pt for track seeds
3233
constexpr int UnusedIndex = -1; // global unused flag
3334
constexpr float UnsetValue = -999.f; // global unset value
3435
constexpr float Radl = 9.36f; // Radiation length of Si [cm]

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -686,12 +686,21 @@ bool TrackerTraits<NLayers>::finaliseTrackSeed(const TrackSeedN& seed,
686686
trkParams.ReseedIfShorter)) {
687687
return false;
688688
}
689+
const auto passesFinalLengthCut = [&trkParams](const TrackITSExt& candidate) {
690+
LayerMask hitLayerMask{0};
691+
for (int iLayer{0}; iLayer < trkParams.NLayers; ++iLayer) {
692+
if (candidate.getClusterIndex(iLayer) != constants::UnusedIndex) {
693+
hitLayerMask.set(iLayer);
694+
}
695+
}
696+
return track::TrackSeedSelector<NLayers>::getEffectiveTrackLength(hitLayerMask, trkParams.InactiveLayerMask) >= trkParams.MinTrackLength;
697+
};
689698

690699
const bool extendTop = trkParams.PassFlags[IterationStep::TrackFollowerTop];
691700
const bool extendBot = trkParams.PassFlags[IterationStep::TrackFollowerBot];
692701
if (!extendTop && !extendBot) {
693702
track = makeTrackITSExt(internalTrack);
694-
return true;
703+
return passesFinalLengthCut(track);
695704
}
696705

697706
const int maxHypotheses = std::max(1, trkParams.TrackFollowerMaxHypotheses);
@@ -743,7 +752,7 @@ bool TrackerTraits<NLayers>::finaliseTrackSeed(const TrackSeedN& seed,
743752
if (bestDiff) {
744753
track.setExtendedLayerPattern<NLayers>(bestDiff);
745754
}
746-
return true;
755+
return passesFinalLengthCut(track);
747756
}
748757

749758
template <int NLayers>
@@ -759,11 +768,9 @@ void TrackerTraits<NLayers>::findRoads(const int iteration)
759768
unsortedClusters[iLayer] = mTimeFrame->getUnsortedClusters()[iLayer].data();
760769
}
761770
const auto topology = mTimeFrame->getTrackingTopologyView();
762-
const auto nonSeedingLayerMask = mTrkParams[iteration].getNonSeedingLayerMask();
763-
const auto minSeedingClusters = mTrkParams[iteration].getMinSeedingClusters();
764771
for (int startLevel{mTrkParams[iteration].CellsPerRoad()}; startLevel >= mTrkParams[iteration].CellMinimumLevel(); --startLevel) {
765772

766-
const track::TrackSeedSelector<NLayers> seedFilter{1.e3f, mTrkParams[iteration].MaxChi2NDF, startLevel, mTrkParams[iteration].MaxHoles, minSeedingClusters, mTrkParams[iteration].HoleLayerMask, nonSeedingLayerMask};
773+
const track::TrackSeedSelector<NLayers> seedFilter{constants::MaxTrackSeedQ2Pt, mTrkParams[iteration].MaxChi2NDF, startLevel, mTrkParams[iteration].MaxHoles, mTrkParams[iteration].getMinSeedingClusters(), mTrkParams[iteration].HoleLayerMask, mTrkParams[iteration].getNonSeedingLayerMask()};
767774

768775
bounded_vector<TrackSeedN> trackSeeds(mMemoryPool.get());
769776
for (int startCellTopologyId{0}; startCellTopologyId < topology.nCells; ++startCellTopologyId) {
@@ -853,18 +860,14 @@ void TrackerTraits<NLayers>::acceptTracks(int iteration,
853860
auto& trks = mTimeFrame->getTracks();
854861
trks.reserve(trks.size() + tracks.size());
855862
const float smallestROFHalf = mTimeFrame->getROFOverlapTableView().getClockLayer().mROFLength * 0.5f;
856-
const int minTrackLength = mTrkParams[iteration].MinTrackLength;
857-
const LayerMask inactiveLayerMask = mTrkParams[iteration].InactiveLayerMask;
858863
for (auto& track : tracks) {
859864
int nShared = 0;
860865
bool isFirstShared{false};
861866
int firstLayer{-1}, firstCluster{-1};
862-
LayerMask hitLayerMask{0};
863867
for (int iLayer{0}; iLayer < mTrkParams[iteration].NLayers; ++iLayer) {
864868
if (track.getClusterIndex(iLayer) == constants::UnusedIndex) {
865869
continue;
866870
}
867-
hitLayerMask.set(iLayer);
868871
bool isShared = mTimeFrame->isClusterUsed(iLayer, track.getClusterIndex(iLayer));
869872
nShared += int(isShared);
870873
if (firstLayer < 0) {
@@ -874,11 +877,6 @@ void TrackerTraits<NLayers>::acceptTracks(int iteration,
874877
}
875878
}
876879

877-
/// seeds are selected with a length cut relaxed to the seeding layers: enforce the full minimum length before accepting the final track
878-
if (track::TrackSeedSelector<NLayers>::getEffectiveTrackLength(hitLayerMask, inactiveLayerMask) < minTrackLength) {
879-
continue;
880-
}
881-
882880
/// do not account for the first cluster in the shared clusters number if it is allowed
883881
if (nShared - int(isFirstShared && mTrkParams[iteration].AllowSharingFirstCluster) > mTrkParams[iteration].SharedMaxClusters) {
884882
continue;

0 commit comments

Comments
 (0)