Celeritas
0.5.0-86+4a8eea4
|
Navigate through a Geant4 geometry on a single thread. More...
#include <GeantGeoTrackView.hh>
Classes | |
struct | DetailedInitializer |
Helper struct for initializing from an existing geometry state. More... | |
Public Types | |
Type aliases | |
using | Initializer_t = GeoTrackInitializer |
using | ParamsRef = NativeCRef< GeantGeoParamsData > |
using | StateRef = NativeRef< GeantGeoStateData > |
using | real_type = double |
using | Real3 = Array< real_type, 3 > |
Public Member Functions | |
GeantGeoTrackView (ParamsRef const ¶ms, StateRef const &state, TrackSlotId tid) | |
Construct from params and state data. | |
GeantGeoTrackView & | operator= (Initializer_t const &init) |
Construct the state. | |
GeantGeoTrackView & | operator= (DetailedInitializer const &init) |
Construct the state from a direction and a copy of the parent state. More... | |
VolumeId | volume_id () const |
Get the volume ID in the current cell. | |
VolumeInstanceId | volume_instance_id () const |
Get the physical volume ID in the current cell. | |
LevelId | level () const |
Get the depth in the geometry hierarchy. | |
void | volume_instance_id (Span< VolumeInstanceId > levels) const |
Get the volume instance ID at every level. More... | |
bool | is_outside () const |
Whether the track is outside the valid geometry region. | |
bool | is_on_boundary () const |
Whether the track is on the boundary of a volume. | |
CELER_FORCEINLINE bool | failed () const |
Whether the last operation resulted in an error. | |
Propagation | find_next_step () |
Find the distance to the next geometric boundary. | |
Propagation | find_next_step (real_type max_step) |
Find the distance to the next geometric boundary. More... | |
real_type | find_safety () |
Find the safety at the current position. | |
CELER_FUNCTION real_type | find_safety (real_type max_step) |
Find the safety at the current position. More... | |
void | move_to_boundary () |
Move to the next boundary but don't cross yet. | |
void | move_internal (real_type step) |
Move within the current volume. More... | |
void | move_internal (Real3 const &pos) |
Move within the current volume to a nearby point. More... | |
void | cross_boundary () |
Cross from one side of the current surface to the other. More... | |
void | set_dir (Real3 const &newdir) |
Change the track's direction. More... | |
CELER_FORCEINLINE Real3 const & | pos () const |
CELER_FORCEINLINE Real3 const & | dir () const |
SurfaceId | surface_id () const |
SurfaceId | next_surface_id () const |
Static Public Member Functions | |
static constexpr real_type | extra_push () |
A tiny push to make sure tracks do not get stuck at boundaries. | |
Navigate through a Geant4 geometry on a single thread.
This wraps a Geant4 geometry navigator and volume hierarchy state with the same Celeritas tracker interface. It's not going to be the most efficient code since the G4Navigator
includes a lot of helper functions for managing safety distance, tracking through a field, etc. We also independently store a "celeritas" native position and direction, as well as duplicating the "geant4" position and direction that are also stored under the hood in the heavyweight navigator.
For a description of ordering requirements, see:
|
inline |
Cross from one side of the current surface to the other.
The position must be on the boundary following a move-to-boundary.
|
inline |
State accessors
|
inline |
Find the distance to the next geometric boundary.
It seems that ComputeStep cannot be called twice in a row without an intermediate call to LocateGlobalPointWithinVolume:
the safety will be set to zero.
|
inline |
Find the safety at the current position.
|
inline |
Move within the current volume to a nearby point.
See G4PathFinder::ReLocate
from G4SafetyHelper::ReLocateWithinVolume
from G4VMultipleScattering::AlongStepDoIt
.
|
inline |
Move within the current volume.
The straight-line distance must be less than the distance to the boundary.
|
inline |
VecGeom states are never "on" a surface
|
inline |
Construct the state from a direction and a copy of the parent state.
G4Track::SetTouchableHandle
from G4VEmProcess::PostStepDoIt
maybe see G4SteppingManager::Stepping
|
inline |
State accessors
|
inline |
Change the track's direction.
This happens after a scattering event or movement inside a magnetic field. It resets the calculated distance-to-boundary.
|
inline |
VecGeom states are never "on" a surface
|
inline |
Get the volume instance ID at every level.
The input span size must be equal to the value of "level" plus one. The top-most level ("world" or level zero) starts at index zero and moves downward. Note that Geant4 uses the reverse nomenclature.