File indexing completed on 2025-01-18 09:11:17
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Detector/detail/ProtoMaterialHelper.hpp"
0010
0011 #include "Acts/Detector/ProtoBinning.hpp"
0012 #include "Acts/Geometry/Extent.hpp"
0013 #include "Acts/Material/ProtoSurfaceMaterial.hpp"
0014 #include "Acts/Surfaces/Surface.hpp"
0015
0016 Acts::Experimental::BinningDescription
0017 Acts::Experimental::detail::ProtoMaterialHelper::attachProtoMaterial(
0018 const GeometryContext& gctx, Surface& surface,
0019 const BinningDescription& bDescription) {
0020
0021 BinningDescription fbDescription;
0022
0023 Extent sExtent = surface.polyhedronRepresentation(gctx, 1).extent();
0024 for (const auto& b : bDescription.binning) {
0025 ProtoBinning fBinning = b;
0026
0027 if (fBinning.autorange) {
0028 auto range = sExtent.range(b.axisDir);
0029 fBinning = ProtoBinning(b.axisDir, b.boundaryType, range.min(),
0030 range.max(), b.bins(), b.expansion);
0031 }
0032 fbDescription.binning.push_back(fBinning);
0033 }
0034
0035 auto protoMaterial =
0036 std::make_shared<ProtoGridSurfaceMaterial>(fbDescription);
0037 surface.assignSurfaceMaterial(protoMaterial);
0038
0039 return fbDescription;
0040 }