|
Celeritas 0.7.0-dev.172+develop.fe2a0acd4
|
Navigate through a Geant4 geometry on a single thread. More...
#include <GeantGeoTrackView.hh>
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. | |
| VolumeId | volume_id () const |
| Get the canonical volume ID in the current implementation volume. | |
| VolumeInstanceId | volume_instance_id () const |
| Get the physical volume ID in the current cell. | |
| VolumeLevelId | volume_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. | |
| ImplVolumeId | impl_volume_id () const |
| Get the volume ID in the current cell. | |
| 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. | |
| Real3 | normal () const |
| Get the exit surface normal of the boundary the track has just crossed. | |
| 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. | |
| real_type | find_safety () |
| Find the safety at the current position. | |
| real_type | find_safety (real_type max_step) |
| Find the safety at the current position. | |
| 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. | |
| void | move_internal (Real3 const &pos) |
| Move within the current volume to a nearby point. | |
| void | cross_boundary () |
| Cross from one side of the current surface to the other. | |
| void | set_dir (Real3 const &newdir) |
| Change the track's direction. | |
| G4NavigationHistory const * | nav_history () const |
| Get the navigation state. | |
| CELER_FORCEINLINE Real3 const & | pos () const |
| CELER_FORCEINLINE Real3 const & | dir () 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. Two consecutive "cross boundary" calls are NOT ALLOWED!
|
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.
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 |
Get the exit surface normal of the boundary the track has just crossed.
This vector is in the global coordinate system.
|
inline |
State accessors
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 |
Get the canonical volume ID in the current implementation volume.
|
inline |
Get the volume instance ID at every level.
The input span size must be equal to the value of "volume_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.