33#ifndef __FASTJET_DNN2PICYLINDER_HH__
34#define __FASTJET_DNN2PICYLINDER_HH__
36#include "fastjet/internal/DynamicNearestNeighbours.hh"
37#include "fastjet/internal/DnnPlane.hh"
38#include "fastjet/internal/numconsts.hh"
40FASTJET_BEGIN_NAMESPACE
72 const bool & ignore_nearest_is_mirror =
false,
73 const bool & verbose =
false );
77 int NearestNeighbourIndex(
const int ii)
const ;
81 double NearestNeighbourDistance(
const int ii)
const ;
86 bool Valid(
const int index)
const;
88 void RemoveAndAddPoints(
const std::vector<int> & indices_to_remove,
89 const std::vector<EtaPhi> & points_to_add,
90 std::vector<int> & indices_added,
91 std::vector<int> & indices_of_updated_neighbours);
98 const static int INEXISTENT_VERTEX=-3;
102 bool _ignore_nearest_is_mirror;
142 struct MirrorVertexInfo {
155 std::vector<MirrorVertexInfo> _mirror_info;
159 std::vector<int> _cylinder_index_of_plane_vertex;
171 double phi = point.second;
172 if (phi < pi) { phi += twopi ;}
else {phi -= twopi;}
173 return EtaPhi(point.first, phi);}
183 void _RegisterCylinderPoint (
const EtaPhi & cylinder_point,
184 std::vector<EtaPhi> & plane_points);
201 void _CreateNecessaryMirrorPoints(
202 const std::vector<int> & plane_indices,
203 std::vector<int> & updated_plane_points);
220inline int Dnn2piCylinder::NearestNeighbourIndex(
const int current)
const {
221 int main_index = _mirror_info[current].main_index;
222 int mirror_index = _mirror_info[current].mirror_index;
224 if (mirror_index == INEXISTENT_VERTEX ) {
233 int this_cylinder_index = _cylinder_index_of_plane_vertex[plane_index];
237 assert(_ignore_nearest_is_mirror || this_cylinder_index != current);
242 return this_cylinder_index;
245inline double Dnn2piCylinder::NearestNeighbourDistance(
const int current)
const {
246 int main_index = _mirror_info[current].main_index;
247 int mirror_index = _mirror_info[current].mirror_index;
248 if (mirror_index == INEXISTENT_VERTEX ) {
260inline bool Dnn2piCylinder::Valid(
const int index)
const {
261 return (_DNN->
Valid(_mirror_info[index].main_index));
265inline Dnn2piCylinder::~Dnn2piCylinder() {
Dnn2piCylinder(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 ...
Dnn2piCylinder()
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)
bool Valid(const int index) const
Returns true iff the given index corresponds to a point that exists in the DNN structure (meaning tha...
int NearestNeighbourIndex(const int ii) const
Returns the index of the nearest neighbour of point labelled by ii (assumes ii is valid)
Shortcut for dealing with eta-phi coordinates.