This project builds a minimal Geant4 application for single-muon energy deposition in liquid argon and writes sparse voxelized output to a ROOT file.
- Active volume: liquid argon sphere with radius
20 m - World volume: vacuum box large enough to contain the active volume
- The whole liquid-argon sphere is treated as active
- Particle:
mu- - One particle per event
- Kinetic energy sampled uniformly in
[0.1, 10] GeV - Initial position: origin
- Initial direction: isotropic
- Hadronic physics list:
QGSP_BERT - Electromagnetic physics:
G4EmStandardPhysics
Energy deposition is taken from Geant4 step energy loss:
G4Step::GetTotalEnergyDeposit()- Only steps inside the active liquid-argon volume are counted
- Deposited energy is accumulated into
5 mmcubes - Cubes are stored sparsely, so only cubes with nonzero deposited energy are written
The voxel coordinate written to output is the cube center in mm.
In addition to edep, the code derives scintillation photons and surviving ionization electrons from deposited energy using a simple parameterized liquid-argon model.
Constants used:
W = 23.6 eV- Exciton-to-ion ratio
alpha = 0.21 - Recombination fraction
r = 0.5
Per voxel:
Nq = Edep / WNi = Nq / (1 + alpha)Nex = Nq - NiNphot = Nex + r * NiNelec = (1 - r) * Ni
This is a simple yield model only. It is not a field-dependent recombination model and does not simulate optical photon transport or electron drift.
Default output file:
lar_muon_voxels.root
ROOT tree:
events
Branches:
eventpx_MeVpy_MeVpz_MeVcube_x_mmcube_y_mmcube_z_mmedep_MeVn_scint_photonsn_ionization_electrons
Each tree entry corresponds to one event. The vector branches are aligned element-by-element per nonzero voxel.
Requirements:
- Geant4
- ROOT
- CMake
- C++17 compiler
Build commands:
cmake -S . -B build
cmake --build build -j 4Run the default macro:
./build/lar_muon_voxels run.macIf no macro is provided, the executable runs run.mac by default.