ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::io::homogeneous_material_writer Class Reference

Homogeneous material writer backend. More...

#include <detray/io/backend/homogeneous_material_writer.hpp>

Collaboration diagram for detray::io::homogeneous_material_writer:
[legend]

Public Types

using payload_type = detector_homogeneous_material_payload
 Payload type that the reader processes.

Static Public Member Functions

template<class detector_t>
static homogeneous_material_header_payload header_to_payload (const detector_t &det, const std::string_view det_name)
 Convert the header information into its payload.
template<class detector_t>
static payload_type to_payload (const detector_t &det, const typename detector_t::name_map &)
 Convert the material description of a detector det into its io payload.
template<detray::concepts::material_params material_t>
static material_param_payload to_payload (const material_t &mat)
 Convert surface material mat into its io payload.
template<detray::concepts::algebra algebra_t, detray::concepts::homogeneous_material material_t>
static surface_material_payload to_payload (const material_t &mat, std::size_t sf_idx)
 Convert a homogeneous material surface entry to payload form.
template<class detector_t>
static material_volume_payload to_payload (const typename detector_t::volume_type &vol_desc, const detector_t &det)
 Convert the material description of a volume vol_desc into its io payload.

Static Public Attributes

static constexpr std::string_view tag = "homogeneous_material"
 Tag the writer as "homogeneous_material".

Detailed Description

Homogeneous material writer backend.

Fills a detector_homogeneous_material_payload from a detector instance

Member Function Documentation

◆ header_to_payload()

template<class detector_t>
homogeneous_material_header_payload detray::io::homogeneous_material_writer::header_to_payload ( const detector_t & det,
const std::string_view det_name )
static

Convert the header information into its payload.

Template Parameters
detector_tDetector type to serialize.
Parameters
detDetector providing the material store and surface links.
det_nameName recorded in the serialized header.
Returns
Header payload with counts for slabs, rods, and their surfaces.

◆ to_payload() [1/4]

template<class detector_t>
payload_type detray::io::homogeneous_material_writer::to_payload ( const detector_t & det,
const typename detector_t::name_map &  )
static

Convert the material description of a detector det into its io payload.

Template Parameters
detector_tDetector type to serialize.
Parameters
detDetector whose material descriptions are serialized.
Returns
Payload containing the material entries grouped by volume.

◆ to_payload() [2/4]

template<detray::concepts::material_params material_t>
material_param_payload detray::io::homogeneous_material_writer::to_payload ( const material_t & mat)
static

Convert surface material mat into its io payload.

Template Parameters
material_tMaterial parameter type.
Parameters
matMaterial properties to serialize.
Returns
Payload containing the material parameters.

◆ to_payload() [3/4]

surface_material_payload detray::io::homogeneous_material_writer::to_payload ( const material_t & mat,
std::size_t sf_idx )
static

Convert a homogeneous material surface entry to payload form.

Template Parameters
algebra_tAlgebra backend used by the detector.
material_tHomogeneous material type.
Parameters
matMaterial and thickness attached to the surface.
sf_idxIndex of the owning surface in its collection.
Returns
Payload linking the surface to its material.

◆ to_payload() [4/4]

template<class detector_t>
material_volume_payload detray::io::homogeneous_material_writer::to_payload ( const typename detector_t::volume_type & vol_desc,
const detector_t & det )
static

Convert the material description of a volume vol_desc into its io payload.

Template Parameters
detector_tDetector type to serialize.
Parameters
vol_descVolume descriptor whose surfaces are inspected.
detDetector providing material data and surface descriptors.
Returns
Material payload for the volume.