Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
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
10
12
13#include "Jeep/JPrint.hh"
14#include "Jeep/JParser.hh"
15#include "Jeep/JMessage.hh"
16
17
18/**
19 * \file
20 *
21 * Example for determination of center of optical module.
22 * \author mdejong
23 */
24int main(int argc, char **argv)
25{
26 using namespace std;
27 using namespace JPP;
28
30
31 pair_type precision;
32 int debug;
33
34 try {
35
36 JParser<> zap("Example for determination of center of optical module.");
37
38 zap['e'] = make_field(precision, "precision of fit comparison and centering") = pair_type(1.0e-12, 1.0e-4);
39 zap['d'] = make_field(debug, "debug.") = 3;
40
41 zap(argc, argv);
42 }
43 catch(const exception &error) {
44 FATAL(error.what() << endl);
45 }
46
47 const JModule module = getModule<JKM3NeT_t>(1001);
48 const JEstimator<JPoint3D> position(module.begin(), module.end());
49 const JPosition3D center = module.getCenter();
50
51 DEBUG("position " << position << endl);
52 DEBUG("center " << center << endl);
53
54 ASSERT(center.equals(position, precision.first));
55 ASSERT(center.equals(JVector3D(0.0, 0.0, 0.0), precision.second));
56
57 return 0;
58}
Detector support kit.
General purpose messaging.
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define ASSERT(A,...)
Assert macro.
Definition JMessage.hh:90
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
Data structure for optical module.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Linear fit of JFIT::JPoint3D.
I/O formatting auxiliaries.
Data structure for a composite optical module.
Definition JModule.hh:75
Template definition of linear fit.
Definition JEstimator.hh:25
Data structure for position in three dimensions.
Data structure for vector in three dimensions.
Definition JVector3D.hh:36
bool equals(const JVector3D &vector, const double precision=std::numeric_limits< double >::min()) const
Check equality.
Definition JVector3D.hh:221
Utility class to parse command line options.
Definition JParser.hh:1698
int main(int argc, char **argv)
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Data structure for a pair of indices.