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