33 #include "fastjet/ClusterSequence.hh" 34 #include "fastjet/NestedDefsPlugin.hh" 40 FASTJET_BEGIN_NAMESPACE
44 string NestedDefsPlugin::description ()
const {
47 desc <<
"NestedDefs: successive application of " ;
49 for (list<JetDefinition>::const_iterator it=_defs.begin();it!=_defs.end();it++){
50 desc <<
"Definition " << i++ <<
" [" << it->description() <<
"] - ";
57 vector<PseudoJet> momenta;
60 momenta = clust_seq.
jets();
61 unsigned int step_n = momenta.size();
65 vector<unsigned int> conversion_table(2*step_n);
66 vector<unsigned int> new_conversion_table;
67 for (
unsigned int i=0;i<step_n;i++)
68 conversion_table[i]=i;
75 list<JetDefinition>::const_iterator def_iterator = _defs.begin();
76 unsigned int def_index=0;
79 while (def_iterator!=_defs.end()){
80 last_def = (def_index == (_defs.size()-1));
87 new_conversion_table.clear();
90 const vector<ClusterSequence::history_element> & step_history = step_cs.
history();
95 vector<ClusterSequence::history_element>::const_iterator
96 hist_iterator = step_history.begin();
98 for (
unsigned int i=step_n;i!=0;i--)
101 while (hist_iterator != step_history.end()){
103 if (hist_iterator->parent2 == ClusterSequence::BeamJet){
106 unsigned int step_jet_index = step_cs.
history()[hist_iterator->parent1].jetp_index;
111 momenta.push_back(step_cs.
jets()[step_jet_index]);
112 new_conversion_table.push_back(conversion_table[step_jet_index]);
117 unsigned int step_jet1_index = step_cs.
history()[hist_iterator->parent1].jetp_index;
118 unsigned int step_jet2_index = step_cs.
history()[hist_iterator->parent2].jetp_index;
119 PseudoJet newjet = step_cs.
jets()[hist_iterator->jetp_index];
122 conversion_table[step_jet2_index],
123 last_def ? hist_iterator->dij : 0.0,
127 conversion_table[hist_iterator->jetp_index]=jet_k;
137 step_n = momenta.size();
138 for (
unsigned int i=0;i<step_n;i++)
139 conversion_table[i] = new_conversion_table[i];
148 FASTJET_END_NAMESPACE
const std::vector< history_element > & history() const
allow the user to access the raw internal history.
void plugin_record_ij_recombination(int jet_i, int jet_j, double dij, int &newjet_k)
record the fact that there has been a recombination between jets()[jet_i] and jets()[jet_k], with the specified dij, and return the index (newjet_k) allocated to the new jet, whose momentum is assumed to be the 4-vector sum of that of jet_i and jet_j
void plugin_record_iB_recombination(int jet_i, double diB)
record the fact that there has been a recombination between jets()[jet_i] and the beam...
Class to contain pseudojets, including minimal information of use to jet-clustering routines...
const std::vector< PseudoJet > & jets() const
allow the user to access the internally stored _jets() array, which contains both the initial particl...