12 vector<HelixRange>& ranges,
13 vector<vector<SimpleHit3D> >& split_hits,
14 unsigned int zoomlevel) {
15 index_mapping.clear();
16 index_mapping.resize(hits_vec[zoomlevel]->size(), 0);
17 for (
unsigned int i = 0; i < hits_vec[zoomlevel]->size(); i++) {
18 index_mapping[i] = (*(hits_vec[zoomlevel]))[i].get_id();
19 (*(hits_vec[zoomlevel]))[i].set_id(i);
27 unsigned int n_entries = bins_vec[zoomlevel]->size();
32 unsigned int n_phi = n_phi_bins[zoomlevel];
33 unsigned int n_d = n_d_bins[zoomlevel];
34 unsigned int n_k = n_k_bins[zoomlevel];
35 unsigned int n_dzdl = n_dzdl_bins[zoomlevel];
36 unsigned int n_z0 = n_z0_bins[zoomlevel];
38 unsigned int count = 0;
39 hits_vec[zoomlevel + 1]->clear();
40 setRange((*(bins_vec[zoomlevel]))[count], zoomranges[zoomlevel],
41 zoomranges[zoomlevel + 1], n_phi, n_d, n_k, n_dzdl, n_z0);
43 while (count < n_entries) {
44 hits_vec[zoomlevel + 1]->push_back(
45 (*(hits_vec[zoomlevel]))[(*(bins_vec[zoomlevel]))[count].entry]);
46 hits_vec[zoomlevel + 1]->back().set_id(
47 index_mapping[hits_vec[zoomlevel + 1]->back().get_id()]);
50 if ((count == n_entries) || ((*(bins_vec[zoomlevel]))[count].bin !=
51 (*(bins_vec[zoomlevel]))[count - 1].bin)) {
52 if (((*(bins_vec[zoomlevel]))[count - 1].bin != 0) &&
53 (split_hits.size() == 0)) {
54 for (
unsigned int b = 0; b < (*(bins_vec[zoomlevel]))[count - 1].bin;
58 setRange(bp, zoomranges[zoomlevel], zoomranges[zoomlevel + 1], n_phi,
59 n_d, n_k, n_dzdl, n_z0);
60 ranges.push_back(zoomranges[zoomlevel + 1]);
61 split_hits.push_back(vector<SimpleHit3D>());
63 setRange((*(bins_vec[zoomlevel]))[count - 1], zoomranges[zoomlevel],
64 zoomranges[zoomlevel + 1], n_phi, n_d, n_k, n_dzdl, n_z0);
67 ranges.push_back(zoomranges[zoomlevel + 1]);
68 split_hits.push_back(*(hits_vec[zoomlevel + 1]));
69 if (count == n_entries) {
72 hits_vec[zoomlevel + 1]->clear();
74 unsigned int bin1 = (*(bins_vec[zoomlevel]))[count - 1].bin;
75 unsigned int bin2 = (*(bins_vec[zoomlevel]))[count].bin;
76 for (
unsigned int b = (bin1 + 1); b < bin2; ++b) {
79 setRange(bp, zoomranges[zoomlevel], zoomranges[zoomlevel + 1], n_phi,
80 n_d, n_k, n_dzdl, n_z0);
81 ranges.push_back(zoomranges[zoomlevel + 1]);
82 split_hits.push_back(vector<SimpleHit3D>());
85 setRange((*(bins_vec[zoomlevel]))[count], zoomranges[zoomlevel],
86 zoomranges[zoomlevel + 1], n_phi, n_d, n_k, n_dzdl, n_z0);
90 unsigned int total_bins = n_phi * n_d * n_k * n_dzdl * n_z0;
91 for (
unsigned int b = (1 + (*(bins_vec[zoomlevel]))[count - 1].bin);
92 b < total_bins; ++b) {
95 setRange(bp, zoomranges[zoomlevel], zoomranges[zoomlevel + 1], n_phi, n_d,
97 ranges.push_back(zoomranges[zoomlevel + 1]);
98 split_hits.push_back(vector<SimpleHit3D>());