30 #ifndef DROP_CGAL // in case we do not have the code for CGAL 32 #include "fastjet/internal/Dnn3piCylinder.hh" 35 FASTJET_BEGIN_NAMESPACE
39 Dnn3piCylinder::Dnn3piCylinder(
40 const vector<EtaPhi> & input_points,
41 const bool & ignore_nearest_is_mirror,
42 const bool & verbose) {
45 _ignore_nearest_is_mirror = ignore_nearest_is_mirror;
46 vector<EtaPhi> plane_points;
49 for (
unsigned int i=0; i < input_points.size(); i++) {
50 _RegisterCylinderPoint(input_points[i], plane_points);
53 if (_verbose) cout <<
"============== Preparing _DNN" << endl;
54 _DNN =
new DnnPlane(plane_points, verbose);
77 void Dnn3piCylinder::_RegisterCylinderPoint (
const EtaPhi & cylinder_point,
78 vector<EtaPhi> & plane_points) {
79 double phi = cylinder_point.second;
80 assert(phi >= 0.0 && phi < 2*pi);
84 mvi.main_index = _cylinder_index_of_plane_vertex.size();
85 _cylinder_index_of_plane_vertex.push_back(_mirror_info.size());
86 plane_points.push_back(cylinder_point);
90 mvi.mirror_index = _cylinder_index_of_plane_vertex.size();
91 _cylinder_index_of_plane_vertex.push_back(_mirror_info.size());
92 plane_points.push_back(_remap_phi(cylinder_point));
94 mvi.mirror_index = INEXISTENT_VERTEX;
98 _mirror_info.push_back(mvi);
104 void Dnn3piCylinder::RemoveAndAddPoints(
const vector<int> & indices_to_remove,
105 const vector<EtaPhi> & points_to_add,
106 vector<int> & indices_added,
107 vector<int> & indices_of_updated_neighbours) {
112 vector<int> plane_indices_to_remove;
113 for (
unsigned int i=0; i < indices_to_remove.size(); i++) {
114 MirrorVertexInfo * mvi;
115 mvi = & _mirror_info[indices_to_remove[i]];
116 plane_indices_to_remove.push_back(mvi->main_index);
117 if (mvi->mirror_index != INEXISTENT_VERTEX) {
118 plane_indices_to_remove.push_back(mvi->mirror_index);
124 vector<EtaPhi> plane_points_to_add;
125 indices_added.clear();
126 for (
unsigned int i=0; i < points_to_add.size(); i++) {
127 indices_added.push_back(_mirror_info.size());
128 _RegisterCylinderPoint(points_to_add[i], plane_points_to_add);
135 vector<int> updated_plane_neighbours, plane_indices_added;
136 _DNN->RemoveAndAddPoints(plane_indices_to_remove, plane_points_to_add,
137 plane_indices_added, updated_plane_neighbours);
143 for (i=0; i < updated_plane_neighbours.size(); i++) {
145 _cylinder_index_of_plane_vertex[updated_plane_neighbours[i]]);}
148 indices_of_updated_neighbours.clear();
149 for (set<int>::iterator iter = index_set.begin();
150 iter != index_set.end(); iter++) {
151 indices_of_updated_neighbours.push_back(*iter);
156 FASTJET_END_NAMESPACE