MOCADI 1.34-3.2

Naohito IWASA
Gesellschaft für Schwerionenforschung m.b.H.,
Planckstr. 1, 64291 Darmstadt, Germany

Present Address: Department of Physics, Tohoku University
Sendai, Miyagi, 980-8578, Japan

revised: 31st Jul. 2008

Index

  1. Introduction
  2. Environment Setup
  3. MOCADI Input Files
  4. ATIMA-1.0, BEAM, BR_SLIT, CALL,
    CHARGE_STATES, COLL, COMMENTS, DRIFT,
    DRIFT-IN-GAS, END, EPAX, EPAX-PARAMETER,
    EXPECTED_VALUES, FRAGMENT, HBOOK, IN-FLIGHT-DECAY,
    LOOP-ENDLOOP, MATRIX, MATRIXFILE, MATTER,
    OPTION, PRIMARY_BEAM, PRINT_COLL, PRINT_MATRIX,
    RAND, RANDOMIZE, REACTION_TARGET, READ,
    RESET, SAVE, SHIFT, SLIT,
    STOP, TABLE, TARGET, WEDGE
  5. How to execute MOCADI
  6. MOCADI Output Files
  7. A standard routine for MOCADI calculation

1 Introduction

A precise knowledge of phase-space-density distributions of relativistic heavy ions penetrating through layers of matter in ion-optical systems taking into account of higher-order image aberrations is important for experiments with energetic secondary beams. For the purpose, the Monte Carlo code MOCADI was developed in the late 1980's by T. Schwab, H. Geissel, and A. Magel on IBM computers with PL/I language. MOCADI has been used for design studies of the fragment separator (FRS) at GSI and is used for preparation and analysis of experimental programs at the FRS. MOCADI is an excellent tool for studying beam properties, luminosity, separation quality, implantation profiles, optimization of the experimental setup, and transmission.
We translated MOCADI into C-language on the LINUX and improved its input and output format. CERN-standard one- and two-dimensional histograms (HBOOK) and list-mode output (NTUPLE) are available. Recently a precise knowledge of the atomic and nuclear interaction of relativistic heavy ions with matters was reported. The former was tested in a series of experiments. [C.Scheidenberger et al., Phys. Rev. Lett. 73, 50 (1994); C.Scheidenberger et al., Phys. Rev. Lett. 77, 3987 (1996).] which leads to an improved theory. MOCADI includes this in the form of the energy loss code for heavy ions ATIMA-1.0. If you have any problems with the MOCADI, please contact with Naohito Iwasa, or Helmut Weick.

2 Environment Setup

In this section, I explain how to install MOCADI in your Linux. One can download the mocadi-34-32 and the tar-gzipped data file. The former was compiled by Fedora 7 . First, unpack the mocadi-data.tgz file using the following command
tar zxvf mocadi-data.tgz
If you have super user account, we recommend to move the data directory to /usr/local/mocadi, which is the default directory for MOCADI. If not, one can set the directory by defining the environment variable MOCADI_DIR using the following command.
setenv MOCADI_DIR /home/user/mocadi (for csh)
export MOCADI_DIR="/home/user/mocadi" (for ksh))

If you have super user account, please type following commands.

su
cd /usr/local
mkdir mocadi
cd mocadi
tar zxvf ~user/mocadi-data.tgz
mkdir exe
cd exe
mv ~user/mocadi-34-32 ./
ln -s mocadi-34-32 /usr/local/bin/mocadi
When you don't have super user account, please type following commands.
cd
mkdir mocadi
cd mocadi
tar zxvf ../mocadi-data.tgz
mkdir exe
cd exe
mv ~/mocadi-34-32
ln -s mocadi-34-32 mocadi
alias mocadi ~/mocadi/exe/mocadi
setenv MOCADI_DIR /home/user/mocadi/ (in case of csh)

A MOCADI version which can make Root/Tree listmode outputs was available. However it cannot run in the computer which root is not installed or different version of root or gcc is installed. The version which compiled by Fedora 7 using root_v5.20.00 is mocadi-34-32.FC7R520, and the version which compiled by Debian 3.1 using root_v5.12.00 is mocadi-34-32.DB31R512.

3.MOCADI Input Files

A MOCADI input file (the default extension is ".in") is necessary for executing MOCADI. The input file consists of comment lines and keyword lines as shown in APPENDIX. The keywords are not case sensitive.

3.1 Comments

Comments can be inserted at any place in the input file as line comments and block comments

Line Comment

* line of comment

Block Comments

/*
lines
of
comments
*/

3.2 END

END
The "END" keyword marks the end of an input file. The keyword should be written at least once in a MOCADI input file. Keywords that follow the "END" keyword are ignored.

3.3 BEAM

The "BEAM" keyword marks the beginning of Monte Carlo simulation. This keyword or the "READ" keyword described latter should be written once as the first keyword in a MOCADI input file.

BEAM
N
E0, T0, mass, charge, electron
modeXA
maxX, maxA, rXA,X0, A0
modeYB
maxY, maxB, rYB, Y0, B0
modeET
maxE, maxT, rET, E1, T1

N ions of the primary beam with charge, mass, electrons are produced with initial position distribution (X, Y), angular distribution (A, B), energy distribution (E) and time distribution (T). The initial distributions are calculated event by event as follows. (The r parameter is not used up to now.)

X=X0+dX
A=A0+dA
Y=Y0+dY
B=B0+dB
E=E0*(1+(E1+dE)/100)
T=T0*(1+(T1+dT)/100)

where distributions dX, dA, dY, dB, dE, and dT are calculated from mode*, max* and r* parameters.
mode
0 fixed. d=max
1 uniform distribution, -max* < d* < +max*
2 Gaussian distribution, sigma*=max*
4 uniform distribution in the Ellipse (d1/max1)2+(d2/max2)2<= 1
6 uniform distribution in the 6 dimensional Ellipse (only for modeXA), (dX/maxX)2 + (dA/maxA)2 + (dY/maxY)2 + (dB/maxB)2 + (dE/maxE)2 + (dT/maxT)2 <= 1
7 uniform distribution in the 4 dimensional Ellipse (only for modeXA), (dX/maxX)2 + (dA/maxA)2 + (dY/maxY)2 + (dB/maxB)2 <= 1
8 uniform distribution in the 2 dimensional Ellipse (only for modeXA), (dX/maxX)2 + (dY/maxY)2 <=1, (dA/maxA)2 + (dB/maxB)2 <= 1
9 Gaussian distribution with sigmaX=maxX, sigmaA=maxA, sigmaY=maxY, sigmaB=maxB, sigmaE=maxE, sigmaT=maxT, (only for modeXA
The units of energy(E), time(T), position(X, Y), and angle(A, B) are MeV/u, micro-second, centimeter, and milli-radian, respectively.

3.3a READ (from version 3.1)

READ
N
filename
format, isave, fragment, option

The "READ" keyword marks to read beam parameters from listmode file of filename instead of using the "BEAM" keyword. Note that the keyword cannot be used together with the "TARGET" keyword.
format 5: ASCII format 6: gzipped ASCII format
isave 0: first save point
1: second save point
.........
fragment 0:primary beam
1:fragment 1 (fragment written in TARGET card)
2-:fragment 2- (fragment written in FRAGMENT card)
......

3.4 DRIFT

DRIFT length

or

DRIFT
length

The ``DRIFT'' keyword defines a distance of length[cm] along the optical axis in vacuum.

3.4a DRIFT-IN-GAS

DRIFT-IN-GAS
length,mass,charge,thickness
Fklwi, Fenstr

The ``DRIFT-in-gas'' keyword defines an element of length[cm] along the optical axis in a gas specified as mass and charge with a certain thickness of thickness[mg/cm2]. Fklwi and Fenstr are flags (1:on, 0:off) to calculate angular and energy straggling, respectively.

3.4b IN-FLIGHT-DECAY

IN-FLIGHT-DECAY
length,mass,charge,decay_mode, half-life Q-value

The ``IN-FLIGHT-DECAY'' keyword defines an element of length[cm] along the optical axis in vacuum. The particles with mass[amu] and nuclear charge[e] can be decay with half-life[ms]. When half-life is set to zero, it decays with sufficient long half-life, but all the particles decays in the element. When Q-value[MeV] is set to zero or higher than Q value to the ground state, Q value is calculated from the mass table, assuming decay to the ground state of daughter nuclei.
decay_mode
1 alpha decay
2 beta - decay
3 electron capture decay
4 beta + decay
5 proton decay

3.5 COLL

COLL shape, X0, Y0, Xmax, Ymax, sig_fac

or

COLL
shape, X0, Y0, Xmax, Ymax, sig_fac

The ``COLL'' keyword marks to place a collimator. The possible collimator shapes are given in the table. The units of X0, Y0, Xmax, Ymax, sig_fac are centimeters.
shape
1 A rectangular position collimator X0-Xmax < X < X0+Xmax, Y0-Ymax < Y < Y0+Ymax
2 A rectangular angular collimator X0-Xmax < A < X0+Xmax, Y0-Ymax < B < Y0+Ymax
3 A elliptical position collimator ((X-X0)/Xmax)2 + ((Y-Y0)/Ymax)2 < 1
4 A special position collimator designed for FRS X0-Xmax < X < X0+Xmax, Y0-Ymax < Y < Y0+Ymax, abs((X-X0)(Y-Y0)) < sig_fac2/2 

3.5a SLIT

SLIT

XMIN, XMAX, YMIN, YMAX

The ``SLIT'' keyword defines a rectangular collimator (XMIN < X < XMIN, YMIN < Y < YMIN)

3.6 MATRIX

MATRIX
filename
A0, Z0, E0
order1, order2

or

MATRIX, filename, order1, order2, A0, Z0, E0

The ``MATRIX'' keyword marks to place a part of a magnetic ion-optical system described by a transfer matrix.
The matrix parameters of the system should be written in filename in the directory which is marked by the ``MATRIXFILE'' keyword. MOCADI can read output files by GIOS, TRANSPORT and GICOSY (I tested only GICOSY matrix). The matrix parameters up to order1th order are used in the calculation (max. up to 3rd order). The magnetic rigidity is calculated from information of the reference particle, A0 [amu], Z0 , and E0 [MeV/nucleon]. Note that this keyword moves the z-position by the length specified in the matrix file.

3.7 SAVE

SAVE

 
The ``SAVE'' keyword sets that MOCADI stores a list-mode output file with all particle coordinates (positions, directions, energies and so on) by event by event. Output filename and Format are chosen by using the "OPTION LISTMODE" keyword.

3.8 TARGET

TARGET
At, Zt, rho, dist
Af, Zf
mode, thickness, Aref, Zref, Eref
Fklwi, Fenstr, Fgold, Fwico, Fkauf, Ffiss

The ``TARGET'' keyword marks to place here a target.
At mass of the target
Zt charge of target
rho density in mg/cm3
dist formula for momentum distribution of fragment
0: determined by Fgold
1: Goldhaber (Phys. Lett. 53B, 306)
2: Morrissey (Phys. Rev. C39, 460)
3: Lorentzian 4: zero width
Af fragment mass
Zf fragment charge
mode thickness input mode
1,2 : thickness in ratio of range of reference particle
3,4 : thickness in cm
5,6 :thickness in mg/cm2
thickness target thickness
Aref mass of reference particle
Zref charge of reference particle
Eref energy of reference particle [MeV/nucleon]
Fklwi small angle scattering
1 : on
0 : off
Fenstr energy straggling
1 : on
0 : off
Fgold parameter of momentum distribution
if dist=0
1 : Goldhaber (Phys. Lett. 53B, 306)
-1 : Morrissey (Phys. Rev. C39, 460)
0 : no fragmentation
if dist=1
scale factor from Goldhaber distribution (Phys. Lett. 53B, 306)
if dist=2
scale factor from Morrissey distribution (Phys. Rev. C39, 460)
if dist=3
dP//=dPt MeV/c for Lorentzian distribution
Fwico Coulomb scattering
1 : on
0 : off
Fkauf energy loss in fragmentation
1 : Kaufmann (Phys. Rev. C22, 1897)
0 : off
-1 :Morrisay (Phys. Rev. C39, 460)
-2 :parabolic formula with e=12MeV (E<200AMeV)
-2 :parabolic formula with e=8MeV (Phys. Rev. C76, 044605)
Ffiss fragment production by fission
0M/b> : off
1 : fission energy from table of M.Bernas
2 : old original Viola systematics from 1966
3 : Brosa formula (Nucl .Phys. A502 423C (1989)); Viola style formula but based on theory
4 : Hinde formula (Nucl. Phys. A472 318 (1987)), considers asymmetric fission for TKE in the symmetric case it coincides with new Viola
5 : Wilkins formula (Nucl. Phys. C14, 1832 (1976)) as used by K.-H. Schmidt, considers asymmetric fission
6 : new article by Viola (Phys. Rev. C31,/b>, 1550 (1985))
In case of fission, Fgold, Fkaufare not used.
Material list are described in subsection 3-25.

3.8a REACTION-TARGET

REACTION-TARGET
At, Zt, rho, dist
Af, Zf, ID,
mode, thickness, Aref, Zref, Eref,
Fklwi, Fenstr, Fgold, Fwico, Fkauf, Ffiss

The "REACTION-TARGET" keyword marks to place a secondary target. The difference from the "TARGET" keyword is following.
1) The beam particles impinge on a target material (At, Zt) with the thickness. All the particles defined by the fragment identifier ID (0: primary beam, 1: secondary beam defined by the TARGET, 2-: secondary beam defined by the FRAGMENT keyword) change to another particle (Af,Zf) by the reaction (100%). The other particles pass through the material without a change.
2) The reaction probability of 100% is not realistic. Please multiply the real reaction probability to the yield.
The other parameters were described as follows. (velocity of fragment= velocity of projectile) non integer values can be used for scaling.
At mass of the target
Zt charge of target
rho density in mg/cm3
dist formula for momentum distribution of fragment
0: determined by Fgold
1: Goldhaber (Phys. Lett. 53B, 306)
2: Morrissey (Phys. Rev. C39, 460)
3: Lorentzian 4: zero width
Af fragment mass
Zf fragment charge
ID fragment ID to select reacting particle
0: projectile,
1:fragment defined in the TARGET keyword,
2-:fragment defined the FRAGMENT keyword
mode thickness input mode
1,2 : thickness in ratio of range of reference particle
3,4 : thickness in cm
5,6 : thickness in mg/cm2
thickness target thickness
Aref mass of reference particle
Zref charge of reference particle
Eref energy of reference particle [MeV/nucleon]
Fklwi small angle scattering
1 : on
0 : off
Fenstr energy straggling
1 : on
0 : off
Fgold parameter of scale momentum distribution
if dist=0
1 : Goldhaber (Phys. Lett. 53B, 306)
-1 : Morrissey (Phys. Rev. C39, 460)
0 : no fragmentation
if dist=1
scale factor for Goldhaber distribution (Phys. Lett. 53B, 306)
if dist=2
scale factor for Morrissey distribution (Phys. Rev. C39, 460)
if dist=3
dP//=dPt MeV/c for Lorentzian distribution
Fwico Coulomb scattering
1 : on
0 : off
Fkauf energy loss in fragmentation
1 : Kaufmann (Phys. Rev. C22, 1897)
-1 : Morrissey (Phys. Rev. C39, 460)
0 : off
Ffiss fragment production by fission
0M/b> : off
1 : fission energy from table of M.Bernas
2 : old original Viola systematics from 1966
3 : Brosa formula (Nucl .Phys. A502 423C (1989)); Viola style formula but based on theory
4 : Hinde formula (Nucl. Phys. A472 318 (1987)), considers asymmetric fission for TKE in the symmetric case it coincides with new Viola
5 : Wilkins formula (Nucl. Phys. C14, 1832 (1976)) as used by K.-H. Schmidt, considers asymmetric fission
6 : new article by Viola (Phys. Rev. C31,/b>, 1550 (1985))
In case of fission, Fgold, Fkaufare not used.
The material list is described in subsection 3-25.

3.9 WEDGE

WEDGE
Aw, Zw, rho
thick0, thick1, thick2
mode, Aref, Zref, Eref
Fklwi, Fenstr, Fgold, Fwico
modeu, thicku0, thicku1, thicku2

The ``WEDGE'' keyword marks to place a wedge-shaped energy degrader.
 

 
Aw mass of degrader
Zw charge of degrader
rho density in mg/cm3
mode input mode of degrader thickness
thick = thick0 + thick1*X + thick2*X2
1,2: thickness in rate of the range of the reference particle
3,4: thickness in cm
5,6: thickness in mg/cm2
Aref mass of reference particle
Zref charge of reference particle
Eref energy of reference particle [MeV/nucleon]
Fklwi small angle scattering
1 :on;
0 :off
Fenstr energy straggling
1 :on
0 :off
Fgold empirical momentum distribution of fragments
1 :Goldhaber (Phys. Lett. 536, 306)
-1 :Morrissey (Phys. Rev. C39, 460)
0 :off
Fwico Coulomb scattering
1:on
0:off
modeu wedge thickness random mode;
0 :degrader thickness fixed
1 :rectangular distribution
2 :Gaussian distribution
thicku0 thick0 = thick0 * (1 + rnd * thicku0)
thicku1 thick1 = thick1 * (1 + rnd * thicku1)
thicku2 thick2 = thick2 * (1 + rnd * thicku2)
The material list is described in subsection 3-25.

3.10 FRAGMENT

FRAGMENT
mode, para
Z1, A1
..., ...
Zn, An

calculation of many fragments
mode para
1 loop around selected fragment number of loop around reference
2 use fragment list number of fragments in following lists

3.11 BR_SLIT

BR_SLIT
A, Z, E, dBrho/Brho
X0, Y0, Xmax, Ymax
A0, B0, Amax, Bmax

Only particles within the specified Brho,X,Y,A,Bgate are transmitted.
A mass
Z charge
E energy in MeV/nucleon
dBrho/Brho momentum width
X0 x-center in cm
Y0 y-center in cm
Xmax horizontal position acceptance in cm
Ymax vertical position acceptance in cm
A0 horizontal angular center in X in mrad
B0 vertical angular center in Y in mrad
Amax horizontal angular acceptance in mrad
Bmax vertical angular acceptance in mrad

3.12 EXPECTED_VALUES

EXPECTED_VALUES
creates an output in the .out file and gives mean values and deviations at the point as follows.
  ********* erwartungswerte   1 *********************************************
   i_fragment  =         1
   tr: teilchen  =       5000 wi: teilchen  =        5000.000 (      5000.000)
The values of ``tr: teilchen'' and `` wi: teilchen'' are the number of particles out of the initial number "N" defined in the "BEAM" keyword, which reaches the position with and without reaction loss in matter, respectively. The number in the bracket is normalized by production ratio of the first fragment.
      tr: opt    =          1    tr: total =          1
The values of ``tr: opt'' and `` tr: total'' are optical and total transmission, respectively.
      yield  =     1.75199e-15 particle/incident particle
                       z   =          0.0000cm

     <     x     >=  1.845662e-03 cm     sigma     x     =  1.504662e-01 cm
   max     x      =  2.978668e-01 cm       min     x     = -2.985561e-01 cm

     <     a     >=  3.880326e-02 mrad   sigma     a     =  9.157174e+00 mrad
   max     a      =  3.433984e+01 mrad     min     a     = -3.546690e+01 mrad

     <     y     >= -2.233547e-04 cm     sigma     y     =  1.508757e-01 cm
   max     y      =  2.988374e-01 cm       min     y     = -2.982259e-01 cm

     <     b     >= -7.961342e-02 mrad   sigma     b     =  9.101841e+00 mrad
   max     b      =  2.994561e+01 mrad     min     b     = -2.841818e+01 mrad

     <  energie  >=  6.608078e+02 MeV/u  sigma  energie  =  1.736236e+01 MeV/u
   max  energie   =  7.184377e+02 MeV/u    min  energie  =  6.011868e+02 MeV/u

     <   time    >=  0.000000e+00 mu s   sigma   time    =  0.000000e+00 mu s
   max   time     =  0.000000e+00 mu s     min   time    =  0.000000e+00 mu s

     <  mass     >=  7.594830e+01  u     sigma  mass     =  2.829050e-05  u
   max  mass      =  7.594830e+01  u       min  mass     =  7.594830e+01  u

     <    z      >=  2.800000e+01        sigma    z      =  0.000000e+00
   max    z       =  2.800000e+01          min    z      =  2.800000e+01

     < electrons >=  0.000000e+00        sigma electrons =  0.000000e+00
   max electrons  =  0.000000e+00          min electrons =  0.000000e+00

     <  nf/nsf   >=  1.000000e+00        sigma  nf/nsf   =  0.000000e+00
   max  nf/nsf    =  1.000000e+00          min  nf/nsf   =  1.000000e+00

     <  tof-tim  >=  0.000000e+00 mu s   sigma  tof-tim  =  0.000000e+00 mu s
   max  tof-tim   =  0.000000e+00 mu s     min  tof-tim  =  0.000000e+00 mu s

     <  delta e  >=  8.212329e+03 MeV    sigma  delta e  =  3.961656e+03 MeV
   max  delta e   =  1.522776e+04 MeV      min  delta e  =  1.336284e+03 MeV

     <   brho    >=  1.168379e+01  Tm    sigma   brho    =  1.936613e-01  Tm
   max   brho     =  1.232150e+01  Tm      min   brho    =  1.101235e+01  Tm

3.13 STOP

STOP
A,Z
The ``STOP'' keyword stops the beam and the remaining flight length in matter with mass A and charge Z is calculated. The material list is described in subsection 3-25.

3.14 RESET

RESET
The ``RESET'' keyword defines the start of the TOF measurement.

3.15 RAND

RAND
sigmaX, sigmaA, sigmaY, sigmaB, sigmaE, sigmaT, sigmaTOF
sigma X=X+sigmaX*rand
sigma A=A+sigmaA*rand
sigma Y=Y+sigmaY*rand
sigma B=B+sigmaB*rand
sigma E=E+sigmaE*rand
sigma T=T+sigmaT*rand
sigmaTOF TOF=TOF+sigmaTOF*rand
A Gaussian distribution is randomly added to each variables.

3.15a SHIFT

SHIFT
dX, dY, dZ, dX', dY', dTOF

The ``SHIFT'' keyword shifts all the ions coordinates by -dX cm, -dY cm, -dZ cm, -dX' mrad, -dY'mrad -dTOF ns.

X=X+dX
Y=Y+dY
Z=Z+dZ
X'=X'+dX'
Y'=Y'+dY'
TOF=TOF+dTOF

3.16 MATTER

MATTER
Am, Zm, rho
mode, t1, t2, t3,t4
modeg, g1, g2
dx, dy, angle
Fklwi, Fenstr
modeu, thicku0, thickdu1,thickdu2

Am mass of matter
Zm charge of matter
rho density in mg/cm3
mode target thickness input mode
modeg geometry input mode
dx shift in x-direction in cm
dy shift in y-direction in cm
angle turn angle in degree
Fklwi small angle scattering 1:on, 0:off
Fenstr energy straggling 1:on, 0:off
modeu matter thickness random mode
thicku0 thick0=thick0*(1+rnd*thicku0)
thicku1 thick1=thick1*(1+rnd*thicku1)
thicku2 thick2=thick2*(1+rnd*thicku2)
mode unit t1 t2 t3 t4
1 reference rate mass charge energy
2 cm thickness
3 mg/cm2 thickness
modeg function g1 g2
0 homogeneous matter
1 degrader slope
[/cm](mode=1)
[](mode=2)
[mg/cm3](mode=3)
2 round wire distance [cm]
3 rectangular wire distance [cm] strip width[cm]
4 hole target hole radius [cm]
modeu
0 degrader thickness fixed
1 rectangular distribution
2 Gaussian distribution
All angles are measured counter clockwise form y-axis.
Additional parameters as follows are calculated from above parameters.
turn_angle_mrad, lr, thick0, thick1, thick2
The material list are described in subsection 3-25.

3.17 TABLE

TABLE
N
erwa1, element1
.................
erwan, elementn

To generate a table with the determined values.
n number of table entry
erwa number of"EXPECTED_VALUES" in the input file (e.g. when 3, a value of the 3rd EXPECTED_VALUES is printed)
element key number from list below
element
1x [cm]
2a [mrad]
3y [cm]
4b [mrad]
5energy [MeV/nucleon]
6time [micro-second]
7masse [amu]
8z
9electrons
10nf/nsf
11range [mg/cm2]
12tof-tim [micro-second]
13delta-e [MeV/nucleon]
14brho [Tm]
15optical transmission, no sigma value
16total transmission, no sigma value
17z-position [cm], no sigma value
18yield(particle/incident particle)
for sigma value, add 100 to respective key number.

3.18 MATRIXFILE

MATRIXFILE
directory

The ``MATRIXFILE'' keyword sets the path name to the directory where the matrix files are read from using the ``MATRIX'' keyword.
directory name of the directory for matrix input
default: current directory

3.19 PRIMARY_BEAM

PRIMARY_BEAM
primcharge

The "PRIMARY_BEAM" keyword is a flag to primary beam as well.
primcharge =0 Atomic charge states are calculated in the same way as for fragments
=1Charge-state distribution is calculated (independent of switch in the keyword "CHARGE_STATES", but the distribution, which is defined in this element is used)

3.20 CHARGE_STATES

CHARGE_STATES
n
prob0, prob1, ..., prob(n-2)

The charge-state distribution is calculated. Each ion is randomly assigned a new charge state according to the given probabilities.
n distribution with n charge states
prob0 ions with no electrons in %
prob1 ions with one electrons in %
prob(n-1) ions with n-1 electrons in %
The fraction missing to 100% is filled up with ions with n-1 electrons Less than 9 "CHARGE-STATES" keywords can be used.

3.21 HBOOK

hbook, 1, xid, xbin, xmin, xmax (for 1 dimensional histogram)
or
hbook, 2, xid, xbin, xmin, xmax, yid, ybin, ymin, ymax (for 2 dimensional histogram)

The keyword marks to produces HBook histogram from all ion data at this point,
variables type
xid, yid integer ID number of information which you want to see. 1:x, 2:a, 3:y, 4:b, 5:energy, 6:time, 7:mass, 8:charge, 9:electrons, 10:nf/nst, 11:range, 12:ToF_time, 13:dE, 14:Brho 
xbin, ybin integer number of channels for x and y axis
xmin, xmax real lower and upper edges of X channels
ymin, ymax real lower and upper edges of Y channels

3.22 OPTION

OPTION option [,option]....

Available options are follows.

3.22.1 PMATRIX

OPTION, PMATRIX

The keyword sets that all matrix elements of all magnets is written to the standard output file "*.out". The order of matrix printed is determined by the order2 parameter set in the ``MATRIX'' keywords.

3.22.2 PCOLL

OPTION, PCOLL

The keyword sets that the number of particles after passing through each collimator is written to the standard output file ``*.out'' and to a collimator output file ``*.coll''.

3.22.3 LISTMODE

OPTION, LISTMODE, CWN
or
OPTION, LISTMODE, RWN
or
OPTION, LISTMODE, SATAN
or
OPTION, LISTMODE, ASCII
or
OPTION, LISTMODE, GZASCII
or
OPTION, LISTMODE, TREE (experimental)
or
OPTION, LISTMODE, NONE

The keyword defines filename and format of the list-mode output as described in next column. MOCADI makes an NTUPLE entry "1" with a CWN variable length format in an HBOOK output file ``*.hbk'' when you write the "OPTION LISTMODE CWN" keywords in the standard input file.
In the case of the "OPTION LISTMODE RWN" keyword, MOCADI makes NTUPLE entries for all save points with an RWN fixed length format in the HBOOK output file.
For the "OPTION LISTMODE SATAN" keyword, MOCADI makes a SATAN output format almost the same as that by IBM-MOCADI. (The keywords may not be supported for future MOCADI because the ``cwn'' output is more beneficial.) By using the option, 20 real numbers (10 for offsets and 10 for widths) and output-filenames are necessary for the output. They are read from 3 lines just after the "OPTION LISTMODE SATAN" line. Its format is same as that of the 3 lines just after the "END_SATAN" keyword of IBM-MOCADI.
The "OPTION LISTMODE ASCII" keywords gives ascii tables. GZASCII is the same but gzipped.
The "OPTION LISTMODE TREE" keyword can be used in the special version of MOCADI (see section 2). Using this keyword, MOCADI makes Tree entries of ROOT for all save points. (from version 3-2)
In the case of the ``OPTION LISTMODE NONE'' keywords, MOCADI does not create any list-mode outputs (the "save" keyword is ignored). The defaults list-mode is CWN format.

3.22.4 ELECTRIC (from version 3-0)

OPTION ELECTRIC

In MOCADI version 2.x, only matrix elements for magnetic field were used for calculation. From version 3.x, matrix elements for electric fields made by GICOSY also can be used in the calculation. To preserve compatibility, this option for electric field calculation was introduced.
When this option is set in the input file and transfer matrix is calculated by GICOSY, the additional matrix elements for the electric field (e.g. [*,M*]) will be used.

3.23 PRINT_MATRIX

PRINT_MATRIX

The function of the keyword is same as ``OPTION PMATRIX''

3.24 PRINT_COLL

PRINT_COLL

The function of the keyword is same as ``OPTION PCOLL''

3.25 ATIMA-1.0

ATIMA-1.0

The keyword defines that MOCADI uses the same formulas for energy loss, energy straggling, and angular straggling in the layers of matter as ATIMA-1.0. (P. Malzacher and C. Scheidenberger, private communications) All material (A,Z) from Z=1 to Z=92 including isotopes, and composite materials or materials in the liquid state are listed in the table below (compounds are identified by using Z higher than 200). Note that the compound materials cannot be used as a target.
From version 3.2, MOCADI can be uses only ATIMA-1.0.
a material list with
the ATIMA-1.0 keyword
material AZ
H-U 1-238 1-92
plastic 0 201
air 0 202
polyethylene 0 203
liquid Hydrogen 0 204
liquid Deuterium 0 205
water 0 206
diamond 0 207
glass 0 208
AlMg3 0 209
Ar_CO2_30 0 210
CF4 0 211
Isobutene 0 212
Kapton 0 213
Mylar 0 214
NaF 0 215
P10_gas 0 216
Polyolefin 0 217

3.26 EPAX-PARAMETER

EPAX-PARAMETER, p1, p2, p3

The EPAX1 empirical formula for the fragmentation reaction cross section σ is calculated as
σ = y(Afrag) * exp(-r(Zprob-Zfrag)u) * sqr(r/3.1415926)
where u=1.5 for Zprob > Zfrag and Aproj>33, and u=2.0 for the others. [K. S\"ummerer et al., Phys Rev. C 42 (1990) 2546].
The keyword can be used to make small modification of the formula
σ = p1 * y(Afrag) * exp(-r(Zprob-Zfrag)u) * sqr(r/3.1415926)
where u=p3 for zprob > Zf and Aproj>33 and u=p2 for the others.
The projectile fragmentation cross sections was systematically studied by using an 40Ar primary beam impinging on Be and Ta targets at RIKEN. The results suggest to modify the parameter set, p1=0.667, p2=2.0, and p3=1.7. (A. Ozawa, private communications.) Please use this keyword on your own risk.

3.27 RANDOMIZE

RANDOMIZE iseed

The keyword sets initial seed for random number generator.

3.28 LOOP-ENDLOOP

LOOP n
...... (another keywords)
ENDLOOP

3.29 CALL

CALL library,function
dpar1 dpar2 dpar3 dpar4 dpar5 .... dpar15
option

The "CALL" keyword marks to use an external user function named as function in a shared library (*.so). Note that library should be specified as a full-path name. The function is called with 15 double parametersdpar* and a string (120 characters)option. The source code for the library could look as below in test.c. In the test program, the ion coordinates(out[i]) are defined event by event. If the return value of ext_beam is negative the particle is lost. The maximal number of external functions in a MOCADI input file is 100.

----------------------- test.c --------------------------------------------

int ext_beam(double *in, double *out, double *dpar, char *option)
{
  /* in[0]=X [cm]   in[4]=energy[AMeV] in[8]=electron       in[12]=deltaE[MeV]
     in[1]=X'[mrad] in[5]=time  [us]   in[9]=nf/nsf         in[13]=reserved
     in[2]=Y [cm]   in[6]=mass  [amu]  in[10]=range[mg/c2]  in[13]=reserved
     in[3]=Y'[mrad] in[7]=z            in[11]=tof  [us]
     the element range is valid after the "stop" keyword
     the element deltaE is valid behind energy loss materials
                                          (matter, wedge etc.)
  */
  int i;
  for(i=0;i<14;i++)
    printf("%le\t",in[i]);     /* print all ion-optics parameters */ 
  printf("\n");
  for(i=0;i<15;i++)
    printf("%le\t",dpar[i]);  /* print all numerical parameters */
  printf("\n");
  printf("%s\n",option);       /* print option */
  for(i=0;i<14;i++)
    out[i]=i*10;               /* change ion-optics parameters */ 
  return(0);                   /* when this particle is be lost, the
                                  return value is set to be negative */
}

-----------------------------------------------------------------------------

To create a shared library (e.g. test.so) from a source file (e.g.test.c) the following commands are used.
   gcc -fPIC -c test.c
   gcc -shared -Wl,-soname,test.so -o test.so test.o
the function can be used using a following keyword.
   call /home/iwasa/mocadi/work/test.so ext_beam
   9 4 1.8 19 6 5 100 1 1 1 1 1 0 0 0             
   parameters                                     

3.30 EPAX

EPAX 1 (default)

or

EPAX 2

This keyword defines version number of the empirical formula, EPAX, which calculates production cross section of projectile fragments.
c.f.
EPAX-1: K.Sümmerer, et al., Phys. Rev. C 42, 2546 (1990)
EPAX-2: K.Sümmerer, B.Blank, Phys. Rev. C 61, 34607 (2000)

4 How to execute MOCADI

After having prepared an input file, type the command:

MOCADI input_file_name

when you do not type an extension after input_file_name, MOCADI assumes the default extension ".in". When you don't type input_file_name, MOCADI will prompt for a file name.

5 MOCADI Output Files

MOCADI creates the following output files
*.out standard output file
*.coll collimator output file
*.tab table output file (when you use TABLE keyword in input file)
*.hbk HBOOK output file including NTUPLE output (when you use HBOOK or SAVE keywords in input file)
*.lmdi SATAN output file
*.asc list-mode output file in the ASCII code
*.asc-gz gzipped list-mode output file in the ASCII code
*.root ROOT/TREE list-mode output file
The standard output file, collimator one, table one, and ascii one are text files, whereas the HBook and ROOT/TREE one is binary files. For making histograms from the HBook output file, you can use ``PAW'' from the CERN Library.
From the ROOT/TREE output file, you can use ``ROOT''

6 A standard routine for MOCADI calculation

  1. Copy a input file for a beam line of your interest.
  2. Modify the parameters of the "BEAM" and "TARGET" keywords to your case.
  3. Place an "END" keyword just after the first "EXPECTED_VALUES" keyword.
  4. Execute MOCADI and check the standard output to obtain precise mass, charge and energy after the penetrating through the target material.
  5. Change the mass, charge, and energy of reference particle of the "MATRIX" keywords.
  6. When the "MATTER" and "WEDGE" keywords appears, place "EXPECTED_VALUES" keyword and ``END''keyword after the material keyword, execute MOCADI to check the energy of the particle, and change the energy of reference particle in the "MATRIX" keywords downstream of the material.

Acknowledgment

It is my pleasure to thank H. Geissel for providing us with the source codes. Many thanks are due to K. Sümmerer and M. Dahlinger for their help on programming. I am grateful to K. Sümmerer, T.Baumann, and H. Weick for their help to make this manual. I thank M. Pfünzner and A. Ozawa for their fruitful suggestions. Special thanks are due to P. Malzacher and C. Scheidenberger for providing energy-loss, energy-straggling, and angular-straggling functions of ATIMA-1.0.

APPENDIX

A.1 How to use PAW

For using "PAW", type "paw". PAW asks for a workstation number. Type the number corresponding to the graphics output device you want to use. (1:X-Terminal, 7879:TEX4010, 0:no graphic) When PAW cannot make a HIGZ window on your X-terminal, please type the following commands, and execute PAW again.

set display /cre/node=IP_address_of_your_terminal/trans=tcpip

% PAW
******************************************************
*                                                    *
*            W E L C O M E    to   P A W             *
*                                                    *
*       Version 2.06/00       9 November 1994        *
*                                                    *
******************************************************
Workstation type (?=HELP) =1 :
Enter terminal number (1:X-terminal, 7879:TEX4010, 0:no graphic)
Version 1.21/12 of HIGZ started

PAW >
Now you can type PAW commands at the PAW prompt.

A.1.1 Open an HBOOK file and the way to see information

PAW > H/file 44 B8.HBK   (open Hbook file B8.HBK on the unit 44)
PAW > h/list


===>Directory :
         1 (N)   Save                   when you use CWN format

         1 (N)   Save 1                 \
         2 (N)   Save 2                  when you use RWN format
         3 (N)   Save 3                 /

       101 (2)   1:x*y                  \     
       102 (2)   2:x*y                   when you use HBOOK command
       103 (2)   3:x*y                  /
Note that units of position, angle, energy, time, and rigidity are cm, mrad, MeV/u, micro-second, and MeV/c, respectively.

A.1.2 How to show histograms from HBOOK output

PAW > h/plot  101  (plots a scatter plot of a 2D-histogram 101)
PAW > contour 101  (draws a contour plot of a 2D-histogram 101)
PAW > surface 101  (plots a scatter plot of a 2D-histogram 101
                    as 3 dim. view)

A.1.3 How to show histograms from Row-Wise-NTUPLE output

PAW > n/print 1              (print information at save 1)


********************************************************
* NTUPLE ID=    1  ENTRIES= 103579   Save 1
********************************************************
*  Var numb  *   Name    *    Lower     *    Upper     *
********************************************************
*      1     * X         * -.164687E+01 * 0.176604E+01 *
*      2     * A         * -.137222E+02 * 0.135885E+02 *
*      3     * Y         * -.134754E+01 * 0.136219E+01 *
*      4     * B         * -.629065E+01 * 0.626050E+01 *
*      5     * energy    * 0.256659E+03 * 0.271148E+03 *
*      6     * time      * 0.923414E+00 * 0.977539E+00 *
*      7     * mass      * 0.802461E+01 * 0.802461E+01 *
*      8     * z         * 0.500000E+01 * 0.500000E+01 *
*      9     * electron  * 0.000000E+00 * 0.000000E+00 *
*     10     * nf_nsf    * 0.888366E+00 * 0.896811E+00 *
*     11     * range     * 0.000000E+00 * 0.000000E+00 *
*     12     * tof       * 0.923414E+00 * 0.977539E+00 *
*     13     * dE        * 0.343888E+03 * 0.376508E+03 *
*     14     * brho      * 0.000000E+00 * 0.000000E+00 *
*     15     * weight    * 0.000000E+00 * 1.000000E+00 *
********************************************************

PAW > n/plot 1.x
                   (plot an 1D-histogram of x position at save 1)
PAW > n/plot 1.x%y
                   (plot a 2D-histogram of x v.s. y of save 1)
PAW > n/plot 1.x Energy>100
                   (plot an 1D-histogram of x gated by E>100 A MeV)

Note that units of position, angle, energy, time, and rigidity are cm, mrad, MeV/u, micro-seconds, and MeV/c, respectively.

A.1.4 How to show histograms from Column-Wise-NTUPLE output

PAW > n/print 1              (print information)


******************************************************************
* Ntuple ID = 1      Entries = 10000     SAVE
******************************************************************
* Var numb * Type * Packing *    Range     *  Block   *  Name    *
******************************************************************
*      1   * I*4  *         * [0,15]       * TEILCHEN * N
*      2   * R*4  *         *              * TEILCHEN * X(N)
*      3   * R*4  *         *              * TEILCHEN * A(N)
*      4   * R*4  *         *              * TEILCHEN * Y(N)
*      5   * R*4  *         *              * TEILCHEN * B(N)
*      6   * R*4  *         *              * TEILCHEN * ENERGY(N)
*      7   * R*4  *         *              * TEILCHEN * TIME(N)
*      8   * R*4  *         *              * TEILCHEN * MASS(N)
*      9   * R*4  *         *              * TEILCHEN * Z(N)
*     10   * R*4  *         *              * TEILCHEN * ELNUM(N)
*     11   * R*4  *         *              * TEILCHEN * TOF(N)
*     12   * R*4  *         *              * TEILCHEN * DE(N)
*     13   * R*4  *         *              * TEILCHEN * BRHO(N)
*     14   * R*4  *         *              * TEILCHEN * WEIGHT(N)
*     15   * R*4  *         *              * TEILCHEN * RANGE
******************************************************************
*  Block   *  Entries  * Unpacked * Packed *   Packing Factor    *
******************************************************************
* TEILCHEN *  10000    * 724      * Var.   *    Variable         *
* Total    *    ---    * 724      * Var.   *    Variable         *
******************************************************************
* Blocks = 1            Variables = 13      Max. Columns = 181   *
******************************************************************

PAW > n/plot 1.x(1)       (plot an 1D-histogram of x at save 1)
PAW > n/plot 1.x(2) n>=2  (plot an 1D-histogram of x at save 2)
PAW > n/plot 1.x(1)%y(1)  (plot a 2D-histogram of x v.s. y at save 1)
PAW > n/plot 1.x(1) N>=2  (plot an 1D-histogram of x at save 1 gated by 
                           events passing though to save 2)
PAW > n/plot 1.x(1)%x(2)  (plot a 2D-histogram of x at save 1 and x at save 2)
PAW > n/plot 1.x(1)%mass(1) ! ! ! ! box
                          (plot transmission for each fragment) 
PAW > n/plot 1.z(1)%mass(1) weight(1) ! ! ! box
                          (plot yield of each fragment) 
PAW > n/plot 1.x(1) z(1)=5&&mass(1)>8&&mass(1)<9&&weight(1)
                          (plot yield of 8B as a function of x at
                           save 1)
PAW > n/plot 1.range range>0&&z(1)=5&&mass(1)>8&&mass(1)<9
                          (plot range of 8B in the matter described
                           by the "stop" keyword)

Note that units of position, angle, energy, time, rigidity, weight, and range are cm, mrad, MeV/u, micro-seconds, Tm, particle/incident particle, and mg/cm2, respectively. In case you get an error message about the array index, probably the ion with a certain index was cut off due to the collimators. Try adding a condition to avoid this error, e.g. nt/plot 1.x(3) N>=3. In this case PAW looks only at ions with array at least 3 and no error will occur.

A.1.5 How to print histograms on printer

PAW > for/file 45 MOCADI.ps  (open a postscript file "MOCADI.PS"
                              on the unit 45)
PAW > metafile 45 -111       (activate postscript-output on the unit 45)
Type plot commands as described in previous subsections.
PAW > close 45          (close the postscript file)
PAW > shell lpr -P"printer name" MOCADI.ps 
                        (print the postscript file to the printer psaf)
or to print content of current graphics window
    PAW > opt zfl1
Type plot commands
   
    PAW > pic/print filename.ps
    PAW > shell lpr -P"printer name" filename.ps

A.1.6 Exit from PAW

PAW > close 44          (close hbook file for the unit number 44)
PAW > exit
%

A.2 Examples of input files

MOCADI download page at GSI
RIPS @ RIKEN