Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ClusterSequenceArea.hh

Go to the documentation of this file.
00001 //STARTHEADER
00002 // $Id: ClusterSequenceArea.hh 1173 2008-04-03 11:33:00Z salam $
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 #ifndef __FASTJET_CLUSTERSEQUENCEAREA_HH__
00032 #define __FASTJET_CLUSTERSEQUENCEAREA_HH__
00033 
00034 #include "fastjet/ClusterSequenceAreaBase.hh"
00035 #include "fastjet/ClusterSequenceActiveArea.hh"
00036 #include "fastjet/ClusterSequenceActiveAreaExplicitGhosts.hh"
00037 #include "fastjet/ClusterSequencePassiveArea.hh"
00038 #include "fastjet/ClusterSequenceVoronoiArea.hh"
00039 #include "fastjet/AreaDefinition.hh"
00040 
00041 FASTJET_BEGIN_NAMESPACE
00042 
00049 class ClusterSequenceArea : public ClusterSequenceAreaBase {
00050 public:
00052   template<class L> ClusterSequenceArea
00053          (const std::vector<L> & pseudojets, 
00054           const JetDefinition & jet_def,
00055           const AreaDefinition & area_def_in)  : _area_def(area_def_in) {
00056     initialize_and_run_cswa(pseudojets, jet_def);
00057   }
00058 
00060   template<class L> ClusterSequenceArea
00061          (const std::vector<L> & pseudojets, 
00062           const JetDefinition & jet_def,
00063           const GhostedAreaSpec & area_spec)   : _area_def(area_spec){
00064     initialize_and_run_cswa(pseudojets, jet_def);
00065   }
00066 
00068   template<class L> ClusterSequenceArea
00069          (const std::vector<L> & pseudojets, 
00070           const JetDefinition & jet_def,
00071           const VoronoiAreaSpec & area_spec)   : _area_def(area_spec){
00072     initialize_and_run_cswa(pseudojets, jet_def);
00073   }
00074 
00076   const AreaDefinition & area_def() const {return _area_def;}
00077 
00078 
00080   virtual double area       (const PseudoJet & jet) const {
00081     return _area_base->area(jet);}
00082 
00085   virtual double area_error (const PseudoJet & jet) const {
00086     return _area_base->area_error(jet);}
00087 
00089   virtual PseudoJet area_4vector(const PseudoJet & jet) const {
00090     return _area_base->area_4vector(jet);}
00091 
00092   // /// return the total area, up to |y|<maxrap, that is free of jets
00093   // virtual double empty_area(double maxrap) const {
00094   //   return _area_base->empty_area(maxrap);}
00095   // 
00096   // /// return something similar to the number of pure ghost jets
00097   // /// in the given rapidity range in an active area case.
00098   // /// For the local implementation we return empty_area/(0.55 pi R^2),
00099   // /// based on measured properties of ghost jets with kt and cam. Note
00100   // /// that the number returned is a double.
00101   // virtual double n_empty_jets(double maxrap) const {
00102   //   return _area_base->n_empty_jets(maxrap);
00103 
00105   virtual double empty_area(const RangeDefinition & range) const {
00106     return _area_base->empty_area(range);}
00107 
00113   virtual double n_empty_jets(const RangeDefinition & range) const {
00114     return _area_base->n_empty_jets(range);
00115   }
00116 
00118   virtual bool is_pure_ghost(const PseudoJet & jet) const {
00119     return _area_base->is_pure_ghost(jet);
00120   }
00121 
00125   virtual void get_median_rho_and_sigma(const RangeDefinition & range, 
00126                                         bool use_area_4vector,
00127                                         double & median, double & sigma,
00128                                         double & mean_area) const {
00129     _warn_if_range_unsuitable(range);
00130     ClusterSequenceAreaBase::get_median_rho_and_sigma(range, use_area_4vector,
00131                                                       median, sigma, mean_area);
00132   }
00133 
00138   virtual void get_median_rho_and_sigma(const RangeDefinition & range, 
00139                                         bool use_area_4vector,
00140                                         double & median, double & sigma) const {
00141     ClusterSequenceAreaBase::get_median_rho_and_sigma(range,use_area_4vector,
00142                                                       median,sigma);
00143   }
00144 
00145 
00149   virtual void parabolic_pt_per_unit_area(double & a, double & b, 
00150                                           const RangeDefinition & range, 
00151                                           double exclude_above=-1.0, 
00152                                           bool use_area_4vector=false) const {
00153     _warn_if_range_unsuitable(range);
00154     ClusterSequenceAreaBase::parabolic_pt_per_unit_area(
00155                                 a,b,range, exclude_above, use_area_4vector);
00156   }
00157 
00158 
00159 private:
00160   
00164   void _warn_if_range_unsuitable(const RangeDefinition & range) const;
00165 
00166   template<class L> void initialize_and_run_cswa (
00167                                  const std::vector<L> & pseudojets, 
00168                                  const JetDefinition & jet_def);
00169 
00170   std::auto_ptr<ClusterSequenceAreaBase> _area_base;
00171   AreaDefinition _area_def;
00172   static LimitedWarning _range_warnings;
00173 
00174 };
00175 
00176 //----------------------------------------------------------------------
00177 template<class L> void ClusterSequenceArea::initialize_and_run_cswa(
00178            const std::vector<L> & pseudojets, 
00179            const JetDefinition  & jet_def)
00180  {
00181   
00182   ClusterSequenceAreaBase * _area_base_ptr;
00183   switch(_area_def.area_type()) {
00184   case active_area:
00185     _area_base_ptr = new ClusterSequenceActiveArea(pseudojets, 
00186                                                    jet_def, 
00187                                                    _area_def.ghost_spec());
00188     break;
00189   case active_area_explicit_ghosts:
00190     _area_base_ptr = new ClusterSequenceActiveAreaExplicitGhosts(pseudojets, 
00191                                                    jet_def, 
00192                                                    _area_def.ghost_spec());
00193     break;
00194   case voronoi_area:
00195     _area_base_ptr = new ClusterSequenceVoronoiArea(pseudojets, 
00196                                                    jet_def, 
00197                                                    _area_def.voronoi_spec());
00198     break;
00199   case one_ghost_passive_area:
00200     _area_base_ptr = new ClusterSequence1GhostPassiveArea(pseudojets, 
00201                                                     jet_def, 
00202                                                     _area_def.ghost_spec());
00203     break;
00204   case passive_area:
00205     _area_base_ptr = new ClusterSequencePassiveArea(pseudojets, 
00206                                                     jet_def, 
00207                                                     _area_def.ghost_spec());
00208     break;
00209   default:
00210     std::cerr << "Error: unrecognized area_type in ClusterSequenceArea:" 
00211               << _area_def.area_type() << std::endl;
00212     exit(-1);
00213   }
00214   // now copy across the information from the area base class
00215   _area_base = std::auto_ptr<ClusterSequenceAreaBase>(_area_base_ptr);
00216   transfer_from_sequence(*_area_base);
00217 }
00218 
00219 FASTJET_END_NAMESPACE
00220 
00221 #endif // __FASTJET_CLUSTERSEQUENCEAREA_HH__
00222 
00223 

Generated on Fri Aug 15 13:45:28 2008 for fastjet by  doxygen 1.4.2