ORANGE#
The ORANGE (Oak Ridge Advanced Nested Geometry Engine) package is currently under development as the version in SCALE is ported to GPU.
-
class OrangeParams : public celeritas::GeoParamsSurfaceInterface, public celeritas::ParamsDataInterface<OrangeParamsData>#
Persistent model data for an ORANGE geometry.
This class initializes and manages the data used by ORANGE (surfaces, volumes) and provides a host-based interface for them.
Public Functions
-
explicit OrangeParams(std::string const &json_filename)#
Construct from a JSON file (if JSON is enabled).
The JSON format is defined by the SCALE ORANGE exporter (not currently distributed).
-
explicit OrangeParams(G4VPhysicalVolume const*)#
Construct in-memory from a Geant4 geometry (not implemented).
Perhaps someday we’ll implement in-memory translation…
-
explicit OrangeParams(OrangeInput input)#
Advanced usage: construct from explicit host data.
Volume and surface labels must be unique for the time being.
-
inline virtual bool supports_safety() const final#
Whether safety distance calculations are accurate and precise.
-
inline virtual BBox const &bbox() const final#
Outer bounding box of geometry.
-
inline virtual VolumeId::size_type num_volumes() const final#
Number of volumes.
-
virtual Label const &id_to_label(VolumeId vol_id) const final#
Get the label of a volume.
-
virtual VolumeId find_volume(std::string const &name) const final#
Locate the volume ID corresponding to a unique name.
If the name isn’t in the geometry, a null ID will be returned. If the name is not unique, a RuntimeError will be raised.
-
virtual VolumeId find_volume(Label const &label) const final#
Locate the volume ID corresponding to a label.
If the label isn’t in the geometry, a null ID will be returned.
-
inline virtual VolumeId find_volume(G4LogicalVolume const *volume) const final#
Locate the volume ID corresponding to a Geant4 volume.
TODO: To be properly implemented, as it requires a future Geant4 converter.
-
virtual SpanConstVolumeId find_volumes(std::string const &name) const final#
Get zero or more volume IDs corresponding to a name.
This is useful for volumes that are repeated in the geometry with different uniquifying ‘extensions’.
-
virtual Label const &id_to_label(SurfaceId surf_id) const final#
Get the label of a surface.
-
virtual SurfaceId find_surface(std::string const &name) const final#
Locate the surface ID corresponding to a label name.
-
inline virtual SurfaceId::size_type num_surfaces() const final#
Number of surfaces.
-
Label const &id_to_label(UniverseId surf_id) const#
Get the label of a universe.
-
UniverseId find_universe(std::string const &name) const#
Locate the universe ID corresponding to a label name.
-
inline UniverseId::size_type num_universes() const#
Number of universes.
-
explicit OrangeParams(std::string const &json_filename)#
-
class OrangeTrackView#
Navigate through an ORANGE geometry on a single thread.
Ordering requirements:
initialize (through assignment) must come first
access (pos, dir, volume/surface/is_outside/is_on_boundary) good at any time
find_next_step
find_safety
ormove_internal
ormove_to_boundary
if on boundary,
cross_boundary
at any time,
set_dir
, but then must dofind_next_step
before anymove
orcross
action above
The main point is that
find_next_step
depends on the current straight-line direction,move_to_boundary
andmove_internal
(with a step length) depends on that distance, andcross_boundary
depends on being on the boundary with a knowledge of the post-boundary state.move_internal
with a position should depend on the safety distance but that’s not yet implemented.Public Functions
-
inline OrangeTrackView(ParamsRef const ¶ms, StateRef const &states, TrackSlotId tid)#
Construct from persistent and state data.
-
inline OrangeTrackView &operator=(Initializer_t const &init)#
Construct the state.
Expensive. This function should only be called to initialize an event from a starting location and direction. Secondaries will initialize their states from a copy of the parent.
-
inline OrangeTrackView &operator=(DetailedInitializer const &init)#
Construct the state from a direction and a copy of the parent state.
-
inline Real3 const &pos() const#
The current position.
-
inline Real3 const &dir() const#
The current direction.
-
inline VolumeId volume_id() const#
The current volume ID.
Note
It is allowable to call this function when “outside”, because the outside in ORANGE is just a special volume. Other geometries may not have that behavior.
-
inline SurfaceId surface_id() const#
The current surface ID.
-
inline SurfaceId next_surface_id() const#
After ‘find_next_step’, the next straight-line surface.
-
inline bool is_outside() const#
Whether the track is outside the valid geometry region.
-
inline bool is_on_boundary() const#
Whether the track is exactly on a surface.
-
inline Propagation find_next_step()#
Find the distance to the next geometric boundary.
-
inline Propagation find_next_step(real_type max_step)#
Find a nearby distance to the next geometric boundary up to a distance.
This may reduce the number of surfaces needed to check, sort, or write to temporary memory, thereby speeding up transport.
-
inline real_type find_safety(real_type max_step)#
Find the distance to the nearest nearby boundary.
Since we currently support only “simple” safety distances, we can’t eliminate anything by checking only nearby surfaces.
-
inline void move_to_boundary()#
Move to the next straight-line boundary but do not change volume.
-
inline void move_internal(real_type step)#
Move within the current volume.
The straight-line distance must be less than the distance to the boundary.
-
inline void move_internal(Real3 const &pos)#
Move within the current volume to a nearby point.
- Todo:
Currently it’s up to the caller to make sure that the position is “nearby”. We should actually test this with an “is inside” call.
-
inline void cross_boundary()#
Cross from one side of the current surface to the other.
The position must be on the boundary following a move-to-boundary. This should only be called once per boundary crossing.
-
inline void set_dir(Real3 const &newdir)#
Change the track’s direction.
This happens after a scattering event or movement inside a magnetic field. It resets the calculated distance-to-boundary. It is allowed to happen on the boundary, but changing direction so that it goes from pointing outward to inward (or vice versa) will mean that
cross_boundary
will be a null-op.TODO: This needs to be updated to handle reflections through levels
-
struct DetailedInitializer#
Helper struct for initializing from an existing geometry state.