Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
JDynamics.cc File Reference

Example program to apply dynamic position and orientation calibration. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <limits>
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JSupport/JMultipleFileScanner.hh"
#include "JSupport/JMeta.hh"
#include "JDynamics/JDynamics.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 program to apply dynamic position and orientation calibration.

Author
mdejong

Definition in file JDynamics.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 25 of file JDynamics.cc.

26{
27 using namespace std;
28 using namespace JPP;
29
31 JLimit_t& numberOfEvents = calibrationFile.getLimit();
32 string detectorFile;
33 string outputFile;
34 double Tmax_s;
35 double t1_s;
36 int debug;
37
38 try {
39
40 JParser<> zap("Example program to apply dynamic position and orientation calibration.");
41
42 zap['f'] = make_field(calibrationFile, "output of JBallarat[.sh] / JKatoomba[.sh]");
43 zap['n'] = make_field(numberOfEvents) = JLimit::max();
44 zap['a'] = make_field(detectorFile);
45 zap['o'] = make_field(outputFile);
46 zap['T'] = make_field(Tmax_s) = 0.0;
47 zap['t'] = make_field(t1_s);
48 zap['d'] = make_field(debug) = 2;
49
50 zap(argc, argv);
51 }
52 catch(const exception &error) {
53 FATAL(error.what() << endl);
54 }
55
56
58
59 try {
60 load(detectorFile, detector);
61 }
62 catch(const JException& error) {
63 FATAL(error);
64 }
65
66 detector.comment.add(JMeta(argc, argv));
67
68 JDynamics dynamics(detector, Tmax_s);
69
70 STATUS("loading calibration from file(s)" << endl);
71
72 for (JMultipleFileScanner<>::const_iterator i = calibrationFile.begin(); i != calibrationFile.end(); ++i) {
73 STATUS(*i << endl);
74 }
75
76 dynamics.load(calibrationFile);
77
78 STATUS("OK" << endl);
79
80 STATUS("Coverage position " << FIXED(5,1) << 100.0 * dynamics.position .getCoverage(detector, t1_s) << "%" << endl);
81 STATUS("Coverage orientation " << FIXED(5,1) << 100.0 * dynamics.orientation.getCoverage(detector, t1_s) << "%" << endl);
82
83 dynamics.update(t1_s);
84
85 store(outputFile.c_str(), dynamics);
86}
string outputFile
#define STATUS(A)
Definition JMessage.hh:63
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:74
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Detector data structure.
Definition JDetector.hh:96
General exception.
Definition JException.hh:24
Utility class to parse command line options.
Definition JParser.hh:1698
General purpose class for object reading from a list of file names.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448
Detector file.
Definition JHead.hh:227
Dynamic detector calibration.
Definition JDynamics.hh:81
Auxiliary class for defining the range of iterations of objects.
Definition JLimit.hh:45
static counter_type max()
Get maximum counter value.
Definition JLimit.hh:128
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72