Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
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
9
#include "
JFit/JPoint3DEstimator.hh
"
10
11
#include "
Jeep/JPrint.hh
"
12
#include "
Jeep/JParser.hh
"
13
#include "
Jeep/JMessage.hh
"
14
15
16
/**
17
* \file
18
*
19
* Example for determination of center of optical module.
20
* \author mdejong
21
*/
22
int
main
(
int
argc,
char
**argv)
23
{
24
using namespace
std;
25
using namespace
JPP;
26
27
typedef
pair<double, double>
pair_type
;
28
29
pair_type
precision;
30
int
debug
;
31
32
try
{
33
34
JParser<>
zap(
"Example for determination of center of optical module."
);
35
36
zap[
'e'
] =
make_field
(precision,
"precision of fit comparison and centering"
) =
pair_type
(1.0e-12, 1.0e-4);
37
zap[
'd'
] =
make_field
(
debug
,
"debug."
) = 3;
38
39
zap(argc, argv);
40
}
41
catch
(
const
exception &error) {
42
FATAL
(error.what() << endl);
43
}
44
45
const
JModule module =
JModule::getInstance
();
46
const
JEstimator<JPoint3D> position(module.begin(), module.end());
47
const
JPosition3D center = module.getCenter();
48
49
DEBUG
(
"position "
<< position << endl);
50
DEBUG
(
"center "
<< center << endl);
51
52
ASSERT
(center.equals(position, precision.first));
53
ASSERT
(center.equals(JVector3D(0.0, 0.0, 0.0), precision.second));
54
55
return
0;
56
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
JCALIBRATE::pair_type
JCombinatorics::pair_type pair_type
Definition:
JCalibrateK40.hh:41
std::pair
Definition:
JSTDTypes.hh:15
ASSERT
#define ASSERT(A,...)
Assert macro.
Definition:
JMessage.hh:90
JPrint.hh
I/O formatting auxiliaries.
JLANG::getInstance
T & getInstance(const T &object)
Get static instance from temporary object.
Definition:
JObject.hh:75
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
debug
int debug
debug level
Definition:
JSirene.cc:63
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.
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
JModule.hh
Data structure for a composite optical module.
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5