\documentclass[11pt]{article}
\usepackage{latexsym,html}
\usepackage[dvips]{graphicx}

\voffset=-0.75in \hoffset=-0.75in
\addtolength{\textheight}{1.5in}
\addtolength{\textwidth}{1.5in}
\renewcommand{\floatpagefraction}{1.0}
\renewcommand{\textfraction}{0.0}
\newcommand{\egs}{{\tt EGS4}}
\newcommand{\pegs}{{\tt PEGS4}}
\newcommand{\shower}{{\tt shower}}
\newcommand{\elegant}{{\tt elegant}}
\newcommand{\sddsplot}{{\tt sddsplot}}
\newcommand{\SDDS}{{\tt SDDS}}
\begin{document}
\title{User's Guide to {\tt shower} version 1.0, an {\tt EGS4} Interface}
\author{L. Emery}
\maketitle
%\tableofcontents
\section{Introduction}
Program \shower\ is a SDDS-compliant interface program to the Monte
Carlo electromagnectic shower program \egs\cite{egs4,Bielajew}.  The
\shower\ program consists of a main routine and two subroutines
required by the \egs\ system, and other subroutines related to the
geometry of the problem, all written in the C language.  The \egs\
MORTRAN source code is not modified except for minor details, such as
flags and common blocks,\footnote{One may scan for comments in the MORTRAN code
to view the changes. However none of the physics is modified from the
original.} and is called as a subroutine.

In \shower\ the \egs\ Monte Carlo simulation is controlled with
input files describing the input particle beam and the geometry
definition, and command line arguments. Program \shower\
reads incident particles coordinates from an input date file, sets up
FORTRAN data structures required by \egs\ subroutines {\tt howfar} and
{\tt ausgab}, calls the \egs\ subroutine {\tt shower}, and writes the
output particle coordinates to files.  The output particle
coordinates files can serve as input to another \shower\ run with a
different geometry as part of a linked set of runs.

A regions summary file contains data related to each region defined in the
geometry file, such as absorbed dose rate per unit input beam power.

While the geometry definition is the most difficult programming aspect
in conventional \egs, it is vastly simplified in \shower\ because the
geometry isn't hard-coded in a subroutine but rather defined in a
separate geometry file with namelist type commands. In {\tt shower} we
restrict ourselves to defining regions of rectangular prism (blocks)
or cylindrical geometries. A 3D grid defining all space for the
simulation is internally generated from all the block or cylindrical
definitions.  It is felt that most simulations can be well
approximated using these elementary shapes, however complex the
problem really is.

Coordinates of outgoing particles can be obtained by setting a flag in
a particular defined region. 

\section{Command line}
Many options are available in the command line. To review the possible
options, type ``\shower'' at the shell prompt.  The program returns
\begin{verbatim}
shower <SDDSinputfile> -geometry=<GeometryDefinitionFile> -root=<string>
 -summary[=<file>] [-defaultParticleType=<particleType>] 
 [-seedNumber=<integer>] [-samples=<integer>]
 [-trajectories[=<file>]] [-vacuumStepSize=<distance-in-cm>] [-plotGeometry[=<file>]]
 [-outOfBounds[=<file>]] [-undefinedRegion[=<file>]]
 [-useInInput=<particleType>[,...]] [-keepInOutput=<particle-type>[,...]] [-verbose]
 [-splitting] [-describeGeometryInput] [-fixLowEnergyTransport=[{0|1}]] 
 [-sumPathLengths] [-addTimeColumn] [-useTimeColumn]

SDDSinputfile         input file of initial coordinates of incident particles;
                      output files produced by previous shower runs are valid input files;
-geometry             specifies file with geometry namelist commands defining materials;
-root                 string with which to construct default filenames;
-summary              SDDS file containing summary data for each region; default name
                      is <root>.summary where <root> is the value of the -root option;
-defaultParticleType  default particle type if not defined in input beam file;
<particleType>        valid values are "electrons", "positrons", or "photons";
-seedNumber           integer to initialize the random number generator;
-samples              number of times to repeat the tracking of input file particles;
-trajectories         file for storing shower trajectories; default name 
                      is <root>.traj; 
-vacuumStepSize       maximum step size in vacuum;
-plotGeometry         SDDS file containing line segments
                      defining solid regions edges;
-outOfBounds          SDDS file containing coordinates of out-of-bounds particles;
                      default name is <root>.outOfBounds;
-undefinedRegion      SDDS file containing coordinates of particles entering
                      undefined space; default name is <root>.undefinedRegion;
-useInInput           select which particle type or types use (read) in particle
                      coordinate input file;
-keepInOutput         select which particle type or types to keep (write) in particle
                      coordinate output files;
-splitting            enables splitting of particle for improved statistics
                      as defined in the geometry definitions;
-describeGeometryInput prints out the namelist commands for the geometry input file
-fixLowEnergyTransport flag for enabling(1)/disabling(0) the maximum limit on the fractional
                      energy loss per step defined for each material in the geometry
                      input file. The default value is 1
-sumPathLengths       calculated path lengths for all particles in all regions.
                      Energy cut-offs are specified in region definitions.
                      Results are in the summary file.
-addTimeColumn        Output coordinate files contains time elapsed
                      relative to initial particle. Initial particle has t=0.
-useTimeColumn        Use the column "t" in the beam input file as a starting
                      time value for the shower.
-verbose              spews verbiage
\end{verbatim}
where square brackets enclose optional parameters.

\section{Brief Description of Input and Output Files}
Running \shower\ requires three input files:
\begin{itemize}
\item 
{\bf cross-section data:} Text data file creaed by combining outputs
from multiple \pegs\ runs which provides the physics of the
simulation. Note that we haven't changed any of the original physics
formulas.

\item
{\bf input beam coordinates:} SDDS-format file containing initial
coordinates, and energy of the particles. Other parameters, such as
{\tt PowerOfInitialBeam}, used to calculate absorbed dose rate, may be
defined here.

\item 
{\bf geometry definition:} File containing namelist type commands
defining the geometry of the problem, i.e. dimensions and material
composition. Sometimes in the future there might be a solid modeling
input.
\end{itemize}

There are three types of output files:
\begin{itemize}

\item 
{\bf output beam coordinates:} Coordinates of all particles crossing a
bounding plane of a region defined in the geometry file. The file name
is specified in region definition.  The data may be used for
quantitative analysis of a shower, or used as input file to another
run of \shower.  Particles that go out-of-bounds or entering an
undefined region of space, may be recorded in separate files defined
in the command line.

\item 
{\bf shower trajectory:} Coordinates of trajectories of all particles
produced in a \shower\ run, including those that are created and
eventually get absorbed. 

\item 
{\bf summary:} Lists quantities related to each region defined, such
as the total energy absorbed.

\item
{\bf line segment geometry:} Contains coordinates of all line segments
of the shapes defining the geometry of the problem.  Most useful when
overlayed in 2D on shower trajectory plots.
\end{itemize}

\section{Input Files}
The input file will be covered in more detail here.

\subsection{Cross-section Data File} \label{cross-section file}
This file is required by the \egs\ subroutines, and contains most of
the physics of the simulation.  The cross-section data is created by
program \pegs, the \egs\ preprocessor.  \pegs\ has to be run once for
each material type in an \egs\ simulation.  The material can be an
element, compound or mixture.  The resulting data file is an ascii
text file that an \egs\ subroutine will parse and store as
cross-section data. One normally pre-calculates a number of materials
and combine the individual cross-section files into a larger file. A
file with several material types that have been used at APS is
provided in the distribution. One may want to create an element file
that has lower cut-off for charged particle or photon transport. Thus
one could generate two \pegs\ output files for the same element but
with different cut-off energies.

Program \shower\ looks for the combined cross-section file in the
environment variable {\tt EGS4\_CROSSSECTION}. If {\tt
EGS4\_CROSSSECTION} is undefined (not recommended), the program looks
for the file {\tt fort.12} in the current directory. (The name {\tt
fort.12} comes from the conventional implementation of \egs.)

\subsection{Input Beam File}
The file for the input beam is specified in the command line. This
file may be created using an editor or the \SDDS\ toolkit, or may be
an output of previous \shower\ runs. The data may even originate from
other SDDS-compliant physics simulation programs. Converting from one
type of data to another is relatively easy with \SDDS\ toolkit
programs.

A short introduction to the \SDDS\ format is given here with
specific definitions required in the \shower\ input beam file.

An \SDDS-format file consists of a header and zero or more pages of
data represented as follows:
\begin{verbatim}
SDDS1
description-command
column-command
.
.
column-command
parameter-command
.
.
parameter-command
data-command
! end of header, beginning of data page 1
parameter data
tabular data
! beginning of data page 2
parameter data
tabular data
.
.
\end{verbatim}
The header contains namelist commands describing the structure of the
data pages using parameter and column commands. The tabular data
consists zero or more rows of $n$ columns, where $n$ is the number of
columns defined in the header. Each column of data column must
appear in the same order as the definitions of the header. The
description command is optional.  Another data type, array, is not
mentioned here since it is not used in \shower.

The first line of the file must be {\tt SDDS1}, indicating that the
file is an \SDDS\ version 1 file.  The description command follows,
for example:
\begin{verbatim}
&description text = "Coordinates of particles entering ``concrete'' region",
 contents = "Particle coordinates", &end
\end{verbatim}
The {\tt text} and {\tt contents} field are intended to be a general
description to aid a user in identifying the file.  This particular
description command came from a output file created by a \shower\
simulation with a region labeled ``concrete''. The {\tt contents}
field is intended to represent a formal way to identify the type of
file. The quantities in the description don't have any particualr
significance to \shower\ but may be used in other \SDDS\ toolkit
programs, such as \sddsplot.

In the input beam file \shower\ recognizes the columns {\tt x}, {\tt
y}, {\tt z}, {\tt u}, {\tt v}, {\tt w}, {\tt t}, and {\tt Energy}.
The first three are the cartesian coordinates of incident particle
with units of meters. The next three are direction cosines with no
units. The next coordinate is time in seconds. It has been added to
\egs\ internal data so that tracking of the time coordinate of a beam
file can be continued through the {\tt shower} simulation. This
addition was requested by C. Yao. The last coordinate is the total
energy (kinetic plus rest mass), in MeV.  Note that only the {\tt
Energy} column need to be defined, as the rest of the coordinates
default to zero (except for {\tt w} which defaults to 1) when the
simulation starts. Additional columns may exist in this file, but will
be ignored by \shower. An example of a column definition is
\begin{verbatim}
&column
 name = "Energy",  symbol = "Energy",  units = "MeV", description = "Energy",
 type=double,
&end
\end{verbatim}
The minimum set of fields for a valid column definition in general
consists of {\tt name} and {\tt type}. For \shower, an additional
requirement is the specification of the units, ``{\tt m}'' for
coordinates and ``{\tt MeV}'' for {\tt Energy}.  All coordinate data
types should be {\tt double}.  Other columns could be defined in the
input file for informational purposes, but they will be ignored by
\shower.

Parameters are quantities assigned for each data page. For the input
beam file the parameter {\tt Type} indicates whether the page of data
correspond to electrons, positrons or photons.  The definition of
parameter {\tt Type} is
\begin{verbatim}
&parameter name = "Type", symbol = "Type", 
 description = "Particle type", type = "string",
&end
\end{verbatim}
Note that while the definition of the parameter belong in the header,
the actual value of the parameter appears at the start of each page.
Program shower will recognize string values equal to {\tt electrons},
{\tt positrons}, and {\tt photons}. The string data may appear in quotes.

If the parameter {\tt Type} isn't defined in the input file, then
\shower\ uses the value given for the command line option {\tt
-defaultParticleType}. If no value was assigned to this option, then
\shower\ gives an error message, and aborts.

The parameters listed below are all optional. Most of them are
generated in output files. They do not take part in the Monte-Carlo
simulation themselves, but in combination of the simulation results
these parameters are used to calculate absorbed doses.

\begin{itemize}
\item
{\tt PowerOfInitialBeam} --- Double. Units of W. Default value of 1 W.
This is defined in the input beam file by the user. This parameter is
passed to all output files.  If linked \shower\ runs are used to
transport radiation through different parts of a complex simulation,
this parameter serves as a mechanism to pass the information required
to calculate a radiation dose in the final run.

\item 
{\tt Generation} --- Long. Default value of 0. Its value in an output
beam file is one more than its value in an input beam file. For a
primary beam, its value should be set to zero. Therefore, in an output
beam file, its value is the number of \shower\ runs that have been
done starting from the primary beam. This parameter is involved in
defining parameter {\tt TotalIncidentEnergyOfFirstRun}.

\item
{\tt CumulativeSamples} --- Long. Default value of 1. This is the
cumulative number of samples that precedes the input file. In an output
file, its value is multiplied by the number of samples in the current
\shower\ run.  This parameter is used in the calculation of the
radiation absorbed dose.

\item
{\tt TotalIncidentEnergyOfFirstRun} --- Double. No default values. This
parameter is the total energy of all particle used in the primary beam
run (``generation'' zero). Its value is generated in the output files
of the generation zero run. This quantity is used in calculating
the radiation absorbed dose.
\end{itemize}

For the {\tt \&data} command, one sets {\tt mode} equal to {\tt ascii},
and {\tt no\_row\_counts} flag to 1.  Here is an example of a minimal
input file used as the primary beam of a Monte Carlo calculation of
radiation dose at the APS.  The beam power at the safety envelope is
308 W.
\begin{verbatim}
SDDS1
&description
 text="One-particle 7000 GeV positron beam",
 contents="Particle coordinates" &end
&parameter
 name = "PowerOfInitialBeam" description="Initial beam power",
 symbol = "P$b0$n", type="double" units="W" &end
&parameter
 name = "Type" type="string"  &end
&column
 name="E" units="MeV" type=double &end
&data
 mode = "ascii" no_row_counts=1 &end
! page number 1
! Initial beam power of 308 W
308
! parameter Type
positrons
! start of tabular data
7000
\end{verbatim}
Here, only the energy column is defined. The other column quantities
are assumed to be zero.  The parameter {\tt PowerOfInitialBeam} is
defined with value 308 W, which happens to be relevant for safety
simulations at APS.  The particle type is ``positrons''. Only one
particle of 7 GeV is defined.

Note that command line option {\tt
-chooseInInputfiles=particleType[,...]} can be used to select
particles of one or more types in the input files, and discard the
particles of the unnamed types.  Thus if one had {\tt
-chooseInInputfiles=electrons} for the input file above, then no
particle would be tracked.

\subsection{Geometry File}
The required geometry file is created by the user.  Three namelist
commands are available, {\tt \&initial\_coordinates}, {\tt \&block},
and {\tt \&cylinder}. Since the regions can only be of rectangular
prism (blocks) or cylindrical type, the commands {\tt \&block} and
{\tt \&cylinder} can't be mixed in the same geometry file.  The fields
for the first command are:
\begin{verbatim}
&initial_coordinates
   double x_cm = 0.0
   double y_cm = 0.0
   double z_cm = 0.0
   double xp = 0.0
   double yp = 0.0
&end
\end{verbatim}
\begin{itemize}
\item Defaults are shown on the right hand side of ``{\tt =}''.  The
word ``{\tt double}'' in the above syntax definition isn't part of the
actual command and should be omitted in a command. It is shown here
only to specify the data ytpe.
\item {\tt x\_cm,y\_cm,z\_cm} --- Amount by which to change the
coordinates of all particles defined in all input files.  Units are in
centimeters.
\item {\tt xp,yp} --- Amount by which to change the slope with respect
to the $z$-axis of all particles defined in all input files.
\end{itemize}

The {\tt \&block} command defines a block-like region of material:
\begin{verbatim}
&block
   STRING label = NULL
   STRING material = NULL
   double x_lower_cm = 0.0
   double x_upper_cm = 0.0
   double y_lower_cm = 0.0
   double y_upper_cm = 0.0
   double z_lower_cm = 0.0
   double z_upper_cm = 0.0
   double Bx = 0.0;
   double By = 0.0;
   double Bz = 0.0;
   double Ex = 0.0;
   double Ey = 0.0;
   double Ez = 0.0;
   long x_slices = 1;
   long y_slices = 1;
   long z_slices = 1;
   STRING outputfile = NULL;
   double photonEnergyCutoff = 0.0;        
   double leptonEnergyCutoff = 0.0;        
   long split = 1;        
   double minimumWeight = 0.0;
   double maximumDeltaE = 0.02;
   double electronPathLengthEnergyCutoff = 0.0;
   double positronPathLengthEnergyCutoff = 0.0;
   double photonPathLengthEnergyCutoff = 0.0;
&end
\end{verbatim}
\begin{itemize}
\item {\tt label} --- An optional label identifying the region. The
label value will appear in the output file.
\item {\tt material} --- A string specifying the material in the
region. This material can be an element, a mixture, or a compound, and
must be defined in the cross-section file.

The {\tt material} string value is converted to uppercase and passed
to \egs\ for identification of data arrays in the cross-section data
file defined by environment variable {\tt EGS4\_CROSSSECTION} (see
section \ref{cross-section file}).  If this cross-section file exists,
and contains the required information on the specified element,
mixture, or compound, the relevant data is read into \egs\ subroutine
arrays.  Otherwise, an error message is printed out, and execution
stops.

In order to track through empty space, the empty space must be defined
as a region of pre-set material ``{\tt vacuum}''. Otherwise, a
particle entering an undefined region of space will be discarded, and
optionally recorded in a coordinate file (see command line arguments).

\item {\tt \{x,y,z\}\_lower\_cm,\{x,y,z\}\_upper\_cm} --- Boundaries of the
block region in units of cm (the units used here is to be consistent
with the units used by \egs). If a later {\tt \&block} definition
overlaps with the volume of one defined earlier, then the first block
takes precedence. Smaller objects such as targets where the shower
process usually starts should be defined first so that they can be
nested inside larger regions.

\item {\tt Bx,By,Bz} --- Uniform magnetic field in entire region. Only
one component of B is allowed in one region (this is to keep tracking
in {\tt howfar} subroutine simple).  Each tracking segment in a region
with a magnetic field is converted into an arc of a circle
approximated by shorter line segments joined by a small angle, with
the possibility of interaction with matter at each vertex.

\item {\tt Ex,Ey,Ez} --- Electric field in region. Not implemented yet.

\item {\tt \{x,y,z\}\_slices} --- Number of equal divisions of the region
along a particular direction.  Each sub-region becomes a new region
with the same label, material, magnetic field.  This usually doesn't
affect the Monte Carlo simulation.  However, for regions with
dimensions smaller than the mean free path of a particle, the larger
number of steps may improve the simulation of Coulomb scattering.
Also, in the regions summary file each subdivision of a region is considered
as a separate region with the same material and label values. This is a
convenient way to determine absorbed dose as a function of position.

The slice option does not work well with the {\tt outputfile}
specification. Therefore slices should be left equal to 1 if an output
file is specified.

\item {\tt outputfile} --- Creates an ouput file which records
  coordinates of particles entering the region.  Once inside the
  output region, the particles are discarded from further
  tracking. There is no further scattering or energy loss for those
  particles.  The region most downstream in the beam direction or the
  ``outer'' region of the geometry would normally be set up by the
  user with an output file defined.

This output file of coordinates is used to start another run with
geometry defined further downstream. Thus a large problem can be split
into many parts. Also a different kind of simulation can be inserted
in between shower runs, such as transport through an accelerator
beamline.

All kinetic energies of particles are summed in the summary file for
this region, so a calculation of absorbed dose, say, will be always an
incorrect calculation.  In reality some particles (or it's
descendants) will survive the transport through this region and be
absorbed in a further region. Thus {\tt outputfile} option is not
supposed to be used when calculating absorbed dose.

\item {\tt photonEnergyCutoff, leptonEnergyCutoff} --- Modifies the
energy cut-off of photon and lepton transport for the particular
region to a possibly higher value for saving cpu time. Units of
MeV. The energy cut-off is defined as the minimum energy at which the
particle can no longer move forward and is absorbed on the spot.  The
cut-off energy cannot be made smaller than the default value found in
the cross-section data file, because the original \pegs\ run stopped
at that energy lower limit. Using a larger value than the default
values may reduce simulation time at the expense of reduced
accuracy. The user must make his own determination of setting this value.

\item {\tt split} --- When greater than one, allows particle splitting
when particle enters the region, in order to improve statistics for
that region. The number of particles is increased by the value of {\tt
split}. At the same time the weighting of the particles are reduced by
the same factor, thus not affecting the total energy deposited in the region.

\item {\tt minimumWeight} --- Specifies the minimum weighting allowed
when particle splitting is enabled. This prevents a runaway situation
for some geometries with ``reflections'' where potentially a very
large number of particles are created from a single particle.

\item {\tt maximumDeltaE} --- Specifies the maximum relative energy
loss a particle may suffer when it is tracked through a single
step. This parameter forces the reduction of the path length such that
the relative energy loss is approximately equal to the value given.

\item {\tt electronPathLengthEnergyCutoff,
positronPathLengthEnergyCutoff, photonPathLengthEnergyCutoff} --- Sets
the emnergy cut-off in MeV for the three types of particles for which
the path length will be calculated. The default is zero MeV. For
example a cut-off of 1 MeV would be used for charged particles in a
lucite region, in order to estimate the cerenkov radiation produced
there. This feature was requested by B. Yang of APS.

\end{itemize}

The {\tt \&cylinder} command is similar to the {\tt \&block} command:
\begin{verbatim}
&cylinder
   STRING label = NULL
   STRING material = NULL
   double r_lower_cm = 0.0
   double r_upper_cm = 0.0
   double z_lower_cm = 0.0
   double z_upper_cm = 0.0
   double Bx = 0.0
   double By = 0.0;
   double Bz = 0.0;
   double Ex = 0.0;
   double Ey = 0.0;
   double Ez = 0.0;
   long r_slices = 1
   long z_slices = 1
   STRING outputfile = NULL
   double photonEnergyCutoff = 0.0;        
   double leptonEnergyCutoff = 0.0;
   long split = 1;        
   double minimumWeight = 0.0;
   double maximumDeltaE = 0.02;
   double electronPathLengthEnergyCutoff = 0.0;
   double positronPathLengthEnergyCutoff = 0.0;
   double photonPathLengthEnergyCutoff = 0.0;
&end
\end{verbatim}
The only difference with the {\tt \&block} command is the absence of
the dimension variables in $y$, and the replacement of the variables
in $x$ with variables in $r$. The cylinder defined are concentric and
are centered on the $z$-axis.

The {\tt \&block} and {\tt \&cylinder} commands can't be mixed in the
same geometry file.  If the first material definition command is of one type,
then the rest must be of the same type.

\section{Output Files}
The output files will be covered here. Since all output files are in
\SDDS\ format, the type of quantities contained in them can always be
determined by typing:
\begin{verbatim}
sddsquery <file>.
\end{verbatim}

\subsection{Output Particle Files}
When a particle enters a region with {\tt outputfile} speficied,
the full coordinates are recorded into this file, and the particle is
discarded.  It is best to define the output region such that most particles
entering this region passes through only one side. This will make
the processing less confusing.

The option {\tt -discardInOutputFiles=particleType[,...]} in the
command line is used to discard particles of one or more types in the
output files, which is useful in reducing the size of the files if a
particular particle type is not needed in the results. This option
applies to all output files produced in a \shower\ run. 

The file produced by the {\tt -outOfBounds}, and {\tt
-undefinedRegion} contain the full coordinates of particles going out
of bounds, or going into a volume within bounds but not defined.
Usually these particles aren't interesting. These files can
be used for debugging purposes. For instance, one could check whether
total energy is conserved.

Beam data coordinates are buffered in internal data pages of 500 rows
in length before being written to the output file. Thus one may find
interleaved data pages for electrons, positrons, and photons. When
processing data one should realize that the output files are split
into pages. For instance before histogramming, say the energy
coordinate, the command {\tt sddscombine} should be used on the output
file to merge all data pages into one.

\subsection{Shower Trajectory File}
This file is generated by the {\tt -trajectories} option.  If the name
of the trajectories file is unspecified, then one is formed
automatically by adding {\tt .traj} to the string given by {\tt -root}.

The shower file contains the $x$, $y$, $z$ coordinates and the energy
of each particles produced in the shower at each tracking step. The
column names are {\tt x}, {\tt y}, {\tt z}, and {\tt Energy},
respectively.  The shower file may grow very large depending on the
number of samples requested, the energy of the initial particle, and
depending on whether the shower is fully developed.

The shower output file may be plotted directly with the \sddsplot\
toolkit plotting program.  For instance,
\begin{verbatim}
sddsplot -col=x,z <file> -grapic=dots
\end{verbatim}
plots the $x,z$ projection of the shower trajectories in {\tt <file>}
as dots.  Since no information on the geometry of the problem is
contained in these output files it may be necessary to overlap the
shower product trajectories with the outline of the regions. The
outline can be generated from the geometry plot file produced by
\shower, as explained in the next section.

\subsection{Geometry Plot File}
This file is generated by the {\tt -plotGeometry} option.  If the name
of the geometry plot file is unspecified, then one is formed by adding
{\tt .line\_segments} to the string given by {\tt -root}.

This file contains the end point coordinates of the segments forming
the edges of the solids defined in the geometry file.  The columns of
the \SDDS\ file are {\tt xFrom}, {\tt yFrom}, {\tt zFrom}, {\tt xTo},
{\tt yTo}, and {\tt zTo}.  If two regions with the same material are
touching, then the common edge, if any, is not included.

The commandline option {\tt -vacuumStep=<distanceInCM>} allows one to
change the default distance by which particles are tracked at every
step in vacuum regions. In vacuum, all particles have infinite
mean-free path. For cpu efficiency, the default is made a very large
number such as 10 m. To create coordinates inside vacuum regions, a
distance value smaller than the dimension of the regions must be given.

\subsection{Summary File}
A regions summary file is always created. The filename can be
specified by the argument of the {\tt -summary} option or formed
automatically by adding {\tt .summary} to the value of the {\tt -root}
argument. The columns in this file contain information pertaining to
regions, such as the label, the geometrical center of each region
(calculated from the limits in the definition command), the volume
(including any subtractions due to overlap with previously defined
regions), the energy deposited by each type of particles, the fraction
of the total beam energy deposited, and, if the beam power was
specified, the radiation absorbed dose rate.

\section{Postprocessing the Output Files}
Since the output coordinate files and the summary file are in \SDDS\
format, \SDDS\ toolkit programs are available for post-processing the
results. The programs are listed in references \cite{SDDS}.
Programs that may be applicable with \shower\ outputs files are:
\begin{itemize}
\item
{\tt sddshist, sdds2hist} --- Histogram program
\item
{\tt sddsquery} --- Lists the columns and parameter definitions in a file.
\item
{\tt sddsprocess} --- General processing program.
\item
{\tt sddscombine} --- Combines \SDDS\ files, and optionally merges
data pages into one.
\item
{\tt sddsconvert} --- Convert between ascii and binary, and other
filtering functions.
\item
{\tt sddscontour} --- Contour and density plotting program
\end{itemize}
For instance, the program {\tt sddsprocess} operating on the summary
file can give the maximum dose rate in any region with material value
matching the string ``human''.

\section{Acknowledgement}
The \egs\ code system was obtained from A. Bielajew of NRC of Canada.

\begin{thebibliography}{9}
\bibitem{egs4}
{W. R. Nelson, Hideo Hirayama, and D. W. O. Rogers}, ``{The EGS4 Code
  System},'' SLAC 265, SLAC, December 1985.

\bibitem{Bielajew}
A.~F. Bielajew, ``egs4unix ver. 3.0.''
\newblock Implementation of EGS4 on Unix, private communication.

\bibitem{SDDS} 
   M. Borland, ``User's Guide for SDDS Toolkit Version 1.8''
\begin{htmlonly} Available \htmladdnormallink{here.}{http://ops.aps.anl.gov/manuals/SDDStoolkit/SDDStoolkit.html}
\end{htmlonly}

\end{thebibliography}
\end{document}
