Geant4  10.00.p01
EulerAngles.icc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // ---------------------------------------------------------------------------
3 //
4 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
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 inline HepEulerAngles::HepEulerAngles()
23 : phi_( 0.0 ), theta_( 0.0 ), psi_( 0.0 )
24 {} // HepEulerAngles::HepEulerAngles()
25 
26 inline HepEulerAngles::HepEulerAngles (
27  double phi1, double theta1, double psi1 )
28  : phi_( phi1 ), theta_( theta1 ), psi_( psi1 )
29 {} // HepEulerAngles::HepEulerAngles()
30 
31 inline double HepEulerAngles::getPhi() const {
32  return phi_;
33 } // HepEulerAngles::getPhi()
34 
35 inline double HepEulerAngles::phi() const {
36  return phi_;
37 } // HepEulerAngles::phi()
38 
39 inline HepEulerAngles & HepEulerAngles::setPhi( double phi1 ) {
40  phi_ = phi1;
41  return *this;
42 } // HepEulerAngles::setPhi()
43 
44 inline double HepEulerAngles::getTheta() const {
45  return theta_;
46 } // HepEulerAngles::getTheta()
47 
48 inline double HepEulerAngles::theta() const {
49  return theta_;
50 } // HepEulerAngles::theta()
51 
52 inline HepEulerAngles & HepEulerAngles::setTheta( double theta1 ) {
53  theta_ = theta1;
54  return *this;
55 } // HepEulerAngles::setTheta()
56 
57 inline double HepEulerAngles::getPsi() const {
58  return psi_;
59 } // HepEulerAngles::getPsi()
60 
61 inline double HepEulerAngles::psi() const {
62  return psi_;
63 } // HepEulerAngles::psi()
64 
65 inline HepEulerAngles & HepEulerAngles::setPsi( double psi1 ) {
66  psi_ = psi1;
67  return *this;
68 } // HepEulerAngles::setPsi()
69 
70 inline HepEulerAngles &
71  HepEulerAngles::set( double phi1, double theta1, double psi1 ) {
72  phi_ = phi1, theta_ = theta1, psi_ = psi1;
73  return *this;
74 } // HepEulerAngles::set()
75 
76 
77 inline int HepEulerAngles::compare( const HepEulerAngles & ea ) const {
78 
79  return phi_ < ea.phi_ ? -1
80  : phi_ > ea.phi_ ? +1
81  : theta_ < ea.theta_ ? -1
82  : theta_ > ea.theta_ ? +1
83  : psi_ < ea.psi_ ? -1
84  : psi_ > ea.psi_ ? +1
85  : 0;
86 
87 } // HepEulerAngles::compare()
88 
89 
90 inline bool HepEulerAngles::operator==( const HepEulerAngles & ea ) const {
91  return ( compare( ea ) == 0 );
92 } // HepEulerAngles::operator==()
93 
94 inline bool HepEulerAngles::operator!=( const HepEulerAngles & ea ) const {
95  return ( compare( ea ) != 0 );
96 } // HepEulerAngles::operator!=()
97 
98 inline bool HepEulerAngles::operator<( const HepEulerAngles & ea ) const {
99  return ( compare( ea ) < 0 );
100 } // HepEulerAngles::operator<()
101 
102 inline bool HepEulerAngles::operator<=( const HepEulerAngles & ea ) const {
103  return ( compare( ea ) <= 0 );
104 } // HepEulerAngles::operator<=()
105 
106 inline bool HepEulerAngles::operator>( const HepEulerAngles & ea ) const {
107  return ( compare( ea ) > 0 );
108 } // HepEulerAngles::operator>()
109 
110 inline bool HepEulerAngles::operator>=( const HepEulerAngles & ea ) const {
111  return ( compare( ea ) >= 0 );
112 } // HepEulerAngles::operator>=()
113 
114 inline double HepEulerAngles::getTolerance() {
115  return tolerance;
116 } // HepEulerAngles::getTolerance()
117 
118 inline double HepEulerAngles::setTolerance( double tol ) {
119  double oldTolerance( tolerance );
120  tolerance = tol;
121  return oldTolerance;
122 } // HepEulerAngles::setTolerance()
123 
124 } // namespace CLHEP