Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:10:53

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/GeometryContext.hpp"
0013 #include "Acts/Geometry/PortalShell.hpp"
0014 #include "Acts/Geometry/TrackingVolume.hpp"
0015 
0016 namespace Acts {
0017 
0018 /// The static blueprint node wraps a single already-constructred @c TrackingVolume.
0019 /// The node will present this volume to its hierarchy. The volume is given as
0020 /// mutable, and will be potentially enlarged in order to connect to neighboring
0021 /// volumes.
0022 /// - In case the volume already has child volumes, they will be retained.
0023 /// - In case the volume already has a registered navigation policy, it will be
0024 ///   overwritten with the one configured on this node, regardless of content.
0025 class StaticBlueprintNode : public BlueprintNode {
0026  public:
0027   /// Construct the static node from an existing volume
0028   /// @param volume The volume to wrap
0029   explicit StaticBlueprintNode(std::unique_ptr<TrackingVolume> volume);
0030 
0031   /// Get the name of this node. It is automatically taken from the wrapped
0032   /// volume
0033   /// @return The name of the volume
0034   const std::string& name() const override;
0035 
0036   /// @copydoc BlueprintNode::build
0037   /// Build-phase of the blueprint construction. Returns the wrapped volume for
0038   /// sizing.
0039   Volume& build(const BlueprintOptions& options, const GeometryContext& gctx,
0040                 const Logger& logger = Acts::getDummyLogger()) override;
0041 
0042   /// @copydoc BlueprintNode::connect
0043   PortalShellBase& connect(
0044       const BlueprintOptions& options, const GeometryContext& gctx,
0045       const Logger& logger = Acts::getDummyLogger()) override;
0046 
0047   /// @copydoc BlueprintNode::finalize
0048   void finalize(const BlueprintOptions& options, const GeometryContext& gctx,
0049                 TrackingVolume& parent,
0050                 const Logger& logger = Acts::getDummyLogger()) override;
0051 
0052   virtual StaticBlueprintNode& setNavigationPolicyFactory(
0053       std::shared_ptr<NavigationPolicyFactory> navigationPolicyFactory);
0054 
0055   const NavigationPolicyFactory* navigationPolicyFactory() const;
0056 
0057  protected:
0058   void addToGraphviz(std::ostream& os) const override;
0059 
0060   std::unique_ptr<TrackingVolume> m_volume;
0061 
0062   std::unique_ptr<PortalShellBase> m_shell;
0063 
0064   std::shared_ptr<NavigationPolicyFactory> m_navigationPolicyFactory;
0065 };
0066 
0067 }  // namespace Acts