Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
CLHEP::HepEulerAngles Class Reference

#include <EulerAngles.h>

Public Member Functions

 HepEulerAngles ()
 
 HepEulerAngles (double phi, double theta, double psi)
 
double getPhi () const
 
double phi () const
 
EAsetPhi (double phi)
 
double getTheta () const
 
double theta () const
 
EAsetTheta (double theta)
 
double getPsi () const
 
double psi () const
 
EAsetPsi (double psi)
 
EAset (double phi, double theta, double psi)
 
int compare (const EA &ea) const
 
bool operator== (const EA &ea) const
 
bool operator!= (const EA &ea) const
 
bool operator< (const EA &ea) const
 
bool operator<= (const EA &ea) const
 
bool operator> (const EA &ea) const
 
bool operator>= (const EA &ea) const
 
bool isNear (const EA &ea, double epsilon=tolerance) const
 
double howNear (const EA &ea) const
 

Static Public Member Functions

static double getTolerance ()
 
static double setTolerance (double tol)
 

Protected Types

typedef HepEulerAngles EA
 

Protected Member Functions

double distance (const HepEulerAngles &ex) const
 

Protected Attributes

double phi_
 
double theta_
 
double psi_
 

Static Protected Attributes

static double tolerance = Hep3Vector::ToleranceTicks * 1.0e-8
 

Friends

std::ostream & operator<< (std::ostream &os, const EA &ea)
 
std::istream & operator>> (std::istream &is, EA &ea)
 

Detailed Description

Author

Definition at line 39 of file EulerAngles.h.

Member Typedef Documentation

Definition at line 42 of file EulerAngles.h.

Constructor & Destructor Documentation

CLHEP::HepEulerAngles::HepEulerAngles ( )
inline
CLHEP::HepEulerAngles::HepEulerAngles ( double  phi,
double  theta,
double  psi 
)
inline

Member Function Documentation

int CLHEP::HepEulerAngles::compare ( const EA ea) const
inline
double CLHEP::HepEulerAngles::distance ( const HepEulerAngles ex) const
protected

Definition at line 64 of file EulerAngles.cc.

Referenced by howNear(), and isNear().

64  {
65 
66  double thisRep[9];
67  double exRep[9];
68 
69  ZMpvEulerAnglesRep ( *this, thisRep );
70  ZMpvEulerAnglesRep ( ex, exRep );
71 
72  double sum = 0.0;
73  for (int i = 0; i < 9; i++) {
74  sum += thisRep[i] * exRep[i];
75  }
76 
77  double d = 3.0 - sum; // NaN-proofing:
78  return (d >= 0) ? d : 0; // sqrt(distance) is used in howNear()
79 
80 } // HepEulerAngles::distance()
double CLHEP::HepEulerAngles::getPhi ( ) const
inline
double CLHEP::HepEulerAngles::getPsi ( ) const
inline
double CLHEP::HepEulerAngles::getTheta ( ) const
inline
static double CLHEP::HepEulerAngles::getTolerance ( )
inlinestatic
double CLHEP::HepEulerAngles::howNear ( const EA ea) const

Definition at line 90 of file EulerAngles.cc.

References distance().

90  {
91 
92  return std::sqrt( distance( ex ) );
93 
94 } // HepEulerAngles::howNear()
double distance(const HepEulerAngles &ex) const
Definition: EulerAngles.cc:64
bool CLHEP::HepEulerAngles::isNear ( const EA ea,
double  epsilon = tolerance 
) const

Definition at line 83 of file EulerAngles.cc.

References distance().

83  {
84 
85  return distance( ex ) <= epsilon*epsilon ;
86 
87 } // HepEulerAngles::isNear()
double distance(const HepEulerAngles &ex) const
Definition: EulerAngles.cc:64
bool CLHEP::HepEulerAngles::operator!= ( const EA ea) const
inline
bool CLHEP::HepEulerAngles::operator< ( const EA ea) const
inline
bool CLHEP::HepEulerAngles::operator<= ( const EA ea) const
inline
bool CLHEP::HepEulerAngles::operator== ( const EA ea) const
inline
bool CLHEP::HepEulerAngles::operator> ( const EA ea) const
inline
bool CLHEP::HepEulerAngles::operator>= ( const EA ea) const
inline
double CLHEP::HepEulerAngles::phi ( ) const
inline
double CLHEP::HepEulerAngles::psi ( ) const
inline
EA& CLHEP::HepEulerAngles::set ( double  phi,
double  theta,
double  psi 
)
inline

Referenced by CLHEP::operator>>().

EA& CLHEP::HepEulerAngles::setPhi ( double  phi)
inline
EA& CLHEP::HepEulerAngles::setPsi ( double  psi)
inline
EA& CLHEP::HepEulerAngles::setTheta ( double  theta)
inline
static double CLHEP::HepEulerAngles::setTolerance ( double  tol)
inlinestatic
double CLHEP::HepEulerAngles::theta ( ) const
inline

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const EA ea 
)
friend

Definition at line 100 of file EulerAngles.cc.

101 {
102  os << "(" << ea.phi() << ", " << ea.theta() << ", " << ea.psi() << ")";
103  return os;
104 } // operator<<()
std::istream& operator>> ( std::istream &  is,
EA ea 
)
friend

Definition at line 109 of file EulerAngles.cc.

109  {
110  double thePhi;
111  double theTheta;
112  double thePsi;
113  ZMinput3doubles ( is, "HepEulerAngle", thePhi , theTheta , thePsi );
114  ea.set ( thePhi , theTheta , thePsi );
115  return is;
116 } // operator>>()
void ZMinput3doubles(std::istream &is, const char *type, double &x, double &y, double &z)
Definition: ZMinput.cc:42

Field Documentation

double CLHEP::HepEulerAngles::phi_
protected

Definition at line 102 of file EulerAngles.h.

double CLHEP::HepEulerAngles::psi_
protected

Definition at line 104 of file EulerAngles.h.

double CLHEP::HepEulerAngles::theta_
protected

Definition at line 103 of file EulerAngles.h.

double CLHEP::HepEulerAngles::tolerance = Hep3Vector::ToleranceTicks * 1.0e-8
staticprotected

Definition at line 43 of file EulerAngles.h.


The documentation for this class was generated from the following files: