Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ struct LongRangeDihadronCor {
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")
O2_DEFINE_CONFIGURABLE(cfgRemapFT0CDeadChannels, bool, false, "If true, remap FT0C channels 177->145, 176->144, 178->146, 179->147, 139->115")
struct : ConfigurableGroup {
O2_DEFINE_CONFIGURABLE(cfgMultCentHighCutFunction, std::string, "[0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x + 10.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)", "Functional for multiplicity correlation cut");
O2_DEFINE_CONFIGURABLE(cfgMultCentLowCutFunction, std::string, "[0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x - 3.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)", "Functional for multiplicity correlation cut");
Expand Down Expand Up @@ -250,6 +252,19 @@ struct LongRangeDihadronCor {
kFT0COuterRingMin = 144,
kFT0COuterRingMax = 207
};
enum MirroringConstants {
kFT0AOuterMirror = 32,
kFT0AInnerMirror = 16,
kFT0COuterMirror = 32,
kFT0CInnerMirror = 24
};
Comment on lines +257 to +260
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The constant kFT0AInnerMirror is defined but never used in the code. Consider removing it if it's not needed, or add a comment explaining its purpose if it's reserved for future use.

Suggested change
kFT0AInnerMirror = 16,
kFT0COuterMirror = 32,
kFT0CInnerMirror = 24
};
kFT0COuterMirror = 32,
kFT0CInnerMirror = 24
};

Copilot uses AI. Check for mistakes.
enum DeadChannels {
kFT0ARemapChannelStart = 92,
kFT0ARemapChannelEnd = 95,
kFT0CRemapChannelStart = 144,
kFT0CRemapChannelEnd = 147,
kFT0CRemapChannelInnerRing = 115
};
std::array<float, 6> tofNsigmaCut;
std::array<float, 6> itsNsigmaCut;
std::array<float, 6> tpcNsigmaCut;
Expand Down Expand Up @@ -653,6 +668,19 @@ struct LongRangeDihadronCor {
id = ft0.channelC()[iCh];
id = id + Ft0IndexA;
ampl = ft0.amplitudeC()[iCh];
if (cfgRemapFT0CDeadChannels) {
if (id == kFT0CRemapChannelInnerRing) {
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 >= kFT0CRemapChannelStart && id <= kFT0CRemapChannelEnd) {
int dead_id = id + kFT0COuterMirror;
registry.fill(HIST("FT0Amp"), dead_id, ampl);
ampl = ampl / cstFT0RelGain[iCh];
registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
}
}
Comment on lines +671 to +683
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The gain correction is being applied using the wrong index. The code uses cstFT0RelGain[iCh], where iCh is the position in the FT0C channel array, but cstFT0RelGain is indexed by the global channel ID (0-207). For dead channels, you should use cstFT0RelGain[dead_id] instead of cstFT0RelGain[iCh] to apply the correct gain correction for the remapped dead channel.

Copilot uses AI. Check for mistakes.
Comment on lines +671 to +683
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The interaction between the remapping and rejection features is potentially confusing. When remapping is enabled, dead channels receive amplitude data from functioning channels. However, if rejection is enabled for the ring containing the dead channels, those dead channels will still have non-zero amplitude (from remapping), while the functioning channels in the same ring are set to zero. Consider documenting this behavior or adding logic to also zero out remapped dead channels when their corresponding ring rejection is enabled.

Copilot uses AI. Check for mistakes.
if ((cfgRejectFT0CInside && (id >= kFT0CInnerRingMin && id <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (id >= kFT0COuterRingMin && id <= kFT0COuterRingMax)))
ampl = 0.;
registry.fill(HIST("FT0Amp"), id, ampl);
Expand All @@ -661,6 +689,14 @@ struct LongRangeDihadronCor {
} else if (fitType == kFT0A) {
id = ft0.channelA()[iCh];
ampl = ft0.amplitudeA()[iCh];
if (cfgRemapFT0ADeadChannels) {
if (id >= kFT0ARemapChannelStart && id <= kFT0ARemapChannelEnd) {
int dead_id = id - kFT0AOuterMirror;
registry.fill(HIST("FT0Amp"), dead_id, ampl);
ampl = ampl / cstFT0RelGain[iCh];
registry.fill(HIST("FT0AmpCorrect"), dead_id, ampl);
}
}
Comment on lines +692 to +699
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The gain correction is being applied using the wrong index. The code uses cstFT0RelGain[iCh], where iCh is the position in the FT0A channel array, but cstFT0RelGain is indexed by the global channel ID (0-207). For dead channels, you should use cstFT0RelGain[dead_id] instead of cstFT0RelGain[iCh] to apply the correct gain correction for the remapped dead channel.

Copilot uses AI. Check for mistakes.
Comment on lines +692 to +699
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The interaction between the remapping and rejection features is potentially confusing. When remapping is enabled, dead channels receive amplitude data from functioning channels. However, if rejection is enabled for the ring containing the dead channels, those dead channels will still have non-zero amplitude (from remapping), while the functioning channels in the same ring are set to zero. Consider documenting this behavior or adding logic to also zero out remapped dead channels when their corresponding ring rejection is enabled.

Copilot uses AI. Check for mistakes.
if ((cfgRejectFT0AInside && (id >= kFT0AInnerRingMin && id <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (id >= kFT0AOuterRingMin && id <= kFT0AOuterRingMax)))
ampl = 0.;
registry.fill(HIST("FT0Amp"), id, ampl);
Expand Down
Loading