Skip to content

Commit a21861d

Browse files
authored
PWGJE: Fix excessive use of RecoDecay::constrainAngle (#8053)
1 parent b91750e commit a21861d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

PWGJE/Core/JetUtilities.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ std::tuple<std::vector<std::vector<int>>, std::vector<std::vector<int>>> MatchCl
141141
template <typename T, typename U>
142142
float deltaR(T const& A, U const& B)
143143
{
144-
float dPhi = RecoDecay::constrainAngle(RecoDecay::constrainAngle(A.phi(), -M_PI) - RecoDecay::constrainAngle(B.phi(), -M_PI), -M_PI);
144+
float dPhi = RecoDecay::constrainAngle(A.phi() - B.phi(), -M_PI);
145145
float dEta = A.eta() - B.eta();
146146

147147
return std::sqrt(dEta * dEta + dPhi * dPhi);
@@ -150,7 +150,7 @@ float deltaR(T const& A, U const& B)
150150
template <typename T, typename U, typename V, typename W>
151151
float deltaR(T const& eta1, U const& phi1, V const& eta2, W const& phi2)
152152
{
153-
float dPhi = RecoDecay::constrainAngle(RecoDecay::constrainAngle(phi1, -M_PI) - RecoDecay::constrainAngle(phi2, -M_PI), -M_PI);
153+
float dPhi = RecoDecay::constrainAngle(phi1 - phi2, -M_PI);
154154
float dEta = eta1 - eta2;
155155

156156
return std::sqrt(dEta * dEta + dPhi * dPhi);

PWGJE/Tasks/jetTutorial.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ struct JetTutorialTask {
313313
return;
314314
}
315315
for (auto& jet : jets) {
316-
if (TMath::Abs(RecoDecay::constrainAngle(RecoDecay::constrainAngle(jet.phi(), -o2::constants::math::PIHalf) - RecoDecay::constrainAngle(leadingTrackPhi, -o2::constants::math::PIHalf), -o2::constants::math::PIHalf) > 0.6)) {
316+
if (std::abs(RecoDecay::constrainAngle(jet.phi() - leadingTrackPhi, -o2::constants::math::PIHalf) > 0.6)) {
317317
registry.fill(HIST("h_recoil_jet_pt"), jet.pt());
318318
registry.fill(HIST("h_recoil_jet_eta"), jet.eta());
319319
registry.fill(HIST("h_recoil_jet_phi"), jet.phi());

0 commit comments

Comments
 (0)