-
Notifications
You must be signed in to change notification settings - Fork 622
[PWGCF] Martijn laarhoven patch 3 #14416
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
[PWGCF] Martijn laarhoven patch 3 #14416
Conversation
Adding the option to reject the inner of the outer part of the FT0 detectors
Adding option to reject part of the FT0 detectors
Adding the option to remap dead channels to their mirrored image. The standard is off. This fills the amplitude of 9 dead channels by their mirrored image
Adding the option to remap dead channels
|
O2 linter results: ❌ 3 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 optional functionality to remap 9 dead detector channels in the FT0A and FT0C detectors to their mirrored live channels. The feature is disabled by default and controlled by two new configuration flags.
Key changes:
- Added two configuration options to enable remapping of dead channels for FT0A and FT0C detectors
- Introduced mirroring constants enum to define the offset values for channel mapping
- Implemented logic to fill dead channel histograms with amplitude data from their corresponding live mirror channels
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| O2_DEFINE_CONFIGURABLE(cfgRejectFT0AOutside, bool, false, "Rejection of outer ring channels of the FT0A detector") | ||
| O2_DEFINE_CONFIGURABLE(cfgRejectFT0CInside, bool, false, "Rejection of inner ring channels of the FT0C detector") | ||
| O2_DEFINE_CONFIGURABLE(cfgRejectFT0COutside, bool, false, "Rejection of outer ring channels of the FT0C detector") | ||
| O2_DEFINE_CONFIGURABLE(cfgRemapFT0ADeadChannels, bool, false, "If true, remap FT0A channels 60-63 to amplitudes from 92-95 respectively") |
Copilot
AI
Jan 7, 2026
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 configuration description states "remap FT0A channels 60-63 to amplitudes from 92-95 respectively", but the implementation does the opposite. The code at lines 686-687 maps channels 92-95 to channels 60-63 (by subtracting 32). The description should be corrected to match the implementation: "remap FT0A channels 92-95 to amplitudes from 60-63 respectively" or the implementation should be adjusted to match the description.
| O2_DEFINE_CONFIGURABLE(cfgRemapFT0ADeadChannels, bool, false, "If true, remap FT0A channels 60-63 to amplitudes from 92-95 respectively") | |
| O2_DEFINE_CONFIGURABLE(cfgRemapFT0ADeadChannels, bool, false, "If true, remap FT0A channels 92-95 to amplitudes from 60-63 respectively") |
| } else if (id >= 144 && id <= 147) { | ||
| int dead_id = id + kFT0COuterMirror; | ||
| registry.fill(HIST("FT0Amp"), dead_id, ampl); | ||
| ampl = ampl / cstFT0RelGain[iCh]; |
Copilot
AI
Jan 7, 2026
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 variable 'ampl' is modified at line 673 by applying gain correction before filling the dead channel histogram. This causes the subsequent fills for the original channel at lines 679-681 to use the already-corrected amplitude instead of the raw amplitude. As a result, line 679 fills FT0Amp with a gain-corrected value when it should receive the raw amplitude, and line 680 applies gain correction again, leading to double correction in the FT0AmpCorrect histogram. Consider using a separate variable for the corrected amplitude when filling the dead channel histograms to avoid modifying the 'ampl' variable that's used later.
| if (id == 115) { | ||
| int dead_id = id + kFT0CInnerMirror; | ||
| registry.fill(HIST("FT0Amp"), dead_id, ampl); | ||
| ampl = ampl / cstFT0RelGain[iCh]; |
Copilot
AI
Jan 7, 2026
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 variable 'ampl' is modified at line 668 by applying gain correction before filling the dead channel histogram. This causes the subsequent fills for the original channel at lines 679-681 to use the already-corrected amplitude instead of the raw amplitude. As a result, line 679 fills FT0Amp with a gain-corrected value when it should receive the raw amplitude, and line 680 applies gain correction again, leading to double correction in the FT0AmpCorrect histogram. Consider using a separate variable for the corrected amplitude when filling the dead channel histograms to avoid modifying the 'ampl' variable that's used later.
| ampl = ampl / cstFT0RelGain[iCh]; | ||
| registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl); |
Copilot
AI
Jan 7, 2026
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 gain correction is applied inside the remapping block at line 689 before filling the FT0AmpCorrect histogram for the dead channel, but the same amplitude will be divided by cstFT0RelGain[iCh] again at line 696 for the original channel. This creates an inconsistency in how amplitudes are corrected. The gain correction at line 689 should be removed to maintain consistency with the rest of the function's logic where gain correction is applied once after all channel processing.
| O2_DEFINE_CONFIGURABLE(cfgRejectFT0CInside, bool, false, "Rejection of inner ring channels of the FT0C detector") | ||
| O2_DEFINE_CONFIGURABLE(cfgRejectFT0COutside, bool, false, "Rejection of outer ring channels of the FT0C detector") | ||
| O2_DEFINE_CONFIGURABLE(cfgRemapFT0ADeadChannels, bool, false, "If true, remap FT0A channels 60-63 to amplitudes from 92-95 respectively") | ||
| O2_DEFINE_CONFIGURABLE(cfgRemapFT0CDeadChannels, bool, false, "If true, remap FT0C channels 177->145, 176->144, 178->146, 179->147, 139->115") |
Copilot
AI
Jan 7, 2026
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 configuration description states "remap FT0C channels 177->145, 176->144, 178->146, 179->147, 139->115" but the implementation does the opposite mapping. The code at lines 670-671 maps channels 144-147 to 176-179 (adding 32), and line 666 maps channel 115 to 139 (adding 24). This is the reverse of what the description indicates. Either the description should be corrected to reflect the actual mapping direction (e.g., "115->139, 144->176, 145->177, 146->178, 147->179"), or the implementation needs to be adjusted to match the description.
| O2_DEFINE_CONFIGURABLE(cfgRemapFT0CDeadChannels, bool, false, "If true, remap FT0C channels 177->145, 176->144, 178->146, 179->147, 139->115") | |
| O2_DEFINE_CONFIGURABLE(cfgRemapFT0CDeadChannels, bool, false, "If true, remap FT0C channels 115->139, 144->176, 145->177, 146->178, 147->179") |
Adding the option to remap dead channels to their mirrored images. The standard is off. This fills the amplitude of 9 dead channels by their mirrored image