Changes in external/fastjet/NNH.hh [1d208a2:35cdc46] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/NNH.hh
r1d208a2 r35cdc46 3 3 4 4 //FJSTARTHEADER 5 // $Id: NNH.hh 4034 2016-03-02 00:20:27Z soyez$5 // $Id: NNH.hh 3433 2014-07-23 08:17:03Z salam $ 6 6 // 7 7 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 32 32 //FJENDHEADER 33 33 34 #include <fastjet/NNBase.hh> 34 #include<fastjet/ClusterSequence.hh> 35 35 36 36 37 FASTJET_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 37 65 38 66 //---------------------------------------------------------------------- … … 40 68 /// \class NNH 41 69 /// Help solve closest pair problems with generic interparticle and 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> 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> 49 83 /// 50 84 /// For the NNH<BJ> version of the class to function, BJ must provide … … 54 88 /// - double BJ::distance(const BJ * other_bj_jet); // distance between this and other_bj_jet 55 89 /// - double BJ::beam_distance() ; // distance to the beam 56 /// 90 /// 57 91 /// For the NNH<BJ,I> version to function, the BJ::init(...) member 58 92 /// must accept an extra argument … … 60 94 /// - void BJ::init(const PseudoJet & jet, I * info); // initialise with a PseudoJet + info 61 95 /// 62 /// NOTE: THE DISTANCE MUST BE SYMMETRIC I.E. SATISFY63 /// a.distance(b) == b.distance(a)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 64 98 /// 65 99 /// For an example of how the NNH<BJ> class is used, see the Jade (and … … 73 107 /// implementations. 74 108 /// 75 template<class BJ, class I = _NoInfo> class NNH : public NNBase<I> { 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> { 76 114 public: 77 115 78 116 /// constructor with an initial set of jets (which will be assigned indices 79 117 /// 0 ... jets.size()-1 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 118 NNH(const std::vector<PseudoJet> & jets) {start(jets);} 119 NNH(const std::vector<PseudoJet> & jets, I * info) : NNHInfo<I>(info) {start(jets);} 120 84 121 void start(const std::vector<PseudoJet> & jets); 85 122
Note:
See TracChangeset
for help on using the changeset viewer.