How fred-sheppard/detray works
Detray is a header-only, GPU-friendly detector-description and track-propagation library. A client builds or loads a flat detector model, supplies track parameters, and invokes propagation. Navigation queries detector volumes and acceleration structures; a stepper advances the track through magnetic field and material, while actors update parameters, covariance, and trajectories. Separate capabilities provide JSON I/O, detector validation, SVG visualization, configurable algebra backends, and generated Jacobian code. Several implementation relationships are inferred from documented responsibilities because only selected source excerpts were sampled.
Components 23
Detector Construction
- Detector Builders
core/include/detray/builders/detector_builder.hpp - Flat Detector Model
core/include/detray/core/detector.hpp - Tracking Volumes
core/include/detray/geometry/tracking_volume.hpp - Material Model
core/include/detray/material/material_map.hpp
Geometry Navigation
- Navigator
core/include/detray/navigation/navigator.hpp - Navigation State
core/include/detray/navigation/navigation_state.hpp - Search Accelerators
core/include/detray/navigation/accelerators/spatial_grid.hpp
Track Propagation
- Track Parameters
core/include/detray/tracks/tracks.hpp - Propagator
core/include/detray/propagator/propagator.hpp - Runge Kutta Stepper
core/include/detray/propagator/rk_stepper.hpp - Propagation Actors
core/include/detray/propagator/actor_chain.hpp - Covariance Transport
core/include/detray/propagator/actors/codegen/covariance_transport.hpp - Jacobian Engine
core/include/detray/propagator/detail/jacobian_engine.hpp - Trajectory Results
core/include/detray/tracks/trajectories.hpp
I/O and Tools
- Detector Reader
io/include/detray/io/frontend/detector_reader.hpp - Detector Writer
io/include/detray/io/frontend/detector_writer.hpp - Consistency Checker
core/include/detray/utils/consistency_checker.hpp - SVG Illustrator
plugins/svgtools/include/detray/plugins/svgtools/illustrator.hpp
Backends and Generation
- Algebra Backends
core/include/detray/definitions/algebra.hpp - Metadata Generator
python/detray/detectors/impl/metadata_generator.py - Symbolic Code Generation
codegen/detray-sympy/detray_sympy/codegen.py
Other components
- Client Application
- Magnetic Field
Connections 30
- Client Application → Detector Builders: builds
- Detector Builders → Flat Detector Model: creates
- Flat Detector Model → Tracking Volumes: exposes
- Client Application → Detector Reader: loads
- Detector Reader → Flat Detector Model: populates
- Client Application → Track Parameters: supplies
- Client Application → Propagator: runs
- Propagator → Navigator: navigates
- Navigator → Flat Detector Model: reads geometry
- Navigator → Navigation State: updates
- Navigator → Search Accelerators: queries
- Propagator → Runge Kutta Stepper: advances
- Runge Kutta Stepper → Magnetic Field: samples
- Runge Kutta Stepper → Material Model: reads material
- Propagator → Propagation Actors: dispatches
- Propagation Actors → Covariance Transport: runs
- Covariance Transport → Jacobian Engine: uses
- Propagation Actors → Trajectory Results: records
- Propagator → Trajectory Results: returns
- Client Application → Detector Writer: saves
- Detector Writer → Flat Detector Model: reads
- Client Application → Consistency Checker: validates
- Consistency Checker → Flat Detector Model: checks
- Client Application → SVG Illustrator: renders
- SVG Illustrator → Flat Detector Model: reads
- Client Application → Algebra Backends: selects
- Client Application → Metadata Generator: configures
- Metadata Generator → Flat Detector Model: generates types
- Client Application → Symbolic Code Generation: generates
- Symbolic Code Generation → Jacobian Engine: emits code