fastjet 2.4.5
|
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.
: _defs(defs){}
fastjet::NestedDefsPlugin::NestedDefsPlugin | ( | const NestedDefsPlugin & | plugin | ) | [inline] |
string fastjet::NestedDefsPlugin::description | ( | ) | const [virtual] |
return a textual description of the jet-definition implemented in this plugin
Implements fastjet::JetDefinition::Plugin.
Definition at line 46 of file NestedDefsPlugin.cc.
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 fastjet::JetDefinition::Plugin.
Definition at line 70 of file NestedDefsPlugin.hh.
{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 fastjet::JetDefinition::Plugin.
Definition at line 58 of file NestedDefsPlugin.cc.
References fastjet::ClusterSequence::history(), fastjet::ClusterSequence::jets(), fastjet::ClusterSequence::plugin_record_iB_recombination(), and fastjet::ClusterSequence::plugin_record_ij_recombination().
{ vector<PseudoJet> momenta; // build the initial list of particles momenta = clust_seq.jets(); unsigned int step_n = momenta.size(); // initialise the conversion table, which works as follows // conversion_table[step_cs_jet_index] = main_cs_jet_index vector<unsigned int> conversion_table(2*step_n); vector<unsigned int> new_conversion_table; for (unsigned int i=0;i<step_n;i++) conversion_table[i]=i; // Now the steps go as follows: // for each definition in the list, // - do the clustering, // - copy the history into the main one // - update the list of momenta and the index conversion table list<JetDefinition>::const_iterator def_iterator = _defs.begin(); unsigned int def_index=0; bool last_def=false; while (def_iterator!=_defs.end()){ last_def = (def_index == (_defs.size()-1)); // do the clustering ClusterSequence step_cs(momenta, *def_iterator); // clear the momenta as we shall fill them again momenta.clear(); new_conversion_table.clear(); // retrieve the history const vector<ClusterSequence::history_element> & step_history = step_cs.history(); // copy the history // note that we skip the initial steps which are just the // declaration of the particles. vector<ClusterSequence::history_element>::const_iterator hist_iterator = step_history.begin(); for (unsigned int i=step_n;i!=0;i--) hist_iterator++; while (hist_iterator != step_history.end()){ // check if it is a recombination with the beam or a simple recombination if (hist_iterator->parent2 == ClusterSequence::BeamJet){ // save this jet for future clustering // unless we've reached the last def in which case, record the clustering unsigned int step_jet_index = step_cs.history()[hist_iterator->parent1].jetp_index; if (last_def){ clust_seq.plugin_record_iB_recombination(conversion_table[step_jet_index], hist_iterator->dij); } else { momenta.push_back(step_cs.jets()[step_jet_index]); new_conversion_table.push_back(conversion_table[step_jet_index]); } } else { // record combination // note that we set the recombination distance to 0 except for the last alg unsigned int step_jet1_index = step_cs.history()[hist_iterator->parent1].jetp_index; unsigned int step_jet2_index = step_cs.history()[hist_iterator->parent2].jetp_index; PseudoJet newjet = step_cs.jets()[hist_iterator->jetp_index]; int jet_k; clust_seq.plugin_record_ij_recombination(conversion_table[step_jet1_index], conversion_table[step_jet2_index], last_def ? hist_iterator->dij : 0.0, newjet, jet_k); // save info in the conversion table for tracking purposes conversion_table[hist_iterator->jetp_index]=jet_k; } // go to the next history element hist_iterator++; } // finalise this step: // - update nr of particles // - update conversion table step_n = momenta.size(); for (unsigned int i=0;i<step_n;i++) conversion_table[i] = new_conversion_table[i]; // go to the next alg def_index++; def_iterator++; } }
std::list<JetDefinition> fastjet::NestedDefsPlugin::_defs [private] |
Definition at line 73 of file NestedDefsPlugin.hh.