Add a unit test for isFromRadDecay and fix its ancestry walk - #15675
Open
sawenzel wants to merge 1 commit into
Open
Add a unit test for isFromRadDecay and fix its ancestry walk#15675sawenzel wants to merge 1 commit into
sawenzel wants to merge 1 commit into
Conversation
The query added in AliceO2Group#15470 gave two wrong answers. Primaries returned true, because mTrackIDtoParticlesEntry is meaningless for them - primaries never enter mParticles - so the lookup landed on an unrelated secondary. Descendants of a radioactive decay returned false, because the `imo > 0` guard skipped buffer entry 0, which after FinishPrimary() is the first secondary of the current primary. Walking trackIDs and stopping at mNumberOfPrimaryParticles removes both, and the method becomes const, binds a reference instead of copying the MCTrack, and drops the two includes MCTrack.h already provides. The new test case fails on all four affected checks without this change.
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.
This PR adds a unit test and fixes two bugs in the
isFromRadDecayquery introduced in #15470.testStack.cxx— builds a small stack with a radioactive decay as the first secondary of its primary. Four of its checks fail on dev today.mTrackIDtoParticlesEntryis meaningless for a primary, since primaries never entermParticles, so the lookup landed on an unrelated secondary.while (imo > 0)skipped buffer entry 0, which afterFinishPrimary()is the first secondary of the current primary.mNumberOfPrimaryParticles— the same primary testselectTracks()uses, so the mapping is never consulted for a primary.