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