next up previous contents index
Next: Booking Commands Up: Fortran Application Interface Previous: Fortran Application Interface   Contents   Index


Registration Commands

As the variables used in parameter, test and histogram definitions are intended to refer to variables of the same name used by an analysis code, they must be linked in some manner. This is accomplished by having the analyzer ``register'' any variable that is required by the desciption files. This registration must be performed before the parameters, tests and histograms are booked. Four byte integers and four byte real numbers may be registered. A variable is registered by calling the appropriate registration function with a string giving its name and a pointer to the variable's location in memory. At the time a variable is registered, it must be given a class through the use of the appropriate subroutine call.

  character*length name
  character*LEN title
  integer*4 ierr

  
  integer*4 ilen, rlen
  parameter (ilen=LEN)
  parameter (rlen=LEN)
  integer*4 ival
  integer*4 iarray(ilen)
  real*4 rval
  real*4 rarray(rlen)
  character*LEN string

  ierr=regeventint(name,ival,title)                ! I*4 event variable
  ierr=regeventreal(name,rval,title)               ! R*4 event
  ierr=regeventdouble(name,rval,title)             ! R*8 event
  ierr=regparmint(name,ival,title)                 ! I*4 parameter
  ierr=regparmreal(name,rval,title)                ! R*4 parameter
  ierr=regparmdouble(name,rval,title)              ! R*8 parameter
  ierr=regtestint(name,ival,title)                 ! I*4 test result
  ierr=regtestreal(name,rval,title)                ! R*4 test result
  ierr=regtestdouble(name,rval,title)              ! R*8 test result
  ierr=regeventintarray(name,iarray,ilen,title)    ! I*4 event array
  ierr=regeventrealarray(name,rarray,rlen,title)   ! R*4 event array
  ierr=regeventdoublearray(name,rarray,rlen,title) ! R*8 event array
  ierr=regparmintarray(name,iarray,ilen,title)     ! I*4 parameter array
  ierr=regparmrealarray(name,rarray,rlen,title)    ! R*4 parameter array
  ierr=regparmdoublearray(name,rarray,rlen,title)  ! R*8 parameter array
  ierr=regtestmintarray(name,iarray,ilen,title)    ! I*4 test result array
  ierr=regtestrealarray(name,rarray,rlen,title)    ! R*4 test result array
  ierr=regtestdoublearray(name,rarray,rlen,title)  ! R*8 test result array

  ierr=regparmstring(name,string,title)            ! Character string

The title argument is an arbitrary string that may be used to label a variable. It may be omitted by using a zero instead of a string. The above functions return an error code, zero for success, and not zero for failure. No specific meanings have been assigned yet for the failure error codes.

The memory locations of the variables that are registered must be static. In Fortran this can be guaranteed by placing all variables that are registered in common blocks. (Or by listing the variables in SAVE statements.)

A test result variable does need not to be registered unless one wants access to the test result from within the source code. An example would be where one wants to condition analysis (peformed after executing a test block) on the result of one of the tests.

If a test result is to be a real value, then the variable or array must be registered before the tests are booked.


next up previous contents index
Next: Booking Commands Up: Fortran Application Interface Previous: Fortran Application Interface   Contents   Index
Mohammad Ahmed 2003-07-23