ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EulerAngles.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EulerAngles.h
1 // -*- C++ -*-
2 // CLASSDOC OFF
3 // ---------------------------------------------------------------------------
4 // CLASSDOC ON
5 //
6 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
7 //
8 // ----------------------------------------------------------------------
9 //
10 // EulerAngles.h EulerAngles class --
11 // Support class for PhysicsVectors classes
12 //
13 // History:
14 // 09-Jan-1998 WEB FixedTypes is now found in ZMutility
15 // 12-Jan-1998 WEB PI is now found in ZMutility
16 // 15-Jun-1998 WEB Added namespace support
17 // 02-May-2000 WEB No global using
18 // 26-Jul-2000 MF CLHEP version
19 //
20 // ----------------------------------------------------------------------
21 
22 #ifndef HEP_EULERANGLES_H
23 #define HEP_EULERANGLES_H
24 
25 #include <iostream>
26 
27 namespace CLHEP {
28 
29 // Declarations of classes and global methods
30 class HepEulerAngles;
31 std::ostream & operator<<(std::ostream & os, const HepEulerAngles & aa);
32 std::istream & operator>>(std::istream & is, HepEulerAngles & aa);
33 
39 
40 protected:
41  typedef HepEulerAngles EA; // just an abbreviation
42  static double tolerance; // to determine relative nearness
43 
44 public:
45 
46  // ---------- Constructors:
47  inline HepEulerAngles();
48  inline HepEulerAngles( double phi, double theta, double psi );
49 
50  // ---------- Destructor, copy constructor, assignment:
51  // use C++ defaults
52 
53  // ---------- Accessors:
54 
55 public:
56  inline double getPhi() const;
57  inline double phi() const;
58  inline EA & setPhi( double phi );
59 
60  inline double getTheta() const;
61  inline double theta() const;
62  inline EA & setTheta( double theta );
63 
64  inline double getPsi() const;
65  inline double psi() const;
66  inline EA & setPsi( double psi );
67 
68  inline EA & set( double phi, double theta, double psi );
69 
70  // ---------- Operations:
71 
72  // comparisons:
73  inline int compare ( const EA & ea ) const;
74 
75  inline bool operator==( const EA & ea ) const;
76  inline bool operator!=( const EA & ea ) const;
77  inline bool operator< ( const EA & ea ) const;
78  inline bool operator<=( const EA & ea ) const;
79  inline bool operator> ( const EA & ea ) const;
80  inline bool operator>=( const EA & ea ) const;
81 
82  // relative comparison:
83  inline static double getTolerance();
84  inline static double setTolerance( double tol );
85 
86  bool isNear ( const EA & ea, double epsilon = tolerance ) const;
87  double howNear( const EA & ea ) const;
88 
89  // ---------- I/O:
90 
91  friend std::ostream & operator<<( std::ostream & os, const EA & ea );
92  friend std::istream & operator>>( std::istream & is, EA & ea );
93 
94  // ---------- Helper methods:
95 
96 protected:
97  double distance( const HepEulerAngles & ex ) const;
98 
99  // ---------- Data members:
100 protected:
101  double phi_;
102  double theta_;
103  double psi_;
104 
105 }; // HepEulerAngles
106 
107 } // namespace CLHEP
108 
109 #include "CLHEP/Vector/EulerAngles.icc"
110 
111 #endif // EULERANGLES_H