File GeometryIdGenerator.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

namespace Experimental
class GeometryIdGenerator : public Acts::Experimental::IGeometryIdGenerator
#include <Acts/Detector/GeometryIdGenerator.hpp>

This is the default implementation of the geometry id generator.

It is a simple counter based generator that assigns ids to the geometry and increments the counter for each object type.

Sub counters, i.e. for the sensitive surfaces, are reset after the volume call, such that a new volume or layer volume would start from counter 0 again.

If the generator is configured to override existing ids, it will do so and not respect previously assigned ids.

If the generator is configured in container mode, it will increase the layer id for each layer volume with confined surfaces.

Public Functions

inline GeometryIdGenerator(const Config &cfg, std::unique_ptr<const Logger> mlogger = getDefaultLogger("GeometryIdGenerator", Logging::INFO))

Constructor with config.

Parameters
  • cfg – is the geometry configuration object

  • mlogger – is the logging instance

~GeometryIdGenerator() override = default
virtual void assignGeometryId(IGeometryIdGenerator::GeoIdCache &cache, DetectorVolume &dVolume) const final

Method for assigning a geometry id to a detector volume.

Parameters
  • cache – is the cache object for e.g. object counting

  • dVolume – the detector volume to assign the geometry id to

virtual void assignGeometryId(IGeometryIdGenerator::GeoIdCache &cache, Portal &portal) const final

Method for assigning a geometry id to a portal.

Parameters
  • cache – is the cache object for e.g. object counting

  • portal – the portal to assign the geometry id to

virtual void assignGeometryId(IGeometryIdGenerator::GeoIdCache &cache, Surface &surface) const final

Method for assigning a geometry id to a surface.

Parameters
  • cache – is the cache object for e.g. object counting

  • surface – the surface to assign the geometry id to

virtual IGeometryIdGenerator::GeoIdCache generateCache() const final

Interface method to generata a geometry id cache.

Returns

a geometry id cache decorated in a std::any object

Private Functions

inline const Logger &logger() const

Private access method to the logger.

GeometryIdentifier volumeId(Cache &cache, bool incrementLayer = true) const

Helper method to get the volume id from the cache.

Parameters
  • cache – the provided cache

  • incrementLayer – if true, the layer counter is incremented

Returns

a valid geometry identifier

Private Members

Config m_cfg

Configuration object.

std::unique_ptr<const Logger> m_logger

logging instance

struct Cache
#include <Acts/Detector/GeometryIdGenerator.hpp>

Nested cache struct.

Public Members

unsigned int layerCount = 0u

Cache count of the layer volume, for container mode.

unsigned int passiveCount = 0u

Cache count of passive surfaces.

unsigned int portalCount = 0u

Cache count of the portal surfaces.

unsigned int sensitiveCount = 0u

Cache count of sensitive surfaces.

unsigned int volumeCount = 0u

Cache count of the volume, for non-container mode.

struct Config
#include <Acts/Detector/GeometryIdGenerator.hpp>

Nested config struct.

Public Members

unsigned int containerId = 0u

Container id (if container mode), will not be incremented.

bool containerMode = false

Container mode.

bool overrideExistingIds = false

Force override existing ids.

bool resetSubCounters = true

Resetting mode.