diff --git a/RecoTracker/LSTCore/interface/alpaka/Constants.h b/RecoTracker/LSTCore/interface/alpaka/Constants.h index 7cb70125a427e..2050c5e0727b0 100644 --- a/RecoTracker/LSTCore/interface/alpaka/Constants.h +++ b/RecoTracker/LSTCore/interface/alpaka/Constants.h @@ -121,15 +121,27 @@ namespace SDL { //defining the constant host device variables right up here // Currently pixel tracks treated as LSs with 2 double layers (IT layers 1+2 and 3+4) and 4 hits. To be potentially handled better in the future. - struct Params_pLS { static constexpr int kLayers = 2, kHits = 4; }; - struct Params_LS { static constexpr int kLayers = 2, kHits = 4; }; - struct Params_T3 { static constexpr int kLayers = 3, kHits = 6; }; - struct Params_pT3 { static constexpr int kLayers = 5, kHits = 10; }; - struct Params_T5 { static constexpr int kLayers = 5, kHits = 10; }; - struct Params_pT5 { static constexpr int kLayers = 7, kHits = 14; }; + struct Params_pLS { + static constexpr int kLayers = 2, kHits = 4; + }; + struct Params_LS { + static constexpr int kLayers = 2, kHits = 4; + }; + struct Params_T3 { + static constexpr int kLayers = 3, kHits = 6; + }; + struct Params_pT3 { + static constexpr int kLayers = 5, kHits = 10; + }; + struct Params_T5 { + static constexpr int kLayers = 5, kHits = 10; + }; + struct Params_pT5 { + static constexpr int kLayers = 7, kHits = 14; + }; // 15 MeV constant from the approximate Bethe-Bloch formula - ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float kMulsInGeV = 0.015; + ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float kMulsInGeV = 0.015; ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float miniMulsPtScaleBarrel[6] = { 0.0052, 0.0038, 0.0034, 0.0034, 0.0032, 0.0034}; ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float miniMulsPtScaleEndcap[5] = {0.006, 0.006, 0.006, 0.006, 0.006}; diff --git a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h index b4323c03dabb0..d36150ffd48ff 100644 --- a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h +++ b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h @@ -1989,11 +1989,14 @@ namespace SDL { unsigned int pixelInnerMD = segmentsInGPU.mdIndices[Params_pLS::kLayers * pixelIndex]; unsigned int pixelOuterMD = segmentsInGPU.mdIndices[Params_pLS::kLayers * pixelIndex + 1]; - pixelQuintupletsInGPU.hitIndices[Params_pT5::kHits * pixelQuintupletIndex] = mdsInGPU.anchorHitIndices[pixelInnerMD]; - pixelQuintupletsInGPU.hitIndices[Params_pT5::kHits * pixelQuintupletIndex + 1] = mdsInGPU.outerHitIndices[pixelInnerMD]; + pixelQuintupletsInGPU.hitIndices[Params_pT5::kHits * pixelQuintupletIndex] = + mdsInGPU.anchorHitIndices[pixelInnerMD]; + pixelQuintupletsInGPU.hitIndices[Params_pT5::kHits * pixelQuintupletIndex + 1] = + mdsInGPU.outerHitIndices[pixelInnerMD]; pixelQuintupletsInGPU.hitIndices[Params_pT5::kHits * pixelQuintupletIndex + 2] = mdsInGPU.anchorHitIndices[pixelOuterMD]; - pixelQuintupletsInGPU.hitIndices[Params_pT5::kHits * pixelQuintupletIndex + 3] = mdsInGPU.outerHitIndices[pixelOuterMD]; + pixelQuintupletsInGPU.hitIndices[Params_pT5::kHits * pixelQuintupletIndex + 3] = + mdsInGPU.outerHitIndices[pixelOuterMD]; pixelQuintupletsInGPU.hitIndices[Params_pT5::kHits * pixelQuintupletIndex + 4] = quintupletsInGPU.hitIndices[Params_T5::kHits * T5Index]; @@ -2529,15 +2532,15 @@ namespace SDL { float zPix[Params_pLS::kLayers] = {mdsInGPU.anchorZ[pixelInnerMDIndex], mdsInGPU.anchorZ[pixelOuterMDIndex]}; float rtPix[Params_pLS::kLayers] = {mdsInGPU.anchorRt[pixelInnerMDIndex], mdsInGPU.anchorRt[pixelOuterMDIndex]}; float zs[Params_T5::kLayers] = {mdsInGPU.anchorZ[firstMDIndex], - mdsInGPU.anchorZ[secondMDIndex], - mdsInGPU.anchorZ[thirdMDIndex], - mdsInGPU.anchorZ[fourthMDIndex], - mdsInGPU.anchorZ[fifthMDIndex]}; + mdsInGPU.anchorZ[secondMDIndex], + mdsInGPU.anchorZ[thirdMDIndex], + mdsInGPU.anchorZ[fourthMDIndex], + mdsInGPU.anchorZ[fifthMDIndex]}; float rts[Params_T5::kLayers] = {mdsInGPU.anchorRt[firstMDIndex], - mdsInGPU.anchorRt[secondMDIndex], - mdsInGPU.anchorRt[thirdMDIndex], - mdsInGPU.anchorRt[fourthMDIndex], - mdsInGPU.anchorRt[fifthMDIndex]}; + mdsInGPU.anchorRt[secondMDIndex], + mdsInGPU.anchorRt[thirdMDIndex], + mdsInGPU.anchorRt[fourthMDIndex], + mdsInGPU.anchorRt[fifthMDIndex]}; rzChiSquared = computePT5RZChiSquared(acc, modulesInGPU, lowerModuleIndices, rtPix, zPix, rts, zs); @@ -2554,15 +2557,15 @@ namespace SDL { //outer T5 float xs[Params_T5::kLayers] = {mdsInGPU.anchorX[firstMDIndex], - mdsInGPU.anchorX[secondMDIndex], - mdsInGPU.anchorX[thirdMDIndex], - mdsInGPU.anchorX[fourthMDIndex], - mdsInGPU.anchorX[fifthMDIndex]}; + mdsInGPU.anchorX[secondMDIndex], + mdsInGPU.anchorX[thirdMDIndex], + mdsInGPU.anchorX[fourthMDIndex], + mdsInGPU.anchorX[fifthMDIndex]}; float ys[Params_T5::kLayers] = {mdsInGPU.anchorY[firstMDIndex], - mdsInGPU.anchorY[secondMDIndex], - mdsInGPU.anchorY[thirdMDIndex], - mdsInGPU.anchorY[fourthMDIndex], - mdsInGPU.anchorY[fifthMDIndex]}; + mdsInGPU.anchorY[secondMDIndex], + mdsInGPU.anchorY[thirdMDIndex], + mdsInGPU.anchorY[fourthMDIndex], + mdsInGPU.anchorY[fifthMDIndex]}; //get the appropriate radii and centers centerX = segmentsInGPU.circleCenterX[pixelSegmentArrayIndex]; diff --git a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h index 0950e2244d20e..99be477d167c4 100644 --- a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h +++ b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h @@ -2877,8 +2877,18 @@ namespace SDL { bool isFlat[5]; computeSigmasForRegression(acc, modulesInGPU, lowerModuleIndices, delta1, delta2, slopes, isFlat); - regressionRadius = computeRadiusUsingRegression( - acc, Params_T5::kLayers, xVec, yVec, delta1, delta2, slopes, isFlat, regressionG, regressionF, sigmas2, chiSquared); + regressionRadius = computeRadiusUsingRegression(acc, + Params_T5::kLayers, + xVec, + yVec, + delta1, + delta2, + slopes, + isFlat, + regressionG, + regressionF, + sigmas2, + chiSquared); #ifdef USE_T5_DNN unsigned int mdIndices[] = {firstMDIndex, secondMDIndex, thirdMDIndex, fourthMDIndex, fifthMDIndex}; diff --git a/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h b/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h index 5adb74e79932e..69f2396003000 100644 --- a/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h +++ b/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h @@ -142,8 +142,9 @@ namespace SDL { trackCandidatesInGPU.objectIndices[2 * trackCandidateIndex] = innerTrackletIndex; trackCandidatesInGPU.objectIndices[2 * trackCandidateIndex + 1] = outerTrackletIndex; - size_t limits = trackCandidateType == 7 ? Params_pT5::kLayers - : Params_pT3::kLayers; // 7 means pT5, Params_pT3::kLayers = Params_T5::kLayers = 5 + size_t limits = trackCandidateType == 7 + ? Params_pT5::kLayers + : Params_pT3::kLayers; // 7 means pT5, Params_pT3::kLayers = Params_T5::kLayers = 5 //send the starting pointer to the logicalLayer and hitIndices for (size_t i = 0; i < limits; i++) { @@ -556,19 +557,20 @@ namespace SDL { float radius = 0.5f * (__H2F(pixelQuintupletsInGPU.pixelRadius[pixelQuintupletIndex]) + __H2F(pixelQuintupletsInGPU.quintupletRadius[pixelQuintupletIndex])); unsigned int pT5PixelIndex = pixelQuintupletsInGPU.pixelIndices[pixelQuintupletIndex]; - addTrackCandidateToMemory(trackCandidatesInGPU, - 7 /*track candidate type pT5=7*/, - pT5PixelIndex, - pixelQuintupletsInGPU.T5Indices[pixelQuintupletIndex], - &pixelQuintupletsInGPU.logicalLayers[Params_pT5::kLayers * pixelQuintupletIndex], - &pixelQuintupletsInGPU.lowerModuleIndices[Params_pT5::kLayers * pixelQuintupletIndex], - &pixelQuintupletsInGPU.hitIndices[Params_pT5::kHits * pixelQuintupletIndex], - segmentsInGPU.seedIdx[pT5PixelIndex - pLS_offset], - __H2F(pixelQuintupletsInGPU.centerX[pixelQuintupletIndex]), - __H2F(pixelQuintupletsInGPU.centerY[pixelQuintupletIndex]), - radius, - trackCandidateIdx, - pixelQuintupletIndex); + addTrackCandidateToMemory( + trackCandidatesInGPU, + 7 /*track candidate type pT5=7*/, + pT5PixelIndex, + pixelQuintupletsInGPU.T5Indices[pixelQuintupletIndex], + &pixelQuintupletsInGPU.logicalLayers[Params_pT5::kLayers * pixelQuintupletIndex], + &pixelQuintupletsInGPU.lowerModuleIndices[Params_pT5::kLayers * pixelQuintupletIndex], + &pixelQuintupletsInGPU.hitIndices[Params_pT5::kHits * pixelQuintupletIndex], + segmentsInGPU.seedIdx[pT5PixelIndex - pLS_offset], + __H2F(pixelQuintupletsInGPU.centerX[pixelQuintupletIndex]), + __H2F(pixelQuintupletsInGPU.centerY[pixelQuintupletIndex]), + radius, + trackCandidateIdx, + pixelQuintupletIndex); } } }