The CLAS12 Geant4 simulation
Abstract The Geant4 Monte Carlo (GEMC) package is used to simulate the passage of particles through the various CLAS12 detectors. The geometry is implemented through a database of Geant4 volumes created either through the GEMC native API, by the CLAS12 geometry service, or imported from the CAD engineering model. The truth information is digitized with a plugin mechanism by routines specific to each detector and includes the use of the CLAS12 calibration database constants to produce both ADC and TDC response functions. Theoretical models that produce the generated events interface with GEMC through the LUND data format. The merging of simulated data with real random trigger data provides a mechanism to include both beam and electronic background into the simulation of generated events to accurately model beam data from the CLAS12 detector. The performance of simulation is demonstrated by comparison with the experimental data.