Locate vertex around given position.
376 {
377 vertex_type vertex;
378
379 for (const_iterator i = this->cbegin(); i != this->cend(); ++i) {
380
381 const JPosition3D p0 = position + *i;
382 const double d0 = p0.getDistance(root.getPosition());
383 const double t0 = root.getToA() -
V.
getTime(d0, p0.getZ(), root.getZ());
384
385 int n0 = 1;
386 double q0 = root.getQ();
387
388 for (T p = __begin; p != __end && n0 + distance(p, __end) >= numberOfHits && n0 + distance(p, __end) >= vertex.N; ++p) {
389
390 const double d1 = p0.getDistance(p->getPosition());
391 const double t1 = p->getToA() -
V.
getTime(d1, p0.getZ(), p->getZ());
392
393 if (fabs(t1 - t0) <=
Tmax_s) {
394 n0 += 1;
395 q0 += p->getQ();
396 }
397 }
398
399 if (q0 > vertex.Q) {
400 vertex = vertex_type(p0, t0, n0, q0);
401 }
402 }
403
404 return vertex;
405 }