Jpp
examples
JDetector
JCompass.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "
JGeometry3D/JPosition3D.hh
"
7
#include "
JDetector/JCompass.hh
"
8
#include "
JDetector/JCompassMatrix.hh
"
9
10
#include "
Jeep/JPrint.hh
"
11
#include "
Jeep/JParser.hh
"
12
#include "
Jeep/JMessage.hh
"
13
14
15
/**
16
* \file
17
*
18
* Example compass operations.
19
* \author mdejong
20
*/
21
int
main
(
int
argc,
char
**argv)
22
{
23
using namespace
std
;
24
using namespace
JPP
;
25
26
JCompass compass;
27
int
debug
;
28
29
try
{
30
31
JParser<>
zap;
32
33
zap[
'C'
] =
make_field
(compass) = JCompass();
34
zap[
'd'
] =
make_field
(
debug
) = 3;
35
36
zap(argc, argv);
37
}
38
catch
(
const
exception &error) {
39
FATAL
(error.what() << endl);
40
}
41
42
43
44
const
JCompassMatrix R(compass);
45
46
cout <<
"compass "
<< compass << endl;
47
cout << R << endl;
48
49
JPosition3D pos[] = {
50
JPosition3D(1, 0, 0),
51
JPosition3D(0, 1, 0),
52
JPosition3D(0, 0, 1)
53
};
54
55
for
(
int
i = 0; i !=
sizeof
(pos)/
sizeof
(pos[0]); ++i) {
56
57
cout << showpos <<
FIXED
(8,3) << pos[i] <<
" -> "
;
58
59
pos[i].rotate(R);
60
61
cout << showpos <<
FIXED
(8,3) << pos[i] << endl;
62
}
63
}
FIXED
Auxiliary data structure for floating point format specification.
Definition:
JPrint.hh:481
JMessage.hh
JPrint.hh
JPosition3D.hh
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JCompass.hh
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition:
JAAnetToolkit.hh:37
debug
int debug
debug level
Definition:
JSirene.cc:59
JCompassMatrix.hh
JParser.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
std
Definition:
jaanetDictionary.h:36
main
int main(int argc, char **argv)
Definition:
JCompass.cc:21
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
Generated by
1.8.16