Geiger-Marsden Experiment Simulation using Geant4 and ROOT
  • C++ 97.5%
  • CMake 2.5%
Find a file
2026-04-20 16:04:31 +08:00
include Add particle energy configuration 2026-04-20 15:54:58 +08:00
src Clarify alpha energy configuration 2026-04-20 16:04:31 +08:00
.gitignore basic simulation 2026-04-09 12:18:40 +08:00
CMakeLists.txt basic simulation 2026-04-09 12:18:40 +08:00
main.cpp basic simulation 2026-04-09 12:18:40 +08:00
README.md Clarify alpha energy configuration 2026-04-20 16:04:31 +08:00
run.mac Clarify alpha energy configuration 2026-04-20 16:04:31 +08:00
run_test.mac Clarify alpha energy configuration 2026-04-20 16:04:31 +08:00

Geiger-Marsden Experiment Simulation

卢瑟福α粒子散射实验模拟

Usage

  1. Load runtime and packages

    source "$(spack location -i geant4)/bin/geant4.sh"
    spack load cmake geant4 root
    
    
  2. Configure and compile

    mkdir -p build && cd build
    cmake ..
    cmake --build . -j4
    
  3. Run with command-line parameters

    ./build/rutherford \
      --threads 1 \
      --foil-thickness-um 4 \
      --particle-energy-mev 5.486 \
      --events 100000 \
      --outdir results \
      --tag testA
    
  4. Run with macro file

    ./build/rutherford --macro run.mac --outdir results --tag macroA
    
  5. Legacy positional macro mode (equivalent to --macro)

    ./build/rutherford run.mac --outdir results
    

Output Naming

  • Command-line mode:

    Rutherford_th{threads}_foil{thickness}um_e{energy}MeV_n{events}_{tag}.root

  • Macro mode:

    Rutherford_macro_{macroName}_{tag}.root

  • Plot image uses the same suffix with prefix rutherford_scattering_.

All outputs are written to --outdir.

Notes

  • In macro mode, --threads, --foil-thickness-um, --particle-energy-mev, --events are ignored.
  • Use --no-plot to skip generating PNG and only keep ROOT data.
  • In macro files, set primary alpha energy by /generator/energy <value> MeV after /run/initialize.