Class Acts::Experimental::Detector

class Detector : public std::enable_shared_from_this<Detector>

Public Functions

inline 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

inline const std::string &name() const

Return the name of the detector.

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

inline void updateDetectorVolumeFinder(DetectorVolumeUpdator &&mVolumeFinder)

Update the volume finder.

Parameters

mVolumeFinder – the new volume finder

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

Non-const access to the volumes.

Returns

the volumes shared pointer store

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

Const access to sub volumes.

Returns

a vector to const DetectorVolume raw pointers

Public Static Functions

template<typename ...Args>
static inline std::shared_ptr<Detector> makeShared(Args&&... args)

Factory for producing memory managed instances of Detector.

Will forward all parameters and will attempt to find a suitable constructor.

Template Parameters

Args – the arguments that will be forwarded