28{
31
32 int numberOfEvents;
33 ULong_t seed;
34 double precision;
36
37 try {
38
40
45
46 zap(argc, argv);
47 }
48 catch(const exception &error) {
49 FATAL(error.what() << endl);
50 }
51
52 gRandom->SetSeed(seed);
53
54 {
56
57 const JUTMPosition pointer[] = { JNorth_t, JEast_t, JSouth_t, JWest_t, JNorth_t };
58
59 for (int i = 0; i != 4; ++i) {
60
62
64
66
68
69 ASSERT(u.
equals(pointer[i+1], precision),
"compass definitions");
70 }
71 }
72
73 for (int count = 0; count < numberOfEvents; ++count) {
74
75 STATUS(
"event: " << setw(10) << count <<
'\r');
DEBUG(endl);
76
77 const JCompass c1(gRandom->Uniform(-1.0*PI,+1.0*PI),
78 gRandom->Uniform(-0.5*PI,+0.5*PI),
79 gRandom->Uniform(-0.5*PI,+0.5*PI));
80
85
86 DEBUG(
"compass [1] " << setprecision(3) <<
c1 << endl);
87 DEBUG(
"compass [2] " << setprecision(3) << c2 << endl);
88 DEBUG(
"quaternion [1] " << setprecision(5) << Q1 << endl);
89 DEBUG(
"quaternion [2] " << setprecision(5) << Q2 << endl);
90
92
93 ASSERT(Q1.equals(+Q2, precision) ||
94 Q1.equals(-Q2, precision), "compass to rotation to quaternion versus compass to quaternion");
95
96 ASSERT(
c1.equals(c2, precision),
"compass to quaternion to compass");
97
99 JVector3X_t,
100 JVector3Y_t,
101 JVector3Z_t,
102 };
103
104 for (int i = 0; i != sizeof(pos)/sizeof(pos[0]); ++i) {
105
108
110
112
114
115 DEBUG(showpos <<
FIXED(8,3) << p0 <<
" -> " << flush);
118
120 }
121 }
122
123 return 0;
124}
TCanvas * c1
Global variables to handle mouse events.
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for compass in three dimensions.
Data structure for position in three dimensions.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Data structure for unit quaternion in three dimensions.
const JQuaternion3D & getQuaternion() const
Get quaternion.
const JRotation3D & getRotation() const
Get rotation.
bool equals(const JVector3D &vector, const double precision=std::numeric_limits< double >::min()) const
Check equality.
Utility class to parse command line options.
Data structure for UTM position.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.