30 #ifndef DROP_CGAL // in case we do not have the code for CGAL
32 #ifndef __FASTJET_DNNPLANE_HH__
33 #define __FASTJET_DNNPLANE_HH__
35 #include "fastjet/internal/Triangulation.hh"
36 #include "fastjet/internal/DynamicNearestNeighbours.hh"
38 FASTJET_BEGIN_NAMESPACE
47 class DnnPlane :
public DynamicNearestNeighbours {
54 DnnPlane(
const std::vector<EtaPhi> &,
const bool & verbose =
false );
59 int NearestNeighbourIndex(
const int & ii)
const ;
63 double NearestNeighbourDistance(
const int & ii)
const ;
68 bool Valid(
const int & index)
const;
70 void RemoveAndAddPoints(
const std::vector<int> & indices_to_remove,
71 const std::vector<EtaPhi> & points_to_add,
72 std::vector<int> & indices_added,
73 std::vector<int> & indices_of_updated_neighbours);
76 EtaPhi etaphi(
const int i)
const;
78 double eta(
const int i)
const;
80 double phi(
const int i)
const;
93 std::vector<SuperVertex> _supervertex;
97 static const bool _crash_on_coincidence =
true;
104 inline double _euclid_distance(
const Point& p1,
const Point& p2)
const {
105 double distx= p1.x()-p2.x();
106 double disty= p1.y()-p2.y();
107 return distx*distx+disty*disty;
113 void _SetNearest(
const int & j);
125 void _SetAndUpdateNearest(
const int & j,
126 std::vector<int> & indices_of_updated_neighbours);
131 void _CrashIfVertexPresent(
const Vertex_handle & vertex,
132 const int & its_index);
140 inline int DnnPlane::NearestNeighbourIndex(
const int & ii)
const {
141 return _supervertex[ii].NNindex;}
143 inline double DnnPlane::NearestNeighbourDistance(
const int & ii)
const {
144 return _supervertex[ii].NNdistance;}
146 inline bool DnnPlane::Valid(
const int & index)
const {
147 if (index >= 0 && index < static_cast<int>(_supervertex.size())) {
148 return (_supervertex[index].vertex != NULL);}
else {
return false;} }
150 inline EtaPhi DnnPlane::etaphi(
const int i)
const {
151 Point * p = & (_supervertex[i].vertex->point());
152 return EtaPhi(p->x(),p->y()); }
154 inline double DnnPlane::eta(
const int i)
const {
155 return _supervertex[i].vertex->point().x(); }
157 inline double DnnPlane::phi(
const int i)
const {
158 return _supervertex[i].vertex->point().y(); }
161 FASTJET_END_NAMESPACE
163 #endif // __FASTJET_DNNPLANE_HH__