next up previous contents index
Next: Sample common blocks Up: Sample Code Previous: Sample Code   Contents   Index

Sample Variable registration

Before the CTP input file can be read in, the variables used must be registered by the physics analysis code. We do that by a call to the following routine:
  subroutine regallvars()

  implicit none

  include 'parcommon.inc'
  include 'testcommon.inc'
  include 'eventcommon.inc'

  integer*4 regparmint, regparmreal
  integer*4 ierr
c
c Register the parameters used in the ``constants block''
c
  ierr = regparmreal('proton',proton,'Mass of the proton')
  ierr = regparmreal('neutron',neutron,'Mass of the neutron')
  ierr = regparmreal('pion',pion,'Mass of the charged pion')
  ierr = regparmreal('pizero',pizero,'Mass of the neutral pion')
  ierr = regparmrealarray('offsets',offsets,8,'An array of offsets')
  ierr = regparmreal('thmin',thmin,'Low end of theta cut')
  ierr = regparmreal('thmax',thmax,'High end of theta cut')
  ierr = regparmreal('phimin',phimin,'Low end of phi cut')
  ierr = regparmreal('phimax',phimax,'High end of phi cut')
  ierr = regparmstring('hbook_filename',hbook_filename,
		'HBOOK Filename')
  ierr = regparmstring('report_filename',report_filename,
		'Report Generator Filename')
c
c Register some test result variables.  Only the array clean is
c registered as CTP will automatically register test result variables
c as the test block is booked.  If you want to easily access
c
  ierr = regtestintarray('clean',clean,6,'Array of test results')
c
c Register variables that are recalculated each event which contain
c quantities that may be histogrammed.
c
  ierr = regeventreal('mass',mass,'Calculated mass')
  ierr = regeventreal('fptheta',fptheta,'Theta angle at focal plane')
c
  return
  end



Mohammad Ahmed 2003-07-23