Skip to content

Commit

Permalink
Fix uninitialization of shiftedRt2
Browse files Browse the repository at this point in the history
  • Loading branch information
VourMa committed Nov 29, 2024
1 parent 48600da commit ab567f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions RecoTracker/LSTCore/src/alpaka/MiniDoublet.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {

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

0 comments on commit ab567f1

Please sign in to comment.