Changeset 35cdc46 in git for external/fastjet/ClusterSequence_TiledN2.cc
- Timestamp:
- Sep 3, 2014, 3:18:54 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- be2222c
- Parents:
- 5b5a56b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/ClusterSequence_TiledN2.cc
r5b5a56b r35cdc46 1 // STARTHEADER2 // $Id $1 //FJSTARTHEADER 2 // $Id: ClusterSequence_TiledN2.cc 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 // ENDHEADER28 29 30 // The plainN^2 part of the ClusterSequence class -- separated out29 //FJENDHEADER 30 31 32 // The tiled N^2 part of the ClusterSequence class -- separated out 31 33 // from the rest of the class implementation so as to speed up 32 34 // compilation of this particular part while it is under test. … … 39 41 #include "fastjet/ClusterSequence.hh" 40 42 #include "fastjet/internal/MinHeap.hh" 43 #include "fastjet/internal/TilingExtent.hh" 41 44 42 45 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh … … 94 97 _tile_size_phi = twopi / _n_tiles_phi; // >= _Rparam and fits in 2pi 95 98 96 // always include zero rapidity in the tiling region 97 _tiles_eta_min = 0.0; 98 _tiles_eta_max = 0.0; 99 // but go no further than following 100 const double maxrap = 7.0; 101 102 // and find out how much further one should go 103 for(unsigned int i = 0; i < _jets.size(); i++) { 104 double eta = _jets[i].rap(); 105 // first check if eta is in range -- to avoid taking into account 106 // very spurious rapidities due to particles with near-zero kt. 107 if (abs(eta) < maxrap) { 108 if (eta < _tiles_eta_min) {_tiles_eta_min = eta;} 109 if (eta > _tiles_eta_max) {_tiles_eta_max = eta;} 110 } 111 } 99 TilingExtent tiling_analysis(*this); 100 _tiles_eta_min = tiling_analysis.minrap(); 101 _tiles_eta_max = tiling_analysis.maxrap(); 102 103 // // always include zero rapidity in the tiling region 104 // _tiles_eta_min = 0.0; 105 // _tiles_eta_max = 0.0; 106 // // but go no further than following 107 // const double maxrap = 7.0; 108 // 109 // // and find out how much further one should go 110 // for(unsigned int i = 0; i < _jets.size(); i++) { 111 // double eta = _jets[i].rap(); 112 // // first check if eta is in range -- to avoid taking into account 113 // // very spurious rapidities due to particles with near-zero kt. 114 // if (abs(eta) < maxrap) { 115 // if (eta < _tiles_eta_min) {_tiles_eta_min = eta;} 116 // if (eta > _tiles_eta_max) {_tiles_eta_max = eta;} 117 // } 118 // } 112 119 113 120 // now adjust the values … … 167 174 //---------------------------------------------------------------------- 168 175 /// return the tile index corresponding to the given eta,phi point 169 int ClusterSequence::_tile_index(const double & eta, const double &phi) const {176 int ClusterSequence::_tile_index(const double eta, const double phi) const { 170 177 int ieta, iphi; 171 178 if (eta <= _tiles_eta_min) {ieta = 0;} … … 249 256 /// their "tagged" status is false; when a neighbour is added its 250 257 /// tagged status is set to true. 258 /// 259 /// Note that with a high level of warnings (-pedantic -Wextra -ansi, 260 /// gcc complains about tile_index maybe being used uninitialised for 261 /// oldB in ClusterSequence::_minheap_faster_tiled_N2_cluster(). We 262 /// have explicitly checked that it was harmless so we could disable 263 /// the gcc warning by hand using the construct below 264 /// 265 /// #pragma GCC diagnostic push 266 /// #pragma GCC diagnostic ignored "-Wpragmas" 267 /// #pragma GCC diagnostic ignored "-Wuninitialized" 268 /// #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" 269 /// ... 270 /// #pragma GCC diagnostic pop 271 /// 272 /// the @GCC diagnostic push/pop directive was only introduced in 273 /// gcc-4.6, so for broader usage, we'd need to insert #pragma GCC 274 /// diagnostic ignored "-Wpragmas" at the top of this file 251 275 inline void ClusterSequence::_add_untagged_neighbours_to_tile_union( 252 276 const int tile_index, … … 274 298 TiledJet * jetA = briefjets, * jetB; 275 299 TiledJet oldB; 276 oldB.tile_index=0; // prevents a gcc warning 300 oldB.tile_index=0; // prevents a gcc warning 277 301 278 302 // will be used quite deep inside loops, but declare it here so that … … 517 541 TiledJet * jetA = briefjets, * jetB; 518 542 TiledJet oldB; 519 oldB.tile_index=0; // prevents a gcc warning 543 oldB.tile_index=0; // prevents a gcc warning 520 544 521 545 // will be used quite deep inside loops, but declare it here so that … … 555 579 // when we set NN for both jetA and jetB on the RH tiles. 556 580 } 557 558 581 559 582 // now create the diJ (where J is i's NN) table -- remember that … … 721 744 } 722 745 723 724 725 746 //---------------------------------------------------------------------- 726 747 /// run a tiled clustering, with our minheap for keeping track of the … … 735 756 TiledJet oldB; 736 757 oldB.tile_index=0; // prevents a gcc warning 737 738 758 739 759 // will be used quite deep inside loops, but declare it here so that
Note:
See TracChangeset
for help on using the changeset viewer.