Документ взят из кэша поисковой машины. Адрес оригинального документа : http://theory.sinp.msu.ru/comphep_html/tutorial/node51.html
Дата изменения: Wed Aug 9 20:40:47 2000
Дата индексирования: Mon Oct 1 22:44:25 2012
Кодировка:
Fortran  case C case User programs in
 CompHEP Concept of user
 program implementation Contents

Fortran  case1

The user phase space function is evaluated by
REAL*8 FUNCTION USRFUN(CHARACTER *9 TEXT)

The patch is disposed in the file $COMPHEP/f_source/usr/u_var.f.

This function is called by n_comphep_f and $COMPHEP/genEvents programs if the phase space function whose name begins with the 'U' character is used (see Section Phase space functions). The characters following 'U' are passed to the USRFUN routine as its argument.

To create this function one needs to know the particle momenta. They are stored in

COMMON/PVECT/ REAL*8 P(0:3,100)
The first argument of array P is a Lorentz momentum component. $P(0,N)$ is the energy of the $N^{th}$ particle. We have $P(0,N)>0$ as for incoming as for outgoing particles. In the case of collision process $ P(3,N)$ is a projection of the particle space momentum onto the collision axis. The direction of this axis is chosen so that $P(3,1) > 0$ and $P(3,2) < 0$.

The second argument of this array is a momentum ordering number. The first momentum numbers are assigned to incoming particles and the subsequent ones are assigned to outgoing particles. The numbers of incoming and outgoing particles and a correspondence between the particle name and the momentum number may be determined by means of service functions described in Section Fortran  output files.

The work of user structure function is controlled by a set of routines. The patches for them are disposed in $COMPHEP/f_source/usr/sf_prv.f. All of them should be realized by the user:

1. LOGICAL FUNCTION P_PRV(CHARACTER*6 P_NAME)
returns TRUE if the user structure function can be applied to the P_NAME particle. It is used to create the menu of possible structure functions for the particle P_NAME.

2. SUBROUTINE M_PRV(I)
is called for the user input of the structure function parameters just after the user structure function has been chosen. It is assumed that this routine saves values of the entered parameters in some COMMON for subsequent usage in N_PRV described below. The argument 'I' here and in the following means an incoming parton number. It can be 1 or 2.

3. CHARACTER*60 FUNCTION N_PRV(I)
returns the structure function name. If the structure function has a few tuning parameters then the values of these parameters must be included in the returned name. CompHEP  uses the structure function name to keep information about parameters.

4. LOGICAL FUNCTION R_PRV(I,CHARACTER*60 NAME, REAL*8 CMASS, REAL*8 BE)
checks NAME. If NAME has the same format as the one produced by N_PRV(), R_PRV() should read the parameter values, store them in some global variables for subsequent usage, and return TRUE. Otherwise FALSE is returned. REAL*8 CMASS and REAL*8 BE are outgoing parameters. The first one must be equal to the mass on the composite particle which constituents are described by user's structure function. The second one informs CompHEP  that the structure function is singular as

$ (1-X)^{(BE-1)} $, where $0<BE\leq 1$.
In the nonsingular case $BE=1$ must be returned.

5. REAL*8 FUNCTION C_PRV(I,REAL*8 X)
returns the value of structure function divided by $BE*(1-X)^{(BE-1)}$. Here $X$ is the Feynman scaling variable. It is assumed that possible structure function parameters having been stored by R_PRV are used for evaluation. The structure function is normalized so that

\begin{displaymath}be(1-x)^{be-1}c\_prv(i,x)dx\end{displaymath}

is a probability to find the $i^{th}$ parton with fractions $[x, x+dx]$ of initial momentum.

In the simplest case, if the user would like to implement a new structure function without singularity and extra parameters, he can just take a copy of the $COMPHEP/f_source/usr/sf_prv.f file, improve P_PRV so that it returns $'.TRUE.'$ anyway, and rewrite originally trivial C_PRV.



Footnote

Below we insert parameter type definitions into headers of the Fortran  routines. It is done for brevity only and contradicts to the Fortran  style

C case User programs in
 CompHEP Concept of user
 program implementation Contents