FastJet 3.0.2
GridJetPlugin.hh
00001 #ifndef __GRIDJETPLUGIN_HH__
00002 #define __GRIDJETPLUGIN_HH__
00003 
00004 //STARTHEADER
00005 // $Id: GridJetPlugin.hh 2267 2011-06-20 15:10:23Z salam $
00006 //
00007 // Copyright (c) 2011, Matteo Cacciari, Gavin Salam and Gregory Soyez
00008 //
00009 //----------------------------------------------------------------------
00010 // This file is part of FastJet.
00011 //
00012 //  FastJet is free software; you can redistribute it and/or modify
00013 //  it under the terms of the GNU General Public License as published by
00014 //  the Free Software Foundation; either version 2 of the License, or
00015 //  (at your option) any later version.
00016 //
00017 //  The algorithms that underlie FastJet have required considerable
00018 //  development and are described in hep-ph/0512210. If you use
00019 //  FastJet as part of work towards a scientific publication, please
00020 //  include a citation to the FastJet paper.
00021 //
00022 //  FastJet is distributed in the hope that it will be useful,
00023 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00024 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025 //  GNU General Public License for more details.
00026 //
00027 //  You should have received a copy of the GNU General Public License
00028 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
00029 //----------------------------------------------------------------------
00030 //ENDHEADER
00031 
00032 
00033 #include "fastjet/JetDefinition.hh"
00034 
00035 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00036 
00037 // forward declaration to reduce includes
00038 class ClusterSequence;
00039 
00040 //----------------------------------------------------------------------
00041 //
00042 /// @ingroup plugins
00043 /// \class GridJetPlugin
00044 /// plugin for fastjet (v3.0 upwards) that clusters particles such
00045 /// that all particles in a given cell of a rectangular rapidity-phi
00046 /// grid end up in a common "jet".
00047 ///
00048 /// This is not intended for use as a regular jet clustering algorithm, 
00049 /// but is rather provided for comparison purposes with the 
00050 /// GridMedianBackgroundEstimator (which is even faster).
00051 class GridJetPlugin : public JetDefinition::Plugin {
00052 public:
00053   /// Main constructor for the GridJetPlugin Plugin class.
00054   ///
00055   /// \param ymax           The maximal rapidity extent of the grid
00056   /// \param requested_grid_spacing The requested grid spacing
00057   /// \param post_jet_def   if present, and not == JetDefinition()
00058   ///                       (which has undefined_jet_algorithm), then
00059   ///                       run the post_jet_def on the result of the grid
00060   ///                       clustering.
00061   GridJetPlugin (double ymax, double requested_grid_spacing,
00062                  const JetDefinition & post_jet_def = JetDefinition());
00063 
00064   /// copy constructor
00065   GridJetPlugin (const GridJetPlugin & plugin) {
00066     *this = plugin;
00067   }
00068 
00069   // the things that are required by base class
00070   virtual std::string description () const;
00071   virtual void run_clustering(ClusterSequence &) const;
00072 
00073   /// This returns the sqrt(dphi*dy/pi) -- i.e. the radius that for a
00074   /// circular jet would give the same area.
00075   virtual double R() const;
00076 
00077 private:
00078 
00079   void setup_grid();
00080 
00081   int igrid(const PseudoJet & p) const;
00082 
00083   double _ymin, _ymax, _dy, _dphi, _requested_grid_spacing;
00084   int _ny, _nphi, _ntotal;
00085 
00086   JetDefinition _post_jet_def;
00087 
00088 };
00089 
00090 FASTJET_END_NAMESPACE        // defined in fastjet/internal/base.hh
00091 
00092 #endif // __GRIDJETPLUGIN_HH__
00093 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends