CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
eulerProb.cc File Reference
#include <iostream>
#include "CLHEP/Units/SystemOfUnits.h"
#include "CLHEP/Vector/Rotation.h"

Go to the source code of this file.

Classes

class  myRotClass
 

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 27 of file eulerProb.cc.

27 {
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}