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

Shared Geant4 geometry model wrapper. More...

#include <GeantGeoParams.hh>

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

Public Member Functions

 GeantGeoParams (std::string const &gdml_filename)
 Construct from a GDML input. More...
 
 GeantGeoParams (G4VPhysicalVolume const *world)
 Use an existing loaded Geant4 geometry.
 
 CELER_DEFAULT_MOVE_DELETE_COPY (GeantGeoParams)
 
 ~GeantGeoParams () final
 Clean up on destruction.
 
G4VPhysicalVolume const * world () const
 Access the world volume.
 
bool supports_safety () const final
 Whether safety distance calculations are accurate and precise.
 
BBox const & bbox () const final
 Outer bounding box of geometry.
 
LevelId::size_type max_depth () const final
 Maximum nested scene/volume depth.
 
VolumeMap const & volumes () const final
 Get volume metadata. More...
 
VolInstanceMap const & volume_instances () const final
 Get volume instance metadata. More...
 
VolumeId find_volume (G4LogicalVolume const *volume) const final
 Locate the volume ID corresponding to a Geant4 logical volume.
 
G4VPhysicalVolume const * id_to_pv (VolumeInstanceId vol_id) const final
 Get the Geant4 physical volume corresponding to a volume instance ID. More...
 
G4LogicalVolume const * id_to_lv (VolumeId vol_id) const
 Get the Geant4 logical volume corresponding to a volume ID. More...
 
HostRef const & host_ref () const final
 Access geometry data on host.
 
DeviceRef const & device_ref () const final
 No GPU support code.
 
virtual VolumeId find_volume (G4LogicalVolume const *volume) const=0
 Get the volume ID corresponding to a Geant4 logical volume.
 
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.
 
- 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< GeantGeoParamsData >
GeantGeoParamsData< Ownership::const_reference, M > const & ref () const
 Dispatch a "ref" call to host or device data.
 

Additional Inherited Members

- 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< GeantGeoParamsData >
using HostRef = HostCRef< GeantGeoParamsData >
 
using DeviceRef = DeviceCRef< GeantGeoParamsData >
 
- Protected Member Functions inherited from celeritas::GeoParamsInterface
 CELER_DEFAULT_COPY_MOVE (GeoParamsInterface)
 
- Protected Member Functions inherited from celeritas::ParamsDataInterface< GeantGeoParamsData >
 CELER_DEFAULT_COPY_MOVE (ParamsDataInterface)
 

Detailed Description

Shared Geant4 geometry model wrapper.

This can be constructed directly by loading a GDML file, or in-memory using an existing physical volume. One "gotcha" is that due to persistent static variables in Geant4, the volume IDs will be offset if a geometry has been loaded and closed previously.

Constructor & Destructor Documentation

◆ GeantGeoParams()

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

Construct from a GDML input.

This assumes that Celeritas is driving and will manage Geant4 exceptions etc.

Member Function Documentation

◆ id_to_lv()

G4LogicalVolume const * celeritas::GeantGeoParams::id_to_lv ( VolumeId  id) const

Get the Geant4 logical volume corresponding to a volume ID.

If the input volume ID is unassigned, a null pointer will be returned.

◆ id_to_pv()

G4VPhysicalVolume const * celeritas::GeantGeoParams::id_to_pv ( VolumeInstanceId  id) const
finalvirtual

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

If the input ID is false, a null pointer will be returned.

Implements celeritas::GeoParamsInterface.

◆ volume_instances()

auto celeritas::GeantGeoParams::volume_instances ( ) const
inlinefinalvirtual

Get volume instance metadata.

Volume instances correspond directly to Geant4 physical volumes.

Implements celeritas::GeoParamsInterface.

◆ volumes()

auto celeritas::GeantGeoParams::volumes ( ) const
inlinefinalvirtual

Get volume metadata.

Volumes correspond directly to Geant4 logical volumes.

Implements celeritas::GeoParamsInterface.


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