Skip to content

Conversation

@MartijnLaarhoven
Copy link
Contributor

Preserve original amplitude values when filling dead channel histograms
Properly declare mirroredAmpl variables

MartijnLaarhoven and others added 3 commits January 14, 2026 23:13
- Use channel ID instead of array index for gain correction
- Fixes mismatched amplitude corrections for remapped dead channels
- Use channel ID instead of array index for FT0 gain correction
- Preserve original amplitude values for dead channel mapping
- Resolve merge conflict markers
Preserve original amplitude values when filling dead channel histograms
Properly declare mirroredAmpl variables
Copilot AI review requested due to automatic review settings January 15, 2026 09:27
@github-actions github-actions bot added the pwgcf label Jan 15, 2026
@github-actions github-actions bot changed the title fix-ft0-gain-indexing-v3 [PWGCF] fix-ft0-gain-indexing-v3 Jan 15, 2026
@github-actions
Copy link

O2 linter results: ❌ 0 errors, ⚠️ 3 warnings, 🔕 0 disabled

Copy link

Copilot AI left a 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 pull request fixes a bug in the FT0 (Fast Interaction Trigger) channel amplitude handling for dead channel remapping in dihadron correlation analysis. The bug caused incorrect amplitude values to be recorded in histograms due to premature modification of the amplitude variable.

Changes:

  • Fixed amplitude variable corruption when filling dead channel histograms by introducing separate variables (mirroredAmpl and mirroredAmplCorrected) to preserve original amplitude values
  • Added early filtering of rejected FT0 channels in the correlation loop to avoid unnecessary processing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +757 to +763
if (corType == kFT0C) {
if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax)))
continue;
} else if (corType == kFT0A) {
if ((cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax)))
continue;
}
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This channel rejection logic duplicates the rejection already performed in getChannel (which sets ampl to 0). This creates maintainability concerns:

  1. The rejection conditions must be kept in sync between getChannel and this code
  2. The behavior is now inconsistent with fillCorrelationsFT0AFT0C (around line 810-833), which still processes channels where ampl=0

Consider either: (a) refactoring getChannel to return a boolean indicating whether to skip the channel, or (b) moving all rejection logic out of getChannel into the calling code and applying it consistently in both fillCorrelationsTPCFT0 and fillCorrelationsFT0AFT0C.

Suggested change
if (corType == kFT0C) {
if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax)))
continue;
} else if (corType == kFT0A) {
if ((cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax)))
continue;
}

Copilot uses AI. Check for mistakes.
@victor-gonzalez victor-gonzalez merged commit 40936fa into AliceO2Group:master Jan 15, 2026
17 of 19 checks passed
@victor-gonzalez
Copy link
Collaborator

Please, don't keep closing PRs
The same PR is automatically updated with pushes on your fork
This avoid the losing of PR comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants