\CompHEP~ software is written in \C~ and \Fortran.
The symbolic part is done in \C. The numerical one was written in \Fortran~
but later on was converted to \C. However both versions of numerical part are
now available. The \C~  programs  use a graphical  window interface based on
the   X11 or MS-Windows facilities,
whereas the \Fortran~ ones  use only a standard input/output. 
So in the latter case the service   is  more ugly.   


\subsubsection{Graphical interface} \label{X11interface}


  There are the following elements of the user interface in the \CompHEP~
package: {\it On-line Help, Menu, Message, String Editor, Table Editor,
Diagram Viewer} and {\it Plot Viewer}. You can control them using the
\Arrows~ keys, \Enter, \Esc\footnote{Use the  {\tt 'Ctrl ['} sequence if the \Esc~ key is  absent on your
keyboard}, \Backspace,
\PgUp/\PgDn\footnote {On some keyboards there are {\it Prev/Next} instead of 
\PgUp/\PgDn}  
keys and the mouse click. \CompHEP~ is sensitive to the left mouse button release.

  You can toggle on/off colors  and a sound for the \CompHEP~ session as well
as choose the most appropriate font for the \CompHEP~ window.  Just edit
{\it comphep.ini}  which appears as a result of user installation (Section
\ref{u-install}). We hope the syntax  is  obvious. 


\paragraph  {1. On-line Help.} 

At almost every point when \CompHEP~ is waiting for your input, you can
press the {\it F1} key to get a context sensitive help information. If the screen 
height is not enough to display the full help message, you will see the 
\PgDn~ mark in the right-bottom corner of the help window. To get the next 
page of the message press the \PgDn~ key or click the mark. To close the 
help window  press the \Esc~ key or click the asterisk in the top-left corner 
of the help border. 
  
  
\paragraph { 2. Menu.} 

 The   menu program displays a list of menu functions. One of
them is highlighted. See a typical example of  menu in Fig.\ref{screen_menu}.  
Use the arrow keys or a mouse click to highlight
a desired function. Press the \Enter~ key or click on the highlighted
function to activate it. 


   If the  menu is  too large you will
see only a part of it. Use the \PgDn/\PgUp~ buttons or click on the
corresponding marks in the menu corners to scroll. 

   In order to get back to the previous menu level press the \Esc~ key or
click the asterisk in the top-left corner of the menu border. 

   The menu program is also sensitive to the functional keys {\it F1, F2,
..,F9}. The list of 
active functional keys depends on the program point and is displayed on the 
bottom line of the screen. Generally the functional keys  activate the 
following  programs:\\
\begin{tabbing}
F1-~ \= Help~~~~~~~\=: \= displays a help message about the highlighted  menu
function;\\
F2- \>  Manual     \>:\>  displays an  information about service facilities.\\
F3- \> Models     \>:\>   displays  contents of the current model of particle 
interactions.\\ 
F4- \> Diagrams \>:\> browses the generated Feynman diagrams.\\
F6- \> Results  \>:\> views and  deletes \CompHEP~ output files.\\ 
F9-\> Quit     \>:\> quits the \CompHEP~ session.\\ 
\end{tabbing}
   To call one of these programs just press the functional key  or click
on the corresponding symbol on the bottom line of the screen. The digit keys 
act as the functional keys. For example, {\it '3'} acts as {\it F3}.


\paragraph{ 3. Message.}
 
    \CompHEP~ writes informative and dialogue  messages during the session. 
The informative messages finish with the {\it "Press~any~key"} string. You can
continue
your work either following this instruction or clicking the mouse on the
message area. In the second case the  message has a label {\it(Y/N?)}. You
should  press  the {\it Y} or {\it N} key or just click on them in the
message window to answer `Yes' or `No'.


\paragraph{4. String Editor.} 

    If you would like to enter a new process or change a  parameter 
value,  \CompHEP~ calls the String Editor.  As a rule, previous
information about this item is available and the kept string is
displayed.  If you would like to edit the original string, use the
{\it left/right arrow} keys or the mouse click to put the cursor on the
desired position. Otherwise, if the fist input character is a printing
symbol, the original string will be deleted.  The \Delete~ key works as
the \Backspace~ key and removes 
a character left to the cursor.   To terminate the input you can press  \Enter~ 
to accept the resulting string or the \Esc~ key to cancel it.


\paragraph{5. Table Editor.} 

    \CompHEP~ uses {\it tables} to store the information about parameters, particles,
vertices, cuts and distributions. For all these cases any unit 
(displayed as a table line) consists  of several fields (table columns). 
The program  Table Editor is  invented to provide the user a possibility 
to  view and change  the  table contents.   In some program 
points  the Table Editor is  used to browse a table contents without 
a permission to change data.

    Table is displayed on the screen as it follows (see Fig.\ref{screen_table}).
The top line of the window  contains a  title of the table. Below there are  
table columns 
surrounded by a frame box.  The columns are separated by vertical lines. The first 
horizontal line contains column names. 
One cell (a line - column intersection) is highlighted. If the table is open
for  changes, the   highlighted  cell  contains the cursor. The ordering 
number of the corresponding  line  is displayed in the 
top-right corner   of the window.

 
To change position of the  cursor and  the   highlighted  cell one  can use 
the arrow keys, the {\it Tab} key  and the mouse click. If one types any printing symbol it 
will be inserted into the table at the cursor position. 
  The  \PgUp, \PgDn~  keys are used to scroll the table. 
The {\it F1} and {\it F2} functional  keys provide   
information about  the meaning of table fields  and about  facilities
of the Table Editor.
 To exit the table  one has to press the \Esc~ key. 


There are some auxiliary commands which help the user to operate the 
tables. These commands can be realized by means of {\it Control } 
symbols or by mouse click on the command label displayed on the table
border:  
 
{\it Top (\^~T)} moves the cursor ( highlighted cell) to the top line of the 
table.

{\it Bottom (\^~B)} moves the cursor ( highlighted cell) to the bottom line of
the  table.

{\it GoTo (\^~G)}  moves the cursor to the line directed by the user.

{\it Find (\^~F)}  searches the string directed by the user.

{\it Find again (\^~A)} repeats previous command {\it Find}.
 
{\it Zoom (\^~Z)} key switches on the zoom mode to view/edit  
contents of  the  highlighted  cell. In this case
\CompHEP~ opens a special window and  the field text wraps this window.
  To terminate the {\it Zoom} mode  one has either to press \Enter~ to
accept changes  or \Esc~ to forget them.

{\it ErrMess (\^~E)}   redisplays an  error message   concerning the contents
 of one of the  tables 
 which has been previously generated by \CompHEP.
 
The above commands are available in both modes of the Table Editor.
The labels of these commands are disposed on the bottom border  of the 
table. The following  commands 
 are available only  if the table is open
for  changes:

{\it Clr (\^~C)} clears the contents of the current field right to the cursor
position.

{\it Rest (\^~R)} restores the contents of the current field which existed
before last entering  the corresponding cell.

{\it Del (\^~D)}   cuts the current line from the table and
put it into  the buffer.

{\it New (\^~N)} creates a new line and fill it with the buffer contents.
Also you can  press the \Enter~ key to create a new line.

{\it Size (\^~S)} allows  the user to change the width of current field.
This command is active only if the  cursor is disposed in the column 
whose name  is surrounded by the   '\verb|>|','\verb|<|' symbols.

The labels of these commands are disposed on the top border of the window.

\paragraph{ 6.  Diagram Viewer.} 
   This program was designed to display  several Feynman 
diagrams on the   screen. The Viewer splits the screen into   rectangle 
cells and puts the 
diagram images in these cells one by one. One cell is marked by  surrounding
box frame. The total number of diagrams and the ordinal number of the marked
one are  displayed in 
the right-top corner of the screen.  See an example  in Fig.\ref{screen_diag}.
 
The number of diagrams which can be displayed simultaneously
depends on the  window size. 
  If you would like to see more diagrams on one screen, increase the window  
using the window manager.

    You can use the \PgDn/\PgUp~ keys to scroll diagram set. The
\mbox{\Home/\End~} 
 keys display  the beginning/end of the set. To display a diagram with some
ordinal number  you should press the {\it '\#'} key and after that the needed 
number.  You can move the position of the surrounding box 
 by the \Arrows~ keys or by the mouse click.     To finish work with the Diagram Viewer
 press the \Esc~ key.

The labels  for the above  commands  are displayed on the bottom border of the
window and  you may use the mouse click to activate one of them. 

 The Diagram Viewer may have some optional functions which depend  
on the context. The  labels 
for these functions are shown on the top border of the
window. One of them  generates a file with  graphical diagram image in  
the \LaTeX~ format. 
 Press   the 
{\it F1} key to get an information about these commands.
You may use the mouse click  on the label  or its first symbol
to activate  the function.   

\paragraph{ 7. Plot Viewer.}
This program is designed to display smooth curves and histograms.
Examples are presented in Fig.\ref{results_2-2} and  Fig.\ref{plot-image}. 

Being launched the {\it Plot Viewer} displays a picture and waits for the 
keyboard signal as it is shown in Fig.\ref{results_2-2}. The program ends
with pressing the \Esc~ key. 
If some other key is pressed then  the user gets
a menu which you can see in  Fig.\ref{plot-image}. This menu allows to  change 
the limits  of
vertical axis and its scale. Note that the logarithmic scale is available 
only if the lower limit is positive and the ratio of upper and lower limits 
is more then ten. To re-display the plot  choose the {\it 'Redraw plot'} option.  

The menu also provides the user with a possibility to save a graphical plot
image as a \LaTeX~ file and as a numerical table. The name of the 
corresponding  file is displayed on the screen just after  writing the file.
The numerical table created in this way can  be displayed on the screen 
later on by the command\\
\hspace*{2cm} {\tt \$COMPHEP/tab\_view < table\_file}\\
This {\it tab\_view} is just the same {\it Plot Viewer} but compiled as a stand-along
program.
 
The {\it 'Exit Plot'} menu function completes the {\it Plot Viewer} session. 



\subsubsection  {Interface for a text-screen mode}
         
 Only the standard input/output \Fortran~ facilities are used for this part of
\CompHEP.  So the service is  primitive. The user input
here is a string terminated by the \Enter~ key.

\paragraph{1. Menu.}

  When you work with the menu the numerated list of menu functions is displayed.
 Possible inputs are: 
 
 \verb|H<number>| - to get help information about the
$\verb|<number>|^{th}$ menu function;
        
 \verb|<number>|   - to execute the corresponding menu function;

 \verb|X|   - to quit  the current menu.

The lower case characters {\it h} and {\it x} may be used also as 
key characters of the above commands. 
You can see in  Fig.\ref{screen_menu_f} how this menu looks like
on the display. 


\paragraph{2. Tables.}

   Tables are used to enter and change  information about physical cuts
and a phase space regularization.   When you use this program a numerated 
list of  elements is displayed. Elements which have a  number  older than 9 are 
numerated by letters (A,B,C,D ...).
 Under this list you see a prompt for commands:\\
\hspace*{2cm}{\tt   N - new, \verb|D<set>| - delete, C<n> - change, X - quit.} 

\verb|N|   is  used  to insert a new table line. The subsequent input
           depends on the table.

\verb|D<set>|  is  used to delete records enumerated in \verb|<set>|. 
For example, \verb|D13A| will delete  the first, third and tenth  records.

\verb|C<n>|    allows you to change contents of the $\mbox{\verb|<n>|}^{th}$ item.

\verb|X|  is used to quit.  

The lower case characters {\it n, d, c} and {\it x} may be used also as 
key characters of the above commands. 
 
   
\paragraph{3. Viewer.}
 
 When you browse the help information or  some file contents 
the following commands may be used:

to look at the next page      type   the {\it Spacebar} key;

to look at the preceding page      type  `b';

to exit from the viewer         type  `x'.

