Skip to content

Conversation

@MartijnLaarhoven
Copy link
Contributor

  • 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 gain correction
- Fixes mismatched amplitude corrections for remapped dead channels
@github-actions
Copy link

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

@github-actions github-actions bot changed the title Fix FT0 gain correction indexing in longRangeDihadronCor [PWGCF] Fix FT0 gain correction indexing in longRangeDihadronCor Jan 14, 2026
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 PR attempts to fix FT0 gain correction indexing by using channel IDs instead of array indices, which should correct mismatched amplitude corrections for remapped dead channels. However, the PR contains critical unresolved merge conflicts that prevent it from compiling.

Changes:

  • Adds duplicate code blocks with merge conflict markers visible in the diff
  • Introduces temporary variables for mirrored amplitudes in the conflicting sections
  • Adds channel rejection checks in fillCorrelationsTPCFT0 function

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

Comment on lines +708 to +717
<<<<<<< Updated upstream
registry.fill(HIST("FT0Amp"), dead_id, ampl);
ampl = ampl / cstFT0RelGain[iCh];
registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
=======
float mirroredAmpl = ampl;
float mirroredAmplCorrected = mirroredAmpl / cstFT0RelGain[iCh];
registry.fill(HIST("FT0Amp"), dead_id, mirroredAmpl);
registry.fill(HIST("FT0AmpCorrect"), dead_id, mirroredAmplCorrected);
>>>>>>> Stashed changes
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Unresolved merge conflict in FT0A dead channel remapping code. The file contains Git conflict markers and duplicate code blocks that will prevent compilation. Resolve the merge conflict by choosing the appropriate version or merging the changes properly.

Copilot uses AI. Check for mistakes.
int dead_id = id + kFT0CInnerMirror;
<<<<<<< Updated upstream
registry.fill(HIST("FT0Amp"), dead_id, ampl);
ampl = ampl / cstFT0RelGain[iCh];
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The gain correction still uses array index iCh instead of channel ID. According to the PR description, this should use the channel ID (id or dead_id) to fix mismatched amplitude corrections for remapped channels. The cstFT0RelGain array has 208 elements indexed by channel ID (0-207), not by array position. This should be cstFT0RelGain[dead_id] to correctly apply the gain correction for the remapped channel.

Copilot uses AI. Check for mistakes.
} else if (id >= kFT0CRemapChannelStart && id <= kFT0CRemapChannelEnd) {
int dead_id = id + kFT0COuterMirror;
registry.fill(HIST("FT0Amp"), dead_id, ampl);
ampl = ampl / cstFT0RelGain[iCh];
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The gain correction still uses array index iCh instead of channel ID. According to the PR description, this should use the channel ID (id or dead_id) to fix mismatched amplitude corrections for remapped channels. The cstFT0RelGain array has 208 elements indexed by channel ID (0-207), not by array position. This should be cstFT0RelGain[dead_id] to correctly apply the gain correction for the remapped channel.

Copilot uses AI. Check for mistakes.
registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
=======
float mirroredAmpl = ampl;
float mirroredAmplCorrected = mirroredAmpl / cstFT0RelGain[iCh];
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The gain correction still uses array index iCh instead of channel ID. According to the PR description, this should use the channel ID (id or dead_id) to fix mismatched amplitude corrections for remapped channels. The cstFT0RelGain array has 208 elements indexed by channel ID (0-207), not by array position. This should be cstFT0RelGain[dead_id] to correctly apply the gain correction for the remapped channel.

Copilot uses AI. Check for mistakes.
} else if (id >= kFT0CRemapChannelStart && id <= kFT0CRemapChannelEnd) {
int dead_id = id + kFT0COuterMirror;
float mirroredAmpl = ampl;
float mirroredAmplCorrected = mirroredAmpl / cstFT0RelGain[iCh];
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The gain correction still uses array index iCh instead of channel ID. According to the PR description, this should use the channel ID (id or dead_id) to fix mismatched amplitude corrections for remapped channels. The cstFT0RelGain array has 208 elements indexed by channel ID (0-207), not by array position. This should be cstFT0RelGain[dead_id] to correctly apply the gain correction for the remapped channel.

Copilot uses AI. Check for mistakes.
int dead_id = id - kFT0AOuterMirror;
<<<<<<< Updated upstream
registry.fill(HIST("FT0Amp"), dead_id, ampl);
ampl = ampl / cstFT0RelGain[iCh];
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The gain correction still uses array index iCh instead of channel ID. According to the PR description, this should use the channel ID (id or dead_id) to fix mismatched amplitude corrections for remapped channels. The cstFT0RelGain array has 208 elements indexed by channel ID (0-207), not by array position. This should be cstFT0RelGain[dead_id] to correctly apply the gain correction for the remapped channel.

Copilot uses AI. Check for mistakes.
registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
=======
float mirroredAmpl = ampl;
float mirroredAmplCorrected = mirroredAmpl / cstFT0RelGain[iCh];
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The gain correction still uses array index iCh instead of channel ID. According to the PR description, this should use the channel ID (id or dead_id) to fix mismatched amplitude corrections for remapped channels. The cstFT0RelGain array has 208 elements indexed by channel ID (0-207), not by array position. This should be cstFT0RelGain[dead_id] to correctly apply the gain correction for the remapped channel.

Copilot uses AI. Check for mistakes.
@alibuild
Copy link
Collaborator

Error while checking build/O2Physics/o2 for bd2491f at 2026-01-14 23:26:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/14489-slc9_x86-64/0/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:674:1: error: version control conflict marker in file
/sw/SOURCES/O2Physics/14489-slc9_x86-64/0/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:675:25: error: expected primary-expression before ')' token
/sw/SOURCES/O2Physics/14489-slc9_x86-64/0/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:683:1: error: version control conflict marker in file
/sw/SOURCES/O2Physics/14489-slc9_x86-64/0/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:685:41: error: 'mirroredAmpl' was not declared in this scope
/sw/SOURCES/O2Physics/14489-slc9_x86-64/0/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:694:1: error: version control conflict marker in file
/sw/SOURCES/O2Physics/14489-slc9_x86-64/0/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:708:1: error: version control conflict marker in file
/sw/SOURCES/O2Physics/14489-slc9_x86-64/0/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:709:25: error: expected primary-expression before ')' token
/sw/SOURCES/O2Physics/14489-slc9_x86-64/0/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:712:1: error: version control conflict marker in file
/sw/SOURCES/O2Physics/14489-slc9_x86-64/0/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:714:41: error: 'mirroredAmpl' was not declared in this scope
/sw/SOURCES/O2Physics/14489-slc9_x86-64/0/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:717:1: error: version control conflict marker in file
ninja: build stopped: subcommand failed.

Full log here.

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