No flow afterburner#4113
Conversation
📝 WalkthroughWalkthroughThese changes modify flow psi value handling in the sPHENIX event reconstruction pipeline. The generator now returns NaN for missing psi_n entries instead of 0.0, and the reconstruction framework adds a guard condition to prevent processing when flow data maps are empty. Changes
✨ Finishing touches
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)**/*.{cc,cpp,cxx,c}⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (2)📚 Learning: 2026-01-10T07:54:57.021ZApplied to files:
📚 Learning: 2026-01-08T18:39:48.023ZApplied to files:
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Comment |
|
merge now to make a new ana build for the OO sims |
64138d4
into
sPHENIX-Collaboration:master
Build & test reportReport for commit 3d192990eaa8a96baa4b7b9e604c0287b7dd666d:
Automatically generated by sPHENIX Jenkins continuous integration |



Types of changes
What kind of change does this PR introduce? (Bug fix, feature, ...)
For OO the flow afterburner is not run, so there are no reaction plane angles. The HeadReco still tried to read those which generated an error at every event.
Also - the PHHepMCGenEventv1 will not return NAN if the flow angle is not set (rather than 0 which is a valid value
TODOs (if applicable)
Links to other PRs in macros and calibration repositories (if applicable)
PR Summary: Flow Afterburner Guard in HeadReco
Motivation / Context
This PR fixes a bug where HeadReco (event header reconstruction module) attempted to read reaction plane (flow) angles unconditionally from HepMC generator events, even when the flow afterburner was not executed in the reconstruction chain. This is a common scenario in "out-of-the-box" (OO) running where optional modules like the flow afterburner may be disabled. The unguarded reads resulted in warnings/errors on every event when flow data was unavailable.
Key Changes
HeadReco.cc: Added a guard condition
if (!genevt->get_flow_psi_map().empty())around the loop that sets FlowPsiN(n) values for n=1–6. The loop now only executes if the flow psi map contains data, preventing reads of nonexistent flow angles.PHHepMCGenEventv1.cc: Modified
get_flow_psi()to returnNaN(std::numeric_limits<float>::quiet_NaN()) instead of0.0when a requested flow angle does not exist. This is semantically important because0.0is a valid reaction plane angle and would be ambiguous with "not set."Potential Risk Areas
0.0toNaNcould affect downstream code that usesget_flow_psi()values. Code should explicitly handle NaN cases; numerical comparisons with NaN will always be false, which could cause subtle logic errors if not properly handled.Notes
AI-generated summaries should be verified against actual code changes. The modifications are localized and straightforward, but any code consuming FlowPsiN or flow_psi values should be reviewed to ensure proper handling of the new behavior (skipped assignment and NaN returns).
Possible Future Improvements