Geant4-11
EulerAngles.h
Go to the documentation of this file.
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
27namespace CLHEP {
28
29// Declarations of classes and global methods
30class HepEulerAngles;
31std::ostream & operator<<(std::ostream & os, const HepEulerAngles & aa);
32std::istream & operator>>(std::istream & is, HepEulerAngles & aa);
33
39
40protected:
41 typedef HepEulerAngles EA; // just an abbreviation
42 static double tolerance; // to determine relative nearness
43
44public:
45
46 // ---------- Constructors:
48 inline HepEulerAngles( double phi, double theta, double psi );
49
50 // ---------- Destructor, copy constructor, assignment:
51 // use C++ defaults
52
53 // ---------- Accessors:
54
55public:
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
96protected:
97 double distance( const HepEulerAngles & ex ) const;
98
99 // ---------- Data members:
100protected:
101 double phi_;
102 double theta_;
103 double psi_;
104
105}; // HepEulerAngles
106
107} // namespace CLHEP
108
110
111#endif // EULERANGLES_H
G4double epsilon(G4double density, G4double temperature)
bool operator>=(const EA &ea) const
double phi() const
EA & setPhi(double phi)
HepEulerAngles EA
Definition: EulerAngles.h:41
bool operator<=(const EA &ea) const
double getPhi() const
double theta() const
double distance(const HepEulerAngles &ex) const
Definition: EulerAngles.cc:65
double psi() const
bool operator<(const EA &ea) const
static double getTolerance()
friend std::ostream & operator<<(std::ostream &os, const EA &ea)
Definition: EulerAngles.cc:101
EA & setPsi(double psi)
bool operator>(const EA &ea) const
EA & set(double phi, double theta, double psi)
friend std::istream & operator>>(std::istream &is, EA &ea)
Definition: EulerAngles.cc:110
bool operator==(const EA &ea) const
static double setTolerance(double tol)
EA & setTheta(double theta)
static double tolerance
Definition: EulerAngles.h:42
bool operator!=(const EA &ea) const
double getTheta() const
double getPsi() const
double howNear(const EA &ea) const
Definition: EulerAngles.cc:91
HepEulerAngles(double phi, double theta, double psi)
int compare(const EA &ea) const
bool isNear(const EA &ea, double epsilon=tolerance) const
Definition: EulerAngles.cc:84
Definition: DoubConv.h:17
std::istream & operator>>(std::istream &is, HepRandom &dist)
Definition: Random.cc:223
std::ostream & operator<<(std::ostream &os, const HepRandom &dist)
Definition: Random.cc:219