Changes in external/fastjet/NNH.hh [35cdc46:1d208a2] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/NNH.hh
r35cdc46 r1d208a2 3 3 4 4 //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 $ 6 6 // 7 7 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 32 32 //FJENDHEADER 33 33 34 #include<fastjet/ClusterSequence.hh> 35 34 #include <fastjet/NNBase.hh> 36 35 37 36 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh 38 39 /// @ingroup advanced_usage40 /// \class _NoInfo41 /// dummy class, used as a default template argument42 class _NoInfo {};43 44 /// @ingroup advanced_usage45 /// \class NNHInfo46 /// template that will help initialise a BJ with a PseudoJet and extra information47 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_usage57 /// Specialisation of NNHInfo for cases where there is no extra info58 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 65 37 66 38 //---------------------------------------------------------------------- … … 68 40 /// \class NNH 69 41 /// 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> 83 49 /// 84 50 /// For the NNH<BJ> version of the class to function, BJ must provide … … 88 54 /// - double BJ::distance(const BJ * other_bj_jet); // distance between this and other_bj_jet 89 55 /// - double BJ::beam_distance() ; // distance to the beam 90 /// 56 /// 91 57 /// For the NNH<BJ,I> version to function, the BJ::init(...) member 92 58 /// must accept an extra argument … … 94 60 /// - void BJ::init(const PseudoJet & jet, I * info); // initialise with a PseudoJet + info 95 61 /// 96 /// where info might be a pointer to a class that contains, e.g., information97 /// about R, or other parameters of the jet algorithm62 /// NOTE: THE DISTANCE MUST BE SYMMETRIC I.E. SATISFY 63 /// a.distance(b) == b.distance(a) 98 64 /// 99 65 /// For an example of how the NNH<BJ> class is used, see the Jade (and … … 107 73 /// implementations. 108 74 /// 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> { 75 template<class BJ, class I = _NoInfo> class NNH : public NNBase<I> { 114 76 public: 115 77 116 78 /// constructor with an initial set of jets (which will be assigned indices 117 79 /// 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 121 84 void start(const std::vector<PseudoJet> & jets); 122 85
Note:
See TracChangeset
for help on using the changeset viewer.