-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -107,6 +107,8 @@ | |||||||||||||||||||
| O2_DEFINE_CONFIGURABLE(cfgLocalEfficiency, bool, false, "Use local efficiency object") | ||||||||||||||||||||
| 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") | ||||||||||||||||||||
|
Comment on lines
+110
to
+111
|
||||||||||||||||||||
| 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") |
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.
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; |
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.
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.
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.