Sample1 (how primary spectrum is defined)

SOURCE FILES (tar.gz file)

This sample explains how primary particle composition and flux are defined in the 'primary' file.
In this sample COSMOS simulation ONLY outputs primary information at the beginning of each event (primary injection) and exits w
ithout any air shower production.
Output file can be converted into the spectra by a ROOT script so that we can confirm if the spectra are as expected.


Users edit following three files
primary
param
chook.f

Detail of these files are explained below.


*************
*** Usage ***
*************
make clean; make
./cosmosMacGfort < param > out 2> err
(here 'MacGfort' depends on your system.)
root primary_analysis.cpp
(assuming you can use ROOT.)

primary file used in this sample


***************
*** primary ***
***************
'primary' file in this directory defines the proton, Helium and CNO fluxes.
Mixed composition is simulated at the same time.

'primary' file is specified in the 'param' file as
PrimaryFile = 'primary',
You can use different file name if necessary.

*************
*** param ***
*************
Simulation condition is specified in the 'param' file.
In this specific sample, the 'param' file describes as below.
DepthList = -1.0,
HeightList = 99e3,
HeightOfInj = 100e3,
Particles are injected from 100km (100e3 meters) above the sea level and the obsevation site
is defined at 99km. So there is essentially no interaction.
Usually DepthList is used to define the obsevation height in kg/m^2 and HeightList in meter is
calculated inside COSMOS.
However, if it is defined in negative value like this sampe, HeightList is referred and DepthList
is calculated.

DestEventNo = 100000
100k primary particles are injected.
Because we do not simulate air shower, it is done in O(10sec).

***************
*** chook.f ***
***************
chook.f contained user subroutines where the users can define actions at each process of simulation.
In this sample, except chookBgEvent subroutine, nothing is done.
You can confirm the subroutines are empty.

The subroutine
chookBgEvent
is called when a new injection particle is defined.
In this sample in chookBgEvent, the information (particle code etc) are printed to the standard
output. Immediately after that, all information in the particle stack is cleaered using
call cinitStack
so that simulation of this event terminates. (It does not track down to 99km as explained above.)