Celeritas 0.7.0-dev.79+develop.b3dc2e108
Loading...
Searching...
No Matches
Public Member Functions | List of all members
celeritas::VolumeIdBuilder Class Reference

Map a string or Geant4 volume pointer to a volume ID. More...

#include <VolumeIdBuilder.hh>

Public Types

Type aliases
using G4LV = G4LogicalVolume
 

Public Member Functions

 VolumeIdBuilder ()
 Construct from global geometry.
 
 VolumeIdBuilder (VolumeParams const *, GeantGeoParams const *)
 Construct using geant4 params and/or volume params.
 
VolumeId operator() (std::string const &s) const
 Map from a string using VolumeParams.
 
VolumeId operator() (Label const &lab) const
 Map from a label using VolumeParams.
 
VolumeId operator() (G4LogicalVolume const *lv) const
 Map from Geant4 volume pointer using geant_geo.
 

Detailed Description

Map a string or Geant4 volume pointer to a volume ID.

This std::visit -compatible class will convert input types to a canonical volume ID depending on what metadata (constructed Geant4 geometry, volume parameters) are available. A "null" ID can be returned (and warning/error message emitted) if the mapping fails.

This helper class should only have temporary scope.

Constructor & Destructor Documentation

◆ VolumeIdBuilder()

celeritas::VolumeIdBuilder::VolumeIdBuilder ( VolumeParams const v,
GeantGeoParams const gg 
)
inline

Construct using geant4 params and/or volume params.

If both are null, this class will be nonfunctional.


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