Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-09 09:46:31

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 // This file is part of the Acts project.
0010 //
0011 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0012 //
0013 // This Source Code Form is subject to the terms of the Mozilla Public
0014 // License, v. 2.0. If a copy of the MPL was not distributed with this
0015 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0016 
0017 #pragma once
0018 
0019 #include "Acts/Geometry/GeometryContext.hpp"
0020 #include "Acts/Geometry/PortalShell.hpp"
0021 #include "Acts/Geometry/StaticBlueprintNode.hpp"
0022 #include "Acts/Geometry/TrackingVolume.hpp"
0023 
0024 namespace Acts {
0025 
0026 /// Wraps a single child blueprint node and pads it into a larger volume whose
0027 /// dimensions are evaluated at construction time using the child's extent plus
0028 /// a configurable envelope.
0029 /// @note This node can only have a single child. This is not an error during
0030 ///       tree building, but during geometry construction.
0031 /// It defers most of the functionality to @ref Acts::StaticBlueprintNode,
0032 /// and only implements the build phase to perform the padding.
0033 class PadBlueprintNode final : public StaticBlueprintNode {
0034  public:
0035   /// Main constructor for the padding node.
0036   /// @param name The name of the padded volume.
0037   /// @param envelope The envelope to apply to the child node's extent to create the padded volume.
0038   explicit PadBlueprintNode(const std::string& name,
0039                             const ExtentEnvelope& envelope);
0040 
0041   ~PadBlueprintNode() override = default;
0042 
0043   /// @copydoc BlueprintNode::build
0044   /// Build-phase of the blueprint construction. Returns the padded volume.
0045   Volume& build(const BlueprintOptions& options, const GeometryContext& gctx,
0046                 const Logger& logger = Acts::getDummyLogger()) override;
0047 
0048   /// Create a volume that encloses @p inner, enlarged by @p envelope.
0049   /// The padded volume inherits the transform of @p inner, and its bounds are
0050   /// expanded in the *local* frame of @p inner.
0051   /// @note The envelope must be symmetric in every direction that the bounds
0052   ///       cannot express asymmetrically (z for cylinders, all of x/y/z for
0053   ///       cuboids), otherwise the padded volume could not stay centered on
0054   ///       @p inner.
0055   /// @param gctx The geometry context
0056   /// @param inner The volume to enclose
0057   /// @param envelope The envelope to add to the bounds of @p inner
0058   /// @param name The name of the padded volume
0059   /// @param logger The logger to use
0060   /// @return The padded volume enclosing @p inner
0061   /// @throws std::logic_error if @p inner has unsupported bounds, or if the
0062   ///         envelope is asymmetric where it must not be
0063   static std::unique_ptr<TrackingVolume> padded(
0064       const GeometryContext& gctx, const Volume& inner,
0065       const ExtentEnvelope& envelope, const std::string& name,
0066       const Logger& logger = Acts::getDummyLogger());
0067 
0068  private:
0069   ExtentEnvelope m_envelope;
0070   std::string m_name;
0071 };
0072 
0073 namespace Experimental {
0074 /// @deprecated The blueprint geometry moved out of the `Acts::Experimental`
0075 ///             namespace. Use @ref Acts::PadBlueprintNode instead. This alias
0076 ///             is kept for backward compatibility and will be removed.
0077 using PadBlueprintNode [[deprecated(
0078     "Acts::Experimental::PadBlueprintNode moved to Acts::PadBlueprintNode")]] =
0079     Acts::PadBlueprintNode;
0080 }  // namespace Experimental
0081 
0082 }  // namespace Acts