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_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
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
00078 double pt_per_unit_area(mean_pt_strategies strat=median,
00079 double range=2.0 ) const;
00080
00084 void parabolic_pt_per_unit_area(double & a,double & b, double raprange=-1.0,
00085 double exclude_above=-1.0) const;
00086
00087
00088
00089 private:
00090
00093 void _initialise_and_run_AA (const JetDefinition & jet_def,
00094 const ActiveAreaSpec & area_spec,
00095 const bool & writeout_combinations = false);
00096
00097
00098 valarray<double> _average_area, _average_area2;
00099 valarray<PseudoJet> _average_area_4vector;
00100 double _non_jet_area, _non_jet_area2, _non_jet_number;
00101
00102 double _etamax_for_area;
00103 double _etalim_for_area;
00104
00107 void _transfer_ghost_free_history(
00108 const ClusterSequenceActiveAreaExplicitGhosts & clust_seq);
00109
00110
00113 void _transfer_areas(const vector<int> & unique_hist_order,
00114 const ClusterSequenceActiveAreaExplicitGhosts & );
00115
00119 void _extract_tree(vector<int> &) const;
00122 void _extract_tree_children(int pos, valarray<bool> &, const valarray<int> &, vector<int> &) const;
00124 void _extract_tree_parents (int pos, valarray<bool> &, const valarray<int> &, vector<int> &) const;
00125
00128
00129
00130
00131 };
00132
00133
00134 template<class L> ClusterSequenceActiveArea::ClusterSequenceActiveArea
00135 (const std::vector<L> & pseudojets,
00136 const JetDefinition & jet_def,
00137 const ActiveAreaSpec & area_spec,
00138 const bool & writeout_combinations) {
00139
00140
00141 _transfer_input_jets(pseudojets);
00142
00143
00144 _initialise_and_run_AA(jet_def, area_spec, writeout_combinations);
00145
00146 }
00147
00148
00149
00150 FASTJET_END_NAMESPACE
00151
00152 #endif // __FASTJET_CLUSTERSEQUENCEACTIVEAREA_HH__