Skip to content

Commit ffece9c

Browse files
committed
fixing PI constants
1 parent 168f0bb commit ffece9c

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

PWGDQ/Tasks/global-muon-matcher.cxx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "PWGDQ/Core/VarManager.h"
1818

1919
#include "Common/Core/fwdtrackUtilities.h"
20+
#include "Common/Core/RecoDecay.h"
2021
#include "Common/DataModel/EventSelection.h"
2122
#include "Common/DataModel/FwdTrackReAlignTables.h"
2223
#include "Tools/ML/MlResponse.h"
@@ -109,17 +110,8 @@ constexpr std::array<int, 11> SNDetElemCh = {0, 4, 8, 12, 16, 34, 52, 78, 104, 1
109110
// compute minimum difference between azimuthal angles
110111
static float getDeltaPhi(float phi1, float phi2)
111112
{
112-
float dphi = phi1 - phi2;
113-
static constexpr float pi = TMath::Pi();
114-
static constexpr float twopi = pi * 2.f;
115-
if (dphi > pi) {
116-
dphi -= twopi;
117-
}
118-
if (dphi < -pi) {
119-
dphi += twopi;
120-
}
121-
return dphi;
122-
};
113+
return RecoDecay::constrainAngle(phi1 - phi2, -o2::constants::math::PI);
114+
}
123115

124116
struct GlobalMuonMatching {
125117

@@ -220,7 +212,7 @@ struct GlobalMuonMatching {
220212
struct : ConfigurableGroup {
221213
Configurable<int> cfgMixingDepth{"cfgMixingDepth", -1, "Maximum number of mixed candidate groups per MCH track (-1: no limit)"};
222214
Configurable<int64_t> cfgMinDeltaBc{"cfgMinDeltaBc", 3564, "Minimum DeltaBc between mixed collisions"};
223-
Configurable<float> cfgMaxDeltaPhi{"cfgMaxDeltaPhi", static_cast<float>(TMath::Pi() / 10), "Maximum DelptaPhi between mixed MCH tracks (rad)"};
215+
Configurable<float> cfgMaxDeltaPhi{"cfgMaxDeltaPhi", static_cast<float>(o2::constants::math::PI / 10), "Maximum DelptaPhi between mixed MCH tracks (rad)"};
224216
Configurable<float> cfgMaxDeltaR{"cfgMaxDeltaR", 10.f, "Maximum DeltaR between mixed MCH tracks"};
225217
Configurable<float> cfgMaxDeltaAttempts{"cfgMaxDeltaAttempts", 0.1f, "Maximum relative difference in match attempts"};
226218
Configurable<float> cfgMaxDeltaZ{"cfgMaxDeltaZ", 1.f, "Maximum deltaZ between mixed collisions"};

0 commit comments

Comments
 (0)