ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::Experimental::Blueprint Class Reference

This class is the top-level entry point to build a tracking geometry using the blueprint building mechanism. More...

#include <Acts/Geometry/Blueprint.hpp>

Inheritance diagram for Acts::Experimental::Blueprint:
[legend]
Collaboration diagram for Acts::Experimental::Blueprint:
[legend]

Classes

struct  Config

Public Member Functions

 Blueprint (const Config &config)
 Constructor from a config object.
std::unique_ptr< TrackingGeometryconstruct (const BlueprintOptions &options, const GeometryContext &gctx, const Logger &logger=Acts::getDummyLogger())
 Construct the tracking geometry from the blueprint tree.
Public Member Functions inherited from Acts::Experimental::BlueprintNode
virtual ~BlueprintNode ()=default
 Virtual destructor to ensure correct cleanup.
BlueprintNodeaddChild (std::shared_ptr< BlueprintNode > child)
 Register a child to this node.
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.
StaticBlueprintNodeaddStaticVolume (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.
StaticBlueprintNodeaddStaticVolume (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.
CylinderContainerBlueprintNodeaddCylinderContainer (const std::string &name, AxisDirection direction, const std::function< void(CylinderContainerBlueprintNode &cylinder)> &callback={})
 Convenience method for creating a cylinder specialization of Acts::Experimental::ContainerBlueprintNode.
CuboidContainerBlueprintNodeaddCuboidContainer (const std::string &name, AxisDirection direction, const std::function< void(CuboidContainerBlueprintNode &cylinder)> &callback={})
 Convenience method for creating a cuboid specialization of Acts::Experimental::ContainerBlueprintNode.
MaterialDesignatorBlueprintNodeaddMaterial (const std::string &name, const std::function< void(MaterialDesignatorBlueprintNode &material)> &callback={})
 Convenience method for creating a Acts::Experimental::MaterialDesignatorBlueprintNode.
LayerBlueprintNodeaddLayer (const std::string &name, const std::function< void(LayerBlueprintNode &layer)> &callback={})
 Convenience method for creating a Acts::Experimental::LayerBlueprintNode.
GeometryIdentifierBlueprintNodewithGeometryIdentifier (const std::function< void(GeometryIdentifierBlueprintNode &geometryIdentifier)> &callback={})
 Convenience method for creating a Acts::Experimental::GeometryIdentifierBlueprintNode.

Protected Member Functions

void addToGraphviz (std::ostream &os) const override
 Method that writes a representatiohn of this node only to graphviz.
Volumebuild (const BlueprintOptions &options, const GeometryContext &gctx, const Logger &logger=Acts::getDummyLogger()) override
 This method is called during the build phase of the blueprint tree construction.
PortalShellBaseconnect (const BlueprintOptions &options, const GeometryContext &gctx, const Logger &logger=Acts::getDummyLogger()) override
 This method is called during the connect phase.
void finalize (const BlueprintOptions &options, const GeometryContext &gctx, TrackingVolume &parent, const Logger &logger=Acts::getDummyLogger()) override
 This method is called during the finalize phase.
const std::string & name () const override
 The name of the blueprint node, always "Root".
Protected Member Functions inherited from Acts::Experimental::BlueprintNode
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.

Additional Inherited Members

Public Types inherited from Acts::Experimental::BlueprintNode
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.

Detailed Description

This class is the top-level entry point to build a tracking geometry using the blueprint building mechanism.

It forms the root of a tree of nodes where each node performs a portion of the construction. This top-level class has the main construction methods that execute the construction of the geometry.

+---------------+ +-----------+
| | | |
| Root | | v
| | | +---------------+
+---------------+ | | |
| | | Child 1 |
+----------+ | | |
v +----------+ +---------------+
+---------------+ |
| | +--------------+
| Child 2 | v +----------+
| | .---------. | |
+---------------+ / \ | v
( Proc node ) | +---------------+
`. ,' | | |
`-------' | | Child 3 |
| | | |
| | +---------------+
+---------+

The construction phases are documented in BlueprintNode, which is the base class for all nodes in the tree.

Note
This class inherits from BlueprintNode, but hides the main blueprint construction phase overloads. The Blueprint class is only ever intended to be the top-level node, and not anywhere else in the tree.

Constructor & Destructor Documentation

◆ Blueprint()

Acts::Experimental::Blueprint::Blueprint ( const Config & config)
explicit

Constructor from a config object.

Parameters
configThe configuration object

Member Function Documentation

◆ addToGraphviz()

void Acts::Experimental::Blueprint::addToGraphviz ( std::ostream & os) const
overrideprotectedvirtual

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.

Parameters
osThe stream to print to

Reimplemented from Acts::Experimental::BlueprintNode.

◆ build()

Volume & Acts::Experimental::Blueprint::build ( const BlueprintOptions & options,
const GeometryContext & gctx,
const Logger & logger = Acts::getDummyLogger() )
overrideprotectedvirtual

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.

Note
Generally, you should not need to to call this method directly. The construction should usually be done through the special Acts::Experimental::Blueprint class.
Parameters
optionsThe global construction options
gctxThe geometry context for construction (usually nominal)
loggerThe logger to use for output during construction
Returns
The volume used for communicating transform and size up the hierarchy

Implements Acts::Experimental::BlueprintNode.

◆ connect()

PortalShellBase & Acts::Experimental::Blueprint::connect ( const BlueprintOptions & options,
const GeometryContext & gctx,
const Logger & logger = Acts::getDummyLogger() )
overrideprotectedvirtual

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.

Parameters
optionsThe global construction options
gctxThe geometry context for construction (usually nominal)
loggerThe logger to use for output during construction
Returns
Reference to portal shell containing connected portals for this node

Implements Acts::Experimental::BlueprintNode.

◆ construct()

std::unique_ptr< TrackingGeometry > Acts::Experimental::Blueprint::construct ( const BlueprintOptions & options,
const GeometryContext & gctx,
const Logger & logger = Acts::getDummyLogger() )

Construct the tracking geometry from the blueprint tree.

Parameters
optionsThe construction options, see BlueprintOptions
gctxThe geometry context for construction. In almost all cases, this should be the nominal geometry context
loggerThe logger to use for output during construction
Returns
Unique pointer to the constructed tracking geometry

◆ finalize()

void Acts::Experimental::Blueprint::finalize ( const BlueprintOptions & options,
const GeometryContext & gctx,
TrackingVolume & parent,
const Logger & logger = Acts::getDummyLogger() )
overrideprotectedvirtual

This method is called during the finalize phase.

This phase handles:

  • Registering portals into their final volumes
  • Registering volumes into their parents
  • Creating navigation policies
  • (In future) Handle geometry identification assignment

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.

Note
The 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.
Parameters
optionsThe global construction options
gctxThe geometry context for construction (usually nominal)
parentThe parent volume to register in
loggerThe logger to use for output during construction

Implements Acts::Experimental::BlueprintNode.

◆ name()

const std::string & Acts::Experimental::Blueprint::name ( ) const
overrideprotectedvirtual

The name of the blueprint node, always "Root".

Returns
The name

Implements Acts::Experimental::BlueprintNode.