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

C  case

The user phase space function has a prototype
double usrfun(char * name)
The patch is disposed in the file $COMPHEP/c_source/num/userFun.c. This function is called by n_comphep_c programs if the phase space function whose name is started from the 'U' character is used (see Section Phase space functions). The characters following 'U' are passed to the usrfun routine as its argument.

Particle momenta which are needed to evaluate usrfun are stored in the global variable
double pvect[400]
The $m^{th}$ component of $k^{th}$ momentum occupies the $m+4*(k-1)$ position in pvect. We assume that 'm' varies from 0 to 3 and the 'k' momentum counter starts from 1. The agreement about momentum signs is the same as in the Fortran  case. The number of incoming and outgoing particles and the correspondence between the particle name and momentum number can be determined by means of service functions described in Section C output files.

The work of user structure function is driven by a set of routines similar to those of the Fortran  case. All of them have to be realized by the user if he would like to implement a particular structure function. Patches for these routines are disposed in
$COMPHEP/c_source/num/strfun/sf_prv.c.
This file contains:

1) int p_prv(char *particleName)
returns 1 if the user structure function can be implemented to the particleName particle. Otherwise 0 should be returned. It is used to create a menu of possible structure functions;

2) void m_prv(int i)
is called for the user input of the structure function parameters just after the particular structure function is chosen. It is assumed that the input is saved in some static variables. The argument 'i' here and below means an incoming parton number. It could be 1 or 2;

3) void n_prv(int i, char * funcName )
returns the structure function name. If the structure function has a few tuning parameters then values of these parameters have to be included in funcName. CompHEP  uses the structure function name to keep information about parameters;

4) int r_prv(int i, char *funcName)
checks funcName. If funcName has an appropriate format, r_prv must read the value of parameters, store them in some global variables and returns 1. Otherwise 0 is returned;

5) int mass_prv(int i)
returns the mass of the composite particle which constituents are described by this structure function.

6) double be_prv(int i)
performs needed initializations before structure function evaluation. It returns parameter $be$ which informs CompHEP  that the structure function is singular as


\begin{displaymath}(1-x)^{(be -1)}; \end{displaymath}

7) double c_prv(int i, double x)
returns the value of structure function divided by $be(1-x)^{(be-1)}$, where $x$ is the Feynman scaling variable. It is assumed that possible turning parameters have been stored by r_prv in some static variables.

In the simplest case, if the user would like to implement a new structure function without singularity and extra parameters, he may take a copy of the $COMPHEP/c_source/num/strfun/sf_prv.c file, improve p_prv so that it returns $1$ in any case, and rewrite the originally trivial c_prv function.


CompHEP
 output files User programs in
 CompHEP Fortran case Contents