Changeset 35cdc46 in git for external/fastjet/internal
- Timestamp:
- Sep 3, 2014, 3:18:54 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- be2222c
- Parents:
- 5b5a56b
- Location:
- external/fastjet/internal
- Files:
-
- 5 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/internal/ClosestPair2D.hh
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id: ClosestPair2D.hh 2577 2011-09-13 15:11:38Z salam $3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez1 //FJSTARTHEADER 2 // $Id: ClosestPair2D.hh 3433 2014-07-23 08:17:03Z salam $ 3 // 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 #ifndef __FASTJET_CLOSESTPAIR2D__HH__ -
external/fastjet/internal/ClosestPair2DBase.hh
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id: ClosestPair2DBase.hh 2577 2011-09-13 15:11:38Z salam $1 //FJSTARTHEADER 2 // $Id: ClosestPair2DBase.hh 3433 2014-07-23 08:17:03Z salam $ 3 3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 #ifndef __FASTJET_CLOSESTPAIR2DBASE__HH__ -
external/fastjet/internal/ClusterSequence_N2.icc
r5b5a56b r35cdc46 4 4 #include "fastjet/ClusterSequence.hh" 5 5 6 // STARTHEADER6 //FJSTARTHEADER 7 7 // $Id: ClusterSequence_N2.cc 1351 2009-01-09 18:03:03Z salam $ 8 8 // 9 // Copyright (c) 2005-20 09, Matteo Cacciari, GavinSalam and Gregory Soyez9 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 10 10 // 11 11 //---------------------------------------------------------------------- … … 18 18 // 19 19 // The algorithms that underlie FastJet have required considerable 20 // development and are described in hep-ph/0512210. If you use 20 // development. They are described in the original FastJet paper, 21 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 21 22 // FastJet as part of work towards a scientific publication, please 22 // include a citation to the FastJet paper. 23 // quote the version you use and include a citation to the manual and 24 // optionally also to hep-ph/0512210. 23 25 // 24 26 // FastJet is distributed in the hope that it will be useful, … … 28 30 // 29 31 // You should have received a copy of the GNU General Public License 30 // along with FastJet; if not, write to the Free Software 31 // Foundation, Inc.: 32 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 32 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 33 33 //---------------------------------------------------------------------- 34 // ENDHEADER34 //FJENDHEADER 35 35 36 36 //---------------------------------------------------------------------- -
external/fastjet/internal/Dnn2piCylinder.hh
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id: Dnn2piCylinder.hh 2577 2011-09-13 15:11:38Z salam $3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez1 //FJSTARTHEADER 2 // $Id: Dnn2piCylinder.hh 3442 2014-07-24 07:20:49Z salam $ 3 // 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 … … 73 75 /// Returns the index of the nearest neighbour of point labelled 74 76 /// by ii (assumes ii is valid) 75 int NearestNeighbourIndex(const int &ii) const ;77 int NearestNeighbourIndex(const int ii) const ; 76 78 77 79 /// Returns the distance to the nearest neighbour of point labelled 78 80 /// by index ii (assumes ii is valid) 79 double NearestNeighbourDistance(const int &ii) const ;81 double NearestNeighbourDistance(const int ii) const ; 80 82 81 83 /// Returns true iff the given index corresponds to a point that 82 84 /// exists in the DNN structure (meaning that it has been added, and 83 85 /// not removed in the meantime) 84 bool Valid(const int &index) const;86 bool Valid(const int index) const; 85 87 86 88 void RemoveAndAddPoints(const std::vector<int> & indices_to_remove, … … 216 218 /// initialised the class with instructions to ignore this problem the 217 219 /// program will detect and ignore it, or crash. 218 inline int Dnn2piCylinder::NearestNeighbourIndex(const int ¤t) const {220 inline int Dnn2piCylinder::NearestNeighbourIndex(const int current) const { 219 221 int main_index = _mirror_info[current].main_index; 220 222 int mirror_index = _mirror_info[current].mirror_index; … … 241 243 } 242 244 243 inline double Dnn2piCylinder::NearestNeighbourDistance(const int ¤t) const {245 inline double Dnn2piCylinder::NearestNeighbourDistance(const int current) const { 244 246 int main_index = _mirror_info[current].main_index; 245 247 int mirror_index = _mirror_info[current].mirror_index; … … 256 258 } 257 259 258 inline bool Dnn2piCylinder::Valid(const int &index) const {260 inline bool Dnn2piCylinder::Valid(const int index) const { 259 261 return (_DNN->Valid(_mirror_info[index].main_index)); 260 262 } -
external/fastjet/internal/Dnn3piCylinder.hh
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id: Dnn3piCylinder.hh 2577 2011-09-13 15:11:38Z salam $3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez1 //FJSTARTHEADER 2 // $Id: Dnn3piCylinder.hh 3442 2014-07-24 07:20:49Z salam $ 3 // 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 … … 70 72 /// Returns the index of the nearest neighbour of point labelled 71 73 /// by ii (assumes ii is valid) 72 int NearestNeighbourIndex(const int &ii) const ;74 int NearestNeighbourIndex(const int ii) const ; 73 75 74 76 /// Returns the distance to the nearest neighbour of point labelled 75 77 /// by index ii (assumes ii is valid) 76 double NearestNeighbourDistance(const int &ii) const ;78 double NearestNeighbourDistance(const int ii) const ; 77 79 78 80 /// Returns true iff the given index corresponds to a point that 79 81 /// exists in the DNN structure (meaning that it has been added, and 80 82 /// not removed in the meantime) 81 bool Valid(const int &index) const;83 bool Valid(const int index) const; 82 84 83 85 void RemoveAndAddPoints(const std::vector<int> & indices_to_remove, … … 204 206 /// initialised the class with instructions to ignore this problem the 205 207 /// program will detect and ignore it, or crash. 206 inline int Dnn3piCylinder::NearestNeighbourIndex(const int ¤t) const {208 inline int Dnn3piCylinder::NearestNeighbourIndex(const int current) const { 207 209 int main_index = _mirror_info[current].main_index; 208 210 int mirror_index = _mirror_info[current].mirror_index; … … 229 231 } 230 232 231 inline double Dnn3piCylinder::NearestNeighbourDistance(const int ¤t) const {233 inline double Dnn3piCylinder::NearestNeighbourDistance(const int current) const { 232 234 int main_index = _mirror_info[current].main_index; 233 235 int mirror_index = _mirror_info[current].mirror_index; … … 244 246 } 245 247 246 inline bool Dnn3piCylinder::Valid(const int &index) const {248 inline bool Dnn3piCylinder::Valid(const int index) const { 247 249 return (_DNN->Valid(_mirror_info[index].main_index)); 248 250 } -
external/fastjet/internal/Dnn4piCylinder.hh
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id: Dnn4piCylinder.hh 2577 2011-09-13 15:11:38Z salam $1 //FJSTARTHEADER 2 // $Id: Dnn4piCylinder.hh 3442 2014-07-24 07:20:49Z salam $ 3 3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 … … 57 59 /// Returns the index of the nearest neighbour of point labelled 58 60 /// by ii (assumes ii is valid) 59 int NearestNeighbourIndex(const int &ii) const ;61 int NearestNeighbourIndex(const int ii) const ; 60 62 61 63 /// Returns the distance to the nearest neighbour of point labelled 62 64 /// by index ii (assumes ii is valid) 63 double NearestNeighbourDistance(const int &ii) const ;65 double NearestNeighbourDistance(const int ii) const ; 64 66 65 67 /// Returns true iff the given index corresponds to a point that 66 68 /// exists in the DNN structure (meaning that it has been added, and 67 69 /// not removed in the meantime) 68 bool Valid(const int &index) const;70 bool Valid(const int index) const; 69 71 70 72 void RemoveAndAddPoints(const std::vector<int> & indices_to_remove, … … 98 100 // functions defined above 99 101 100 inline int Dnn4piCylinder::NearestNeighbourIndex(const int ¤t) const {102 inline int Dnn4piCylinder::NearestNeighbourIndex(const int current) const { 101 103 return (_DNN1->NearestNeighbourDistance(current) < 102 104 _DNN2->NearestNeighbourDistance(current)) ? … … 105 107 } 106 108 107 inline double Dnn4piCylinder::NearestNeighbourDistance(const int ¤t) const {109 inline double Dnn4piCylinder::NearestNeighbourDistance(const int current) const { 108 110 return (_DNN1->NearestNeighbourDistance(current) < 109 111 _DNN2->NearestNeighbourDistance(current)) ? … … 112 114 } 113 115 114 inline bool Dnn4piCylinder::Valid(const int &index) const {116 inline bool Dnn4piCylinder::Valid(const int index) const { 115 117 return (_DNN1->Valid(index) && _DNN2->Valid(index)); 116 118 } -
external/fastjet/internal/DnnPlane.hh
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id: DnnPlane.hh 2577 2011-09-13 15:11:38Z salam $3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez1 //FJSTARTHEADER 2 // $Id: DnnPlane.hh 3442 2014-07-24 07:20:49Z salam $ 3 // 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 … … 44 46 /// class derived from DynamicNearestNeighbours that provides an 45 47 /// implementation for the Euclidean plane 48 /// 49 /// This class that uses CGAL Delaunay triangulation for most of the 50 /// work (it allows for easy and efficient removal and addition of 51 /// points and circulation over a point's neighbours). The treatment 52 /// of coincident points is not supported by CGAL and is implemented 53 /// according to the method specified in 54 /// issue-tracker/2012-02-CGAL-coincident/METHOD 46 55 /// \endif 47 56 class DnnPlane : public DynamicNearestNeighbours { … … 57 66 /// Returns the index of the nearest neighbour of point labelled 58 67 /// by ii (assumes ii is valid) 59 int NearestNeighbourIndex(const int &ii) const ;68 int NearestNeighbourIndex(const int ii) const ; 60 69 61 70 /// Returns the distance to the nearest neighbour of point labelled 62 71 /// by index ii (assumes ii is valid) 63 double NearestNeighbourDistance(const int &ii) const ;72 double NearestNeighbourDistance(const int ii) const ; 64 73 65 74 /// Returns true iff the given index corresponds to a point that 66 75 /// exists in the DNN structure (meaning that it has been added, and 67 76 /// not removed in the meantime) 68 bool Valid(const int &index) const;77 bool Valid(const int index) const; 69 78 70 79 void RemoveAndAddPoints(const std::vector<int> & indices_to_remove, … … 80 89 double phi(const int i) const; 81 90 82 91 private: 83 92 84 93 /// Structure containing a vertex_handle and cached information on … … 88 97 double NNdistance; 89 98 int NNindex; 99 int coincidence; // ==vertex->info.val() if no coincidence 100 // points to the coinciding SV in case of coincidence 90 101 // later on for cylinder put a second vertex? 91 102 }; … … 95 106 bool _verbose; 96 107 97 static const bool _crash_on_coincidence = true;98 //static const bool _crash_on_coincidence = false;108 //static const bool _crash_on_coincidence = true; 109 static const bool _crash_on_coincidence = false; 99 110 100 111 Triangulation _TR; /// CGAL object for dealing with triangulations … … 111 122 /// Determines the index and distance of the nearest neighbour to 112 123 /// point j and puts the information into the _supervertex entry for j 113 void _SetNearest(const int &j);124 void _SetNearest(const int j); 114 125 115 126 //---------------------------------------------------------------------- … … 123 134 /// Note that j is NOT pushed onto indices_of_updated_neighbours -- 124 135 /// if you want it there, put it there yourself. 125 void _SetAndUpdateNearest(const int &j,136 void _SetAndUpdateNearest(const int j, 126 137 std::vector<int> & indices_of_updated_neighbours); 127 138 128 139 /// given a vertex_handle returned by CGAL on insertion of a new 129 /// points, crash if it turns out that it corresponds to a vertex 130 /// that we already knew about (usually because two points coincide) 131 void _CrashIfVertexPresent(const Vertex_handle & vertex, 132 const int & its_index); 133 140 /// points, returns the coinciding vertex's value if it turns out 141 /// that it corresponds to a vertex that we already knew about 142 /// (usually because two points coincide) 143 int _CheckIfVertexPresent(const Vertex_handle & vertex, 144 const int its_index); 145 146 //---------------------------------------------------------------------- 147 /// if the distance between 'pref' and 'candidate' is smaller (or 148 /// equal) than the one between 'pref' and 'near', return true and 149 /// set 'mindist' to that distance. Note that it is assumed that 150 /// 'mindist' is the euclidian distance between 'pref' and 'near' 151 /// 152 /// Note that the 'near' point is passed through its vertex rather 153 /// than as a point. This allows us to handle cases where we have no min 154 /// yet (near is the infinite vertex) 155 inline bool _is_closer_to(const Point &pref, 156 const Point &candidate, 157 const Vertex_handle &near, 158 double & dist, 159 double & mindist){ 160 dist = _euclid_distance(pref, candidate); 161 return _is_closer_to_with_hint(pref, candidate, near, dist, mindist); 162 } 163 164 /// same as '_is_closer_to' except that 'dist' already contains the 165 /// distance between 'pref' and 'candidate' 166 inline bool _is_closer_to_with_hint(const Point &pref, 167 const Point &candidate, 168 const Vertex_handle &near, 169 const double & dist, 170 double & mindist){ 171 172 // check if 'dist', the pre-computed distance between 'candidate' 173 // and 'pref' is smaller than the distance between 'pref' and its 174 // currently registered nearest neighbour 'near' (and update 175 // things if it is) 176 // 177 // Interestingly enough, it has to be pointed out that the use of 178 // 'abs' instead of 'std::abs' returns wrong results (apparently 179 // ints without any compiler warning) 180 // 181 // The (near != NULL) test is there for one single reason: when 182 // checking that a newly inserted point is not closer than a 183 // previous NN, if that distance comparison involves a "nearly 184 // degenerate" distance we need to access near->point. But 185 // sometimes, in the course of RemoveAndAddPoints, its previous NN 186 // has been deleted and its vertex (corresponding to 'near') set 187 // to NULL. This is not a problem as all points having a deleted 188 // point as NN will have their NN explicitly recomputed at the end 189 // of RemoveAndAddPoints so here we should just make sure there is 190 // no crash... that's done by checking (near != NULL) 191 if ((std::abs(dist-mindist)<DISTANCE_FOR_CGAL_CHECKS) && 192 (near != NULL) && 193 (_euclid_distance(candidate, near->point())<DISTANCE_FOR_CGAL_CHECKS)){ 194 // we're in a situation where there might be a rounding issue, 195 // use CGAL's distance computation to get it right 196 // 197 // Note that in the test right above, 198 // (abs(dist-mindist)<1e-12) guarantees that the current 199 // nearest point is not the infinite vertex and thus 200 // nearest->point() is not ill-defined 201 if (_verbose) std::cout << "using CGAL's distance ordering" << std::endl; 202 if (CGAL::compare_distance_to_point(pref, candidate, near->point())!=CGAL::LARGER){ 203 mindist = dist; 204 return true; 205 } 206 } else if (dist <= mindist) { 207 // Note that the use of a <= in the above expression (instead of 208 // a strict ordering <) is important in one case: when checking 209 // if a new point is the new NN of one of the points in its 210 // neighbourhood, in case of distances being ==, we are sure 211 // that 'candidate' is in a cell adjacent to 'pref' while it may 212 // no longer be the case for 'near' 213 mindist = dist; 214 return true; 215 } 216 217 return false; 218 } 219 220 /// if a distance between a point and 2 others is smaller than this 221 /// and the distance between the two points is also smaller than this 222 /// then use CGAL to compare the distances. 223 static const double DISTANCE_FOR_CGAL_CHECKS; 224 134 225 }; 135 226 … … 138 229 // functions defined above 139 230 140 inline int DnnPlane::NearestNeighbourIndex(const int &ii) const {231 inline int DnnPlane::NearestNeighbourIndex(const int ii) const { 141 232 return _supervertex[ii].NNindex;} 142 233 143 inline double DnnPlane::NearestNeighbourDistance(const int &ii) const {234 inline double DnnPlane::NearestNeighbourDistance(const int ii) const { 144 235 return _supervertex[ii].NNdistance;} 145 236 146 inline bool DnnPlane::Valid(const int &index) const {237 inline bool DnnPlane::Valid(const int index) const { 147 238 if (index >= 0 && index < static_cast<int>(_supervertex.size())) { 148 239 return (_supervertex[index].vertex != NULL);} else {return false;} } -
external/fastjet/internal/DynamicNearestNeighbours.hh
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id: DynamicNearestNeighbours.hh 2687 2011-11-14 11:17:51Z soyez$1 //FJSTARTHEADER 2 // $Id: DynamicNearestNeighbours.hh 3619 2014-08-13 14:17:19Z salam $ 3 3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 … … 37 39 #include<cassert> 38 40 #include "fastjet/internal/numconsts.hh" 41 #include "fastjet/Error.hh" 39 42 40 43 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh … … 68 71 /// Nearest Neighbours code 69 72 /// \endif 70 class DnnError {73 class DnnError : public Error { 71 74 public: 72 75 // constructors 73 DnnError() {;}; 74 DnnError(const std::string & message_in) { 75 _message = message_in; std::cerr << message_in << std::endl;}; 76 77 std::string message() const {return _message;}; 78 79 private: 80 std::string _message; 76 //DnnError() {} 77 DnnError(const std::string & message_in) : Error(message_in) {} 81 78 }; 82 79 … … 112 109 /// Returns the index of the nearest neighbour of point labelled 113 110 /// by ii (assumes ii is valid) 114 virtual int NearestNeighbourIndex(const int &ii) const = 0;111 virtual int NearestNeighbourIndex(const int ii) const = 0; 115 112 116 113 /// Returns the distance to the nearest neighbour of point labelled 117 114 /// by index ii (assumes ii is valid) 118 virtual double NearestNeighbourDistance(const int &ii) const = 0;115 virtual double NearestNeighbourDistance(const int ii) const = 0; 119 116 120 117 /// Returns true iff the given index corresponds to a point that 121 118 /// exists in the DNN structure (meaning that it has been added, and 122 119 /// not removed in the meantime) 123 virtual bool Valid(const int &index) const = 0;120 virtual bool Valid(const int index) const = 0; 124 121 125 122 /// remove the points labelled by the std::vector indices_to_remove, and … … 141 138 /// Remove the point labelled by index and return the list of 142 139 /// points whose nearest neighbours have changed in the process 143 inline void RemovePoint (const int &index,140 inline void RemovePoint (const int index, 144 141 std::vector<int> & indices_of_updated_neighbours) { 145 142 std::vector<int> indices_added; … … 158 155 /// point). 159 156 inline void RemoveCombinedAddCombination( 160 const int & index1, const int &index2,157 const int index1, const int index2, 161 158 const EtaPhi & newpoint, 162 159 int & index3, -
external/fastjet/internal/IsBase.hh
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id: IsBase.hh 3 071 2013-04-01 12:52:46Z cacciari$1 //FJSTARTHEADER 2 // $Id: IsBase.hh 3433 2014-07-23 08:17:03Z salam $ 3 3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 #ifndef __FASTJET_INTERNAL_IS_BASE_HH__ -
external/fastjet/internal/LimitedWarning.hh
r5b5a56b r35cdc46 2 2 #define __FASTJET_INTERNALLIMITEDWARNING_HH__ 3 3 4 // STARTHEADER5 // $Id: LimitedWarning.hh 2577 2011-09-13 15:11:38Z salam $4 //FJSTARTHEADER 5 // $Id: LimitedWarning.hh 3433 2014-07-23 08:17:03Z salam $ 6 6 // 7 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez7 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 8 8 // 9 9 //---------------------------------------------------------------------- … … 16 16 // 17 17 // The algorithms that underlie FastJet have required considerable 18 // development and are described in hep-ph/0512210. If you use 18 // development. They are described in the original FastJet paper, 19 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 19 20 // FastJet as part of work towards a scientific publication, please 20 // include a citation to the FastJet paper. 21 // quote the version you use and include a citation to the manual and 22 // optionally also to hep-ph/0512210. 21 23 // 22 24 // FastJet is distributed in the hope that it will be useful, … … 28 30 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 29 31 //---------------------------------------------------------------------- 30 // ENDHEADER32 //FJENDHEADER 31 33 32 34 -
external/fastjet/internal/MinHeap.hh
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id: MinHeap.hh 2577 2011-09-13 15:11:38Z salam $1 //FJSTARTHEADER 2 // $Id: MinHeap.hh 3433 2014-07-23 08:17:03Z salam $ 3 3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 #ifndef __FASTJET_MINHEAP__HH__ … … 50 52 /// expansion to a maximum size max_size; 51 53 MinHeap (const std::vector<double> & values, unsigned int max_size) : 52 _heap(max_size) {_initialise(values);}; 54 _heap(max_size) {initialise(values);} 55 56 /// do the minimal setup for a MinHeap that can reach max_size; 57 /// initialisation must be performed later with the actual values. 58 MinHeap (unsigned int max_size) : _heap(max_size) {} 53 59 54 60 /// constructor in which the the maximum size is the size of the values array 55 61 MinHeap (const std::vector<double> & values) : 56 _heap(values.size()) {_initialise(values);}; 57 62 _heap(values.size()) {initialise(values);} 63 64 /// initialise the heap with the supplied values. Should only be called if 65 /// the constructor did not supply values. 66 void initialise(const std::vector<double> & values); 67 58 68 /// return the location of the minimal value on the heap 59 69 inline unsigned int minloc() const { 60 return (_heap[0].minloc) - &(_heap[0]);} ;70 return (_heap[0].minloc) - &(_heap[0]);} 61 71 62 72 /// return the minimal value on the heap 63 inline double minval() const {return _heap[0].minloc->value;} ;73 inline double minval() const {return _heap[0].minloc->value;} 64 74 65 inline double operator[](int i) const {return _heap[i].value;} ;75 inline double operator[](int i) const {return _heap[i].value;} 66 76 67 77 /// remove the value at the specified location (i.e. replace it with … … 82 92 std::vector<ValueLoc> _heap; 83 93 84 void _initialise(const std::vector<double> & values);85 94 86 95 -
external/fastjet/internal/SearchTree.hh
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id: SearchTree.hh 3 107 2013-05-03 15:47:47Z salam $1 //FJSTARTHEADER 2 // $Id: SearchTree.hh 3433 2014-07-23 08:17:03Z salam $ 3 3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 … … 188 190 public: 189 191 190 // so that it can access ou t_node object;192 // so that it can access our _node object; 191 193 // note: "class U" needed for clang (v1.1 branches/release_27) compilation 192 template<class U> friend class SearchTree<U>::const_circulator; 194 // 2014-07-22: as reported by Torbjorn Sjostrand, 195 // the next line was giving a warning with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) 196 // (dependent nested name specifier 'SearchTree<U>::' for friend class declaration is not supported) 197 // Just commenting it out, things still seem to work; same with a template of type T 198 //template<class U> friend class SearchTree<U>::const_circulator; 199 friend class SearchTree<T>::const_circulator; 193 200 friend class SearchTree<T>; 194 201 -
external/fastjet/internal/Triangulation.hh
r5b5a56b r35cdc46 3 3 #define __FASTJET_TRIANGULATION__ 4 4 5 // STARTHEADER6 // $Id: Triangulation.hh 2595 2011-09-23 09:05:04Z salam $5 //FJSTARTHEADER 6 // $Id: Triangulation.hh 3433 2014-07-23 08:17:03Z salam $ 7 7 // 8 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez8 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 9 9 // 10 10 //---------------------------------------------------------------------- … … 17 17 // 18 18 // The algorithms that underlie FastJet have required considerable 19 // development and are described in hep-ph/0512210. If you use 19 // development. They are described in the original FastJet paper, 20 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 20 21 // FastJet as part of work towards a scientific publication, please 21 // include a citation to the FastJet paper. 22 // quote the version you use and include a citation to the manual and 23 // optionally also to hep-ph/0512210. 22 24 // 23 25 // FastJet is distributed in the hope that it will be useful, … … 29 31 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 30 32 //---------------------------------------------------------------------- 31 // ENDHEADER33 //FJENDHEADER 32 34 33 35 -
external/fastjet/internal/Voronoi.hh
r5b5a56b r35cdc46 2 2 #define __FASTJET__VORONOI_H__ 3 3 4 //STARTHEADER 5 // $Id: Voronoi.hh 2686 2011-11-14 09:28:22Z soyez $ 6 // 7 // Copyright (c) 1994 by AT&T Bell Laboratories (see below) 8 // 4 //FJSTARTHEADER 5 // $Id: Voronoi.hh 3433 2014-07-23 08:17:03Z salam $ 6 // 7 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 9 8 // 10 9 //---------------------------------------------------------------------- 11 // This file is included as part of FastJet but was mostly written by 12 // S. Fortune in C, put into C++ with memory management by S 13 // O'Sullivan, and with further interface and memeory management 14 // modifications by Gregory Soyez. 15 // 16 // Permission to use, copy, modify, and distribute this software for 17 // any purpose without fee is hereby granted, provided that this 18 // entire notice is included in all copies of any software which is or 19 // includes a copy or modification of this software and in all copies 20 // of the supporting documentation for such software. THIS SOFTWARE IS 21 // BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. 22 // IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY REPRESENTATION 23 // OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS 24 // SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 25 // 10 // This file is part of FastJet. 11 // 12 // FastJet is free software; you can redistribute it and/or modify 13 // it under the terms of the GNU General Public License as published by 14 // the Free Software Foundation; either version 2 of the License, or 15 // (at your option) any later version. 16 // 17 // The algorithms that underlie FastJet have required considerable 18 // development. They are described in the original FastJet paper, 19 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 20 // FastJet as part of work towards a scientific publication, please 21 // quote the version you use and include a citation to the manual and 22 // optionally also to hep-ph/0512210. 23 // 24 // FastJet is distributed in the hope that it will be useful, 25 // but WITHOUT ANY WARRANTY; without even the implied warranty of 26 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 // GNU General Public License for more details. 28 // 29 // You should have received a copy of the GNU General Public License 30 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 31 //---------------------------------------------------------------------- 27 // ENDHEADER32 //FJENDHEADER 28 33 29 34 -
external/fastjet/internal/base.hh
r5b5a56b r35cdc46 1 1 2 // STARTHEADER3 // $Id: base.hh 2717 2011-11-17 14:15:46Z salam $2 //FJSTARTHEADER 3 // $Id: base.hh 3433 2014-07-23 08:17:03Z salam $ 4 4 // 5 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez5 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 6 6 // 7 7 //---------------------------------------------------------------------- … … 14 14 // 15 15 // The algorithms that underlie FastJet have required considerable 16 // development and are described in hep-ph/0512210. If you use 16 // development. They are described in the original FastJet paper, 17 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 17 18 // FastJet as part of work towards a scientific publication, please 18 // include a citation to the FastJet paper. 19 // quote the version you use and include a citation to the manual and 20 // optionally also to hep-ph/0512210. 19 21 // 20 22 // FastJet is distributed in the hope that it will be useful, … … 26 28 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 27 29 //---------------------------------------------------------------------- 28 // ENDHEADER30 //FJENDHEADER 29 31 30 32 #ifndef __FASTJET_FASTJET_BASE_HH__ -
external/fastjet/internal/numconsts.hh
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id: numconsts.hh 2577 2011-09-13 15:11:38Z salam $1 //FJSTARTHEADER 2 // $Id: numconsts.hh 3433 2014-07-23 08:17:03Z salam $ 3 3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31
Note:
See TracChangeset
for help on using the changeset viewer.