Fork me on GitHub

Ignore:
Timestamp:
Sep 3, 2014, 3:18:54 PM (10 years ago)
Author:
Pavel Demin <demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
be2222c
Parents:
5b5a56b
Message:

upgrade FastJet to version 3.1.0-beta.1, upgrade Nsubjettiness to version 2.1.0, add SoftKiller version 1.0.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/ClusterSequence_TiledN2.cc

    r5b5a56b r35cdc46  
    1 //STARTHEADER
    2 // $Id$
     1//FJSTARTHEADER
     2// $Id: ClusterSequence_TiledN2.cc 3433 2014-07-23 08:17:03Z salam $
    33//
    4 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     4// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
    55//
    66//----------------------------------------------------------------------
     
    1313//
    1414//  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
    1617//  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.
    1820//
    1921//  FastJet is distributed in the hope that it will be useful,
     
    2527//  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
    2628//----------------------------------------------------------------------
    27 //ENDHEADER
    28 
    29 
    30 // The plain N^2 part of the ClusterSequence class -- separated out
     29//FJENDHEADER
     30
     31
     32// The tiled N^2 part of the ClusterSequence class -- separated out
    3133// from the rest of the class implementation so as to speed up
    3234// compilation of this particular part while it is under test.
     
    3941#include "fastjet/ClusterSequence.hh"
    4042#include "fastjet/internal/MinHeap.hh"
     43#include "fastjet/internal/TilingExtent.hh"
    4144
    4245FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
     
    9497  _tile_size_phi = twopi / _n_tiles_phi; // >= _Rparam and fits in 2pi
    9598
    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  // }
    112119
    113120  // now adjust the values
     
    167174//----------------------------------------------------------------------
    168175/// return the tile index corresponding to the given eta,phi point
    169 int ClusterSequence::_tile_index(const double & eta, const double & phi) const {
     176int ClusterSequence::_tile_index(const double eta, const double phi) const {
    170177  int ieta, iphi;
    171178  if      (eta <= _tiles_eta_min) {ieta = 0;}
     
    249256/// their "tagged" status is false; when a neighbour is added its
    250257/// 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
    251275inline void ClusterSequence::_add_untagged_neighbours_to_tile_union(
    252276               const int tile_index,
     
    274298  TiledJet * jetA = briefjets, * jetB;
    275299  TiledJet oldB;
    276   oldB.tile_index=0; // prevents a gcc warning 
     300  oldB.tile_index=0; // prevents a gcc warning
    277301
    278302  // will be used quite deep inside loops, but declare it here so that
     
    517541  TiledJet * jetA = briefjets, * jetB;
    518542  TiledJet oldB;
    519   oldB.tile_index=0; // prevents a gcc warning 
     543  oldB.tile_index=0; // prevents a gcc warning
    520544
    521545  // will be used quite deep inside loops, but declare it here so that
     
    555579    // when we set NN for both jetA and jetB on the RH tiles.
    556580  }
    557 
    558581 
    559582  // now create the diJ (where J is i's NN) table -- remember that
     
    721744}
    722745
    723 
    724 
    725746//----------------------------------------------------------------------
    726747/// run a tiled clustering, with our minheap for keeping track of the
     
    735756  TiledJet oldB;
    736757  oldB.tile_index=0; // prevents a gcc warning
    737  
    738758
    739759  // will be used quite deep inside loops, but declare it here so that
Note: See TracChangeset for help on using the changeset viewer.