Skip to content

Conversation

@tomalin
Copy link
Collaborator

@tomalin tomalin commented Dec 22, 2025

PR description:

@sarafiorendi reported that when running HYBRID_NEWKF, the code HitPatternHelper.cc wrote outside array boundaries. On investigating, I found that although HitPatternHelper is full of bugs, the real cause of this was:

  1. This line incorrectly reversed the order of the hit pattern bits

    std::reverse(s.begin(), s.end());
    . The lowest (right-hand bit) should represent the inner tracker layer.

  2. With (1) fixed, it was also necessary to fix

    s.resize(TTTrack_TrackWord::TrackBitWidths::kHitPatternSize);
    , so that when truncating the hit pattern from 8 to 7 bits, the dropped bit corresponded to the outermost tracker layer.

ACTION: @tschuh should note that I believe the same bug exists in TrackerTFP, but this PR does not address that.

I've added these lines (disabled by default) https://github.com/cms-L1TK/cmssw/blob/ianFixHitPattern/L1Trigger/TrackFindingTracklet/test/L1TrackNtupleMaker.cc#L1213 to check the accuracy of the hit pattern. They confirmed the bug fix above, and also identified one other bug solved by this PR:

  1. The radial boundary between PS & 2S modules is incorrectly calculated by
    const double rLimit = setup_->disk2SR(diskId, 0) - setup_->pitchCol2S();
    .

@tomalin tomalin requested a review from tschuh December 22, 2025 13:57
@tomalin tomalin marked this pull request as ready for review December 22, 2025 13:57
@tschuh
Copy link

tschuh commented Jan 3, 2026

I pushed my changes instead of requesting them, please have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants