Constant Field Example



Upcoming in the next release.

This field example displays a uniform longitudinal magnetic field using gmultipoles. It is a minimal scene for checking field-line visualization without running events.


Quickstart

Copy the example to your current directory, build the geometry database, and open the field display:

cp -r $GEMC_HOME/examples/fields/constant .
cd constant
./constant.py
gemc constant.yaml -gui


Geometry

The geometry is defined in constant.py. The world volume root contains one transparent box, constant_field_box, with its mfield property set to constant.


Field Definition

The YAML file defines a longitudinal uniform field through gmultipoles:

gmultipoles:
  - name: constant
    pole_number: 2
    strength: 1
    rotaxis: z
    longitudinal: true

The display options request 30 field lines and auxiliary geometry edges:

show_field_lines: 30
show_auxiliary_edges: true


Field Display

Constant field display: a transparent box with uniform field lines.


Usage

The file constant.yaml sets n: 0, so no /run/beamOn is needed for this display scene. Add -fieldAt to inspect the configured field at a point:

gemc constant.yaml -fieldAt="0*cm 0*cm 0*cm"