NestedAglsPlugin is a plugin for fastjet (v2.4 upwards) that, given a list of jet definitions, performs the clustering by feeding the particles to the first algorithm and then, successively feeding the output to the next algorithm in the list. More...
#include <NestedDefsPlugin.hh>
Public Member Functions | |
NestedDefsPlugin (std::list< JetDefinition > &defs) | |
Main constructor for the NestedDefs Plugin class. | |
NestedDefsPlugin (const NestedDefsPlugin &plugin) | |
copy constructor | |
virtual std::string | description () const |
return a textual description of the jet-definition implemented in this plugin | |
virtual void | run_clustering (ClusterSequence &) const |
given a ClusterSequence that has been filled up with initial particles, the following function should fill up the rest of the ClusterSequence, using the following member functions of ClusterSequence:
| |
virtual double | R () const |
the plugin mechanism's standard way of accessing the jet radius here we return the R of the last alg in the list | |
Private Attributes | |
std::list< JetDefinition > | _defs |
NestedAglsPlugin is a plugin for fastjet (v2.4 upwards) that, given a list of jet definitions, performs the clustering by feeding the particles to the first algorithm and then, successively feeding the output to the next algorithm in the list.
Definition at line 52 of file NestedDefsPlugin.hh.
fastjet::NestedDefsPlugin::NestedDefsPlugin | ( | std::list< JetDefinition > & | defs | ) | [inline] |
Main constructor for the NestedDefs Plugin class.
The argument is an initialised list of jet algorithms
Definition at line 57 of file NestedDefsPlugin.hh.
00057 : 00058 _defs(defs){}
fastjet::NestedDefsPlugin::NestedDefsPlugin | ( | const NestedDefsPlugin & | plugin | ) | [inline] |
copy constructor
Definition at line 61 of file NestedDefsPlugin.hh.
string fastjet::NestedDefsPlugin::description | ( | ) | const [virtual] |
return a textual description of the jet-definition implemented in this plugin
Implements JetDefinition::Plugin.
Definition at line 46 of file NestedDefsPlugin.cc.
References _defs.
00046 { 00047 ostringstream desc; 00048 00049 desc << "NestedDefs: successive application of " ; 00050 unsigned int i=1; 00051 for (list<JetDefinition>::const_iterator it=_defs.begin();it!=_defs.end();it++){ 00052 desc << "Definition " << i++ << " [" << it->description() << "] - "; 00053 } 00054 00055 return desc.str(); 00056 }
virtual double fastjet::NestedDefsPlugin::R | ( | ) | const [inline, virtual] |
the plugin mechanism's standard way of accessing the jet radius here we return the R of the last alg in the list
Implements JetDefinition::Plugin.
Definition at line 70 of file NestedDefsPlugin.hh.
00070 {return _defs.rbegin()->R();}
void fastjet::NestedDefsPlugin::run_clustering | ( | ClusterSequence & | ) | const [virtual] |
given a ClusterSequence that has been filled up with initial particles, the following function should fill up the rest of the ClusterSequence, using the following member functions of ClusterSequence:
..)
Implements JetDefinition::Plugin.
Definition at line 58 of file NestedDefsPlugin.cc.
References _defs, ClusterSequence::BeamJet, ClusterSequence::history(), ClusterSequence::jets(), ClusterSequence::plugin_record_iB_recombination(), and ClusterSequence::plugin_record_ij_recombination().
00058 { 00059 vector<PseudoJet> momenta; 00060 00061 // build the initial list of particles 00062 momenta = clust_seq.jets(); 00063 unsigned int step_n = momenta.size(); 00064 00065 // initialise the conversion table, which works as follows 00066 // conversion_table[step_cs_jet_index] = main_cs_jet_index 00067 vector<unsigned int> conversion_table(2*step_n); 00068 vector<unsigned int> new_conversion_table; 00069 for (unsigned int i=0;i<step_n;i++) 00070 conversion_table[i]=i; 00071 00072 // Now the steps go as follows: 00073 // for each definition in the list, 00074 // - do the clustering, 00075 // - copy the history into the main one 00076 // - update the list of momenta and the index conversion table 00077 list<JetDefinition>::const_iterator def_iterator = _defs.begin(); 00078 unsigned int def_index=0; 00079 bool last_def=false; 00080 00081 while (def_iterator!=_defs.end()){ 00082 last_def = (def_index == (_defs.size()-1)); 00083 00084 // do the clustering 00085 ClusterSequence step_cs(momenta, *def_iterator); 00086 00087 // clear the momenta as we shall fill them again 00088 momenta.clear(); 00089 new_conversion_table.clear(); 00090 00091 // retrieve the history 00092 const vector<ClusterSequence::history_element> & step_history = step_cs.history(); 00093 00094 // copy the history 00095 // note that we skip the initial steps which are just the 00096 // declaration of the particles. 00097 vector<ClusterSequence::history_element>::const_iterator 00098 hist_iterator = step_history.begin(); 00099 00100 for (unsigned int i=step_n;i!=0;i--) 00101 hist_iterator++; 00102 00103 while (hist_iterator != step_history.end()){ 00104 // check if it is a recombination with the beam or a simple recombination 00105 if (hist_iterator->parent2 == ClusterSequence::BeamJet){ 00106 // save this jet for future clustering 00107 // unless we've reached the last def in which case, record the clustering 00108 unsigned int step_jet_index = step_cs.history()[hist_iterator->parent1].jetp_index; 00109 if (last_def){ 00110 clust_seq.plugin_record_iB_recombination(conversion_table[step_jet_index], 00111 hist_iterator->dij); 00112 } else { 00113 momenta.push_back(step_cs.jets()[step_jet_index]); 00114 new_conversion_table.push_back(conversion_table[step_jet_index]); 00115 } 00116 } else { 00117 // record combination 00118 // note that we set the recombination distance to 0 except for the last alg 00119 unsigned int step_jet1_index = step_cs.history()[hist_iterator->parent1].jetp_index; 00120 unsigned int step_jet2_index = step_cs.history()[hist_iterator->parent2].jetp_index; 00121 PseudoJet newjet = step_cs.jets()[hist_iterator->jetp_index]; 00122 int jet_k; 00123 clust_seq.plugin_record_ij_recombination(conversion_table[step_jet1_index], 00124 conversion_table[step_jet2_index], 00125 last_def ? hist_iterator->dij : 0.0, 00126 newjet, jet_k); 00127 00128 // save info in the conversion table for tracking purposes 00129 conversion_table[hist_iterator->jetp_index]=jet_k; 00130 } 00131 00132 // go to the next history element 00133 hist_iterator++; 00134 } 00135 00136 // finalise this step: 00137 // - update nr of particles 00138 // - update conversion table 00139 step_n = momenta.size(); 00140 for (unsigned int i=0;i<step_n;i++) 00141 conversion_table[i] = new_conversion_table[i]; 00142 00143 // go to the next alg 00144 def_index++; 00145 def_iterator++; 00146 } 00147 00148 }
std::list<JetDefinition> fastjet::NestedDefsPlugin::_defs [private] |
Definition at line 73 of file NestedDefsPlugin.hh.
Referenced by description(), and run_clustering().