Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-22 08:23:49

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/PortalShell.hpp"
0013 #include "Acts/Geometry/TrackingGeometry.hpp"
0014 #include "Acts/Geometry/TrackingVolume.hpp"
0015 
0016 namespace Acts {
0017 
0018 class GeometryContext;
0019 
0020 /// This class is the top-level entry point to build a tracking geometry using
0021 /// the blueprint building mechanism. It forms the root of a tree of nodes where
0022 /// each node performs a portion of the construction. This top-level class has
0023 /// the main construction methods that execute the construction of the geometry.
0024 ///
0025 /// ```
0026 ///            +---------------+  +-----------+
0027 ///            |               |  |           |
0028 ///            |     Root      |  |           v
0029 ///            |               |  |   +---------------+
0030 ///            +---------------+  |   |               |
0031 ///                    |          |   |    Child 1    |
0032 ///         +----------+          |   |               |
0033 ///         v          +----------+   +---------------+
0034 /// +---------------+                         |
0035 /// |               |          +--------------+
0036 /// |    Child 2    |          v         +----------+
0037 /// |               |     .---------.    |          |
0038 /// +---------------+    /           \   |          v
0039 ///                     (  Proc node  )  |  +---------------+
0040 ///                      `.         ,'   |  |               |
0041 ///                        `-------'     |  |    Child 3    |
0042 ///                            |         |  |               |
0043 ///                            |         |  +---------------+
0044 ///                            +---------+
0045 /// ```
0046 ///
0047 /// The construction phases are documented in @c BlueprintNode, which is the
0048 /// base class for all nodes in the tree.
0049 /// @note This class inherits from @c BlueprintNode, but hides the main
0050 ///       blueprint construction phase overloads. The @c Blueprint class is
0051 ///       only ever intended to be the top-level node, and not anywhere else
0052 ///       in the tree.
0053 class Blueprint : public BlueprintNode {
0054  public:
0055   struct Config {
0056     /// Determine how much envelope space to produce from the highest volume
0057     /// in the geometry hierarchy and the world volume.
0058     ExtentEnvelope envelope = ExtentEnvelope::Zero();
0059   };
0060 
0061   /// Constructor from a config object
0062   /// @param config The configuration object
0063   explicit Blueprint(const Config& config);
0064 
0065   /// Construct the tracking geometry from the blueprint tree
0066   /// @param options The construction options, see @c BlueprintOptions
0067   /// @param gctx The geometry context for construction. In almost all cases,
0068   ///             this should be the *nominal* geometry context
0069   /// @param logger The logger to use for output during construction
0070   std::unique_ptr<TrackingGeometry> construct(
0071       const BlueprintOptions& options, const GeometryContext& gctx,
0072       const Logger& logger = Acts::getDummyLogger());
0073 
0074  protected:
0075   /// The name of the blueprint node, always "Root"
0076   /// @return The name
0077   const std::string& name() const override;
0078 
0079   /// @copydoc BlueprintNode::build
0080   Volume& build(const BlueprintOptions& options, const GeometryContext& gctx,
0081                 const Logger& logger = Acts::getDummyLogger()) override;
0082 
0083   /// @copydoc BlueprintNode::connect
0084   PortalShellBase& connect(
0085       const BlueprintOptions& options, const GeometryContext& gctx,
0086       const Logger& logger = Acts::getDummyLogger()) override;
0087 
0088   /// @copydoc BlueprintNode::finalize
0089   void finalize(const BlueprintOptions& options, const GeometryContext& gctx,
0090                 TrackingVolume& parent,
0091                 const Logger& logger = Acts::getDummyLogger()) override;
0092 
0093   /// @copydoc BlueprintNode::addToGraphviz
0094   void addToGraphviz(std::ostream& os) const override;
0095 
0096  private:
0097   Config m_cfg;
0098 };
0099 
0100 }  // namespace Acts