Skip to content
Closed
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
25 changes: 24 additions & 1 deletion PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ struct FlowDecorrelation {
O2_DEFINE_CONFIGURABLE(nClustersMftTrack, int, 5, "Minimum number of clusters for MFT track")
O2_DEFINE_CONFIGURABLE(cfgCutChi2Mft, float, -1.0f, "max chi2 of MFT track")
O2_DEFINE_CONFIGURABLE(cfgCutTrackTimeMft, float, -1.0f, "max deviation of MFT track wrt. bc in ns")
O2_DEFINE_CONFIGURABLE(cfgRejectFT0AInside, bool, false, "Rejection of inner ring channels of the FT0A detector")
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")
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 @@ -214,6 +218,16 @@ struct FlowDecorrelation {
kTOF,
kITS
};
enum DetectorChannels {
kFT0AInnerRingMin = 0,
kFT0AInnerRingMax = 31,
kFT0AOuterRingMin = 32,
kFT0AOuterRingMax = 95,
kFT0CInnerRingMin = 96,
kFT0CInnerRingMax = 143,
kFT0COuterRingMin = 144,
kFT0COuterRingMax = 207
};
std::array<float, 6> tofNsigmaCut;
std::array<float, 6> itsNsigmaCut;
std::array<float, 6> tpcNsigmaCut;
Expand Down Expand Up @@ -614,6 +628,15 @@ struct FlowDecorrelation {
int chanelid = 0;
float ampl = 0.;
getChannel(ft0, iCh, chanelid, ampl, corType);
if (corType == kFT0C) {
if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax))) {
Comment on lines 628 to +632
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Variable name chanelid looks like a typo and makes the new rejection logic harder to read/grep. Consider renaming to channelId (and adjusting related uses) for clarity.

Copilot uses AI. Check for mistakes.
continue;
}
} else if (corType == kFT0A) {
if ((cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax))) {
continue;
}
}
Comment on lines 628 to +639
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

When rejection is enabled, the code still calls getChannel() (which fills FT0Amp/FT0AmpCorrect and applies gain correction) before checking whether the channel will be rejected. This adds avoidable work inside the track×channel nested loop and also means the FT0Amp QA histograms still include channels that are “rejected”. Consider checking the channel id/range before calling getChannel(), or moving the rejection logic into getChannel() so rejected channels are skipped/zeroed consistently and without extra fills.

Suggested change
int chanelid = 0;
float ampl = 0.;
getChannel(ft0, iCh, chanelid, ampl, corType);
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;
}
}
// Use preliminary channel id derived from index to perform rejection
int chanelid = static_cast<int>(iCh);
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;
}
}
float ampl = 0.;
// Only retrieve channel information (and trigger its QA) for non-rejected channels
getChannel(ft0, iCh, chanelid, ampl, corType);

Copilot uses AI. Check for mistakes.
auto phi = getPhiFT0(chanelid, corType);
auto eta = getEtaFT0(chanelid, corType);
if (cfgDrawEtaPhiDis && system == SameEvent) {
Expand Down Expand Up @@ -1118,4 +1141,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
return WorkflowSpec{
adaptAnalysisTask<FlowDecorrelation>(cfgc),
};
}
}
Loading