Skip to content

Commit 14220dd

Browse files
committed
ITS: second round of comments
1 parent b74614f commit 14220dd

3 files changed

Lines changed: 14 additions & 13 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
@@ -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 & 12 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>
@@ -763,7 +772,7 @@ void TrackerTraits<NLayers>::findRoads(const int iteration)
763772
const auto minSeedingClusters = mTrkParams[iteration].getMinSeedingClusters();
764773
for (int startLevel{mTrkParams[iteration].CellsPerRoad()}; startLevel >= mTrkParams[iteration].CellMinimumLevel(); --startLevel) {
765774

766-
const track::TrackSeedSelector<NLayers> seedFilter{1.e3f, mTrkParams[iteration].MaxChi2NDF, startLevel, mTrkParams[iteration].MaxHoles, minSeedingClusters, mTrkParams[iteration].HoleLayerMask, nonSeedingLayerMask};
775+
const track::TrackSeedSelector<NLayers> seedFilter{constants::MaxTrackSeedQ2Pt, mTrkParams[iteration].MaxChi2NDF, startLevel, mTrkParams[iteration].MaxHoles, minSeedingClusters, mTrkParams[iteration].HoleLayerMask, nonSeedingLayerMask};
767776

768777
bounded_vector<TrackSeedN> trackSeeds(mMemoryPool.get());
769778
for (int startCellTopologyId{0}; startCellTopologyId < topology.nCells; ++startCellTopologyId) {
@@ -853,18 +862,14 @@ void TrackerTraits<NLayers>::acceptTracks(int iteration,
853862
auto& trks = mTimeFrame->getTracks();
854863
trks.reserve(trks.size() + tracks.size());
855864
const float smallestROFHalf = mTimeFrame->getROFOverlapTableView().getClockLayer().mROFLength * 0.5f;
856-
const int minTrackLength = mTrkParams[iteration].MinTrackLength;
857-
const LayerMask inactiveLayerMask = mTrkParams[iteration].InactiveLayerMask;
858865
for (auto& track : tracks) {
859866
int nShared = 0;
860867
bool isFirstShared{false};
861868
int firstLayer{-1}, firstCluster{-1};
862-
LayerMask hitLayerMask{0};
863869
for (int iLayer{0}; iLayer < mTrkParams[iteration].NLayers; ++iLayer) {
864870
if (track.getClusterIndex(iLayer) == constants::UnusedIndex) {
865871
continue;
866872
}
867-
hitLayerMask.set(iLayer);
868873
bool isShared = mTimeFrame->isClusterUsed(iLayer, track.getClusterIndex(iLayer));
869874
nShared += int(isShared);
870875
if (firstLayer < 0) {
@@ -874,11 +879,6 @@ void TrackerTraits<NLayers>::acceptTracks(int iteration,
874879
}
875880
}
876881

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-
882882
/// do not account for the first cluster in the shared clusters number if it is allowed
883883
if (nShared - int(isFirstShared && mTrkParams[iteration].AllowSharingFirstCluster) > mTrkParams[iteration].SharedMaxClusters) {
884884
continue;

0 commit comments

Comments
 (0)