32 #include "fastjet/PseudoJet.hh"
33 #include "fastjet/ClusterSequence.hh"
39 FASTJET_BEGIN_NAMESPACE
50 void ClusterSequence::_really_dumb_cluster () {
54 vector<PseudoJet *> jetsp(_jets.size());
55 vector<int> indices(_jets.size());
57 for (
size_t i = 0; i<_jets.size(); i++) {
58 jetsp[i] = & _jets[i];
62 for (
int n = jetsp.size(); n > 0; n--) {
66 double ymin = jet_scale_for_algorithm(*(jetsp[0]));
68 for (
int i = 0; i < n; i++) {
69 double yiB = jet_scale_for_algorithm(*(jetsp[i]));
71 ymin = yiB; ii = i; jj = -2;}
75 for (
int i = 0; i < n-1; i++) {
76 for (
int j = i+1; j < n; j++) {
78 double y = min(jet_scale_for_algorithm(*(jetsp[i])),
79 jet_scale_for_algorithm(*(jetsp[j])))
80 * jetsp[i]->plain_distance(*jetsp[j])*_invR2;
81 if (y < ymin) {ymin = y; ii = i; jj = j;}
97 int newn = 2*jetsp.size() - n;
101 _do_ij_recombination_step(jetsp[ii]-&_jets[0],
102 jetsp[jj]-&_jets[0], ymin, nn);
105 jetsp[ii] = &_jets[nn];
108 jetsp[jj] = jetsp[n-1];
110 indices[jj] = indices[n-1];
124 _do_iB_recombination_step(jetsp[ii]-&_jets[0], ymin);
126 jetsp[ii] = jetsp[n-1];
127 indices[ii] = indices[n-1];
134 FASTJET_END_NAMESPACE