Fix: DetermineTowerBackground - Add Psi2 Safety Check#4136
Fix: DetermineTowerBackground - Add Psi2 Safety Check#4136pinkenburg merged 1 commit intosPHENIX-Collaboration:masterfrom
Conversation
- Ensure Psi2 from EventplaneinfoMap is finite and not NaN which can corrupt downstream calculations.
📝 WalkthroughWalkthroughAdds a safety check to ensure Changes
✨ Finishing touches
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 3fa48da17176b340a61716e6a0ab2aa69ea4894d:
Build & test reportReport for commit 9ec298fb7d3b94a243e8056445b7879d11f58659:
Build & test reportReport for commit 18c5a2c56900618bcf9798bb091f064b628994a4:
Build & test reportReport for commit f704495167ff5a179e3b400f49850351b7084714:
Automatically generated by sPHENIX Jenkins continuous integration Automatically generated by sPHENIX Jenkins continuous integration Automatically generated by sPHENIX Jenkins continuous integration Automatically generated by sPHENIX Jenkins continuous integration |
There was a problem hiding this comment.
Pull request overview
This PR adds a safety check to prevent non-finite (NaN or Inf) values in the Psi2 event plane angle when extracted from the EventplaneinfoMap during sEPD event plane reconstruction. The check prevents corrupted Psi2 values from propagating to downstream flow calculations.
Changes:
- Added validation check for non-finite Psi2 values after extraction from EventplaneinfoMap
- Sets Psi2 to 0 and marks flow extraction as failed when non-finite values are detected
- Adds warning message when non-finite values are encountered
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f810048
into
sPHENIX-Collaboration:master




Types of changes
What kind of change does this PR introduce? (Bug fix, feature, ...)
Bug Fix: Ensure Psi2 from EventplaneinfoMap is finite and not NaN which can corrupt downstream calculations.
TODOs (if applicable)
Links to other PRs in macros and calibration repositories (if applicable)
Pull Request Summary: DetermineTowerBackground - Add Psi2 Safety Check
Motivation & Context
The sEPD (sPHENIX Event Plane Detector) is used to extract the event plane angle (Psi2) for flow-corrected analyses in the tower background determination module. In rare cases, the EventplaneinfoMap data retrieval can return non-finite values (NaN or Inf), which would corrupt downstream calculations of event plane and anisotropic flow coefficients. This fix adds a defensive safety check to catch and handle such corrupted values.
Key Changes
_Psi2immediately after extraction from sEPD data (line ~615)std::isfinite(_Psi2)to detect both NaN and Inf values_is_flow_failure = true)_Psi2to 0 to prevent propagation of corrupt valuesPotential Risk Areas
_is_flow_failurewill have_Psi2 = 0, which may merge with legitimate zero-flow events; monitoring rates useful for detecting persistent sEPD issuesFuture Improvements
_is_flow_failureand detector data quality flagsNote: This analysis relies on AI-generated interpretation of code structure; careful review of EventplaneinfoMap behavior and sEPD data sources recommended to ensure check addresses root causes rather than symptoms.