Geant4 9.6.0
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)
 
HepRotationXoperator= (const HepRotationX &r)
 
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 43 of file RotationX.h.

Constructor & Destructor Documentation

◆ HepRotationX() [1/4]

CLHEP::HepRotationX::HepRotationX ( )
inline

◆ HepRotationX() [2/4]

CLHEP::HepRotationX::HepRotationX ( double  delta)

Definition at line 31 of file RotationX.cc.

31 :
32 its_d(proper(ddelta)), its_s(std::sin(ddelta)), its_c(std::cos(ddelta))
33{}
static double proper(double delta)

◆ HepRotationX() [3/4]

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

◆ ~HepRotationX()

CLHEP::HepRotationX::~HepRotationX ( )
inline

◆ HepRotationX() [4/4]

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

114 {
115 boost.set(0,0,0);
116 rotation = axisAngle();
117}
HepAxisAngle axisAngle() const

◆ decompose() [2/4]

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

Definition at line 107 of file RotationX.cc.

108 {
109 boost.set(0,0,0);
110 rotation = axisAngle();
111}

◆ decompose() [3/4]

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

Definition at line 125 of file RotationX.cc.

126 {
127 boost.set(0,0,0);
128 rotation = HepRotation(*this);
129}

◆ decompose() [4/4]

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

Definition at line 119 of file RotationX.cc.

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

◆ delta()

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

◆ distance2() [1/4]

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

Definition at line 154 of file RotationX.cc.

154 {
155 return distance2( HepLorentzRotation(lt));
156}
double distance2(const HepRotationX &r) const
Definition: RotationX.cc:131

◆ distance2() [2/4]

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

Definition at line 144 of file RotationX.cc.

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

◆ distance2() [3/4]

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

Definition at line 136 of file RotationX.cc.

136 {
137 double sum = r.xx() +
138 yy() * r.yy() + yz() * r.yz()
139 + zy() * r.zy() + zz() * r.zz();
140 double answer = 3.0 - sum;
141 return (answer >= 0 ) ? answer : 0;
142}
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 131 of file RotationX.cc.

131 {
132 double answer = 2.0 * ( 1.0 - ( its_s * r.its_s + its_c * r.its_c ) ) ;
133 return (answer >= 0) ? answer : 0;
134}

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

◆ eulerAngles()

HepEulerAngles CLHEP::HepRotationX::eulerAngles ( ) const

Definition at line 62 of file RotationX.cc.

62 {
63 return HepEulerAngles( phi(), theta(), psi() );
64} // HepRotationX::eulerAngles()
double psi() const
Definition: RotationX.cc:54
double phi() const
Definition: RotationX.cc:42
double theta() const
Definition: RotationX.cc:50

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

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

◆ howNear() [2/4]

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

Definition at line 167 of file RotationX.cc.

167 {
168 return std::sqrt(distance2(lt));
169}

◆ howNear() [3/4]

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

Definition at line 161 of file RotationX.cc.

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

◆ howNear() [4/4]

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

Definition at line 158 of file RotationX.cc.

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

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

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

◆ isNear() [2/4]

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

Definition at line 180 of file RotationX.cc.

181 {
182 return (distance2(lt) <= epsilon*epsilon);
183}

◆ isNear() [3/4]

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

Definition at line 173 of file RotationX.cc.

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

◆ isNear() [4/4]

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

Definition at line 170 of file RotationX.cc.

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

◆ norm2()

double CLHEP::HepRotationX::norm2 ( ) const

Definition at line 185 of file RotationX.cc.

185 {
186 return 2.0 - 2.0 * its_c;
187}

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

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

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

◆ phi()

double CLHEP::HepRotationX::phi ( ) const

Definition at line 42 of file RotationX.cc.

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

Referenced by eulerAngles().

◆ phiX()

double CLHEP::HepRotationX::phiX ( ) const

Definition at line 74 of file RotationX.cc.

74 {
75 return (yx() == 0.0 && xx() == 0.0) ? 0.0 : std::atan2(yx(),xx());
76 // or ---- return 0;
77}
double xx() const
double yx() const

◆ phiY()

double CLHEP::HepRotationX::phiY ( ) const

Definition at line 79 of file RotationX.cc.

79 {
80 return (yy() == 0.0 && xy() == 0.0) ? 0.0 : std::atan2(yy(),xy());
81 // or ---- return (yy() == 0.0) ? 0.0 : std::atan2(yy(),xy());
82}
double xy() const

◆ phiZ()

double CLHEP::HepRotationX::phiZ ( ) const

Definition at line 84 of file RotationX.cc.

84 {
85 return (yz() == 0.0 && xz() == 0.0) ? 0.0 : std::atan2(yz(),xz());
86 // or ---- return (yz() == 0.0) ? 0.0 : std::atan2(yz(),xz());
87}
double xz() const

◆ print()

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

Definition at line 189 of file RotationX.cc.

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

◆ proper()

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

Referenced by set().

◆ psi()

double CLHEP::HepRotationX::psi ( ) const

Definition at line 54 of file RotationX.cc.

54 {
55 if ( (its_d > 0) && (its_d < CLHEP::pi) ) {
56 return CLHEP::pi;
57 } else {
58 return 0.0;
59 }
60} // 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 35 of file RotationX.cc.

35 {
36 its_d = proper(ddelta);
37 its_s = std::sin(its_d);
38 its_c = std::cos(its_d);
39 return *this;
40}

Referenced by setDelta().

◆ setDelta()

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

Definition at line 103 of file RotationX.cc.

103 {
104 set(ddelta);
105}
HepRotationX & set(double delta)
Definition: RotationX.cc:35

◆ setTolerance()

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

◆ theta()

double CLHEP::HepRotationX::theta ( ) const

Definition at line 50 of file RotationX.cc.

50 {
51 return std::fabs( its_d );
52} // HepRotationX::theta()

Referenced by eulerAngles().

◆ thetaX()

double CLHEP::HepRotationX::thetaX ( ) const

Definition at line 89 of file RotationX.cc.

89 {
90 return safe_acos(zx());
91 // or ---- return CLHEP::halfpi;
92}
double zx() const

◆ thetaY()

double CLHEP::HepRotationX::thetaY ( ) const

Definition at line 94 of file RotationX.cc.

94 {
95 return safe_acos(zy());
96}

◆ thetaZ()

double CLHEP::HepRotationX::thetaZ ( ) const

Definition at line 98 of file RotationX.cc.

98 {
99 return safe_acos(zz());
100 // or ---- return d;
101}

◆ 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 264 of file RotationX.h.

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

◆ its_d

double CLHEP::HepRotationX::its_d
protected

Definition at line 260 of file RotationX.h.

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

◆ its_s

double CLHEP::HepRotationX::its_s
protected

Definition at line 263 of file RotationX.h.

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


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