ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::Experimental::ElementLayerAssembler< BackendT > Class Template Reference

Fluent builder that assembles a flat collection of cylindrical or disc-like detector layers from layer-representative detector elements into a CylinderContainerBlueprintNode. More...

#include <Acts/Geometry/BlueprintBuilder.hpp>

Inheritance diagram for Acts::Experimental::ElementLayerAssembler< BackendT >:
[legend]

Public Types

using AxisDefinition
 Axis definition type, or std::monostate when the backend does not support axis definitions.
using Builder = BlueprintBuilder<BackendT>
 The associated BlueprintBuilder type.
using Element = typename BackendT::Element
 Backend detector element handle type.
using LayerCustomizer = detail::LayerCustomizer<Element>
 Callback type that can replace or wrap a LayerBlueprintNode.
using LayerSpec = typename BackendT::LayerSpec
 Backend layer-specification type.
using LayerType = Acts::Experimental::LayerBlueprintNode::LayerType
 Distinguishes barrel (Cylinder) from endcap (Disc) layer geometry.

Public Member Functions

void addTo (Acts::Experimental::BlueprintNode &node) const &&
 Build the container node and attach it as a child of node.
ElementLayerAssembler && barrel () &&
 Shorthand for setLayerType(LayerType::Cylinder).
std::shared_ptr< Acts::Experimental::ContainerBlueprintNodebuild () const
 Build and return the assembled container node.
ElementLayerAssembler && endcap () &&
 Shorthand for setLayerType(LayerType::Disc).
template<typename CustomizerT>
requires ( detail::LayerNodeReturningCallable<Element, std::decay_t<CustomizerT>> || detail::LayerNodeReplacingCallable<Element, std::decay_t<CustomizerT>>)
ElementLayerAssembler && onLayer (CustomizerT customizer) &&
 Register a callback invoked for each created layer node.
ElementLayerAssembler && planar () &&
 Shorthand for setLayerType(LayerType::Plane).
ElementLayerAssembler && setAttachmentStrategy (std::optional< Acts::VolumeAttachmentStrategy > strategy) &&
 Override the attachment strategy for the container node.
ElementLayerAssembler && setContainer (const Element &container) &&
 Set the detector element that acts as the containing volume for the layer search.
ElementLayerAssembler && setContainer (const std::string &name) &&
 Set the container element by name, searching from the world root.
ElementLayerAssembler && setContainerName (std::string containerName) &&
 Override the output container node name.
ElementLayerAssembler && setEmptyOk (bool emptyOk) &&
 Control whether an empty layer collection is an error.
ElementLayerAssembler && setEnvelope (const Acts::ExtentEnvelope &envelope) &&
 Set an envelope to be applied to every layer node produced.
template<typename B = BackendT>
requires (detail::HasAxisDefinition<B>)
ElementLayerAssembler && setLayerAxes (typename B::AxisDefinition layerAxes) &&
 Set the axis definition used to derive the layer transform from the parent element shape.
ElementLayerAssembler && setLayerElements (std::vector< Element > layerElements) &&
 Set an explicit list of layer-representative elements.
ElementLayerAssembler && setLayerFilter (const std::regex &pattern) &&
 Set the regex filter used to select layer elements inside the container.
ElementLayerAssembler && setLayerFilter (const std::string &pattern) &&
 Set the regex filter used to select layer elements inside the container by name string.
ElementLayerAssembler && setLayerNameSuffix (const std::optional< std::string > &layerNameSuffix) &&
 Set an explicit suffix for produced layer node names.
ElementLayerAssembler && setLayerType (LayerType layerType) &&
 Set the layer geometry type explicitly.
template<typename B = BackendT>
requires (detail::HasAxisDefinition<B>)
ElementLayerAssembler && setSensorAxes (typename B::AxisDefinition axes) &&
 Set the axis definition used to orient sensitive surfaces.

Detailed Description

template<detail::BlueprintBackend BackendT>
class Acts::Experimental::ElementLayerAssembler< BackendT >

Fluent builder that assembles a flat collection of cylindrical or disc-like detector layers from layer-representative detector elements into a CylinderContainerBlueprintNode.

Each supplied element represents one layer: its hierarchy path is used as the layer name and (optionally) its geometry drives the layer transform. Obtained from BlueprintBuilder::layers().

builder.layers()
.barrel()
.setSensorAxes(myAxes)
.setLayerFilter(layerPattern)
.setContainer(containerElement)
.addTo(parentNode);
Template Parameters
BackendTGeometry backend that provides detector elements, layer specifications, hierarchy traversal, sensitive-element classification, and surface construction.

Member Typedef Documentation

◆ AxisDefinition

template<detail::BlueprintBackend BackendT>
using Acts::Experimental::ElementLayerAssembler< BackendT >::AxisDefinition
Initial value:
std::conditional_t<detail::HasAxisDefinition<BackendT>,
typename BackendT::AxisDefinition, std::monostate>

Axis definition type, or std::monostate when the backend does not support axis definitions.

Member Function Documentation

◆ addTo()

template<detail::BlueprintBackend BackendT>
void Acts::Experimental::ElementLayerAssembler< BackendT >::addTo ( Acts::Experimental::BlueprintNode & node) const &&

Build the container node and attach it as a child of node.

Equivalent to node.addChild(build()).

Parameters
nodeBlueprint node that will receive the built container as a child.

◆ barrel()

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::barrel ( ) &&
nodiscard

Shorthand for setLayerType(LayerType::Cylinder).

Returns
*this (rvalue).

◆ build()

template<detail::BlueprintBackend BackendT>
std::shared_ptr< Acts::Experimental::ContainerBlueprintNode > Acts::Experimental::ElementLayerAssembler< BackendT >::build ( ) const
nodiscard

Build and return the assembled container node.

Each resolved layer element becomes exactly one LayerBlueprintNode. The layer name is derived from the element's full path in the hierarchy (plus an optional suffix). The layer transform is deduced from the element when setLayerAxes() is configured.

Exceptions
std::runtime_errorif the layer type has not been set, if the backend requires axes and none were provided, if neither a layer filter nor explicit layer elements have been provided, if no container name is resolvable, or if the container yields no matching elements and emptyOk is false.
Returns
Shared pointer to the fully assembled container node.

◆ endcap()

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::endcap ( ) &&
nodiscard

Shorthand for setLayerType(LayerType::Disc).

Returns
*this (rvalue).

◆ onLayer()

template<detail::BlueprintBackend BackendT>
template<typename CustomizerT>
requires ( detail::LayerNodeReturningCallable<Element, std::decay_t<CustomizerT>> || detail::LayerNodeReplacingCallable<Element, std::decay_t<CustomizerT>>)
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::onLayer ( CustomizerT customizer) &&
nodiscard

Register a callback invoked for each created layer node.

The callback may either:

In both cases, the first argument is the source layer element.

Parameters
customizerCallback applied to each created layer node.
Returns
*this (rvalue).

◆ planar()

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::planar ( ) &&
nodiscard

Shorthand for setLayerType(LayerType::Plane).

Returns
*this (rvalue).

◆ setAttachmentStrategy()

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setAttachmentStrategy ( std::optional< Acts::VolumeAttachmentStrategy > strategy) &&
nodiscard

Override the attachment strategy for the container node.

When unset the backend's default strategy is used.

Parameters
strategyOptional attachment strategy; pass std::nullopt to reset to the default.
Returns
*this (rvalue).

◆ setContainer() [1/2]

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setContainer ( const Element & container) &&
nodiscard

Set the detector element that acts as the containing volume for the layer search.

Parameters
containerElement whose subtree is searched for layers matching the filter.
Returns
*this (rvalue).

◆ setContainer() [2/2]

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setContainer ( const std::string & name) &&
nodiscard

Set the container element by name, searching from the world root.

Exceptions
std::runtime_errorif no element with name is found.
Parameters
nameName of the detector element to use as the container.
Returns
*this (rvalue).

◆ setContainerName()

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setContainerName ( std::string containerName) &&
nodiscard

Override the output container node name.

If set, this name is used verbatim for the produced CylinderContainerBlueprintNode. Otherwise, the name is taken from the configured container element (when setContainer is used).

Parameters
containerNameExplicit container-node name to use.
Returns
*this (rvalue).

◆ setEmptyOk()

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setEmptyOk ( bool emptyOk) &&
nodiscard

Control whether an empty layer collection is an error.

When emptyOk is false (the default) and no layers are found in the container, build() throws. Setting it to true downgrades the failure to an informational log message.

Parameters
emptyOkIf true, silently accept an empty result.
Returns
*this (rvalue).

◆ setEnvelope()

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setEnvelope ( const Acts::ExtentEnvelope & envelope) &&
nodiscard

Set an envelope to be applied to every layer node produced.

Parameters
envelopeEnvelope margins added around each layer's extent.
Returns
*this (rvalue).

◆ setLayerAxes()

template<detail::BlueprintBackend BackendT>
template<typename B = BackendT>
requires (detail::HasAxisDefinition<B>)
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setLayerAxes ( typename B::AxisDefinition layerAxes) &&
nodiscard

Set the axis definition used to derive the layer transform from the parent element shape.

Only available when the backend defines an AxisDefinition type and stores optional layer-axis information in LayerSpec. When set, the layer transform is extracted automatically from the geometry of the enclosing detector element.

Parameters
layerAxesAxis definition forwarded to LayerSpec::layerAxes.
Returns
*this (rvalue).

◆ setLayerElements()

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setLayerElements ( std::vector< Element > layerElements) &&
nodiscard

Set an explicit list of layer-representative elements.

When set, the assembler skips subtree discovery via setContainer() and uses these elements directly as layer representatives. setLayerFilter() still applies as an optional post-filter on this list. Set either setContainerName or setContainer to define the output container name.

Parameters
layerElementsLayer-representative elements; one layer per element.
Returns
*this (rvalue).

◆ setLayerFilter() [1/2]

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setLayerFilter ( const std::regex & pattern) &&
nodiscard

Set the regex filter used to select layer elements inside the container.

Parameters
patternPre-compiled regular expression matched against each child element name.
Returns
*this (rvalue).

◆ setLayerFilter() [2/2]

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setLayerFilter ( const std::string & pattern) &&
nodiscard

Set the regex filter used to select layer elements inside the container by name string.

Parameters
patternRegular-expression string; converted to std::regex internally.
Returns
*this (rvalue).

◆ setLayerNameSuffix()

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setLayerNameSuffix ( const std::optional< std::string > & layerNameSuffix) &&
nodiscard

Set an explicit suffix for produced layer node names.

The final node name is "<anchor path>|<suffix>". Use std::nullopt to clear a previously configured suffix.

Parameters
layerNameSuffixOptional suffix appended to each produced layer name.
Returns
*this (rvalue).

◆ setLayerType()

template<detail::BlueprintBackend BackendT>
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setLayerType ( LayerType layerType) &&
nodiscard

Set the layer geometry type explicitly.

Parameters
layerTypeLayerType::Cylinder for barrel, LayerType::Disc for endcap.
Returns
*this (rvalue).

◆ setSensorAxes()

template<detail::BlueprintBackend BackendT>
template<typename B = BackendT>
requires (detail::HasAxisDefinition<B>)
ElementLayerAssembler && Acts::Experimental::ElementLayerAssembler< BackendT >::setSensorAxes ( typename B::AxisDefinition axes) &&
nodiscard

Set the axis definition used to orient sensitive surfaces.

Only available when the backend defines an AxisDefinition type and stores optional surface-axis information in LayerSpec.

Parameters
axesAxis definition forwarded to LayerSpec::axes.
Returns
*this (rvalue).