FastJet  3.0.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
GridJetPlugin.hh
1 #ifndef __GRIDJETPLUGIN_HH__
2 #define __GRIDJETPLUGIN_HH__
3 
4 //STARTHEADER
5 // $Id: GridJetPlugin.hh 2267 2011-06-20 15:10:23Z salam $
6 //
7 // Copyright (c) 2011, Matteo Cacciari, Gavin Salam and Gregory Soyez
8 //
9 //----------------------------------------------------------------------
10 // This file is part of FastJet.
11 //
12 // FastJet is free software; you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation; either version 2 of the License, or
15 // (at your option) any later version.
16 //
17 // The algorithms that underlie FastJet have required considerable
18 // development and are described in hep-ph/0512210. If you use
19 // FastJet as part of work towards a scientific publication, please
20 // include a citation to the FastJet paper.
21 //
22 // FastJet is distributed in the hope that it will be useful,
23 // but WITHOUT ANY WARRANTY; without even the implied warranty of
24 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 // GNU General Public License for more details.
26 //
27 // You should have received a copy of the GNU General Public License
28 // along with FastJet. If not, see <http://www.gnu.org/licenses/>.
29 //----------------------------------------------------------------------
30 //ENDHEADER
31 
32 
33 #include "fastjet/JetDefinition.hh"
34 
35 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
36 
37 // forward declaration to reduce includes
38 class ClusterSequence;
39 
40 //----------------------------------------------------------------------
41 //
42 /// @ingroup plugins
43 /// \class GridJetPlugin
44 /// plugin for fastjet (v3.0 upwards) that clusters particles such
45 /// that all particles in a given cell of a rectangular rapidity-phi
46 /// grid end up in a common "jet".
47 ///
48 /// This is not intended for use as a regular jet clustering algorithm,
49 /// but is rather provided for comparison purposes with the
50 /// GridMedianBackgroundEstimator (which is even faster).
52 public:
53  /// Main constructor for the GridJetPlugin Plugin class.
54  ///
55  /// \param ymax The maximal rapidity extent of the grid
56  /// \param requested_grid_spacing The requested grid spacing
57  /// \param post_jet_def if present, and not == JetDefinition()
58  /// (which has undefined_jet_algorithm), then
59  /// run the post_jet_def on the result of the grid
60  /// clustering.
61  GridJetPlugin (double ymax, double requested_grid_spacing,
62  const JetDefinition & post_jet_def = JetDefinition());
63 
64  /// copy constructor
65  GridJetPlugin (const GridJetPlugin & plugin) {
66  *this = plugin;
67  }
68 
69  // the things that are required by base class
70  virtual std::string description () const;
71  virtual void run_clustering(ClusterSequence &) const;
72 
73  /// This returns the sqrt(dphi*dy/pi) -- i.e. the radius that for a
74  /// circular jet would give the same area.
75  virtual double R() const;
76 
77 private:
78 
79  void setup_grid();
80 
81  int igrid(const PseudoJet & p) const;
82 
83  double _ymin, _ymax, _dy, _dphi, _requested_grid_spacing;
84  int _ny, _nphi, _ntotal;
85 
86  JetDefinition _post_jet_def;
87 
88 };
89 
90 FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh
91 
92 #endif // __GRIDJETPLUGIN_HH__
93