Jpp
18.1.0
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JDetector
examples/JDetector/JModule.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
#include <utility>
6
7
#include "
JDetector/JModule.hh
"
8
#include "
JDetector/JDetectorToolkit.hh
"
9
10
#include "
JFit/JPoint3DEstimator.hh
"
11
12
#include "
Jeep/JPrint.hh
"
13
#include "
Jeep/JParser.hh
"
14
#include "
Jeep/JMessage.hh
"
15
16
17
/**
18
* \file
19
*
20
* Example for determination of center of optical module.
21
* \author mdejong
22
*/
23
int
main
(
int
argc,
char
**argv)
24
{
25
using namespace
std;
26
using namespace
JPP;
27
28
typedef
pair<double, double>
pair_type
;
29
30
pair_type
precision;
31
int
debug
;
32
33
try
{
34
35
JParser<>
zap(
"Example for determination of center of optical module."
);
36
37
zap[
'e'
] =
make_field
(precision,
"precision of fit comparison and centering"
) =
pair_type
(1.0e-12, 1.0e-4);
38
zap[
'd'
] =
make_field
(
debug
,
"debug."
) = 3;
39
40
zap(argc, argv);
41
}
42
catch
(
const
exception &error) {
43
FATAL
(error.what() << endl);
44
}
45
46
const
JModule module = getModule<JKM3NeT_t>(1001);
47
const
JEstimator<JPoint3D> position(module.begin(), module.end());
48
const
JPosition3D center = module.getCenter();
49
50
DEBUG
(
"position "
<< position << endl);
51
DEBUG
(
"center "
<< center << endl);
52
53
ASSERT
(center.equals(position, precision.first));
54
ASSERT
(center.equals(JVector3D(0.0, 0.0, 0.0), precision.second));
55
56
return
0;
57
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
JCALIBRATE::pair_type
JCombinatorics::pair_type pair_type
Definition:
JCalibrateK40.hh:41
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
std::pair
Definition:
JSTDTypes.hh:15
ASSERT
#define ASSERT(A,...)
Assert macro.
Definition:
JMessage.hh:90
JPrint.hh
I/O formatting auxiliaries.
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JPoint3DEstimator.hh
Linear fit of JFIT::JPoint3D.
JParser.hh
Utility class to parse command line options.
JDetectorToolkit.hh
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
JModule.hh
Data structure for optical module.
Generated by
1.8.5