33#ifndef __FASTJET_DNN3PICYLINDER_HH__
34#define __FASTJET_DNN3PICYLINDER_HH__
36#include "fastjet/internal/DynamicNearestNeighbours.hh"
37#include "fastjet/internal/DnnPlane.hh"
38#include "fastjet/internal/numconsts.hh"
40FASTJET_BEGIN_NAMESPACE
69 const bool & ignore_nearest_is_mirror =
false,
70 const bool & verbose =
false );
83 bool Valid(
const int index)
const;
86 const std::vector<EtaPhi> & points_to_add,
87 std::vector<int> & indices_added,
88 std::vector<int> & indices_of_updated_neighbours);
95 const static int INEXISTENT_VERTEX=-3;
99 bool _ignore_nearest_is_mirror;
139 struct MirrorVertexInfo {
152 std::vector<MirrorVertexInfo> _mirror_info;
156 std::vector<int> _cylinder_index_of_plane_vertex;
167 double phi = point.second;
168 if (phi < pi) { phi += twopi ;}
169 return EtaPhi(point.first, phi);}
191 void _RegisterCylinderPoint (
const EtaPhi & cylinder_point,
192 std::vector<EtaPhi> & plane_points);
209 int main_index = _mirror_info[current].main_index;
210 int mirror_index = _mirror_info[current].mirror_index;
212 if (mirror_index == INEXISTENT_VERTEX ) {
213 plane_index = _DNN->NearestNeighbourIndex(main_index);
216 _DNN->NearestNeighbourDistance(main_index) <
217 _DNN->NearestNeighbourDistance(mirror_index)) ?
218 _DNN->NearestNeighbourIndex(main_index) :
219 _DNN->NearestNeighbourIndex(mirror_index) ;
221 int this_cylinder_index = _cylinder_index_of_plane_vertex[plane_index];
225 assert(_ignore_nearest_is_mirror || this_cylinder_index != current);
230 return this_cylinder_index;
234 int main_index = _mirror_info[current].main_index;
235 int mirror_index = _mirror_info[current].mirror_index;
236 if (mirror_index == INEXISTENT_VERTEX ) {
237 return _DNN->NearestNeighbourDistance(main_index);
240 _DNN->NearestNeighbourDistance(main_index) <
241 _DNN->NearestNeighbourDistance(mirror_index)) ?
242 _DNN->NearestNeighbourDistance(main_index) :
243 _DNN->NearestNeighbourDistance(mirror_index) ;
249 return (_DNN->Valid(_mirror_info[index].main_index));
253inline Dnn3piCylinder::~Dnn3piCylinder() {
int NearestNeighbourIndex(const int ii) const
Returns the index of the nearest neighbour of point labelled by ii (assumes ii is valid).
Dnn3piCylinder(const std::vector< EtaPhi > &, const bool &ignore_nearest_is_mirror=false, const bool &verbose=false)
Initialiser from a set of points on an Eta-Phi plane, where eta can have an arbitrary ranges and phi ...
void RemoveAndAddPoints(const std::vector< int > &indices_to_remove, const std::vector< EtaPhi > &points_to_add, std::vector< int > &indices_added, std::vector< int > &indices_of_updated_neighbours)
insertion and removal of points
bool Valid(const int index) const
Returns true iff the given index corresponds to a point that exists in the DNN structure (meaning tha...
Dnn3piCylinder()
empty initaliser
double NearestNeighbourDistance(const int ii) const
Returns the distance to the nearest neighbour of point labelled by index ii (assumes ii is valid).
Shortcut for dealing with eta-phi coordinates.