Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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
28namespace CLHEP {
29
30// Declarations of classes and global methods
31class HepEulerAngles;
32std::ostream & operator<<(std::ostream & os, const HepEulerAngles & aa);
33std::istream & operator>>(std::istream & is, HepEulerAngles & aa);
34
35/**
36 * @author
37 * @ingroup vector
38 */
40
41protected:
42 typedef HepEulerAngles EA; // just an abbreviation
43 static double tolerance; // to determine relative nearness
44
45public:
46
47 // ---------- Constructors:
49 inline HepEulerAngles( double phi, double theta, double psi );
50
51 // ---------- Destructor, copy constructor, assignment:
52 // use C++ defaults
53
54 // ---------- Accessors:
55
56public:
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
97protected:
98 double distance( const HepEulerAngles & ex ) const;
99
100 // ---------- Data members:
101protected:
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
bool operator>=(const EA &ea) const
double phi() const
EA & setPhi(double phi)
HepEulerAngles EA
Definition: EulerAngles.h:42
bool operator<=(const EA &ea) const
double getPhi() const
double theta() const
double distance(const HepEulerAngles &ex) const
Definition: EulerAngles.cc:64
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:100
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:109
bool operator==(const EA &ea) const
static double setTolerance(double tol)
EA & setTheta(double theta)
static double tolerance
Definition: EulerAngles.h:43
bool operator!=(const EA &ea) const
double getTheta() const
double getPsi() const
double howNear(const EA &ea) const
Definition: EulerAngles.cc:90
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:83
Definition: DoubConv.h:17
std::istream & operator>>(std::istream &is, HepRandom &dist)
Definition: Random.cc:120
std::ostream & operator<<(std::ostream &os, const HepRandom &dist)
Definition: Random.cc:116