|
Celeritas 0.7+cf8d83d
|
Navigate through a Geant4 geometry on a single thread. More...
#include <GeantGeoTrackView.hh>
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. | |
| GeoStatus | geo_status () const |
| Geometry tracking status. | |
| 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. | |
| bool | failed () const |
| Whether the last operation resulted in an error. | |
| Real3 const & | normal () const |
| Get the exit surface normal of the boundary the track has just crossed. | |
| 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. | |
Type aliases | |
| using | Initializer_t = GeoTrackInitializer |
| using | ParamsRef = NativeCRef< GeantGeoParamsData > |
| using | StateRef = NativeRef< GeantGeoStateData > |
| using | real_type = double |
| using | Real3 = Array< real_type, 3 > |
| Real3 const & | pos () const |
| Real3 const & | dir () const |
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.
Geant4 thinks about boundaries differently to Celeritas. When we find the next step, it will internally store the "blocking" volume (daughter="entering", current volume="exiting") and the normal at that point. The G4 navigation in practice has three options:
ComputeStep SetGeometricallyLimitedStep, and update the volume via LocateGlobalPointAndUpdateTouchableHandle LocateGlobalPointWithinVolume .State accessors
State accessors
State accessors
State accessors
State accessors
|
inline |
Cross from one side of the current surface to the other.
The position must be on the boundary following a move-to-boundary.
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 .
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.
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.