How minmyatngwe/tempo_xrf_repo works
TEMPO XRF is a prototype workflow for configuring and running Geant4 X-ray fluorescence simulations, processing simulated detector output, and inspecting geometry and tracks in a browser. The documented user path runs from Streamlit configuration through the simulation launcher and Geant4 run, then into detector-response processing and visualization. The graph includes documented geometry, physics, source, and browser-debug capabilities; excerpts do not expose every frontend/backend handoff, so uncertain links are omitted.
Main entry points: sim.cpp Geant4 Entry · main.py Streamlit Navigation · simulation.py Run Controller · detectorConstruction.cpp World & Detector
Components 26
Configuration UI
- Streamlit Navigation
python_code/frontend/main.py - Geometry Inputs
python_code/frontend/views/geometry.py - Geometry Editors
python_code/frontend/helper/frontend_helper.py - X-ray Tube Setup
python_code/frontend/views/xray_tube.py - Physics Settings
python_code/frontend/views/physics_engine.py - Physics Config State
python_code/frontend/views/physics_state.py - Run Controller
python_code/frontend/views/simulation.py
Geant4 Simulation
- Simulation Config
include/simulationConfig.hh - Geant4 Entry
sim.cpp - Runtime Commands
src/simulationMessenger.cpp - World & Detector
src/detectorConstruction.cpp - Photon Generator
src/primaryGenerator.cpp - XRF Physics
src/physicsList.cpp - Run Actions
src/actionInitialization.cpp - Detector Scoring
src/sensitiveDetector.cpp - Geometry Export
src/geometryExporter.cpp - Track Export
src/browserTrackExporter.cpp
Detector Analysis
- Simulation ROOT Output
- Detector Response
python_code/frontend/detector_noise/pipeline.py - Results & Noise UI
python_code/frontend/views/result_and_detector_noise.py - X-ray Spectrum Tool
python_code/frontend/helper/xray_tube.py
Browser Debugging
- Three.js Viewer
python_code/vis/main.js - Geometry JSON
python_code/vis/public/xrf_geometry_vis.json - Tracks JSON
python_code/vis/public/xrf_tracks.json
Other components
- Researcher
- Geant4 Runtime
Connections 28
- Researcher → Streamlit Navigation: configures
- Streamlit Navigation → Geometry Inputs: opens
- Streamlit Navigation → X-ray Tube Setup: opens
- Streamlit Navigation → Physics Settings: opens
- Streamlit Navigation → Run Controller: opens
- Streamlit Navigation → Results & Noise UI: opens
- Geometry Inputs → Geometry Editors: uses editors
- Physics Settings → Physics Config State: builds settings
- Run Controller → Geant4 Entry: launches
- Run Controller → X-ray Spectrum Tool: generates spectrum
- Geant4 Entry → Simulation Config: loads JSON
- Geant4 Entry → Runtime Commands: initializes
- Geant4 Entry → World & Detector: registers
- Geant4 Entry → XRF Physics: registers
- Geant4 Entry → Run Actions: registers
- Geant4 Entry → Geant4 Runtime: starts run
- World & Detector → Detector Scoring: attaches detector
- World & Detector → Geometry Export: exports geometry
- Run Actions → Track Export: configures
- Geant4 Runtime → Simulation ROOT Output: writes results
- Geant4 Runtime → Geometry JSON: exports geometry
- Geant4 Runtime → Tracks JSON: exports tracks
- Results & Noise UI → Detector Response: runs processing
- Detector Response → Simulation ROOT Output: reads ROOT
- Detector Response → X-ray Spectrum Tool: uses fluence
- Three.js Viewer → Geometry JSON: loads geometry
- Three.js Viewer → Tracks JSON: loads tracks
- Researcher → Three.js Viewer: inspects