DecayFinder search/match fix#4231
Conversation
📝 WalkthroughWalkthroughModified the decay-finding logic in Changes
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. Comment |
Build & test reportReport for commit de78126e283bf6824684048c6259979c4e221da4:
Automatically generated by sPHENIX Jenkins continuous integration |
|
Marking this PR as ready to merge. The neutral |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
offline/packages/decayfinder/DecayFinder.cc (1)
380-392:⚠️ Potential issue | 🟠 MajorReset the per-candidate state before each mother search.
aTrackFailedPT,aTrackFailedETA,aMotherHasPhoton, andaMotherHasPi0are initialized once outside the loops and then reused for every matched mother. Once one candidate flips any of them, later candidates in the same event inherit that state and can be miscounted or marked unreconstructable incorrectly.Suggested fix
if (this_pid == mother_id_to_match) { + aTrackFailedPT = false; + aTrackFailedETA = false; + aMotherHasPhoton = false; + aMotherHasPi0 = false; + if (Verbosity() >= VERBOSITY_MAX) { std::cout << "parent->pdg_id(): " << g4particle->get_pid() << std::endl; } @@ if (this_pid == mother_id_to_match) { + aTrackFailedPT = false; + aTrackFailedETA = false; + aMotherHasPhoton = false; + aMotherHasPi0 = false; + if (Verbosity() >= VERBOSITY_MAX) { std::cout << "parent->pdg_id(): " << (*p)->pdg_id() << std::endl; }Also applies to: 461-480
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4dfe3780-bffd-47bc-9b6c-6046413cb0ac
📒 Files selected for processing (1)
offline/packages/decayfinder/DecayFinder.cc



Types of changes
What kind of change does this PR introduce? (Bug fix, feature, ...)
This PR fixes a
DecayFindermother-matching bug for charge-conjugate decay descriptors with a negatively charged mother. As an example, for a negatively charged Xi decay[Xi- -> {Lambda0 -> proton^+ pi^-} pi^-]cc, the parser assigns a signedm_mother_ID-3312, while the mother-search loop compares it againstabs((*p)->pdg_id())in charge-conjugate mode, making the match fail even when the decay is presentA simple fix, which always compares the unsigned PID for the charge-conjugate mode, is implemented
@cdean-github I am marking this as a draft PR for now, both for review and because it appears to fix the charged$\Xi$ decay. I have not yet been able to get the neutral $\Xi$ decay to work. Once I am more certain that the current issue with the neutral $\Xi$ decay is not related to DecayFinder, I will mark this as ready to merge.)
TODOs (if applicable)
Links to other PRs in macros and calibration repositories (if applicable)