Geiger-Marsden Experiment Simulation using Geant4 and ROOT
- C++ 97.5%
- CMake 2.5%
| include | ||
| src | ||
| .gitignore | ||
| CMakeLists.txt | ||
| main.cpp | ||
| README.md | ||
| run.mac | ||
| run_test.mac | ||
Geiger-Marsden Experiment Simulation
卢瑟福α粒子散射实验模拟
Usage
-
Load runtime and packages
source "$(spack location -i geant4)/bin/geant4.sh" spack load cmake geant4 root -
Configure and compile
mkdir -p build && cd build cmake .. cmake --build . -j4 -
Run with command-line parameters
./build/rutherford \ --threads 1 \ --foil-thickness-um 4 \ --particle-energy-mev 5.486 \ --events 100000 \ --outdir results \ --tag testA -
Run with macro file
./build/rutherford --macro run.mac --outdir results --tag macroA -
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,--eventsare ignored. - Use
--no-plotto skip generating PNG and only keep ROOT data. - In macro files, set primary alpha energy by
/generator/energy <value> MeVafter/run/initialize.