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

Backend adapter for building ACTS blueprints from a TGeo geometry tree. More...

#include <ActsPlugins/Root/BlueprintBuilder.hpp>

Collaboration diagram for ActsPlugins::TGeoBlueprintBuilderBackend:
[legend]

Classes

struct  Config
 Runtime configuration for the TGeo blueprint backend. More...
struct  Element
 Lightweight backend element that points to a node context. More...
struct  LayerSpec
 Optional layer configuration used during layer assembly. More...
struct  NodeContext
 Context for one node in the TGeo hierarchy. More...

Public Types

using AxisDefinition = TGeoAxes
 Axis definitions used for detector element and layer surface creation.
using DetectorElement = TGeoDetectorElement
 Concrete detector element type used by this backend.
using DetectorElementFactory
 Factory function used to instantiate detector elements.
using DetectorElementPtr = std::shared_ptr<DetectorElement>
 Shared pointer to the detector element type.
using ElementPredicate = std::function<bool(const Element&)>
 Predicate used to classify geometry elements as sensitive.
using IdentifierProvider
 Provider that maps an element to a detector element identifier.

Public Member Functions

 TGeoBlueprintBuilderBackend (const Config &cfg, const Acts::Logger &logger)
 Construct the backend from configuration and logger.
std::vector< Elementchildren (const Element &parent) const
 Retrieve the direct children of a parent element.
DetectorElementPtr createDetectorElement (const Element &element, AxisDefinition axes) const
 Create a detector element for a sensitive geometry element.
bool isSensitive (const Element &element) const
 Check whether an element is considered sensitive.
const Acts::Loggerlogger () const
 Access the backend logger.
std::optional< Acts::Transform3lookupLayerTransform (const Element &element, const LayerSpec &layerSpec) const
 Look up an optional transform to use for the assembled layer.
std::vector< std::shared_ptr< Acts::Surface > > makeSurfaces (std::span< const Element > sensitives, const LayerSpec &layerSpec) const
 Build ACTS surfaces for a set of sensitive elements.
std::string nameOf (const Element &element) const
 Retrieve the node name for an element.
const TGeoNode & nodeOf (const Element &element) const
 Access the underlying TGeo node for an element.
Element parent (const Element &element) const
 Retrieve the parent element of an element.
std::string pathOf (const Element &element) const
 Compute the full geometry path of an element.
TGeoHMatrix transformOf (const Element &element) const
 Compute the world transform of an element.
Element world () const
 Access the world/root element of the configured TGeo tree.

Static Public Member Functions

static DetectorElementPtr defaultElementFactory (const TGeoDetectorElement::Identifier &identifier, const TGeoNode &tGeoNode, const TGeoMatrix &tGeoMatrix, AxisDefinition axes, double lengthScale, std::shared_ptr< const Acts::ISurfaceMaterial > material)
 Default detector element factory implementation.

Static Public Attributes

static constexpr std::string_view kIdentifier = "TGeoBlueprintBuilderBackend"
 Identifier used by the generic blueprint infrastructure.

Detailed Description

Backend adapter for building ACTS blueprints from a TGeo geometry tree.

Member Typedef Documentation

◆ DetectorElementFactory

Initial value:
std::function<DetectorElementPtr(
const TGeoDetectorElement::Identifier&, const TGeoNode&,
const TGeoMatrix&, AxisDefinition, double,
std::shared_ptr<const Acts::ISurfaceMaterial>)>
std::shared_ptr< DetectorElement > DetectorElementPtr
Shared pointer to the detector element type.
Definition BlueprintBuilder.hpp:80
TGeoAxes AxisDefinition
Axis definitions used for detector element and layer surface creation.
Definition BlueprintBuilder.hpp:66
identifier_type Identifier
Identifier alias.
Definition TGeoDetectorElement.hpp:49

Factory function used to instantiate detector elements.

◆ IdentifierProvider

Initial value:
Lightweight backend element that points to a node context.
Definition BlueprintBuilder.hpp:45

Provider that maps an element to a detector element identifier.

Constructor & Destructor Documentation

◆ TGeoBlueprintBuilderBackend()

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

Construct the backend from configuration and logger.

Parameters
cfgBackend configuration.
loggerLogger instance used for diagnostics.

Member Function Documentation

◆ children()

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

Retrieve the direct children of a parent element.

Parameters
parentParent element.
Returns
Direct child elements.

◆ createDetectorElement()

DetectorElementPtr ActsPlugins::TGeoBlueprintBuilderBackend::createDetectorElement ( const Element & element,
AxisDefinition axes ) const

Create a detector element for a sensitive geometry element.

Parameters
elementSensitive element to convert.
axesAxis definition used to build the detector element surface.
Returns
Shared detector element instance.

◆ defaultElementFactory()

DetectorElementPtr ActsPlugins::TGeoBlueprintBuilderBackend::defaultElementFactory ( const TGeoDetectorElement::Identifier & identifier,
const TGeoNode & tGeoNode,
const TGeoMatrix & tGeoMatrix,
AxisDefinition axes,
double lengthScale,
std::shared_ptr< const Acts::ISurfaceMaterial > material )
static

Default detector element factory implementation.

Parameters
identifierIdentifier assigned to the detector element.
tGeoNodeSource TGeo node.
tGeoMatrixGlobal transform matrix of the source node.
axesAxis definition used to build the ACTS surface.
lengthScaleScale factor converting TGeo lengths to ACTS units.
materialOptional surface material assigned to created surfaces.
Returns
Shared detector element instance.

◆ isSensitive()

bool ActsPlugins::TGeoBlueprintBuilderBackend::isSensitive ( const Element & element) const

Check whether an element is considered sensitive.

Parameters
elementElement to classify.
Returns
True if the element is sensitive.

◆ logger()

const Acts::Logger & ActsPlugins::TGeoBlueprintBuilderBackend::logger ( ) const

Access the backend logger.

Returns
Backend logger instance.

◆ lookupLayerTransform()

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

Look up an optional transform to use for the assembled layer.

Parameters
elementReference element for the lookup.
layerSpecOptional layer assembly overrides.
Returns
Layer transform if one can be determined.

◆ makeSurfaces()

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

Build ACTS surfaces for a set of sensitive elements.

Parameters
sensitivesSensitive elements that contribute surfaces.
layerSpecOptional layer assembly overrides.
Returns
Created ACTS surfaces.

◆ nameOf()

std::string ActsPlugins::TGeoBlueprintBuilderBackend::nameOf ( const Element & element) const

Retrieve the node name for an element.

Parameters
elementElement whose node name is requested.
Returns
Node name.

◆ nodeOf()

const TGeoNode & ActsPlugins::TGeoBlueprintBuilderBackend::nodeOf ( const Element & element) const

Access the underlying TGeo node for an element.

Parameters
elementElement whose node is requested.
Returns
Referenced TGeo node.

◆ parent()

Element ActsPlugins::TGeoBlueprintBuilderBackend::parent ( const Element & element) const

Retrieve the parent element of an element.

Parameters
elementElement whose parent is requested.
Returns
Parent element.

◆ pathOf()

std::string ActsPlugins::TGeoBlueprintBuilderBackend::pathOf ( const Element & element) const

Compute the full geometry path of an element.

Parameters
elementElement whose path is requested.
Returns
Full geometry path.

◆ transformOf()

TGeoHMatrix ActsPlugins::TGeoBlueprintBuilderBackend::transformOf ( const Element & element) const

Compute the world transform of an element.

Parameters
elementElement whose transform is requested.
Returns
Global transformation matrix.

◆ world()

Element ActsPlugins::TGeoBlueprintBuilderBackend::world ( ) const

Access the world/root element of the configured TGeo tree.

Returns
Root element of the geometry hierarchy.