Skip to content

Commit 21e4da2

Browse files
committed
trying to normalise angle difference without using RecoDecay
1 parent e1f2039 commit 21e4da2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

PWGUD/Tasks/upcRhoAnalysis.cxx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/// \file upcRhoAnalysis.cxx
1717

1818
#include "Common/DataModel/PIDResponse.h"
19-
// #include "Common/Core/RecoDecay.h"
19+
// #include "Common/Core/RecoDecay.h" // need to use something from this to restrict angle ranges
2020

2121
#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h"
2222
#include "PWGUD/DataModel/UDTables.h"
@@ -525,10 +525,11 @@ struct UpcRhoAnalysis {
525525
double deltaPhi(const ROOT::Math::PxPyPzMVector& p1, const ROOT::Math::PxPyPzMVector& p2)
526526
{
527527
double dPhi = p1.Phi() - p2.Phi();
528-
if (dPhi > o2::constants::math::PI)
529-
dPhi -= o2::constants::math::TwoPI;
530-
else if (dPhi < -o2::constants::math::PI)
531-
dPhi += o2::constants::math::TwoPI;
528+
dPhi = std::fmod(dPhi + o2::constants::math::PI, o2::constants::math::TwoPI) - o2::constants::math::PI; // normalize to (-pi, pi)
529+
// if (dPhi > o2::constants::math::PI)
530+
// dPhi -= o2::constants::math::TwoPI;
531+
// else if (dPhi < -o2::constants::math::PI)
532+
// dPhi += o2::constants::math::TwoPI;
532533
return dPhi; // calculate delta phi in (-pi, pi)
533534
}
534535

0 commit comments

Comments
 (0)