33{
35
36 string inputFile;
39 ULong_t seed;
41
42 try {
43
44 JParser<> zap(
"Example program to test convex hull and enclosing circle.");
45
51
52 zap(argc, argv);
53 }
54 catch(const exception &error) {
55 FATAL(error.what() << endl);
56 }
57
58 gRandom->SetSeed(seed);
59
61
62
64
67
68
69 if (inputFile != "") {
70
71 ifstream in(inputFile.c_str());
72
73 for (
double x, y; in >>
x >>
y; ) {
75 }
76
77 in.close();
78
80
82
84
87 }
88
90
92
93 for (const_iterator i = buffer.begin(); i != buffer.end(); ++i)
94 out <<
FIXED(7,3) << i->getX() <<
' '
96
97 out.close();
98 }
99
100 } else {
101
103 }
104
105 for (const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
107 }
108
110
112 buffer.end());
113
114
116 << 0 << ' '
118
122
124
126
128
129
130 {
132
133 for (const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
136
138
139 }
140 }
141
142 for (
int i = 0; i !=
sizeof(
n)/
sizeof(n[0]); ++i) {
143 NOTICE(
"Number of points outside [" << i <<
"] " << n[i] <<
endl);
144 }
145 }
146
148
149 TCanvas cv(
"cv",
"", 400, 400);
150
151 cv.SetFillStyle(4000);
152 cv.SetFillColor(0);
153
154 cv.Divide(1, 1);
155 cv.cd(1);
156
157
159
160
162
165
166 int N = 0;
167
168 for (const_iterator i = buffer.begin(); i != buffer.end(); ++i, ++N) {
171 }
172
173
178
180
182 h2.Draw();
183
184
187
188
189 TGraph g(N, x, y);
190
191 g.SetMarkerStyle(20);
193 g.SetMarkerSize(0.7);
194 g.Draw("P");
195
196
197
198
200
202
206
207
208
209
210 const int i = --N;
211
213
216
217 N = N + 1 - i;
218
219 TGraph g2(N, &x[i], &y[i]);
220
221 g2.SetLineColor(
kRed);
222 g2.SetLineWidth(2);
223 g2.Draw("L");
224
225
226 cv.Update();
227
228 tp->Run();
229}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Double_t g1(const Double_t x)
Function.
Data structure for circle in two dimensions.
Data structure for vector in two dimensions.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
double getArea2D(T __begin, T __end)
Get area of a convex polygon.
bool inside2D(T __begin, T __end, const JVector2D &pos)
Check if given point is inside a convex polygon.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.