Celeritas  0.5.0-86+4a8eea4
Public Member Functions | List of all members
celeritas::OrangeParams Class Referencefinal

Persistent model data for an ORANGE geometry. More...

#include <OrangeParams.hh>

Inheritance diagram for celeritas::OrangeParams:
Inheritance graph
[legend]

Public Types

Type aliases
using SurfaceMap = LabelIdMultiMap< SurfaceId >
 
using UniverseMap = LabelIdMultiMap< UniverseId >
 
- Public Types inherited from celeritas::GeoParamsSurfaceInterface
using SurfaceMap = LabelIdMultiMap< SurfaceId >
 
- Public Types inherited from celeritas::GeoParamsInterface
using SpanConstVolumeId = Span< VolumeId const >
 
using VolumeMap = LabelIdMultiMap< VolumeId >
 
using VolInstanceMap = LabelIdMultiMap< VolumeInstanceId >
 
- Public Types inherited from celeritas::ParamsDataInterface< OrangeParamsData >
using HostRef = HostCRef< OrangeParamsData >
 
using DeviceRef = DeviceCRef< OrangeParamsData >
 

Public Member Functions

 OrangeParams (std::string const &filename)
 Construct from a JSON file (if JSON is enabled). More...
 
 OrangeParams (G4VPhysicalVolume const *)
 Construct in-memory from a Geant4 geometry. More...
 
 OrangeParams (OrangeInput &&input)
 Advanced usage: construct from explicit host data. More...
 
 ~OrangeParams () final
 Default destructor to define vtable externally. More...
 
 CELER_DELETE_COPY_MOVE (OrangeParams)
 
bool supports_safety () const final
 Whether safety distance calculations are accurate and precise.
 
BBox const & bbox () const final
 Outer bounding box of geometry.
 
size_type max_depth () const final
 Maximum universe depth.
 
SurfaceMap const & surfaces () const final
 Get surface metadata.
 
UniverseMap const & universes () const
 Get universe metadata.
 
VolumeMap const & volumes () const final
 Get volume metadata.
 
VolInstanceMap const & volume_instances () const final
 Get volume instance metadata.
 
VolumeId find_volume (G4LogicalVolume const *volume) const final
 Locate the volume ID corresponding to a Geant4 volume. More...
 
G4VPhysicalVolume const * id_to_pv (VolumeInstanceId vol_id) const final
 Get the Geant4 physical volume corresponding to a volume instance ID. More...
 
Label const & id_to_label (UniverseId univ_id) const
 
UniverseId find_universe (std::string const &name) const
 
UniverseId::size_type num_universes () const
 
HostRef const & host_ref () const final
 Reference to CPU geometry data.
 
DeviceRef const & device_ref () const final
 Reference to managed GPU geometry data.
 
Label const & id_to_label (SurfaceId surf_id) const
 Get the label for a placed volume ID.
 
Label const & id_to_label (VolumeId vol_id) const
 Get the label for a placed volume ID.
 
- Public Member Functions inherited from celeritas::GeoParamsSurfaceInterface
 ~GeoParamsSurfaceInterface () override=0
 Default virtual destructor.
 
Label const & id_to_label (SurfaceId surf_id) const
 Get the label for a placed volume ID.
 
SurfaceId find_surface (std::string const &name) const
 Get the surface ID corresponding to a unique label name.
 
SurfaceId::size_type num_surfaces () const
 Number of distinct surfaces.
 
Label const & id_to_label (VolumeId vol_id) const
 Get the label for a placed volume ID.
 
- Public Member Functions inherited from celeritas::GeoParamsInterface
virtual ~GeoParamsInterface ()=0
 Default virtual destructor.
 
VolumeId::size_type num_volumes () const
 Number of volumes.
 
Label const & id_to_label (VolumeId vol_id) const
 Get the label for a placed volume ID.
 
VolumeId find_volume (std::string const &name) const
 Get the volume ID corresponding to a unique name.
 
VolumeId find_volume (Label const &label) const
 Get the volume ID corresponding to a unique label.
 
VolumeId find_volume (char const *name) const
 Get the volume ID corresponding to a unique name.
 
SpanConstVolumeId find_volumes (std::string const &name) const
 Get the volume ID corresponding to a unique name.
 
- Public Member Functions inherited from celeritas::ParamsDataInterface< OrangeParamsData >
OrangeParamsData< Ownership::const_reference, M > const & ref () const
 Dispatch a "ref" call to host or device data.
 

Additional Inherited Members

- Protected Member Functions inherited from celeritas::GeoParamsSurfaceInterface
 CELER_DEFAULT_COPY_MOVE (GeoParamsSurfaceInterface)
 
- Protected Member Functions inherited from celeritas::GeoParamsInterface
 CELER_DEFAULT_COPY_MOVE (GeoParamsInterface)
 
- Protected Member Functions inherited from celeritas::ParamsDataInterface< OrangeParamsData >
 CELER_DEFAULT_COPY_MOVE (ParamsDataInterface)
 

Detailed Description

Persistent model data for an ORANGE geometry.

This class initializes and manages the data used by ORANGE (surfaces, volumes) and provides a host-based interface for them.

Constructor & Destructor Documentation

◆ OrangeParams() [1/3]

celeritas::OrangeParams::OrangeParams ( std::string const &  filename)
explicit

Construct from a JSON file (if JSON is enabled).

The JSON format is defined by the SCALE ORANGE exporter (not currently distributed).

◆ OrangeParams() [2/3]

celeritas::OrangeParams::OrangeParams ( G4VPhysicalVolume const *  world)
explicit

Construct in-memory from a Geant4 geometry.

TODO: expose options? Fix volume mappings?

◆ OrangeParams() [3/3]

celeritas::OrangeParams::OrangeParams ( OrangeInput &&  input)
explicit

Advanced usage: construct from explicit host data.

Volume and surface labels must be unique for the time being.

◆ ~OrangeParams()

celeritas::OrangeParams::~OrangeParams ( )
finaldefault

Default destructor to define vtable externally.

Needed due to a buggy LLVM optimization that causes dynamic-casts in downstream libraries to fail: see https://github.com/celeritas-project/celeritas/pull/1436 .

Member Function Documentation

◆ find_volume()

VolumeId celeritas::OrangeParams::find_volume ( G4LogicalVolume const *  volume) const
inlinefinalvirtual

Locate the volume ID corresponding to a Geant4 volume.

Todo:
Implement using g4org::Converter

Implements celeritas::GeoParamsInterface.

◆ id_to_pv()

G4VPhysicalVolume const * celeritas::OrangeParams::id_to_pv ( VolumeInstanceId  vol_id) const
inlinefinalvirtual

Get the Geant4 physical volume corresponding to a volume instance ID.

Todo:
Implement using g4org::Converter

Implements celeritas::GeoParamsInterface.


The documentation for this class was generated from the following files: