USER DOCUMENTATION FOR THE PIX ROUTINES
			    by John Keyser
			       7/28/94

I.  Overview

	The pix routines have been implemented in order to 
allow a user to display a picture of the experiment.  The view
of the experiment will be a 3-D projection based on some
viewing angle, which can be modified.  Options to zoom in
and change general parameters (color, whether or not something
is displayed at all) are included.  Also available are commands
to print the picture to a postscript file and to print out
raw event data.


II.  The general picture

	The picture displayed by the pix routines has three
"parts."  The first, and probably most important part is the 
drawing of the apparatus itself.  Shown are the outlines of all
detectors, the hits on the detectors, the outlines of the 
non-detectors (e.g. magnets, target), the reconstructed tracks,
and the intersection of these tracks with each detector.  This is
displayed on the bottom portion of the window. The second portion 
of the picture is the text area, displayed in the upper left hand
corner.  This area gives the run, spill, and event numbers, triggers 
which fired, momentum and chi squared for each track, and the pair 
mass, pt, xf, and x2.  Finally, a third area of the screen (the 
upper right hand corner) contains a small drawing of the x, y, and 
z axes, which gives the viewpoint that the experiment is being 
looked at from.  At the bottom of this area is a line of "help"
describing the direct interaction commands.


III.  Interacting via kuip commands

	A number of kuip commands are available to change aspects
of the picture.  The list of commands, along with what each one 
does, is as follows:

Under /control menu:

PIXSWITCH - Internal switch to turn pix on or off (default on)
	Parameters: Turn pix ON/OFF

Under /control/pix menu (all remaining commands) :

PRINT -  Write the current picture to a postscript file.  Files
	are numbered pix#.ps with # being the number of the
	picture printed from this run.

DUMPDATA - Write out the raw event data to a file.  The file is
	named RRRR_EEEE.dump, with RRRR being the run number and
	EEEE being the event number.  Data is written in ocatal.

REDRAW - Redraw the picture.  This should not have to be used
	very often.  It will remove any zooming which has occurred.

HOLD - Put a hold on the picture but NOT on the analysis.  The 
	picture will remain on the screen until a release command
	is given, but analysis will continue in the background.

RELEASE - Release a held picture.  Display of new pictures will 
	continue as normal after the release command.

INTERACT - Stop analysis and allow interaction directly with picture.
	Stopping the analysis also stops kuip commands from being 
	entered.  To resume analysis, a release command must be
	given from the picture itself (see below).

MODE - Change the method of how often to display new pictures.  There 
	are six choices:
		Every Nth Event - a new picture is displayed after
			every N events are analyzed
		Every Nth Second - a new picture is displayed after
			every N seconds have passed since last picture
		Every Nth Event and hold - Same as Every Nth Event,
			but a HOLD command is automatically given
			after each new picture is displayed (thereby
			keeping it on the screen until released).
		Every Nth Second and hold - Same as Every Nth Second,
			but a HOLD command is automatically given
			after each new picture is displayed.
		Every Nth Event and interact - Same as Every Nth Event,
			but an INTERACT command is automatically given
			after each new picture is displayed (and thus
			stopping analysis.
		Every Nth Second and interact - Same as Every Nth Second,
			but an INTERACT command is automatically given
			after each new picture is displayed
	Also, a parameter sets whether or not to reset time after 
		interaction.  If YES is given, then the time for the 
		last display is set when leaving interaction mode.  If
		NO is given, then the time for the last display is set
		when interaction mode is entered, so time is still kept
		while interacting.
	Parameters: Mode (see above), # of events between pictures, # of
		seconds between pictures, reset time after interact

COLORS/NONDETS - Change the colors of any of the non-detectors.
	(Target, SM12, SM3, Beam Dump, Calorimeter)
	Parameters: dump color, magnets color, target color, cal. color

COLORS/TRACKS - Change the color of the tracks or the intersections of
	the tracks with planes.
	Parameters: Track color, Track intersection color

COLORS/DET - Change the color of any detector outline or detector hit.
	Parameters: PT outline color, Hodo outline color, DC outline
		color, PT hit color, Hodo hit color, DC raw hit color,
		DC associated hit color

VIEW/XZ - Change the view to an X-Z view.

VIEW/YZ - Change the view to a Y-Z view.

VIEW/CHANGE - Change the viewing angle and scaling factors.  The 
	parameters which may be set are: 
		Horizontal angle - the angle from the positive x-axis toward
			the positive z-axis (in degrees: 0.0 to 360.0)
		Vertical angle - the angle from the positive y axis toward
			the x-z plane (in degrees: 0.0 to 180.0)
                X Scaling Factor - the factor by which the picture
			should be scaled in the X direction
		Y Scaling Factor - the factor by which the picture
			should be scaled in the Y direction
		Z Scaling Factor - the factor by which the picture
			should be scaled in the Z direction
	Parameters: Alpha, Beta, XScale, YScale, ZScale

SET/NONDET - Turn non-detectors on or off (target, SM12,
	Beam Dump, SM3, Calorimeter)
	Parameters: Target on/off, Dump on/off, SM12 on/off, SM3 on/off,
		Calorimeter on/off

SET/TRACK - Turn track tracks, intersections, or track labels on or off.
	Parameters: Tracks on/off, Track intersections on/off, track
		labels on/off

SET/STN - Turn detectors and detector hits on or off by station 
	(1, 2, 3, or 4).
	Parameters: Station 1 outlines on/off, Station 1 hits on/off, ...
		... , Station 4 hits on/off

SET/TYPE - Turn detectors and detector hits on or off by type
	(prop tubes, hodoscopes, drift chambers).
	Parameters: PT outlines on/off, PT hits on/off, Hodo outlines
		on/off, Hodo hits on/off, DC outlines on/off, DC raw 
		hits on/off, DC associated hits on/off

SET/TUBES - Turn prop tube outlines and hits on or off.
	Parameters: PTY1 outlines on/off, PTY1 hits on/off, PTX outlines
		on/off, PTX hits on/off, PTY2 outline on/off, PTY2 hits
		on/off

SET/HODOS - Turn hodoscope outlines and hits on or off.
	Parameters: Hodo X1 outline on/off, Hodo X1 hits on/off, Hodo Y1 
		outline on/off, ... (for  Y2, X3, Y3, X4, Y4)

SET/DC1 - Turn drift chamber station 1 outlines, raw hits, and associated 
	hits on or off.
	Parameters: DC Y1 outline on/off, DC Y1 raw hits on/off, DC Y1 
		associated hits on/off, .... (for Y1P, U1, U1P, V1, V1P)

SET/DC2 - Turn drift chamber station 2 outlines, raw hits, and associated 
	hits on or off.
	Parameters: DC Y2 outline on/off, DC Y2 raw hits on/off, DC Y2 
		associated hits on/off, .... (for Y2P, U2, U2P, V2, V2P)

SET/DC3 - Turn drift chamber station 3 outlines, raw hits, and associated 
	hits on or off.
	Parameters: DC Y3 outline on/off, DC Y3 raw hits on/off, DC Y3 
		associated hits on/off, .... (for Y3P, U3, U3P, V3, V3P)

NOTE:  Turning these SET switches on and off turns the pictures on or off.  
	It does NOT turn them on or off in the actual analysis.


IV.  Interacting via mouse/picture interaction

	A number of commands can be performed by using a mouse to 
interact directly with the picture.  This can be done after an INTERACT
command has been given.  Many of these commands are either much simpler
to use or made possible by this mode of interaction.  The commands 
possible are as follows:  (note that picture refers to the portion of
the screen in which the picture of the experiment is drawn (the lower
portion), text refers to the portion of the screen in which text is
written (the upper left portion of the screen), and axes refers the the
portion of the screen in which a small set of axes are drawn (the
upper right hand portion of the scren)).

PICTURE SECTION
	Left button - zoom in on that portion of the picture.  The
		zoomed in picture will be approximately 1/4 the area
		of the original picture, centered on the point the mouse
		was clicked on.
	Center button - Redraw the entire picture.  Any zooming is removed.
		(Same as REDRAW kuip command)
	Right button - zoom out from that portion of the picture.  The
		zoomed out picture will contain approximately 4 times
		the area of the original picture, centered on the point
		the mouse was clicked on.

TEXT SECTION
	Left button - dump raw data for that event to a file.  (Same as
		DUMP_DATA kuip command)
	Center button - release hold on picture.  If a HOLD command had 
		been issued, this acts like a RELEASE command.  If an
		INTERACT command had been issued, this acts to "undo" the
		command, and allow analysis to continue as before.
	Right button - draw the current picture to a file.  (Same as
		PRINT kuip command)

AXES SECTION
	Left button - rotate view of experiment.  Pressing the button
		down "grabs" the axes.  Moving the mouse while the 
		button is held down moves the axes around.  When the
		button is released, the entire picture will be redrawn
		from the new viewing angle as seen in the axes.  Note that
		horizontal movements of the mouse change the alpha angle,
		while vertical movements of the mouse change the beta angle.
		If the mouse leaves the axes area, the button is assumed
		to be released.
	Center button - release hold on picture.  Same as TEXT SECTION, 
		Center button.
	Right button - go to a Y-Z view of the apparatus.  If a Y-Z view
		is already displayed, go to an X-Z view.
	

V.  Additional comments

	Please note that at the current time, interaction directly with the
picture is not possible unless an INTERACT command is given (thereby stopping
the analysis).