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)
110 if (__begin != __end) {
114 for (T i = __begin; i != __end; ++i) {
115 __x += i->getX() * i->getW();
116 __y += i->getY() * i->getW();
117 __z += i->getZ() * i->getW();
144 const int N =
distance(__begin, __end);
148 double Dmin = numeric_limits<double>::max();
150 for (T i = __begin; i != __end; ++i) {
151 for (T
j = i; ++
j != __end; ) {
169 const double dl =
getDmin(__begin, i);
170 const double dr =
getDmin(i, __end);
172 const double Dmin = min(dl, dr);
177 while (--il != __begin && i ->getZ() - il->getZ() < Dmin) {}
178 while (++ir != __end && ir->getZ() - i ->getZ() < Dmin) {}
184 return min(Dmin, dz);
201 inline bool operator()(
const T& first,
const T& second)
const
203 return first.getZ() < second.getZ();
234 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.