65 DnnPlane(
const std::vector<EtaPhi> &,
const bool & verbose =
false );
70 int NearestNeighbourIndex(
const int ii)
const ;
74 double NearestNeighbourDistance(
const int ii)
const ;
79 bool Valid(
const int index)
const;
81 void RemoveAndAddPoints(
const std::vector<int> & indices_to_remove,
82 const std::vector<EtaPhi> & points_to_add,
83 std::vector<int> & indices_added,
84 std::vector<int> & indices_of_updated_neighbours);
87 EtaPhi etaphi(
const int i)
const;
89 double eta(
const int i)
const;
91 double phi(
const int i)
const;
106 std::vector<SuperVertex> _supervertex;
111 static const bool _crash_on_coincidence =
false;
117 inline double _euclid_distance(
const Point& p1,
const Point& p2)
const {
118 double distx= p1.x()-p2.x();
119 double disty= p1.y()-p2.y();
120 return distx*distx+disty*disty;
126 void _SetNearest(
const int j);
138 void _SetAndUpdateNearest(
const int j,
139 std::vector<int> & indices_of_updated_neighbours);
145 int _CheckIfVertexPresent(
const Vertex_handle & vertex,
146 const int its_index);
157 inline bool _is_closer_to(
const Point &pref,
158 const Point &candidate,
159 const Vertex_handle &near,
162 dist = _euclid_distance(pref, candidate);
163 return _is_closer_to_with_hint(pref, candidate, near, dist, mindist);
168 inline bool _is_closer_to_with_hint(
const Point &pref,
169 const Point &candidate,
170 const Vertex_handle &near,
193 if ((std::abs(dist-mindist)<DISTANCE_FOR_CGAL_CHECKS) &&
194 _is_not_null(near) &&
195 (_euclid_distance(candidate, near->point())<DISTANCE_FOR_CGAL_CHECKS)){
203 if (_verbose) std::cout <<
"using CGAL's distance ordering" << std::endl;
204 if (CGAL::compare_distance_to_point(pref, candidate, near->point())!=CGAL::LARGER){
208 }
else if (dist <= mindist) {
225 static const double DISTANCE_FOR_CGAL_CHECKS;
233 inline static bool _is_not_null(
const Vertex_handle & vh) {
241 return vh.operator->();
DnnPlane(const std::vector< EtaPhi > &, const bool &verbose=false)
Initialiser from a set of points on an Eta-Phi plane, where both eta and phi can have arbitrary range...