Repository navigation
End the fluctuating hit chain after 1000 times the expected number of hits, as the hit chain does - #208
Merged
Conversation
… hits, as the hit chain does
|
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 31 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. |
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
TFCSLateralShapeParametrizationFluctChain::simulatesimulates hits until the relative fluctuation of the deposited energy,error2 = sum(E_hit^2) / (sum E_hit)^2, is belowsigma2. A hit that the cell mapping rejects keeps zero energy and is still a success (TFCSHitCellMappingsetsE = 0beyond its boundary cut). If every hit is rejected, for example for a shower centre outside the cells of the layer,sum E_hitstays 0,error2is never updated and the loop never ends: the simulation of the event hangs.TFCSLateralShapeParametrizationHitChainaborts its loop after 1000 times the expected number of hits; the fluctuating chain has no such limit. The bug is inherited: the loop in Athenaupstream/main(ISF_FastCaloSimEvent) has no limit either. Nothing to port from Athena.Change
|E_layer / E_avghit|, at least 1) and at least 1000 hits, as inTFCSLateralShapeParametrizationHitChain, with a warning giving the deposited and the expected energy. The limit is computed indouble, so an average hit energy near 0 cannot overflow it.TFCSLateralShapeParametrization::set_calosampleis exported (FASTCALOSIM_EXPORT): the code creating parametrizations calls it from outside the library, and so does the new test.FluctChainTests: a fluctuating chain withTFCSLateralShapeParametrizationHitNumberFromEand aTFCSHitCellMappingon a geometry whose only cell is far from every hit ends withFCSSuccessand no cell energy (onmainit does not end).A chain that reaches its precision ends as before, since it needs about the expected number of hits.
Checks
Run on
main(73c5cc7) with #205 to #213 together, 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 tomain, max RSS 4.76 GB on bothci-linux(clang-tidy 21, cppcheck): 0 warnings; its ctest 138/138 passedTFCSparam_AF3_MC23_Sep23.rootcontains noTFCSLateralShapeParametrizationFluctChain(all parametrizations walked), so production simulation is unchanged