Geant4 simulations of xenon-based detectors
You can find this package at https://github.com/l-althueser/XeSim and check out the most recent version with:
git clone https://github.com/l-althueser/XeSim.git
Ensure ROOT (version 6) and GEANT4 (tested with G4.10.3.3) are properly setup.
Then to compile, run:
make clean
make -j # "-j" for parallel compilation using all available CPU
You can run the code with the following command
$G4WORKDIR/bin/Linux-g++/XeSim -d <detector> -p <preinit file>
-c <detector setup file> -f <run macro file> -o <output .root file>
-n <Nb of generated events>
where -d
, -p
, -f
and -n
arguments are required for the simulation to run without errors. The optional parameters -v
and -i
trigger the visualization and interactive modes.
Available detectors:
- "template": a simple detector with a volume and a single PMT
- "muensterTPC": a version of the TPC in the XENON/LowRad setup at the University of Münster
- some smaller detectors
interactive
$G4WORKDIR/bin/Linux-g++/XeSim -d template -p ./macros/template/preinit.mac -c ./macros/template/det_setup.mac -f ./macros/template/src_optPhot.mac -i
VRML generation
$G4WORKDIR/bin/Linux-g++/XeSim -d template -p ./macros/template/preinit.mac -c ./macros/template/det_setup.mac -f ./macros/template/src_geantino.mac -n 1 -v
optical photons
$G4WORKDIR/bin/Linux-g++/XeSim -d muensterTPC -p ./macros/muensterTPC/preinit.mac -c ./macros/muensterTPC/det_setup.mac -f ./macros/muensterTPC/src_optPhot_DP_S1.mac -o test_optphot.root -n 100000
interactive
$G4WORKDIR/bin/Linux-g++/XeSim -d muensterTPC -p ./macros/muensterTPC/preinit.mac -c ./macros/muensterTPC/det_setup.mac -i
VRML generation
$G4WORKDIR/bin/Linux-g++/XeSim -d muensterTPC -p ./macros/muensterTPC/preinit.mac -c ./macros/muensterTPC/det_setup.mac -f ./macros/muensterTPC/src_geantino.mac -n 1 -v
You can simply view the generated simulation data with any version of ROOT. Just type ..
root
new TBrowser
.. and navigate to the generated events.root
file. Now you can do the normal click and drag routine of ROOT.
The output file has an specific file format which is described in the following.
Name | type | description |
---|---|---|
G4VERSION | TName | version of geant4 |
MC_TAG | TName | name of the simulation toolkit (e.g. "template") |
Name | type | description |
---|---|---|
nbevents | TParameter | number of simulated events |
Name | type | description |
---|---|---|
eventid | int | event number |
nphotodethits | int | total number of hits for all photo detectors |
photodethits | int | number of hits for each photo detector as list |
etot | float | total G4 energy deposit in this event |
nsteps | int | number of G4 steps |
trackid | int | track ID |
type | string | particle type |
parentid | int | track ID of parent |
parenttype | string | particle type of parent |
creaproc | string | process that created this particle |
edproc | string | process for this particular energy deposit |
xp | vector | x coordinate of energy deposit (mm) |
yp | vector | y coordinate of energy deposit (mm) |
zp | vector | z coordinate of energy deposit (mm) |
ed | vector | energy deposit (keV) |
time | vector | timestamp of the current particle/trackid |
type_pri | string | particle type of primary |
e_pri | vector | energy of primary (keV) |
xp_pri | vector | x coordinate of primary particle (mm) |
yp_pri | vector | y coordinate of primary particle (mm) |
zp_pri | vector | z coordinate of primary particle (mm) |