30 #ifndef DROP_CGAL // in case we do not have the code for CGAL
31 #ifndef __FASTJET_DNN4PICYLINDER_HH__
32 #define __FASTJET_DNN4PICYLINDER_HH__
34 #include "fastjet/internal/DynamicNearestNeighbours.hh"
35 #include "fastjet/internal/DnnPlane.hh"
36 #include "fastjet/internal/numconsts.hh"
38 FASTJET_BEGIN_NAMESPACE
47 class Dnn4piCylinder :
public DynamicNearestNeighbours {
55 Dnn4piCylinder(
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);
85 DnnPlane * _DNN1, * _DNN2;
89 inline EtaPhi _remap_phi(
const EtaPhi & point) {
90 double phi = point.second;
91 if (phi < pi) { phi += twopi ;}
92 return EtaPhi(point.first, phi);}
100 inline int Dnn4piCylinder::NearestNeighbourIndex(
const int & current)
const {
101 return (_DNN1->NearestNeighbourDistance(current) <
102 _DNN2->NearestNeighbourDistance(current)) ?
103 _DNN1->NearestNeighbourIndex(current) :
104 _DNN2->NearestNeighbourIndex(current) ;
107 inline double Dnn4piCylinder::NearestNeighbourDistance(
const int & current)
const {
108 return (_DNN1->NearestNeighbourDistance(current) <
109 _DNN2->NearestNeighbourDistance(current)) ?
110 _DNN1->NearestNeighbourDistance(current) :
111 _DNN2->NearestNeighbourDistance(current) ;
114 inline bool Dnn4piCylinder::Valid(
const int & index)
const {
115 return (_DNN1->Valid(index) && _DNN2->Valid(index));
119 inline Dnn4piCylinder::~Dnn4piCylinder() {
125 FASTJET_END_NAMESPACE
127 #endif // __FASTJET_DNN4PICYLINDER_HH__