Skip to content

Commit 15e4fe7

Browse files
authored
Merge pull request #46844 from SegmentLinking/CMSSW_14_2_0_pre4_fixUninit_shiftedRt2
Fix to LST code due to uninitialization of the shiftedRt2 variable
2 parents e96d4be + ab567f1 commit 15e4fe7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

RecoTracker/LSTCore/src/alpaka/MiniDoublet.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
420420

421421
// Cut #2: dphi difference
422422
// Ref to original code: https://github.com/slava77/cms-tkph2-ntuple/blob/184d2325147e6930030d3d1f780136bc2dd29ce6/doubletAnalysis.C#L3085
423-
float xn = 0.f, yn = 0.f; // , zn = 0;
424-
float shiftedRt2;
423+
float xn = 0.f, yn = 0.f;
424+
float shiftedRt2 = 0.f;
425425
if (modules.sides()[lowerModuleIndex] != Center) // If barrel and not center it is tilted
426426
{
427427
// Shift the hits and calculate new xn, yn position
@@ -462,9 +462,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
462462
noShiftedDphi = deltaPhi(acc, xLower, yLower, xUpper, yUpper);
463463
}
464464
} else {
465-
shiftedX = 0;
466-
shiftedY = 0;
467-
shiftedZ = 0;
465+
shiftedX = 0.f;
466+
shiftedY = 0.f;
467+
shiftedZ = 0.f;
468+
shiftedRt2 = 0.f;
468469
dPhi = deltaPhi(acc, xLower, yLower, xUpper, yUpper);
469470
noShiftedDphi = dPhi;
470471
}
@@ -476,7 +477,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
476477
// Ref to original code: https://github.com/slava77/cms-tkph2-ntuple/blob/184d2325147e6930030d3d1f780136bc2dd29ce6/doubletAnalysis.C#L3076
477478
if (modules.sides()[lowerModuleIndex] != Center) {
478479
// When it is tilted, use the new shifted positions
479-
// TODO: This is somewhat of an mystery.... somewhat confused why this is the case
480480
if (modules.moduleLayerType()[lowerModuleIndex] != Pixel) {
481481
// dPhi Change should be calculated so that the upper hit has higher rt.
482482
// In principle, this kind of check rt_lower < rt_upper should not be necessary because the hit shifting should have taken care of this.

0 commit comments

Comments
 (0)