Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JModule.cc File Reference

Example for determination of center of optical module. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <utility>
#include "JDetector/JModule.hh"
#include "JFit/JPoint3DEstimator.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Example for determination of center of optical module.

Author
mdejong

Definition in file JModule.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 22 of file JModule.cc.

23 {
24  using namespace std;
25  using namespace JPP;
26 
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 }
Utility class to parse command line options.
Definition: JParser.hh:1500
JCombinatorics::pair_type pair_type
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62