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/tools/Filter.hh

    r5b5a56b r35cdc46  
    22#define __FASTJET_TOOLS_FILTER_HH__
    33
    4 //STARTHEADER
    5 // $Id: Filter.hh 2694 2011-11-14 22:27:51Z salam $
    6 //
    7 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     4//FJSTARTHEADER
     5// $Id: Filter.hh 3494 2014-07-30 20:38:48Z soyez $
     6//
     7// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
    88//
    99//----------------------------------------------------------------------
     
    1616//
    1717//  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
    1920//  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.
    2123//
    2224//  FastJet is distributed in the hope that it will be useful,
     
    2830//  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
    2931//----------------------------------------------------------------------
    30 //ENDHEADER
     32//FJENDHEADER
    3133
    3234#include <fastjet/ClusterSequence.hh>
     
    98100  /// Note: this is just for derived classes
    99101  ///       a Filter initialised through this constructor will not work!
    100   Filter() : _Rfiltfunc(0){};
     102  Filter() : _Rfiltfunc(0), _initialised(false){};
    101103
    102104  /// define a filter that decomposes a jet into subjets using a
     
    113115  /// ghosts
    114116  Filter(JetDefinition subjet_def, Selector selector, double rho = 0.0) :
    115     _subjet_def(subjet_def), _Rfiltfunc(0), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0) {}
     117    _subjet_def(subjet_def), _Rfiltfunc(0), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0), _initialised(true) {}
    116118
    117119  /// Same as the full constructor (see above) but just specifying the radius
     
    121123  ///  \param Rfilt   the filtering radius
    122124  Filter(double Rfilt, Selector selector, double rho = 0.0) :
    123     _Rfiltfunc(0), _Rfilt(Rfilt), _selector(selector), _rho(rho), _subtractor(0) {
     125    _Rfiltfunc(0), _Rfilt(Rfilt), _selector(selector), _rho(rho), _subtractor(0), _initialised(true) {
    124126    if (_Rfilt<0)
    125127      throw Error("Attempt to create a Filter with a negative filtering radius");
     
    133135  ///  \param Rfilt_func   the filtering radius function of a PseudoJet
    134136  Filter(FunctionOfPseudoJet<double> *Rfilt_func, Selector selector, double rho = 0.0) :
    135     _Rfiltfunc(Rfilt_func), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0) {}
     137    _Rfiltfunc(Rfilt_func), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0), _initialised(true) {}
    136138
    137139  /// default dtor
     
    140142  /// Set a subtractor that is applied to all individual subjets before
    141143  /// deciding which ones to keep. It takes precedence over a non-zero rho.
    142   void set_subtractor(const Transformer * subtractor) {_subtractor = subtractor;}
     144  void set_subtractor(const FunctionOfPseudoJet<PseudoJet> * subtractor) {_subtractor = subtractor;}
    143145
    144146  /// runs the filtering and sets kept and rejected to be the jets of interest
     
    159161  /// It also sets the subjet_def to be used in joining things (the bit of
    160162  /// subjet def that is of interest for later is the recombiner).
    161   void _set_filtered_elements(const PseudoJet & jet,
    162                               std::vector<PseudoJet> & filtered_elements,
    163                               JetDefinition & subjet_def,
    164                               bool & discard_area) const;
     163  ///
     164  /// this returns true if teh optimisation trick for C/A reclustering has been used
     165  bool _set_filtered_elements(const PseudoJet & jet,
     166                              std::vector<PseudoJet> & filtered_elements) const;
    165167 
    166   /// set the filtered elements in the simple case of C/A+C/A
    167   void _set_filtered_elements_cafilt(const PseudoJet & jet,
    168                                      std::vector<PseudoJet> & filtered_elements,
    169                                      double Rfilt) const;
    170 
    171   /// set the filtered elements in the generic re-clustering case
    172   void _set_filtered_elements_generic(const PseudoJet & jet,
    173                                       std::vector<PseudoJet> & filtered_elements,
    174                                       const JetDefinition & subjet_def,
    175                                       bool do_areas) const;
    176 
    177168  /// gather the information about what is kept and rejected under the
    178169  /// form of a PseudoJet with a special ClusterSequenceInfo
     170  ///
     171  /// The last argument (ca_optimisation_used) should be true if the
     172  /// optimisation trick for C/A reclustering has been used (in which
     173  /// case some extra tests have to be run for non-explicit-ghost
     174  /// areas)
    179175  PseudoJet _finalise(const PseudoJet & jet,
    180176                      std::vector<PseudoJet> & kept,
    181177                      std::vector<PseudoJet> & rejected,
    182                       const JetDefinition & subjet_def,
    183                       const bool discard_area) const;
    184 
    185   // a series of checks
    186   //--------------------------------------------------------------------
    187   /// get the pieces down to the fundamental pieces
    188   bool _get_all_pieces(const PseudoJet &jet, std::vector<PseudoJet> &all_pieces) const;
    189 
    190   /// get the common recombiner to all pieces (NULL if none)
    191   const JetDefinition::Recombiner* _get_common_recombiner(const std::vector<PseudoJet> &all_pieces) const;
    192 
    193   /// check if one can apply the simplified trick for C/A subjets
    194   bool _check_ca(const std::vector<PseudoJet> &all_pieces) const;
    195 
    196   /// check if the jet (or all its pieces) have explicit ghosts
    197   /// (assuming the jet has area support
    198   ///
    199   /// Note that if the jet has an associated cluster sequence that is no
    200   /// longer valid, an error will be thrown
    201   bool _check_explicit_ghosts(const std::vector<PseudoJet> &all_pieces) const;
     178                      bool ca_optimisation_used) const;
    202179
    203180  bool _uses_subtraction() const {return (_subtractor || _rho != 0);}
     
    209186  Selector _selector;  ///< the subjet selection criterium
    210187  double _rho;                 ///< the background density (used for subtraction when possible)
    211   const Transformer * _subtractor; ///< for subtracting bkgd density from subjets
     188  const FunctionOfPseudoJet<PseudoJet> * _subtractor; ///< for subtracting bkgd density from subjets
     189
     190  bool _initialised;    ///< true when the Filter has been properly intialised
    212191};
    213192
Note: See TracChangeset for help on using the changeset viewer.