104 vector<TrackJetParticlePtr> particle_list;
106 const vector<PseudoJet> & jets = clust_seq.
jets();
108 for (vector<PseudoJet>::const_iterator mom_it = jets.begin(); mom_it != jets.end(); mom_it++){
109 particle_list.push_back(TrackJetParticlePtr(index, mom_it->perp2()));
114 stable_sort(particle_list.begin(), particle_list.end());
120 vector<PseudoJet> tuned_particles = clust_seq.
jets();
121 vector<PseudoJet> tuned_tracks = clust_seq.
jets();
122 for (vector<PseudoJet>::iterator pit = tuned_particles.begin();
123 pit != tuned_particles.end(); pit++)
124 _jet_recombiner.preprocess(*pit);
125 for (vector<PseudoJet>::iterator pit = tuned_tracks.begin();
126 pit != tuned_tracks.end(); pit++)
127 _track_recombiner.preprocess(*pit);
131 list<int> sorted_pt_index;
132 for (vector<TrackJetParticlePtr>::iterator mom_it = particle_list.begin();
133 mom_it != particle_list.end(); mom_it++)
134 sorted_pt_index.push_back(mom_it->index);
137 while (sorted_pt_index.size()){
141 int current_jet_index = sorted_pt_index.front();
142 PseudoJet current_jet = tuned_particles[current_jet_index];
143 PseudoJet current_track = tuned_tracks[current_jet_index];
146 list<int>::iterator index_it = sorted_pt_index.begin();
147 sorted_pt_index.erase(index_it);
150 index_it = sorted_pt_index.begin();
151 while (index_it != sorted_pt_index.end()){
152 const PseudoJet & current_particle = tuned_particles[*index_it];
153 const PseudoJet & current_particle_track = tuned_tracks[*index_it];
156 double distance2 = current_track.
plain_distance(current_particle_track);
157 if (distance2 <= _radius2){
161 _jet_recombiner.recombine(current_jet, current_particle, new_jet);
162 _track_recombiner.recombine(current_track, current_particle_track, new_track);
167 current_jet = new_jet;
168 current_track = new_track;
169 current_jet_index = new_jet_index;
172 sorted_pt_index.erase(index_it);
176 index_it = sorted_pt_index.begin();