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 leverages Geant4 to run simulations of particles through geometries stored in databases.
Key features include:
- Python API provides database I/O of geometry and materials
- Custom extensibility of fieldmaps, hardware electronics, output formats and signal digitization
- Built-in
ASCII
andROOT
output
Databases
Geant4 objects are uploaded to databases using the python API. Running simulations looks like this:
- GEMC reads databases (
ASCII
,SQLite
,GDML
orCAD
files) to create the geometry (volumes, materials, surfaces, etc). - Generated particle are transported through the geometry by Geant4.
- The resulting hits are processed, collected and digitized.
- Outputs are streamed to
ASCII
,ROOT
and/or user defined formats.

Python API
Python
is used to create and upload to databases the geometry, materials, mirrors, etc.
- No previous knowledge of Geant4 or C++ is required.
- The application does not need to be re-compiled when the geometry is changed.

gvolume = GVolume('flux_box')
gvolume.description = 'carbon fiber box'
gvolume.make_box(40.0, 40.0, 2.0)
gvolume.material = 'carbonFiber'
gvolume.color = '3399FF'
gvolume.digitization = 'flux'
gvolume.set_position(0, 0, 100)
gvolume.style = 1
gvolume.set_identifier('box', 2) # identifier for this box
gvolume.publish(configuration)
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

Continuous Integration
Gemc is built on several platforms for every commit and pull request. In addition, nightly releases are built and deployed the Github repository.
Reference
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.