Fork me on GitHub

Ignore:
Timestamp:
Dec 9, 2014, 1:27:13 PM (10 years ago)
Author:
Michele <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
37deb3b, 9e991f8
Parents:
f6b6ee7 (diff), e7e90df (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'TestFastJet310b1'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/JetDefinition.hh

    rf6b6ee7 r49234af  
    1 //STARTHEADER
    2 // $Id: JetDefinition.hh 2687 2011-11-14 11:17:51Z soyez $
    3 //
    4 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     1#ifndef __FASTJET_JETDEFINITION_HH__
     2#define __FASTJET_JETDEFINITION_HH__
     3
     4//FJSTARTHEADER
     5// $Id: JetDefinition.hh 3677 2014-09-09 22:45:25Z soyez $
     6//
     7// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
    58//
    69//----------------------------------------------------------------------
     
    1316//
    1417//  The algorithms that underlie FastJet have required considerable
    15 //  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
    1620//  FastJet as part of work towards a scientific publication, please
    17 //  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.
    1823//
    1924//  FastJet is distributed in the hope that it will be useful,
     
    2530//  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
    2631//----------------------------------------------------------------------
    27 //ENDHEADER
    28 
    29 #ifndef __FASTJET_JETDEFINITION_HH__
    30 #define __FASTJET_JETDEFINITION_HH__
     32//FJENDHEADER
    3133
    3234#include<cassert>
     
    4749/// clustering events with kt and cambridge style algorithms.
    4850enum Strategy {
    49   /// fastest form about 500..10^4
     51  /// Like N2MHTLazy9 in a number of respects, but does not calculate
     52  /// ghost-ghost distances and so does not carry out ghost-ghost
     53  /// recombination.
     54  ///
     55  /// If you want active ghosted areas, then this is only suitable for
     56  /// use with the anti-kt algorithm (or genkt with negative p), and
     57  /// does not produce any pure ghost jets. If used with active areas
     58  /// with Kt or Cam algorithms it will actually produce a passive
     59  /// area.
     60  ///
     61  /// Particles are deemed to be ghosts if their pt is below a
     62  /// threshold (currently 1e-50, hard coded as ghost_limit in
     63  /// LazyTiling9SeparateGhosts).
     64  ///
     65  /// Currently for events with a couple of thousand normal particles
     66  /// and O(10k) ghosts, this can be quicker than N2MHTLazy9, which
     67  /// would otherwise be the best strategy.
     68  ///
     69  /// New in FJ3.1
     70  N2MHTLazy9AntiKtSeparateGhosts   = -10,
     71  /// only looks into a neighbouring tile for a particle's nearest
     72  /// neighbour (NN) if that particle's in-tile NN is further than the
     73  /// distance to the edge of the neighbouring tile. Uses tiles of
     74  /// size R and a 3x3 tile grid around the particle.
     75  /// New in FJ3.1
     76  N2MHTLazy9   = -7,
     77  /// Similar to N2MHTLazy9, but uses tiles of size R/2 and a 5x5 tile
     78  /// grid around the particle.
     79  /// New in FJ3.1
     80  N2MHTLazy25   = -6,
     81  /// Like to N2MHTLazy9 but uses slightly different optimizations,
     82  /// e.g. for calculations of distance to nearest tile; as of
     83  /// 2014-07-18 it is slightly slower and not recommended for
     84  /// production use. To considered deprecated.
     85  /// New in FJ3.1
     86  N2MHTLazy9Alt   = -5,
     87  /// faster that N2Tiled above about 500 particles; differs from it
     88  /// by retainig the di(closest j) distances in a MinHeap (sort of
     89  /// priority queue) rather than a simple vector.
    5090  N2MinHeapTiled   = -4,
    5191  /// fastest from about 50..500
     
    5797  /// worse even than the usual N^3 algorithms
    5898  N3Dumb      =  0,
    59   /// automatic selection of the best (based on N)
     99  /// automatic selection of the best (based on N), including
     100  /// the LazyTiled strategies that are new to FJ3.1
    60101  Best        =  1,
    61102  /// best of the NlnN variants -- best overall for N>10^4.
     
    79120  /// (Does not work for R>=2pi)
    80121  NlnNCam      = 12, // 2piMultD
     122  /// the automatic strategy choice that was being made in FJ 3.0
     123  /// (restricted to strategies that were present in FJ 3.0)
     124  BestFJ30     =  21,
    81125  /// the plugin has been used...
    82126  plugin_strategy = 999
     
    87131/// \enum JetAlgorithm
    88132/// the various families of jet-clustering algorithm
     133//
     134// [Remember to update the "is_spherical()" routine if any further
     135// spherical algorithms are added to the list below]
    89136enum JetAlgorithm {
    90137  /// the longitudinally invariant kt algorithm
     
    102149  /// where p = extra_param()
    103150  genkt_algorithm=3,
    104   /// a version of cambridge with a special distance measure for particles
    105   /// whose pt is < extra_param()
     151  /// a version of cambridge with a special distance measure for
     152  /// particles whose pt is < extra_param(); this is not usually
     153  /// intended for end users, but is instead automatically selected
     154  /// when requesting a passive Cambridge area.
    106155  cambridge_for_passive_algorithm=11,
    107156  /// a version of genkt with a special distance measure for particles
    108157  /// whose pt is < extra_param() [relevant for passive areas when p<=0]
     158  /// ***** NB: THERE IS CURRENTLY NO IMPLEMENTATION FOR THIS ALG *******
    109159  genkt_for_passive_algorithm=13,
    110160  //.................................................................
     
    131181
    132182//======================================================================
    133 /// the various recombination schemes
     183/// The various recombination schemes
     184///
     185/// Note that the schemes that recombine with non-linear weighting of
     186/// the directions (e.g. pt2, winner-takes-all) are collinear safe
     187/// only for algorithms with a suitable ordering of the
     188/// recombinations: orderings in which, for particles of comparable
     189/// energies, small-angle clusterings take place before large-angle
     190/// clusterings. This property is satisfied by all gen-kt algorithms.
     191///
    134192enum RecombinationScheme {
    135193  /// summing the 4-momenta
     
    153211  /// no preprocessing
    154212  BIpt2_scheme=6,
     213  /// pt-based Winner-Takes-All (WTA) recombination: the
     214  /// result of the recombination has the rapidity, azimuth and mass
     215  /// of the the PseudoJet with the larger pt, and a pt equal to the
     216  /// sum of the two pt's
     217  WTA_pt_scheme=7,
     218  /// mod-p-based Winner-Takes-All (WTA) recombination: the result of
     219  /// the recombination gets the 3-vector direction and mass of the
     220  /// PseudoJet with the larger |3-momentum| (modp), and a
     221  /// |3-momentum| equal to the scalar sum of the two |3-momenta|.
     222  WTA_modp_scheme=8,
     223  // Energy-ordering can lead to dangerous situations with particles at
     224  // rest. We instead implement the WTA_modp_scheme
     225  //
     226  // // energy-based Winner-Takes-All (WTA) recombination: the result of
     227  // // the recombination gets the 3-vector direction and mass of the
     228  // // PseudoJet with the larger energy, and an energy equal to the
     229  // // to the sum of the two energies
     230  // WTA_E_scheme=8,
    155231  /// for the user's external scheme
    156232  external_scheme = 99
     
    244320                const Recombiner * recombiner_in,
    245321                Strategy strategy_in = Best) {
    246     *this = JetDefinition(jet_algorithm_in, R_in, external_scheme, strategy_in);
     322    *this = JetDefinition(jet_algorithm_in, R_in, xtra_param_in, external_scheme, strategy_in);
    247323    _recombiner = recombiner_in;
    248     set_extra_param(xtra_param_in);
    249324  }
    250325
     
    284359                RecombinationScheme recomb_scheme_in = E_scheme,
    285360                int nparameters_in = 1);
     361
     362  /// cluster the supplied particles and returns a vector of resulting
     363  /// jets, sorted by pt (or energy in the case of spherical,
     364  /// i.e. e+e-, algorithms). This routine currently only makes
     365  /// sense for "inclusive" type algorithms.
     366  template <class L>
     367  std::vector<PseudoJet> operator()(const std::vector<L> & particles) const;
    286368 
    287369  /// R values larger than max_allowable_R are not allowed.
     
    297379
    298380  /// set the recombiner class to the one provided
     381  ///
     382  /// Note that in order to associate to a jet definition a recombiner
     383  /// from another jet definition, it is strongly recommended to use
     384  /// the set_recombiner(const JetDefinition &) method below. The
     385  /// latter correctly handles the situations where the jet definition
     386  /// owns the recombiner (i.e. where delete_recombiner_when_unused
     387  /// has been called). In such cases, using set_recombiner(const
     388  /// Recombiner *) may lead to memory corruption.
    299389  void set_recombiner(const Recombiner * recomb) {
    300     if (_recombiner_shared()) _recombiner_shared.reset(recomb);
     390    if (_shared_recombiner()) _shared_recombiner.reset(recomb);
    301391    _recombiner = recomb;
    302392    _default_recombiner = DefaultRecombiner(external_scheme);
    303393  }
    304394
     395  /// set the recombiner to be the same as the one of 'other_jet_def'
     396  ///
     397  /// Note that this is the recommended method to associate to a jet
     398  /// definition the recombiner from another jet definition. Compared
     399  /// to the set_recombiner(const Recombiner *) above, it correctly
     400  /// handles the case where the jet definition owns the recombiner
     401  /// (i.e. where delete_recombiner_when_unused has been called)
     402  void set_recombiner(const JetDefinition &other_jet_def);
     403
    305404  /// calling this tells the JetDefinition to handle the deletion of
    306   /// the recombiner when it is no longer used
     405  /// the recombiner when it is no longer used. (Should not be called
     406  /// if the recombiner was initialised from a JetDef whose recombiner
     407  /// was already scheduled to delete itself - memory handling will
     408  /// already be automatic across both JetDef's in that case).
    307409  void delete_recombiner_when_unused();
    308410
     
    310412  const Plugin * plugin() const {return _plugin;};
    311413
    312   /// allows to let the JetDefinition handle the deletion of the
     414  /// calling this causes the JetDefinition to handle the deletion of the
    313415  /// plugin when it is no longer used
    314416  void delete_plugin_when_unused();
     
    333435  void set_extra_param(double xtra_param) {_extra_param = xtra_param;}
    334436
    335   /// return a pointer to the currently defined recombiner.
     437  /// returns a pointer to the currently defined recombiner.
    336438  ///
    337439  /// Warning: the pointer may be to an internal recombiner (for
     
    347449
    348450  /// returns true if the current jet definitions shares the same
    349   /// recombiner as teh one passed as an argument
     451  /// recombiner as the one passed as an argument
    350452  bool has_same_recombiner(const JetDefinition &other_jd) const;
     453
     454  /// returns true if the jet definition involves an algorithm
     455  /// intended for use on a spherical geometry (e.g. e+e- algorithms,
     456  /// as opposed to most pp algorithms, which use a cylindrical,
     457  /// rapidity-phi geometry).
     458  bool is_spherical() const;
    351459
    352460  /// return a textual description of the current jet definition
    353461  std::string description() const;
    354462
     463  /// returns a description not including the recombiner information
     464  std::string description_no_recombiner() const;
     465
     466  /// a short textual description of the algorithm jet_alg
     467  static std::string algorithm_description(const JetAlgorithm jet_alg);
     468
     469  /// the number of parameters associated to a given jet algorithm
     470  static unsigned int n_parameters_for_algorithm(const JetAlgorithm jet_alg);
    355471
    356472public:
     
    462578    virtual bool exclusive_sequence_meaningful() const {return false;}
    463579
     580    /// returns true if the plugin implements an algorithm intended
     581    /// for use on a spherical geometry (e.g. e+e- algorithms, as
     582    /// opposed to most pp algorithms, which use a cylindrical,
     583    /// rapidity-phi geometry).
     584    virtual bool is_spherical() const {return false;}
     585
    464586    /// a destructor to be replaced if necessary in derived classes...
    465587    virtual ~Plugin() {};
     
    481603  DefaultRecombiner _default_recombiner;
    482604  const Recombiner * _recombiner;
    483   SharedPtr<const Recombiner> _recombiner_shared;
     605  SharedPtr<const Recombiner> _shared_recombiner;
    484606
    485607};
     
    516638
    517639
    518 
    519 
    520 
    521640FASTJET_END_NAMESPACE
    522641
     642// include ClusterSequence which includes the implementation of the
     643// templated JetDefinition::operator()(...) member
     644#include "fastjet/ClusterSequence.hh"
     645
     646
    523647#endif // __FASTJET_JETDEFINITION_HH__
Note: See TracChangeset for help on using the changeset viewer.