
   \CompHEP~ \Fortran~ output is used  to compile  the squared matrix element
 for  subsequent 
 evaluation of cross sections and distributions.  The explanation
below is necessary  only if you would like to use the \CompHEP~ \Fortran~
output for other phase space integration program  or,  vice versa, to use
the \CompHEP~ 
routines  to integrate a phase space function  produced in some other
manner outside  \CompHEP.

Below we insert the  declaration of  parameter  type into the header of \Fortran~ 
routine. It is done for brevity only  and contradicts to the \Fortran~
style. We use also the {\it Real*X}  designation  for declaring  
the parameter of floating point type  which is {\it Real*8} or {\it Real*16} depending on 
the  type of   output. 

 
   {\tt FUNCTION LENR()}\\ 
returns 8 in the case when \CompHEP~ produces a code with 
Real*8 (DOUBLE PRECISION) floating arithmetics or
16 in the case when \CompHEP~ produces a code with 
Real*16 (QUADRUPLE PRECISION) floating arithmetics.

   {\tt   FUNCTION NIN()}\\ 
returns a number of incoming particles.

   {\tt   FUNCTION NOUT()}\\
returns a number of outgoing particles.

   {\tt   FUNCTION NPRC()} \\
returns a total  number of subprocesses.

   {\tt   CHARACTER*6 FUNCTION PINF(NSUB,NPRTCL) } \\
returns a particle name for the
subprocess {\tt NSUB}. {\tt NPRTCL} is the particle ordering number in the subprocess.
The first {\tt NIN()} numbers numerate the incoming particles.

    {\tt  SUBROUTINE PMAS(NSUB,NPRTCL,REAL*X VAL)}\\ 
returns the particle mass. Incoming parameters are: {\tt NSUB} - the subprocess
number and {\tt NPRTCL} - the ordering number of particle.
 Returned parameter is VAL. In the case when LENR()=8 VAL must be a REAL*8
variable, otherwise it must be described as a REAL*16 one.

    {\tt  FUNCTION NVAR()}\\ 
returns a number of physical parameters involved in the calculation.
      
     {\tt SUBROUTINE VINF(NUMVAR,CHARACTER *6 NAME,REAL*8  VAL)}\\
provides the information about physical parameters involved into evaluations.
It returns the physical   parameter name NAME and its value VAL. 
The incoming {\tt NUMVAR}  is the parameter ordering number which
must be smaller than or equal to {\tt NVAR()}.
 
      {\tt SUBROUTINE ASGN(NUMVAR,REAL*8 VALNEW)}\\
assigns to the parameter {\tt NUMVAR} a new value {\tt VALNEW}.

      {\tt SUBROUTINE VINI}\\
makes the initialization of all physical parameters.  

{\tt      SUBROUTINE CPTH(CHARACTER*60 PATH, CHARACTER*1 F\_SLASH) }\\
assigns new values to all its parameters. {\it PATH}
is the path to the \CompHEP~ root directory (see Section \ref{u-install}). 
 {\tt F\_SLASH} is a symbol which separates file name in
the path. It is "/" or "\verb|\|" in the {\it UNIX} and {\it MS-Windows}  cases correspondingly.
  

  {\tt    REAL*8 FUNCTION SQME(NSUB)}\\ 
returns a numerical value of squared matrix element for the subprocess {\it NSUB}. 
Summation over out-particle polarization states and an averaging over
in-particle polarization states are carried out. Information about scalar
products of momenta must be passed on to the {\it SQME} through 
\begin{equation}
\label{SCLR} 
{\it COMMON/SCLR/ REAL*X~ PP(15)}
\end{equation}
 The assignments of scalar product values  to elements of the  {\it PP}
array,  like
$$PP(INDX(k,l)) = p_k.p_l\;\;\;  , $$
must be done before the {\it SQME} call. We assume that all four-momenta 
$p_i$ of particles have  positive energy components $( p_i^0 > 0)$.
 {\it PP} must be of the   {\it REAL*8} type in the case of double precision calculation 
and of the {\it REAL*16} type for the quadruple precision one.
      
  {\it SQME} is sensitive to the states of {\it LOGICAL} flags {\it
GWIDTH} and {\it RWIDTH} from
the {\it COMMON/WDTH/GWIDTH,RWIDTH}. They define the treatment of  particle 
finite width. The {\it GWIDTH} flag indicates that the widths do not break gauge
invariance. {\it RWIDTH} states that the running widths are substituted. See the
discussion in Section \ref{Breit-Wigner}.

   It is assumed that the same units ( for example,  powers of  GeV ) are used
 for momenta and for physical variables.  {\it SQME} produces an answer in
the
 $$[P]^{(2*(NIN()+NOUT()-4))}$$
 units, where {\tt [P]} is a unit of momentum.
Standard normalization for SQME is used. See 
 Eqs. (23.12) and (23.26) in \cite{ParticlesFields}.  When {\it n\_comphep\_f} 
 calls the {\it SQME} function it substitutes momenta in
the {\it GeV} units.
  
      {\tt FUNCTION INDX(K,L)}\\ 
returns the position of  scalar product $p_k.p_l$ in the 
{\it PP} array  (\ref{SCLR}). 
