Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • R Rec
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 281
    • Issues 281
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Jira
    • Jira
  • Merge requests 48
    • Merge requests 48
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • LHCbLHCb
  • Rec
  • Merge requests
  • !2432

fix bug in SelectiveBremMatchAlg

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Maarten Van Veghel requested to merge mveghel-selbremmatchfix into master May 07, 2021
  • Overview 39
  • Commits 20
  • Pipelines 14
  • Changes 4

This solves the non-deterministic, rare bug reported in Rec#197 -- closes #197 (closed)

The bug relates to an interator-based for-loop over vector while adding stuff to the vector in the loop in SelectiveMatchUtils.h:

Old (buggy):

          for ( const auto& cellid : cellids ) {
            const auto& neighbors = calo.neighborCells( cellid );
            cellids.insert( cellids.end(), neighbors.begin(), neighbors.end() );
          }

New:

          for ( auto i = 0; i < nCells; ++i ) {
            const auto& neighbors = calo.neighborCells( cellids.at( i ) );
            cellids.insert( cellids.end(), neighbors.begin(), neighbors.end() );
          }

On top of the bug fix

It puts further safety nets to ensure a maximum of calo cells is checked in selective search for brem and the reserved memory for vectors is updated accordingly such that reserved memory is always sufficient. The default maxima are set at 8 for maximum number of cells checked in scan from first to last state. Typically, search windows wider than 4 cells (smallest cize) are only relevant for tracks with < 3 GeV/c momentum.

In addition, applies (style) changes from Rec!2423 to other selective match algorithms as well.

Edited Jun 10, 2021 by Rosen Matev
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: mveghel-selbremmatchfix