7 std::vector<size_t>
idx(
v.size());
11 std::sort(
idx.begin(),
idx.end(), [&
v](
size_t i1,
size_t i2) {
return (*
v[
i1]) > (*
v[
i2]); });
17 return (
a->x() -
to[0]) * (
a->x() -
to[0]) + (
a->y() -
to[1]) * (
a->y() -
to[1]);
23 unsigned int es_size =
es.size();
24 for (
unsigned int i = 0;
i < es_size; ++
i) {
27 float x = thecls[
es[
i]]->x();
28 float y = thecls[
es[
i]]->y();
29 float z = thecls[
es[
i]]->z();
31 if (
zees[layer] == 0.) {
52 std::vector<reco::HGCalMultiCluster> thePreClusters;
54 std::vector<KDTree> hit_kdtree(2 * (
maxlayer + 1));
55 for (
unsigned int i = 0;
i <= 2 *
maxlayer + 1; ++
i) {
57 hit_kdtree[
i].build(
points[
i], bounds);
59 std::vector<int> vused(
es.size(), 0);
60 unsigned int used = 0;
62 unsigned int es_size =
es.size();
63 for (
unsigned int i = 0;
i < es_size; ++
i) {
67 vused[
i] = (thecls[
es[
i]]->z() > 0) ? 1 : -1;
70 std::array<double, 3> from{{thecls[
es[
i]]->x(), thecls[
es[
i]]->y(), thecls[
es[
i]]->z()}};
72 unsigned int lastlayer = firstlayer +
maxlayer + 1;
73 for (
unsigned int j = firstlayer;
j < lastlayer; ++
j) {
78 std::array<double, 3>
to{{0., 0.,
zees[
j]}};
90 std::vector<ClusterRef>
found;
92 hit_kdtree[
j].search(search_box,
found);
94 for (
unsigned int k = 0;
k <
found.size();
k++) {
95 if (vused[
found[
k].ind] == 0 && distReal2(thecls[
es[
found[
k].ind]],
to) < radius2) {
108 thePreClusters.push_back(
temp);
109 auto &back = thePreClusters.back();
111 back.setEnergy(
clusterTools->getMultiClusterEnergy(back));
116 return thePreClusters;
121 to[0] = from[0] / from[2] *
to[2];
122 to[1] = from[1] / from[2] *
to[2];