File TGeoLayerBuilder.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

class TGeoLayerBuilder : public Acts::ILayerBuilder
#include <Acts/Plugins/TGeo/TGeoLayerBuilder.hpp>

This parses the gGeoManager and looks for a defined combination of volume with contained sensitive detector element.

The association is done by matching the names of the TGeoNode / TGeoVolume to the search string.

The parsing can be restricted to a given parse volume (in r and z), and given some splitting parameters the surfaces can be automatically be split into layers.

Public Types

using ElementFactory = std::function<std::shared_ptr<TGeoDetectorElement>(const Identifier&, const TGeoNode&, const TGeoMatrix &tGeoMatrix, const std::string &axes, double scalor, std::shared_ptr<const Acts::ISurfaceMaterial> material)>

Public Functions

TGeoLayerBuilder(const Config &config, std::unique_ptr<const Logger> logger = getDefaultLogger("TGeoLayerBuilder", Logging::INFO))

Constructor.

Parameters
  • config – is the configuration struct

  • logger – the local logging instance

~TGeoLayerBuilder() override

Destructor.

virtual const LayerVector centralLayers(const GeometryContext &gctx) const final

LayerBuilder interface method - returning the central layers.

Parameters

gctx – the geometry context for this build call

inline const std::vector<std::shared_ptr<const TGeoDetectorElement>> &detectorElements() const

Return the created detector elements.

inline Config getConfiguration() const

Get the configuration object.

inline virtual const std::string &identification() const final

Name identification.

virtual const LayerVector negativeLayers(const GeometryContext &gctx) const final

LayerBuilder interface method - returning the layers at negative side.

Parameters

gctx – the geometry context for this build call

virtual const LayerVector positiveLayers(const GeometryContext &gctx) const final

LayerBuilder interface method - returning the layers at negative side.

Parameters

gctx – the geometry context for this build call

void setConfiguration(const Config &config)

Set the configuration object.

Parameters

config – is the configuration struct

void setLogger(std::unique_ptr<const Logger> newLogger)

Set logging instance.

Public Static Functions

static std::shared_ptr<TGeoDetectorElement> defaultElementFactory(const Identifier &identifier, const TGeoNode &tGeoNode, const TGeoMatrix &tGeoMatrix, const std::string &axes, double scalor, std::shared_ptr<const Acts::ISurfaceMaterial> material)

Private Functions

void buildLayers(const GeometryContext &gctx, LayerVector &layers, int type = 0)

Private helper method : build layers.

Parameters
  • gctx – the geometry context of this call

  • layers – is goint to be filled

  • type – is the indication which ones to build -1 | 0 | 1

inline const Logger &logger() const

Private access to the logger.

inline void registerSplit(std::vector<double> &parameters, double test, double tolerance, std::pair<double, double> &range) const

Private helper method : register splitting input.

Private Members

Config m_cfg

Configuration object.

std::vector<std::shared_ptr<const TGeoDetectorElement>> m_elementStore
std::array<std::string, 3> m_layerTypes = {"Negative", "Central", "Positive"}

layer types

std::unique_ptr<const Logger> m_logger

Logging instance.

struct Config
#include <Acts/Plugins/TGeo/TGeoLayerBuilder.hpp>

nested configuration struct for steering of the layer builder

Public Members

bool autoSurfaceBinning = false

Automated binning & tolerances.

std::string configurationName = "undefined"

String based identification.

std::shared_ptr<const ITGeoDetectorElementSplitter> detectorElementSplitter = nullptr

Split TGeoElement if a splitter is provided.

ElementFactory elementFactory = defaultElementFactory

Factory for creating detector elements based on TGeoNodes.

std::shared_ptr<const ITGeoIdentifierProvider> identifierProvider = nullptr

Create an indentifier from TGeoNode.

std::array<std::vector<LayerConfig>, 3> layerConfigurations

Configuration is always | n | c | p |.

std::shared_ptr<const LayerCreator> layerCreator = nullptr

Layer creator.

std::array<double, 3> layerSplitToleranceR = {-1., -1., -1.}

Split tolerances in R.

std::array<double, 3> layerSplitToleranceZ = {-1., -1., -1.}

Split tolerances in Z.

std::shared_ptr<const ProtoLayerHelper> protoLayerHelper = nullptr

ProtoLayer helper.

Acts::SurfaceBinningMatcher surfaceBinMatcher

The surface binning matcher.

double unit = 1 * UnitConstants::cm

Unit conversion.

struct LayerConfig
#include <Acts/Plugins/TGeo/TGeoLayerBuilder.hpp>

Helper config structs for volume parsing.

Public Types

using RangeConfig = std::pair<BinningValue, std::pair<double, double>>
using SplitConfig = std::pair<BinningValue, double>

Public Functions

inline LayerConfig()

Public Members

std::vector<std::pair<int, BinningType>> binning0 = {{-1, equidistant}}

Binning setup in l0: nbins (-1 -> automated), axis binning type.

std::vector<std::pair<int, BinningType>> binning1 = {{-1, equidistant}}

Binning setup in l1: nbins (-1 -> automated), axis binning type.

std::pair<double, double> envelope = {1 * UnitConstants::mm, 1 * UnitConstants::mm}

The envelope to be built around the layer.

std::string localAxes = "XYZ"

The local axis definition of TGeo object to Acts::Surface.

std::vector<RangeConfig> parseRanges = {}

Parse ranges: parameter and ranges.

std::vector<std::string> sensorNames = {}

Identify the sensor(s) by name.

std::vector<SplitConfig> splitConfigs = {}

Layer splitting: parameter and tolerance.

std::string volumeName = ""

Identify the search volume by name.