Skip to content

Conversation

@MartijnLaarhoven
Copy link
Contributor

Adding the option to remap dead channels to their mirrored image

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
Copilot AI review requested due to automatic review settings January 7, 2026 14:38
@github-actions github-actions bot added the pwgcf label Jan 7, 2026
@github-actions github-actions bot changed the title Adding the option to remap dead channels [PWGCF] Adding the option to remap dead channels Jan 7, 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 adds functionality to remap dead detector channels in the FT0A and FT0C detectors to their working mirror channels, allowing the analysis to use mirrored channel data in place of dead channels.

Key changes:

  • Added configuration options to enable remapping of dead channels for FT0A (channels 60-63) and FT0C (channels 177, 176, 178, 179, 139)
  • Introduced MirroringConstant enum defining offset values for calculating mirror channel positions
  • Implemented remapping logic in the getChannel function to duplicate working channel amplitudes to dead channel histogram positions
Comments suppressed due to low confidence (3)

PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:697

  • The amplitude undergoes gain correction twice for remapped channels. First, it's corrected at line 689 and the corrected value is filled into the histogram. Then, the same amplitude variable is corrected again at line 696 (for the original channel ID) using the same gain factor. This double correction will result in incorrect amplitude values. The remapping block should either work with a copy of the amplitude or the gain correction at line 696 should be skipped for channels that were already corrected in the remapping block.
          ampl = ampl / cstFT0RelGain[iCh];
          registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
        }
      }
      if ((cfgRejectFT0AInside && (id >= kFT0AInnerRingMin && id <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (id >= kFT0AOuterRingMin && id <= kFT0AOuterRingMax)))
        ampl = 0.;
      registry.fill(HIST("FT0Amp"), id, ampl);
      ampl = ampl / cstFT0RelGain[iCh];
      registry.fill(HIST("FT0AmpCorrect"), id, ampl);

PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:681

  • The amplitude undergoes gain correction twice for remapped channels. First, it's corrected at line 668 and the corrected value is filled into the histogram. Then, the same amplitude variable is corrected again at line 680 (for the original channel ID) using the same gain factor. This double correction will result in incorrect amplitude values. The remapping block should either work with a copy of the amplitude or the gain correction at line 680 should be skipped for channels that were already corrected in the remapping block.
          ampl = ampl / cstFT0RelGain[iCh];
          registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
        } else if (id >= 144 && id <= 147) {
          int dead_id = id + kFT0COuterMirror;
          registry.fill(HIST("FT0Amp"), dead_id, ampl);
          ampl = ampl / cstFT0RelGain[iCh];
          registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
        }
      }
      if ((cfgRejectFT0CInside && (id >= kFT0CInnerRingMin && id <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (id >= kFT0COuterRingMin && id <= kFT0COuterRingMax)))
        ampl = 0.;
      registry.fill(HIST("FT0Amp"), id, ampl);
      ampl = ampl / cstFT0RelGain[iCh];
      registry.fill(HIST("FT0AmpCorrect"), id, ampl);

PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx:681

  • The amplitude undergoes gain correction twice for remapped channels. First, it's corrected at line 673 and the corrected value is filled into the histogram. Then, the same amplitude variable is corrected again at line 680 (for the original channel ID) using the same gain factor. This double correction will result in incorrect amplitude values. The remapping block should either work with a copy of the amplitude or the gain correction at line 680 should be skipped for channels that were already corrected in the remapping block.
          ampl = ampl / cstFT0RelGain[iCh];
          registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
        }
      }
      if ((cfgRejectFT0CInside && (id >= kFT0CInnerRingMin && id <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (id >= kFT0COuterRingMin && id <= kFT0COuterRingMax)))
        ampl = 0.;
      registry.fill(HIST("FT0Amp"), id, ampl);
      ampl = ampl / cstFT0RelGain[iCh];
      registry.fill(HIST("FT0AmpCorrect"), id, ampl);

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

Comment on lines +664 to +676
if (cfgRemapFT0CDeadChannels) {
if (id == 115) {
int dead_id = id + kFT0CInnerMirror;
registry.fill(HIST("FT0Amp"), dead_id, ampl);
ampl = ampl / cstFT0RelGain[iCh];
registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
} else if (id >= 144 && id <= 147) {
int dead_id = id + kFT0COuterMirror;
registry.fill(HIST("FT0Amp"), dead_id, ampl);
ampl = ampl / cstFT0RelGain[iCh];
registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
}
}
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The remapping logic appears to be inverted. According to the configuration description, dead channels (177, 176, 178, 179, 139) should receive amplitudes from their working mirror channels (145, 144, 146, 147, 115). However, the current implementation checks if the channel ID is a working channel (115 or 144-147) and then fills histograms for the dead channels. This means:

  1. The dead channels themselves are never processed when encountered
  2. Working channels have their amplitudes duplicated to dead channel histograms
  3. The gain correction is applied using the wrong channel index (iCh corresponds to the working channel, not the dead one)

The logic should instead check if the current channel is a dead channel, calculate which working channel to read from, and use that working channel's amplitude.

Copilot uses AI. Check for mistakes.
Comment on lines +685 to +692
if (cfgRemapFT0ADeadChannels) {
if (id >= 92 && id <= 95) {
int dead_id = id - kFT0AOuterMirror;
registry.fill(HIST("FT0Amp"), dead_id, ampl);
ampl = ampl / cstFT0RelGain[iCh];
registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
}
}
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The remapping logic appears to be inverted. According to the configuration description, dead channels (60-63) should receive amplitudes from their working mirror channels (92-95). However, the current implementation checks if the channel ID is a working channel (92-95) and then fills histograms for the dead channels (60-63). This means:

  1. The dead channels themselves are never processed when encountered
  2. Working channels have their amplitudes duplicated to dead channel histograms
  3. The gain correction is applied using the wrong channel index (iCh corresponds to the working channel, not the dead one)

The logic should instead check if the current channel is a dead channel, calculate which working channel to read from, and use that working channel's amplitude.

Copilot uses AI. Check for mistakes.
Comment on lines +255 to +260
enum MirroringConstant {
kFT0AOuterMirror = 32,
kFT0AInnerMirror = 16,
kFT0COuterMirror = 32,
kFT0CInnerMirror = 24
};
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The enum constant name "MirroringConstant" is grammatically incorrect. It should be "MirroringConstants" (plural) since the enum defines multiple constants, following the convention used by other enums in this file like "DetectorChannels".

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

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.

1 participant