From ccced858769b32798b55e50e459c8eaa697d3fc6 Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Sat, 14 Nov 2026 10:59:43 +0100 Subject: [PATCH] dndetaMFTPbPb.cxx: Fix azimuthal angle selection for MC particles --- PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx | 45 ++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx index 8eaef0ae1c8..4293d9457cc 100644 --- a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx +++ b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx @@ -328,7 +328,9 @@ struct DndetaMFTPbPb { struct : ConfigurableGroup { Configurable etaRangeMidrap{"etaRangeMidrap", 1.0f, "Eta range for midrapidity tracks"}; - Configurable usephiCut{"usephiCut", false, "use azimuthal angle cut"}; + Configurable usePhiCut{"usePhiCut", false, "use azimuthal angle cut"}; + Configurable usePhiCutGen{"usePhiCutGen", false, "use azimuthal angle cut for particles"}; + Configurable usePhiCutExtra{"usePhiCutExtra", false, "use additional azimuthal angle cut"}; Configurable phiCut{"phiCut", 0.1f, "Cut on azimuthal angle of MFT tracks"}; Configurable minPhi{"minPhi", 0.f, ""}; Configurable maxPhi{"maxPhi", 6.2832, ""}; @@ -1141,20 +1143,25 @@ struct DndetaMFTPbPb { } float phi = track.phi(); o2::math_utils::bringTo02Pi(phi); - if (phi < trackCuts.minPhi || trackCuts.maxPhi < phi) { + if (phi < 0.f || TwoPI < phi) { return false; } if constexpr (fillHis) { registryQC.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelPhi)); } - if (trackCuts.usephiCut) { - if ((phi < trackCuts.phiCut) || - ((phi > PI - trackCuts.phiCut) && (phi < PI + trackCuts.phiCut)) || - (phi > TwoPI - trackCuts.phiCut) || - ((phi > ((PIHalf - 0.1) * PI) - trackCuts.phiCut) && - (phi < ((PIHalf - 0.1) * PI) + trackCuts.phiCut))) { + if (trackCuts.usePhiCut) { + if (phi < trackCuts.minPhi || trackCuts.maxPhi < phi) { return false; } + if (trackCuts.usePhiCutExtra) { + if ((phi < trackCuts.phiCut) || + ((phi > PI - trackCuts.phiCut) && (phi < PI + trackCuts.phiCut)) || + (phi > TwoPI - trackCuts.phiCut) || + ((phi > ((PIHalf - 0.1) * PI) - trackCuts.phiCut) && + (phi < ((PIHalf - 0.1) * PI) + trackCuts.phiCut))) { + return false; + } + } } if constexpr (fillHis) { registryQC.fill(HIST("Tracks/hTrkSel"), static_cast(TrkSel::trkSelPhiCut)); @@ -1336,17 +1343,22 @@ struct DndetaMFTPbPb { } float phi = particle.phi(); o2::math_utils::bringTo02Pi(phi); - if (phi < trackCuts.minPhi || trackCuts.maxPhi < phi) { + if (phi < 0.f || TwoPI < phi) { return false; } - if (trackCuts.usephiCut) { - if ((phi < trackCuts.phiCut) || - ((phi > PI - trackCuts.phiCut) && (phi < PI + trackCuts.phiCut)) || - (phi > TwoPI - trackCuts.phiCut) || - ((phi > ((PIHalf - 0.1) * PI) - trackCuts.phiCut) && - (phi < ((PIHalf - 0.1) * PI) + trackCuts.phiCut))) { + if (trackCuts.usePhiCutGen) { + if (phi < trackCuts.minPhi || trackCuts.maxPhi < phi) { return false; } + if (trackCuts.usePhiCutExtra) { + if ((phi < trackCuts.phiCut) || + ((phi > PI - trackCuts.phiCut) && (phi < PI + trackCuts.phiCut)) || + (phi > TwoPI - trackCuts.phiCut) || + ((phi > ((PIHalf - 0.1) * PI) - trackCuts.phiCut) && + (phi < ((PIHalf - 0.1) * PI) + trackCuts.phiCut))) { + return false; + } + } } return true; } @@ -1513,6 +1525,9 @@ struct DndetaMFTPbPb { } float phi = particle.phi(); o2::math_utils::bringTo02Pi(phi); + if (phi < 0.f || TwoPI < phi) { + continue; + } if constexpr (isCent) { registryMC.fill(HIST("Tracks/Centrality/EtaZvtxGen_t"), particle.eta(), zvtx, c, occ); registryMC.fill(HIST("Tracks/Centrality/PhiEtaGen_t"), phi, particle.eta(), c, occ);