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 //
00050 class VoronoiAreaSpec {
00051 public:
00052 
00054   VoronoiAreaSpec() : _effective_Rfact(1.0) {};
00055   
00057   VoronoiAreaSpec(double effective_Rfact) : 
00058     _effective_Rfact(effective_Rfact) {};
00059 
00061   double effective_Rfact() const {return _effective_Rfact;}
00062 
00064   std::string description() const;
00065 
00066 private:
00067   double _effective_Rfact;
00068 };
00069 
00070 
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 //----------------------------------------------------------------------
00082 class AreaDefinition {
00083 public:
00084   
00087   AreaDefinition() {
00088     _area_type  = active_area;
00089     _ghost_spec = GhostedAreaSpec();
00090   }
00091 
00094   AreaDefinition(AreaType type, const GhostedAreaSpec & spec) {
00095     _ghost_spec = spec;
00096     _area_type   = type;
00097     assert(type != voronoi_area);
00098   }
00099 
00102   AreaDefinition(AreaType type, const VoronoiAreaSpec & spec) {
00103     _voronoi_spec = spec;
00104     _area_type   = type;
00105     assert(type == voronoi_area);
00106   }
00107 
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 
00121   AreaDefinition(const GhostedAreaSpec & spec, AreaType type = active_area) {
00122     _ghost_spec = spec;
00123     _area_type   = type;
00124     assert(type != voronoi_area);
00125   }
00126 
00129   AreaDefinition(const VoronoiAreaSpec & spec) {
00130     _voronoi_spec = spec;
00131     _area_type    = voronoi_area;
00132   }
00133 
00135   std::string description() const;
00136 
00138   AreaType area_type() const {return _area_type;}
00139 
00141   const GhostedAreaSpec  & ghost_spec()  const {return _ghost_spec;}
00142   GhostedAreaSpec & ghost_spec()  {return _ghost_spec;}
00143 
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__