@@ -308,6 +308,11 @@ void TrackerTraitsGPU<NLayers>::findRoads(const int iteration)
308308 firstClusters.resize (this ->mTrkParams [iteration].NLayers );
309309 sharedFirstClusters.resize (this ->mTrkParams [iteration].NLayers );
310310 const auto hostTopology = mTimeFrameGPU ->getTrackingTopologyView ();
311+ const bool extendTop = this ->mTrkParams [iteration].PassFlags [IterationStep::TrackFollowerTop];
312+ const bool extendBot = this ->mTrkParams [iteration].PassFlags [IterationStep::TrackFollowerBot];
313+ const bool extendTracks = extendTop || extendBot;
314+ int nExtendedTracks{0 };
315+ int nExtendedClusters{0 };
311316 for (int startLevel{this ->mTrkParams [iteration].CellsPerRoad ()}; startLevel >= this ->mTrkParams [iteration].CellMinimumLevel (); --startLevel) {
312317 bounded_vector<TrackSeed<NLayers>> trackSeeds (this ->getMemoryPool ().get ());
313318 for (int startCellTopologyId{0 }; startCellTopologyId < hostTopology.nCells ; ++startCellTopologyId) {
@@ -357,7 +362,6 @@ void TrackerTraitsGPU<NLayers>::findRoads(const int iteration)
357362 this ->mTrkParams [iteration].LayerxX0 ,
358363 trackSeeds.size (),
359364 this ->mBz ,
360- startLevel,
361365 this ->mTrkParams [iteration].MaxChi2ClusterAttachment ,
362366 this ->mTrkParams [iteration].MaxChi2NDF ,
363367 this ->mTrkParams [iteration].ReseedIfShorter ,
@@ -367,32 +371,66 @@ void TrackerTraitsGPU<NLayers>::findRoads(const int iteration)
367371 this ->mTrkParams [iteration].CorrType ,
368372 mTimeFrameGPU ->getFrameworkAllocator ());
369373 mTimeFrameGPU ->createTrackITSExtDevice (trackSeeds.size ());
374+ if (extendTracks) {
375+ mTimeFrameGPU ->createTrackExtensionScratchDevice (kTrackExtensionLaunchThreads , this ->mTrkParams [iteration].TrackFollowerBeamWidth );
376+ }
370377 computeTrackSeedHandler (mTimeFrameGPU ->getDeviceTrackSeeds (),
371378 mTimeFrameGPU ->getDeviceArrayTrackingFrameInfo (),
372379 mTimeFrameGPU ->getDeviceArrayUnsortedClusters (),
380+ mTimeFrameGPU ->getDeviceIndexTableUtils (),
381+ mTimeFrameGPU ->getDeviceROFMaskTableView (),
382+ mTimeFrameGPU ->getDeviceROFOverlapTableView (),
383+ mTimeFrameGPU ->getDeviceArrayClusters (),
384+ (const unsigned char **)mTimeFrameGPU ->getDeviceArrayUsedClusters (),
385+ mTimeFrameGPU ->getDeviceArrayClustersIndexTables (),
386+ mTimeFrameGPU ->getDeviceROFrameClusters (),
373387 mTimeFrameGPU ->getDeviceTrackITSExt (),
374388 mTimeFrameGPU ->getDeviceTrackSeedsLUT (),
389+ extendTracks ? mTimeFrameGPU ->getDeviceActiveTrackExtensionHypotheses () : nullptr ,
390+ extendTracks ? mTimeFrameGPU ->getDeviceNextTrackExtensionHypotheses () : nullptr ,
375391 this ->mTrkParams [iteration].LayerRadii ,
376392 this ->mTrkParams [iteration].MinPt ,
377393 this ->mTrkParams [iteration].LayerxX0 ,
378394 trackSeeds.size (),
379395 mTimeFrameGPU ->getNTrackSeeds (),
380396 this ->mBz ,
381- startLevel,
382397 this ->mTrkParams [iteration].MaxChi2ClusterAttachment ,
383398 this ->mTrkParams [iteration].MaxChi2NDF ,
384399 this ->mTrkParams [iteration].ReseedIfShorter ,
385400 this ->mTrkParams [iteration].RepeatRefitOut ,
386401 this ->mTrkParams [iteration].ShiftRefToCluster ,
402+ this ->mTrkParams [iteration].NLayers ,
403+ this ->mTrkParams [iteration].PhiBins ,
404+ this ->mTrkParams [iteration].TrackFollowerBeamWidth ,
405+ extendTop,
406+ extendBot,
407+ this ->mTrkParams [iteration].TrackFollowerNSigmaCutPhi ,
408+ this ->mTrkParams [iteration].TrackFollowerNSigmaCutZ ,
387409 mTimeFrameGPU ->getDevicePropagator (),
388410 this ->mTrkParams [iteration].CorrType ,
389411 mTimeFrameGPU ->getFrameworkAllocator ());
390412 mTimeFrameGPU ->downloadTrackITSExtDevice ();
391413
392414 auto & tracks = mTimeFrameGPU ->getTrackITSExt ();
415+ const auto previousAcceptedTracks = this ->mTimeFrame ->getTracks ().size ();
393416 this ->acceptTracks (iteration, tracks, firstClusters, sharedFirstClusters);
417+ if (extendTracks) {
418+ for (auto iTrack{previousAcceptedTracks}; iTrack < this ->mTimeFrame ->getTracks ().size (); ++iTrack) {
419+ const auto diff = (this ->mTimeFrame ->getTracks ()[iTrack].getPattern () >> kExtendedPatternShift ) & makeAddedClustersPatternMask<NLayers>();
420+ if (!diff) {
421+ continue ;
422+ }
423+ ++nExtendedTracks;
424+ for (int iLayer{0 }; iLayer < this ->mTrkParams [iteration].NLayers ; ++iLayer) {
425+ nExtendedClusters += (diff >> iLayer) & 0x1u ;
426+ }
427+ }
428+ }
394429 mTimeFrameGPU ->loadUsedClustersDevice ();
395430 }
431+ if (extendTracks) {
432+ LOGP (info, " Integrated track extension accepted {} tracks using {} clusters in iteration {}" , nExtendedTracks, nExtendedClusters, iteration);
433+ }
396434 this ->markTracks (iteration, sharedFirstClusters);
397435 // wipe the artefact memory
398436 mTimeFrameGPU ->popMemoryStack (iteration);
0 commit comments