Go to the documentation of this file. 1 #ifndef __JGEOMETRY3DTOOLKIT__
2 #define __JGEOMETRY3DTOOLKIT__
81 if (__begin != __end) {
83 for (T i = __begin; i != __end; ++i) {
111 if (__begin != __end) {
115 for (T i = __begin; i != __end; ++i) {
116 __x += i->getX() * i->getW();
117 __y += i->getY() * i->getW();
118 __z += i->getZ() * i->getW();
145 const int N =
distance(__begin, __end);
149 double Dmin = numeric_limits<double>::max();
151 for (T i = __begin; i != __end; ++i) {
152 for (T
j = i; ++
j != __end; ) {
170 const double dl =
getDmin(__begin, i);
171 const double dr =
getDmin(i, __end);
173 const double Dmin = min(dl, dr);
178 while (--il != __begin && i ->getZ() - il->getZ() < Dmin) {}
179 while (++ir != __end && ir->getZ() - i ->getZ() < Dmin) {}
185 return min(Dmin, dz);
202 inline bool operator()(
const T& first,
const T& second)
const
204 return first.getZ() < second.getZ();
235 return getDmin(__begin, __end);
Auxiliary class for sorting elements.
Auxiliary class for determination of smallest distance between pair of 3D points.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
JCenter3D(const JVector3D &p0, const JVector3D &p1)
Constructor.
JWeighedCenter3D(T __begin, T __end)
Constructor.
JSmallestDistance3D()
Default constructor.
static const JSmallestDistance3D getSmallestDistance3D
Function object for smallest distance determination.
double operator()(T __begin, T __end) const
Get smallest distance between two points.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Data structure for vector in three dimensions.
Data structure for position in three dimensions.
static const JCompareZ compareZ
Function object for sorting elements.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
static double getDmin(T __begin, T __end)
Recursive method to find the smallest distance.
bool operator()(const T &first, const T &second) const
Compare x-positions of given points.
JCenter3D(const JVector3D &p0, const JVector3D &p1, const JVector3D &p2)
Constructor.
JCenter3D(T __begin, T __end)
Constructor.
Auxiliary classes and methods for 3D geometrical objects and operations.
static const JSmallestDistance2D getSmallestDistance2D
Function object for smallest distance determination.
JVector3D & add(const JVector3D &vector)
Add vector.
JVector3D & div(const double factor)
Scale vector.