CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
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 32 of file EulerAngles.h.

Member Typedef Documentation

◆ EA

Definition at line 35 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 66 of file EulerAngles.cc.

66 {
67
68 double thisRep[9];
69 double exRep[9];
70
71 ZMpvEulerAnglesRep ( *this, thisRep );
72 ZMpvEulerAnglesRep ( ex, exRep );
73
74 double sum = 0.0;
75 for (int i = 0; i < 9; i++) {
76 sum += thisRep[i] * exRep[i];
77 }
78
79 double d = 3.0 - sum; // NaN-proofing:
80 return (d >= 0) ? d : 0; // std::sqrt(distance) is used in howNear()
81
82} // 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 92 of file EulerAngles.cc.

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

◆ isNear()

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

Definition at line 85 of file EulerAngles.cc.

85 {
86
87 return distance( ex ) <= epsilon*epsilon ;
88
89} // 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()

◆ psi()

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

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

◆ operator>>

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

Definition at line 111 of file EulerAngles.cc.

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

Member Data Documentation

◆ phi_

double CLHEP::HepEulerAngles::phi_
protected

Definition at line 95 of file EulerAngles.h.

◆ psi_

double CLHEP::HepEulerAngles::psi_
protected

Definition at line 97 of file EulerAngles.h.

◆ theta_

double CLHEP::HepEulerAngles::theta_
protected

Definition at line 96 of file EulerAngles.h.

◆ tolerance

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

Definition at line 36 of file EulerAngles.h.


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