Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 08:11:52

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 #pragma once
0010 
0011 #include "Acts/Geometry/BlueprintNode.hpp"
0012 #include "Acts/Geometry/CuboidVolumeBounds.hpp"
0013 #include "Acts/Utilities/ProtoAxis.hpp"
0014 
0015 namespace Acts {
0016 class HomogeneousSurfaceMaterial;
0017 
0018 namespace Experimental {
0019 
0020 namespace detail {
0021 class MaterialDesignatorBlueprintNodeImpl;
0022 }
0023 
0024 /// This node type registers material proxies into its child volume during the
0025 /// blueprint construction. It is configured ahead of time which volume faces
0026 /// to mark up, and how do to so.
0027 /// @note This node can only have a single child. This is not an error during
0028 ///       tree building, but during geometry construction.
0029 class MaterialDesignatorBlueprintNode final : public BlueprintNode {
0030  public:
0031   /// Main constructor for the material designator node.
0032   /// @param name The name of the node (for debug only)
0033   explicit MaterialDesignatorBlueprintNode(const std::string& name);
0034 
0035   ~MaterialDesignatorBlueprintNode() override;
0036 
0037   /// @copydoc BlueprintNode::name
0038   const std::string& name() const override;
0039 
0040   /// @copydoc BlueprintNode::toStream
0041   void toStream(std::ostream& os) const override;
0042 
0043   /// This method participates in the geometry construction.
0044   /// It checks that this node only has a single child, is correctly
0045   /// configured, and forwards the call.
0046   /// @param options The global blueprint options
0047   /// @param gctx The geometry context (nominal usually)
0048   /// @param logger The logger to use
0049   /// @return The child volume
0050   Volume& build(const BlueprintOptions& options, const GeometryContext& gctx,
0051                 const Logger& logger = Acts::getDummyLogger()) override;
0052 
0053   /// This method participates in the geometry construction.
0054   /// It receives the populated portal shell from its only child and attaches
0055   /// material proxies by consulting the configuration stored in the node.
0056   /// @note Currently, this node will unconditionally attach
0057   ///       @ref Acts::ProtoGridSurfaceMaterial
0058   ///
0059   /// @param options The global blueprint options
0060   /// @param gctx The geometry context (nominal usually)
0061   /// @param logger The logger to use
0062   /// @return The portal shell with material proxies attached
0063   PortalShellBase& connect(
0064       const BlueprintOptions& options, const GeometryContext& gctx,
0065       const Logger& logger = Acts::getDummyLogger()) override;
0066 
0067   /// This method participates in the geometry construction.
0068   /// Passes through the call to its only child.
0069   /// @param options The global blueprint options
0070   /// @param gctx The geometry context (nominal usually)
0071   /// @param parent The parent volume
0072   /// @param logger The logger to use during construction
0073   void finalize(const BlueprintOptions& options, const GeometryContext& gctx,
0074                 TrackingVolume& parent, const Logger& logger) override;
0075 
0076   /// Configure the designator with a cylinder face and corresponding binning
0077   /// information.
0078   /// @note This method can be called multiple times to configure different faces.
0079   /// @param face The face of the cylinder to configure
0080   /// @param loc0 The first binning configuration along local axis 0
0081   /// @param loc1 The first binning configuration along local axis 1
0082   /// @return The material designator node
0083   /// @note If this node has previously been configured with a different volume
0084   ///       shape, this will throw an exception.
0085   MaterialDesignatorBlueprintNode& configureFace(
0086       CylinderVolumeBounds::Face face, const DirectedProtoAxis& loc0,
0087       const DirectedProtoAxis& loc1);
0088 
0089   /// Configure the designator with a cuboid face and corresponding binning
0090   /// information.
0091   /// @param face The face of the cylinder to configure
0092   /// @param material The material to use
0093   /// @return The material designator node
0094   /// @note If this node has previously been configured with a different volume
0095   ///       shape, this will throw an exception.
0096   MaterialDesignatorBlueprintNode& configureFace(
0097       CylinderVolumeBounds::Face face,
0098       std::shared_ptr<const Acts::HomogeneousSurfaceMaterial> material);
0099 
0100   /// Configure the designator with a cuboid face and corresponding binning
0101   /// information.
0102   /// @note This method can be called multiple times to configure different faces.
0103   /// @param face The face of the cuboid to configure
0104   /// @param loc0 The first binning configuration along local axis 0
0105   /// @param loc1 The second binning configuration along local axis 1
0106   /// @return The material designator node
0107   /// @note If this node has previously been configured with a different volume
0108   ///       shape, this will throw an exception.
0109   MaterialDesignatorBlueprintNode& configureFace(CuboidVolumeBounds::Face face,
0110                                                  const DirectedProtoAxis& loc0,
0111                                                  const DirectedProtoAxis& loc1);
0112 
0113   /// Configure the designator with a cuboid face and a homogeneous surface
0114   /// material.
0115   /// @param face The face of the cuboid to configure
0116   /// @param material The material to use
0117   /// @return The material designator node
0118   /// @note If this node has previously been configured with a different volume
0119   ///       shape, this will throw an exception.
0120   MaterialDesignatorBlueprintNode& configureFace(
0121       CuboidVolumeBounds::Face face,
0122       std::shared_ptr<const Acts::HomogeneousSurfaceMaterial> material);
0123 
0124  private:
0125   /// @copydoc BlueprintNode::addToGraphviz
0126   void addToGraphviz(std::ostream& os) const override;
0127 
0128   detail::MaterialDesignatorBlueprintNodeImpl& impl();
0129   const detail::MaterialDesignatorBlueprintNodeImpl& impl() const;
0130 
0131   std::unique_ptr<detail::MaterialDesignatorBlueprintNodeImpl> m_impl;
0132 };
0133 
0134 }  // namespace Experimental
0135 }  // namespace Acts