Skip to content

Map hits without a wiggle in TFCSHitCellMappingWiggle without wiggle bins instead of reading bins that do not exist - #214

Merged
jbeirer merged 2 commits into
mainfrom
wiggle-without-bins
Nov 24, 2026
Merged

jbeirer merged 2 commits into
mainfrom
wiggle-without-bins

Conversation

@jbeirer

@jbeirer jbeirer commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

TFCSHitCellMappingWiggle::simulate_hit starts with eta < get_bin_low_edge(0) || eta >= get_bin_up_edge(get_number_of_bins() - 1). Without wiggle bins this reads m_bin_low_edge[0] of an empty vector, and get_number_of_bins() - 1 wraps around: undefined behaviour. A new mapping has one bin (no function over [0, init_eta_max]), so there are no bins only after the public clear(), or initialize() with empty inputs. Nothing calls either of them that way today (the library only calls clear() in the destructor and in initialize(), which then fills the bins), so this is a guard for that public API rather than a fix of a current failure. The bug is inherited: Athena upstream/main (ISF_FastCaloSimEvent) has the same code. Nothing to port from Athena.

Change

  • Without wiggle bins the hit is mapped without a wiggle, as outside the bins.
  • clear() is exported (FASTCALOSIM_EXPORT): the code creating parametrizations calls it from outside the library, and so does the new test.
  • New WiggleTests: a new mapping has one bin. After clear() it maps a hit to its cell with its energy and its phi unchanged.

Simulation with wiggle bins is unchanged (the new condition is false whenever there is a bin).

Checks

Run on main (73c5cc7) with #205 to #215 together (they apply without conflicts), against main:

  • GCC 15 (LCG_110, developer build): 0 warnings; ctest 139/139 passed (main: 128/128), incl. the unchanged AtlasTransportTests and AtlasSimTests references
  • AtlasBenchmark dump (BENCH_N=50): byte-identical to main
  • SliceCheck on the MC23 file TFCSparam_dev_Hybrid_Ha_v5_all_baryons_0_500.root (BENCH_N=20): byte-identical to main
  • clang-format 20.1.8
  • GCC 16 and Clang 22 with the CI flags: 0 warnings
  • Alma 10 ci-linux (clang-tidy 21, cppcheck): 0 warnings; its ctest 139/139 passed
  • Production files: all 1884 TFCSHitCellMappingWiggle in TFCSparam_AF3_MC23_Sep23.root have at least two bins, so production simulation is unchanged

…bins instead of reading bins that do not exist
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1397f2e3-e42f-4151-9498-71cde600a50c
Commits

Reviewing files that changed from the base of the PR and between 73c5cc7 and a76088f.

Files selected for processing: 3

  • include/FastCaloSim/Core/TFCSHitCellMappingWiggle.h
  • source/Core/TFCSHitCellMappingWiggle.cxx
  • test/source/WiggleTests.cxx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the tests Issues affecting the CI tests label Nov 24, 2026
@jbeirer
jbeirer merged commit 2e34965 into main Nov 24, 2026
16 checks passed
@jbeirer
jbeirer deleted the wiggle-without-bins branch November 24, 2026 10:35
@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
test/source/WiggleTests.cxx 91.30% 2 Missing ⚠️
Files with missing lines Coverage Δ
...nclude/FastCaloSim/Core/TFCSHitCellMappingWiggle.h 88.88% <ø> (ø)
source/Core/TFCSHitCellMappingWiggle.cxx 25.96% <100.00%> (+7.69%) ⬆️
test/source/WiggleTests.cxx 91.30% <91.30%> (ø)

... and 2 files with indirect coverage changes

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

Labels

tests Issues affecting the CI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant