CLHEP 2.4.7.1
C++ Class Library for High Energy Physics
EulerAngles.icc
Go to the documentation of this file.
1#ifndef EULERANGLES_ICC
2#error "EulerAngles.icc included without EulerAngles.h"
3#endif
4
5
6// ----------------------------------------------------------------------
7//
8// EulerAngles.icc - Inline methods for EulerAngles class.
9//
10// History:
11// 9-Apr-1997 MF Split off from original angles.hh. Content-free.
12// 26-Jan-1998 WEB Fleshed out.
13// 12-Mar-1998 WEB Gave default constructor proper default values
14// 13-Mar-1998 WEB Simplified compare()
15// 17-Jun-1998 WEB Added namespace support
16// 27-Jul-2000 MF CLHEP version
17//
18// ----------------------------------------------------------------------
19
20namespace CLHEP {
21
22
24: phi_( 0.0 ), theta_( 0.0 ), psi_( 0.0 )
25{} // HepEulerAngles::HepEulerAngles()
26
28 double phi1, double ttheta, double psi1 )
29 : phi_( phi1 ), theta_( ttheta ), psi_( psi1 )
30{} // HepEulerAngles::HepEulerAngles()
31
32inline double HepEulerAngles::getPhi() const {
33 return phi_;
34} // HepEulerAngles::getPhi()
35
36inline double HepEulerAngles::phi() const {
37 return phi_;
38} // HepEulerAngles::phi()
39
40inline HepEulerAngles & HepEulerAngles::setPhi( double phi1 ) {
41 phi_ = phi1;
42 return *this;
43} // HepEulerAngles::setPhi()
44
45inline double HepEulerAngles::getTheta() const {
46 return theta_;
47} // HepEulerAngles::getTheta()
48
49inline double HepEulerAngles::theta() const {
50 return theta_;
51} // HepEulerAngles::theta()
52
53inline HepEulerAngles & HepEulerAngles::setTheta( double ttheta ) {
54 theta_ = ttheta;
55 return *this;
56} // HepEulerAngles::setTheta()
57
58inline double HepEulerAngles::getPsi() const {
59 return psi_;
60} // HepEulerAngles::getPsi()
61
62inline double HepEulerAngles::psi() const {
63 return psi_;
64} // HepEulerAngles::psi()
65
66inline HepEulerAngles & HepEulerAngles::setPsi( double psi1 ) {
67 psi_ = psi1;
68 return *this;
69} // HepEulerAngles::setPsi()
70
71inline HepEulerAngles &
72 HepEulerAngles::set( double phi1, double ttheta, double psi1 ) {
73 phi_ = phi1, theta_ = ttheta, psi_ = psi1;
74 return *this;
75} // HepEulerAngles::set()
76
77
78inline int HepEulerAngles::compare( const HepEulerAngles & ea ) const {
79
80 return phi_ < ea.phi_ ? -1
81 : phi_ > ea.phi_ ? +1
82 : theta_ < ea.theta_ ? -1
83 : theta_ > ea.theta_ ? +1
84 : psi_ < ea.psi_ ? -1
85 : psi_ > ea.psi_ ? +1
86 : 0;
87
88} // HepEulerAngles::compare()
89
90
91inline bool HepEulerAngles::operator==( const HepEulerAngles & ea ) const {
92 return ( compare( ea ) == 0 );
93} // HepEulerAngles::operator==()
94
95inline bool HepEulerAngles::operator!=( const HepEulerAngles & ea ) const {
96 return ( compare( ea ) != 0 );
97} // HepEulerAngles::operator!=()
98
99inline bool HepEulerAngles::operator<( const HepEulerAngles & ea ) const {
100 return ( compare( ea ) < 0 );
101} // HepEulerAngles::operator<()
102
103inline bool HepEulerAngles::operator<=( const HepEulerAngles & ea ) const {
104 return ( compare( ea ) <= 0 );
105} // HepEulerAngles::operator<=()
106
107inline bool HepEulerAngles::operator>( const HepEulerAngles & ea ) const {
108 return ( compare( ea ) > 0 );
109} // HepEulerAngles::operator>()
110
111inline bool HepEulerAngles::operator>=( const HepEulerAngles & ea ) const {
112 return ( compare( ea ) >= 0 );
113} // HepEulerAngles::operator>=()
114
116 return tolerance;
117} // HepEulerAngles::getTolerance()
118
119inline double HepEulerAngles::setTolerance( double tol ) {
120 double oldTolerance( tolerance );
121 tolerance = tol;
122 return oldTolerance;
123} // HepEulerAngles::setTolerance()
124
125} // namespace CLHEP
static double setTolerance(double tol)
bool operator>=(const EA &ea) const
bool operator<=(const EA &ea) const
EA & setPhi(double phi)
double getPhi() const
double theta() const
EA & set(double phi, double theta, double psi)
bool operator<(const EA &ea) const
bool operator>(const EA &ea) const
bool operator==(const EA &ea) const
static double tolerance
Definition EulerAngles.h:36
bool operator!=(const EA &ea) const
double getTheta() const
EA & setPsi(double psi)
double getPsi() const
static double getTolerance()
EA & setTheta(double theta)
int compare(const EA &ea) const