CLAS12 Forward Time-of-Flight Example
This example shows the CLAS12 Forward Time-of-Flight (FTOF) 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/ftof
./ftof.py
gemc ftof.yaml -n=1
Geometry
The geometry, shown below, is defined in geometry_src/ftof/ftof.py and geometry_src/ftof/geometry.py.
The FTOF builder reads the local coatjava geometry factory, converts the CLAS12 forward TOF panels and
scintillator paddles to GEMC volumes, and stores them in gemc.db.
The world (a box named root) contains, for each of the six sectors:
- three panel mother volumes named ftof_p1a_s<sector>, ftof_p1b_s<sector>, and ftof_p2_s<sector>
- scintillator paddles named panel1a_sector<sector>paddle<n> (23 paddles), panel1b_… (62), and panel2_… (5)
- a lead shield behind panels 1a and 2 named ftof_shield_p1a_sector<sector> and ftof_shield_p2_sector<sector>
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 examplegemc -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: 12*deg
randomThetaModel: cosine
delta_phi: 180*deg
See also the Internal Generator Documentation for more information.
Digitization
The scintillator paddles use the CLAS12-specific ftof digitization plugin. Each paddle is read out at both ends, so the plugin splits every hit into a Left and a Right PMT channel. The identifiers record sector, panel, paddle, and PMT side:
gvolume.digitization = "ftof"
gvolume.set_identifier("sector", sector, "panel", layer, "paddle", paddle, "side", 0)
Usage
Building the detector
Use geometry_src/ftof/ftof.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 ftof.yaml can be used to run the setup. Add -gui to run interactively:
gemc ftof.yaml -gui
Modify ftof.yaml as needed, in particular to add particles, control the number of threads, or change the
output.
Running Events
Output
The gstreamer option selects the output filenames and formats:
gstreamer:
- format: csv
filename: ftof
- format: hipo
filename: ftof
See also the Output Documentation for more information.
Plotting with the GEMC Analyzer
Run GEMC with 2,000 events first. The default YAML file writes the analyzer CSV streams.
gemc ftof.yaml -n=2000 -no_field=all -plugin_path=/opt/projects/gemc/clas12-systems/build
Plot the total energy deposited per hit:
gemc-analyzer ftof_t0_true_info.csv totalEDeposited --kind csv --data true_info

Plot the y vs x hit positions:
gemc-analyzer ftof_t0_true_info.csv --kind csv --data true_info --plot yvsx --bins 80
