Geant4 9.6.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 39 of file EulerAngles.h.

Member Typedef Documentation

◆ EA

Definition at line 42 of file EulerAngles.h.

Constructor & Destructor Documentation

◆ HepEulerAngles() [1/2]

CLHEP::HepEulerAngles::HepEulerAngles ( )
inline

◆ 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 64 of file EulerAngles.cc.

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()

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()

static double CLHEP::HepEulerAngles::getTolerance ( )
inlinestatic

◆ howNear()

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

Definition at line 90 of file EulerAngles.cc.

90 {
91
92 return std::sqrt( distance( ex ) );
93
94} // HepEulerAngles::howNear()
double distance(const HepEulerAngles &ex) const
Definition: EulerAngles.cc:64

◆ isNear()

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

Definition at line 83 of file EulerAngles.cc.

83 {
84
85 return distance( ex ) <= epsilon*epsilon ;
86
87} // HepEulerAngles::isNear()

◆ 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()

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

◆ psi()

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

◆ set()

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

◆ 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()

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

◆ theta()

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

Friends And Related Function Documentation

◆ operator<<

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<<()

◆ 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

Member Data Documentation

◆ phi_

double CLHEP::HepEulerAngles::phi_
protected

Definition at line 102 of file EulerAngles.h.

◆ psi_

double CLHEP::HepEulerAngles::psi_
protected

Definition at line 104 of file EulerAngles.h.

◆ theta_

double CLHEP::HepEulerAngles::theta_
protected

Definition at line 103 of file EulerAngles.h.

◆ tolerance

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: