Celeritas 0.7.0-dev.79+develop.b3dc2e108
Loading...
Searching...
No Matches
Functions
GeantGeoUtils.cc File Reference
#include "GeantGeoUtils.hh"
#include <algorithm>
#include <iostream>
#include <string>
#include <unordered_set>
#include <G4Element.hh>
#include <G4FieldManager.hh>
#include <G4Isotope.hh>
#include <G4LogicalBorderSurface.hh>
#include <G4LogicalSkinSurface.hh>
#include <G4LogicalVolume.hh>
#include <G4LogicalVolumeStore.hh>
#include <G4Material.hh>
#include <G4NavigationHistory.hh>
#include <G4PhysicalVolumeStore.hh>
#include <G4ReflectionFactory.hh>
#include <G4RegionStore.hh>
#include <G4SolidStore.hh>
#include <G4Threading.hh>
#include <G4TouchableHistory.hh>
#include <G4TransportationManager.hh>
#include <G4VPhysicalVolume.hh>
#include <G4Version.hh>
#include <G4ios.hh>
#include "corecel/Assert.hh"
#include "corecel/cont/Range.hh"
#include "corecel/io/Join.hh"
#include "corecel/io/Logger.hh"
#include "corecel/io/ScopedStreamRedirect.hh"
#include "orange/g4org/Converter.hh"

Functions

std::ostream & celeritas::operator<< (std::ostream &os, PrintableNavHistory const &pnh)
 Print detailed information about the touchable history.
 
std::ostream & celeritas::operator<< (std::ostream &os, PrintableLV const &plv)
 Print the logical volume name, ID, and address.
 
void celeritas::reset_geant_geometry ()
 Reset all Geant4 geometry stores if not using RunManager.
 
Span< G4LogicalVolume * > celeritas::geant_logical_volumes ()
 Get a view to the Geant4 LV store.
 
G4VPhysicalVolume constceleritas::geant_world_volume ()
 Get the world volume for the primary geometry.
 
G4Field constceleritas::geant_field ()
 Get an optional global magnetic field for the tracking geometry.
 
std::unordered_set< G4LogicalVolume const * > celeritas::find_geant_volumes (std::unordered_set< std::string > names)
 Find Geant4 logical volumes corresponding to a list of names.
 

Function Documentation

◆ find_geant_volumes()

std::unordered_set< G4LogicalVolume const * > celeritas::find_geant_volumes ( std::unordered_set< std::string >  names)
inline

Find Geant4 logical volumes corresponding to a list of names.

If logical volumes with duplicate names are present, they will all show up in the output and a warning will be emitted. If one is missing, a RuntimeError will be raised.

static std::string_view const labels[] = {"Vol1", "Vol2"};
auto vols = find_geant_volumes(make_span(labels));

◆ geant_field()

G4Field const * celeritas::geant_field ( )

Get an optional global magnetic field for the tracking geometry.

Returns
Field if geometry has been initialized and field exists, nullptr otherwise.

◆ geant_logical_volumes()

Span< G4LogicalVolume * > celeritas::geant_logical_volumes ( )
inline

Get a view to the Geant4 LV store.

This includes all volumes, potentially null ones as well.

◆ geant_world_volume()

G4VPhysicalVolume const * celeritas::geant_world_volume ( )

Get the world volume for the primary geometry.

Returns
World volume if geometry has been initialized, nullptr otherwise.

◆ operator<<()

std::ostream & celeritas::operator<< ( std::ostream &  os,
PrintableNavHistory const pnh 
)
inline

Print detailed information about the touchable history.

For brevity, this does not print the world volume.

◆ reset_geant_geometry()

void celeritas::reset_geant_geometry ( )
inline

Reset all Geant4 geometry stores if not using RunManager.

Use this function if reading geometry and cleaning up without doing any transport in between (useful for geometry conversion testing).