25 using SurfaceCluster = std::pair<Extent, std::vector<const Surface*>>;
26 std::vector<SurfaceCluster> clusteredSurfaces;
33 auto findCluster = [&](
const Extent& extent) -> SurfaceCluster& {
34 for (
auto& cluster : clusteredSurfaces) {
35 if (cluster.first.intersects(extent, sorting.first)) {
40 clusteredSurfaces.push_back(SurfaceCluster(extent, {}));
41 return clusteredSurfaces.back();
45 for (
auto& sf : surfaces) {
46 auto sfExtent = sf->polyhedronRepresentation(gctx, 1).extent();
47 sfExtent.envelope()[sorting.first] = {sorting.second, sorting.second};
48 auto& sfCluster = findCluster(sfExtent);
49 sfCluster.first.extend(sfExtent);
50 sfCluster.second.push_back(sf);
53 protoLayers.reserve(clusteredSurfaces.size());
54 for (
auto&
clusters : clusteredSurfaces) {
64 const std::vector<SortingConfig>& sortings)
const {
65 ACTS_DEBUG(
"Received " << surfaces.size() <<
" surfaces at input.");
66 std::vector<std::vector<const Surface*>> sortSurfaces = {surfaces};
67 for (
const auto& sorting : sortings) {
68 ACTS_VERBOSE(
"-> Sorting a set of " << sortSurfaces.size() <<
" in "
70 std::vector<std::vector<const Surface*>> subSurfaces;
71 for (
const auto& ssurfaces : sortSurfaces) {
72 ACTS_VERBOSE(
"-> Surfaces for this sorting step: " << ssurfaces.size());
73 auto pLayers = protoLayers(gctx, ssurfaces, sorting);
74 ACTS_VERBOSE(
"-> Resulted in " << pLayers.size() <<
" ProtoLayers.");
75 for (
const auto& pLayer : pLayers) {
76 ACTS_VERBOSE(
"--> ProtoLayer contains " << pLayer.surfaces().size()
78 subSurfaces.push_back(pLayer.surfaces());
81 sortSurfaces = subSurfaces;
83 ACTS_DEBUG(
"Yielded " << sortSurfaces.size() <<
" at output.");
85 std::vector<Acts::ProtoLayer> finalProtoLayers;
87 for (
const auto& ssurfaces : sortSurfaces) {
88 finalProtoLayers.push_back(
ProtoLayer(gctx, ssurfaces));
91 return finalProtoLayers;