From 5f74fca2ce169762de1746184c0c18c98b4643a0 Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Tue, 5 Aug 2025 17:39:28 +0200 Subject: [PATCH] Fix DeltaPhi definition --- PWGDQ/Tasks/taskJpsiHf.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGDQ/Tasks/taskJpsiHf.cxx b/PWGDQ/Tasks/taskJpsiHf.cxx index 79d9348940a..ef415259a02 100644 --- a/PWGDQ/Tasks/taskJpsiHf.cxx +++ b/PWGDQ/Tasks/taskJpsiHf.cxx @@ -97,15 +97,16 @@ struct taskJPsiHf { float deltaRap = -999; float deltaPhi = -999; - for (auto& dilepton : dileptons) { + for (auto const& dilepton : dileptons) { ptDilepton = RecoDecay::pt(dilepton.px(), dilepton.py()); rapDilepton = RecoDecay::y(std::array{dilepton.px(), dilepton.py(), dilepton.pz()}, constants::physics::MassJPsi); phiDilepton = RecoDecay::phi(dilepton.px(), dilepton.py()); - for (auto& dmeson : dmesons) { + for (auto const& dmeson : dmesons) { ptDmeson = RecoDecay::pt(dmeson.px(), dmeson.py()); phiDmeson = RecoDecay::phi(dmeson.px(), dmeson.py()); - deltaPhi = RecoDecay::constrainAngle(phiDilepton - phiDmeson, -o2::constants::math::PIHalf); + float absDeltaPhiRaw = std::abs(phiDilepton - phiDmeson); + deltaPhi = (absDeltaPhiRaw < o2::constants::math::PI) ? absDeltaPhiRaw : o2::constants::math::TwoPI - absDeltaPhiRaw; auto ptBinDmesForBdt = findBin(binsPtDmesForBdt, ptDmeson); if (ptBinDmesForBdt == -1) {