CLAS12 Drift Chamber Example



This example shows the CLAS12 drift chamber 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/dc
./dc.py
gemc dc.yaml -n=1


Geometry

The geometry, shown below, is defined in geometry_src/dc/dc.py and geometry_src/dc/geometry.py. The DC builder reads the local coatjava geometry factory, converts the CLAS12 drift chamber regions and superlayers to GEMC volumes, and stores them in gemc.db.

The world (a box named root) contains:

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 superlayer sensitivities use the CLAS12-specific dc digitization plugin. The identifiers record sector, superlayer, layer, and wire numbers:

gvolume.digitization = "dc"
gvolume.set_identifier("sector", sector, "superlayer", superlayer, "layer", 1, "wire", 1)


Usage

Building the detector

Use geometry_src/dc/dc.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 dc.yaml can be used to run the setup. Add -gui to run interactively:

gemc dc.yaml -gui

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


Running Events

CLAS12 DC simulation: generated electrons crossing the drift chamber geometry.


Output

The gstreamer option selects the output filenames and formats:

gstreamer:
  - format: csv
    filename: dc
  - format: hipo
    filename: dc

See also the Output Documentation for more information.