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