FastJet 3.0beta1
AreaDefinition.hh
00001 //STARTHEADER
00002 // $Id: AreaDefinition.hh 1761 2010-09-16 10:43:18Z soyez $
00003 //
00004 // Copyright (c) 2006-2007, Matteo Cacciari, Gavin Salam and Gregory Soyez
00005 //
00006 //----------------------------------------------------------------------
00007 // This file is part of FastJet.
00008 //
00009 //  FastJet is free software; you can redistribute it and/or modify
00010 //  it under the terms of the GNU General Public License as published by
00011 //  the Free Software Foundation; either version 2 of the License, or
00012 //  (at your option) any later version.
00013 //
00014 //  The algorithms that underlie FastJet have required considerable
00015 //  development and are described in hep-ph/0512210. If you use
00016 //  FastJet as part of work towards a scientific publication, please
00017 //  include a citation to the FastJet paper.
00018 //
00019 //  FastJet is distributed in the hope that it will be useful,
00020 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 //  GNU General Public License for more details.
00023 //
00024 //  You should have received a copy of the GNU General Public License
00025 //  along with FastJet; if not, write to the Free Software
00026 //  Foundation, Inc.:
00027 //      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //----------------------------------------------------------------------
00029 //ENDHEADER
00030 
00031 
00032 #ifndef __FASTJET_AREADEFINITION_HH__
00033 #define __FASTJET_AREADEFINITION_HH__
00034 
00035 #include "fastjet/GhostedAreaSpec.hh"
00036 
00037 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00038 
00039 //----------------------------------------------------------------------
00040 //
00041 /// @ingroup area_classes
00042 /// \class VoronoiAreaSpec
00043 /// Specification for the computation of the Voronoi jet area
00044 ///
00045 /// class for holding a "Voronoi area" specification; an area will be
00046 /// assigned to each particle, which is the area of the intersection
00047 /// of the particle's Voronoi cell with a circle of radius
00048 /// R*effective_Rfact.
00049 ///
00050 class VoronoiAreaSpec {
00051 public:
00052 
00053   /// default constructor (effective_Rfact = 1);
00054   VoronoiAreaSpec() : _effective_Rfact(1.0) {};
00055   
00056   /// constructor that allows you to set effective_Rfact.
00057   VoronoiAreaSpec(double effective_Rfact) : 
00058     _effective_Rfact(effective_Rfact) {};
00059 
00060   /// return the value of effective_Rfact
00061   double effective_Rfact() const {return _effective_Rfact;}
00062 
00063   /// return a textual description of the area definition.
00064   std::string description() const;
00065 
00066 private:
00067   double _effective_Rfact;
00068 };
00069 
00070 
00071 /// the different types of area that are supported
00072 enum AreaType {invalid_area = -1, 
00073                active_area = 0, active_area_explicit_ghosts = 1,
00074                one_ghost_passive_area = 10, passive_area = 11, 
00075                voronoi_area=20};
00076 
00077 
00078 //----------------------------------------------------------------------
00079 /// @ingroup area_classes
00080 /// \class AreaDefinition
00081 /// class that holds a generic area definition
00082 class AreaDefinition {
00083 public:
00084   
00085   /// default constructor, which provides a ghosted active area, with
00086   /// sensible defaults for the ghosts.
00087   AreaDefinition() {
00088     _area_type  = active_area;
00089     _ghost_spec = GhostedAreaSpec();
00090   }
00091 
00092   /// constructor for an area definition based on an area type and a
00093   /// ghosted area specification
00094   AreaDefinition(AreaType type, const GhostedAreaSpec & spec) {
00095     _ghost_spec = spec;
00096     _area_type   = type;
00097     assert(type != voronoi_area);
00098   }
00099 
00100   /// constructor for an area definition based on an area type and a
00101   /// voronoi area specification (type must be voronoi_area)
00102   AreaDefinition(AreaType type, const VoronoiAreaSpec & spec) {
00103     _voronoi_spec = spec;
00104     _area_type   = type;
00105     assert(type == voronoi_area);
00106   }
00107 
00108   /// constructor for an area definition based on an area type and 
00109   /// which attempts to provide sensible defaults for everything else
00110   AreaDefinition(AreaType type) {
00111     _area_type   = type;
00112     if (type == voronoi_area) {
00113       _voronoi_spec = VoronoiAreaSpec();
00114     } else {
00115       _ghost_spec = GhostedAreaSpec();
00116     }
00117   }
00118 
00119   /// constructor for an area definition based on an ghosted area
00120   /// specification, and an option to select which ghosted area you want
00121   AreaDefinition(const GhostedAreaSpec & spec, AreaType type = active_area) {
00122     _ghost_spec = spec;
00123     _area_type   = type;
00124     assert(type != voronoi_area);
00125   }
00126 
00127   /// constructor for an area definition based on a voronoi area
00128   /// specification
00129   AreaDefinition(const VoronoiAreaSpec & spec) {
00130     _voronoi_spec = spec;
00131     _area_type    = voronoi_area;
00132   }
00133 
00134   /// return a description of the current area definition
00135   std::string description() const;
00136 
00137   /// return info about the type of area being used by this defn
00138   AreaType area_type() const {return _area_type;}
00139 
00140   /// return a reference to the active area spec
00141   const GhostedAreaSpec  & ghost_spec()  const {return _ghost_spec;}
00142   GhostedAreaSpec & ghost_spec()  {return _ghost_spec;}
00143 
00144   /// return a reference to the voronoi area spec
00145   const VoronoiAreaSpec & voronoi_spec() const {return _voronoi_spec;}
00146   
00147 private:
00148 
00149   AreaType        _area_type;
00150   GhostedAreaSpec  _ghost_spec;
00151   VoronoiAreaSpec _voronoi_spec;
00152 };
00153 
00154 FASTJET_END_NAMESPACE        // defined in fastjet/internal/base.hh
00155 
00156 
00157 #endif // __FASTJET_AREADEFINITION_HH__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends