|
ACTS
Experiment-independent tracking
|
Concrete, non-template surface material backed by a 2D grid. More...
#include <Acts/Material/GridSurfaceMaterial.hpp>
Classes | |
| struct | GloballyIndexed |
| Per-bin indices into a (possibly shared) globally owned material vector. More... | |
| struct | Indexed |
| Per-bin indices into a locally owned material vector. More... | |
Public Types | |
| using | Direct = std::vector<MaterialSlab> |
| Material slabs stored directly, one per bin (including under-/overflow). | |
| using | Storage = std::variant<Direct, Indexed, GloballyIndexed> |
The material storage backend: one of Direct, Indexed or GloballyIndexed. | |
Public Member Functions | |
| GridSurfaceMaterial (MultiAxisSpec2D binning, Storage storage, double splitFactor=1., MappingType mappingType=MappingType::Default) | |
| Construct from a 2D binning spec and a storage backend. | |
| const MultiAxisSpec2D & | binning () const |
| Return the 2D multi-axis binning spec. | |
| std::vector< AxisDirection > | localAxisDirections () const override |
| Returns the axis directions for the local coordinate system. | |
| const MaterialSlab & | materialSlab (const Vector2 &lp) const final |
| Return method for full material description of the Surface. | |
| virtual MaterialSlab | materialSlab (const Vector2 &lp, Direction pDir, MaterialUpdateMode mode) const |
| Return method for fully scaled material description of the Surface. | |
| const IMultiAxis2D & | multiAxis () const |
| Return the multi-axis used for local position lookup. | |
| ISurfaceMaterial & | scale (double factor) override |
| Scale material. | |
| const Storage & | storage () const |
| Return the material storage backend. | |
| std::ostream & | toStream (std::ostream &sl) const override |
| Output Method for std::ostream, to be overloaded by child classes. | |
| Public Member Functions inherited from Acts::ISurfaceMaterial | |
| ISurfaceMaterial ()=default | |
| Constructor. | |
| ISurfaceMaterial (double splitFactor) | |
| Constructor. | |
| ISurfaceMaterial (double splitFactor, MappingType mappingType) | |
| Constructor. | |
| virtual | ~ISurfaceMaterial ()=default |
| Destructor. | |
| double | factor (Direction pDir, MaterialUpdateMode mode) const |
| Update pre factor. | |
| MappingType | mappingType () const |
| Return the type of surface material mapping. | |
| std::string | toString () const |
| output into a string | |
Static Public Member Functions | |
| static std::unique_ptr< GridSurfaceMaterial > | createDirect (const IAxis &axis0, const IAxis &axis1, const std::vector< std::vector< MaterialSlab > > &payload) |
Create a GridSurfaceMaterial with direct storage from two axes. | |
| static std::unique_ptr< GridSurfaceMaterial > | createDirect (const MultiAxisSpec2D &binning, const Surface &surface, const std::vector< std::vector< MaterialSlab > > &payload) |
Create a GridSurfaceMaterial with direct storage by resolving a multi-axis spec against a surface. | |
| static std::unique_ptr< GridSurfaceMaterial > | createGloballyIndexed (const IAxis &axis0, const IAxis &axis1, std::shared_ptr< std::vector< MaterialSlab > > material, const std::vector< std::vector< std::size_t > > &payload) |
Create a GridSurfaceMaterial with globally indexed storage from two axes. | |
| static std::unique_ptr< GridSurfaceMaterial > | createGloballyIndexed (const MultiAxisSpec2D &binning, const Surface &surface, std::shared_ptr< std::vector< MaterialSlab > > material, const std::vector< std::vector< std::size_t > > &payload) |
Create a GridSurfaceMaterial with globally indexed storage from a multi-axis spec resolved against a surface. | |
| static std::unique_ptr< GridSurfaceMaterial > | createIndexed (const IAxis &axis0, const IAxis &axis1, std::vector< MaterialSlab > material, const std::vector< std::vector< std::size_t > > &payload) |
Create a GridSurfaceMaterial with locally indexed storage from two axes. | |
| static std::unique_ptr< GridSurfaceMaterial > | createIndexed (const MultiAxisSpec2D &binning, const Surface &surface, std::vector< MaterialSlab > material, const std::vector< std::vector< std::size_t > > &payload) |
Create a GridSurfaceMaterial with locally indexed storage from a multi-axis spec resolved against a surface. | |
Additional Inherited Members | |
| Protected Attributes inherited from Acts::ISurfaceMaterial | |
| MappingType | m_mappingType {MappingType::Default} |
| Use the default mapping type by default. | |
| double | m_splitFactor {1.} |
| the split factor in favour of oppositePre | |
Concrete, non-template surface material backed by a 2D grid.
The grid geometry is described by a (fully specified) MultiAxisSpec2D, resolved internally into an IMultiAxis2D that maps a local surface position to a flattened bin index, see IMultiAxis. That index then addresses one of three storage backends:
Direct : a material slab stored directly per binIndexed : a per-bin index into a locally owned material vectorGloballyIndexed : a per-bin index into a (possibly shared) globally owned material vectorAll three backends share the same binning/indexing logic, so the local lookup, scaling and I/O only need to branch on the storage backend, not on the concrete grid or axis types.
The grid is always 2D: local (bound) lookup is assumed to already be expressed in the grid's own 2D coordinate system, i.e. lp[0] maps directly onto axis 0 and lp[1] onto axis 1. Only local lookup is supported - there is no global (Vector3) lookup, since that would require a global-to-local coordinate transform.
|
explicit |
Construct from a 2D binning spec and a storage backend.
| binning | the fully specified 2D multi-axis binning spec |
| storage | the material storage backend |
| splitFactor | pre/post splitting directive |
| mappingType | type of surface mapping associated to the surface |
| std::domain_error | if binning is not fully specified |
| std::invalid_argument | if the storage size does not match the number of bins implied by binning (including under-/overflow) |
| const MultiAxisSpec2D & Acts::GridSurfaceMaterial::binning | ( | ) | const |
Return the 2D multi-axis binning spec.
|
static |
Create a GridSurfaceMaterial with direct storage from two axes.
| axis0 | the axis in direction 0 |
| axis1 | the axis in direction 1 |
| payload | the material payload, one slab per regular bin, column major, i.e. [i0][i1] |
|
static |
Create a GridSurfaceMaterial with direct storage by resolving a multi-axis spec against a surface.
This follows the same pattern as ProtoGridSurfaceMaterial: the (possibly deferred) axis specs are resolved against surface via resolveMultiAxis, exactly as is done for a ProtoGridSurfaceMaterial in BinnedSurfaceMaterialAccumulator. Binning restricted to a single local direction is expressed by a single-bin spec in the other direction.
| binning | the 2D multi-axis binning spec (deferred axes are resolved against surface) |
| surface | the surface to resolve the deferred axes against |
| payload | the material payload, one slab per regular bin, column major, i.e. [i0][i1] |
|
static |
Create a GridSurfaceMaterial with globally indexed storage from two axes.
| axis0 | the axis in direction 0 |
| axis1 | the axis in direction 1 |
| material | the (possibly shared) globally owned material vector, addressed by payload |
| payload | the index payload, one index per regular bin, column major, i.e. [i0][i1] |
|
static |
Create a GridSurfaceMaterial with globally indexed storage from a multi-axis spec resolved against a surface.
| binning | the binning specification for the grid |
| surface | the surface to which the material is applied |
| material | the (possibly shared) globally owned material vector, addressed by payload |
| payload | the index payload, one index per regular bin, column major, i.e. [i0][i1] |
|
static |
Create a GridSurfaceMaterial with locally indexed storage from two axes.
| axis0 | the axis in direction 0 |
| axis1 | the axis in direction 1 |
| material | the locally owned material vector, addressed by payload |
| payload | the index payload, one index per regular bin, column major, i.e. [i0][i1] |
|
static |
Create a GridSurfaceMaterial with locally indexed storage from a multi-axis spec resolved against a surface.
| binning | the 2D multi-axis binning spec (deferred axes are resolved against surface) |
| surface | the surface to resolve the deferred axes against |
| material | the locally owned material vector, addressed by payload |
| payload | the index payload, one index per regular bin, column major, i.e. [i0][i1] |
|
overridevirtual |
Returns the axis directions for the local coordinate system.
Returns the directions of both axes of binning() if both carry a direction (as is always the case when built by resolving against a Surface, see the createDirect / createIndexed / createGloballyIndexed factory methods), or an empty vector if either does not - this lets Surface::assignSurfaceMaterial detect whether the grid's axis order needs swapping to match the surface's canonical local axes.
Implements Acts::ISurfaceMaterial.
|
finalvirtual |
Return method for full material description of the Surface.
| lp | is the local position used for the (eventual) lookup |
Implements Acts::ISurfaceMaterial.
|
virtual |
Return method for fully scaled material description of the Surface.
| lp | is the local position used for the (eventual) lookup |
| pDir | is the positive direction through the surface |
| mode | is the material update directive |
Reimplemented from Acts::ISurfaceMaterial.
| const IMultiAxis2D & Acts::GridSurfaceMaterial::multiAxis | ( | ) | const |
Return the multi-axis used for local position lookup.
|
overridevirtual |
Scale material.
| factor | is the scale factor applied |
GloballyIndexed storage this scales the entries addressed by this grid's indices in place, in the (possibly shared) global material vector - entries shared with other grids are scaled too. Implements Acts::ISurfaceMaterial.
| const Storage & Acts::GridSurfaceMaterial::storage | ( | ) | const |
Return the material storage backend.
|
overridevirtual |
Output Method for std::ostream, to be overloaded by child classes.
| sl | Output stream to write to |
Implements Acts::ISurfaceMaterial.