ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
ActsPlugins::DD4hep::DD4hepBackend Class Reference

Backend adapter that maps a DD4hep detector hierarchy onto the ACTS experimental blueprint-builder interface. More...

#include <ActsPlugins/DD4hep/BlueprintBuilder.hpp>

Collaboration diagram for ActsPlugins::DD4hep::DD4hepBackend:
[legend]

Classes

struct  Config
 Configuration of the DD4hep backend instance. More...
struct  LayerSpec
 Layer-specific configuration forwarded from the generic builder to the DD4hep backend. More...

Public Types

using AxisDefinition = TGeoAxes
 Axis-definition type forwarded to ROOT-based surface conversion helpers.
using DetectorElement = DD4hepDetectorElement
 Concrete ACTS detector-element implementation used for DD4hep geometry.
using DetectorElementFactory
 Factory that creates detector elements for converted DD4hep sensitives.
using DetectorElementPtr = std::shared_ptr<DetectorElement>
 Shared pointer to a DD4hep-backed ACTS detector element.
using Element = dd4hep::DetElement
 DD4hep detector-element handle type consumed by the generic builder.

Public Member Functions

 DD4hepBackend (const Config &cfg, const Acts::Logger &logger)
 Construct the DD4hep backend.
std::vector< Elementchildren (const Element &parent) const
 Return the direct DD4hep child elements of a parent element.
template<typename... Args>
int constant (std::format_string< Args... > fmt, Args &&... args) const
 Retrieves a named integer constant from the DD4hep detector description.
DetectorElementPtr createDetectorElement (const Element &detElement, AxisDefinition axes) const
 Create an ACTS detector element from a DD4hep sensitive element.
bool isBarrel (const Element &element) const
 Check whether a DD4hep element represents a barrel sub-detector.
bool isEndcap (const Element &element) const
 Check whether a DD4hep element represents an endcap sub-detector.
bool isSensitive (const Element &element) const
 Check whether a DD4hep element represents a sensitive detector element.
bool isTracker (const Element &element) const
 Check whether a DD4hep element is part of the tracking detector.
const Acts::Loggerlogger () const
 Return the logger associated with this backend.
std::optional< Acts::Transform3lookupLayerTransform (const Element &element, const LayerSpec &layerSpec) const
 Derive the layer transform from a DD4hep detector element when possible.
std::shared_ptr< Acts::Experimental::StaticBlueprintNodemakeBeampipe () const
 Create a static beampipe blueprint node from the DD4hep world geometry.
std::vector< std::shared_ptr< Acts::Surface > > makeSurfaces (std::span< const Element > sensitives, const LayerSpec &layerSpec) const
 Convert a set of DD4hep sensitive elements into ACTS surfaces.
std::string nameOf (const Element &element) const
 Return the fully qualified DD4hep name of an element.
Element parent (const Element &element) const
 Return the direct parent DD4hep element of a child element.
Element world () const
 Return the DD4hep world detector element.

Static Public Member Functions

static DetectorElementPtr defaultElementFactory (const Element &detElement, AxisDefinition axes, double lengthScale)
 Default detector-element factory used when Config::elementFactory is not overridden.

Static Public Attributes

static constexpr std::string_view kIdentifier = "DD4hepBackend"
 Identifier string used in diagnostics emitted by the generic blueprint builder.

Detailed Description

Backend adapter that maps a DD4hep detector hierarchy onto the ACTS experimental blueprint-builder interface.

The backend exposes DD4hep detector elements as blueprint input elements and provides the conversions needed to create ACTS surfaces, detector elements, and optional layer transforms.

Member Typedef Documentation

◆ DetectorElementFactory

Initial value:
std::function<DetectorElementPtr(
const Element& detElement, AxisDefinition axes, double lengthScale)>
dd4hep::DetElement Element
DD4hep detector-element handle type consumed by the generic builder.
Definition BlueprintBuilder.hpp:47
std::shared_ptr< DetectorElement > DetectorElementPtr
Shared pointer to a DD4hep-backed ACTS detector element.
Definition BlueprintBuilder.hpp:63
TGeoAxes AxisDefinition
Axis definitions used for detector element and layer surface creation.
Definition BlueprintBuilder.hpp:66

Factory that creates detector elements for converted DD4hep sensitives.

Constructor & Destructor Documentation

◆ DD4hepBackend()

ActsPlugins::DD4hep::DD4hepBackend::DD4hepBackend ( const Config & cfg,
const Acts::Logger & logger )
explicit

Construct the DD4hep backend.

Parameters
cfgBackend configuration and DD4hep detector handle.
loggerLogger used for diagnostics.

Member Function Documentation

◆ children()

std::vector< Element > ActsPlugins::DD4hep::DD4hepBackend::children ( const Element & parent) const

Return the direct DD4hep child elements of a parent element.

Parameters
parentParent DD4hep detector element.
Returns
Direct children of parent.

◆ constant()

template<typename... Args>
int ActsPlugins::DD4hep::DD4hepBackend::constant ( std::format_string< Args... > fmt,
Args &&... args ) const

Retrieves a named integer constant from the DD4hep detector description.

The name is constructed by formatting fmt with args.

Template Parameters
ArgsTypes used to format the constant name.
Parameters
fmtFormat string used to construct the DD4hep constant name.
argsFormat arguments substituted into fmt.
Returns
Integer constant value stored in the DD4hep detector description.

◆ createDetectorElement()

DetectorElementPtr ActsPlugins::DD4hep::DD4hepBackend::createDetectorElement ( const Element & detElement,
AxisDefinition axes ) const

Create an ACTS detector element from a DD4hep sensitive element.

Parameters
detElementDD4hep sensitive element to convert.
axesAxis convention used for the converted surface.
Returns
Shared pointer to the created detector element.

◆ defaultElementFactory()

DetectorElementPtr ActsPlugins::DD4hep::DD4hepBackend::defaultElementFactory ( const Element & detElement,
AxisDefinition axes,
double lengthScale )
static

Default detector-element factory used when Config::elementFactory is not overridden.

Parameters
detElementDD4hep sensitive detector element to wrap.
axesAxis convention used for surface conversion.
lengthScaleUnit scale applied during geometry conversion.
Returns
Newly created DD4hep-backed ACTS detector element.

◆ isBarrel()

bool ActsPlugins::DD4hep::DD4hepBackend::isBarrel ( const Element & element) const

Check whether a DD4hep element represents a barrel sub-detector.

Parameters
elementDD4hep detector element to classify.
Returns
true if the element is tagged as barrel.

◆ isEndcap()

bool ActsPlugins::DD4hep::DD4hepBackend::isEndcap ( const Element & element) const

Check whether a DD4hep element represents an endcap sub-detector.

Parameters
elementDD4hep detector element to classify.
Returns
true if the element is tagged as endcap.

◆ isSensitive()

bool ActsPlugins::DD4hep::DD4hepBackend::isSensitive ( const Element & element) const

Check whether a DD4hep element represents a sensitive detector element.

Parameters
elementDD4hep detector element to classify.
Returns
true if the element is sensitive.

◆ isTracker()

bool ActsPlugins::DD4hep::DD4hepBackend::isTracker ( const Element & element) const

Check whether a DD4hep element is part of the tracking detector.

Parameters
elementDD4hep detector element to classify.
Returns
true if the element belongs to the tracker.

◆ logger()

const Acts::Logger & ActsPlugins::DD4hep::DD4hepBackend::logger ( ) const

Return the logger associated with this backend.

Returns
Logger used for diagnostics.

◆ lookupLayerTransform()

std::optional< Acts::Transform3 > ActsPlugins::DD4hep::DD4hepBackend::lookupLayerTransform ( const Element & element,
const LayerSpec & layerSpec ) const

Derive the layer transform from a DD4hep detector element when possible.

Parameters
elementDD4hep element providing the geometric context.
layerSpecLayer configuration controlling the transform lookup.
Returns
The derived layer transform, or std::nullopt if none is available.

◆ makeBeampipe()

std::shared_ptr< Acts::Experimental::StaticBlueprintNode > ActsPlugins::DD4hep::DD4hepBackend::makeBeampipe ( ) const

Create a static beampipe blueprint node from the DD4hep world geometry.

Returns
Shared pointer to the generated beampipe node.

◆ makeSurfaces()

std::vector< std::shared_ptr< Acts::Surface > > ActsPlugins::DD4hep::DD4hepBackend::makeSurfaces ( std::span< const Element > sensitives,
const LayerSpec & layerSpec ) const

Convert a set of DD4hep sensitive elements into ACTS surfaces.

Parameters
sensitivesSensitive DD4hep elements belonging to one layer.
layerSpecLayer configuration controlling axes and naming.
Returns
Converted ACTS surfaces for the given sensitives.

◆ nameOf()

std::string ActsPlugins::DD4hep::DD4hepBackend::nameOf ( const Element & element) const

Return the fully qualified DD4hep name of an element.

Parameters
elementDD4hep detector element to inspect.
Returns
Full element name.

◆ parent()

Element ActsPlugins::DD4hep::DD4hepBackend::parent ( const Element & element) const

Return the direct parent DD4hep element of a child element.

Parameters
elementChild DD4hep detector element.
Returns
Parent detector element.

◆ world()

Element ActsPlugins::DD4hep::DD4hepBackend::world ( ) const

Return the DD4hep world detector element.

Returns
Root detector element of the DD4hep hierarchy.