Skip to content

Clear the extrapolation state at the start of an extrapolation - #210

Merged
jbeirer merged 1 commit into
mainfrom
extrapolation-clear-state
Nov 24, 2026
Merged

jbeirer merged 1 commit into
mainfrom
extrapolation-clear-state

Conversation

@jbeirer

@jbeirer jbeirer commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

FastCaloSimCaloExtrapolation::extrapolate writes into the TFCSExtrapolationState it is given but never clears it. A layer or sub-position that the particle does not reach is skipped (continue), and a particle that does not reach the calorimeter returns before the layers. When a state is reused for another particle, those layers keep the positions and the OK flags of the previous particle. The current callers (Athena FastCaloSimV2Tool and FastCaloSimModel, FastSimModel of the test app) create a new state for each particle, so they are not affected, but nothing in the interface asks for that.

Change

  • extrapolate calls result.clear() first. The explicit reset of the ID-calo boundary values for a failed boundary extrapolation is removed, since clear() sets the same values.
  • The documentation of extrapolate says that it replaces the previous content.
  • New test BasicExtrapolTests.ExtrapolationReplacesPreviousResult: a particle at eta 0.3 reaches EMB2. A second particle along the beam pipe (eta 8, beyond the acceptance) in the same state leaves EMB2 not OK (on main it keeps the first particle's positions).

Results for a new state are unchanged.

Checks

Run on main (73c5cc7) with #205 to #213 together, against main:

  • GCC 15 (LCG_110, developer build): 0 warnings; ctest 138/138 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, max RSS 4.76 GB on both
  • 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 138/138 passed

@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 31 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: 5db9cdb7-733d-4538-8b36-980aae9c6276
Commits

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

Files selected for processing: 3

  • include/FastCaloSim/Extrapolation/FastCaloSimCaloExtrapolation.h
  • source/Extrapolation/FastCaloSimCaloExtrapolation.cxx
  • test/source/BasicExtrapolTests.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
@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
...loSim/Extrapolation/FastCaloSimCaloExtrapolation.h 100.00% <ø> (ø)
...rce/Extrapolation/FastCaloSimCaloExtrapolation.cxx 95.26% <100.00%> (+13.02%) ⬆️
test/source/BasicExtrapolTests.cxx 98.73% <100.00%> (+0.22%) ⬆️

@jbeirer
jbeirer merged commit 5304855 into main Nov 24, 2026
19 checks passed
@jbeirer
jbeirer deleted the extrapolation-clear-state branch November 24, 2026 10:35
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