Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 38 of file EulerAngles.h.

Member Typedef Documentation

◆ EA

Definition at line 41 of file EulerAngles.h.

Constructor & Destructor Documentation

◆ HepEulerAngles() [1/2]

CLHEP::HepEulerAngles::HepEulerAngles ( )
inline

Referenced by operator<<, operator>>, and setTolerance().

◆ HepEulerAngles() [2/2]

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

Member Function Documentation

◆ compare()

int CLHEP::HepEulerAngles::compare ( const EA & ea) const
inline

◆ distance()

double CLHEP::HepEulerAngles::distance ( const HepEulerAngles & ex) const
protected

Definition at line 65 of file EulerAngles.cc.

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

Referenced by howNear(), and isNear().

◆ getPhi()

double CLHEP::HepEulerAngles::getPhi ( ) const
inline

◆ getPsi()

double CLHEP::HepEulerAngles::getPsi ( ) const
inline

◆ getTheta()

double CLHEP::HepEulerAngles::getTheta ( ) const
inline

◆ getTolerance()

double CLHEP::HepEulerAngles::getTolerance ( )
inlinestatic

◆ howNear()

double CLHEP::HepEulerAngles::howNear ( const EA & ea) const

Definition at line 91 of file EulerAngles.cc.

91 {
92
93 return std::sqrt( distance( ex ) );
94
95} // HepEulerAngles::howNear()
double distance(const HepEulerAngles &ex) const

◆ isNear()

bool CLHEP::HepEulerAngles::isNear ( const EA & ea,
double epsilon = tolerance ) const

Definition at line 84 of file EulerAngles.cc.

84 {
85
86 return distance( ex ) <= epsilon*epsilon ;
87
88} // HepEulerAngles::isNear()
G4double epsilon(G4double density, G4double temperature)

◆ operator!=()

bool CLHEP::HepEulerAngles::operator!= ( const EA & ea) const
inline

◆ operator<()

bool CLHEP::HepEulerAngles::operator< ( const EA & ea) const
inline

◆ operator<=()

bool CLHEP::HepEulerAngles::operator<= ( const EA & ea) const
inline

◆ operator==()

bool CLHEP::HepEulerAngles::operator== ( const EA & ea) const
inline

◆ operator>()

bool CLHEP::HepEulerAngles::operator> ( const EA & ea) const
inline

◆ operator>=()

bool CLHEP::HepEulerAngles::operator>= ( const EA & ea) const
inline

◆ phi()

◆ psi()

◆ set()

EA & CLHEP::HepEulerAngles::set ( double phi,
double theta,
double psi )
inline

Referenced by operator>>.

◆ setPhi()

EA & CLHEP::HepEulerAngles::setPhi ( double phi)
inline

◆ setPsi()

EA & CLHEP::HepEulerAngles::setPsi ( double psi)
inline

◆ setTheta()

EA & CLHEP::HepEulerAngles::setTheta ( double theta)
inline

◆ setTolerance()

double CLHEP::HepEulerAngles::setTolerance ( double tol)
inlinestatic

◆ theta()

double CLHEP::HepEulerAngles::theta ( ) const
inline

◆ operator<<

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

Definition at line 101 of file EulerAngles.cc.

102{
103 os << "(" << ea.phi() << ", " << ea.theta() << ", " << ea.psi() << ")";
104 return os;
105} // operator<<()

◆ operator>>

std::istream & operator>> ( std::istream & is,
EA & ea )
friend

Definition at line 110 of file EulerAngles.cc.

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

Member Data Documentation

◆ phi_

double CLHEP::HepEulerAngles::phi_
protected

Definition at line 101 of file EulerAngles.h.

◆ psi_

double CLHEP::HepEulerAngles::psi_
protected

Definition at line 103 of file EulerAngles.h.

◆ theta_

double CLHEP::HepEulerAngles::theta_
protected

Definition at line 102 of file EulerAngles.h.

◆ tolerance

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

Definition at line 42 of file EulerAngles.h.

Referenced by setTolerance().


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