CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

eulerProb.cc
Go to the documentation of this file.
1 // HepRotatonTest.cc
2 
3 #include <iostream>
4 #include "CLHEP/Units/SystemOfUnits.h"
5 #include "CLHEP/Vector/Rotation.h"
6 
7 using std::cout;
8 using std::endl;
9 using namespace CLHEP;
10 
11 
12 class myRotClass: public HepRotation {
13 public:
14  myRotClass (const HepRotationZ& rot): HepRotation (rot) {;};
15  void setXX (const double& v) {rxx = v;};
16  void setXY (const double& v) {rxy = v;};
17  void setXZ (const double& v) {rxz = v;};
18  void setYX (const double& v) {ryx = v;};
19  void setYY (const double& v) {ryy = v;};
20  void setYZ (const double& v) {ryz = v;};
21  void setZX (const double& v) {rzx = v;};
22  void setZY (const double& v) {rzy = v;};
23  void setZZ (const double& v) {rzz = v;};
24 };
25 
26 
27 int main () {
28  HepRotationZ az (120*deg); // az.set (120*degree);
29  // HepRotation rot (az);
30  myRotClass rot(az);
31 
32  const double corr = 0.9999999999999999;
33  rot.setZZ (corr);
34  // Make sure that det(rot)=1, so that its still a valid rotation
35  // (in principal I would expect that HepRotation should be robust
36  // enough to give reasonable results even without this step since
37  // round off errors in floating point operations could also cause
38  // such a loss of precision).
39  rot.setXX (rot.xx()/std::sqrt(corr)); rot.setXY (rot.xy()/std::sqrt(corr));
40  rot.setYX (rot.yx()/std::sqrt(corr)); rot.setYY (rot.yy()/std::sqrt(corr));
41 
42  cout.setf (std::ios::scientific, std::ios::floatfield);
43  rot.print (cout); cout << "\n";
44  cout.precision (30);
45  cout << rot.xx() << "\t" << rot.xy() << "\t" << rot.xz() << "\n"
46  << rot.yx() << "\t" << rot.yy() << "\t" << rot.yz() << "\n"
47  << rot.zx() << "\t" << rot.zy() << "\t" << rot.zz() << endl;
48  cout << "\nEuler angles:"
49  << "\nphi = " << rot.phi()
50  << "\ttheta = " << rot.theta()
51  << "\tpsi = " << rot.psi()
52  << endl;
53 
54  HepRotation newrot (rot.phi(), rot.theta(), rot.psi());
55  newrot.print(cout);
56 
57  return 0;
58 }
59 
CLHEP::HepRotation::xy
double xy() const
main
int main()
Definition: eulerProb.cc:27
myRotClass::setZZ
void setZZ(const double &v)
Definition: eulerProb.cc:23
CLHEP::HepRotation::print
std::ostream & print(std::ostream &os) const
Definition: RotationIO.cc:22
CLHEP::HepRotation::zy
double zy() const
CLHEP::HepRotation::zx
double zx() const
myRotClass::setYZ
void setYZ(const double &v)
Definition: eulerProb.cc:20
CLHEP::HepRotation::yx
double yx() const
myRotClass::setZX
void setZX(const double &v)
Definition: eulerProb.cc:21
CLHEP::HepRotation
Definition: Geometry/CLHEP/Vector/Rotation.h:48
myRotClass::setYX
void setYX(const double &v)
Definition: eulerProb.cc:18
CLHEP::HepRotation::phi
double phi() const
Definition: RotationE.cc:73
myRotClass::setYY
void setYY(const double &v)
Definition: eulerProb.cc:19
CLHEP
Definition: ClhepVersion.h:13
v
they are gone ZOOM Features Discontinued The following features of the ZOOM package were felt to be extreme overkill These have been after checking that no existing user code was utilizing as in SpaceVector v
Definition: keyMergeIssues.doc:324
CLHEP::HepRotation::yy
double yy() const
myRotClass::setXX
void setXX(const double &v)
Definition: eulerProb.cc:15
CLHEP::HepRotationZ
Definition: Geometry/CLHEP/Vector/RotationZ.h:43
CLHEP::HepRotation::yz
double yz() const
myRotClass::myRotClass
myRotClass(const HepRotationZ &rot)
Definition: eulerProb.cc:14
myRotClass::setXY
void setXY(const double &v)
Definition: eulerProb.cc:16
myRotClass
Definition: eulerProb.cc:12
CLHEP::HepRotation::psi
double psi() const
Definition: RotationE.cc:113
CLHEP::HepRotation::xx
double xx() const
CLHEP::HepRotation::zz
double zz() const
CLHEP::HepRotation::theta
double theta() const
Definition: RotationE.cc:107
CLHEP::HepRotation::xz
double xz() const
myRotClass::setZY
void setZY(const double &v)
Definition: eulerProb.cc:22
myRotClass::setXZ
void setXZ(const double &v)
Definition: eulerProb.cc:17