|
ACTS
Experiment-independent tracking
|
Base class for all nodes in the blueprint tree. More...
#include <Acts/Geometry/BlueprintNode.hpp>
Public Types | |
| using | ChildRange |
| A range-like object that allows range based for loops and index access. | |
| using | MutableChildRange |
| A range-like object that allows range based for loops and index access. | |
Public Member Functions | |
| virtual | ~BlueprintNode ()=default |
| Virtual destructor to ensure correct cleanup. | |
| BlueprintNode & | addChild (std::shared_ptr< BlueprintNode > child) |
Register a child to this node. | |
| virtual void | addToGraphviz (std::ostream &os) const |
| Method that writes a representatiohn of this node only to graphviz. | |
| MutableChildRange | children () |
| Return a MutableChildRange to the children of this node. | |
| ChildRange | children () const |
| Return a ChildRange to the children of this node. | |
| void | clearChildren () |
| Remove all children from this node. | |
| std::size_t | depth () const |
| Return the depth of this node in the blueprint tree. | |
| void | graphviz (std::ostream &os) const |
| Print the node tree starting from this node to graphviz format. | |
| virtual const std::string & | name () const =0 |
| Get the name of this node. | |
Construction methods | |
| virtual Volume & | build (const BlueprintOptions &options, const GeometryContext &gctx, const Logger &logger=Acts::getDummyLogger())=0 |
| This method is called during the build phase of the blueprint tree construction. | |
| virtual PortalShellBase & | connect (const BlueprintOptions &options, const GeometryContext &gctx, const Logger &logger=Acts::getDummyLogger())=0 |
| This method is called during the connect phase. | |
| virtual void | finalize (const BlueprintOptions &options, const GeometryContext &gctx, TrackingVolume &parent, const Logger &logger=Acts::getDummyLogger())=0 |
| This method is called during the finalize phase. | |
Convenience methods | |
These methods are meant to make the construction of a blueprint tree in code more ergonomic. They usually take an optional callback parameter. The primary use for this parameter is structural, as it facilitates introducing scopes to indicate in code that objects are nested. Blueprint::Config cfg;
auto root = std::make_unique<Blueprint>(cfg);
root->addStaticVolume(
base, std::make_shared<CylinderVolumeBounds>(50_mm, 400_mm, 1000_mm),
"PixelWrapper", [&](auto& wrapper) {
// This scope can be used to equip `wrapper`
});
Definition Blueprint.hpp:57 Alternatively, they can also be used without a callback, as the newly created node is also returned by reference: auto& wrapper = root->addStaticVolume(
base, std::make_shared<CylinderVolumeBounds>(50_mm, 400_mm, 1000_mm),
"PixelWrapper");
In both cases, it's not necessary to register the newly created node with a parent node. | |
| StaticBlueprintNode & | addStaticVolume (std::unique_ptr< TrackingVolume > volume, const std::function< void(StaticBlueprintNode &cylinder)> &callback={}) |
This method creates a new Acts::Experimental::StaticBlueprintNode wrapping volume and adds it to this node as a child. | |
| StaticBlueprintNode & | addStaticVolume (const Transform3 &transform, std::shared_ptr< VolumeBounds > volumeBounds, const std::string &volumeName="undefined", const std::function< void(StaticBlueprintNode &cylinder)> &callback={}) |
| Alternative overload for creating a Acts::Experimental::StaticBlueprintNode. | |
| CylinderContainerBlueprintNode & | addCylinderContainer (const std::string &name, AxisDirection direction, const std::function< void(CylinderContainerBlueprintNode &cylinder)> &callback={}) |
| Convenience method for creating a cylinder specialization of Acts::Experimental::ContainerBlueprintNode. | |
| CuboidContainerBlueprintNode & | addCuboidContainer (const std::string &name, AxisDirection direction, const std::function< void(CuboidContainerBlueprintNode &cylinder)> &callback={}) |
| Convenience method for creating a cuboid specialization of Acts::Experimental::ContainerBlueprintNode. | |
| MaterialDesignatorBlueprintNode & | addMaterial (const std::string &name, const std::function< void(MaterialDesignatorBlueprintNode &material)> &callback={}) |
| Convenience method for creating a Acts::Experimental::MaterialDesignatorBlueprintNode. | |
| LayerBlueprintNode & | addLayer (const std::string &name, const std::function< void(LayerBlueprintNode &layer)> &callback={}) |
| Convenience method for creating a Acts::Experimental::LayerBlueprintNode. | |
| GeometryIdentifierBlueprintNode & | withGeometryIdentifier (const std::function< void(GeometryIdentifierBlueprintNode &geometryIdentifier)> &callback={}) |
| Convenience method for creating a Acts::Experimental::GeometryIdentifierBlueprintNode. | |
Protected Member Functions | |
| std::string | indent () const |
| An indentation depending on the depth of this node. | |
| std::string | prefix () const |
| Printing helper returning a prefix including an indent depending on the depth. | |
| void | setDepth (std::size_t depth) |
Set the depth to depth and update children recursively. | |
| virtual void | toStream (std::ostream &os) const |
| Virtual method to determine stream representation. | |
Base class for all nodes in the blueprint tree.
This class defines the three-phase construction process. The three phases are
During the build phase, the build method of all nodes in the tree are called recursively. Some nodes, like Acts::Experimental::ContainerBlueprintNode, will take action on the volumes returns from its children, and perform sizing to connect them. See the Acts::Experimental::ContainerBlueprintNode and Acts::CylinderVolumeStack documentation for details on how the sizing is carried out.
A range-like object that allows range based for loops and index access.
This type's iterators and accessors return const references when dereferenced.
A range-like object that allows range based for loops and index access.
This type's iterators and accessors return mutable references when dereferenced.
|
virtualdefault |
Virtual destructor to ensure correct cleanup.
| BlueprintNode & Acts::Experimental::BlueprintNode::addChild | ( | std::shared_ptr< BlueprintNode > | child | ) |
Register a child to this node.
| child | The child node to add |
| CuboidContainerBlueprintNode & Acts::Experimental::BlueprintNode::addCuboidContainer | ( | const std::string & | name, |
| AxisDirection | direction, | ||
| const std::function< void(CuboidContainerBlueprintNode &cylinder)> & | callback = {} ) |
Convenience method for creating a cuboid specialization of Acts::Experimental::ContainerBlueprintNode.
| name | The name of the container node. This name is only reflected in the node tree for debugging, as no extra volumes is created for the container. |
| direction | The direction of the stack configuration. See Acts::CuboidVolumeStack for details. |
| callback | An optional callback that receives the node as an argument |
| CylinderContainerBlueprintNode & Acts::Experimental::BlueprintNode::addCylinderContainer | ( | const std::string & | name, |
| AxisDirection | direction, | ||
| const std::function< void(CylinderContainerBlueprintNode &cylinder)> & | callback = {} ) |
Convenience method for creating a cylinder specialization of Acts::Experimental::ContainerBlueprintNode.
| name | The name of the container node. This name is only reflected in the node tree for debugging, as no extra volumes is created for the container. |
| direction | The direction of the stack configuration. See Acts::CylinderVolumeStack for details. |
| callback | An optional callback that receives the node as an argument |
| LayerBlueprintNode & Acts::Experimental::BlueprintNode::addLayer | ( | const std::string & | name, |
| const std::function< void(LayerBlueprintNode &layer)> & | callback = {} ) |
Convenience method for creating a Acts::Experimental::LayerBlueprintNode.
| name | The name of the layer node. |
| callback | An optional callback that receives the node as an argument |
| MaterialDesignatorBlueprintNode & Acts::Experimental::BlueprintNode::addMaterial | ( | const std::string & | name, |
| const std::function< void(MaterialDesignatorBlueprintNode &material)> & | callback = {} ) |
Convenience method for creating a Acts::Experimental::MaterialDesignatorBlueprintNode.
| name | The name of the material designator node. Used for debugging the node tree only. |
| callback | An optional callback that receives the node as an argument |
| StaticBlueprintNode & Acts::Experimental::BlueprintNode::addStaticVolume | ( | const Transform3 & | transform, |
| std::shared_ptr< VolumeBounds > | volumeBounds, | ||
| const std::string & | volumeName = "undefined", | ||
| const std::function< void(StaticBlueprintNode &cylinder)> & | callback = {} ) |
Alternative overload for creating a Acts::Experimental::StaticBlueprintNode.
This overload will invoke the constructor of Acts::TrackingVolume and use that volume to create the node.
| transform | The transform of the volume |
| volumeBounds | The bounds of the volume |
| volumeName | The name of the volume |
| callback | An optional callback that receives the node as an argument |
| StaticBlueprintNode & Acts::Experimental::BlueprintNode::addStaticVolume | ( | std::unique_ptr< TrackingVolume > | volume, |
| const std::function< void(StaticBlueprintNode &cylinder)> & | callback = {} ) |
This method creates a new Acts::Experimental::StaticBlueprintNode wrapping volume and adds it to this node as a child.
| volume | The volume to add |
| callback | An optional callback that receives the node as an argument |
|
virtual |
Method that writes a representatiohn of this node only to graphviz.
This should generally not be called on its own, but through the BlueprintNode::graphviz method.
| os | The stream to print to |
Reimplemented in Acts::Experimental::Blueprint, Acts::Experimental::ContainerBlueprintNode, and Acts::Experimental::StaticBlueprintNode.
|
pure virtual |
This method is called during the build phase of the blueprint tree construction.
It returns a single Acts::Volume which represents transform and bounds of the entire subtree. This does not have to correspond to the final Acts::TrackingVolume, some node types will produce temporary volume representations. Lifetime of the returned volume is managed by the source node! Nodes higher in the hierarchy will issue resizes down the tree hierarchy. This is not done through a direct hierarchy, but coordinated by the respective node type, by internally consulting its children.
| options | The global construction options |
| gctx | The geometry context for construction (usually nominal) |
| logger | The logger to use for output during construction |
Implemented in Acts::Experimental::Blueprint, Acts::Experimental::ContainerBlueprintNode, Acts::Experimental::GeometryIdentifierBlueprintNode, Acts::Experimental::LayerBlueprintNode, Acts::Experimental::MaterialDesignatorBlueprintNode, and Acts::Experimental::StaticBlueprintNode.
| MutableChildRange Acts::Experimental::BlueprintNode::children | ( | ) |
Return a MutableChildRange to the children of this node.
| ChildRange Acts::Experimental::BlueprintNode::children | ( | ) | const |
Return a ChildRange to the children of this node.
| void Acts::Experimental::BlueprintNode::clearChildren | ( | ) |
Remove all children from this node.
|
pure virtual |
This method is called during the connect phase.
This phase handles the creation and connection of portals (instances of Acts::PortalLinkBase). After the build-phase has completed, the volume sizes are final. Each node will consult its fully sized volume to produce boundary surfaces. Each boundary surface is then turned into a Acts::TrivialPortalLink, which in turn produces a one-sided portal (see Acts::Portal documentation)
Some nodes (like Acts::Experimental::ContainerBlueprintNode) will take action on their children, and unify the connected portals.
After a node's processing has completed, it returns a reference to a Acts::PortalShellBase, which represents a set of portals in a specific geometry arrangement. The returned object lifetime is managed by the returning node.
| options | The global construction options |
| gctx | The geometry context for construction (usually nominal) |
| logger | The logger to use for output during construction |
Implemented in Acts::Experimental::Blueprint, Acts::Experimental::CuboidContainerBlueprintNode, Acts::Experimental::CylinderContainerBlueprintNode, Acts::Experimental::GeometryIdentifierBlueprintNode, Acts::Experimental::MaterialDesignatorBlueprintNode, and Acts::Experimental::StaticBlueprintNode.
| std::size_t Acts::Experimental::BlueprintNode::depth | ( | ) | const |
Return the depth of this node in the blueprint tree.
A depth of zero means this node does not have a parent.
|
pure virtual |
This method is called during the finalize phase.
This phase handles:
At the end of this phase, each node will have transferred any temporary resources created during the build, that need to be retained, into the final Acts::TrackingGeometry, and can be safely destroyed.
parent for volumes, portals, etc to be registered in is passed in as an argument, rather than being implicitly determined from the parent node. This is done so that nodes can remove themselves from the final volume hierarchy, like container nodes or the Acts::Experimental::MaterialDesignatorBlueprintNode.| options | The global construction options |
| gctx | The geometry context for construction (usually nominal) |
| parent | The parent volume to register in |
| logger | The logger to use for output during construction |
Implemented in Acts::Experimental::Blueprint, Acts::Experimental::ContainerBlueprintNode, Acts::Experimental::GeometryIdentifierBlueprintNode, Acts::Experimental::MaterialDesignatorBlueprintNode, and Acts::Experimental::StaticBlueprintNode.
| void Acts::Experimental::BlueprintNode::graphviz | ( | std::ostream & | os | ) | const |
Print the node tree starting from this node to graphviz format.
| os | The stream to print to |
|
protected |
An indentation depending on the depth of this node.
|
pure virtual |
Get the name of this node.
Implemented in Acts::Experimental::Blueprint, Acts::Experimental::ContainerBlueprintNode, Acts::Experimental::GeometryIdentifierBlueprintNode, Acts::Experimental::LayerBlueprintNode, Acts::Experimental::MaterialDesignatorBlueprintNode, and Acts::Experimental::StaticBlueprintNode.
|
protected |
Printing helper returning a prefix including an indent depending on the depth.
|
protected |
Set the depth to depth and update children recursively.
| depth | New depth value to set |
|
protectedvirtual |
Virtual method to determine stream representation.
| os | Output stream to write to |
Reimplemented in Acts::Experimental::MaterialDesignatorBlueprintNode.
| GeometryIdentifierBlueprintNode & Acts::Experimental::BlueprintNode::withGeometryIdentifier | ( | const std::function< void(GeometryIdentifierBlueprintNode &geometryIdentifier)> & | callback = {} | ) |
Convenience method for creating a Acts::Experimental::GeometryIdentifierBlueprintNode.
| callback | An optional callback that receives the node as an argument |