1 | #ifndef HEP_EULERANGLES_H
|
---|
2 | #define HEP_EULERANGLES_H
|
---|
3 |
|
---|
4 | // ----------------------------------------------------------------------
|
---|
5 | //
|
---|
6 | // EulerAngles.h EulerAngles class --
|
---|
7 | // Support class for PhysicsVectors classes
|
---|
8 | //
|
---|
9 | // History:
|
---|
10 | // 09-Jan-1998 WEB FixedTypes is now found in ZMutility
|
---|
11 | // 12-Jan-1998 WEB PI is now found in ZMutility
|
---|
12 | // 15-Jun-1998 WEB Added namespace support
|
---|
13 | // 02-May-2000 WEB No global using
|
---|
14 | // 26-Jul-2000 MF CLHEP version
|
---|
15 | //
|
---|
16 | // ----------------------------------------------------------------------
|
---|
17 |
|
---|
18 | #include <iostream>
|
---|
19 | #include "CLHEP/Vector/defs.h"
|
---|
20 |
|
---|
21 | namespace CLHEP {
|
---|
22 |
|
---|
23 | // Declarations of classes and global methods
|
---|
24 | class HepEulerAngles;
|
---|
25 | std::ostream & operator<<(std::ostream & os, const HepEulerAngles & aa);
|
---|
26 | std::istream & operator>>(std::istream & is, HepEulerAngles & aa);
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * @author
|
---|
30 | * @ingroup vector
|
---|
31 | */
|
---|
32 | class HepEulerAngles {
|
---|
33 |
|
---|
34 | protected:
|
---|
35 | typedef HepEulerAngles EA; // just an abbreviation
|
---|
36 | static double tolerance; // to determine relative nearness
|
---|
37 |
|
---|
38 | public:
|
---|
39 |
|
---|
40 | // ---------- Constructors:
|
---|
41 | inline HepEulerAngles();
|
---|
42 | inline HepEulerAngles( double phi, double theta, double psi );
|
---|
43 |
|
---|
44 | // ---------- Destructor, copy constructor, assignment:
|
---|
45 | // use C++ defaults
|
---|
46 |
|
---|
47 | // ---------- Accessors:
|
---|
48 |
|
---|
49 | public:
|
---|
50 | inline double getPhi() const;
|
---|
51 | inline double phi() const;
|
---|
52 | inline EA & setPhi( double phi );
|
---|
53 |
|
---|
54 | inline double getTheta() const;
|
---|
55 | inline double theta() const;
|
---|
56 | inline EA & setTheta( double theta );
|
---|
57 |
|
---|
58 | inline double getPsi() const;
|
---|
59 | inline double psi() const;
|
---|
60 | inline EA & setPsi( double psi );
|
---|
61 |
|
---|
62 | inline EA & set( double phi, double theta, double psi );
|
---|
63 |
|
---|
64 | // ---------- Operations:
|
---|
65 |
|
---|
66 | // comparisons:
|
---|
67 | inline int compare ( const EA & ea ) const;
|
---|
68 |
|
---|
69 | inline bool operator==( const EA & ea ) const;
|
---|
70 | inline bool operator!=( const EA & ea ) const;
|
---|
71 | inline bool operator< ( const EA & ea ) const;
|
---|
72 | inline bool operator<=( const EA & ea ) const;
|
---|
73 | inline bool operator> ( const EA & ea ) const;
|
---|
74 | inline bool operator>=( const EA & ea ) const;
|
---|
75 |
|
---|
76 | // relative comparison:
|
---|
77 | inline static double getTolerance();
|
---|
78 | inline static double setTolerance( double tol );
|
---|
79 |
|
---|
80 | bool isNear ( const EA & ea, double epsilon = tolerance ) const;
|
---|
81 | double howNear( const EA & ea ) const;
|
---|
82 |
|
---|
83 | // ---------- I/O:
|
---|
84 |
|
---|
85 | friend std::ostream & operator<<( std::ostream & os, const EA & ea );
|
---|
86 | friend std::istream & operator>>( std::istream & is, EA & ea );
|
---|
87 |
|
---|
88 | // ---------- Helper methods:
|
---|
89 |
|
---|
90 | protected:
|
---|
91 | double distance( const HepEulerAngles & ex ) const;
|
---|
92 |
|
---|
93 | // ---------- Data members:
|
---|
94 | protected:
|
---|
95 | double phi_;
|
---|
96 | double theta_;
|
---|
97 | double psi_;
|
---|
98 |
|
---|
99 | }; // HepEulerAngles
|
---|
100 |
|
---|
101 | } // namespace CLHEP
|
---|
102 |
|
---|
103 |
|
---|
104 | namespace zmpv {
|
---|
105 |
|
---|
106 | typedef CLHEP::HepEulerAngles EulerAngles;
|
---|
107 |
|
---|
108 | } // end of namespace zmpv
|
---|
109 |
|
---|
110 | #define EULERANGLES_ICC
|
---|
111 | #include "CLHEP/Vector/EulerAngles.icc"
|
---|
112 | #undef EULERANGLES_ICC
|
---|
113 |
|
---|
114 | #ifdef ENABLE_BACKWARDS_COMPATIBILITY
|
---|
115 | // backwards compatibility will be enabled ONLY in CLHEP 1.9
|
---|
116 | using namespace CLHEP;
|
---|
117 | #endif
|
---|
118 |
|
---|
119 |
|
---|
120 | #endif // EULERANGLES_H
|
---|