CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
CLHEP::HepRotationX Class Reference

#include <RotationX.h>

Public Member Functions

 HepRotationX ()
 
 HepRotationX (double delta)
 
 HepRotationX (const HepRotationX &orig)
 
 HepRotationX (HepRotationX &&orig)=default
 
HepRotationXoperator= (const HepRotationX &r)
 
HepRotationXoperator= (HepRotationX &&r)=default
 
HepRotationXset (double delta)
 
 ~HepRotationX ()
 
Hep3Vector colX () const
 
Hep3Vector colY () const
 
Hep3Vector colZ () const
 
Hep3Vector rowX () const
 
Hep3Vector rowY () const
 
Hep3Vector rowZ () const
 
double xx () const
 
double xy () const
 
double xz () const
 
double yx () const
 
double yy () const
 
double yz () const
 
double zx () const
 
double zy () const
 
double zz () const
 
HepRep3x3 rep3x3 () const
 
double getPhi () const
 
double getTheta () const
 
double getPsi () const
 
double phi () const
 
double theta () const
 
double psi () const
 
HepEulerAngles eulerAngles () const
 
double getDelta () const
 
Hep3Vector getAxis () const
 
double delta () const
 
Hep3Vector axis () const
 
HepAxisAngle axisAngle () const
 
void getAngleAxis (double &delta, Hep3Vector &axis) const
 
double phiX () const
 
double phiY () const
 
double phiZ () const
 
double thetaX () const
 
double thetaY () const
 
double thetaZ () const
 
HepLorentzVector col1 () const
 
HepLorentzVector col2 () const
 
HepLorentzVector col3 () const
 
HepLorentzVector col4 () const
 
HepLorentzVector row1 () const
 
HepLorentzVector row2 () const
 
HepLorentzVector row3 () const
 
HepLorentzVector row4 () const
 
double xt () const
 
double yt () const
 
double zt () const
 
double tx () const
 
double ty () const
 
double tz () const
 
double tt () const
 
HepRep4x4 rep4x4 () const
 
void setDelta (double delta)
 
void decompose (HepAxisAngle &rotation, Hep3Vector &boost) const
 
void decompose (Hep3Vector &boost, HepAxisAngle &rotation) const
 
void decompose (HepRotation &rotation, HepBoost &boost) const
 
void decompose (HepBoost &boost, HepRotation &rotation) const
 
bool isIdentity () const
 
int compare (const HepRotationX &r) const
 
bool operator== (const HepRotationX &r) const
 
bool operator!= (const HepRotationX &r) const
 
bool operator< (const HepRotationX &r) const
 
bool operator> (const HepRotationX &r) const
 
bool operator<= (const HepRotationX &r) const
 
bool operator>= (const HepRotationX &r) const
 
double distance2 (const HepRotationX &r) const
 
double distance2 (const HepRotation &r) const
 
double howNear (const HepRotationX &r) const
 
double howNear (const HepRotation &r) const
 
bool isNear (const HepRotationX &r, double epsilon=Hep4RotationInterface::tolerance) const
 
bool isNear (const HepRotation &r, double epsilon=Hep4RotationInterface::tolerance) const
 
double distance2 (const HepBoost &lt) const
 
double distance2 (const HepLorentzRotation &lt) const
 
double howNear (const HepBoost &lt) const
 
double howNear (const HepLorentzRotation &lt) const
 
bool isNear (const HepBoost &lt, double epsilon=Hep4RotationInterface::tolerance) const
 
bool isNear (const HepLorentzRotation &lt, double epsilon=Hep4RotationInterface::tolerance) const
 
double norm2 () const
 
void rectify ()
 
Hep3Vector operator() (const Hep3Vector &p) const
 
Hep3Vector operator* (const Hep3Vector &p) const
 
HepLorentzVector operator() (const HepLorentzVector &w) const
 
HepLorentzVector operator* (const HepLorentzVector &w) const
 
HepRotationX operator* (const HepRotationX &rx) const
 
HepRotationXoperator*= (const HepRotationX &r)
 
HepRotationXtransform (const HepRotationX &r)
 
HepRotationX inverse () const
 
HepRotationXinvert ()
 
std::ostream & print (std::ostream &os) const
 

Static Public Member Functions

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

Protected Member Functions

 HepRotationX (double dd, double ss, double cc)
 

Static Protected Member Functions

static double proper (double delta)
 

Protected Attributes

double its_d
 
double its_s
 
double its_c
 

Friends

HepRotationX inverseOf (const HepRotationX &r)
 

Detailed Description

Author

Definition at line 40 of file RotationX.h.

Constructor & Destructor Documentation

◆ HepRotationX() [1/5]

CLHEP::HepRotationX::HepRotationX ( )
inline

◆ HepRotationX() [2/5]

CLHEP::HepRotationX::HepRotationX ( double  delta)

Definition at line 28 of file RotationX.cc.

28 :
29 its_d(proper(ddelta)), its_s(std::sin(ddelta)), its_c(std::cos(ddelta))
30{}
static double proper(double delta)

◆ HepRotationX() [3/5]

CLHEP::HepRotationX::HepRotationX ( const HepRotationX orig)
inline

◆ HepRotationX() [4/5]

CLHEP::HepRotationX::HepRotationX ( HepRotationX &&  orig)
inlinedefault

◆ ~HepRotationX()

CLHEP::HepRotationX::~HepRotationX ( )
inline

◆ HepRotationX() [5/5]

CLHEP::HepRotationX::HepRotationX ( double  dd,
double  ss,
double  cc 
)
inlineprotected

Member Function Documentation

◆ axis()

Hep3Vector CLHEP::HepRotationX::axis ( ) const
inline

◆ axisAngle()

HepAxisAngle CLHEP::HepRotationX::axisAngle ( ) const
inline

Referenced by decompose().

◆ col1()

HepLorentzVector CLHEP::HepRotationX::col1 ( ) const
inline

◆ col2()

HepLorentzVector CLHEP::HepRotationX::col2 ( ) const
inline

◆ col3()

HepLorentzVector CLHEP::HepRotationX::col3 ( ) const
inline

◆ col4()

HepLorentzVector CLHEP::HepRotationX::col4 ( ) const
inline

◆ colX()

Hep3Vector CLHEP::HepRotationX::colX ( ) const
inline

◆ colY()

Hep3Vector CLHEP::HepRotationX::colY ( ) const
inline

◆ colZ()

Hep3Vector CLHEP::HepRotationX::colZ ( ) const
inline

◆ compare()

int CLHEP::HepRotationX::compare ( const HepRotationX r) const
inline

◆ decompose() [1/4]

void CLHEP::HepRotationX::decompose ( Hep3Vector boost,
HepAxisAngle rotation 
) const

Definition at line 110 of file RotationX.cc.

111 {
112 boost.set(0,0,0);
113 rotation = axisAngle();
114}
HepAxisAngle axisAngle() const

◆ decompose() [2/4]

void CLHEP::HepRotationX::decompose ( HepAxisAngle rotation,
Hep3Vector boost 
) const

Definition at line 104 of file RotationX.cc.

105 {
106 boost.set(0,0,0);
107 rotation = axisAngle();
108}

◆ decompose() [3/4]

void CLHEP::HepRotationX::decompose ( HepBoost boost,
HepRotation rotation 
) const

Definition at line 122 of file RotationX.cc.

123 {
124 boost.set(0,0,0);
125 rotation = HepRotation(*this);
126}

◆ decompose() [4/4]

void CLHEP::HepRotationX::decompose ( HepRotation rotation,
HepBoost boost 
) const

Definition at line 116 of file RotationX.cc.

117 {
118 boost.set(0,0,0);
119 rotation = HepRotation(*this);
120}

◆ delta()

double CLHEP::HepRotationX::delta ( ) const
inline

◆ distance2() [1/4]

double CLHEP::HepRotationX::distance2 ( const HepBoost lt) const

Definition at line 151 of file RotationX.cc.

151 {
152 return distance2( HepLorentzRotation(lt));
153}
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:128

◆ distance2() [2/4]

double CLHEP::HepRotationX::distance2 ( const HepLorentzRotation lt) const

Definition at line 141 of file RotationX.cc.

141 {
142 HepAxisAngle a;
143 Hep3Vector b;
144 lt.decompose(b, a);
145 double bet = b.beta();
146 double bet2 = bet*bet;
147 HepRotation r(a);
148 return bet2/(1-bet2) + distance2(r);
149}

◆ distance2() [3/4]

double CLHEP::HepRotationX::distance2 ( const HepRotation r) const

Definition at line 133 of file RotationX.cc.

133 {
134 double sum = r.xx() +
135 yy() * r.yy() + yz() * r.yz()
136 + zy() * r.zy() + zz() * r.zz();
137 double answer = 3.0 - sum;
138 return (answer >= 0 ) ? answer : 0;
139}
double yz() const
double zy() const
double yy() const
double zz() const

◆ distance2() [4/4]

double CLHEP::HepRotationX::distance2 ( const HepRotationX r) const

Definition at line 128 of file RotationX.cc.

128 {
129 double answer = 2.0 * ( 1.0 - ( its_s * r.its_s + its_c * r.its_c ) ) ;
130 return (answer >= 0) ? answer : 0;
131}

Referenced by distance2(), howNear(), and isNear().

◆ eulerAngles()

HepEulerAngles CLHEP::HepRotationX::eulerAngles ( ) const

Definition at line 59 of file RotationX.cc.

59 {
60 return HepEulerAngles( phi(), theta(), psi() );
61} // HepRotationX::eulerAngles()
double psi() const
Definition: RotationX.cc:51
double phi() const
Definition: RotationX.cc:39
double theta() const
Definition: RotationX.cc:47

◆ getAngleAxis()

void CLHEP::HepRotationX::getAngleAxis ( double delta,
Hep3Vector axis 
) const
inline

◆ getAxis()

Hep3Vector CLHEP::HepRotationX::getAxis ( ) const
inline

◆ getDelta()

double CLHEP::HepRotationX::getDelta ( ) const
inline

◆ getPhi()

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

◆ getPsi()

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

◆ getTheta()

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

◆ getTolerance()

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

◆ howNear() [1/4]

double CLHEP::HepRotationX::howNear ( const HepBoost lt) const

Definition at line 161 of file RotationX.cc.

161 {
162 return std::sqrt(distance2(b));
163}

◆ howNear() [2/4]

double CLHEP::HepRotationX::howNear ( const HepLorentzRotation lt) const

Definition at line 164 of file RotationX.cc.

164 {
165 return std::sqrt(distance2(lt));
166}

◆ howNear() [3/4]

double CLHEP::HepRotationX::howNear ( const HepRotation r) const

Definition at line 158 of file RotationX.cc.

158 {
159 return std::sqrt(distance2(r));
160}

◆ howNear() [4/4]

double CLHEP::HepRotationX::howNear ( const HepRotationX r) const

Definition at line 155 of file RotationX.cc.

155 {
156 return std::sqrt(distance2(r));
157}

◆ inverse()

HepRotationX CLHEP::HepRotationX::inverse ( ) const
inline

◆ invert()

HepRotationX & CLHEP::HepRotationX::invert ( )
inline

◆ isIdentity()

bool CLHEP::HepRotationX::isIdentity ( ) const
inline

◆ isNear() [1/4]

bool CLHEP::HepRotationX::isNear ( const HepBoost lt,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 173 of file RotationX.cc.

173 {
174 return (distance2(lt) <= epsilon*epsilon);
175}

◆ isNear() [2/4]

bool CLHEP::HepRotationX::isNear ( const HepLorentzRotation lt,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 177 of file RotationX.cc.

178 {
179 return (distance2(lt) <= epsilon*epsilon);
180}

◆ isNear() [3/4]

bool CLHEP::HepRotationX::isNear ( const HepRotation r,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 170 of file RotationX.cc.

170 {
171 return (distance2(r) <= epsilon*epsilon);
172}

◆ isNear() [4/4]

bool CLHEP::HepRotationX::isNear ( const HepRotationX r,
double  epsilon = Hep4RotationInterface::tolerance 
) const

Definition at line 167 of file RotationX.cc.

167 {
168 return (distance2(r) <= epsilon*epsilon);
169}

◆ norm2()

double CLHEP::HepRotationX::norm2 ( ) const

Definition at line 182 of file RotationX.cc.

182 {
183 return 2.0 - 2.0 * its_c;
184}

◆ operator!=()

bool CLHEP::HepRotationX::operator!= ( const HepRotationX r) const
inline

◆ operator()() [1/2]

Hep3Vector CLHEP::HepRotationX::operator() ( const Hep3Vector p) const
inline

◆ operator()() [2/2]

HepLorentzVector CLHEP::HepRotationX::operator() ( const HepLorentzVector w) const
inline

◆ operator*() [1/3]

Hep3Vector CLHEP::HepRotationX::operator* ( const Hep3Vector p) const
inline

◆ operator*() [2/3]

HepLorentzVector CLHEP::HepRotationX::operator* ( const HepLorentzVector w) const
inline

◆ operator*() [3/3]

HepRotationX CLHEP::HepRotationX::operator* ( const HepRotationX rx) const
inline

◆ operator*=()

HepRotationX & CLHEP::HepRotationX::operator*= ( const HepRotationX r)
inline

◆ operator<()

bool CLHEP::HepRotationX::operator< ( const HepRotationX r) const
inline

◆ operator<=()

bool CLHEP::HepRotationX::operator<= ( const HepRotationX r) const
inline

◆ operator=() [1/2]

HepRotationX & CLHEP::HepRotationX::operator= ( const HepRotationX r)
inline

◆ operator=() [2/2]

HepRotationX & CLHEP::HepRotationX::operator= ( HepRotationX &&  r)
inlinedefault

◆ operator==()

bool CLHEP::HepRotationX::operator== ( const HepRotationX r) const
inline

◆ operator>()

bool CLHEP::HepRotationX::operator> ( const HepRotationX r) const
inline

◆ operator>=()

bool CLHEP::HepRotationX::operator>= ( const HepRotationX r) const
inline

◆ phi()

double CLHEP::HepRotationX::phi ( ) const

Definition at line 39 of file RotationX.cc.

39 {
40 if ( (its_d > 0) && (its_d < CLHEP::pi) ) {
41 return CLHEP::pi;
42 } else {
43 return 0.0;
44 }
45} // HepRotationX::phi()

Referenced by eulerAngles().

◆ phiX()

double CLHEP::HepRotationX::phiX ( ) const

Definition at line 71 of file RotationX.cc.

71 {
72 return (yx() == 0.0 && xx() == 0.0) ? 0.0 : std::atan2(yx(),xx());
73 // or ---- return 0;
74}
double xx() const
double yx() const

◆ phiY()

double CLHEP::HepRotationX::phiY ( ) const

Definition at line 76 of file RotationX.cc.

76 {
77 return (yy() == 0.0 && xy() == 0.0) ? 0.0 : std::atan2(yy(),xy());
78 // or ---- return (yy() == 0.0) ? 0.0 : std::atan2(yy(),xy());
79}
double xy() const

◆ phiZ()

double CLHEP::HepRotationX::phiZ ( ) const

Definition at line 81 of file RotationX.cc.

81 {
82 return (yz() == 0.0 && xz() == 0.0) ? 0.0 : std::atan2(yz(),xz());
83 // or ---- return (yz() == 0.0) ? 0.0 : std::atan2(yz(),xz());
84}
double xz() const

◆ print()

std::ostream & CLHEP::HepRotationX::print ( std::ostream &  os) const

Definition at line 186 of file RotationX.cc.

186 {
187 os << "\nRotation about X (" << its_d <<
188 ") [cos d = " << its_c << " sin d = " << its_s << "]\n";
189 return os;
190}

◆ proper()

static double CLHEP::HepRotationX::proper ( double  delta)
inlinestaticprotected

Referenced by set().

◆ psi()

double CLHEP::HepRotationX::psi ( ) const

Definition at line 51 of file RotationX.cc.

51 {
52 if ( (its_d > 0) && (its_d < CLHEP::pi) ) {
53 return CLHEP::pi;
54 } else {
55 return 0.0;
56 }
57} // HepRotationX::psi()

Referenced by eulerAngles().

◆ rectify()

void CLHEP::HepRotationX::rectify ( )
inline

◆ rep3x3()

HepRep3x3 CLHEP::HepRotationX::rep3x3 ( ) const
inline

◆ rep4x4()

HepRep4x4 CLHEP::HepRotationX::rep4x4 ( ) const
inline

◆ row1()

HepLorentzVector CLHEP::HepRotationX::row1 ( ) const
inline

◆ row2()

HepLorentzVector CLHEP::HepRotationX::row2 ( ) const
inline

◆ row3()

HepLorentzVector CLHEP::HepRotationX::row3 ( ) const
inline

◆ row4()

HepLorentzVector CLHEP::HepRotationX::row4 ( ) const
inline

◆ rowX()

Hep3Vector CLHEP::HepRotationX::rowX ( ) const
inline

◆ rowY()

Hep3Vector CLHEP::HepRotationX::rowY ( ) const
inline

◆ rowZ()

Hep3Vector CLHEP::HepRotationX::rowZ ( ) const
inline

◆ set()

HepRotationX & CLHEP::HepRotationX::set ( double  delta)

Definition at line 32 of file RotationX.cc.

32 {
33 its_d = proper(ddelta);
34 its_s = std::sin(its_d);
35 its_c = std::cos(its_d);
36 return *this;
37}

Referenced by setDelta().

◆ setDelta()

void CLHEP::HepRotationX::setDelta ( double  delta)

Definition at line 100 of file RotationX.cc.

100 {
101 set(ddelta);
102}
HepRotationX & set(double delta)
Definition: RotationX.cc:32

◆ setTolerance()

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

◆ theta()

double CLHEP::HepRotationX::theta ( ) const

Definition at line 47 of file RotationX.cc.

47 {
48 return std::fabs( its_d );
49} // HepRotationX::theta()

Referenced by eulerAngles().

◆ thetaX()

double CLHEP::HepRotationX::thetaX ( ) const

Definition at line 86 of file RotationX.cc.

86 {
87 return safe_acos(zx());
88 // or ---- return CLHEP::halfpi;
89}
double zx() const

◆ thetaY()

double CLHEP::HepRotationX::thetaY ( ) const

Definition at line 91 of file RotationX.cc.

91 {
92 return safe_acos(zy());
93}

◆ thetaZ()

double CLHEP::HepRotationX::thetaZ ( ) const

Definition at line 95 of file RotationX.cc.

95 {
96 return safe_acos(zz());
97 // or ---- return d;
98}

◆ transform()

HepRotationX & CLHEP::HepRotationX::transform ( const HepRotationX r)
inline

◆ tt()

double CLHEP::HepRotationX::tt ( ) const
inline

◆ tx()

double CLHEP::HepRotationX::tx ( ) const
inline

◆ ty()

double CLHEP::HepRotationX::ty ( ) const
inline

◆ tz()

double CLHEP::HepRotationX::tz ( ) const
inline

◆ xt()

double CLHEP::HepRotationX::xt ( ) const
inline

◆ xx()

double CLHEP::HepRotationX::xx ( ) const
inline

Referenced by phiX().

◆ xy()

double CLHEP::HepRotationX::xy ( ) const
inline

Referenced by phiY().

◆ xz()

double CLHEP::HepRotationX::xz ( ) const
inline

Referenced by phiZ().

◆ yt()

double CLHEP::HepRotationX::yt ( ) const
inline

◆ yx()

double CLHEP::HepRotationX::yx ( ) const
inline

Referenced by phiX().

◆ yy()

double CLHEP::HepRotationX::yy ( ) const
inline

Referenced by distance2(), and phiY().

◆ yz()

double CLHEP::HepRotationX::yz ( ) const
inline

Referenced by distance2(), and phiZ().

◆ zt()

double CLHEP::HepRotationX::zt ( ) const
inline

◆ zx()

double CLHEP::HepRotationX::zx ( ) const
inline

Referenced by thetaX().

◆ zy()

double CLHEP::HepRotationX::zy ( ) const
inline

Referenced by distance2(), and thetaY().

◆ zz()

double CLHEP::HepRotationX::zz ( ) const
inline

Referenced by distance2(), and thetaZ().

Friends And Related Function Documentation

◆ inverseOf

HepRotationX inverseOf ( const HepRotationX r)
friend

Member Data Documentation

◆ its_c

double CLHEP::HepRotationX::its_c
protected

Definition at line 263 of file RotationX.h.

Referenced by distance2(), norm2(), print(), and set().

◆ its_d

double CLHEP::HepRotationX::its_d
protected

Definition at line 259 of file RotationX.h.

Referenced by phi(), print(), psi(), set(), and theta().

◆ its_s

double CLHEP::HepRotationX::its_s
protected

Definition at line 262 of file RotationX.h.

Referenced by distance2(), print(), and set().


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