How luozf14/mdmsim works
MdmSim is a Geant4 ion-transport simulation: configuration and field maps initialize the detector and physics, events generate a beam and optionally react in a virtual target, then transport through the MDM fields to detector scoring and ROOT output. The README documents the detector stages, response models, and output branches; some wiring is inferred only where the supplied excerpts and explicit documentation support it.
Main entry points: EventAction.cc Event aggregation · MdmSim.cc MdmSim entry point · DetectorConstruction.cc Spectrometer geometry · ActionInitialization.cc Action initialization
Components 19
Run setup
- Run configuration
config/config.json - MdmSim entry point
MdmSim.cc - Action initialization
src/ActionInitialization.cc
Reaction and transport
- Spectrometer geometry
src/DetectorConstruction.cc - Beam generator
src/PrimaryGeneratorAction.cc - Reaction registration
src/ReactionPhysics.cc - Two-body reaction
src/ReactionProcess.cc - Geant4 field integration
src/MdmFieldMapMagneticField.cc - Map reader and interpolation
src/MdmFieldMap.cpp - Magnet field maps
Detector scoring
- Silicon scoring
src/SiDetectorSD.cc - PPAC scoring
src/PpacSD.cc - Tracking-plane scoring
src/TrackingPlaneSD.cc
Event results
- Event aggregation
src/EventAction.cc - Legacy RAYTRACE
src/MdmTrace.cc - ROOT analysis
src/Analysis.cc - Simulation ROOT file
Other components
- Simulation operator
- Geant4 run manager
Connections 24
- Simulation operator → MdmSim entry point: starts run
- Run configuration → MdmSim entry point: configures
- MdmSim entry point → Spectrometer geometry: sets up geometry
- MdmSim entry point → Action initialization: installs actions
- MdmSim entry point → Reaction registration: installs physics
- MdmSim entry point → Geant4 run manager: starts run
- Action initialization → Beam generator: registers
- Action initialization → Event aggregation: registers
- Reaction registration → Two-body reaction: registers process
- Beam generator → Geant4 run manager: generates ions
- Geant4 run manager → Two-body reaction: dispatches process
- Spectrometer geometry → Geant4 field integration: attaches fields
- Geant4 field integration → Map reader and interpolation: loads and samples
- Magnet field maps → Map reader and interpolation: map data
- Spectrometer geometry → Silicon scoring: attaches scorer
- Spectrometer geometry → PPAC scoring: attaches scorer
- Spectrometer geometry → Tracking-plane scoring: attaches scorer
- Geant4 run manager → Event aggregation: dispatches events
- Event aggregation → Silicon scoring: reads hit collections
- Event aggregation → PPAC scoring: reads hit collections
- Event aggregation → Tracking-plane scoring: reads hit collections
- Event aggregation → Legacy RAYTRACE: traces slit hits
- Event aggregation → ROOT analysis: sets event data
- ROOT analysis → Simulation ROOT file: writes trees