
   *----------------------------------------------------------------------*
   *             --->> HELP FILE FOR PROGRAM TESTK.FOR <<---              *
   *  TESTK simulates the 1993 aerogel beam test fixture, with the good   *
   *  mirror, and two different cameras.                                  *
   *----------------------------------------------------------------------*
   *                                                                      *
   *            type HELP          or                                     *
   *                 HELP *        or                                     *
   *                 HELP ?        to get the whole file shown            *
   *                                                                      *   
   *            type HELP COMMANDS to see a short list of valid commands  *
   *                                                                      *   
   *            type HELP string   to get help only on command 'STRING'   *
   *                                                                      *
   *----------------------------------------------------------------------*


>> XP, YP, ZP 
   Starting point of the ray. Note that for historical reasons, the back of 
   the aerogel (the exit face) is at z=+7 cm. Also, y=0 is 2 cm below the top 
   of the sample holder. In the side view, the origin (0,0,0) is marked with 
   a cross.

>> THEX,THEY 
   Starting angle of the photon (in the case PHOT=1) or track (in case PHOT=0).
   Don't forget to reset the angles when you switch PHOT.  (values in degrees)

>> TYPE 
   Particle type: 1=electron, 2=pion, 3=kaon, 4=proton.

>> PNOM 
   Momentum of the incoming particle (in GeV/c).

>> PPCM
   (Photons per cm, scaled). If PPCM=1, generate 1 event. This parameter can 
   be used to generate multiple events, or a fraction of an event (in the case
   of RATTLE=1)

>> ZBLOCK
   Thickness of a block of aerogel in cm. (also see NBLOCK)

>> NBLOCK
   number of aerogel blocks (also see ZBLOCK)

>> AHUNT, CHUNT
   The so-called Hunt parameters, describing the transmission of a piece of 
   aerogel, taking into account only the surface losses (AHUNT), and Rayleigh 
   scattering (CHUNT). For any particular sample of aerogel, these parameters 
   are directly measured in a transmission spectrograph.
               TRANSMISSION = AHUNT*EXP(-T*CHUNT/WAVEL**4)
   where T is the sample thickness and WAVEL the photon wavelenght.

>> INDEX                     
   Refractive index of the aerogel.

>> XSPHR, RSPHR
   XSPHR is the point in 3-space where the center of the mirror is located.
   From this point RSPHR points to the center of the sphere; thus /RSPHR/
   is the radius of curvature (=2*focal lenght).

>> FRESNEL
   Focal length of fresnel lens. Note that the location of the lens is defined 
   by the position of the oval mask holder (see XOVAL), and by SFRES, the 
   distance from the bottom of the mask holder slot to the lenses' optical 
   axis.

>> SFRES slot bottom to fresnel center  
   The distance from the bottom of the mask holder slot to the lenses' optical 
   axis. The mask holder is defined by XOVAL and ROVAL.

>> XTUBE, RTUBE
   Location and orientation of the photomultiplier tube face.

>> XFILM, RFILM
   Location and orientation of the polaroid film plane.
   
>> EDGES 
   The Z and Y coordinates of the upper edges of the sample holder and 
   mounting plate. These can block the upper rays of a cone originating far 
   back in the sample.

>> XOVAL, ROVAL
   XOVAL defines the center of curvature of the bottom semicircle of the oval 
   hole in the PMT mounting plate. ROVAL defines the orientation of this oval 
   opening, while the 4th component of ROVAL is the 'straight section' between 
   the upper and lower semicircles of the oval. Note that the mask holder slot 
   is the same as the oval opening.

>> MASK
   The radii of the mask (if any). If both radii are 0, no mask is applied.
   R1 < R2 (open between them). Note that since the ring images are elliptical,
   R1 and R2 are actually the horizontal major axes. The vertical axis of the
   ellips is interpolated from actual photographs taken at n=1.030 and n=1.01.

>> TUBE
   This switch toggles between the PMT view (with the ovals and masks), and
   the polaroid film view.

>> RANDOM
   This switch toggles between generating photons random in phi, or with phi 
   monotonously increasing, so they appear in spirals inthe various planes.

>> SIDE 
   This switch toggles between the side view, and the PMT/film plane views.

>> SCATTER 
   When doing regular tracing (SIDE=0, RATTLE=0):
   If SCATTER=1, then scattered photons are followed throught the apparatus. 
   If SCATTER=0, only the unscattered photons are followed.
   When doing RATTLE, you can set SCATTER=0 to turn off the straight-out
   photons, so you see only the scattered photons.

>> RATTLE
   When RATTLE=1, you get the view of the block of aerogel, tracing the 
   individual photons until they leave the sample. Note that if SCATTER=1,
   the unscattered cherenkov cone photons are also displayed, and they are
   not shown if SCATTER=0.
   In the case of RATTLE, photons are not traced any further, and only the 
   histograms having to do with the generation and scattering in the aerogel 
   are filled.
   Also see FAST.

>> PHOTON 
   If PHOTON=1, single photons are traced (as for the SIDE view). If PHOTON=0
   then cherenkov cones are generated (as for SIDE=0).
   Don't forget to change THEX, THEY when you switch PHOTON.

>> BLOCK 
   If BLOCK=1, then photons are discarded if they hit a boundary in the OVAL 
   plane. If you have masks on, and don't see the rings, turn BLOCK off to see 
   where they went.

>> AIR 
   If AIR=1, photons are generated in the air between the aerogel and the 
   spherical mirror.

>> XYLIM 
   This sets the scale for the display. The full-screen width is twice XYLIM.
   Special values: 13.89 gives you the polaroid photograph on a 1:1 scale.

>> OFFX
   Allows you to maneuver the image on the screen left/right and up/down.

>> QUIT, EXIT, STOP
   Exit from the program. Note xxx.PS contains copies of all the pictures 
   shown (you may want to edit and discard between 'page:' markers). File 
   xxx.HST contains the histograms, which can be viewed with PAW. 
   File xxx.INI contains the last settings used.

>> CLEAR
   This one clears all histograms, erases the picture, and also zeros the 
   counts in the STAT tables.

>> HISTOGRAM
   Show histogram ID. If ID=0, an index of booked histograms is shown.

>> GO
   Ready with setup, proceed.

>> SHOW
   Show the menu. In addition, on the next picture, you will see some of the 
   parameters printed on the picture.

>> ALL
   Something about saving the last n rays?

>> DEBUG
   Make an innocent error, so that the program drops down to the DBG> prompt.

>> STAT
   The program tallies photons that arrive at certain locations, when SIDE=0 
   and PHOT=0. Losses and survivors are calculated, and STAT shows a table
   of these. The tables are reset with the CLEAR command.

>> FAST
   Normally, the program proceeds 'chronologically', that is, photons are
   generated between 200-700nm, then they are propagated through the aerogel, 
   then out of the gel to the mirror, folded with the mirror spectrum etc..
   When FAST=1, the generated spectrum is FIRST folded with the mirror, 
   acrylic and PMT efficiency spectra, before any propagation. This speeds
   up the events tremendously, because it cuts down low-wavelenght photons, 
   which take a long time to rattle around the aerogel.

>> COMMANDS
 XP,     YP,      ZP,     THEX,   THEY,  TYPE,  PNOM,    PPCM,   ZBLOCK,
 NBLOCK, AHUNT,   CHUNT,  INDEX,  XSPHR, RSPHR, FRESNEL, SFRES,  XTUBE,
 RTUBE,  XFILM,   RFILM,  EDGES,  XOVAL, ROVAL, MASK,    TUBE,   RANDOM,
 SIDE,   SCATTER, RATTLE, PHOTON, BLOCK, AIR,   XYLIM,   OFFX,   QUIT, 
 EXIT,   STOP,    CLEAR,  HISTO,  HELP,  FAST,  COMMANDS
   
