Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/NNH.hh

    r35cdc46 r1d208a2  
    33
    44//FJSTARTHEADER
    5 // $Id: NNH.hh 3433 2014-07-23 08:17:03Z salam $
     5// $Id: NNH.hh 4034 2016-03-02 00:20:27Z soyez $
    66//
    77// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    3232//FJENDHEADER
    3333
    34 #include<fastjet/ClusterSequence.hh>
    35 
     34#include <fastjet/NNBase.hh>
    3635
    3736FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
    38 
    39 /// @ingroup advanced_usage
    40 /// \class _NoInfo
    41 /// dummy class, used as a default template argument
    42 class _NoInfo {};
    43 
    44 /// @ingroup advanced_usage
    45 /// \class NNHInfo
    46 /// template that will help initialise a BJ with a PseudoJet and extra information
    47 template<class I> class NNHInfo {
    48 public:
    49   NNHInfo()         : _info(NULL) {}
    50   NNHInfo(I * info) : _info(info) {}
    51   template<class NNBJ> void init_jet(NNBJ * briefjet, const fastjet::PseudoJet & jet, int index) { briefjet->init(jet, index, _info);}
    52 private:
    53   I * _info;
    54 };
    55 
    56 /// @ingroup advanced_usage
    57 /// Specialisation of NNHInfo for cases where there is no extra info
    58 template<> class NNHInfo<_NoInfo>  {
    59 public:
    60   NNHInfo()           {}
    61   NNHInfo(_NoInfo * ) {}
    62   template<class NNBJ> void init_jet(NNBJ * briefjet, const fastjet::PseudoJet & jet, int index) { briefjet->init(jet, index);}
    63 };
    64 
    6537
    6638//----------------------------------------------------------------------
     
    6840/// \class NNH
    6941/// Help solve closest pair problems with generic interparticle and
    70 /// beam distance.
    71 ///
    72 /// Class to help solve closest pair problems with generic interparticle
    73 /// distances and a beam distance, using Anderberg's Nearest Neighbour
    74 /// Heuristic.
    75 ///
    76 /// It is templated with a BJ (brief jet) class --- BJ should
    77 /// basically cache the minimal amount of information that is needed
    78 /// to efficiently calculate interparticle distances and particle-beam
    79 /// distances.
    80 ///
    81 /// This class can be used with or without an extra "Information" template,
    82 /// i.e. NNB<BJ> or NNH<BJ,I>
     42/// beam distance (generic case)
     43///
     44/// (see NNBase.hh for an introductory description)
     45///
     46/// This variant provides an implementation for any distance measure.
     47/// It is templated with a BJ (brief jet) classand can be used with or
     48/// without an extra "Information" template, i.e. NNH<BJ> or NNH<BJ,I>
    8349///
    8450/// For the NNH<BJ> version of the class to function, BJ must provide
     
    8854///  - double BJ::distance(const BJ * other_bj_jet); // distance between this and other_bj_jet
    8955///  - double BJ::beam_distance()                  ; // distance to the beam
    90 ///
     56/// 
    9157/// For the NNH<BJ,I> version to function, the BJ::init(...) member
    9258/// must accept an extra argument
     
    9460///  - void   BJ::init(const PseudoJet & jet, I * info);   // initialise with a PseudoJet + info
    9561///
    96 /// where info might be a pointer to a class that contains, e.g., information
    97 /// about R, or other parameters of the jet algorithm
     62/// NOTE: THE DISTANCE MUST BE SYMMETRIC I.E. SATISFY
     63///     a.distance(b) == b.distance(a)
    9864///
    9965/// For an example of how the NNH<BJ> class is used, see the Jade (and
     
    10773/// implementations.
    10874///
    109 ///
    110 /// Implementation note: this class derives from NNHInfo, which deals
    111 /// with storing any global information that is needed during the clustering
    112 
    113 template<class BJ, class I = _NoInfo> class NNH : public NNHInfo<I> {
     75template<class BJ, class I = _NoInfo> class NNH : public NNBase<I> {
    11476public:
    11577
    11678  /// constructor with an initial set of jets (which will be assigned indices
    11779  /// 0 ... jets.size()-1
    118   NNH(const std::vector<PseudoJet> & jets) {start(jets);}
    119   NNH(const std::vector<PseudoJet> & jets, I * info) : NNHInfo<I>(info) {start(jets);}
    120  
     80  NNH(const std::vector<PseudoJet> & jets)           : NNBase<I>()     {start(jets);}
     81  NNH(const std::vector<PseudoJet> & jets, I * info) : NNBase<I>(info) {start(jets);}
     82
     83  // initialisation from a given list of particles
    12184  void start(const std::vector<PseudoJet> & jets);
    12285
Note: See TracChangeset for help on using the changeset viewer.