FastJet 3.4.1
GridJetPlugin.hh
1#ifndef __FASTJET_GRIDJETPLUGIN_HH__
2#define __FASTJET_GRIDJETPLUGIN_HH__
3
4//FJSTARTHEADER
5// $Id: GridJetPlugin.hh 2267 2011-06-20 15:10:23Z salam $
6//
7// Copyright (c) 2005-2023, Matteo Cacciari, Gavin P. 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. They are described in the original FastJet paper,
19// hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
20// FastJet as part of work towards a scientific publication, please
21// quote the version you use and include a citation to the manual and
22// optionally also to hep-ph/0512210.
23//
24// FastJet is distributed in the hope that it will be useful,
25// but WITHOUT ANY WARRANTY; without even the implied warranty of
26// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27// GNU General Public License for more details.
28//
29// You should have received a copy of the GNU General Public License
30// along with FastJet. If not, see <http://www.gnu.org/licenses/>.
31//----------------------------------------------------------------------
32//FJENDHEADER
33
34
35#include "fastjet/JetDefinition.hh"
36
37// makes it easy to switch back and forth between use of
38// RectangularGrid or not; this got enabled in FJ3.1
39#define FASTJET_GRIDJET_USEFJGRID
40
41#ifdef FASTJET_GRIDJET_USEFJGRID
42#include "fastjet/RectangularGrid.hh"
43#endif
44
45FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
46
47// forward declaration to reduce includes
48class ClusterSequence;
49
50//----------------------------------------------------------------------
51//
52/// @ingroup plugins
53/// \class GridJetPlugin
54/// plugin for fastjet (v3.0 upwards) that clusters particles such
55/// that all particles in a given cell of a rectangular rapidity-phi
56/// grid end up in a common "jet".
57///
58/// This is not intended for use as a regular jet clustering algorithm,
59/// but is rather provided for comparison purposes with the
60/// GridMedianBackgroundEstimator (which is even faster).
62#ifdef FASTJET_GRIDJET_USEFJGRID
64#endif
65{
66public:
67 /// Basic constructor for the GridJetPlugin Plugin class.
68 ///
69 /// \param ymax The maximal rapidity extent of the grid
70 /// \param requested_grid_spacing The requested grid spacing
71 /// \param post_jet_def if present, and not == JetDefinition()
72 /// (which has undefined_jet_algorithm), then
73 /// run the post_jet_def on the result of the grid
74 /// clustering.
75 GridJetPlugin (double ymax, double requested_grid_spacing,
76 const JetDefinition & post_jet_def = JetDefinition());
77
78#ifdef FASTJET_GRIDJET_USEFJGRID
79 /// Constructor for the GridJetPlugin Plugin class that allows
80 /// full control over the underlying grid. New in FastJet 3.1.
81 ///
82 /// \param grid The maximal rapidity extent of the grid
83 /// \param post_jet_def if present, and not == JetDefinition()
84 /// (which has undefined_jet_algorithm), then
85 /// run the post_jet_def on the result of the grid
86 /// clustering.
87 GridJetPlugin (const RectangularGrid & grid,
88 const JetDefinition & post_jet_def = JetDefinition());
89#endif // FASTJET_GRIDJET_USEFJGRID
90
91
92
93 // /// copy constructor
94 // GridJetPlugin (const GridJetPlugin & plugin) {
95 // *this = plugin;
96 // }
97
98 // the things that are required by base class
99 virtual std::string description () const;
100 virtual void run_clustering(ClusterSequence &) const;
101
102 /// This returns the sqrt(dphi*dy/pi) -- i.e. the radius that for a
103 /// circular jet would give the same area.
104 virtual double R() const;
105
106 // As of FastJet 3.1 the following functions become available through
107 // the underlying RectangularGrid class.
108#ifndef FASTJET_GRIDJET_USEFJGRID
109 /// returns the actual rapidity spacing of the grid
110 double drap() const {return _dy;}
111 /// returns the actual phi spacing of the grid
112 double dphi() const {return _dphi;}
113 /// returns the minimum rapidity of the grid
114 double rapmin() const {return _ymin;}
115 /// returns the maximum rapidity of the grid
116 double rapmax() const {return _ymax;}
117#endif
118
119private:
120
121#ifndef FASTJET_GRIDJET_USEFJGRID
122 void setup_grid();
123
124 int n_tiles() const {return _ntotal;}
125 int n_good_tiles() const {return _ntotal;}
126
127 int tile_index(const PseudoJet & p) const;
128 bool tile_is_good(int /* itile */) const {return true;}
129
130 double _ymin, _ymax, _dy, _dphi, _requested_grid_spacing;
131 int _ny, _nphi, _ntotal;
132#endif
133
134 JetDefinition _post_jet_def;
135
136};
137
138FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh
139
140#endif // __FASTJET_GRIDJETPLUGIN_HH__
141
deals with clustering
plugin for fastjet (v3.0 upwards) that clusters particles such that all particles in a given cell of ...
a class that allows a user to introduce their own "plugin" jet finder
class that is intended to hold a full definition of the jet clusterer
Class to contain pseudojets, including minimal information of use to jet-clustering routines.
Definition: PseudoJet.hh:68
Class that holds a generic rectangular tiling.