-
Notifications
You must be signed in to change notification settings - Fork 613
[PWGCF] Added option to reject the inside or the outside of the detector ring of FT0 #14190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added option to reject the inside or the outside of the detector ring of FT0
|
O2 linter results: ❌ 2 errors, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds configuration options to selectively reject signals from inside or outside rings of the FT0 detector in the long-range dihadron correlation analysis. The implementation introduces two boolean flags that control whether to zero out amplitudes from specific channel ID ranges.
Key changes:
- Added two new configurables:
cfgRejectOutsideDetectorsandcfgRejectInsideDetectorsto control ring rejection - Implemented channel rejection logic in the
getChannel()function for both FT0A and FT0C detector sections - Rejection is performed by setting amplitude to 0 for channels in specific ID ranges
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if ((cfgRejectInsideDetectors && ((id >= 31 && id <= 96) || (id >= 143 && id <= 208))) || (cfgRejectOutsideDetectors && ((id >= 0 && id <= 30) || (id >= 97 && id <= 142)))) | ||
| ampl = 0.; |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no validation to prevent both cfgRejectInsideDetectors and cfgRejectOutsideDetectors from being enabled simultaneously. If both are true, this would reject all channels, which may not be the intended behavior. Consider adding mutual exclusivity validation or documenting the expected behavior when both are enabled.
| O2_DEFINE_CONFIGURABLE(cfgUseEventWeights, bool, false, "Use event weights for mixed event") | ||
| O2_DEFINE_CONFIGURABLE(cfgDrawEtaPhiDis, bool, false, "draw eta-phi distribution for detectors in used") | ||
| O2_DEFINE_CONFIGURABLE(cfgRejectOutsideDetectors, bool, false, "Rejection of outside ring events of the FT0 detector") | ||
| O2_DEFINE_CONFIGURABLE(cfgRejectInsideDetectors, bool, false, "Rejection of inside ring events of the FT0 detector") |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description says "Rejection of inside ring events of the FT0 detector" but the implementation rejects channels (by setting amplitude to 0), not events. The description should clarify that this rejects signals from specific channels/rings rather than entire events.
| O2_DEFINE_CONFIGURABLE(cfgRejectInsideDetectors, bool, false, "Rejection of inside ring events of the FT0 detector") | |
| O2_DEFINE_CONFIGURABLE(cfgRejectInsideDetectors, bool, false, "Rejection of signals from inside ring channels of the FT0 detector") |
| O2_DEFINE_CONFIGURABLE(cfgRejectOutsideDetectors, bool, false, "Rejection of outside ring events of the FT0 detector") | ||
| O2_DEFINE_CONFIGURABLE(cfgRejectInsideDetectors, bool, false, "Rejection of inside ring events of the FT0 detector") |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configurable name "cfgRejectOutsideDetectors" is ambiguous and could be misunderstood as rejecting multiple detectors. Consider renaming to "cfgRejectFT0OutsideRing" to be more specific and consistent with the description mentioning "FT0 detector".
| O2_DEFINE_CONFIGURABLE(cfgRejectOutsideDetectors, bool, false, "Rejection of outside ring events of the FT0 detector") | |
| O2_DEFINE_CONFIGURABLE(cfgRejectInsideDetectors, bool, false, "Rejection of inside ring events of the FT0 detector") | |
| O2_DEFINE_CONFIGURABLE(cfgRejectFT0OutsideRing, bool, false, "Reject events in the outside ring of the FT0 detector") | |
| O2_DEFINE_CONFIGURABLE(cfgRejectFT0InsideRing, bool, false, "Reject events in the inside ring of the FT0 detector") |
| id = id + Ft0IndexA; | ||
| ampl = ft0.amplitudeC()[iCh]; | ||
| if ((cfgRejectInsideDetectors && ((id >= 31 && id <= 96) || (id >= 143 && id <= 208))) || (cfgRejectOutsideDetectors && ((id >= 0 && id <= 30) || (id >= 97 && id <= 142)))) | ||
| ampl = 0.; |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rejection logic appears to have a bug for FT0C channels. After adding Ft0IndexA (96) to the channel ID on line 642, the id range becomes 96-207. However, the rejection ranges include (0-30) which would never match FT0C channels, and (31-96) which would only match id=96. This suggests the rejection logic was designed for FT0A channel IDs (0-95) but is being incorrectly applied to FT0C after the offset is added. The rejection logic should be applied before adding the offset, or the ranges should be adjusted to account for the offset.
| id = id + Ft0IndexA; | |
| ampl = ft0.amplitudeC()[iCh]; | |
| if ((cfgRejectInsideDetectors && ((id >= 31 && id <= 96) || (id >= 143 && id <= 208))) || (cfgRejectOutsideDetectors && ((id >= 0 && id <= 30) || (id >= 97 && id <= 142)))) | |
| ampl = 0.; | |
| ampl = ft0.amplitudeC()[iCh]; | |
| // Apply rejection logic to raw FT0C channel ID (before offset) | |
| if ((cfgRejectInsideDetectors && ((id >= 31 && id <= 96) || (id >= 143 && id <= 208))) || (cfgRejectOutsideDetectors && ((id >= 0 && id <= 30) || (id >= 97 && id <= 142)))) | |
| ampl = 0.; | |
| id = id + Ft0IndexA; |
| if ((cfgRejectInsideDetectors && ((id >= 31 && id <= 96) || (id >= 143 && id <= 208))) || (cfgRejectOutsideDetectors && ((id >= 0 && id <= 30) || (id >= 97 && id <= 142)))) | ||
| ampl = 0.; |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rejection logic is duplicated in both FT0C (lines 644-645) and FT0A (lines 652-653) sections. The identical conditional expression should be extracted into a helper function or applied before the if-else branch to improve code maintainability and reduce duplication.
| if ((cfgRejectInsideDetectors && ((id >= 31 && id <= 96) || (id >= 143 && id <= 208))) || (cfgRejectOutsideDetectors && ((id >= 0 && id <= 30) || (id >= 97 && id <= 142)))) | ||
| ampl = 0.; |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The complex conditional expression with multiple OR and AND operators is difficult to read and verify. Consider breaking this into intermediate boolean variables with descriptive names (e.g., isInsideRing, isOutsideRing) or extracting it into a separate helper function to improve code clarity.
Added option to reject the inside or the outside of the detector ring of FT0