@@ -369,7 +369,7 @@ GPUg() void computeLayerCellsKernel(
369369 const Cluster** sortedClusters,
370370 const Cluster** unsortedClusters,
371371 const TrackingFrameInfo** tfInfo,
372- const Tracklet** tracklets,
372+ Tracklet** tracklets,
373373 int ** trackletsLUT,
374374 const int nTrackletsCurrent,
375375 const int layer,
@@ -462,11 +462,11 @@ GPUg() void computeLayerTrackletsMultiROFKernel(
462462 const int * rofPV,
463463 const int nVertices,
464464 const int vertexId,
465- const Cluster** clusters, // input data rof0
465+ const Cluster** clusters, // Input data rof0
466466 const int ** ROFClusters, // Number of clusters on layers per ROF
467467 const unsigned char ** usedClusters, // Used clusters
468- const int ** indexTables, // input data rof0-delta <rof0< rof0+delta (up to 3 rofs)
469- Tracklet* tracklets, // output data
468+ const int ** indexTables, // Input data rof0-delta <rof0< rof0+delta (up to 3 rofs)
469+ Tracklet** tracklets, // Output data
470470 int ** trackletsLUT,
471471 const int iteration,
472472 const float NSigmaCut,
@@ -475,18 +475,18 @@ GPUg() void computeLayerTrackletsMultiROFKernel(
475475 const float minR,
476476 const float maxR,
477477 const float positionResolution,
478- const float meanDeltaR = -666 .f,
479- const float MSAngle = -666 .f)
478+ const float meanDeltaR = -42 .f,
479+ const float MSAngle = -42 .f)
480480{
481481 const int phiBins{utils->getNphiBins ()};
482482 const int zBins{utils->getNzBins ()};
483483 for (unsigned int iROF{blockIdx .x }; iROF < endROF - startROF; iROF += gridDim .x ) {
484- const int rof0 = iROF + startROF;
484+ const short rof0 = iROF + startROF;
485485 auto primaryVertices = getPrimaryVertices (rof0, rofPV, totalROFs, multMask, vertices);
486486 const auto startVtx{vertexId >= 0 ? vertexId : 0 };
487487 const auto endVtx{vertexId >= 0 ? o2::gpu::CAMath::Min (vertexId + 1 , static_cast <int >(primaryVertices.size ())) : static_cast <int >(primaryVertices.size ())};
488- auto minROF = o2::gpu::CAMath::Max (startROF, static_cast <int >(rof0 - deltaROF));
489- auto maxROF = o2::gpu::CAMath::Min (endROF - 1 , static_cast <int >(rof0 + deltaROF));
488+ const short minROF = o2::gpu::CAMath::Max (startROF, static_cast <int >(rof0 - deltaROF));
489+ const short maxROF = o2::gpu::CAMath::Min (endROF - 1 , static_cast <int >(rof0 + deltaROF));
490490 auto clustersCurrentLayer = getClustersOnLayer (rof0, totalROFs, layerIndex, ROFClusters, clusters);
491491 if (clustersCurrentLayer.empty ()) {
492492 continue ;
@@ -523,7 +523,7 @@ GPUg() void computeLayerTrackletsMultiROFKernel(
523523 }
524524
525525 const int tableSize{phiBins * zBins + 1 };
526- for (int rof1{minROF}; rof1 <= maxROF; ++rof1) {
526+ for (short rof1{minROF}; rof1 <= maxROF; ++rof1) {
527527 auto clustersNextLayer = getClustersOnLayer (rof1, totalROFs, layerIndex + 1 , ROFClusters, clusters);
528528 if (clustersNextLayer.empty ()) {
529529 continue ;
@@ -534,26 +534,24 @@ GPUg() void computeLayerTrackletsMultiROFKernel(
534534 const int maxBinIndex{firstBinIndex + selectedBinsRect.z - selectedBinsRect.x + 1 };
535535 const int firstRowClusterIndex = indexTables[layerIndex + 1 ][(rof1 - startROF) * tableSize + firstBinIndex];
536536 const int maxRowClusterIndex = indexTables[layerIndex + 1 ][(rof1 - startROF) * tableSize + maxBinIndex];
537- for (int iNextCluster {firstRowClusterIndex}; iNextCluster < maxRowClusterIndex; ++iNextCluster ) {
538- if (iNextCluster >= clustersNextLayer.size ()) {
537+ for (int nextClusterIndex {firstRowClusterIndex}; nextClusterIndex < maxRowClusterIndex; ++nextClusterIndex ) {
538+ if (nextClusterIndex >= clustersNextLayer.size ()) {
539539 break ;
540540 }
541- const Cluster& nextCluster{clustersNextLayer[iNextCluster ]};
541+ const Cluster& nextCluster{clustersNextLayer[nextClusterIndex ]};
542542 if (usedClusters[layerIndex + 1 ][nextCluster.clusterId ]) {
543543 continue ;
544544 }
545545 const float deltaPhi{o2::gpu::CAMath::Abs (currentCluster.phi - nextCluster.phi )};
546- const float deltaZ{o2::gpu::CAMath::Abs (tanLambda * (nextCluster.radius - currentCluster.radius ) +
547- currentCluster. zCoordinate - nextCluster. zCoordinate ) };
546+ const float deltaZ{o2::gpu::CAMath::Abs (tanLambda * (nextCluster.radius - currentCluster.radius ) + currentCluster. zCoordinate - nextCluster. zCoordinate )};
547+ const int nextSortedIndex{ROFClusters[layerIndex + 1 ][rof1] + nextClusterIndex };
548548 if (deltaZ / sigmaZ < NSigmaCut && (deltaPhi < phiCut || o2::gpu::CAMath::Abs (deltaPhi - constants::math::TwoPi) < phiCut)) {
549- // if (layerIndex > 0) {
550549 if constexpr (initRun) {
551550 trackletsLUT[layerIndex][currentSortedIndex]++; // we need l0 as well for usual exclusive sums.
552551 } else {
553- // }
554552 const float phi{o2::gpu::CAMath::ATan2 (currentCluster.yCoordinate - nextCluster.yCoordinate , currentCluster.xCoordinate - nextCluster.xCoordinate )};
555553 const float tanL{(currentCluster.zCoordinate - nextCluster.zCoordinate ) / (currentCluster.radius - nextCluster.radius )};
556- // tf->getTracklets() [layerIndex].emplace_back(currentSortedIndex, tf->getSortedIndex(rof1, layerIndex + 1, iNextCluster) , tanL, phi, rof0, rof1) ;
554+ new (tracklets [layerIndex] + trackletsLUT[ layerIndex][currentSortedIndex] + storedTracklets) Tracklet{currentSortedIndex, nextSortedIndex , tanL, phi, rof0, rof1} ;
557555 }
558556 ++storedTracklets;
559557 }
@@ -809,7 +807,7 @@ void computeTrackletsInROFsHandler(const IndexTableUtils* utils,
809807 const int ** ROFClusters,
810808 const unsigned char ** usedClusters,
811809 const int ** clustersIndexTables,
812- Tracklet* tracklets,
810+ Tracklet** tracklets,
813811 int ** trackletsLUTs,
814812 const int iteration,
815813 const float NSigmaCut,
@@ -859,7 +857,7 @@ void countCellsHandler(
859857 const Cluster** sortedClusters,
860858 const Cluster** unsortedClusters,
861859 const TrackingFrameInfo** tfInfo,
862- const Tracklet** tracklets,
860+ Tracklet** tracklets,
863861 int ** trackletsLUT,
864862 const int nTracklets,
865863 const int layer,
@@ -909,7 +907,7 @@ void computeCellsHandler(
909907 const Cluster** sortedClusters,
910908 const Cluster** unsortedClusters,
911909 const TrackingFrameInfo** tfInfo,
912- const Tracklet** tracklets,
910+ Tracklet** tracklets,
913911 int ** trackletsLUT,
914912 const int nTracklets,
915913 const int layer,
@@ -1128,7 +1126,7 @@ template void computeTrackletsInROFsHandler<7>(const IndexTableUtils* utils,
11281126 const int ** ROFClusters,
11291127 const unsigned char ** usedClusters,
11301128 const int ** clustersIndexTables,
1131- Tracklet* tracklets,
1129+ Tracklet** tracklets,
11321130 int ** trackletsLUTs,
11331131 const int iteration,
11341132 const float NSigmaCut,
0 commit comments