00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef DROP_CGAL // in case we do not have the code for CGAL
00033 #include <set>
00034 #include "fastjet/internal/Dnn4piCylinder.hh"
00035 using namespace std;
00036
00037 FASTJET_BEGIN_NAMESPACE
00038
00039
00041 Dnn4piCylinder::Dnn4piCylinder(
00042 const vector<EtaPhi> & input_points, const bool & verbose) {
00043
00044 _verbose = verbose;
00045 vector<EtaPhi> copied_points(input_points.size());
00046 for (unsigned int i=0; i < input_points.size(); i++) {
00047 double phi = input_points[i].second;
00048 assert(phi >= 0.0 && phi < 2*pi);
00049 copied_points[i] = _remap_phi(input_points[i]);
00050 }
00051
00052 if (_verbose) cout << "============== Preparing _DNN1" << endl;
00053 _DNN1 = new DnnPlane(input_points, verbose);
00054 if (_verbose) cout << "============== Preparing _DNN2" << endl;
00055 _DNN2 = new DnnPlane(copied_points, verbose);
00056 }
00057
00058
00059
00061 void Dnn4piCylinder::RemoveAndAddPoints(const vector<int> & indices_to_remove,
00062 const vector<EtaPhi> & points_to_add,
00063 vector<int> & indices_added,
00064 vector<int> & indices_of_updated_neighbours) {
00065
00066 vector<int> indices1, indices2;
00067
00068 _DNN1->RemoveAndAddPoints(indices_to_remove,points_to_add,
00069 indices_added,indices1);
00070
00071
00072 vector<EtaPhi> remapped_points(points_to_add.size());
00073 for (size_t i = 0; i < points_to_add.size(); i++) {
00074 remapped_points[i] = _remap_phi(points_to_add[i]);
00075 }
00076 _DNN2->RemoveAndAddPoints(indices_to_remove, remapped_points,
00077 indices_added,indices2);
00078
00079
00080
00081 set<int> index_set;
00082 unsigned int i;
00083 for (i=0; i < indices1.size(); i++) {index_set.insert(indices1[i]);}
00084 for (i=0; i < indices2.size(); i++) {index_set.insert(indices2[i]);}
00085
00086 indices_of_updated_neighbours.clear();
00087 for (set<int>::iterator iter = index_set.begin();
00088 iter != index_set.end(); iter++) {
00089 indices_of_updated_neighbours.push_back(*iter);
00090 }
00091 }
00092
00093 FASTJET_END_NAMESPACE
00094
00095 #endif // DROP_CGAL