![]() |
|
|||
File indexing completed on 2025-04-05 07:57:21
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/GeometryIdentifier.hpp" 0013 #include "Acts/Utilities/Logger.hpp" 0014 0015 #include <memory> 0016 0017 namespace Acts { 0018 0019 class TrackingVolume; 0020 class PortalShellBase; 0021 class Volume; 0022 0023 namespace Experimental { 0024 0025 struct GeometryIdentifierBlueprintNodeImpl; 0026 0027 /// @brief Blueprint node for configuring and applying geometry identifiers to volumes 0028 /// 0029 /// This node must have exactly one child and applies geometry identifier 0030 /// configurations to the volumes in its subtree during finalization. Multiple 0031 /// configurations can be chained using the fluent interface. 0032 class GeometryIdentifierBlueprintNode : public BlueprintNode { 0033 public: 0034 /// Virtual destructor pushed to cpp file to avoid defining implementation 0035 /// details 0036 ~GeometryIdentifierBlueprintNode() override; 0037 0038 /// Default constructor 0039 GeometryIdentifierBlueprintNode(); 0040 0041 /// @brief Build the volume hierarchy under this node 0042 /// @param options Blueprint build options 0043 /// @param gctx The geometry context 0044 /// @param logger The logger instance 0045 /// @return Reference to the built volume 0046 /// @note Requires exactly one child node 0047 Volume& build(const BlueprintOptions& options, const GeometryContext& gctx, 0048 const Logger& logger = Acts::getDummyLogger()) override; 0049 0050 /// @brief Connect portals in the volume hierarchy 0051 /// @param options Blueprint build options 0052 /// @param gctx The geometry context 0053 /// @param logger The logger instance 0054 /// @return Reference to the connected portal shell 0055 PortalShellBase& connect( 0056 const BlueprintOptions& options, const GeometryContext& gctx, 0057 const Logger& logger = Acts::getDummyLogger()) override; 0058 0059 /// @brief Finalize the volume hierarchy and apply geometry identifier configurations 0060 /// @param options Blueprint build options 0061 /// @param gctx The geometry context 0062 /// @param parent The parent tracking volume 0063 /// @param logger The logger instance 0064 /// @note Applies all configured geometry ID assignments to new volumes in the subtree 0065 void finalize(const BlueprintOptions& options, const GeometryContext& gctx, 0066 TrackingVolume& parent, 0067 const Logger& logger = Acts::getDummyLogger()) override; 0068 0069 /// @brief Set a fixed layer ID for volumes in this subtree 0070 /// @param layer The layer ID value to set 0071 /// @return Reference to this node for method chaining 0072 /// @note Will throw if volumes already have layer IDs assigned 0073 GeometryIdentifierBlueprintNode& setLayerIdTo( 0074 GeometryIdentifier::Value layer); 0075 0076 /// @brief Incrementally assign layer IDs to volumes in this subtree 0077 /// @param start The starting layer ID value (default: 0) 0078 /// @return Reference to this node for method chaining 0079 /// @note Will throw if volumes already have layer IDs assigned 0080 /// @note Layer IDs are assigned sequentially starting from the given value 0081 GeometryIdentifierBlueprintNode& incrementLayerIds( 0082 GeometryIdentifier::Value start = 0); 0083 0084 /// @brief Set the same volume ID for all volumes in this subtree 0085 /// @param volumeId The volume ID to set 0086 /// @return Reference to this node for method chaining 0087 /// @note Will throw if volumes already have volume IDs assigned 0088 /// @note Applies recursively to all descendant volumes 0089 GeometryIdentifierBlueprintNode& setAllVolumeIdsTo( 0090 GeometryIdentifier::Value volumeId); 0091 0092 /// Predicate function to compare two @ref Acts::TrackingVolume with each other to determine their *closure order*. 0093 using CompareVolumes = 0094 std::function<bool(const TrackingVolume&, const TrackingVolume&)>; 0095 0096 /// @brief Configure this node to order eligible tracking volumes using the provided 0097 /// function 0098 /// @return Reference to this node for method chaining 0099 GeometryIdentifierBlueprintNode& sortBy(const CompareVolumes& compare); 0100 0101 /// @brief Get the name of this node 0102 /// @return String containing concatenated configuration names 0103 const std::string& name() const override; 0104 0105 private: 0106 std::unique_ptr<GeometryIdentifierBlueprintNodeImpl> m_impl; 0107 }; 0108 0109 } // namespace Experimental 0110 } // namespace Acts
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |