This directory containes user hooks for the full detector simulation  of
BETS2. (as of Feb. 2000).
Two programs can be created: sepics and layer2z.

# If the detector config is changed, you must verify that any
  modification is needed in 
       CompDetail file
       readCompDetail.f
       Zbets.h


sepics$ARCH: it can be created by 
    make
sepics$ARCH can be executed by
    sepics$ARCH < FirstInput

Its output takes the following form:

 1.08     2.52    20.16    13.10     8.80    18.10    19.92    17.86     9.93 
1000.00  0.00000  0.00000  1.00000  14.00  14.00  6  1  1  1
           2         140   1.049017               1
           3         140   1.091867               1
         ....
           0          0     0                     0
 next events

 First 9 are partcile numbers in the trigger scinti,
 next one is  E0(GeV), next 3 are direction cosines of the incident particle
 next 2 are incident position(cm)  x0, y0,
 next 2 are 1ry-code and  charge
 next 2 are in and out. in =1 means the incident is within top surface. 0 -->outside
                        out=1 means the shower axis at the bottom is within the bottom surface.
                           =0 --> outside.
Then, there are 4 column repeated data. They are
 "scifi layer number"  "scifi number in that layer"  "ptcl_number"  "x or y"(1 or 2).

If the last one is 1, the x position can be obtained  as
       (scifi number-1) x 1 mm + 0.5 mm
If the last one is 2, the y position can be obtained as
       (scifi number-1) x 1 mm + 0.5 mm
The z position can be obtained by seeing the table which can be
created by the folloiwng  program.

layer2z:fiber layer number vs its z value table can be  created by
    make -f layer2z.mk
The table can be created by 
    layer2z < FirstInput


Fibers are numbered from the top


-------------------
If the incident can not be specified by sepicsfile,
you may use myprimary.f and activate corresponding
part in ephook.f.

