00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
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
00043 class ClusterSequenceArea : public ClusterSequenceAreaBase {
00044 public:
00045 template<class L> ClusterSequenceArea
00046 (const std::vector<L> & pseudojets,
00047 const JetDefinition & jet_def,
00048 const AreaDefinition & area_def_in) : _area_def(area_def_in) {
00049 initialize_and_run_cswa(pseudojets, jet_def);
00050 }
00051
00052 template<class L> ClusterSequenceArea
00053 (const std::vector<L> & pseudojets,
00054 const JetDefinition & jet_def,
00055 const GhostedAreaSpec & area_spec) : _area_def(area_spec){
00056 initialize_and_run_cswa(pseudojets, jet_def);
00057 }
00058
00059 template<class L> ClusterSequenceArea
00060 (const std::vector<L> & pseudojets,
00061 const JetDefinition & jet_def,
00062 const VoronoiAreaSpec & area_spec) : _area_def(area_spec){
00063 initialize_and_run_cswa(pseudojets, jet_def);
00064 }
00065
00067 const AreaDefinition & area_def() const {return _area_def;}
00068
00069
00071 virtual double area (const PseudoJet & jet) const {
00072 return _area_base->area(jet);}
00073
00076 virtual double area_error (const PseudoJet & jet) const {
00077 return _area_base->area_error(jet);}
00078
00080 virtual PseudoJet area_4vector(const PseudoJet & jet) const {
00081 return _area_base->area_4vector(jet);}
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00096 virtual double empty_area(const RangeDefinition & range) const {
00097 return _area_base->empty_area(range);}
00098
00104 virtual double n_empty_jets(const RangeDefinition & range) const {
00105 return _area_base->n_empty_jets(range);
00106 }
00107
00109 virtual bool is_pure_ghost(const PseudoJet & jet) const {
00110 return _area_base->is_pure_ghost(jet);
00111 }
00112
00116 virtual void get_median_rho_and_sigma(const RangeDefinition & range,
00117 bool use_area_4vector,
00118 double & median, double & sigma,
00119 double & mean_area) const {
00120 _warn_if_range_unsuitable(range);
00121 ClusterSequenceAreaBase::get_median_rho_and_sigma(range, use_area_4vector,
00122 median, sigma, mean_area);
00123 }
00124
00128 virtual void parabolic_pt_per_unit_area(double & a, double & b,
00129 const RangeDefinition & range,
00130 double exclude_above=-1.0,
00131 bool use_area_4vector=false) const {
00132 _warn_if_range_unsuitable(range);
00133 ClusterSequenceAreaBase::parabolic_pt_per_unit_area(
00134 a,b,range, exclude_above, use_area_4vector);
00135 }
00136
00137
00138 private:
00139
00143 void _warn_if_range_unsuitable(const RangeDefinition & range) const;
00144
00145 template<class L> void initialize_and_run_cswa (
00146 const std::vector<L> & pseudojets,
00147 const JetDefinition & jet_def);
00148
00149 std::auto_ptr<ClusterSequenceAreaBase> _area_base;
00150 AreaDefinition _area_def;
00151 static LimitedWarning _range_warnings;
00152
00153 };
00154
00155
00156 template<class L> void ClusterSequenceArea::initialize_and_run_cswa(
00157 const std::vector<L> & pseudojets,
00158 const JetDefinition & jet_def)
00159 {
00160
00161 ClusterSequenceAreaBase * _area_base_ptr;
00162 switch(_area_def.area_type()) {
00163 case active_area:
00164 _area_base_ptr = new ClusterSequenceActiveArea(pseudojets,
00165 jet_def,
00166 _area_def.ghost_spec());
00167 break;
00168 case active_area_explicit_ghosts:
00169 _area_base_ptr = new ClusterSequenceActiveAreaExplicitGhosts(pseudojets,
00170 jet_def,
00171 _area_def.ghost_spec());
00172 break;
00173 case voronoi_area:
00174 _area_base_ptr = new ClusterSequenceVoronoiArea(pseudojets,
00175 jet_def,
00176 _area_def.voronoi_spec());
00177 break;
00178 case one_ghost_passive_area:
00179 _area_base_ptr = new ClusterSequence1GhostPassiveArea(pseudojets,
00180 jet_def,
00181 _area_def.ghost_spec());
00182 break;
00183 case passive_area:
00184 _area_base_ptr = new ClusterSequencePassiveArea(pseudojets,
00185 jet_def,
00186 _area_def.ghost_spec());
00187 break;
00188 default:
00189 std::cerr << "Error: unrecognized area_type in ClusterSequenceArea:"
00190 << _area_def.area_type() << std::endl;
00191 exit(-1);
00192 }
00193
00194 _area_base = std::auto_ptr<ClusterSequenceAreaBase>(_area_base_ptr);
00195 transfer_from_sequence(*_area_base);
00196 }
00197
00198 FASTJET_END_NAMESPACE
00199
00200 #endif // __FASTJET_CLUSTERSEQUENCEAREA_HH__
00201
00202