28{
31
34 UInt_t seed;
36
37 try {
38
39 JParser<> zap(
"Example program of JEllipse2D class.");
40
45
46 zap(argc, argv);
47 }
48 catch(const exception &error) {
49 FATAL(error.what() << endl);
50 }
51
52 gRandom->SetSeed(seed);
53
55
57
59 gRandom->Gaus(0.0, 1.0)));
60 }
61
62 try {
63
64 const JEllipse2D ellipse(ps.begin(), ps.end());
65
66 if (
debug >= debug_t) {
67 cout << "number of iterations " << ellipse.numberOfIterations << endl;
68 cout << "center: (" << ellipse.getX() << ", " << ellipse.getY() << ")" << endl;
69 cout << "major Semi-Axis: " << ellipse.getMajorAxis() << endl;
70 cout << "minor Semi-Axis: " << ellipse.getMinorAxis() << endl;
71 cout << "rotation (degrees): " << ellipse.getAngle() * 180.0 / PI << endl;
72 }
73
76
77 for (const auto& p : ps) {
78 X.push_back(p.getX());
79 Y.push_back(p.getY());
80 }
81
82 TGraph gs(X.size(), X.data(), Y.data());
83
84 gs.SetName("gs");
85
86 TEllipse ts(ellipse.getX(),
87 ellipse.getY(),
88 ellipse.getMajorAxis(),
89 ellipse.getMinorAxis(),
90 0.0,
91 360.0,
92 ellipse.getAngle() * 180.0 / PI);
93
94 ts.SetFillStyle(0);
95
97
98 out << gs;
99 out << ts;
100
101 out.Write();
102 out.Close();
103
104 } catch (const exception& error) {
105 cerr << "error: " << error.what() << endl;
106 }
107
108 return 0;
109}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for position in two dimensions.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).