CLHEP  2.4.7.2
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 
20 namespace CLHEP {
21 
22 
23 inline HepEulerAngles::HepEulerAngles()
24 : phi_( 0.0 ), theta_( 0.0 ), psi_( 0.0 )
25 {} // HepEulerAngles::HepEulerAngles()
26 
27 inline HepEulerAngles::HepEulerAngles (
28  double phi1, double ttheta, double psi1 )
29  : phi_( phi1 ), theta_( ttheta ), psi_( psi1 )
30 {} // HepEulerAngles::HepEulerAngles()
31 
32 inline double HepEulerAngles::getPhi() const {
33  return phi_;
34 } // HepEulerAngles::getPhi()
35 
36 inline double HepEulerAngles::phi() const {
37  return phi_;
38 } // HepEulerAngles::phi()
39 
40 inline HepEulerAngles & HepEulerAngles::setPhi( double phi1 ) {
41  phi_ = phi1;
42  return *this;
43 } // HepEulerAngles::setPhi()
44 
45 inline double HepEulerAngles::getTheta() const {
46  return theta_;
47 } // HepEulerAngles::getTheta()
48 
49 inline double HepEulerAngles::theta() const {
50  return theta_;
51 } // HepEulerAngles::theta()
52 
53 inline HepEulerAngles & HepEulerAngles::setTheta( double ttheta ) {
54  theta_ = ttheta;
55  return *this;
56 } // HepEulerAngles::setTheta()
57 
58 inline double HepEulerAngles::getPsi() const {
59  return psi_;
60 } // HepEulerAngles::getPsi()
61 
62 inline double HepEulerAngles::psi() const {
63  return psi_;
64 } // HepEulerAngles::psi()
65 
66 inline HepEulerAngles & HepEulerAngles::setPsi( double psi1 ) {
67  psi_ = psi1;
68  return *this;
69 } // HepEulerAngles::setPsi()
70 
71 inline 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 
78 inline 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 
91 inline bool HepEulerAngles::operator==( const HepEulerAngles & ea ) const {
92  return ( compare( ea ) == 0 );
93 } // HepEulerAngles::operator==()
94 
95 inline bool HepEulerAngles::operator!=( const HepEulerAngles & ea ) const {
96  return ( compare( ea ) != 0 );
97 } // HepEulerAngles::operator!=()
98 
99 inline bool HepEulerAngles::operator<( const HepEulerAngles & ea ) const {
100  return ( compare( ea ) < 0 );
101 } // HepEulerAngles::operator<()
102 
103 inline bool HepEulerAngles::operator<=( const HepEulerAngles & ea ) const {
104  return ( compare( ea ) <= 0 );
105 } // HepEulerAngles::operator<=()
106 
107 inline bool HepEulerAngles::operator>( const HepEulerAngles & ea ) const {
108  return ( compare( ea ) > 0 );
109 } // HepEulerAngles::operator>()
110 
111 inline bool HepEulerAngles::operator>=( const HepEulerAngles & ea ) const {
112  return ( compare( ea ) >= 0 );
113 } // HepEulerAngles::operator>=()
114 
115 inline double HepEulerAngles::getTolerance() {
116  return tolerance;
117 } // HepEulerAngles::getTolerance()
118 
119 inline double HepEulerAngles::setTolerance( double tol ) {
120  double oldTolerance( tolerance );
121  tolerance = tol;
122  return oldTolerance;
123 } // HepEulerAngles::setTolerance()
124 
125 } // namespace CLHEP