Celeritas 0.6.0-47+develop.b3cbb238
Loading...
Searching...
No Matches
Classes | Functions
GeantGeoParams.hh File Reference
#include <memory>
#include <string>
#include "corecel/Macros.hh"
#include "corecel/data/ParamsDataInterface.hh"
#include "BoundingBox.hh"
#include "GeoParamsInterface.hh"
#include "ScopedGeantExceptionHandler.hh"
#include "ScopedGeantLogger.hh"
#include "Types.hh"
#include "g4/GeantGeoData.hh"
This graph shows which files directly or indirectly include this file:

Classes

class  celeritas::GeantGeoParams
 Shared Geant4 geometry model wrapper. More...
 

Functions

void celeritas::geant_geo (GeantGeoParams const &gp)
 Set global geometry instance.
 
GeantGeoParams constceleritas::geant_geo ()
 Access the global geometry instance.
 

Function Documentation

◆ geant_geo() [1/2]

GeantGeoParams const * celeritas::geant_geo ( )

Access the global geometry instance.

This should be used by Geant4 geometry-related helper functions throughout the code base. Make sure to check the result is not null! Do not save a pointer to it either.

Returns
Reference to the global Geant4 wrapper, or nullptr if not set.

◆ geant_geo() [2/2]

void celeritas::geant_geo ( GeantGeoParams 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 is not thread safe; it should be done only during setup on the main thread.