32 #ifndef DROP_CGAL // in case we do not have the code for CGAL 
   33 #ifndef __FASTJET_DNN4PICYLINDER_HH__ 
   34 #define __FASTJET_DNN4PICYLINDER_HH__ 
   36 #include "fastjet/internal/DynamicNearestNeighbours.hh" 
   37 #include "fastjet/internal/DnnPlane.hh" 
   38 #include "fastjet/internal/numconsts.hh" 
   40 FASTJET_BEGIN_NAMESPACE      
 
   49 class Dnn4piCylinder : 
public DynamicNearestNeighbours {
 
   57   Dnn4piCylinder(
const std::vector<EtaPhi> &, 
const bool & verbose = 
false );
 
   61   int NearestNeighbourIndex(
const int ii) 
const ;
 
   65   double NearestNeighbourDistance(
const int ii) 
const ;
 
   70   bool Valid(
const int index) 
const;
 
   72   void RemoveAndAddPoints(
const std::vector<int> & indices_to_remove,
 
   73                           const std::vector<EtaPhi> & points_to_add,
 
   74                           std::vector<int> & indices_added,
 
   75                           std::vector<int> & indices_of_updated_neighbours);
 
   87   DnnPlane * _DNN1, * _DNN2;
 
   91   inline EtaPhi _remap_phi(
const EtaPhi & point) {
 
   92     double phi = point.second;
 
   93     if (phi < pi) { phi += twopi ;}
 
   94     return EtaPhi(point.first, phi);}
 
  102 inline int Dnn4piCylinder::NearestNeighbourIndex(
const int current)
 const {
 
  103   return (_DNN1->NearestNeighbourDistance(current) < 
 
  104           _DNN2->NearestNeighbourDistance(current)) ? 
 
  105     _DNN1->NearestNeighbourIndex(current) : 
 
  106     _DNN2->NearestNeighbourIndex(current) ; 
 
  109 inline double Dnn4piCylinder::NearestNeighbourDistance(
const int current)
 const {
 
  110   return (_DNN1->NearestNeighbourDistance(current) < 
 
  111           _DNN2->NearestNeighbourDistance(current)) ? 
 
  112     _DNN1->NearestNeighbourDistance(current) : 
 
  113     _DNN2->NearestNeighbourDistance(current) ; 
 
  116 inline bool Dnn4piCylinder::Valid(
const int index)
 const {
 
  117   return (_DNN1->Valid(index) && _DNN2->Valid(index));
 
  121 inline Dnn4piCylinder::~Dnn4piCylinder() {
 
  127 FASTJET_END_NAMESPACE
 
  129 #endif //  __FASTJET_DNN4PICYLINDER_HH__