From 78bc043adb2c2745b61136a2bc56578844101810 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Tue, 25 Nov 2025 15:40:12 -0800 Subject: [PATCH 1/8] fix z luminous region cut for general rIn/rOut relationship --- RecoTracker/LSTCore/src/alpaka/PixelTriplet.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h index 4851506766b2a..53792feda7cb0 100644 --- a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h +++ b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h @@ -878,23 +878,21 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float etaErr = pixelData.etaErr; ptSLo = alpaka::math::max(acc, ptCut, ptSLo - 10.0f * alpaka::math::max(acc, ptErr, 0.005f * ptSLo)); ptSLo = alpaka::math::min(acc, 10.0f, ptSLo); - float alpha1GeV_OutLo = alpaka::math::asin(acc, alpaka::math::min(acc, rt_OutLo * k2Rinv1GeVf / ptCut, kSinAlphaMax)); - const float rtRatio_OutLoInOut = - rt_OutLo / rt_InOut; // Outer segment beginning rt divided by inner segment beginning rt; + // Outer segment beginning rt divided by inner segment beginning rt; + const float rtRelDiff = rt_OutLo / rt_InOut - 1.f; - float dzDrtScale = - alpaka::math::tan(acc, alpha1GeV_OutLo) / alpha1GeV_OutLo; // The track can bend in r-z plane slightly + // The track can bend in r-z plane slightly + float dzDrtScale = alpaka::math::tan(acc, alpha1GeV_OutLo) / alpha1GeV_OutLo; const float zpitch_InLo = 0.05f; const float zpitch_InOut = 0.05f; float zpitch_OutLo = (isPS_OutLo ? kPixelPSZpitch : kStrip2SZpitch); float zGeom = zpitch_InLo + zpitch_OutLo; - zHi = z_InUp + (z_InUp + kDeltaZLum) * (rtRatio_OutLoInOut - 1.f) * (z_InUp < 0.f ? 1.f : dzDrtScale) + - (zpitch_InOut + zpitch_OutLo); - zLo = z_InUp + (z_InUp - kDeltaZLum) * (rtRatio_OutLoInOut - 1.f) * (z_InUp > 0.f ? 1.f : dzDrtScale) - - (zpitch_InOut + zpitch_OutLo); //slope-correction only on outer end - + const float dLum = alpaka::math::copysign(acc, kDeltaZLum, rtRelDiff); + // dzDrtScale correction is only on outer end + zHi = z_InUp + (z_InUp + dLum) * rtRelDiff * (z_InUp < 0.f ? 1.f : dzDrtScale) + (zpitch_InOut + zpitch_OutLo); + zLo = z_InUp + (z_InUp - dLum) * rtRelDiff * (z_InUp > 0.f ? 1.f : dzDrtScale) - (zpitch_InOut + zpitch_OutLo); if ((z_OutLo < zLo) || (z_OutLo > zHi)) return false; From d542cfcc79c749339488f521f2a9fd5ed9d5e60c Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Mon, 2 Feb 2026 15:22:44 -0800 Subject: [PATCH 2/8] PixelTriplet and quadruplet logic updates for PPBB/PPEE to cover CA-extended pLS stopping in barrel and endcap OT: - fix error computations and dBetas - account for radius uncertainties in lumi-based and pointed z selection, most important for connections with pLS on the same tilted layer - use the tl-axis length in dBetaRes term, it becomes large in the near-3-point cases - rename a few more variables for clarity - fixup to the dzDrtScale use in PPBB - PPEE: fix dLum and dzDrtScale in rt{Lo,Hi}, fix dz sign in rt{Lo,Hi}_point --- .../LSTCore/src/alpaka/NeuralNetwork.h | 1 - RecoTracker/LSTCore/src/alpaka/PixelTriplet.h | 207 +++++++++--------- RecoTracker/LSTCore/src/alpaka/Quintuplet.h | 20 +- 3 files changed, 118 insertions(+), 110 deletions(-) diff --git a/RecoTracker/LSTCore/src/alpaka/NeuralNetwork.h b/RecoTracker/LSTCore/src/alpaka/NeuralNetwork.h index 8e12327f5bcb6..737684496cfc0 100644 --- a/RecoTracker/LSTCore/src/alpaka/NeuralNetwork.h +++ b/RecoTracker/LSTCore/src/alpaka/NeuralNetwork.h @@ -155,7 +155,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { constexpr unsigned int kInputFeatures = 7; constexpr unsigned int kHiddenFeatures = 32; constexpr unsigned int kOutputFeatures = 1; - float x[kInputFeatures] = { alpaka::math::log10(acc, rPhiChiSquared), alpaka::math::log10(acc, tripletRadius), diff --git a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h index 53792feda7cb0..aa35d94652bfd 100644 --- a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h +++ b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h @@ -162,37 +162,36 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { MiniDoubletsConst mds, SegmentsConst segments, const PixelSeedData& pixelData, - uint16_t outerInnerLowerModuleIndex, - uint16_t outerOuterLowerModuleIndex, + uint16_t lowerModuleIndex, + uint16_t outerModuleIndex, unsigned int outerSegmentIndex, const float ptCut) { - short outerInnerLowerModuleSubdet = modules.subdets()[outerInnerLowerModuleIndex]; - short outerOuterLowerModuleSubdet = modules.subdets()[outerOuterLowerModuleIndex]; + short lowerModuleSubdet = modules.subdets()[lowerModuleIndex]; + short outerModuleSubdet = modules.subdets()[outerModuleIndex]; unsigned int segmentMD0Index = segments.mdIndices()[outerSegmentIndex][0]; unsigned int segmentMD1Index = segments.mdIndices()[outerSegmentIndex][1]; - if (outerInnerLowerModuleSubdet == Barrel and - (outerOuterLowerModuleSubdet == Barrel or outerOuterLowerModuleSubdet == Endcap)) { + if (lowerModuleSubdet == Barrel and (outerModuleSubdet == Barrel or outerModuleSubdet == Endcap)) { return runTripletDefaultAlgoPPBB(acc, modules, mds, segments, pixelData, - outerInnerLowerModuleIndex, - outerOuterLowerModuleIndex, + lowerModuleIndex, + outerModuleIndex, outerSegmentIndex, segmentMD0Index, segmentMD1Index, ptCut); - } else if (outerInnerLowerModuleSubdet == Endcap and outerOuterLowerModuleSubdet == Endcap) { + } else if (lowerModuleSubdet == Endcap and outerModuleSubdet == Endcap) { return runTripletDefaultAlgoPPEE(acc, modules, mds, segments, pixelData, - outerInnerLowerModuleIndex, - outerOuterLowerModuleIndex, + lowerModuleIndex, + outerModuleIndex, outerSegmentIndex, segmentMD0Index, segmentMD1Index, @@ -847,8 +846,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { const float ptCut) { float dPhi, betaIn, betaOut, pt_beta, zLo, zHi, zLoPointed, zHiPointed, dPhiCut, betaOutCut; - bool isPS_OutLo = (modules.moduleType()[segmentInnerModuleIndex] == PS); - const float rt_InLo = pixelData.rt_InLo; const float rt_InUp = pixelData.rt_InUp; float rt_OutLo = mds.anchorRt()[segmentMD0Index]; @@ -884,46 +881,56 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { const float rtRelDiff = rt_OutLo / rt_InOut - 1.f; // The track can bend in r-z plane slightly - float dzDrtScale = alpaka::math::tan(acc, alpha1GeV_OutLo) / alpha1GeV_OutLo; + const float dzDrtScale = alpaka::math::tan(acc, alpha1GeV_OutLo) / alpha1GeV_OutLo; + // adjust for fwd and bwd to keep zHi > zLo + const float dzDrtScaleHi = z_InUp * rtRelDiff < 0.f ? 1.f : dzDrtScale; + const float dzDrtScaleLo = z_InUp * rtRelDiff > 0.f ? 1.f : dzDrtScale; const float zpitch_InLo = 0.05f; - const float zpitch_InOut = 0.05f; - float zpitch_OutLo = (isPS_OutLo ? kPixelPSZpitch : kStrip2SZpitch); - float zGeom = zpitch_InLo + zpitch_OutLo; + bool sameLayerOutLo = + alpaka::math::abs(acc, rt_OutLo - rt_InOut) < 1.f && alpaka::math::abs(acc, z_InUp - z_OutLo) < 1.f; + bool isPS_OutLo = (modules.moduleType()[segmentInnerModuleIndex] == PS); + bool isTilted_OutLo = (modules.sides()[segmentInnerModuleIndex] != Center); + // same layer pLS is P-size, 50 um otherwise + const float zpitch_InOut = sameLayerOutLo ? kPixelPSZpitch : 0.05f; + const float zpitch_OutLo = (isPS_OutLo ? kPixelPSZpitch : kStrip2SZpitch); // could reduce using dzdrt for tilted + const float zGeom = zpitch_InLo + zpitch_OutLo; + const float rGeom = zpitch_InOut + zpitch_OutLo; // could reduce using dzdrt for tilted const float dLum = alpaka::math::copysign(acc, kDeltaZLum, rtRelDiff); + // could reduce dR uncertrainty using dzdrt + const float dRtRelZ = isTilted_OutLo ? alpaka::math::abs(acc, rGeom / rt_InOut * z_InUp) : 0.f; // dzDrtScale correction is only on outer end - zHi = z_InUp + (z_InUp + dLum) * rtRelDiff * (z_InUp < 0.f ? 1.f : dzDrtScale) + (zpitch_InOut + zpitch_OutLo); - zLo = z_InUp + (z_InUp - dLum) * rtRelDiff * (z_InUp > 0.f ? 1.f : dzDrtScale) - (zpitch_InOut + zpitch_OutLo); + zHi = z_InUp + dRtRelZ + (z_InUp + dLum) * rtRelDiff * dzDrtScaleHi + (zpitch_InOut + zpitch_OutLo); + zLo = z_InUp - dRtRelZ + (z_InUp - dLum) * rtRelDiff * dzDrtScaleLo - (zpitch_InOut + zpitch_OutLo); if ((z_OutLo < zLo) || (z_OutLo > zHi)) return false; const float cosh2Eta = 1.f + (pz * pz) / (ptIn * ptIn); const float drt_OutLo_InUp = (rt_OutLo - rt_InUp); + const float drt_OutLo_InUp_abs = alpaka::math::abs(acc, drt_OutLo_InUp); + const float drt_OutLo_InUp_2 = drt_OutLo_InUp * drt_OutLo_InUp; const float r3_InUp = alpaka::math::sqrt(acc, z_InUp * z_InUp + rt_InUp * rt_InUp); float drt_InSeg = rt_InOut - rt_InLo; const float thetaMuls2 = - (kMulsInGeV * kMulsInGeV) * (0.1f + 0.2f * (rt_OutLo - rt_InUp) / 50.f) * (r3_InUp / rt_InUp); + (kMulsInGeV * kMulsInGeV) * (0.1f + 0.2f * drt_OutLo_InUp_abs / 50.f) * (r3_InUp / rt_InUp); const float muls2 = thetaMuls2 * 9.f / (ptCut * ptCut) * 16.f; - float dzErr = (drt_OutLo_InUp * drt_OutLo_InUp) * (etaErr * etaErr) * cosh2Eta; - dzErr += 0.03f * 0.03f; // Approximately account for IT module size - dzErr *= 9.f; // 3 sigma - dzErr += muls2 * (drt_OutLo_InUp * drt_OutLo_InUp) / 3.f * cosh2Eta; - dzErr += zGeom * zGeom; + const float dzDrIn = pz / ptIn; + float dzErr = 9.f * drt_OutLo_InUp_2 * (etaErr * etaErr) * cosh2Eta; // 3 sigma + dzErr += isTilted_OutLo ? rGeom * rGeom * dzDrIn * dzDrIn : 0.f; // radius err + dzErr += muls2 * drt_OutLo_InUp_2 / 3.f * cosh2Eta; // multiple scattering + dzErr += zGeom * zGeom; // z err dzErr = alpaka::math::sqrt(acc, dzErr); - const float dzDrIn = pz / ptIn; - const float zWindow = dzErr / drt_InSeg * drt_OutLo_InUp + zGeom; - const float dzMean = dzDrIn * drt_OutLo_InUp * - (1.f + drt_OutLo_InUp * drt_OutLo_InUp * 4 * k2Rinv1GeVf * k2Rinv1GeVf / ptIn / ptIn / - 24.f); // with curved path correction + const float dzMean = + dzDrIn * drt_OutLo_InUp * + (1.f + drt_OutLo_InUp_2 * k2Rinv1GeVf * k2Rinv1GeVf / ptIn / ptIn / 6.f); // with curved path correction // Constructing upper and lower bound - zLoPointed = z_InUp + dzMean - zWindow; - zHiPointed = z_InUp + dzMean + zWindow; - + zLoPointed = z_InUp + dzMean - dzErr; + zHiPointed = z_InUp + dzMean + dzErr; if ((z_OutLo < zLoPointed) || (z_OutLo > zHiPointed)) return false; @@ -938,7 +945,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float diffY = y_OutLo - y_InLo; dPhi = cms::alpakatools::deltaPhi(acc, midPointX, midPointY, diffX, diffY); - if (alpaka::math::abs(acc, dPhi) > dPhiCut) return false; @@ -958,6 +964,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float tl_axis_x = x_OutUp - x_InUp; float tl_axis_y = y_OutUp - y_InUp; + float drt_tl_axis = alpaka::math::sqrt(acc, tl_axis_x * tl_axis_x + tl_axis_y * tl_axis_y); + if (drt_tl_axis < 0.2f) // avoid very uncertain math. Sub-optimal: could change a ref point + return true; float tl_axis_highEdge_x = tl_axis_x; float tl_axis_highEdge_y = tl_axis_y; @@ -966,11 +975,13 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float tl_axis_lowEdge_y = tl_axis_y; betaIn = -cms::alpakatools::deltaPhi(acc, px, py, tl_axis_x, tl_axis_y); - float betaInRHmin = betaIn; - float betaInRHmax = betaIn; - betaOut = -alpha_OutUp + cms::alpakatools::deltaPhi(acc, x_OutUp, y_OutUp, tl_axis_x, tl_axis_y); - + const float drt_tli = + alpaka::math::sqrt(acc, (x_OutLo - x_InUp) * (x_OutLo - x_InUp) + (y_OutLo - y_InUp) * (y_OutLo - y_InUp)); + if (drt_tli < 0.1f && alpaka::math::abs(acc, betaOut) < 1e-3f) { + // 3-point degeneracy: fix the sign of betaOut + betaOut = alpaka::math::copysign(acc, betaOut, betaIn); + } float betaOutRHmin = betaOut; float betaOutRHmax = betaOut; @@ -1004,14 +1015,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } //beta computation - float drt_tl_axis = alpaka::math::sqrt(acc, tl_axis_x * tl_axis_x + tl_axis_y * tl_axis_y); - //innerOuterAnchor - innerInnerAnchor const float rt_InSeg = alpaka::math::sqrt(acc, (x_InUp - x_InLo) * (x_InUp - x_InLo) + (y_InUp - y_InLo) * (y_InUp - y_InLo)); //no betaIn cut for the pixels - float betaAv = 0.5f * (betaIn + betaOut); pt_beta = ptIn; int lIn = 0; @@ -1019,23 +1027,26 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float sdOut_dr = 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; + bool useBetaInSign = drt_tl_axis < sdOut_dr && drt_tli < sdOut_dr; // pLS ends inside the LS + + runDeltaBetaIterations(acc, betaIn, betaOut, pt_beta, rt_InSeg, sdOut_dr, drt_tl_axis, lIn, useBetaInSign); + // wrap around pi (do for all) + if (alpaka::math::abs(acc, betaIn) > kPi / 2.f || alpaka::math::abs(acc, betaOut) > kPi / 2.f) { + betaIn = cms::alpakatools::reducePhiRange(acc, kPi - betaIn); + betaOut = cms::alpakatools::reducePhiRange(acc, kPi - betaOut); + betaOutRHmin = cms::alpakatools::reducePhiRange(acc, kPi - betaOutRHmin); + betaOutRHmax = cms::alpakatools::reducePhiRange(acc, kPi - betaOutRHmax); + } - 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)) - : 0.; //mean value of min,max is the old betaIn const float betaOutMMSF = (alpaka::math::abs(acc, betaOutRHmin + betaOutRHmax) > 0) ? (2.f * betaOut / alpaka::math::abs(acc, betaOutRHmin + betaOutRHmax)) : 0.; - betaInRHmin *= betaInMMSF; - betaInRHmax *= betaInMMSF; betaOutRHmin *= betaOutMMSF; betaOutRHmax *= betaOutMMSF; - float min_ptBeta_ptBetaMax = alpaka::math::min( - acc, alpaka::math::abs(acc, pt_beta), kPt_betaMax); //need to confirm the range-out value of 7 GeV - const float dBetaMuls2 = thetaMuls2 * 16.f / (min_ptBeta_ptBetaMax * min_ptBeta_ptBetaMax); + float pt_beta_trunc = + alpaka::math::min(acc, alpaka::math::abs(acc, pt_beta), kPt_betaMax); // truncated to kPt_betaMax + const float dBetaMuls2 = thetaMuls2 * 16.f / (pt_beta_trunc * pt_beta_trunc); const float alphaInAbsReg = alpaka::math::max(acc, alpaka::math::abs(acc, alpha_InLo), @@ -1072,12 +1083,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { //Cut #6: The real beta cut if (alpaka::math::abs(acc, betaOut) >= betaOutCut) return false; - const float dBetaRes = 0.02f / alpaka::math::min(acc, sdOut_d, drt_InSeg); - const float dBetaCut2 = - (dBetaRes * dBetaRes * 2.0f + dBetaMuls2 + dBetaLum2 + dBetaRIn2 + dBetaROut2 + - 0.25f * - (alpaka::math::abs(acc, betaInRHmin - betaInRHmax) + alpaka::math::abs(acc, betaOutRHmin - betaOutRHmax)) * - (alpaka::math::abs(acc, betaInRHmin - betaInRHmax) + alpaka::math::abs(acc, betaOutRHmin - betaOutRHmax))); + const float dBetaRes = 0.02f / alpaka::math::min(acc, alpaka::math::min(acc, sdOut_d, drt_InSeg), drt_tl_axis); + const float dBetaCut2 = (dBetaRes * dBetaRes * 2.0f + dBetaMuls2 + dBetaLum2 + dBetaRIn2 + dBetaROut2 + + 0.25f * (betaOutRHmin - betaOutRHmax) * (betaOutRHmin - betaOutRHmax)); float dBeta = betaIn - betaOut; return dBeta * dBeta <= dBetaCut2; } @@ -1131,37 +1139,36 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { ptSLo = alpaka::math::min(acc, 10.0f, ptSLo); const float zpitch_InLo = 0.05f; - float zpitch_OutLo = (isPS_OutLo ? kPixelPSZpitch : kStrip2SZpitch); - float zGeom = zpitch_InLo + zpitch_OutLo; + const float zpitch_OutLo = (isPS_OutLo ? kPixelPSZpitch : kStrip2SZpitch); + const float zGeom = zpitch_InLo + zpitch_OutLo; const float slope = alpaka::math::asin(acc, alpaka::math::min(acc, rt_OutLo * k2Rinv1GeVf / ptCut, kSinAlphaMax)); - const float dzDrtScale = alpaka::math::tan(acc, slope) / slope; //FIXME: need approximate value + const float dzDrtScale = slope / alpaka::math::tan(acc, slope); // account for a bend in r-z + const bool signZProd = (z_InUp < 0) ^ (z_OutLo < z_InUp); + const float dzDrtScaleLo = signZProd ? dzDrtScale : 1.f; + const float dzDrtScaleHi = signZProd ? 1.f : dzDrtScale; - const float dLum = alpaka::math::copysign(acc, kDeltaZLum, z_InUp); - bool isOutSgInnerMDPS = modules.moduleType()[segmentInnerModuleIndex] == PS; + const float dLum = alpaka::math::copysign(acc, kDeltaZLum + zGeom, z_OutLo - z_InUp); + bool isInnerMDPS = modules.moduleType()[segmentInnerModuleIndex] == PS; - const float rtGeom1 = isOutSgInnerMDPS - ? kPixelPSZpitch - : kStrip2SZpitch; //FIXME: make this chosen by configuration for lay11,12 full PS + //FIXME: make this chosen by configuration for lay11,12 full PS + const float rtGeom1 = isInnerMDPS ? kPixelPSZpitch : kStrip2SZpitch; const float zGeom1 = alpaka::math::copysign(acc, zGeom, z_InUp); //used in B-E region - rtLo = rt_InUp * (1.f + (z_OutLo - z_InUp - zGeom1) / (z_InUp + zGeom1 + dLum) / dzDrtScale) - - rtGeom1; //slope correction only on the lower end - - float zInForHi = z_InUp - zGeom1 - dLum; - if (zInForHi * z_InUp < 0) - zInForHi = alpaka::math::copysign(acc, 0.1f, z_InUp); - rtHi = rt_InUp * (1.f + (z_OutLo - z_InUp + zGeom1) / zInForHi) + rtGeom1; + //slope correction only on the lower end + rtLo = rt_InUp * (1.f + (z_OutLo - z_InUp - zGeom1) / (z_InUp + dLum) * dzDrtScaleLo) - rtGeom1; + rtHi = rt_InUp * (1.f + (z_OutLo - z_InUp + zGeom1) / (z_InUp - dLum) * dzDrtScaleHi) + rtGeom1; // Cut #2: rt condition if ((rt_OutLo < rtLo) || (rt_OutLo > rtHi)) return false; - const float dzOutInAbs = alpaka::math::abs(acc, z_OutLo - z_InUp); + const float dzOutIn = z_OutLo - z_InUp; const float cosh2Eta = 1.f + (pz * pz) / (ptIn * ptIn); - const float multDzDr2 = (dzOutInAbs * dzOutInAbs) * cosh2Eta / ((cosh2Eta - 1.f) * (cosh2Eta - 1.f)); + const float multDzDr2 = (dzOutIn * dzOutIn) * cosh2Eta / ((cosh2Eta - 1.f) * (cosh2Eta - 1.f)); const float r3_InUp = alpaka::math::sqrt(acc, z_InUp * z_InUp + rt_InUp * rt_InUp); + const float drt_OutLo_InUp = (rt_OutLo - rt_InUp); // drOutIn const float thetaMuls2 = - (kMulsInGeV * kMulsInGeV) * (0.1f + 0.2f * (rt_OutLo - rt_InUp) / 50.f) * (r3_InUp / rt_InUp); + (kMulsInGeV * kMulsInGeV) * (0.1f + 0.2f * alpaka::math::abs(acc, drt_OutLo_InUp) / 50.f) * (r3_InUp / rt_InUp); const float muls2 = thetaMuls2 * 9.f / (ptCut * ptCut) * 16.f; float drtErr = (etaErr * etaErr) * multDzDr2; @@ -1169,12 +1176,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { drtErr *= 9.f; // 3 sigma drtErr += muls2 * multDzDr2 / 3.f * cosh2Eta; drtErr = alpaka::math::sqrt(acc, drtErr); - const float drtDzIn = alpaka::math::abs(acc, ptIn / pz); - - const float drt_OutLo_InUp = (rt_OutLo - rt_InUp); // drOutIn + const float drtDzIn = ptIn / pz; const float rtWindow = drtErr + rtGeom1; - const float drtMean = drtDzIn * dzOutInAbs * + const float drtMean = drtDzIn * dzOutIn * (1.f - drt_OutLo_InUp * drt_OutLo_InUp * 4 * k2Rinv1GeVf * k2Rinv1GeVf / ptIn / ptIn / 24.f); // with curved path correction const float rtLo_point = rt_InUp + drtMean - rtWindow; @@ -1215,6 +1220,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float tl_axis_x = x_OutUp - x_InUp; float tl_axis_y = y_OutUp - y_InUp; + float drt_tl_axis = alpaka::math::sqrt(acc, tl_axis_x * tl_axis_x + tl_axis_y * tl_axis_y); + if (drt_tl_axis < 0.2f) // avoid very uncertain math. Sub-optimal: could change a ref point + return true; float tl_axis_highEdge_x = tl_axis_x; float tl_axis_highEdge_y = tl_axis_y; @@ -1223,10 +1231,13 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float tl_axis_lowEdge_y = tl_axis_y; betaIn = -cms::alpakatools::deltaPhi(acc, px, py, tl_axis_x, tl_axis_y); - float betaInRHmin = betaIn; - float betaInRHmax = betaIn; - betaOut = -alpha_OutUp + cms::alpakatools::deltaPhi(acc, x_OutUp, y_OutUp, tl_axis_x, tl_axis_y); + const float drt_tli = + alpaka::math::sqrt(acc, (x_OutLo - x_InUp) * (x_OutLo - x_InUp) + (y_OutLo - y_InUp) * (y_OutLo - y_InUp)); + if (drt_tli < 0.1f && alpaka::math::abs(acc, betaOut) < 1e-3f) { + // 3-point degeneracy: fix the sign of betaOut + betaOut = alpaka::math::copysign(acc, betaOut, betaIn); + } float betaOutRHmin = betaOut; float betaOutRHmax = betaOut; @@ -1260,12 +1271,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } //beta computation - float drt_tl_axis = alpaka::math::sqrt(acc, tl_axis_x * tl_axis_x + tl_axis_y * tl_axis_y); //no betaIn cut for the pixels const float rt_InSeg = alpaka::math::sqrt(acc, (x_InUp - x_InLo) * (x_InUp - x_InLo) + (y_InUp - y_InLo) * (y_InUp - y_InLo)); - float betaAv = 0.5f * (betaIn + betaOut); pt_beta = ptIn; int lIn = 0; @@ -1273,23 +1282,26 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float sdOut_dr = 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; + bool useBetaInSign = drt_tl_axis < sdOut_dr && drt_tli < sdOut_dr; // pLS ends inside the LS + + runDeltaBetaIterations(acc, betaIn, betaOut, pt_beta, rt_InSeg, sdOut_dr, drt_tl_axis, lIn, useBetaInSign); + // wrap around pi (do for all) + if (alpaka::math::abs(acc, betaIn) > kPi / 2.f || alpaka::math::abs(acc, betaOut) > kPi / 2.f) { + betaIn = cms::alpakatools::reducePhiRange(acc, kPi - betaIn); + betaOut = cms::alpakatools::reducePhiRange(acc, kPi - betaOut); + betaOutRHmin = cms::alpakatools::reducePhiRange(acc, kPi - betaOutRHmin); + betaOutRHmax = cms::alpakatools::reducePhiRange(acc, kPi - betaOutRHmax); + } - 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)) - : 0.; //mean value of min,max is the old betaIn const float betaOutMMSF = (alpaka::math::abs(acc, betaOutRHmin + betaOutRHmax) > 0) ? (2.f * betaOut / alpaka::math::abs(acc, betaOutRHmin + betaOutRHmax)) : 0.; - betaInRHmin *= betaInMMSF; - betaInRHmax *= betaInMMSF; betaOutRHmin *= betaOutMMSF; betaOutRHmax *= betaOutMMSF; - float min_ptBeta_ptBetaMax = alpaka::math::min( + float pt_beta_trunc = alpaka::math::min( acc, alpaka::math::abs(acc, pt_beta), kPt_betaMax); //need to confirm the range-out value of 7 GeV - const float dBetaMuls2 = thetaMuls2 * 16.f / (min_ptBeta_ptBetaMax * min_ptBeta_ptBetaMax); + const float dBetaMuls2 = thetaMuls2 * 16.f / (pt_beta_trunc * pt_beta_trunc); const float alphaInAbsReg = alpaka::math::max(acc, @@ -1330,12 +1342,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float drt_InSeg = rt_InUp - rt_InLo; - const float dBetaRes = 0.02f / alpaka::math::min(acc, sdOut_d, drt_InSeg); - const float dBetaCut2 = - (dBetaRes * dBetaRes * 2.0f + dBetaMuls2 + dBetaLum2 + dBetaRIn2 + dBetaROut2 + - 0.25f * - (alpaka::math::abs(acc, betaInRHmin - betaInRHmax) + alpaka::math::abs(acc, betaOutRHmin - betaOutRHmax)) * - (alpaka::math::abs(acc, betaInRHmin - betaInRHmax) + alpaka::math::abs(acc, betaOutRHmin - betaOutRHmax))); + const float dBetaRes = 0.02f / alpaka::math::min(acc, alpaka::math::min(acc, sdOut_d, drt_InSeg), drt_tl_axis); + const float dBetaCut2 = (dBetaRes * dBetaRes * 2.0f + dBetaMuls2 + dBetaLum2 + dBetaRIn2 + dBetaROut2 + + 0.25f * (betaOutRHmin - betaOutRHmax) * (betaOutRHmin - betaOutRHmax)); float dBeta = betaIn - betaOut; return dBeta * dBeta <= dBetaCut2; } diff --git a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h index eec5cfe8f2fd1..30c506ebe7a86 100644 --- a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h +++ b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h @@ -793,18 +793,18 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { 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 lIn, + bool useBetaInSign = false) { if (lIn == 0) { betaOut += alpaka::math::copysign( acc, alpaka::math::asin( acc, alpaka::math::min(acc, sdOut_dr * k2Rinv1GeVf / alpaka::math::abs(acc, pt_beta), kSinAlphaMax)), - betaOut); + useBetaInSign ? betaIn : betaOut); return; } @@ -827,7 +827,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { alpaka::math::asin( acc, alpaka::math::min(acc, sdOut_dr * k2Rinv1GeVf / alpaka::math::abs(acc, pt_beta), kSinAlphaMax)), betaOut); //FIXME: need a faster version - betaAv = 0.5f * (betaInUpd + betaOutUpd); + float betaAv = 0.5f * (betaInUpd + betaOutUpd); //1st update const float pt_beta_inv = @@ -865,9 +865,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { acc, alpaka::math::min(acc, sdOut_dr * k2Rinv1GeVf / alpaka::math::abs(acc, pt_betaIn), 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; + float betaAv = (alpaka::math::abs(acc, betaOut) > 0.2f * alpaka::math::abs(acc, betaIn)) + ? (0.5f * (betaInUpd + betaOutUpd)) + : betaInUpd; //1st update pt_beta = dr * k2Rinv1GeVf / alpaka::math::sin(acc, betaAv); //get a better pt estimate @@ -1013,7 +1013,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { (mds.anchorY()[fourthMDIndex] - mds.anchorY()[thirdMDIndex])); float sdOut_d = mds.anchorRt()[fourthMDIndex] - mds.anchorRt()[thirdMDIndex]; - runDeltaBetaIterations(acc, betaIn, betaOut, betaAv, pt_beta, rt_InSeg, sdOut_dr, drt_tl_axis, lIn); + runDeltaBetaIterations(acc, betaIn, betaOut, 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)) @@ -1179,7 +1179,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { (mds.anchorY()[fourthMDIndex] - mds.anchorY()[thirdMDIndex])); float sdOut_d = mds.anchorRt()[fourthMDIndex] - mds.anchorRt()[thirdMDIndex]; - runDeltaBetaIterations(acc, betaIn, betaOut, betaAv, pt_beta, sdIn_dr, sdOut_dr, dr, lIn); + runDeltaBetaIterations(acc, betaIn, betaOut, 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)) @@ -1324,7 +1324,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { (mds.anchorY()[fourthMDIndex] - mds.anchorY()[thirdMDIndex])); float sdOut_d = mds.anchorRt()[fourthMDIndex] - mds.anchorRt()[thirdMDIndex]; - runDeltaBetaIterations(acc, betaIn, betaOut, betaAv, pt_beta, sdIn_dr, sdOut_dr, dr, lIn); + runDeltaBetaIterations(acc, betaIn, betaOut, 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)) From 0d234e838fa73645587cae5bf9faeed5553292dc Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Mon, 6 Apr 2026 10:41:04 -0700 Subject: [PATCH 3/8] PixelSegmentsSoALayout::pLSHitsIdxs are now packed OT/IT<<32 + index to have a fast (and disambiguated) overlap checks; simplify pLS overlap check --- .../LSTCore/interface/PixelSegmentsSoA.h | 2 +- RecoTracker/LSTCore/src/alpaka/Hit.h | 5 ++ RecoTracker/LSTCore/src/alpaka/Segment.h | 9 ++-- .../LSTCore/src/alpaka/TrackCandidate.h | 52 ++++++------------- 4 files changed, 28 insertions(+), 40 deletions(-) diff --git a/RecoTracker/LSTCore/interface/PixelSegmentsSoA.h b/RecoTracker/LSTCore/interface/PixelSegmentsSoA.h index 9be36d52cc221..a5c3d088fb9e5 100644 --- a/RecoTracker/LSTCore/interface/PixelSegmentsSoA.h +++ b/RecoTracker/LSTCore/interface/PixelSegmentsSoA.h @@ -9,7 +9,7 @@ namespace lst { GENERATE_SOA_LAYOUT(PixelSegmentsSoALayout, - SOA_COLUMN(Params_pLS::ArrayUxHits, pLSHitsIdxs), + SOA_COLUMN(Params_pLS::ArrayUxHits, pLSHitsIdxs), // packed OT/IT<<32 + index SOA_COLUMN(Params_pLS::ArrayFxEmbed, plsEmbed), SOA_COLUMN(char, isDup), SOA_COLUMN(bool, partOfPT5), diff --git a/RecoTracker/LSTCore/src/alpaka/Hit.h b/RecoTracker/LSTCore/src/alpaka/Hit.h index 7e917f8f04c56..ecab2d81e8d9e 100644 --- a/RecoTracker/LSTCore/src/alpaka/Hit.h +++ b/RecoTracker/LSTCore/src/alpaka/Hit.h @@ -16,6 +16,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { return cms::alpakatools::deltaPhi(acc, x1, y1, x2 - x1, y2 - y1); } + ALPAKA_FN_ACC ALPAKA_FN_INLINE unsigned int packedHitIdx(unsigned int ih, HitsBaseConst hitsBase) { + constexpr int kOTBit = 1 << 31; + return hitsBase.idxs()[ih] | (hitsBase.detid()[ih] == kPixelModuleId ? 0 : kOTBit); + } + struct ModuleRangesKernel { ALPAKA_FN_ACC void operator()(Acc1D const& acc, ModulesConst modules, diff --git a/RecoTracker/LSTCore/src/alpaka/Segment.h b/RecoTracker/LSTCore/src/alpaka/Segment.h index d0f6fa9d4974d..69a9f75e90510 100644 --- a/RecoTracker/LSTCore/src/alpaka/Segment.h +++ b/RecoTracker/LSTCore/src/alpaka/Segment.h @@ -1130,10 +1130,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { (hitsBase.zs()[mds.anchorHitIndices()[outerMDIndex]]); score_lsq = score_lsq * score_lsq; - const Params_pLS::ArrayUxHits hits1{{hitsBase.idxs()[mds.anchorHitIndices()[innerMDIndex]], - hitsBase.idxs()[mds.anchorHitIndices()[outerMDIndex]], - hitsBase.idxs()[mds.outerHitIndices()[innerMDIndex]], - hitsBase.idxs()[mds.outerHitIndices()[outerMDIndex]]}}; + const Params_pLS::ArrayUxHits hits1{{packedHitIdx(mds.anchorHitIndices()[innerMDIndex], hitsBase), + packedHitIdx(mds.anchorHitIndices()[outerMDIndex], hitsBase), + packedHitIdx(mds.outerHitIndices()[innerMDIndex], hitsBase), + packedHitIdx(mds.outerHitIndices()[outerMDIndex], hitsBase)}}; + addPixelSegmentToMemory(acc, segments, pixelSegments, diff --git a/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h b/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h index 3afb7295e1dab..1b08fb4355192 100644 --- a/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h +++ b/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h @@ -151,41 +151,22 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { #endif } - ALPAKA_FN_ACC ALPAKA_FN_INLINE int checkPixelHits( - unsigned int ix, unsigned int jx, MiniDoubletsConst mds, SegmentsConst segments, HitsBaseConst hitsBase) { - int phits1[Params_pLS::kHits]; - int phits2[Params_pLS::kHits]; - - phits1[0] = hitsBase.idxs()[mds.anchorHitIndices()[segments.mdIndices()[ix][0]]]; - phits1[1] = hitsBase.idxs()[mds.anchorHitIndices()[segments.mdIndices()[ix][1]]]; - phits1[2] = hitsBase.idxs()[mds.outerHitIndices()[segments.mdIndices()[ix][0]]]; - phits1[3] = hitsBase.idxs()[mds.outerHitIndices()[segments.mdIndices()[ix][1]]]; - - phits2[0] = hitsBase.idxs()[mds.anchorHitIndices()[segments.mdIndices()[jx][0]]]; - phits2[1] = hitsBase.idxs()[mds.anchorHitIndices()[segments.mdIndices()[jx][1]]]; - phits2[2] = hitsBase.idxs()[mds.outerHitIndices()[segments.mdIndices()[jx][0]]]; - phits2[3] = hitsBase.idxs()[mds.outerHitIndices()[segments.mdIndices()[jx][1]]]; - - int npMatched = 0; - + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool pixelHitsOverlapAny(unsigned int ix, + unsigned int jx, + PixelSegmentsConst pixelSegments) { + if (ix == jx) + return true; + + auto const& phits1 = pixelSegments.pLSHitsIdxs()[ix]; + auto const& phits2 = pixelSegments.pLSHitsIdxs()[jx]; for (int i = 0; i < Params_pLS::kHits; i++) { - bool pmatched = false; - if (phits1[i] == -1) - continue; - for (int j = 0; j < Params_pLS::kHits; j++) { - if (phits2[j] == -1) - continue; - if (phits1[i] == phits2[j]) { - pmatched = true; - break; + return true; } } - if (pmatched) - npMatched++; } - return npMatched; + return false; } struct CrossCleanpT3 { @@ -405,9 +386,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } else if (type == LSTObjType::pT3) { int pT3Index = innerTrackletIdx; int pLSIndex = pixelTriplets.pixelSegmentIndices()[pT3Index]; - int npMatched = checkPixelHits(prefix + pixelArrayIndex, pLSIndex, mds, segments, hitsBase); - if (npMatched > 0) + if (pixelHitsOverlapAny(pixelArrayIndex, pLSIndex - prefix, pixelSegments)) { pixelSegments.isDup()[pixelArrayIndex] = true; + } float eta2 = __H2F(pixelTriplets.eta_pix()[pT3Index]); float phi2 = __H2F(pixelTriplets.phi_pix()[pT3Index]); @@ -415,12 +396,12 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float dPhi = cms::alpakatools::deltaPhi(acc, phi1, phi2); float dR2 = dEta * dEta + dPhi * dPhi; - if (dR2 < 0.000001f) + if (dR2 < 0.000001f) { pixelSegments.isDup()[pixelArrayIndex] = true; + } } else if (type == LSTObjType::pT5) { unsigned int pLSIndex = innerTrackletIdx; - int npMatched = checkPixelHits(prefix + pixelArrayIndex, pLSIndex, mds, segments, hitsBase); - if (npMatched > 0) { + if (pixelHitsOverlapAny(pixelArrayIndex, pLSIndex - prefix, pixelSegments)) { pixelSegments.isDup()[pixelArrayIndex] = true; } @@ -430,8 +411,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float dPhi = cms::alpakatools::deltaPhi(acc, phi1, phi2); float dR2 = dEta * dEta + dPhi * dPhi; - if (dR2 < 0.000001f) + if (dR2 < 0.000001f) { pixelSegments.isDup()[pixelArrayIndex] = true; + } } } } From de615eb8e76e4cff906e301d1aecc84455b0aad5 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Mon, 13 Apr 2026 01:41:52 -0700 Subject: [PATCH 4/8] skip duplicate hits --- RecoTracker/LST/plugins/LSTOutputConverter.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/RecoTracker/LST/plugins/LSTOutputConverter.cc b/RecoTracker/LST/plugins/LSTOutputConverter.cc index 7ebf9e9388f60..1ba11fbe957a6 100644 --- a/RecoTracker/LST/plugins/LSTOutputConverter.cc +++ b/RecoTracker/LST/plugins/LSTOutputConverter.cc @@ -189,7 +189,14 @@ void LSTOutputConverter::produce(edm::Event& iEvent, const edm::EventSetup& iSet unsigned int hitIdx = lstOutput_view.hitIndices()[i][layerSlot][hitSlot]; if (hitIdx == lst::kTCEmptyHitIdx) continue; - recHits.push_back(OTHits[hitIdx]->clone()); + bool hitOK = true; + for (auto const& hit : recHits) + if (hit.sharesInput(OTHits[hitIdx], TrackingRecHit::all)) { + hitOK = false; + break; + } + if (hitOK) + recHits.push_back(OTHits[hitIdx]->clone()); } } @@ -212,9 +219,7 @@ void LSTOutputConverter::produce(edm::Event& iEvent, const edm::EventSetup& iSet } } }); - } - if (iType != lst::LSTObjType::pLS) { // For T5/T4: makeSeed is needed whenever seeds or TCs are produced, since the resulting // seed is the only source of initial state for T5/T4 track candidates. // For other pT objects: makeSeed is only needed for seed output. From 5c7738a6584e449f5c84237240e2c020ffe7c6c1 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Wed, 29 Apr 2026 07:57:57 -0700 Subject: [PATCH 5/8] load the last pLS hit to the 4th entry; use it in the hit position range in pLS-LS matching --- RecoTracker/LSTCore/interface/LSTPrepareInput.h | 7 ++++--- RecoTracker/LSTCore/src/alpaka/PixelTriplet.h | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/RecoTracker/LSTCore/interface/LSTPrepareInput.h b/RecoTracker/LSTCore/interface/LSTPrepareInput.h index 002e9e35423e7..3f2a028cf7dd0 100644 --- a/RecoTracker/LSTCore/interface/LSTPrepareInput.h +++ b/RecoTracker/LSTCore/interface/LSTPrepareInput.h @@ -169,8 +169,9 @@ namespace lst { trkX.push_back(r3LH.x()); trkY.push_back(see_dxy[iSeed]); trkZ.push_back(see_dz[iSeed]); - hitId.push_back(hTypes[3] == intPixel ? kPixelModuleId : ph2_detId[hIdxs[3]]); - hitClustSize.push_back(hTypes[3] == intPixel ? 1 : ph2_clustSize[hIdxs[3]]); + auto iLH = see_hitIdx[iSeed].size() - 1; + hitId.push_back(hTypes[iLH] == intPixel ? kPixelModuleId : ph2_detId[hIdxs[iLH]]); + hitClustSize.push_back(hTypes[iLH] == intPixel ? 1 : ph2_clustSize[hIdxs[iLH]]); } px_vec.push_back(px); py_vec.push_back(py); @@ -193,7 +194,7 @@ namespace lst { char isQuad = false; if (see_hitIdx[iSeed].size() > 3) { isQuad = true; - hitIdxs.push_back(see_hitIdx[iSeed][3]); + hitIdxs.push_back(see_hitIdx[iSeed].back()); } float neta = 25.; float nphi = 72.; diff --git a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h index aa35d94652bfd..667419257840f 100644 --- a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h +++ b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h @@ -886,12 +886,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { const float dzDrtScaleHi = z_InUp * rtRelDiff < 0.f ? 1.f : dzDrtScale; const float dzDrtScaleLo = z_InUp * rtRelDiff > 0.f ? 1.f : dzDrtScale; const float zpitch_InLo = 0.05f; - bool sameLayerOutLo = - alpaka::math::abs(acc, rt_OutLo - rt_InOut) < 1.f && alpaka::math::abs(acc, z_InUp - z_OutLo) < 1.f; + bool isPLSinOT = pixelSeeds.pLSHitsIdxs()[pixelSegmentArrayIndex][3] & (1 << 31); bool isPS_OutLo = (modules.moduleType()[segmentInnerModuleIndex] == PS); bool isTilted_OutLo = (modules.sides()[segmentInnerModuleIndex] != Center); // same layer pLS is P-size, 50 um otherwise - const float zpitch_InOut = sameLayerOutLo ? kPixelPSZpitch : 0.05f; + const float zpitch_InOut = isPLSinOT ? kPixelPSZpitch : 0.05f; const float zpitch_OutLo = (isPS_OutLo ? kPixelPSZpitch : kStrip2SZpitch); // could reduce using dzdrt for tilted const float zGeom = zpitch_InLo + zpitch_OutLo; const float rGeom = zpitch_InOut + zpitch_OutLo; // could reduce using dzdrt for tilted From 12314fe42100400c09c843012e181e1dcf7851c6 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Thu, 28 May 2026 15:53:06 -0700 Subject: [PATCH 6/8] moved to pixelSeeds firstHit, nHits (kMaxPLSHitsInHitsSoA = 4), hitDetBits (kMaxPLSHitBitsInHitsSoA = 8) to open room for more hits --- RecoTracker/LSTCore/interface/Common.h | 3 + RecoTracker/LSTCore/interface/LSTInputSoA.h | 4 +- .../LSTCore/interface/LSTPrepareInput.h | 64 +++++++++++-------- RecoTracker/LSTCore/interface/alpaka/Common.h | 1 + RecoTracker/LSTCore/src/alpaka/PixelTriplet.h | 8 ++- RecoTracker/LSTCore/src/alpaka/Segment.h | 15 +++-- 6 files changed, 59 insertions(+), 36 deletions(-) diff --git a/RecoTracker/LSTCore/interface/Common.h b/RecoTracker/LSTCore/interface/Common.h index ec0ad431898d5..4fcc14b9106a9 100644 --- a/RecoTracker/LSTCore/interface/Common.h +++ b/RecoTracker/LSTCore/interface/Common.h @@ -24,6 +24,9 @@ namespace lst { constexpr unsigned int kPixelModuleId = 1; + constexpr unsigned int kMaxPLSHitsInHitsSoA = 4; + constexpr unsigned int kMaxPLSHitBitsInHitsSoA = 8; + constexpr unsigned int max_blocks = 80; constexpr unsigned int max_connected_modules = 40; diff --git a/RecoTracker/LSTCore/interface/LSTInputSoA.h b/RecoTracker/LSTCore/interface/LSTInputSoA.h index e0e50afc75a7c..ca915f3753d54 100644 --- a/RecoTracker/LSTCore/interface/LSTInputSoA.h +++ b/RecoTracker/LSTCore/interface/LSTInputSoA.h @@ -26,7 +26,9 @@ namespace lst { SOA_SCALAR(unsigned int, nHitsOT)) GENERATE_SOA_LAYOUT(PixelSeedsSoALayout, - SOA_COLUMN(Params_pLS::ArrayUxHits, hitIndices), + SOA_COLUMN(unsigned int, firstHit), + SOA_COLUMN(uint8_t, nHits), + SOA_COLUMN(uint8_t, hitDetBits), // IT 0, OT 1 up to min(nHits, 8) SOA_COLUMN(float, deltaPhi), SOA_COLUMN(unsigned int, seedIdx), SOA_COLUMN(int, charge), diff --git a/RecoTracker/LSTCore/interface/LSTPrepareInput.h b/RecoTracker/LSTCore/interface/LSTPrepareInput.h index 3f2a028cf7dd0..dfc7fc0397eaf 100644 --- a/RecoTracker/LSTCore/interface/LSTPrepareInput.h +++ b/RecoTracker/LSTCore/interface/LSTPrepareInput.h @@ -55,7 +55,9 @@ namespace lst { std::vector hitClustSize; std::vector hitId; std::vector hitIdxs; - std::vector hitIndices_vec; + std::vector firstHit_vec; + std::vector nHits_vec; + std::vector hitDetBits_vec; std::vector deltaPhi_vec; std::vector ptIn_vec; std::vector ptErr_vec; @@ -78,7 +80,9 @@ namespace lst { px_vec.reserve(n_see); py_vec.reserve(n_see); pz_vec.reserve(n_see); - hitIndices_vec.reserve(n_see); + firstHit_vec.reserve(n_see); + nHits_vec.reserve(n_see); + hitDetBits_vec.reserve(n_see); ptIn_vec.reserve(n_see); ptErr_vec.reserve(n_see); etaErr_vec.reserve(n_see); @@ -96,6 +100,7 @@ namespace lst { hitIdxs.resize(hit_size); std::iota(hitIdxs.begin(), hitIdxs.end(), 0); + int nHitsOT = ph2_x.size(); for (size_t iSeed = 0; iSeed < n_see; iSeed++) { // Only needed for standalone @@ -133,20 +138,31 @@ namespace lst { } else continue; - unsigned int hitIdx0 = hit_size + count; - count++; - unsigned int hitIdx1 = hit_size + count; - count++; - unsigned int hitIdx2 = hit_size + count; - count++; - unsigned int hitIdx3; - if (see_hitIdx[iSeed].size() <= 3) - hitIdx3 = hitIdx2; - else { - hitIdx3 = hit_size + count; - count++; + firstHit_vec.push_back(hit_size + count); + nHits_vec.push_back(see_hitIdx[iSeed].size()); + + const unsigned int nHitsToSoA = + std::min(static_cast(see_hitIdx[iSeed].size()), kMaxPLSHitsInHitsSoA); + assert(nHitsToSoA >= 3); // need to rework the logic for less than 3 hits + count += nHitsToSoA; + + auto const& hTypes = see_hitType[iSeed]; + auto constexpr intPixel = static_cast(HitType::Pixel); + auto const& hIdxs = see_hitIdx[iSeed]; + for (unsigned int iSH = 0; iSH < nHitsToSoA; iSH++) { + auto iH = iSH + 1 == nHitsToSoA ? see_hitIdx[iSeed].size() - 1 : iSH; // include the last + hitId.push_back(hTypes[iH] == intPixel ? kPixelModuleId : ph2_detId[hIdxs[iH]]); + hitClustSize.push_back(hTypes[iH] == intPixel ? 1 : ph2_clustSize[hIdxs[iH]]); + } + uint8_t hitDetBits = 0; + uint8_t nToBits = std::min(kMaxPLSHitBitsInHitsSoA, static_cast(see_hitIdx[iSeed].size())); + for (int iSH = 0; iSH < nToBits; iSH++) { + auto iH = iSH + 1 == nToBits ? see_hitIdx[iSeed].size() - 1 : iSH; // include the last + hitDetBits |= (hTypes[iH] != intPixel) << iSH; } + hitDetBits_vec.push_back(hitDetBits); + // eventually these trk[XYZ] should be moved to the PixelSeeds SoA trkX.push_back(r3PCA.x()); trkY.push_back(r3PCA.y()); trkZ.push_back(r3PCA.z()); @@ -158,26 +174,17 @@ namespace lst { trkX.push_back(r3LH.x()); trkY.push_back(r3LH.y()); trkZ.push_back(r3LH.z()); - auto const& hTypes = see_hitType[iSeed]; - auto constexpr intPixel = static_cast(HitType::Pixel); - auto const& hIdxs = see_hitIdx[iSeed]; - for (int iSH = 0; iSH < 3; iSH++) { - hitId.push_back(hTypes[iSH] == intPixel ? kPixelModuleId : ph2_detId[hIdxs[iSH]]); - hitClustSize.push_back(hTypes[iSH] == intPixel ? 1 : ph2_clustSize[hIdxs[iSH]]); - } - if (see_hitIdx[iSeed].size() > 3) { + for (unsigned int iH = 3; iH < nHitsToSoA; iH++) { trkX.push_back(r3LH.x()); trkY.push_back(see_dxy[iSeed]); trkZ.push_back(see_dz[iSeed]); - auto iLH = see_hitIdx[iSeed].size() - 1; - hitId.push_back(hTypes[iLH] == intPixel ? kPixelModuleId : ph2_detId[hIdxs[iLH]]); - hitClustSize.push_back(hTypes[iLH] == intPixel ? 1 : ph2_clustSize[hIdxs[iLH]]); } + assert(trkX.size() == count); + px_vec.push_back(px); py_vec.push_back(py); pz_vec.push_back(pz); - hitIndices_vec.push_back({{hitIdx0, hitIdx1, hitIdx2, hitIdx3}}); ptIn_vec.push_back(ptIn); ptErr_vec.push_back(ptErr); etaErr_vec.push_back(etaErr); @@ -210,7 +217,6 @@ namespace lst { } // Build the SoAs - int nHitsOT = ph2_x.size(); int nHitsIT = trkX.size(); int nPixelSeeds = ptIn_vec.size(); if (static_cast(nPixelSeeds) > n_max_pixel_segments_per_module) { @@ -242,7 +248,9 @@ namespace lst { std::copy_n(hitIdxs.data(), nHitsIT + nHitsOT, hits.idxs().data()); auto pixelSeeds = lstInputHC.view().pixelSeeds(); - std::copy_n(hitIndices_vec.data(), nPixelSeeds, pixelSeeds.hitIndices().data()); + std::copy_n(firstHit_vec.data(), nPixelSeeds, pixelSeeds.firstHit().data()); + std::copy_n(nHits_vec.data(), nPixelSeeds, pixelSeeds.nHits().data()); + std::copy_n(hitDetBits_vec.data(), nPixelSeeds, pixelSeeds.hitDetBits().data()); std::copy_n(deltaPhi_vec.data(), nPixelSeeds, pixelSeeds.deltaPhi().data()); std::copy_n(ptIn_vec.data(), nPixelSeeds, pixelSeeds.ptIn().data()); std::copy_n(ptErr_vec.data(), nPixelSeeds, pixelSeeds.ptErr().data()); diff --git a/RecoTracker/LSTCore/interface/alpaka/Common.h b/RecoTracker/LSTCore/interface/alpaka/Common.h index a380fc3888583..bd9fab0360d5e 100644 --- a/RecoTracker/LSTCore/interface/alpaka/Common.h +++ b/RecoTracker/LSTCore/interface/alpaka/Common.h @@ -47,6 +47,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { // To be updated with std::numeric_limits::infinity() in the code and data files HOST_DEVICE_CONSTANT float kVerticalModuleSlope = 123456789.0; HOST_DEVICE_CONSTANT int kLogicalOTLayers = 11; // logical OT layers are 1..11 + HOST_DEVICE_CONSTANT auto kMaxPLSHitBitsInHitsSoA = ::lst::kMaxPLSHitBitsInHitsSoA; HOST_DEVICE_CONSTANT float kMiniDeltaTilted[3] = {0.26f, 0.26f, 0.26f}; HOST_DEVICE_CONSTANT float kMiniDeltaFlat[6] = {0.26f, 0.16f, 0.16f, 0.18f, 0.18f, 0.18f}; diff --git a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h index 667419257840f..3d7ea3e450473 100644 --- a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h +++ b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h @@ -25,6 +25,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { float x_InUp, y_InUp, z_InUp, rt_InUp; // pixel outer MD (pLSMD1) float alpha_InLo; // pixel segment dPhiChange int charge; + uint8_t nHits; + uint8_t hitDetBits; }; ALPAKA_FN_ACC ALPAKA_FN_INLINE PixelSeedData loadPixelSeedData(PixelSeedsConst pixelSeeds, @@ -45,6 +47,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { pixelData.eta = pixelSeeds.eta()[pixelSeedIndex]; pixelData.phi = pixelSeeds.phi()[pixelSeedIndex]; pixelData.charge = pixelSeeds.charge()[pixelSeedIndex]; + pixelData.nHits = pixelSeeds.nHits()[pixelSeedIndex]; + pixelData.hitDetBits = pixelSeeds.hitDetBits()[pixelSeedIndex]; pixelData.circleCenterX = pixelSegments.circleCenterX()[pixelSeedIndex]; pixelData.circleCenterY = pixelSegments.circleCenterY()[pixelSeedIndex]; pixelData.circleRadius = pixelSegments.circleRadius()[pixelSeedIndex]; @@ -886,7 +890,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { const float dzDrtScaleHi = z_InUp * rtRelDiff < 0.f ? 1.f : dzDrtScale; const float dzDrtScaleLo = z_InUp * rtRelDiff > 0.f ? 1.f : dzDrtScale; const float zpitch_InLo = 0.05f; - bool isPLSinOT = pixelSeeds.pLSHitsIdxs()[pixelSegmentArrayIndex][3] & (1 << 31); + bool isPLSinOT = + pixelData.hitDetBits & + (1 << (alpaka::math::min(acc, static_cast(pixelData.nHits), kMaxPLSHitBitsInHitsSoA) - 1)); bool isPS_OutLo = (modules.moduleType()[segmentInnerModuleIndex] == PS); bool isTilted_OutLo = (modules.sides()[segmentInnerModuleIndex] != Center); // same layer pLS is P-size, 50 um otherwise diff --git a/RecoTracker/LSTCore/src/alpaka/Segment.h b/RecoTracker/LSTCore/src/alpaka/Segment.h index 69a9f75e90510..26cfc1e480119 100644 --- a/RecoTracker/LSTCore/src/alpaka/Segment.h +++ b/RecoTracker/LSTCore/src/alpaka/Segment.h @@ -1087,13 +1087,16 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { unsigned int outerMDIndex = ranges.miniDoubletModuleIndices()[pixelModuleIndex] + 2 * (tid) + 1; unsigned int pixelSegmentIndex = ranges.segmentModuleIndices()[pixelModuleIndex] + tid; + unsigned int firstHit = pixelSeeds.firstHit()[tid]; + unsigned int nHits = pixelSeeds.nHits()[tid]; + unsigned int fourthHit = nHits < 4 ? firstHit + 2 : firstHit + 3; addMDToMemory(acc, mds, hitsBase, hitsExtended, modules, - pixelSeeds.hitIndices()[tid][0], - pixelSeeds.hitIndices()[tid][1], + firstHit, + firstHit + 1, pixelModuleIndex, 0, 0, @@ -1109,8 +1112,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { hitsBase, hitsExtended, modules, - pixelSeeds.hitIndices()[tid][2], - pixelSeeds.hitIndices()[tid][3], + firstHit + 2, + fourthHit, pixelModuleIndex, 0, 0, @@ -1144,8 +1147,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { outerMDIndex, pixelModuleIndex, hits1, - pixelSeeds.hitIndices()[tid][0], - pixelSeeds.hitIndices()[tid][2], + firstHit, + firstHit + 2, pixelSeeds.deltaPhi()[tid], pixelSegmentIndex, tid, From fd5e1820f3ee0eb16d8382f3e68c71509d84ac16 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Mon, 8 Jun 2026 06:22:07 -0700 Subject: [PATCH 7/8] second-guess CA extension and use dropOTHitsPurePLS if the pLS ends in OT and was not extended by LST (at most 3 IT hits) --- .../hltInitialStepTrackCandidates_cfi.py | 2 + .../hltInitialStepTrajectorySeedsLST_cfi.py | 2 + RecoTracker/LST/plugins/LSTOutputConverter.cc | 53 +++++++++++++++---- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrackCandidates_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrackCandidates_cfi.py index 8f766e6b0df4e..ddf9b1fd2d933 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrackCandidates_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrackCandidates_cfi.py @@ -64,6 +64,8 @@ lstPixelSeeds = cms.InputTag('hltInputLST'), includeT5s = cms.bool(True), includeNonpLSTSs = cms.bool(False), + dropOTHitsPurePLS = cms.bool(False), + maxITHitsToDropOTHitsPurePLS = cms.int32(3), produceSeeds = cms.bool(False), produceTrackCandidates = cms.bool(True), propagatorAlong = cms.ESInputTag('', 'PropagatorWithMaterial'), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrajectorySeedsLST_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrajectorySeedsLST_cfi.py index 82e2085f7c263..e311af604f68a 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrajectorySeedsLST_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrajectorySeedsLST_cfi.py @@ -6,6 +6,8 @@ lstPixelSeeds = cms.InputTag('hltInputLST'), includeT5s = cms.bool(True), includeNonpLSTSs = cms.bool(True), + dropOTHitsPurePLS = cms.bool(False), + maxITHitsToDropOTHitsPurePLS = cms.int32(3), produceSeeds = cms.bool(True), produceTrackCandidates = cms.bool(False), propagatorAlong = cms.ESInputTag('', 'PropagatorWithMaterial'), diff --git a/RecoTracker/LST/plugins/LSTOutputConverter.cc b/RecoTracker/LST/plugins/LSTOutputConverter.cc index 1ba11fbe957a6..1184b4b211ed3 100644 --- a/RecoTracker/LST/plugins/LSTOutputConverter.cc +++ b/RecoTracker/LST/plugins/LSTOutputConverter.cc @@ -25,6 +25,8 @@ #include "TrackingTools/Records/interface/TrackingComponentsRecord.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" +#include + class LSTOutputConverter : public edm::stream::EDProducer<> { public: explicit LSTOutputConverter(edm::ParameterSet const& iConfig); @@ -40,6 +42,8 @@ class LSTOutputConverter : public edm::stream::EDProducer<> { const edm::EDGetTokenT lstPixelSeedToken_; const bool includeT5s_; const bool includeNonpLSTSs_; + const bool dropOTHitsPurePLS_; + const int maxITHitsToDropOTHitsPurePLS_; const bool produceSeeds_; const bool produceTrackCandidates_; const edm::ESGetToken mfToken_; @@ -68,6 +72,8 @@ LSTOutputConverter::LSTOutputConverter(edm::ParameterSet const& iConfig) lstPixelSeedToken_{consumes(iConfig.getParameter("lstPixelSeeds"))}, includeT5s_(iConfig.getParameter("includeT5s")), includeNonpLSTSs_(iConfig.getParameter("includeNonpLSTSs")), + dropOTHitsPurePLS_(iConfig.getParameter("dropOTHitsPurePLS")), + maxITHitsToDropOTHitsPurePLS_(iConfig.getParameter("maxITHitsToDropOTHitsPurePLS")), produceSeeds_(iConfig.getParameter("produceSeeds")), produceTrackCandidates_(iConfig.getParameter("produceTrackCandidates")), mfToken_(esConsumes()), @@ -110,6 +116,8 @@ void LSTOutputConverter::fillDescriptions(edm::ConfigurationDescriptions& descri desc.add("lstPixelSeeds", edm::InputTag("lstInputProducer")); desc.add("includeT5s", true); desc.add("includeNonpLSTSs", false); + desc.add("dropOTHitsPurePLS", false); + desc.add("maxITHitsToDropOTHitsPurePLS", 3); desc.add("produceSeeds", true); desc.add("produceTrackCandidates", true); desc.add("propagatorAlong", edm::ESInputTag{"", "PropagatorWithMaterial"}); @@ -167,16 +175,21 @@ void LSTOutputConverter::produce(edm::Event& iEvent, const edm::EventSetup& iSet for (unsigned int i = 0; i < nTrackCandidates; i++) { auto iType = lstOutput_view.trackCandidateType()[i]; bool const isT5orT4 = (iType == lst::LSTObjType::T5 || iType == lst::LSTObjType::T4); - LogDebug("LSTOutputConverter") << " cand " << i << " " << iType << " " << lstOutput_view.pixelSeedIndex()[i]; + const auto iSeed = lstOutput_view.pixelSeedIndex()[i]; + const bool dropHitsOTpL = + iType == lst::LSTObjType::pLS && dropOTHitsPurePLS_ && + std::prev(pixelSeeds[iSeed].recHits().end())->geographicalId().subdetId() > PixelSubdetector::PixelEndcap && + std::ranges::count_if(pixelSeeds[iSeed].recHits(), [](const auto& h) { + return h.geographicalId().subdetId() <= PixelSubdetector::PixelEndcap; + }) <= maxITHitsToDropOTHitsPurePLS_; + LogDebug("LSTOutputConverter") << " cand " << i << " " << iType << " " << iSeed; TrajectorySeed seed; edm::RefToBase seedRef; - if (!isT5orT4) { - seed = pixelSeeds[lstOutput_view.pixelSeedIndex()[i]]; - seedRef = {pixelSeedsRBP, lstOutput_view.pixelSeedIndex()[i]}; - } - edm::OwnVector recHits; - if (!isT5orT4) { + if (!isT5orT4 && !dropHitsOTpL) { + seed = pixelSeeds[iSeed]; + seedRef = {pixelSeedsRBP, iSeed}; + for (auto const& hit : seed.recHits()) recHits.push_back(hit.clone()); } @@ -269,11 +282,29 @@ void LSTOutputConverter::produce(edm::Event& iEvent, const edm::EventSetup& iSet LogDebug("LSTOutputConverter") << "Created a seed with " << trajectorySeed.nHits() << " " << ss.detId() << " " << ss.pt() << " " << ss.parameters().vector() << " " << ss.error(0); } - } else { - if (produceSeeds_) { - outputTS.emplace_back(seed); - outputpLSTS.emplace_back(seed); + } else if (produceSeeds_ || (produceTrackCandidates_ && dropHitsOTpL)) { // pLS handling + if (dropHitsOTpL) { // true if need to drop OT hits + using Hit = SeedingHitSet::ConstRecHitPointer; + hitsForSeed.clear(); + hitsForSeed.reserve(std::ranges::size(pixelSeeds[iSeed].recHits())); + for (auto const& hit : pixelSeeds[iSeed].recHits()) { + if (hit.geographicalId().subdetId() > PixelSubdetector::PixelEndcap) + continue; + hitsForSeed.emplace_back(dynamic_cast(&hit)); + recHits.push_back(hit.clone()); + } + GlobalTrackingRegion region; + seedCreator_->init(region, iSetup, nullptr); + seeds.clear(); + seedCreator_->makeSeed(seeds, hitsForSeed); + if (seeds.empty()) + edm::LogInfo("LSTOutputConverter") << "failed to convert a pLS object to a seed" << i << iSeed; + seed = seeds[0]; + seedRef = edm::RefToBase(edm::Ref(outputTSRP, outputTS.size())); } + outputTS.emplace_back(seed); + if (produceSeeds_) // matches the logic for iEvent.emplace + outputpLSTS.emplace_back(seed); } if (!produceTrackCandidates_) From 56c4d8f669def60f1edd60440fc6cbe8d4899c67 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Thu, 16 Apr 2026 14:56:55 -0700 Subject: [PATCH 8/8] now do not removeOTRechits --- .../python/HLT_75e33/modules/hltInitialStepSeeds_cfi.py | 5 ++--- .../HLT_75e33/modules/hltInitialStepTrackCandidates_cfi.py | 2 +- .../modules/hltInitialStepTrajectorySeedsLST_cfi.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepSeeds_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepSeeds_cfi.py index f3d6f6d9b7472..f720d04af0fc4 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepSeeds_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepSeeds_cfi.py @@ -14,14 +14,13 @@ TTRHBuilder = cms.string('WithTrackAngle'), usePV = cms.bool(False), includeFourthHit = cms.bool(True), - removeOTRechits = cms.bool(True), + removeOTRechits = cms.bool(False), produceComplement = cms.bool(False) ) from Configuration.ProcessModifiers.hltPhase2LegacyTracking_cff import hltPhase2LegacyTracking hltPhase2LegacyTracking.toModify(hltInitialStepSeeds, - includeFourthHit = False, - removeOTRechits = False + includeFourthHit = False ) from Configuration.ProcessModifiers.phase2_hlt_vertexTrimming_cff import phase2_hlt_vertexTrimming diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrackCandidates_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrackCandidates_cfi.py index ddf9b1fd2d933..20875c25ec8a2 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrackCandidates_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrackCandidates_cfi.py @@ -64,7 +64,7 @@ lstPixelSeeds = cms.InputTag('hltInputLST'), includeT5s = cms.bool(True), includeNonpLSTSs = cms.bool(False), - dropOTHitsPurePLS = cms.bool(False), + dropOTHitsPurePLS = cms.bool(True), maxITHitsToDropOTHitsPurePLS = cms.int32(3), produceSeeds = cms.bool(False), produceTrackCandidates = cms.bool(True), diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrajectorySeedsLST_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrajectorySeedsLST_cfi.py index e311af604f68a..2021d10f0b706 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrajectorySeedsLST_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepTrajectorySeedsLST_cfi.py @@ -6,7 +6,7 @@ lstPixelSeeds = cms.InputTag('hltInputLST'), includeT5s = cms.bool(True), includeNonpLSTSs = cms.bool(True), - dropOTHitsPurePLS = cms.bool(False), + dropOTHitsPurePLS = cms.bool(True), maxITHitsToDropOTHitsPurePLS = cms.int32(3), produceSeeds = cms.bool(True), produceTrackCandidates = cms.bool(False),