Cherenkov Example



This example shows how to activate Cherenkov radiation in a GEMC detector. The three radiator names are neutral demonstration labels. Their optical constants may be unphysical and should not be read as definitions of real materials.

You can run this example in your browser: Cherenkov


Quickstart

Copy the example to your current directory. To create the geometry, run 1 event, and produce ROOT and CSV output files:

cp -r $GEMC_HOME/examples/optical/cherenkov .
cd cherenkov
./cherenkov.py
gemc cherenkov.yaml -n=1


Geometry

The geometry, shown below, is defined in cherenkov.py. It is produced in three variations: default, mediumIndexRadiator, and highIndexRadiator.

The world (a box named root) contains a radiator box. The radiator material depends on the selected variation:

variation material color refractive-index range
default lowIndexRadiator red 1.0010-1.0013
mediumIndexRadiator mediumIndexRadiator blue 1.0110-1.0150
highIndexRadiator highIndexRadiator green 1.0500-1.0530

Interactive viewer:

Cherenkov geometry with 1 generated electron. The highIndexRadiator volume (green, style = 2 renders it as a cloud) is the medium generating Cherenkov radiation.


Physics List

FTFP_BERT + G4OpticalPhysics is used by default in the YAML file. The optical physics component is required to produce optical photons.


Generator

The default kinematics is a 1 GeV electron beam generated along the z-axis near the start of the radiator. This is defined in the YAML file:

gparticle:
  - name: e-
    p: 1000*MeV
    vz: -50*cm


Digitization

The detector volume sensitivities are specified with the gPhotonDetector digitization (one of the available GEMC prebuilt routines) in cherenkov.py.

The identifier is used to distinguish the different detector boxes:

backplate.digitization = "gPhotonDetector"
backplate.set_identifier("detector", panel_id)


Usage

Building the detector

Use the Python script cherenkov.py to build the detector. By default, the setup is stored in a SQLite file named gemc.db. Command-line options can define the database type, variations, and run number.


Running gemc

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

gemc cherenkov.yaml -gui

The YAML sets g4view.cloudPoints: 60000 so cloud-style volumes are dense enough for the rendered geometry screenshots.

Modify cherenkov.yaml as needed, in particular to add particles, control the number of threads, or change the output. The gPhotonDetector digitization records optical photons even when they deposit zero energy, so recordZeroEdep is not required for this example.


Variations

Within the YAML file, the variation is set to mediumIndexRadiator. You can replace it with default or highIndexRadiator to change the material. For example:

gsystem:
  - name: cherenkov
    variation: highIndexRadiator

Different radiator materials produce different photon yields and angles, as shown below. Their optical constants are demonstration values and may be unphysical. Use the variation name in the gstreamer filename when you want separate output files for each variation.


low-img medium-img high-img
lowy-img mediumy-img highy-img

Left: default (lowIndexRadiator), Center: mediumIndexRadiator, Right: highIndexRadiator.


Output

The gstreamer option selects the output name and format. Two simultaneous streams are selected: CSV and ROOT.

gstreamer:
  - format: csv
    filename: cherenkov
  - format: root
    filename: cherenkov

Because gPhotonDetector is a per-event digitization, GEMC will produce one output file per thread. For ROOT files, you can use hadd to merge the files.

gstreamer

The gstreamer option selects the output name and format. Run gemc help gstreamer to check its documentation:

-gstreamer=<sequence> ......: define a gstreamer output

• filename: name of output file. Default value: NODFLT
• format: format of output file. Default value: NODFLT
• type: type of output fileDefault value: event


Define output formats and filenames. 
It can be used to select <events> or <frame> streams.
The file extension is added automatically based on the format.

Supported formats:
	
  - jlabsro
  - root
  - ascii
  - csv
  - json


Output types:

  - event: write events
  - stream: write frame time snapshots

Example that defines two gstreamer outputs:

 -gstreamer="[{format: root, filename: out}, {format: csv, filename: out}]"


The produced files structure depends on the accumulation method used:

  - event-based digitization (like <flux>) will have one file per 
    thread, with "_t<thread#>" appended to the filename
  - run-based digitization (like <dosimeter>) will have one output file


Plotting with the GEMC Analyzer

Run GEMC with 1 event first. The default YAML file writes cherenkov_t0_digitized.csv and cherenkov_t0_true_info.csv.

gemc cherenkov.yaml -n=1

Plot the digitized photon energy:

gemc-analyzer cherenkov_t0_digitized.csv E --kind csv

Cherenkov digitized energy plot

Plot the optical-photon hit positions in the y-vs-x plane, with x and y limits in cm:

gemc-analyzer cherenkov_t0_true_info.csv --kind csv --data true_info --plot yvsx --xlim -20 20 --ylim -20 20

Cherenkov medium-index optical-photon y-vs-x plot