00001 //STARTHEADER 00002 // $Id: ClusterSequenceVoronoiArea.hh 621 2007-05-09 10:34:30Z salam $ 00003 // 00004 // Copyright (c) 2005-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_CLUSTERSEQUENCEVORONOIAREA_HH__ 00032 #define __FASTJET_CLUSTERSEQUENCEVORONOIAREA_HH__ 00033 00034 #include "fastjet/PseudoJet.hh" 00035 #include "fastjet/AreaDefinition.hh" 00036 #include "fastjet/ClusterSequenceAreaBase.hh" 00037 #include <memory> 00038 #include <vector> 00039 00040 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh 00041 00046 class ClusterSequenceVoronoiArea : public ClusterSequenceAreaBase { 00047 public: 00053 template<class L> ClusterSequenceVoronoiArea 00054 (const std::vector<L> & pseudojets, 00055 const JetDefinition & jet_def, 00056 const VoronoiAreaSpec & spec = VoronoiAreaSpec(), 00057 const bool & writeout_combinations = false); 00058 00060 ~ClusterSequenceVoronoiArea(); 00061 00063 virtual inline double area(const PseudoJet & jet) const { 00064 return _voronoi_area[jet.cluster_hist_index()];}; 00065 00070 virtual inline PseudoJet area_4vector(const PseudoJet & jet) const { 00071 return _voronoi_area_4vector[jet.cluster_hist_index()];}; 00072 00075 virtual inline double area_error(const PseudoJet & jet) const { 00076 return 0.0;}; 00077 00080 class VoronoiAreaCalc; 00081 00082 00083 private: 00085 void _initializeVA(); 00086 00087 std::vector<double> _voronoi_area; 00088 std::vector<PseudoJet> _voronoi_area_4vector; 00089 VoronoiAreaCalc *_pa_calc; 00090 double _effective_Rfact; 00091 }; 00092 00093 00094 00095 00097 //---------------------------------------------------------------------- 00098 template<class L> ClusterSequenceVoronoiArea::ClusterSequenceVoronoiArea 00099 (const std::vector<L> &pseudojets, 00100 const JetDefinition &jet_def, 00101 const VoronoiAreaSpec & spec, 00102 const bool & writeout_combinations) : 00103 _effective_Rfact(spec.effective_Rfact()) { 00104 00105 // transfer the initial jets (type L) into our own array 00106 _transfer_input_jets(pseudojets); 00107 00108 // run the clustering 00109 _initialise_and_run(jet_def,writeout_combinations); 00110 00111 // the jet clustering's already been done, now worry about areas... 00112 _initializeVA(); 00113 } 00114 00115 FASTJET_END_NAMESPACE 00116 00117 #endif // __FASTJET_CLUSTERSEQUENCEVORONOIAREA_HH__