ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::surface_factory< detector_t, mask_shape_t > Class Template Reference

Generates a number of surfaces for a volume (can be portals, passives or sensitives) and fills them into the containers of a volume builder. More...

#include <detray/builders/surface_factory.hpp>

Inheritance diagram for detray::surface_factory< detector_t, mask_shape_t >:
[legend]
Collaboration diagram for detray::surface_factory< detector_t, mask_shape_t >:
[legend]

Public Types

using detector_type = detector_t
 Detector type whose surface and geometry stores this factory fills.
using sf_data_collection = std::vector<surface_data_t>
 Collection of input records describing surfaces to construct.
using surface_data_t = surface_data<detector_t>
 shorthad for a collection of surface data that can be read by a surface factory
Public Types inherited from detray::surface_factory_interface< detector_t >
using navigation_link = typename detector_t::surface_type::navigation_link
 Navigation link type used by surfaces produced by the factory.

Public Member Functions

 surface_factory ()=default
 Empty factory.
auto bounds () const -> const std::vector< std::vector< std::vector< scalar_t > > > &
auto clear () -> void override
 Clear old data.
auto operator() (typename detector_t::volume_type &volume, typename detector_t::surface_lookup_container &surfaces, typename detector_t::transform_container &transforms, typename detector_t::mask_container &masks, typename detector_t::geometry_context ctx={}) -> dindex_range override
 Generate the surfaces and add them to given data collections.
auto push_back (sf_data_collection &&surface_data) -> void override
 Add all necessary components to the factory from bundled surface data in.
void push_back (surface_data_t &&sf_data) override
 Add all necessary components to the factory for a single surface.
auto size () const -> dindex override
auto transforms () const -> const std::vector< typename detector_t::transform3_type > &
auto types () const -> const std::vector< surface_id > &
const auto & volume_links () const
Public Member Functions inherited from detray::surface_factory_interface< detector_t >
virtual void clear ()=0
 Clear all data in the factory.
virtual dindex size () const =0
virtual void push_back (std::vector< surface_data< detector_t > > &&data)=0

Additional Inherited Members

Protected Member Functions inherited from detray::surface_factory_interface< detector_t >
template<typename container_t, typename... Args>
dindex insert_in_container (container_t &cont, const typename container_t::value_type value, const dindex idx, Args &&...args) const
 Insert a value in a container at a specific index.

Detailed Description

template<concepts::detector detector_t, typename mask_shape_t>
class detray::surface_factory< detector_t, mask_shape_t >

Generates a number of surfaces for a volume (can be portals, passives or sensitives) and fills them into the containers of a volume builder.

Template Parameters
detector_tthe type of detector the volume belongs to.
mask_shape_tthe shape of the surface.

Member Function Documentation

◆ bounds()

template<concepts::detector detector_t, typename mask_shape_t>
auto detray::surface_factory< detector_t, mask_shape_t >::bounds ( ) const->conststd::vector< std::vector< std::vector< scalar_t > > > &
Returns
the mask boundaries currently held by the factory

◆ operator()()

template<concepts::detector detector_t, typename mask_shape_t>
auto detray::surface_factory< detector_t, mask_shape_t >::operator() ( typename detector_t::volume_type & volume,
typename detector_t::surface_lookup_container & surfaces,
typename detector_t::transform_container & transforms,
typename detector_t::mask_container & masks,
typename detector_t::geometry_context ctx = {} )->dindex_range
overridevirtual

Generate the surfaces and add them to given data collections.

Parameters
volumethe volume they will be added to in the detector.
surfacesthe resulting surface objects.
transformsthe transforms of the surfaces.
masksthe masks of the surfaces (all of the same shape).
ctxthe geometry context.
Returns
index range of inserted surfaces in surfaces container

Implements detray::surface_factory_interface< detector_t >.

◆ push_back() [1/2]

template<concepts::detector detector_t, typename mask_shape_t>
auto detray::surface_factory< detector_t, mask_shape_t >::push_back ( sf_data_collection && surface_data) ->void
override

Add all necessary components to the factory from bundled surface data in.

Parameters
surface_data.

◆ push_back() [2/2]

template<concepts::detector detector_t, typename mask_shape_t>
void detray::surface_factory< detector_t, mask_shape_t >::push_back ( surface_data_t && sf_data)
overridevirtual

Add all necessary components to the factory for a single surface.

Parameters
sf_dataSurface type, links, bounds, and transform to store.

Implements detray::surface_factory_interface< detector_t >.

◆ size()

template<concepts::detector detector_t, typename mask_shape_t>
auto detray::surface_factory< detector_t, mask_shape_t >::size ( ) const->dindex
override
Returns
the current number of surfaces that will be built by this factory

◆ transforms()

template<concepts::detector detector_t, typename mask_shape_t>
auto detray::surface_factory< detector_t, mask_shape_t >::transforms ( ) const->conststd::vector< typenamedetector_t::transform3_type > &
Returns
the transforms currently held by the factory

◆ types()

template<concepts::detector detector_t, typename mask_shape_t>
auto detray::surface_factory< detector_t, mask_shape_t >::types ( ) const->conststd::vector< surface_id > &
Returns
the surface types

◆ volume_links()

template<concepts::detector detector_t, typename mask_shape_t>
const auto & detray::surface_factory< detector_t, mask_shape_t >::volume_links ( ) const
Returns
the volume link(s) currently held by the factory