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_CLUSTERSEQUENCEACTIVEAREAEXPLICITGHOSTS_HH_
00032 #define __FASTJET_CLUSTERSEQUENCEACTIVEAREAEXPLICITGHOSTS_HH_
00033
00034 #include "fastjet/PseudoJet.hh"
00035 #include "fastjet/ClusterSequenceWithArea.hh"
00036 #include "fastjet/ActiveAreaSpec.hh"
00037 #include<iostream>
00038 #include<vector>
00039
00040 FASTJET_BEGIN_NAMESPACE
00041
00042
00047 class ClusterSequenceActiveAreaExplicitGhosts :
00048 public ClusterSequenceWithArea {
00049 public:
00052 template<class L> ClusterSequenceActiveAreaExplicitGhosts
00053 (const std::vector<L> & pseudojets,
00054 const JetDefinition & jet_def,
00055 const ActiveAreaSpec & area_spec,
00056 const bool & writeout_combinations = false)
00057 : ClusterSequenceWithArea() {
00058 _initialise(pseudojets,jet_def,area_spec,writeout_combinations); }
00059
00061 template<class L> void _initialise
00062 (const std::vector<L> & pseudojets,
00063 const JetDefinition & jet_def,
00064 const ActiveAreaSpec & area_spec,
00065 const bool & writeout_combinations);
00066
00067
00068
00070 unsigned int n_hard_particles() const;
00071
00073 virtual double area (const PseudoJet & jet) const;
00074
00079 virtual PseudoJet area_4vector (const PseudoJet & jet) const;
00080
00082 bool is_pure_ghost(const PseudoJet & jet) const;
00083
00087 bool is_pure_ghost(int history_index) const;
00088
00090 double total_area () const;
00091
00092 private:
00093
00094 int _n_ghosts;
00095 double _ghost_area;
00096 std::vector<bool> _is_pure_ghost;
00097 std::vector<double> _areas;
00098 std::vector<PseudoJet> _area_4vectors;
00099
00100 unsigned int _initial_hard_n;
00101
00104 void _add_ghosts(const ActiveAreaSpec & area_spec);
00105
00109 void _post_process();
00110
00111 };
00112
00113
00114
00115
00116
00117 template<class L> void ClusterSequenceActiveAreaExplicitGhosts::_initialise
00118 (const std::vector<L> & pseudojets,
00119 const JetDefinition & jet_def,
00120 const ActiveAreaSpec & area_spec,
00121 const bool & writeout_combinations) {
00122
00123
00124
00125
00126
00127
00128 for (unsigned int i = 0; i < pseudojets.size(); i++) {
00129 PseudoJet mom(pseudojets[i]);
00130
00131 _jets.push_back(mom);
00132 _is_pure_ghost.push_back(false);
00133 }
00134
00135 _initial_hard_n = _jets.size();
00136
00137 _add_ghosts(area_spec);
00138
00139 if (writeout_combinations) {
00140 std::cout << "# Printing particles including ghosts\n";
00141 for (unsigned j = 0; j < _jets.size(); j++) {
00142 printf("%5u %20.13f %20.13f %20.13e\n",
00143 j,_jets[j].rap(),_jets[j].phi_02pi(),_jets[j].kt2());
00144 }
00145 std::cout << "# Finished printing particles including ghosts\n";
00146 }
00147
00148
00149
00150 _jets.reserve(_jets.size()*2);
00151
00152
00153 _initialise_and_run(jet_def,writeout_combinations);
00154
00155
00156 _post_process();
00157 }
00158
00159
00160 inline unsigned int ClusterSequenceActiveAreaExplicitGhosts::n_hard_particles() const {return _initial_hard_n;}
00161
00162
00163
00164 FASTJET_END_NAMESPACE
00165
00166 #endif // __FASTJET_CLUSTERSEQUENCEACTIVEAREAEXPLICITGHOSTS_HH_