Celeritas 0.6.0-129+develop.846910afa
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
celeritas::VecgeomParams Class Referencefinal

Shared model parameters for a VecGeom geometry. More...

#include <VecgeomParams.hh>

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

Public Types

Type aliases
using VecLv = std::vector< G4LogicalVolume const * >
 
using VecPv = std::vector< G4VPhysicalVolume const * >
 
using ImplVolInstanceId = VecgeomPlacedVolumeId
 
using ImplVolInstanceMap = LabelIdMultiMap< ImplVolInstanceId >
 
- Public Types inherited from celeritas::GeoParamsInterface
using SpanConstVolumeId = Span< ImplVolumeId const >
 
using ImplVolumeMap = LabelIdMultiMap< ImplVolumeId >
 
- Public Types inherited from celeritas::ParamsDataInterface< VecgeomParamsData >
using HostRef = HostCRef< VecgeomParamsData >
 
using DeviceRef = DeviceCRef< VecgeomParamsData >
 

Public Member Functions

 VecgeomParams (vecgeom::GeoManager const &, Ownership, VecLv const &, VecPv const &)
 Set up vecgeom given existing an already set up VecGeom CPU world.
 
 ~VecgeomParams () final
 Clean up vecgeom on destruction.
 
bool supports_safety () const final
 Whether safety distance calculations are accurate and precise.
 
BBox constbbox () const final
 Outer bounding box of geometry.
 
LevelId::size_type max_depth () const
 Maximum nested geometry depth.
 
inp::Model make_model_input () const final
 Create model parameters corresponding to our internal representation.
 
ImplVolumeMap constimpl_volumes () const final
 Get volume metadata.
 
ImplVolInstanceMap constimpl_volume_instances () const
 Get volume instance metadata.
 
ImplVolumeId find_volume (G4LogicalVolume const *volume) const final
 Locate the volume ID corresponding to a Geant4 logical volume.
 
GeantPhysicalInstance id_to_geant (VolumeInstanceId vol_id) const final
 Get the Geant4 physical volume corresponding to a volume instance ID.
 
VolumeId volume_id (ImplVolumeId) const final
 Get the canonical volume IDs corresponding to an implementation volume.
 
HostRef consthost_ref () const final
 Access geometry data on host.
 
DeviceRef constdevice_ref () const final
 Access geometry data on device.
 
virtual ImplVolumeId find_volume (G4LogicalVolume const *volume) const=0
 Get the volume ID corresponding to a Geant4 logical volume.
 
- Public Member Functions inherited from celeritas::GeoParamsInterface
virtual ~GeoParamsInterface ()=0
 Default virtual destructor.
 
- Public Member Functions inherited from celeritas::ParamsDataInterface< VecgeomParamsData >
VecgeomParamsData< Ownership::const_reference, M > const & ref () const
 
VecgeomParamsData< Ownership::const_reference, M > const & ref () const
 Dispatch a "ref" call to host or device data.
 

Static Public Member Functions

static bool use_surface_tracking ()
 Whether surface tracking is being used.
 
static bool use_vgdml ()
 Whether VecGeom GDML is used to load the geometry.
 
Static constructor helpers
Todo:
: move these to a "model" abstraction that loads/emits geometry, materials, volumes?
static std::shared_ptr< VecgeomParamsfrom_gdml (std::string const &filename)
 Build by loading a GDML file.
 
static std::shared_ptr< VecgeomParamsfrom_gdml_g4 (std::string const &filename)
 Build by loading a GDML file using Geant4.
 
static std::shared_ptr< VecgeomParamsfrom_gdml_vg (std::string const &filename)
 Build by loading a GDML file using VecGeom's (buggy) in-house loader.
 
static std::shared_ptr< VecgeomParamsfrom_geant (std::shared_ptr< GeantGeoParams const > const &geo)
 Build from a Geant4 geometry.
 

Additional Inherited Members

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

Detailed Description

Shared model parameters for a VecGeom geometry.

The model defines the shapes, volumes, etc.

Member Function Documentation

◆ bbox()

BBox const & celeritas::VecgeomParams::bbox ( ) const
inlinefinalvirtual

Outer bounding box of geometry.

Implements celeritas::GeoParamsInterface.

◆ device_ref()

DeviceRef const & celeritas::VecgeomParams::device_ref ( ) const
inlinefinalvirtual

Access geometry data on device.

Implements celeritas::ParamsDataInterface< VecgeomParamsData >.

◆ find_volume() [1/2]

ImplVolumeId celeritas::VecgeomParams::find_volume ( G4LogicalVolume const volume) const
finalvirtual

Locate the volume ID corresponding to a Geant4 logical volume.

Implements celeritas::GeoParamsInterface.

◆ find_volume() [2/2]

virtual ImplVolumeId celeritas::GeoParamsInterface::find_volume ( G4LogicalVolume const volume) const
virtual

Get the volume ID corresponding to a Geant4 logical volume.

Implements celeritas::GeoParamsInterface.

◆ from_gdml_g4()

std::shared_ptr< VecgeomParams > celeritas::VecgeomParams::from_gdml_g4 ( std::string const filename)
static

Build by loading a GDML file using Geant4.

This mode is incompatible with having an existing run manager. It will clear the geometry once complete.

◆ host_ref()

HostRef const & celeritas::VecgeomParams::host_ref ( ) const
inlinefinalvirtual

Access geometry data on host.

Implements celeritas::ParamsDataInterface< VecgeomParamsData >.

◆ id_to_geant()

GeantPhysicalInstance celeritas::VecgeomParams::id_to_geant ( VolumeInstanceId  id) const
finalvirtual

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

Warning
This will not correctly yield replica/copy numbers.
Todo:
This will be removed soon! Also fix missing use of CopyNo in VecgeomParams::VecgeomParams .

Implements celeritas::GeoParamsInterface.

◆ impl_volume_instances()

auto celeritas::VecgeomParams::impl_volume_instances ( ) const
inline

Get volume instance metadata.

Volume instances correspond directly to Geant4 physical volumes.

◆ impl_volumes()

auto celeritas::VecgeomParams::impl_volumes ( ) const
inlinefinalvirtual

Get volume metadata.

Implements celeritas::GeoParamsInterface.

◆ make_model_input()

inp::Model celeritas::VecgeomParams::make_model_input ( ) const
finalvirtual

Create model parameters corresponding to our internal representation.

Currently this creates a one-to-one mapping for use when constructed from VGDML rather than Geant4.

Implements celeritas::GeoParamsInterface.

◆ max_depth()

LevelId::size_type celeritas::VecgeomParams::max_depth ( ) const
inline

Maximum nested geometry depth.

Todo:
Only use in VolumeParams

◆ supports_safety()

bool celeritas::VecgeomParams::supports_safety ( ) const
inlinefinalvirtual

Whether safety distance calculations are accurate and precise.

Implements celeritas::GeoParamsInterface.

◆ volume_id()

VolumeId celeritas::VecgeomParams::volume_id ( ImplVolumeId  iv_id) const
inlinefinalvirtual

Get the canonical volume IDs corresponding to an implementation volume.

Note
See make_inp_volumes : for now, volume IDs and impl IDs are identical

Implements celeritas::GeoParamsInterface.


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