18 using SurfaceCluster = std::pair<Extent, std::vector<const Surface*>>;
19 std::vector<SurfaceCluster> clusteredSurfaces;
26 auto findCluster = [&](
const Extent& extent) -> SurfaceCluster& {
27 for (
auto& cluster : clusteredSurfaces) {
28 if (cluster.first.intersects(extent, sorting.first, sorting.second)) {
33 clusteredSurfaces.push_back(SurfaceCluster(extent, {}));
34 return clusteredSurfaces.back();
38 for (
auto& sf : surfaces) {
39 auto sfExtent = sf->polyhedronRepresentation(gctx, 1).extent();
40 auto& sfCluster = findCluster(sfExtent);
41 sfCluster.first.extend(sfExtent);
42 sfCluster.second.push_back(sf);
46 protoLayers.reserve(clusteredSurfaces.size());
47 for (
auto& clusters : clusteredSurfaces) {
48 ACTS_VERBOSE(
"Creatingg ProtoLayer with " << clusters.second.size()
50 protoLayers.push_back(
ProtoLayer(gctx, clusters.second));
57 const std::vector<SortingConfig>& sortings)
const {
58 ACTS_DEBUG(
"Received " << surfaces.size() <<
" surfaces at input.");
59 std::vector<std::vector<const Surface*>> sortSurfaces = {surfaces};
60 for (
const auto& sorting : sortings) {
61 ACTS_VERBOSE(
"-> Sorting a set of " << sortSurfaces.size() <<
" in "
63 std::vector<std::vector<const Surface*>> subSurfaces;
64 for (
const auto& ssurfaces : sortSurfaces) {
65 ACTS_VERBOSE(
"-> Surfaces for this sorting step: " << ssurfaces.size());
66 auto pLayers = protoLayers(gctx, ssurfaces, sorting);
67 ACTS_VERBOSE(
"-> Resulted in " << pLayers.size() <<
" ProtoLayers.");
68 for (
const auto& pLayer : pLayers) {
69 ACTS_VERBOSE(
"--> ProtoLayer containes " << pLayer.surfaces().size()
71 subSurfaces.push_back(pLayer.surfaces());
74 sortSurfaces = subSurfaces;
76 ACTS_DEBUG(
"Yielded " << sortSurfaces.size() <<
" at output.");
78 std::vector<Acts::ProtoLayer> finalProtoLayers;
80 for (
auto ssurfaces : sortSurfaces) {
81 finalProtoLayers.push_back(
ProtoLayer(gctx, ssurfaces));
84 return finalProtoLayers;