32 #ifndef DROP_CGAL // in case we do not have the code for CGAL
34 #include "fastjet/internal/Dnn3piCylinder.hh"
37 FASTJET_BEGIN_NAMESPACE
41 Dnn3piCylinder::Dnn3piCylinder(
42 const vector<EtaPhi> & input_points,
43 const bool & ignore_nearest_is_mirror,
44 const bool & verbose) {
47 _ignore_nearest_is_mirror = ignore_nearest_is_mirror;
48 vector<EtaPhi> plane_points;
51 for (
unsigned int i=0; i < input_points.size(); i++) {
52 _RegisterCylinderPoint(input_points[i], plane_points);
55 if (_verbose) cout <<
"============== Preparing _DNN" << endl;
56 _DNN =
new DnnPlane(plane_points, verbose);
79 void Dnn3piCylinder::_RegisterCylinderPoint (
const EtaPhi & cylinder_point,
80 vector<EtaPhi> & plane_points) {
81 double phi = cylinder_point.second;
82 assert(phi >= 0.0 && phi < 2*pi);
86 mvi.main_index = _cylinder_index_of_plane_vertex.size();
87 _cylinder_index_of_plane_vertex.push_back(_mirror_info.size());
88 plane_points.push_back(cylinder_point);
92 mvi.mirror_index = _cylinder_index_of_plane_vertex.size();
93 _cylinder_index_of_plane_vertex.push_back(_mirror_info.size());
94 plane_points.push_back(_remap_phi(cylinder_point));
96 mvi.mirror_index = INEXISTENT_VERTEX;
100 _mirror_info.push_back(mvi);
106 void Dnn3piCylinder::RemoveAndAddPoints(
const vector<int> & indices_to_remove,
107 const vector<EtaPhi> & points_to_add,
108 vector<int> & indices_added,
109 vector<int> & indices_of_updated_neighbours) {
114 vector<int> plane_indices_to_remove;
115 for (
unsigned int i=0; i < indices_to_remove.size(); i++) {
116 MirrorVertexInfo * mvi;
117 mvi = & _mirror_info[indices_to_remove[i]];
118 plane_indices_to_remove.push_back(mvi->main_index);
119 if (mvi->mirror_index != INEXISTENT_VERTEX) {
120 plane_indices_to_remove.push_back(mvi->mirror_index);
126 vector<EtaPhi> plane_points_to_add;
127 indices_added.clear();
128 for (
unsigned int i=0; i < points_to_add.size(); i++) {
129 indices_added.push_back(_mirror_info.size());
130 _RegisterCylinderPoint(points_to_add[i], plane_points_to_add);
137 vector<int> updated_plane_neighbours, plane_indices_added;
138 _DNN->RemoveAndAddPoints(plane_indices_to_remove, plane_points_to_add,
139 plane_indices_added, updated_plane_neighbours);
145 for (i=0; i < updated_plane_neighbours.size(); i++) {
147 _cylinder_index_of_plane_vertex[updated_plane_neighbours[i]]);}
150 indices_of_updated_neighbours.clear();
151 for (set<int>::iterator iter = index_set.begin();
152 iter != index_set.end(); iter++) {
153 indices_of_updated_neighbours.push_back(*iter);
158 FASTJET_END_NAMESPACE