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

ClusterSequenceActiveArea.hh

Go to the documentation of this file.
00001 //STARTHEADER
00002 // $Id: ClusterSequenceActiveArea.hh 482 2007-02-28 17:07:24Z cacciari $
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_CLUSTERSEQUENCEACTIVEAREA_HH__
00032 #define __FASTJET_CLUSTERSEQUENCEACTIVEAREA_HH__
00033 
00034 
00035 #include "fastjet/PseudoJet.hh"
00036 #include "fastjet/ClusterSequenceWithArea.hh"
00037 #include "fastjet/ClusterSequenceActiveAreaExplicitGhosts.hh"
00038 #include<iostream>
00039 #include<vector>
00040 
00041 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00042 
00043 using namespace std;
00044 
00049 class ClusterSequenceActiveArea : public ClusterSequenceWithArea {
00050 public:
00051 
00053   template<class L> ClusterSequenceActiveArea
00054          (const std::vector<L> & pseudojets, 
00055           const JetDefinition & jet_def,
00056           const ActiveAreaSpec & area_spec,
00057           const bool & writeout_combinations = false) ;
00058 
00059   virtual double area (const PseudoJet & jet) const {
00060                              return _average_area[jet.cluster_hist_index()];};
00061   virtual double area_error (const PseudoJet & jet) const {
00062                              return _average_area2[jet.cluster_hist_index()];};
00063 
00064   virtual PseudoJet area_4vector (const PseudoJet & jet) const {
00065                     return _average_area_4vector[jet.cluster_hist_index()];};
00066 
00070   enum mean_pt_strategies{median=0, non_ghost_median, pttot_over_areatot, 
00071                           pttot_over_areatot_cut, mean_ratio_cut, play,
00072                           median_4vector};
00073 
00079   double pt_per_unit_area(mean_pt_strategies strat=median, 
00080                           double range=2.0 ) const;
00081 
00085   void parabolic_pt_per_unit_area(double & a,double & b, double raprange=-1.0,
00086                                   double exclude_above=-1.0, 
00087                                   bool use_area_4vector=false ) const;
00088 
00089 
00090 
00091 private:
00092 
00095   void _initialise_and_run_AA (const JetDefinition & jet_def,
00096                                const ActiveAreaSpec & area_spec,
00097                                const bool & writeout_combinations = false);
00098 
00099 
00100   valarray<double> _average_area, _average_area2;
00101   valarray<PseudoJet> _average_area_4vector;
00102   double           _non_jet_area, _non_jet_area2, _non_jet_number;
00103 
00104   double _maxrap_for_area; // max rap where we put ghosts
00105   double _safe_rap_for_area; // max rap where we trust jet areas
00106 
00109   void _transfer_ghost_free_history(
00110            const ClusterSequenceActiveAreaExplicitGhosts & clust_seq);
00111 
00112 
00115   void _transfer_areas(const vector<int> & unique_hist_order, 
00116                        const ClusterSequenceActiveAreaExplicitGhosts & );
00117 
00121   void _extract_tree(vector<int> &) const;
00124   void _extract_tree_children(int pos, valarray<bool> &, const valarray<int> &, vector<int> &) const;
00126   void _extract_tree_parents (int pos, valarray<bool> &, const valarray<int> &,  vector<int> &) const;
00127 
00130   //static int _n_seed_warnings;
00131   //const static int _max_seed_warnings = 10;
00132 
00133 };
00134 
00135 
00136 template<class L> ClusterSequenceActiveArea::ClusterSequenceActiveArea 
00137 (const std::vector<L> & pseudojets, 
00138  const JetDefinition & jet_def,
00139  const ActiveAreaSpec & area_spec,
00140  const bool & writeout_combinations) {
00141 
00142   // transfer the initial jets (type L) into our own array
00143   _transfer_input_jets(pseudojets);
00144 
00145   // run the clustering for active areas
00146   _initialise_and_run_AA(jet_def, area_spec, writeout_combinations);
00147 
00148 }
00149 
00150 
00151   
00152 FASTJET_END_NAMESPACE
00153 
00154 #endif // __FASTJET_CLUSTERSEQUENCEACTIVEAREA_HH__

Generated on Mon Apr 2 20:57:48 2007 for fastjet by  doxygen 1.4.2