@@ -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
749758template <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