

Information
FIGS for the Impatient
To make a FIGS graphics file for data or Monte Carlo do the following:
These five steps will create a FIGS graphics file with at most 20
events, by writing events to your FIGSOUT file.
To view the events in the file, run FIGS.
You can also skip the last two steps if you want to look at the first
20 events without selecting any particular events.
$FIGSFLAG
MAXFIGS=20
$END
Note: this produces the largest possible FIGS graphics file. To refine your selections, see the following description of the FIGSFLAG namelist.
FIGS graphics files can be created for data or Monte Carlo. The code that
writes the files has been fully integrated into the
driver
routines, so anybody who is familiar with the template can create FIGS
graphics files by following these steps:
A complete list of FIGSFLAGs can be found in "What does FIGS have now?"
This is a sample FIGSFLAG namelist:
You can see that there is a flag for each detector as well as MAXFIGS,
which sets the maximum number of events that will be written out.
A negative value for the detector flag means that the geometry information (a
picture of the detector) is written out, but no event information is output.
A postive value means that both geometry and event infomation is written out for
that detector element. Different positive values of the flags make it possible
to instruct the individual routines to write out different types of information.
This mechanism is used for the SSD and PWC routines, which write out tracks
and/or hits depending on the value of FIGSSD and FIGPWC, respectively. For
example, to write out PWC tracks set FIGPWC = 1; to write out PWC tracks
and PWC hits set FIGPWC = 2.
Here is an example:
The second line in this example will delete a figs.ster file, if one exists.
Note that you can also write the FIGS graphics data to a UNIX
named pipe
(a file that acts like a FIFO) by adding
to your script. This will not work for AFS directories, so you could use
an NFS mounted scratch disk if you are working on fnalu.
can be inserted anywhere in the reconstruction code. This will write an event
to the FIGS graphics file, and tag the event using the spill number. Note that
the FIGEVNT variable must be set to one so that the FIGSANAL
routine will write out the event.
The first routine that is called is
figsinit.
This routine serves three purposes. First, it reads the FIGSFLAG namelist.
The values from the namelist are put in a common block in FIGSFLAG.INC.
Next it allocates a unit number with GETLUN, and opens the file that is
associated with the FIGSOUT environment variable. Third, it defines
various shades of orange that are used to represent different energy values,
which are also stored in FIGSFLAG.INC.
The second routine is
figsgeom.
Each detector has a subroutine that is called to write graphics
primitives to the FIGS graphics file. Each detector subroutine,
FIGSG_xxx, includes the FIGSFLAG.INC file, and writes its output
to UNIT=lunfigg. The output is a series of graphics primitives
that specify the geometry of the detector.
The
figsanal
routine is similar in function to figsgeom. Detector
routines that are called by figsanal write their output
to UNIT=lunfigs, which has been defined to be the same as lunfigg
(in an earlier version of the code we wrote the geometry and
event data to two different files).
The fourth routine is
figsstop,
which shuts everything down and closes the files.
Creating a FIGS graphics file
A FIGS graphics file is an ASCII file that is used for graphics purposes, and it
usually includes the FOCUS detector geometry, data recorded by the detector, and
results from event reconstruction software. The file is arranged so that the
detector geometry comes first, followed by data for individual events.
Set flag(s) in the CONTROL namelist:
There are two flags (DOFIGS and FIGALL) in the CONTROL namelist that control the
routines that write FIGS graphics files. The DOFIGS flag is used to tell
the routines to write a file, by setting DOFIGS = 1. Note that the
default setting is DOFIGS = 0, which tells the routines NOT to write a
graphics file. The FIGALL flag is used to set a value for all of the flags
in the FIGSFLAG namelist. For example, to write out all of the available
graphics data for every detector, set FIGALL = 2. Note that this
produces the largest possible graphics file for your events.Include a FIGSFLAG namelist:
The FIGS routines use a namelist called FIGSFLAG to control what is
written to a FIGS graphics file. This namelist is very similar to
DRVFLAG
in format and purpose. To work correctly within the template, it should follow
USRFLAG in the e831job.nam namelist or the mcfocus.nam
namelist.
$FIGSFLAG
MAXFIGS = 20
FIGSTG = 0,
FIGSSD = 1,
FIGPWC = 1,
FIGSTW = 0,
FIGCER = 0,
FIGIEC = 1,
FIGOEC = 0,
FIGHDC = 0,
FIGOMU = 0,
FIGIMU = 0,
FIGHXV = 0,
$END
Define the FIGSOUT environment variable:
To write a FIGS graphics file you must supply the name of an output file. Use
the FIGSOUT environment variable to do this in your e831job.run or
mcfocus.run file.
setenv FIGSOUT figs.ster
if (-e $FIGSOUT) rm -f $FIGSOUT
mknod $FIGSOUT p
Selecting events in your USRANAL:
To select particular events for output to the FIGS graphics file, you can
impose cuts to select the events in your USRANAL routine and set
FIGEVNT = 1 to write out the events. Events that should NOT be
written to the graphics file should have FIGEVNT = 0 in USRANAL.
Calling FIGSANAL for diagnostic purposes:
FIGSANAL
is the subroutine that is called by
DRVANAL
to write an event to the FIGS graphics file. You can easily write the
same event more than once by calling FIGSANAL at different locations
in the code. This is useful to see what an event looks like at different
stages in the event reconstruction. In order to "label" the event to keep
track of the different stages, one can temporarily use the spill number to
tag the event. For example,
isave_spill = spill
spill = 3
FIGEVNT = 1
call FIGSANAL
FIGEVNT = 0
spill = isave_spill
Adding more things to FIGS
FIGS was designed to make it easy to add more detectors, to add different ways
of viewing event data, and easy to modify the graphical user interface.
We have numerous examples of code in the
FIGS library
to display the detectors and event data for FOCUS. The code in the
FIGS display library
can be modified to add new features to FIGS.
Writing display routines
The display routines for both FOCUS detectors and event data are called by two
subroutines, figsgeom and figsanal. All together there are
four routines that control the code that produces FIGS graphics files. The
following description provides an overview of these four routines.
| Apparatus | Geometry Code | Event Code | Settings for FIGS flags | |
|---|---|---|---|---|
| Magnets | figsg_mag.sf | |
none | |
| BeO target | figsg_tar.sf | |
none | |
| Target Silicon | figsg_stg.sf | figsa_stg.sf | FIGSTG=1 - planes and hits | |
| SSDs | figsg_ssd.sf | figsa_ssd.sf | FIGSSD=1 - planes and tracks
FIGSSD=2 - planes, tracks and hits FIGSSD=3 - planes, tracks and strips |
|
| PWCs | figsg_pwc.sf | figsa_pwc.sf | FIGPWC=1 - chambers and tracks
FIGPWC=2 - chambers, tracks and hits |
|
| IE | figsg_iec.sf | figsa_iec.sf | FIGIEC=1 - detectors and hits | |
| OE | figsg_oec.sf | figsa_oec.sf | FIGOEC=1 - detectors and hits | |
| HC | figsg_hdc.sf | figsa_hdc.sf | FIGHDC=1 - detectors and hits | |
| IMU | figsg_imu.sf | figsa_imu.sf | FIGIMU=1 - detectors and hits | |
| OMU | figsg_omu.sf | figsa_omu.sf | FIGOMU=1 - detectors and hits | |
| HxV & OH | figsg_hxv.sf | figsa_hxv.sf | FIGHXV=1 - detectors and hits | |
| Straws | figsg_stw.sf | FIGSTW=1 - detectors |
Last updated July 8, 1997