From 8ec29108dbf770d828e3aa96e1ddeeda1c39237e Mon Sep 17 00:00:00 2001 From: GNiendorf Date: Thu, 26 Sep 2024 16:15:27 -0400 Subject: [PATCH 1/2] remove redundant functions --- .../LSTCore/interface/alpaka/Constants.h | 10 ++ RecoTracker/LSTCore/src/alpaka/MiniDoublet.h | 37 +--- .../LSTCore/src/alpaka/PixelQuintuplet.h | 136 +-------------- RecoTracker/LSTCore/src/alpaka/PixelTriplet.h | 158 +----------------- RecoTracker/LSTCore/src/alpaka/Quintuplet.h | 8 +- RecoTracker/LSTCore/src/alpaka/Segment.h | 36 +--- 6 files changed, 31 insertions(+), 354 deletions(-) diff --git a/RecoTracker/LSTCore/interface/alpaka/Constants.h b/RecoTracker/LSTCore/interface/alpaka/Constants.h index 76bb934b6994b..c8763d8f037db 100644 --- a/RecoTracker/LSTCore/interface/alpaka/Constants.h +++ b/RecoTracker/LSTCore/interface/alpaka/Constants.h @@ -83,6 +83,16 @@ namespace lst { // Since C++ can't represent infinity, lst_INF = 123456789 was used to represent infinity in the data table ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float lst_INF = 123456789.0; + ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float kMiniDeltaTilted[3] = {0.26f, 0.26f, 0.26f}; + ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float kMiniDeltaFlat[6] = {0.26f, 0.16f, 0.16f, 0.18f, 0.18f, 0.18f}; + ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float kMiniDeltaLooseTilted[3] = {0.4f, 0.4f, 0.4f}; + ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float kMiniDeltaEndcap[5][15] = { + {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, + {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, + {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.18f, 0.18f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, + {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.18f, 0.18f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, + {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.18f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}}; + namespace t5dnn { // Working points matching LST fake rate (43.9%) or signal acceptance (82.0%) diff --git a/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h b/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h index 601eb26735527..821e7571b3c28 100644 --- a/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h +++ b/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h @@ -283,35 +283,6 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE float moduleGapSize(struct lst::Modules const& modulesInGPU, uint16_t moduleIndex) { - float miniDeltaTilted[3] = {0.26f, 0.26f, 0.26f}; - float miniDeltaFlat[6] = {0.26f, 0.16f, 0.16f, 0.18f, 0.18f, 0.18f}; - float miniDeltaLooseTilted[3] = {0.4f, 0.4f, 0.4f}; - float miniDeltaEndcap[5][15]; - - for (size_t i = 0; i < 5; i++) { - for (size_t j = 0; j < 15; j++) { - if (i == 0 || i == 1) { - if (j < 10) { - miniDeltaEndcap[i][j] = 0.4f; - } else { - miniDeltaEndcap[i][j] = 0.18f; - } - } else if (i == 2 || i == 3) { - if (j < 8) { - miniDeltaEndcap[i][j] = 0.4f; - } else { - miniDeltaEndcap[i][j] = 0.18f; - } - } else { - if (j < 9) { - miniDeltaEndcap[i][j] = 0.4f; - } else { - miniDeltaEndcap[i][j] = 0.18f; - } - } - } - } - unsigned int iL = modulesInGPU.layers[moduleIndex] - 1; unsigned int iR = modulesInGPU.rings[moduleIndex] - 1; short subdet = modulesInGPU.subdets[moduleIndex]; @@ -320,14 +291,14 @@ namespace lst { float moduleSeparation = 0; if (subdet == Barrel and side == Center) { - moduleSeparation = miniDeltaFlat[iL]; + moduleSeparation = kMiniDeltaFlat[iL]; } else if (isTighterTiltedModules(modulesInGPU, moduleIndex)) { - moduleSeparation = miniDeltaTilted[iL]; + moduleSeparation = kMiniDeltaTilted[iL]; } else if (subdet == Endcap) { - moduleSeparation = miniDeltaEndcap[iL][iR]; + moduleSeparation = kMiniDeltaEndcap[iL][iR]; } else //Loose tilted modules { - moduleSeparation = miniDeltaLooseTilted[iL]; + moduleSeparation = kMiniDeltaLooseTilted[iL]; } return moduleSeparation; diff --git a/RecoTracker/LSTCore/src/alpaka/PixelQuintuplet.h b/RecoTracker/LSTCore/src/alpaka/PixelQuintuplet.h index 00af39286369c..e59421945d759 100644 --- a/RecoTracker/LSTCore/src/alpaka/PixelQuintuplet.h +++ b/RecoTracker/LSTCore/src/alpaka/PixelQuintuplet.h @@ -381,138 +381,6 @@ namespace lst { return true; }; - template - ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeChiSquaredpT5(TAcc const& acc, - unsigned int nPoints, - float* xs, - float* ys, - float* delta1, - float* delta2, - float* slopes, - bool* isFlat, - float g, - float f, - float radius) { - /* - Given values of (g, f, radius) and a set of points (and its uncertainties) compute chi squared - */ - float c = g * g + f * f - radius * radius; - float chiSquared = 0.f; - float absArctanSlope, angleM, xPrime, yPrime, sigma2; - for (size_t i = 0; i < nPoints; i++) { - absArctanSlope = ((slopes[i] != lst::lst_INF) ? alpaka::math::abs(acc, alpaka::math::atan(acc, slopes[i])) - : 0.5f * float(M_PI)); - if (xs[i] > 0 and ys[i] > 0) { - angleM = 0.5f * float(M_PI) - absArctanSlope; - } else if (xs[i] < 0 and ys[i] > 0) { - angleM = absArctanSlope + 0.5f * float(M_PI); - } else if (xs[i] < 0 and ys[i] < 0) { - angleM = -(absArctanSlope + 0.5f * float(M_PI)); - } else if (xs[i] > 0 and ys[i] < 0) { - angleM = -(0.5f * float(M_PI) - absArctanSlope); - } else { - angleM = 0; - } - if (not isFlat[i]) { - xPrime = xs[i] * alpaka::math::cos(acc, angleM) + ys[i] * alpaka::math::sin(acc, angleM); - yPrime = ys[i] * alpaka::math::cos(acc, angleM) - xs[i] * alpaka::math::sin(acc, angleM); - } else { - xPrime = xs[i]; - yPrime = ys[i]; - } - sigma2 = 4 * ((xPrime * delta1[i]) * (xPrime * delta1[i]) + (yPrime * delta2[i]) * (yPrime * delta2[i])); - chiSquared += (xs[i] * xs[i] + ys[i] * ys[i] - 2 * g * xs[i] - 2 * f * ys[i] + c) * - (xs[i] * xs[i] + ys[i] * ys[i] - 2 * g * xs[i] - 2 * f * ys[i] + c) / (sigma2); - } - return chiSquared; - }; - - template - ALPAKA_FN_ACC ALPAKA_FN_INLINE void computeSigmasForRegression_pT5(TAcc const& acc, - lst::Modules const& modulesInGPU, - const uint16_t* lowerModuleIndices, - float* delta1, - float* delta2, - float* slopes, - bool* isFlat, - unsigned int nPoints = 5, - bool anchorHits = true) { - /* - bool anchorHits required to deal with a weird edge case wherein - the hits ultimately used in the regression are anchor hits, but the - lower modules need not all be Pixel Modules (in case of PS). Similarly, - when we compute the chi squared for the non-anchor hits, the "partner module" - need not always be a PS strip module, but all non-anchor hits sit on strip - modules. - */ - ModuleType moduleType; - short moduleSubdet, moduleSide; - float inv1 = kWidthPS / kWidth2S; - float inv2 = kPixelPSZpitch / kWidth2S; - float inv3 = kStripPSZpitch / kWidth2S; - for (size_t i = 0; i < nPoints; i++) { - moduleType = modulesInGPU.moduleType[lowerModuleIndices[i]]; - moduleSubdet = modulesInGPU.subdets[lowerModuleIndices[i]]; - moduleSide = modulesInGPU.sides[lowerModuleIndices[i]]; - const float& drdz = modulesInGPU.drdzs[lowerModuleIndices[i]]; - slopes[i] = modulesInGPU.dxdys[lowerModuleIndices[i]]; - //category 1 - barrel PS flat - if (moduleSubdet == Barrel and moduleType == PS and moduleSide == Center) { - delta1[i] = inv1; - delta2[i] = inv1; - slopes[i] = -999.f; - isFlat[i] = true; - } - //category 2 - barrel 2S - else if (moduleSubdet == Barrel and moduleType == TwoS) { - delta1[i] = 1.f; - delta2[i] = 1.f; - slopes[i] = -999.f; - isFlat[i] = true; - } - //category 3 - barrel PS tilted - else if (moduleSubdet == Barrel and moduleType == PS and moduleSide != Center) { - delta1[i] = inv1; - isFlat[i] = false; - - if (anchorHits) { - delta2[i] = (inv2 * drdz / alpaka::math::sqrt(acc, 1 + drdz * drdz)); - } else { - delta2[i] = (inv3 * drdz / alpaka::math::sqrt(acc, 1 + drdz * drdz)); - } - } - //category 4 - endcap PS - else if (moduleSubdet == Endcap and moduleType == PS) { - delta1[i] = inv1; - isFlat[i] = false; - /* - despite the type of the module layer of the lower module index, - all anchor hits are on the pixel side and all non-anchor hits are - on the strip side! - */ - if (anchorHits) { - delta2[i] = inv2; - } else { - delta2[i] = inv3; - } - } - //category 5 - endcap 2S - else if (moduleSubdet == Endcap and moduleType == TwoS) { - delta1[i] = 1.f; - delta2[i] = 500.f * inv1; - isFlat[i] = false; - } -#ifdef WARNINGS - else { - printf("ERROR!!!!! I SHOULDN'T BE HERE!!!! subdet = %d, type = %d, side = %d\n", - moduleSubdet, - moduleType, - moduleSide); - } -#endif - } - }; - template ALPAKA_FN_ACC ALPAKA_FN_INLINE float computePT5RPhiChiSquared(TAcc const& acc, lst::Modules const& modulesInGPU, @@ -530,8 +398,8 @@ namespace lst { bool isFlat[5]; float chiSquared = 0; - computeSigmasForRegression_pT5(acc, modulesInGPU, lowerModuleIndices, delta1, delta2, slopes, isFlat); - chiSquared = computeChiSquaredpT5(acc, 5, xs, ys, delta1, delta2, slopes, isFlat, g, f, radius); + computeSigmasForRegression(acc, modulesInGPU, lowerModuleIndices, delta1, delta2, slopes, isFlat); + chiSquared = computeChiSquared(acc, 5, xs, ys, delta1, delta2, slopes, isFlat, g, f, radius); return chiSquared; }; diff --git a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h index 86fe79b8099f7..9372c6eca6ac7 100644 --- a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h +++ b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h @@ -321,52 +321,6 @@ namespace lst { return true; }; - template - ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeChiSquaredpT3(TAcc const& acc, - unsigned int nPoints, - float* xs, - float* ys, - float* delta1, - float* delta2, - float* slopes, - bool* isFlat, - float g, - float f, - float radius) { - //given values of (g, f, radius) and a set of points (and its uncertainties) - //compute chi squared - float c = g * g + f * f - radius * radius; - float chiSquared = 0.f; - float absArctanSlope, angleM, xPrime, yPrime, sigma2; - for (size_t i = 0; i < nPoints; i++) { - absArctanSlope = ((slopes[i] != lst::lst_INF) ? alpaka::math::abs(acc, alpaka::math::atan(acc, slopes[i])) - : 0.5f * float(M_PI)); - if (xs[i] > 0 and ys[i] > 0) { - angleM = 0.5f * float(M_PI) - absArctanSlope; - } else if (xs[i] < 0 and ys[i] > 0) { - angleM = absArctanSlope + 0.5f * float(M_PI); - } else if (xs[i] < 0 and ys[i] < 0) { - angleM = -(absArctanSlope + 0.5f * float(M_PI)); - } else if (xs[i] > 0 and ys[i] < 0) { - angleM = -(0.5f * float(M_PI) - absArctanSlope); - } else { - angleM = 0; - } - - if (not isFlat[i]) { - xPrime = xs[i] * alpaka::math::cos(acc, angleM) + ys[i] * alpaka::math::sin(acc, angleM); - yPrime = ys[i] * alpaka::math::cos(acc, angleM) - xs[i] * alpaka::math::sin(acc, angleM); - } else { - xPrime = xs[i]; - yPrime = ys[i]; - } - sigma2 = 4 * ((xPrime * delta1[i]) * (xPrime * delta1[i]) + (yPrime * delta2[i]) * (yPrime * delta2[i])); - chiSquared += (xs[i] * xs[i] + ys[i] * ys[i] - 2 * g * xs[i] - 2 * f * ys[i] + c) * - (xs[i] * xs[i] + ys[i] * ys[i] - 2 * g * xs[i] - 2 * f * ys[i] + c) / sigma2; - } - return chiSquared; - }; - //TODO: merge this one and the pT5 function later into a single function template ALPAKA_FN_ACC ALPAKA_FN_INLINE float computePT3RPhiChiSquared(TAcc const& acc, @@ -434,7 +388,7 @@ namespace lst { } #endif } - chiSquared = computeChiSquaredpT3(acc, 3, xs, ys, delta1, delta2, slopes, isFlat, g, f, radius); + chiSquared = computeChiSquared(acc, 3, xs, ys, delta1, delta2, slopes, isFlat, g, f, radius); return chiSquared; }; @@ -1071,112 +1025,6 @@ namespace lst { } }; - template - ALPAKA_FN_ACC ALPAKA_FN_INLINE void runDeltaBetaIterationspT3(TAcc const& acc, - float& betaIn, - float& betaOut, - float betaAv, - float& pt_beta, - float sdIn_dr, - float sdOut_dr, - float dr, - float lIn) { - if (lIn == 0) { - betaOut += alpaka::math::copysign( - acc, - alpaka::math::asin( - acc, - alpaka::math::min(acc, sdOut_dr * lst::k2Rinv1GeVf / alpaka::math::abs(acc, pt_beta), lst::kSinAlphaMax)), - betaOut); - return; - } - - if (betaIn * betaOut > 0.f and - (alpaka::math::abs(acc, pt_beta) < 4.f * lst::kPt_betaMax or - (lIn >= 11 and alpaka::math::abs(acc, pt_beta) < - 8.f * lst::kPt_betaMax))) //and the pt_beta is well-defined; less strict for endcap-endcap - { - const float betaInUpd = - betaIn + alpaka::math::copysign( - acc, - alpaka::math::asin( - acc, - alpaka::math::min( - acc, sdIn_dr * lst::k2Rinv1GeVf / alpaka::math::abs(acc, pt_beta), lst::kSinAlphaMax)), - betaIn); //FIXME: need a faster version - const float betaOutUpd = - betaOut + alpaka::math::copysign( - acc, - alpaka::math::asin( - acc, - alpaka::math::min( - acc, sdOut_dr * lst::k2Rinv1GeVf / alpaka::math::abs(acc, pt_beta), lst::kSinAlphaMax)), - betaOut); //FIXME: need a faster version - betaAv = 0.5f * (betaInUpd + betaOutUpd); - - //1st update - const float pt_beta_inv = - 1.f / alpaka::math::abs(acc, dr * k2Rinv1GeVf / alpaka::math::sin(acc, betaAv)); //get a better pt estimate - - betaIn += alpaka::math::copysign( - acc, - alpaka::math::asin(acc, alpaka::math::min(acc, sdIn_dr * lst::k2Rinv1GeVf * pt_beta_inv, lst::kSinAlphaMax)), - betaIn); //FIXME: need a faster version - betaOut += alpaka::math::copysign( - acc, - alpaka::math::asin(acc, alpaka::math::min(acc, sdOut_dr * lst::k2Rinv1GeVf * pt_beta_inv, lst::kSinAlphaMax)), - betaOut); //FIXME: need a faster version - //update the av and pt - betaAv = 0.5f * (betaIn + betaOut); - //2nd update - pt_beta = dr * lst::k2Rinv1GeVf / alpaka::math::sin(acc, betaAv); //get a better pt estimate - } else if (lIn < 11 && alpaka::math::abs(acc, betaOut) < 0.2f * alpaka::math::abs(acc, betaIn) && - alpaka::math::abs(acc, pt_beta) < 12.f * lst::kPt_betaMax) //use betaIn sign as ref - { - const float pt_betaIn = dr * k2Rinv1GeVf / alpaka::math::sin(acc, betaIn); - - const float betaInUpd = - betaIn + alpaka::math::copysign( - acc, - alpaka::math::asin( - acc, - alpaka::math::min( - acc, sdIn_dr * lst::k2Rinv1GeVf / alpaka::math::abs(acc, pt_betaIn), lst::kSinAlphaMax)), - betaIn); //FIXME: need a faster version - const float betaOutUpd = - betaOut + - alpaka::math::copysign( - acc, - alpaka::math::asin( - acc, - alpaka::math::min( - acc, sdOut_dr * lst::k2Rinv1GeVf / alpaka::math::abs(acc, pt_betaIn), lst::kSinAlphaMax)), - betaIn); //FIXME: need a faster version - betaAv = (alpaka::math::abs(acc, betaOut) > 0.2f * alpaka::math::abs(acc, betaIn)) - ? (0.5f * (betaInUpd + betaOutUpd)) - : betaInUpd; - - //1st update - pt_beta = dr * lst::k2Rinv1GeVf / alpaka::math::sin(acc, betaAv); //get a better pt estimate - betaIn += alpaka::math::copysign( - acc, - alpaka::math::asin( - acc, - alpaka::math::min(acc, sdIn_dr * lst::k2Rinv1GeVf / alpaka::math::abs(acc, pt_beta), lst::kSinAlphaMax)), - betaIn); //FIXME: need a faster version - betaOut += alpaka::math::copysign( - acc, - alpaka::math::asin( - acc, - alpaka::math::min(acc, sdOut_dr * lst::k2Rinv1GeVf / alpaka::math::abs(acc, pt_beta), lst::kSinAlphaMax)), - betaIn); //FIXME: need a faster version - //update the av and pt - betaAv = 0.5f * (betaIn + betaOut); - //2nd update - pt_beta = dr * lst::k2Rinv1GeVf / alpaka::math::sin(acc, betaAv); //get a better pt estimate - } - }; - template ALPAKA_FN_ACC ALPAKA_FN_INLINE bool runTripletDefaultAlgoPPBB(TAcc const& acc, lst::Modules const& modulesInGPU, @@ -1374,7 +1222,7 @@ namespace lst { alpaka::math::sqrt(acc, (x_OutUp - x_OutLo) * (x_OutUp - x_OutLo) + (y_OutUp - y_OutLo) * (y_OutUp - y_OutLo)); float sdOut_d = rt_OutUp - rt_OutLo; - runDeltaBetaIterationspT3(acc, betaIn, betaOut, betaAv, pt_beta, rt_InSeg, sdOut_dr, drt_tl_axis, lIn); + runDeltaBetaIterations(acc, betaIn, betaOut, betaAv, pt_beta, rt_InSeg, sdOut_dr, drt_tl_axis, lIn); const float betaInMMSF = (alpaka::math::abs(acc, betaInRHmin + betaInRHmax) > 0) ? (2.f * betaIn / alpaka::math::abs(acc, betaInRHmin + betaInRHmax)) @@ -1634,7 +1482,7 @@ namespace lst { alpaka::math::sqrt(acc, (x_OutUp - x_OutLo) * (x_OutUp - x_OutLo) + (y_OutUp - y_OutLo) * (y_OutUp - y_OutLo)); float sdOut_d = rt_OutUp - rt_OutLo; - runDeltaBetaIterationspT3(acc, betaIn, betaOut, betaAv, pt_beta, rt_InSeg, sdOut_dr, drt_tl_axis, lIn); + runDeltaBetaIterations(acc, betaIn, betaOut, betaAv, pt_beta, rt_InSeg, sdOut_dr, drt_tl_axis, lIn); const float betaInMMSF = (alpaka::math::abs(acc, betaInRHmin + betaInRHmax) > 0) ? (2.f * betaIn / alpaka::math::abs(acc, betaInRHmin + betaInRHmax)) diff --git a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h index 969b6373ad8ae..d7fcd35ecdb13 100644 --- a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h +++ b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h @@ -1243,7 +1243,7 @@ namespace lst { }; template - ALPAKA_FN_ACC ALPAKA_FN_INLINE void runDeltaBetaIterationsT5(TAcc const& acc, + ALPAKA_FN_ACC ALPAKA_FN_INLINE void runDeltaBetaIterations(TAcc const& acc, float& betaIn, float& betaOut, float betaAv, @@ -1535,7 +1535,7 @@ namespace lst { (mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[thirdMDIndex])); float sdOut_d = mdsInGPU.anchorRt[fourthMDIndex] - mdsInGPU.anchorRt[thirdMDIndex]; - lst::runDeltaBetaIterationsT5(acc, betaIn, betaOut, betaAv, pt_beta, rt_InSeg, sdOut_dr, drt_tl_axis, lIn); + lst::runDeltaBetaIterations(acc, betaIn, betaOut, betaAv, pt_beta, rt_InSeg, sdOut_dr, drt_tl_axis, lIn); const float betaInMMSF = (alpaka::math::abs(acc, betaInRHmin + betaInRHmax) > 0) ? (2.f * betaIn / alpaka::math::abs(acc, betaInRHmin + betaInRHmax)) @@ -1787,7 +1787,7 @@ namespace lst { (mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[thirdMDIndex])); float sdOut_d = mdsInGPU.anchorRt[fourthMDIndex] - mdsInGPU.anchorRt[thirdMDIndex]; - lst::runDeltaBetaIterationsT5(acc, betaIn, betaOut, betaAv, pt_beta, sdIn_dr, sdOut_dr, dr, lIn); + lst::runDeltaBetaIterations(acc, betaIn, betaOut, betaAv, pt_beta, sdIn_dr, sdOut_dr, dr, lIn); const float betaInMMSF = (alpaka::math::abs(acc, betaInRHmin + betaInRHmax) > 0) ? (2.f * betaIn / alpaka::math::abs(acc, betaInRHmin + betaInRHmax)) @@ -2029,7 +2029,7 @@ namespace lst { (mdsInGPU.anchorY[fourthMDIndex] - mdsInGPU.anchorY[thirdMDIndex])); float sdOut_d = mdsInGPU.anchorRt[fourthMDIndex] - mdsInGPU.anchorRt[thirdMDIndex]; - lst::runDeltaBetaIterationsT5(acc, betaIn, betaOut, betaAv, pt_beta, sdIn_dr, sdOut_dr, dr, lIn); + lst::runDeltaBetaIterations(acc, betaIn, betaOut, betaAv, pt_beta, sdIn_dr, sdOut_dr, dr, lIn); const float betaInMMSF = (alpaka::math::abs(acc, betaInRHmin + betaInRHmax) > 0) ? (2.f * betaIn / alpaka::math::abs(acc, betaInRHmin + betaInRHmax)) diff --git a/RecoTracker/LSTCore/src/alpaka/Segment.h b/RecoTracker/LSTCore/src/alpaka/Segment.h index f507cf7fc36b7..22243a0e776e3 100644 --- a/RecoTracker/LSTCore/src/alpaka/Segment.h +++ b/RecoTracker/LSTCore/src/alpaka/Segment.h @@ -202,46 +202,26 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE float moduleGapSize_seg(short layer, short ring, short subdet, short side, short rod) { - static constexpr float miniDeltaTilted[3] = {0.26f, 0.26f, 0.26f}; - static constexpr float miniDeltaFlat[6] = {0.26f, 0.16f, 0.16f, 0.18f, 0.18f, 0.18f}; - static constexpr float miniDeltaLooseTilted[3] = {0.4f, 0.4f, 0.4f}; - static constexpr float miniDeltaEndcap[5][15] = { - {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, - {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, - {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.18f, 0.18f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, - {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.18f, 0.18f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, - {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.18f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}}; - unsigned int iL = layer - 1; unsigned int iR = ring - 1; float moduleSeparation = 0; if (subdet == Barrel and side == Center) { - moduleSeparation = miniDeltaFlat[iL]; + moduleSeparation = kMiniDeltaFlat[iL]; } else if (isTighterTiltedModules_seg(subdet, layer, side, rod)) { - moduleSeparation = miniDeltaTilted[iL]; + moduleSeparation = kMiniDeltaTilted[iL]; } else if (subdet == Endcap) { - moduleSeparation = miniDeltaEndcap[iL][iR]; + moduleSeparation = kMiniDeltaEndcap[iL][iR]; } else //Loose tilted modules { - moduleSeparation = miniDeltaLooseTilted[iL]; + moduleSeparation = kMiniDeltaLooseTilted[iL]; } return moduleSeparation; }; ALPAKA_FN_ACC ALPAKA_FN_INLINE float moduleGapSize_seg(lst::Modules const& modulesInGPU, unsigned int moduleIndex) { - static constexpr float miniDeltaTilted[3] = {0.26f, 0.26f, 0.26f}; - static constexpr float miniDeltaFlat[6] = {0.26f, 0.16f, 0.16f, 0.18f, 0.18f, 0.18f}; - static constexpr float miniDeltaLooseTilted[3] = {0.4f, 0.4f, 0.4f}; - static constexpr float miniDeltaEndcap[5][15] = { - {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, - {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, - {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.18f, 0.18f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, - {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.18f, 0.18f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}, - {0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.4f, 0.18f, /*10*/ 0.18f, 0.18f, 0.18f, 0.18f, 0.18f}}; - unsigned int iL = modulesInGPU.layers[moduleIndex] - 1; unsigned int iR = modulesInGPU.rings[moduleIndex] - 1; short subdet = modulesInGPU.subdets[moduleIndex]; @@ -250,14 +230,14 @@ namespace lst { float moduleSeparation = 0; if (subdet == Barrel and side == Center) { - moduleSeparation = miniDeltaFlat[iL]; + moduleSeparation = kMiniDeltaFlat[iL]; } else if (isTighterTiltedModules_seg(modulesInGPU, moduleIndex)) { - moduleSeparation = miniDeltaTilted[iL]; + moduleSeparation = kMiniDeltaTilted[iL]; } else if (subdet == Endcap) { - moduleSeparation = miniDeltaEndcap[iL][iR]; + moduleSeparation = kMiniDeltaEndcap[iL][iR]; } else //Loose tilted modules { - moduleSeparation = miniDeltaLooseTilted[iL]; + moduleSeparation = kMiniDeltaLooseTilted[iL]; } return moduleSeparation; From f32ee1a6ab4de230d25ea3f1364f2e433d583215 Mon Sep 17 00:00:00 2001 From: GNiendorf Date: Fri, 27 Sep 2024 14:45:36 -0400 Subject: [PATCH 2/2] code-format --- RecoTracker/LSTCore/src/alpaka/Quintuplet.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h index d7fcd35ecdb13..0dfd8fb83a412 100644 --- a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h +++ b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h @@ -1244,14 +1244,14 @@ namespace lst { template ALPAKA_FN_ACC ALPAKA_FN_INLINE void runDeltaBetaIterations(TAcc const& acc, - float& betaIn, - float& betaOut, - float betaAv, - float& pt_beta, - float sdIn_dr, - float sdOut_dr, - float dr, - float lIn) { + float& betaIn, + float& betaOut, + float betaAv, + float& pt_beta, + float sdIn_dr, + float sdOut_dr, + float dr, + float lIn) { if (lIn == 0) { betaOut += alpaka::math::copysign( acc,