Repository navigation
Map hits without a wiggle in TFCSHitCellMappingWiggle without wiggle bins instead of reading bins that do not exist - #214
Merged
Merged
Conversation
…bins instead of reading bins that do not exist
|
Warning Review limit reachedYou'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. View limit details
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. |
…e creating parametrizations
Codecov Report❌ Patch coverage is
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TFCSHitCellMappingWiggle::simulate_hitstarts witheta < get_bin_low_edge(0) || eta >= get_bin_up_edge(get_number_of_bins() - 1). Without wiggle bins this readsm_bin_low_edge[0]of an empty vector, andget_number_of_bins() - 1wraps around: undefined behaviour. A new mapping has one bin (no function over[0, init_eta_max]), so there are no bins only after the publicclear(), orinitialize()with empty inputs. Nothing calls either of them that way today (the library only callsclear()in the destructor and ininitialize(), 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: Athenaupstream/main(ISF_FastCaloSimEvent) has the same code. Nothing to port from Athena.Change
clear()is exported (FASTCALOSIM_EXPORT): the code creating parametrizations calls it from outside the library, and so does the new test.WiggleTests: a new mapping has one bin. Afterclear()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), againstmain:main: 128/128), incl. the unchangedAtlasTransportTestsandAtlasSimTestsreferencesAtlasBenchmarkdump (BENCH_N=50): byte-identical tomainSliceCheckon the MC23 fileTFCSparam_dev_Hybrid_Ha_v5_all_baryons_0_500.root(BENCH_N=20): byte-identical tomainci-linux(clang-tidy 21, cppcheck): 0 warnings; its ctest 139/139 passedTFCSHitCellMappingWiggleinTFCSparam_AF3_MC23_Sep23.roothave at least two bins, so production simulation is unchanged