#include <Dnn4piCylinder.hh>
Inheritance diagram for fastjet::Dnn4piCylinder:


Public Member Functions | |
| Dnn4piCylinder () | |
| empty initaliser | |
| Dnn4piCylinder (const std::vector< EtaPhi > &, const bool &verbose=false) | |
| initialiser... | |
| int | NearestNeighbourIndex (const int &ii) const |
| Returns the index of the nearest neighbour of point labelled by ii (assumes ii is valid). | |
| 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 that it has been added, and not removed in the meantime). | |
| 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 | |
| ~Dnn4piCylinder () | |
Private Member Functions | |
| EtaPhi | _remap_phi (const EtaPhi &point) |
| given a phi value in the 0--2pi range return one in the pi--3pi range. | |
Private Attributes | |
| bool | _verbose |
| DnnPlane * | _DNN1 |
| DnnPlane * | _DNN2 |
Definition at line 45 of file Dnn4piCylinder.hh.
|
|
empty initaliser
Definition at line 48 of file Dnn4piCylinder.hh. 00048 {}
|
|
||||||||||||
|
initialiser...
Definition at line 41 of file Dnn4piCylinder.cc. References _DNN1, _DNN2, _remap_phi(), _verbose, and fastjet::pi. 00042 {
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 }
|
|
|
Definition at line 117 of file Dnn4piCylinder.hh.
|
|
|
given a phi value in the 0--2pi range return one in the pi--3pi range.
Definition at line 87 of file Dnn4piCylinder.hh. References fastjet::EtaPhi::first, fastjet::pi, fastjet::EtaPhi::second, and twopi. Referenced by Dnn4piCylinder(), and RemoveAndAddPoints(). 00087 {
00088 double phi = point.second;
00089 if (phi < pi) { phi += twopi ;}
00090 return EtaPhi(point.first, phi);}
|
|
|
Returns the distance to the nearest neighbour of point labelled by index ii (assumes ii is valid).
Implements fastjet::DynamicNearestNeighbours. Definition at line 105 of file Dnn4piCylinder.hh. References _DNN1, _DNN2, and fastjet::DnnPlane::NearestNeighbourDistance(). 00105 {
00106 return (_DNN1->NearestNeighbourDistance(current) <
00107 _DNN2->NearestNeighbourDistance(current)) ?
00108 _DNN1->NearestNeighbourDistance(current) :
00109 _DNN2->NearestNeighbourDistance(current) ;
00110 }
|
|
|
Returns the index of the nearest neighbour of point labelled by ii (assumes ii is valid).
Implements fastjet::DynamicNearestNeighbours. Definition at line 98 of file Dnn4piCylinder.hh. References _DNN1, _DNN2, fastjet::DnnPlane::NearestNeighbourDistance(), and fastjet::DnnPlane::NearestNeighbourIndex(). 00098 {
00099 return (_DNN1->NearestNeighbourDistance(current) <
00100 _DNN2->NearestNeighbourDistance(current)) ?
00101 _DNN1->NearestNeighbourIndex(current) :
00102 _DNN2->NearestNeighbourIndex(current) ;
00103 }
|
|
||||||||||||||||||||
|
insertion and removal of points
Implements fastjet::DynamicNearestNeighbours. Definition at line 61 of file Dnn4piCylinder.cc. References _DNN1, _DNN2, _remap_phi(), and fastjet::DnnPlane::RemoveAndAddPoints(). 00064 {
00065
00066 vector<int> indices1, indices2;
00067
00068 _DNN1->RemoveAndAddPoints(indices_to_remove,points_to_add,
00069 indices_added,indices1);
00070
00071 // create a vector with the remapped points (pi..3pi)
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 // merge the two sequences of updated vertices, avoiding double entries
00080 // of vertices with the same index
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 }
|
|
|
Returns true iff the given index corresponds to a point that exists in the DNN structure (meaning that it has been added, and not removed in the meantime).
Implements fastjet::DynamicNearestNeighbours. Definition at line 112 of file Dnn4piCylinder.hh. References _DNN1, _DNN2, and fastjet::DnnPlane::Valid().
|
|
|
Definition at line 83 of file Dnn4piCylinder.hh. Referenced by Dnn4piCylinder(), NearestNeighbourDistance(), NearestNeighbourIndex(), RemoveAndAddPoints(), Valid(), and ~Dnn4piCylinder(). |
|
|
Definition at line 83 of file Dnn4piCylinder.hh. Referenced by Dnn4piCylinder(), NearestNeighbourDistance(), NearestNeighbourIndex(), RemoveAndAddPoints(), Valid(), and ~Dnn4piCylinder(). |
|
|
Definition at line 77 of file Dnn4piCylinder.hh. Referenced by Dnn4piCylinder(). |
1.4.2