@@ -95,8 +95,9 @@ GPUdii() int4 getEmptyBinsRect()
9595 return int4 {0 , 0 , 0 , 0 };
9696}
9797
98+ template <int nLayers>
9899GPUdii () const int4 getBinsRect (const Cluster& currentCluster, const int layerIndex,
99- const o2::its:: IndexTableUtils& utils,
100+ const IndexTableUtils<nLayers> & utils,
100101 const float z1, const float z2, float maxdeltaz, float maxdeltaphi)
101102{
102103 const float zRangeMin = o2::gpu::CAMath::Min (z1, z2) - maxdeltaz;
@@ -331,7 +332,7 @@ GPUg() void fitTrackSeedsKernel(
331332 temporaryTrack.resetCovariance ();
332333 temporaryTrack.setChi2 (0 );
333334 auto & clusters = seed.getClusters ();
334- for (int iL{0 }; iL < 7 ; ++iL) {
335+ for (int iL{0 }; iL < nLayers ; ++iL) {
335336 temporaryTrack.setExternalClusterIndex (iL, clusters[iL], clusters[iL] != constants::UnusedIndex);
336337 }
337338 bool fitSuccess = fitTrack (temporaryTrack, // TrackITSExt& track,
@@ -523,9 +524,9 @@ GPUg() void computeLayerCellsKernel(
523524 }
524525}
525526
526- template <bool initRun>
527+ template <bool initRun, int nLayers >
527528GPUg () void computeLayerTrackletsMultiROFKernel (
528- const IndexTableUtils* utils,
529+ const IndexTableUtils<nLayers> * utils,
529530 const uint8_t * multMask,
530531 const int layerIndex,
531532 const int startROF,
@@ -601,7 +602,7 @@ GPUg() void computeLayerTrackletsMultiROFKernel(
601602 const float zAtRmax{tanLambda * (maxR - currentCluster.radius ) + currentCluster.zCoordinate };
602603 const float sqInverseDeltaZ0{1 .f / (math_utils::Sq (currentCluster.zCoordinate - primaryVertex.getZ ()) + constants::Tolerance)}; // / protecting from overflows adding the detector resolution
603604 const float sigmaZ{o2::gpu::CAMath::Sqrt (math_utils::Sq (resolution) * math_utils::Sq (tanLambda) * ((math_utils::Sq (inverseR0) + sqInverseDeltaZ0) * math_utils::Sq (meanDeltaR) + 1 .f ) + math_utils::Sq (meanDeltaR * MSAngle))};
604- const int4 selectedBinsRect{getBinsRect (currentCluster, layerIndex + 1 , *utils, zAtRmin, zAtRmax, sigmaZ * NSigmaCut, phiCut)};
605+ const int4 selectedBinsRect{getBinsRect<nLayers> (currentCluster, layerIndex + 1 , *utils, zAtRmin, zAtRmax, sigmaZ * NSigmaCut, phiCut)};
605606 if (selectedBinsRect.x == 0 && selectedBinsRect.y == 0 && selectedBinsRect.z == 0 && selectedBinsRect.w == 0 ) {
606607 continue ;
607608 }
@@ -769,7 +770,7 @@ GPUhi() void deallocateMemory(void* p, size_t bytes, cudaStream_t stream = nullp
769770} // namespace gpu
770771
771772template <int nLayers>
772- void countTrackletsInROFsHandler (const IndexTableUtils* utils,
773+ void countTrackletsInROFsHandler (const IndexTableUtils<nLayers> * utils,
773774 const uint8_t * multMask,
774775 const int layer,
775776 const int startROF,
@@ -833,7 +834,7 @@ void countTrackletsInROFsHandler(const IndexTableUtils* utils,
833834}
834835
835836template <int nLayers>
836- void computeTrackletsInROFsHandler (const IndexTableUtils* utils,
837+ void computeTrackletsInROFsHandler (const IndexTableUtils<nLayers> * utils,
837838 const uint8_t * multMask,
838839 const int layer,
839840 const int startROF,
@@ -1241,7 +1242,7 @@ void trackSeedHandler(CellSeed<nLayers>* trackSeeds,
12411242}
12421243
12431244// / Explicit instantiation of ITS2 handlers
1244- template void countTrackletsInROFsHandler<7 >(const IndexTableUtils* utils,
1245+ template void countTrackletsInROFsHandler<7 >(const IndexTableUtils< 7 > * utils,
12451246 const uint8_t * multMask,
12461247 const int layer,
12471248 const int startROF,
@@ -1273,7 +1274,7 @@ template void countTrackletsInROFsHandler<7>(const IndexTableUtils* utils,
12731274 const int nThreads,
12741275 gpu::Streams& streams);
12751276
1276- template void computeTrackletsInROFsHandler<7 >(const IndexTableUtils* utils,
1277+ template void computeTrackletsInROFsHandler<7 >(const IndexTableUtils< 7 > * utils,
12771278 const uint8_t * multMask,
12781279 const int layer,
12791280 const int startROF,
0 commit comments