This directory contains complete programs and scripts that can be used as
utility.  You should make the prorams by using make.

If you type

  make

you will know the Usage. Some utility like scripts are also in the
Scrpt directory.   The programs for checking nuclear interactions
are in the subdirectories of Particle/Events/.

showParam:  can be used to check your input Namelist data.

	  If showParam is ready, it may be better to use 'pretty'
	  in the Scrpt directory to show the Namelist data Default
          or to convert a system output of namelist (which has only
          capital letters in the name field) into a pretty style.
         (use "pretty filename" in the latter case).

drawGeomag: To put data for drawing  the geomagnetic field by gnuplot.

drawRigCut: To put data for drawing the rigidity cutoff data by  gnuplot.
            At program run, give file name containing cutoff data.
===============
To check the  primary spectrum, the following utility routines are available.

sss:     extract data from the basic raw data (such as sample.d in the
         Data/Primary/) so that	one can use gnuplot to show spectrum shape.
testPrim:  check basic raw data by writing summary table.
	   (the same as written by sampPrim) 
sampPrim:  do sampling of primaries using given spectrum data
           also print the same summary data as testPrim does.
getST:   To get area x time for a given primary spectrum; ST is used to
        convert simulated data into absolute flux.
____________________________________

sss (show spectrum shape) is an awk script to extract data from the raw
primary data so that one can check the raw data by drawing the spectrum shape.

Usage:

   awk -f sss file > somefile 

where file is the raw primary data such as sample.d, somefile is 
the data file which can be used by gnuplot to draw primary spectrum.

In gnuplot use,

   set log xy
   plot 'somefile' w l

Or you can directly issue the following command

   plot '< awk -f sss file '
  
if sss is seen.
-----------------------------------
testPrim should be made by make program as

  make testPrim

After creating the program, you can call it as

  testPrim

then you are requested to enter the path to the priamry spectrum data
file such as sample.d.   This produces a sammry table of the defined 
priamries.

-----------------------------------
sampPrim

This should be made by make program as

  make  sampPrim

After creating the sampPrim, you can use it by 

  sampPrim

Then, you are requested to enter the path to the primary file and
then the number of samplings. 

Answer them, "for example,

../Data/Primary/sample.d

10000


The output is made on the error and  standard output like
(# lines are on the error output)

# -----------------# of Component defined= 6----------------------
# Seq.# Code  Comp.  E_ Unit  E_type Diff/Integ  Emin    Emax   # of seg.
#   1     6   p        gev     ke/n       d      .100     100.      13
#   2    10   he       gev     ke/n       d      .100     100.      10
#   3    12   cno      gev     ke/n       d      .100     20.0      11
#   4     1   gamma    mev     e          d      100.     .500E+04   4
#   5     6   p~       mev     e          i      1.00     100.       2
#   6    19   rho      tev     e          d      100.     100.       0
#seq. No.|   Orig Erg | Code # | Total E(GeV)
        6   100.0          19   .1000E+06
        5   1.863           6   .1863E-02
        2   1.034          10   7.892    
        1   .1220           6   1.060    
        3   .5720          12   21.15    
        1   68.66           6   69.59    
        1   30.82           6   31.76    
        3   .3662          12   18.27    
        1   4.138           6   5.076    
        3   2.463          12   47.63    
       ...

You can understand the content of output by the last # line. 
You may need an awk program and some histograming filter for plotting.
Note that if you want to make a histogram of energy and compare it with
the raw data you gave in the primary spectrum file, you should use the
energy in the second colum which is in the same unit as you gave in
the data (say, MeV/n, TeV/p etc).  The energy in the last column is
the total energy in GeV which is used by Cosmos internally.
Also you should confirm that it is really the total energy consistent
with the one in the second column.

================================================================

MultiProd directory.

This directory contains the test programs for multiple production.




getST:

make -f getST

then enter 

getST



