Celeritas 0.6.0-91+develop.2f018e72
Loading...
Searching...
No Matches
Functions
GeantGeoParams.cc File Reference
#include "GeantGeoParams.hh"
#include <map>
#include <unordered_map>
#include <vector>
#include <G4GeometryManager.hh>
#include <G4LogicalBorderSurface.hh>
#include <G4LogicalSkinSurface.hh>
#include <G4LogicalVolume.hh>
#include <G4LogicalVolumeStore.hh>
#include <G4Material.hh>
#include <G4PhysicalVolumeStore.hh>
#include <G4Transportation.hh>
#include <G4TransportationManager.hh>
#include <G4VPhysicalVolume.hh>
#include <G4VSolid.hh>
#include <G4Version.hh>
#include <G4VisExtent.hh>
#include "corecel/Assert.hh"
#include "geocel/inp/Model.hh"
#include "corecel/Config.hh"
#include "corecel/cont/Range.hh"
#include "corecel/io/Logger.hh"
#include "corecel/io/StringUtils.hh"
#include "corecel/sys/Device.hh"
#include "corecel/sys/ScopedMem.hh"
#include "GeantGdmlLoader.hh"
#include "GeantGeoUtils.hh"
#include "GeantUtils.hh"
#include "ScopedGeantExceptionHandler.hh"
#include "ScopedGeantLogger.hh"
#include "g4/Convert.hh"
#include "g4/GeantGeoData.hh"
#include "g4/VisitVolumes.hh"
#include "detail/MakeLabelVector.hh"

Functions

void celeritas::geant_geo (std::shared_ptr< GeantGeoParams const > const &gp)
 Set global geometry instance.
 
std::weak_ptr< GeantGeoParams const > constceleritas::geant_geo ()
 Access the global geometry instance.
 

Function Documentation

◆ geant_geo() [1/2]

std::weak_ptr< GeantGeoParams const > const & celeritas::geant_geo ( )

Access the global geometry instance.

This can be used by Geant4 geometry-related helper functions throughout the code base.

Returns
Weak pointer to the global Geant4 wrapper, which may be null.

◆ geant_geo() [2/2]

void celeritas::geant_geo ( std::shared_ptr< GeantGeoParams const > const gp)

Set global geometry instance.

This allows many parts of the codebase to independently access Geant4 metadata. It should be called during initialization of any Celeritas front end that integrates with Geant4. We can't use shared pointers here because of global initialization order issues (the low-level Geant4 objects may be cleared before a static celeritas::GeantGeoParams is destroyed).

Note
This should be done only during setup on the main thread.