Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
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 39 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 27 of file RotationX.cc.

27 :
28 its_d(proper(ddelta)), its_s(std::sin(ddelta)), its_c(std::cos(ddelta))
29{}
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(), and 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 109 of file RotationX.cc.

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

◆ decompose() [2/4]

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

Definition at line 103 of file RotationX.cc.

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

◆ decompose() [3/4]

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

Definition at line 121 of file RotationX.cc.

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

◆ decompose() [4/4]

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

Definition at line 115 of file RotationX.cc.

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

◆ delta()

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

◆ distance2() [1/4]

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

Definition at line 150 of file RotationX.cc.

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

◆ distance2() [2/4]

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

Definition at line 140 of file RotationX.cc.

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

◆ distance2() [3/4]

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

Definition at line 132 of file RotationX.cc.

132 {
133 double sum = r.xx() +
134 yy() * r.yy() + yz() * r.yz()
135 + zy() * r.zy() + zz() * r.zz();
136 double answer = 3.0 - sum;
137 return (answer >= 0 ) ? answer : 0;
138}
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 127 of file RotationX.cc.

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

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

◆ eulerAngles()

HepEulerAngles CLHEP::HepRotationX::eulerAngles ( ) const

Definition at line 58 of file RotationX.cc.

58 {
59 return HepEulerAngles( phi(), theta(), psi() );
60} // HepRotationX::eulerAngles()
double psi() const
Definition RotationX.cc:50
double phi() const
Definition RotationX.cc:38
double theta() const
Definition RotationX.cc:46

◆ 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 160 of file RotationX.cc.

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

◆ howNear() [2/4]

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

Definition at line 163 of file RotationX.cc.

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

◆ howNear() [3/4]

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

Definition at line 157 of file RotationX.cc.

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

◆ howNear() [4/4]

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

Definition at line 154 of file RotationX.cc.

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

◆ 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 172 of file RotationX.cc.

172 {
173 return (distance2(lt) <= epsilon*epsilon);
174}
G4double epsilon(G4double density, G4double temperature)

◆ isNear() [2/4]

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

Definition at line 176 of file RotationX.cc.

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

◆ isNear() [3/4]

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

Definition at line 169 of file RotationX.cc.

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

◆ isNear() [4/4]

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

Definition at line 166 of file RotationX.cc.

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

◆ norm2()

double CLHEP::HepRotationX::norm2 ( ) const

Definition at line 181 of file RotationX.cc.

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

◆ 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 38 of file RotationX.cc.

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

Referenced by eulerAngles().

◆ phiX()

double CLHEP::HepRotationX::phiX ( ) const

Definition at line 70 of file RotationX.cc.

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

◆ phiY()

double CLHEP::HepRotationX::phiY ( ) const

Definition at line 75 of file RotationX.cc.

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

◆ phiZ()

double CLHEP::HepRotationX::phiZ ( ) const

Definition at line 80 of file RotationX.cc.

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

◆ print()

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

Definition at line 185 of file RotationX.cc.

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

◆ proper()

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

Referenced by set().

◆ psi()

double CLHEP::HepRotationX::psi ( ) const

Definition at line 50 of file RotationX.cc.

50 {
51 if ( (its_d > 0) && (its_d < CLHEP::pi) ) {
52 return CLHEP::pi;
53 } else {
54 return 0.0;
55 }
56} // 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 31 of file RotationX.cc.

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

Referenced by setDelta().

◆ setDelta()

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

Definition at line 99 of file RotationX.cc.

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

◆ setTolerance()

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

◆ theta()

double CLHEP::HepRotationX::theta ( ) const

Definition at line 46 of file RotationX.cc.

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

Referenced by eulerAngles().

◆ thetaX()

double CLHEP::HepRotationX::thetaX ( ) const

Definition at line 85 of file RotationX.cc.

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

◆ thetaY()

double CLHEP::HepRotationX::thetaY ( ) const

Definition at line 90 of file RotationX.cc.

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

◆ thetaZ()

double CLHEP::HepRotationX::thetaZ ( ) const

Definition at line 94 of file RotationX.cc.

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

◆ 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 Symbol Documentation

◆ inverseOf

HepRotationX inverseOf ( const HepRotationX & r)
friend

Member Data Documentation

◆ its_c

double CLHEP::HepRotationX::its_c
protected

Definition at line 262 of file RotationX.h.

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

◆ its_d

double CLHEP::HepRotationX::its_d
protected

Definition at line 258 of file RotationX.h.

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

◆ its_s

double CLHEP::HepRotationX::its_s
protected

Definition at line 261 of file RotationX.h.

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


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