Jpp  17.1.1
the software that should make you happy
 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"
9 
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 
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 }
Utility class to parse command line options.
Definition: JParser.hh:1517
JCombinatorics::pair_type pair_type
int main(int argc, char *argv[])
Definition: Main.cc:15
Data structure for a composite optical module.
Definition: JModule.hh:68
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
I/O formatting auxiliaries.
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1993
General purpose messaging.
#define FATAL(A)
Definition: JMessage.hh:67
Linear fit of JFIT::JPoint3D.
Utility class to parse command line options.
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
Linear fit of crossing point (position) between axes (objects with position and direction).
int debug
debug level
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
Data structure for optical module.