CLAS12 Electromagnetic Calorimeter Example



This example shows the CLAS12 electromagnetic calorimeter (EC) geometry from clas12-systems. It is upcoming in the next release.


Quickstart

From the clas12-systems repository, build the geometry database and run a short simulation:

cd $GEMC_HOME/../clas12-systems/geometry_src/ec
./ec.py
gemc ec.yaml -n=1


Geometry

The geometry, shown below, is defined in geometry_src/ec/ec.py and geometry_src/ec/geometry.py. The EC builder reads the local coatjava geometry factory, converts the CLAS12 calorimeter sectors, lids, lead absorbers, and scintillator strips to GEMC volumes, and stores them in gemc.db.

The world (a box named root) contains:

The EC is a large geometry, so the example sets pyvista-fast: true in _data/examples.yml to use the fast PyVista rendering path when exporting the interactive view below.

Interactive viewer:


Physics List

FTFP_BERT is used by default, selected in the YAML file with phys_list: FTFP_BERT.

phys_list

The physics list can be selected using the option

gemc -phys_list <value>

where <value> can be a combination of the Geant4 physics constructors separated by the + sign. For example

gemc -phys_list="FTFP_BERT + G4NeutronCrossSectionXS"

To see a list of the available Geant4 constructors:

gemc -showPhysics


Generator

The particle kinematics are defined in the YAML file:

gparticle:
  - name: e-
    p: 5000*MeV
    delta_p: 1*GeV
    theta: 25*deg
    delta_theta: 15*deg
    randomThetaModel: cosine
    delta_phi: 180*deg

See also the Internal Generator Documentation for more information.


Digitization

The scintillator strips use the CLAS12-specific ec digitization plugin. The identifiers record sector, layer, and strip numbers:

gvolume.digitization = "ec"
gvolume.set_identifier("sector", sector, "layer", hipo_layer, "strip", strip)


Usage

Building the detector

Use geometry_src/ec/ec.py to build the detector. By default, the setup is stored in a SQLite file named gemc.db.

See also the Building Geometry for more information.


Running GEMC

The file ec.yaml can be used to run the setup. Add -gui to run interactively:

gemc ec.yaml -gui

Modify ec.yaml as needed, in particular to add particles, control the number of threads, or change the output.


Running Events

CLAS12 EC simulation: generated electrons showering in the electromagnetic calorimeter geometry.


Output

The gstreamer option selects the output filenames and formats:

gstreamer:
  - format: csv
    filename: ec
  - format: hipo
    filename: ec

See also the Output Documentation for more information.