ClusterSequenceAreaBase.hh

00001 //STARTHEADER
00002 // $Id: ClusterSequenceAreaBase.hh 1761 2010-09-16 10:43:18Z soyez $
00003 //
00004 // Copyright (c) 2005-2006, Matteo Cacciari and Gavin Salam
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_CLUSTERSEQUENCEAREABASE_HH__
00032 #define __FASTJET_CLUSTERSEQUENCEAREABASE_HH__
00033 
00034 #include "fastjet/ClusterSequence.hh"
00035 #include "fastjet/internal/LimitedWarning.hh"
00036 #include "fastjet/RangeDefinition.hh"
00037 
00038 FASTJET_BEGIN_NAMESPACE
00039 
00047 class ClusterSequenceAreaBase : public ClusterSequence {
00048 public:
00049   
00052   template<class L> ClusterSequenceAreaBase
00053          (const std::vector<L> & pseudojets, 
00054           const JetDefinition & jet_def,
00055           const bool & writeout_combinations = false) :
00056            ClusterSequence(pseudojets, jet_def, writeout_combinations) {}
00057 
00058 
00060   ClusterSequenceAreaBase() {}
00061 
00062 
00064   virtual ~ClusterSequenceAreaBase() {}
00065 
00066 
00069   virtual double area       (const PseudoJet & ) const {return 0.0;}
00070 
00073   virtual double area_error (const PseudoJet & ) const {return 0.0;}
00074 
00086   virtual PseudoJet area_4vector(const PseudoJet & ) const {
00087     return PseudoJet(0.0,0.0,0.0,0.0);}
00088 
00094   virtual bool is_pure_ghost(const PseudoJet & ) const {
00095     return false;
00096   }
00097 
00103   virtual bool has_explicit_ghosts() const {
00104     return false;
00105   }
00106 
00109   virtual double empty_area(const RangeDefinition & range) const;
00110 
00113   double empty_area_from_jets(const std::vector<PseudoJet> & all_jets,
00114                               const RangeDefinition & range) const;
00115 
00121   virtual double n_empty_jets(const RangeDefinition & range) const {
00122     double R = jet_def().R();
00123     return empty_area(range)/(0.55*pi*R*R);
00124   }
00125 
00128   double median_pt_per_unit_area(const RangeDefinition & range) const;
00129 
00132   double median_pt_per_unit_area_4vector(const RangeDefinition & range) const;
00133   
00138   double median_pt_per_unit_something(
00139                     const RangeDefinition & range, bool use_area_4vector) const;
00140 
00161   virtual void get_median_rho_and_sigma(const RangeDefinition & range, 
00162                                         bool use_area_4vector,
00163                                         double & median, double & sigma,
00164                                         double & mean_area) const;
00165 
00181   virtual void get_median_rho_and_sigma(const std::vector<PseudoJet> & all_jets,
00182                                         const RangeDefinition & range, 
00183                                         bool use_area_4vector,
00184                                         double & median, double & sigma,
00185                                         double & mean_area,
00186                                         bool all_are_inclusive = false) const;
00187 
00190   virtual void get_median_rho_and_sigma(const RangeDefinition & range, 
00191                                 bool use_area_4vector,
00192                                 double & median, double & sigma) const {
00193     double mean_area;
00194     get_median_rho_and_sigma(range,  use_area_4vector,
00195                              median,  sigma, mean_area);
00196   }
00197   
00198 
00203   virtual void parabolic_pt_per_unit_area(double & a, double & b, 
00204                                           const RangeDefinition & range, 
00205                                           double exclude_above=-1.0, 
00206                                           bool use_area_4vector=false) const;
00207 
00212   std::vector<PseudoJet> subtracted_jets(const double rho,
00213                                          const double ptmin=0.0) const;
00214 
00219   std::vector<PseudoJet> subtracted_jets(const RangeDefinition & range, 
00220                                          const double ptmin=0.0) const;
00221 
00223   PseudoJet subtracted_jet(const PseudoJet & jet,
00224                            const double rho) const;
00225 
00230   PseudoJet subtracted_jet(const PseudoJet & jet,
00231                            const RangeDefinition & range) const;
00232 
00234   double subtracted_pt(const PseudoJet & jet,
00235                        const double rho,
00236                        bool use_area_4vector=false) const;
00237 
00241   double subtracted_pt(const PseudoJet & jet,
00242                        const RangeDefinition & range,
00243                        bool use_area_4vector=false) const;
00244 
00245 
00246 private:
00248   static LimitedWarning _warnings;
00249   static LimitedWarning _warnings_zero_area;
00250 
00252   void _check_jet_alg_good_for_median() const;
00253   
00254 };
00255 
00256 
00257 
00258 FASTJET_END_NAMESPACE
00259 
00260 #endif // __FASTJET_CLUSTERSEQUENCEAREABASE_HH__