17 ParRange& prange,
unsigned int n_phi,
18 unsigned int n_d,
unsigned int n_k,
19 unsigned int n_dzdl,
unsigned int n_z0) {
21 float z0_size = (range1.
max_z0 - range1.
min_z0) / ((
float)n_z0);
22 float phi_size = (range1.
max_phi - range1.
min_phi) / ((
float)n_phi);
23 float d_size = (range1.
max_d - range1.
min_d) / ((
float)n_d);
24 float k_size = (range1.
max_k - range1.
min_k) / ((
float)n_k);
69 unsigned int max_hits,
70 vector<SimpleTrack3D>& tracks,
71 unsigned int maxtracks,
72 unsigned int zoomlevel) {
73 pairs_vec[zoomlevel]->clear();
74 pair<unsigned int, unsigned int> onepair;
76 for (
unsigned int i = 0; i < (hits_vec[zoomlevel]->size()); ++i) {
79 for (
unsigned int j = 0; j < (hits_vec[zoomlevel]->size()); ++j) {
80 if (((*(hits_vec[zoomlevel]))[j].get_layer() <=
81 (*(hits_vec[zoomlevel]))[i].get_layer())) {
87 pairs_vec[zoomlevel]->push_back(onepair);
90 findHelicesByPairs(min_hits, max_hits, tracks, maxtracks, zoomlevel);
94 unsigned int max_hits,
95 vector<SimpleTrack3D>& tracks,
96 unsigned int maxtracks,
97 unsigned int zoomlevel) {
98 if ((maxtracks != 0) && (tracks.size() >= max_tracks)) {
106 if (print_timings ==
true) {
107 gettimeofday(&t1, NULL);
109 vote_pairs(zoomlevel);
110 if (print_timings ==
true) {
111 gettimeofday(&t2, NULL);
112 time1 = ((double)(t1.tv_sec) + (double)(t1.tv_usec) / 1000000.);
113 time2 = ((double)(t2.tv_sec) + (double)(t2.tv_usec) / 1000000.);
114 vote_time += (time2 - time1);
117 unsigned int n_phi = n_phi_bins[zoomlevel];
118 unsigned int n_d = n_d_bins[zoomlevel];
119 unsigned int n_k = n_k_bins[zoomlevel];
120 unsigned int n_dzdl = n_dzdl_bins[zoomlevel];
121 unsigned int n_z0 = n_z0_bins[zoomlevel];
123 unsigned int n_entries = bins_vec[zoomlevel]->size();
124 if (n_entries == 0) {
128 if (print_timings ==
true) {
129 gettimeofday(&t1, NULL);
131 num_clusters[zoomlevel] = 0;
132 bool use_clusters =
true;
133 bool is_super_bin =
false;
134 makeClusters(zoomlevel, pairs_vec[zoomlevel]->size(), n_phi, n_d, n_k, n_dzdl,
135 n_z0, min_hits, *(clusters_vec[zoomlevel]), use_clusters,
138 gettimeofday(&t2, NULL);
139 time1 = ((double)(t1.tv_sec) + (double)(t1.tv_usec) / 1000000.);
140 time2 = ((double)(t2.tv_sec) + (double)(t2.tv_usec) / 1000000.);
141 cluster_time += (time2 - time1);
144 pair<unsigned int, unsigned int> onepair;
145 for (
unsigned int i = 0, size = num_clusters[zoomlevel]; i < size; ++i) {
149 hits_vec[zoomlevel + 1]->clear();
150 pairs_vec[zoomlevel + 1]->clear();
151 vector<unsigned int>::iterator index_iter;
152 for (index_iter = (*(clusters_vec[zoomlevel]))[i].hit_indexes.begin();
153 index_iter != (*(clusters_vec[zoomlevel]))[i].hit_indexes.end();
155 if (remove_hits ==
true) {
156 if (((*hit_used)[(*(hits_vec[zoomlevel]))
157 [(*(pairs_vec[zoomlevel]))[*index_iter].first]
158 .get_id()] ==
false) &&
159 ((*hit_used)[(*(hits_vec[zoomlevel]))
160 [(*(pairs_vec[zoomlevel]))[*index_iter].second]
161 .get_id()] ==
false)) {
162 temp_pairs.push_back((*(pairs_vec[zoomlevel]))[*index_iter]);
163 new_hits.insert((temp_pairs.back()).first);
164 new_hits.insert((temp_pairs.back()).
second);
167 temp_pairs.push_back((*(pairs_vec[zoomlevel]))[*index_iter]);
168 new_hits.insert((temp_pairs.back()).first);
169 new_hits.insert((temp_pairs.back()).
second);
173 unsigned int temp_index = 0;
174 set<unsigned int>::iterator
it;
175 for (it = new_hits.begin(); it != new_hits.end(); ++
it) {
176 hits_vec[zoomlevel + 1]->push_back((*(hits_vec[zoomlevel]))[*it]);
177 old_to_new[*
it] = temp_index;
180 for (
unsigned int j = 0, size = temp_pairs.size(); j != size; ++j) {
181 onepair.first = old_to_new[temp_pairs[j].first];
182 onepair.second = old_to_new[temp_pairs[j].second];
183 pairs_vec[zoomlevel + 1]->push_back(onepair);
186 (*(clusters_vec[zoomlevel]))[i].range, n_phi, n_d, n_k,
188 if ((breakRecursion(*(hits_vec[zoomlevel + 1]),
189 zoomranges[zoomlevel + 1]) ==
true)) {
190 }
else if (((zoomlevel + 1) == max_zoom) ||
191 (hits_vec[zoomlevel + 1]->size() <= max_hits)) {
194 findTracks(*(hits_vec[zoomlevel + 1]), tracks, zoomranges[zoomlevel + 1]);
196 findHelicesByPairs(min_hits, max_hits, tracks, maxtracks, zoomlevel + 1);