File tree Expand file tree Collapse file tree 14 files changed +63
-53
lines changed
Expand file tree Collapse file tree 14 files changed +63
-53
lines changed Original file line number Diff line number Diff line change 1616#ifndef ROOT_Math_GenVector_Cylindrical3D
1717#define ROOT_Math_GenVector_Cylindrical3D 1
1818
19- #include " Math/Math .h"
19+ #include " TMath .h"
2020
2121#include " Math/GenVector/eta.h"
2222
@@ -109,7 +109,7 @@ public :
109109 {rho=fRho ; zz=fZ ; phi=fPhi ;}
110110
111111private:
112- inline static Scalar pi () { return Scalar (M_PI ); }
112+ inline static Scalar pi () { return Scalar (TMath::Pi () ); }
113113 inline void Restrict ()
114114 {
115115 using std::floor;
Original file line number Diff line number Diff line change 2424
2525#include " Math/GenVector/etaMax.h"
2626
27-
27+ # include " TMath.h "
2828#include < limits>
2929#include < cmath>
3030
@@ -125,7 +125,7 @@ public :
125125 {rho=fRho ; eta=fEta ; phi=fPhi ;}
126126
127127private:
128- inline static Scalar pi () { return M_PI ; }
128+ inline static Scalar pi () { return TMath::Pi () ; }
129129 inline void Restrict () {
130130 using std::floor;
131131 if (fPhi <= -pi () || fPhi > pi ()) fPhi = fPhi - floor (fPhi / (2 * pi ()) + .5 ) * 2 * pi ();
Original file line number Diff line number Diff line change 2222#include " Math/GenVector/PositionVector3D.h"
2323#include " Math/GenVector/LorentzVector.h"
2424#include " Math/GenVector/3DConversions.h"
25+ #include " TMath.h"
2526#include < algorithm>
2627#include < cassert>
2728
@@ -345,7 +346,7 @@ class EulerAngles {
345346 double fTheta ; // X rotation angle (second) defined only [0,PI]
346347 double fPsi ; // Z rotation angle (third) defined in [-PI,PI]
347348
348- static double Pi () { return M_PI ; }
349+ static double Pi () { return TMath::Pi () ; }
349350
350351}; // EulerAngles
351352
Original file line number Diff line number Diff line change 2020#define ROOT_Math_GenVector_Polar2D 1
2121
2222#include " Math/Math.h"
23+ #include " TMath.h"
2324
2425#include " Math/GenVector/etaMax.h"
2526
@@ -131,7 +132,7 @@ public :
131132
132133
133134private:
134- inline static double pi () { return M_PI ; }
135+ inline static double pi () { return TMath::Pi () ; }
135136
136137 /* *
137138 restrict abgle hi to be between -PI and PI
Original file line number Diff line number Diff line change 2323
2424#include " Math/GenVector/eta.h"
2525
26+ #include " TMath.h"
2627#include < cmath>
2728
2829namespace ROOT {
@@ -158,7 +159,7 @@ public :
158159
159160
160161private:
161- inline static Scalar pi () { return M_PI ; }
162+ inline static Scalar pi () { return TMath::Pi () ; }
162163 inline void Restrict () {
163164 using std::floor;
164165 if (fPhi <= -pi () || fPhi > pi ()) fPhi = fPhi - floor (fPhi / (2 * pi ()) + .5 ) * 2 * pi ();
Original file line number Diff line number Diff line change 1919#define ROOT_Math_GenVector_PtEtaPhiM4D 1
2020
2121#include " Math/Math.h"
22+ #include " TMath.h"
2223
2324#include " Math/GenVector/etaMax.h"
2425
@@ -250,7 +251,7 @@ public :
250251 Scalar Et () const { using std::cosh; return E () / cosh (fEta ); }
251252
252253private:
253- inline static Scalar pi () { return M_PI ; }
254+ inline static Scalar pi () { return TMath::Pi () ; }
254255 inline void RestrictPhi () {
255256 using std::floor;
256257 if (fPhi <= -pi () || fPhi > pi ()) fPhi = fPhi - floor (fPhi / (2 * pi ()) + .5 ) * 2 * pi ();
Original file line number Diff line number Diff line change 2626
2727#include " Math/GenVector/RotationXfwd.h"
2828
29+ #include < TMath.h>
2930#include < cmath>
3031
3132namespace ROOT {
@@ -72,9 +73,9 @@ class RotationX {
7273 Rectify makes sure the angle is in (-pi,pi]
7374 */
7475 void Rectify () {
75- if ( std::fabs (fAngle ) >= M_PI ) {
76- double x = fAngle / ( 2.0 * M_PI );
77- fAngle = ( 2.0 * M_PI ) * ( x + std::floor (.5 -x) );
76+ if (std::fabs (fAngle ) >= TMath::Pi () ) {
77+ double x = fAngle / TMath::TwoPi ( );
78+ fAngle = TMath::TwoPi ( ) * (x + std::floor (.5 - x) );
7879 fSin = std::sin (fAngle );
7980 fCos = std::cos (fAngle );
8081 }
@@ -195,8 +196,8 @@ class RotationX {
195196 */
196197 RotationX operator * (const RotationX & r) const {
197198 RotationX ans;
198- double x = (fAngle + r.fAngle ) / ( 2.0 * M_PI );
199- ans.fAngle = ( 2.0 * M_PI ) * ( x + std::floor (.5 -x) );
199+ double x = (fAngle + r.fAngle ) / TMath::TwoPi ( );
200+ ans.fAngle = TMath::TwoPi ( ) * (x + std::floor (.5 - x) );
200201 ans.fSin = fSin *r.fCos + fCos *r.fSin ;
201202 ans.fCos = fCos *r.fCos - fSin *r.fSin ;
202203 return ans;
Original file line number Diff line number Diff line change 2727#include " Math/GenVector/RotationYfwd.h"
2828
2929#include < cmath>
30+ #include < TMath.h>
3031
3132namespace ROOT {
3233namespace Math {
@@ -72,9 +73,9 @@ class RotationY {
7273 Rectify makes sure the angle is in (-pi,pi]
7374 */
7475 void Rectify () {
75- if ( std::fabs (fAngle ) >= M_PI ) {
76- double x = fAngle / ( 2.0 * M_PI );
77- fAngle = ( 2.0 * M_PI ) * ( x + std::floor (.5 -x) );
76+ if (std::fabs (fAngle ) >= TMath::Pi () ) {
77+ double x = fAngle / TMath::TwoPi ( );
78+ fAngle = TMath::TwoPi ( ) * (x + std::floor (.5 - x) );
7879 fSin = std::sin (fAngle );
7980 fCos = std::cos (fAngle );
8081 }
@@ -195,8 +196,8 @@ class RotationY {
195196 */
196197 RotationY operator * (const RotationY & r) const {
197198 RotationY ans;
198- double x = (fAngle + r.fAngle ) / ( 2.0 * M_PI );
199- ans.fAngle = ( 2.0 * M_PI ) * ( x + std::floor (.5 -x) );
199+ double x = (fAngle + r.fAngle ) / TMath::TwoPi ( );
200+ ans.fAngle = TMath::TwoPi ( ) * (x + std::floor (.5 - x) );
200201 ans.fSin = fSin *r.fCos + fCos *r.fSin ;
201202 ans.fCos = fCos *r.fCos - fSin *r.fSin ;
202203 return ans;
Original file line number Diff line number Diff line change 2626
2727#include " Math/GenVector/RotationZfwd.h"
2828
29+ #include " TMath.h"
2930#include < cmath>
3031
3132namespace ROOT {
@@ -72,9 +73,9 @@ class RotationZ {
7273 Rectify makes sure the angle is in (-pi,pi]
7374 */
7475 void Rectify () {
75- if ( std::fabs (fAngle ) >= M_PI ) {
76- double x = fAngle / ( 2.0 * M_PI );
77- fAngle = ( 2.0 * M_PI ) * ( x + std::floor (.5 -x) );
76+ if (std::fabs (fAngle ) >= TMath::Pi () ) {
77+ double x = fAngle / TMath::TwoPi ( );
78+ fAngle = TMath::TwoPi ( ) * (x + std::floor (.5 - x) );
7879 fSin = std::sin (fAngle );
7980 fCos = std::cos (fAngle );
8081 }
@@ -195,8 +196,8 @@ class RotationZ {
195196 */
196197 RotationZ operator * (const RotationZ & r) const {
197198 RotationZ ans;
198- double x = (fAngle + r.fAngle ) / ( 2.0 * M_PI );
199- ans.fAngle = ( 2.0 * M_PI ) * ( x + std::floor (.5 -x) );
199+ double x = (fAngle + r.fAngle ) / TMath::TwoPi ( );
200+ ans.fAngle = TMath::TwoPi ( ) * (x + std::floor (.5 - x) );
200201 ans.fSin = fSin *r.fCos + fCos *r.fSin ;
201202 ans.fCos = fCos *r.fCos - fSin *r.fSin ;
202203 return ans;
Original file line number Diff line number Diff line change 3131
3232#include " Math/GenVector/3DConversions.h"
3333
34+ #include " TMath.h"
3435
3536#include < algorithm>
3637#include < cassert>
@@ -318,7 +319,7 @@ class RotationZYX {
318319 double fTheta ; // Y' rotation angle (pitch) defined in [-PI/2,PI/2]
319320 double fPsi ; // X'' rotation angle (roll) defined in (-PI,PI]
320321
321- static double Pi () { return M_PI ; }
322+ static double Pi () { return TMath::Pi () ; }
322323
323324}; // RotationZYX
324325
You can’t perform that action at this time.
0 commit comments