This site refers to the latest GEMC project (version 3 and above).
For CLAS12 simulations refer to this page. For previous GEMC version, refer to this page.
GEMC is a database-driven Monte Carlo simulation program based on Geant4.
Key features include:
- Python API for geometry and materials
ASCII,SQLite,GDML,CADsupport- Built-in
ASCII,CSVandROOToutput formats - Custom extensibility of digitization, output formats, e.m. fields.
pyvista3D visualization and import.- CAD / meshes support
Databases
Running simulations does not require previous knowledge of C++ or Geant4. A typical workflow looks like this:
- Geant4 geometry and materials are uploaded to databases using
python - GEMC reads databases and builds the Geant4 world
- Particles are transported by Geant4.
- Hits are digitized and streamed to the desired formats.
Typical gemc workflow: the Geant4 world is defined from databases sources.
Users can add run time conditions, particles, etc. Geant4's steps are collected in hits, digitized and streamed.
Python API
GEMC does not need to be re-compiled when the geometry is changed.
Python is used to create and upload to databases the geometry, materials, mirrors, etc.
The API supports pyvista visualization of the geometry.
flux_z = 50
flux_dx = 1
flux_dim = world_size * 0.8
gvolume = GVolume("FluxPlane")
gvolume.mother = "root"
gvolume.description = "Flux Scoring Plane"
gvolume.make_box(flux_dim * 0.5, flux_dim * 0.5, flux_dx * 0.5)
gvolume.material = "G4_AIR"
gvolume.color = "FAFAD2"
gvolume.set_position(0, 0, flux_z)
gvolume.digitization = "flux"
gvolume.set_identifier("flux_plane", 1)
gvolume.publish(cfg)
Geometry Variations
A detector can be re-used in multiple experiments, with configuration changes such as components shifts, changes of materials, addition or removal of certain volumes. GEMC Supports these geometry versions using variations and/or run numbers to adapt to different simulation setups
Status Badges
Gemc is built on several platforms and both arm64, amd64 architectures for every commit and pull request. In addition, nightly releases are built and deployed the Github repository.
| Deployment | |
| Doxygen | |
| Nightly | |
| Site |
Reference
Please make sure to cite the following paper if you use GEMC:
| M. Ungaro, Geant4 Monte-Carlo (GEMC) A database-driven simulation program, EPJ Web of Conferences 295, 05005 (2024) |
Bibtex:
@INPROCEEDINGS{2024EPJWC.29505005U,
author = { {Ungaro}, Maurizio,
title = "{Geant4 Monte-Carlo (GEMC) A database-driven simulation program}",
booktitle = {European Physical Journal Web of Conferences},
year = 2024,
series = {European Physical Journal Web of Conferences},
volume = {295},
month = may,
eid = {05005},
pages = {05005},
doi = {10.1051/epjconf/202429505005},
adsurl = {https://ui.adsabs.harvard.edu/abs/2024EPJWC.29505005U},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
Bibitem:
\bibitem{2024EPJWC.29505005U}
{Ungaro}, M.: Geant4 Monte-Carlo (GEMC) A database-driven simulation program.
\newblock European Physical Journal Web of Conferences \textbf{295}, 05005 (2024).
\newblock \doi{10.1051/epjconf/202429505005}
Source Code and Licence
The GEMC source code on GitHub is distributed under an open source license.