Reaction Package for Sunsort

Relies on: nothing
C include file: evsubs.h
FORTRAN include files: subs.i and evsubs.i

This package allows the user to manipulate the properties of reactions which are used by several other packages.

In C the user can declare as many reaction structures as they like and choose which reaction structure is used when. However, there is one global variable, reac, holding a default reaction which is the one accessed by FORTRAN and the one used for the default event-struct structure.

The reaction structure in C is as follows:

        struct reac {
            double edisp;
            double e1;
            double p1;
            double mass[];
            double q1;
            double vcm;
        };
      

Where the elements have the following meanings:

Edisp
holds the dispersion used to convert energy values in MeV into values used by the programs. If, for example, you prefer all your energies to be measured in keV, then set this to 1000.
E1
holds the beam energy. Divide by edisp to get MeV.
P1
holds the beam momentum. It is defined as sqrt(2*mass[1]*e1).
mass[1]
is the mass of the projectile.
mass[2]
is the mass of the target.
mass[0]
is used as a default mass of a detected particle by some other packages.
mass[2..]
are not defined yet, neither is the size of the array.
q1
is not used at the moment.
vcm
holds the centre of mass velocity. It's defined as p1/(mass[1]+mass[2]). reac_init sets this automatically but the other routines don't. It's up to the user to keep this up to date as several other packages rely on this value.

At the moment, elements of this structure are free to be accessed directly in C, but note that changing the values may confuse packages which rely on them and so may give inconsistent results. It is recommended, therefore, that even in C the user go through the reacs routines to set these values so that later code may be added to these routines to correctly handle any changes. The reac_init routine may also be used instead of the reacs routines.

At the time of writing, the reacs and reac_init functions do not guarantee safety, so they should only be called before any routines in packages which rely on this package.

Routines

int reac_init(int type);
integer function reac_init(integer type)

Initialise the reaction package from the file calib-inputs/reac.cal. This filename is hard coded. If you don't wish to use this, then simply set all the members of the structure listed above.

The format of the file is:

	     beam_energy   dispersion
	     projectile_mass	target_mass
	     hitmass
      

Anything from a *, # or ! to the end of a line is ignored.

The beam_energy should be specified in MeV. It will be multiplied by edisp before it's inserted into the reaction structure.

This function returns OK (in C) or SS_OK (in FORTRAN) if the file loads OK, it returns ABORT (in C) or SS_ABORT (in FORTRAN) if there's a problem.

type should be REAC_SORT for a sort code or REAC_SIM for a simulation.

double reac_edisp(void);
double precision function read_edisp()

Returns reac.edisp.

void reacs_edisp(double value);
subroutine reac_edisp(double precision value)

Sets reac.edisp.

double reac_e1(void);
double precision function read_e1()

Returns reac.e1.

void reacs_e1(double value);
subroutine reac_e1(double precision value)

Sets reac.e1.

double reac_p1(void);
double precision function read_p1()

Returns reac.p1.

void reacs_p1(double value);
subroutine reac_p1(double precision value)

Sets reac.p1.

double reac_mass(int i);
double precision function read_mass(integer i)

Returns reac.mass[i].

void reacs_mass(int i, double value);
subroutine reac_mass(integer i, double precision value)

Sets reac.mass[i].

double reac_vcm(void);
double precision function read_vcm()

Returns reac.vcm.

void reacs_vcm(double value);
subroutine reac_vcm(double precision value)

Sets reac.vcm.


Steven M. Singer
Last modified: Thu Sep 30 20:39:42 BST 1999