ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::GloballyIndexedMaterialAccessor Struct Reference

This is an accessor for cases where the material is filled in a global material vector that is accessed from the different material grids. More...

#include <Acts/Material/GridSurfaceMaterial.hpp>

Inheritance diagram for Acts::GloballyIndexedMaterialAccessor:
[legend]
Collaboration diagram for Acts::GloballyIndexedMaterialAccessor:
[legend]

Public Types

using grid_value_type = std::size_t
 Broadcast the grid_value_type.

Public Member Functions

 GloballyIndexedMaterialAccessor (std::shared_ptr< std::vector< MaterialSlab > > gMaterial, bool shared=false)
 Constructor with global material vector.
template<typename grid_type>
void scale (grid_type &grid, double scale)
 Scale the material (by scaling the thickness).
template<typename grid_type>
const MaterialSlabslab (const grid_type &grid, const typename grid_type::point_t &point) const
 Direct const access to the material slap sorted in the grid.
Public Member Functions inherited from Acts::IGridMaterialAccessor
virtual ~IGridMaterialAccessor ()=default

Public Attributes

std::shared_ptr< std::vector< MaterialSlab > > globalMaterial = nullptr
 The internal storage of the material.
bool sharedEntries = false
 Indicate if you have entries bins across different grids, e.g.

Detailed Description

This is an accessor for cases where the material is filled in a global material vector that is accessed from the different material grids.

Member Typedef Documentation

◆ grid_value_type

Broadcast the grid_value_type.

Constructor & Destructor Documentation

◆ GloballyIndexedMaterialAccessor()

Acts::GloballyIndexedMaterialAccessor::GloballyIndexedMaterialAccessor ( std::shared_ptr< std::vector< MaterialSlab > > gMaterial,
bool shared = false )
explicit

Constructor with global material vector.

Parameters
gMaterialShared pointer to global material vector
sharedWhether material entries are shared across grid points

Member Function Documentation

◆ scale()

template<typename grid_type>
void Acts::GloballyIndexedMaterialAccessor::scale ( grid_type & grid,
double scale )

Scale the material (by scaling the thickness).

Parameters
gridthe grid holding the indices into the global material vector
scalethe amount of the scaling
Note
this will scale only the bins touched by this grid, however, if there are shared bins, then it will throw an exception as the outcome is unpredictable.

◆ slab()

template<typename grid_type>
const MaterialSlab & Acts::GloballyIndexedMaterialAccessor::slab ( const grid_type & grid,
const typename grid_type::point_t & point ) const

Direct const access to the material slap sorted in the grid.

Template Parameters
grid_typethe type of the grid, also defines the point type
Parameters
gridthe grid holding the indices into the global material vector
pointthe lookup point (already casted from global, or filled from local)
Returns
the material slab from the grid bin associated to the lookup point

Member Data Documentation

◆ globalMaterial

std::shared_ptr<std::vector<MaterialSlab> > Acts::GloballyIndexedMaterialAccessor::globalMaterial = nullptr

The internal storage of the material.

◆ sharedEntries

bool Acts::GloballyIndexedMaterialAccessor::sharedEntries = false

Indicate if you have entries bins across different grids, e.g.

by running a compression/clustering algorithm.

It is the responsibility of the user to set this flag correctly.