Skip to content

Commit 2d22797

Browse files
authored
[PWGDQ] Fix DeltaPhi definition (#12448)
1 parent 2e3ee34 commit 2d22797

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

PWGDQ/Tasks/taskJpsiHf.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,16 @@ struct taskJPsiHf {
9797
float deltaRap = -999;
9898
float deltaPhi = -999;
9999

100-
for (auto& dilepton : dileptons) {
100+
for (auto const& dilepton : dileptons) {
101101
ptDilepton = RecoDecay::pt(dilepton.px(), dilepton.py());
102102
rapDilepton = RecoDecay::y(std::array{dilepton.px(), dilepton.py(), dilepton.pz()}, constants::physics::MassJPsi);
103103
phiDilepton = RecoDecay::phi(dilepton.px(), dilepton.py());
104104

105-
for (auto& dmeson : dmesons) {
105+
for (auto const& dmeson : dmesons) {
106106
ptDmeson = RecoDecay::pt(dmeson.px(), dmeson.py());
107107
phiDmeson = RecoDecay::phi(dmeson.px(), dmeson.py());
108-
deltaPhi = RecoDecay::constrainAngle(phiDilepton - phiDmeson, -o2::constants::math::PIHalf);
108+
float absDeltaPhiRaw = std::abs(phiDilepton - phiDmeson);
109+
deltaPhi = (absDeltaPhiRaw < o2::constants::math::PI) ? absDeltaPhiRaw : o2::constants::math::TwoPI - absDeltaPhiRaw;
109110

110111
auto ptBinDmesForBdt = findBin(binsPtDmesForBdt, ptDmeson);
111112
if (ptBinDmesForBdt == -1) {

0 commit comments

Comments
 (0)