How jeffersonlab/g4sbs works
G4SBS is a Geant4 detector simulation whose principal workflow configures a run, generates physics events, transports particles through constructed geometry, and writes ROOT output. The repository also includes ROOT-based analysis and tree-reading tools, plus farm job generators. The graph emphasizes runtime stages and documented capabilities; several connections come from SOURCE INDEX references rather than complete excerpts, so unsampled details are not expanded.
Main entry points: G4SBSDetectorConstruction.cc Detector construction · g4sbs.cc Run application · src Run actions · G4SBSEventGen.cc Event generation
Components 16
Simulation runtime
- Run application
g4sbs.cc - Run actions
src
Physics and geometry
- Event generation
src/G4SBSEventGen.cc - CTEQ PDFs
src/cteq/cteqpdf.c - Wiser pion model
include/wiser_pion.h - Detector construction
src/G4SBSDetectorConstruction.cc - Target geometry
src/G4SBSTargetBuilder.cc - Beamline geometry
src/G4SBSBeamlineBuilder.cc - Electron arm
src/G4SBSEArmBuilder.cc - Hadron arm
src/G4SBSHArmBuilder.cc
Output and data
- ROOT output
src/G4SBSIO.cc
Analysis tools
- SIMC tree reader
include/simc_tree.h - Pythia tree reader
include/Pythia6_tree.h - Spin correlation analysis
root_macros/ElasticEP_Correlation_Analysis_withSpinTrans_julytest.C - Farm job generation
farmsub_scripts
Other components
- User
Connections 14
- User → Run application: runs
- Run application → Run actions: configures
g4sbs.cc - Run application → Detector construction: initializes
- Run actions → Event generation: generates events
- Event generation → CTEQ PDFs: uses PDFs
- Event generation → Wiser pion model: uses model
src/G4SBSEventGen.cc - Detector construction → Target geometry: builds geometry
src/G4SBSDetectorConstruction.cc - Detector construction → Beamline geometry: builds geometry
src/G4SBSDetectorConstruction.cc - Detector construction → Electron arm: builds geometry
src/G4SBSDetectorConstruction.cc - Detector construction → Hadron arm: builds geometry
src/G4SBSDetectorConstruction.cc - Run actions → ROOT output: writes output
- ROOT output → SIMC tree reader: ROOT data
- ROOT output → Pythia tree reader: ROOT data
- SIMC tree reader → Spin correlation analysis: analyzes data