File Detector.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

namespace Experimental
class Detector : public std::enable_shared_from_this<Detector>
#include <Acts/Detector/Detector.hpp>

Public Functions

const DetectorVolumeUpdator &detectorVolumeFinder() const

Const access to the volume finder.

const DetectorVolume *findDetectorVolume(const GeometryContext &gctx, const Vector3 &position) const

Find a volume from a position.

Note

this creates internally a NavigationState object

Parameters
  • gctx – is the Geometry context of the call

  • position – is the position of the call

Returns

the volume pointer or nullptr (if outside)

const DetectorVolume *findDetectorVolume(const std::string &name) const

Find a volume by name.

Parameters

name – with which the volume is searched for

Returns

the volume pointer or nullptr (if not found)

std::shared_ptr<Detector> getSharedPtr()

Retrieve a std::shared_ptr for this surface (non-const version)

Note

Will error if this was not created through the makeShared factory since it needs access to the original reference. In C++14 this is undefined behavior (but most likely implemented as a bad_weak_ptr exception), in C++17 it is defined as that exception.

Note

Only call this if you need shared ownership of this object.

Returns

The shared pointer

std::shared_ptr<const Detector> getSharedPtr() const

Retrieve a std::shared_ptr for this surface (const version)

Note

Will error if this was not created through the makeShared factory since it needs access to the original reference. In C++14 this is undefined behavior, but most likely implemented as a bad_weak_ptr exception, in C++17 it is defined as that exception.

Note

Only call this if you need shared ownership of this object.

Returns

The shared pointer

const std::string &name() const

Return the name of the detector.

std::vector<std::shared_ptr<DetectorVolume>> &rootVolumePtrs()

Non-const access to the root volumes.

Returns

the root volume shared pointer

const std::vector<const DetectorVolume*> &rootVolumes() const

Const access to the root volumes.

Returns

a vector to const DetectorVolume raw pointers

void updateDetectorVolume(const GeometryContext &gctx, NavigationState &nState) const

Update the current volume of a given navigation state.

Parameters
  • gctx – is the Geometry context of the call

  • nState – [in, out] is the navigation state

void updateDetectorVolumeFinder(DetectorVolumeUpdator &&detectorVolumeUpdator)

Update the volume finder.

Parameters

detectorVolumeUpdator – the new volume finder

std::vector<std::shared_ptr<DetectorVolume>> &volumePtrs()

Non-const access to the root volume.

Returns

the volumes shared pointer store

const std::vector<const DetectorVolume*> &volumes() const

Const access to sub volumes.

Returns

a vector to const DetectorVolume raw pointers

Public Static Functions

static std::shared_ptr<Detector> makeShared(const std::string &name, std::vector<std::shared_ptr<DetectorVolume>> rootVolumes, DetectorVolumeUpdator &&detectorVolumeUpdator)

Factory for producing memory managed instances of Detector.

Protected Functions

Detector(const std::string &name, std::vector<std::shared_ptr<DetectorVolume>> rootVolumes, DetectorVolumeUpdator &&detectorVolumeUpdator) noexcept(false)

Create a detector from volumes.

Note

will throw an exception if volumes vector is empty

Note

will throw an exception if duplicate volume names exist

Note

will throw an exception if the delegate is not connected

Parameters
  • name – the detecor name

  • rootVolumes – the volumes contained by this detector

  • detectorVolumeUpdator – is a Delegate to find the assocaited volume

Private Members

DetectorVolumeUpdator m_detectorVolumeUpdator

A volume finder delegate.

std::string m_name = "Unnamed"

Name of the detector.

DetectorVolume::ObjectStore<std::shared_ptr<DetectorVolume>> m_rootVolumes

Root volumes.

std::unordered_map<std::string, size_t> m_volumeNameIndex

Name/index map to find volumes by name and detect duplicates.

DetectorVolume::ObjectStore<std::shared_ptr<DetectorVolume>> m_volumes

Volume store (internal/external)