\section{Chiral Invariant Phase Space Decay.}
% \textheight 8.75in
% \textwidth 6.5in
% \parskip 1.45ex

\newtheorem{theorem}{Theorem}
\newtheorem{acknowledgement}[theorem]{Acknowledgement}
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{axiom}[theorem]{Axiom}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{conclusion}[theorem]{Conclusion}
\newtheorem{condition}[theorem]{Condition}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{criterion}[theorem]{Criterion}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{solution}[theorem]{Solution}
\newtheorem{summary}[theorem]{Summary}

\begin{document}
\title{Manual for the CHIPS event generator in GEANT4}
%\author{M.V.Kossov}
%\address{Mikhail.Kossov@itep.ru, Mikhail.Kossov@cern.ch, kossov@jlab.org,\\
%kossov@post.kek.jp}
\date{\today}
\maketitle

\begin{abstract}
In this manual the basic principles and the procedure of usage of the
CHIPS event generator in the GEANT4 framework is described in detail.
The emphasis is made on the practical issues which can make this event
generator an easy tool for differentapplications in GEANT4.
For the stand alone application of the CHIPS model (not for the
simulation of the processes in matter, but for the physics
analysis purposes) one can use the manual \cite{STAND_ALONE}. The
physics of the model is discussed in this Manual in a concise form
and to find answers to some physics questions one should read the
publications in physics jurnals, which are reffered to in the manual.
All complicated issues are collected in appendices to make easier the
straightforward use of the model. Examples and interfaces give the
 easiest way to use the event generator.
\end{abstract}

\section{Introduction.}

\noindent \qquad  The CHIPS event generator is based on the Chiral
Invariant Phase Space model \cite{CHIPS1},\cite{CHIPS2},\cite{CHIPS3},
which is typically a quark-level SU(3) model (c, b, and t quarks are not
implemented in this version of the event generator), but in spite of
its quark nature it can be successfully used even at very low energies. It
should be pointed out that originally the CHIPS event generator was made
only for the final hadronic fragmentation, so it demands a special development
in the part of the initial interaction of projectiles (projectiles can be
hadrons or photons) with targets (targets can be hadrons or nuclei). So the
first applications of CHIPS described the interactions at rest (where the
interaction cross section is not important)\cite{CHIPS1},\cite{CHIPS2} or
low energy photo-nuclear reactions (where the interaction cross section can
be easily calculated)\cite{CHIPS3}. In this manual the parametrization
of the cross sections of the photonuclear nd electronuclear reactions
is explained and the hadron nuclear crossections are parametrized in
other GEANT4 classes, so formally the CHIPS event jenerator can be
used in all kinds of hadronic interaction (having in mind that the
photon can be considered as a superposition of vector mesons: VDM
model). The interface which was made for the CHIPS event generator
from the String
Model of Geant4 \cite{GEANT4} (the results were briefly discussed by
Hans-Peter Wellisch on MC2000 \cite{MC2000}) makes it possible to use
the CHIPS code for nuclear fragmentation at extremely high energies.
Applications at intermediate energies (1-10 GeV) needs additional
tuning of the interaction mechanizm.

The basic scheme of the event generator is the fragmentation of a quasmon in
vacuum or in nuclear matter. The quasmon is a fundamental notion in the
CHIPS model. It can be considered as a generalization of the hadron notion in
fundamental particles physics. Hadron has quantum numbers and fixed or
distributed mass. The quantum numbers define quark content of the hadron. On
the contrary quasmon is defined by quark content and mass. For each
hadronic state with the fixed mass and corresponding quark content one
can consider this hadronic state as a superposition of hadrons with the same
quark content. The fundamental parameter of the model, critical
temperature ${\bf T}_{c},$ defines a number of quark-partons in a
quasmon. This can help to understand why in CHIPS the
quark content is the basic notion and the particle is a secondary notion, while
in other models the basic notion is a particle and the quark content is a
secondary notion. So the result of a hadronic or a nuclear interaction
is the creation of a quasmon which is actually an intermediate
excited hadronic matter. In vacuum it can dissipate energy radiating
particles according to the quark fusion mechanism\cite{CHIPS1}
(Appendix C) and in nuclear matter in addition to vacuum mechanisms
the quark exchange with surrounding nucleons or nuclear clusters
mechanizm can be realized\cite{CHIPS2} (Appendix D). So the first
published versions of the CHIPS event generator had the {\bf
G4Quasmon} class as the head of the model. All initial interactions were
hidden in the {\bf G4Quasmon} constructor.  It should be mentioned,
that all classes of the CHIPS model have the {\bf G4Q} prefix while
most of GEANT4 classes have just a {\bf G4} prefix. Hopefully the
{\bf G4Q} prefix will not be used by other GEANT4 projects.

        More complicated applications of the model such as an anti-proton
capture at rest and Geant4 String Model interface to CHIPS led to the
multi quasmon version of the model. So since the last publication the
structure of classes of the CHIPS event generator was improved. E.g.
in case of the anti-proton annihilation on the nucleus at rest the first
interaction happens on nuclear periphery. After this initial
interaction, a part of secondary mesons (defined by the special
parameter of the model) independently penetrate the nucleus and each
of the mesons can create a separate quasmon in nuclear matter of the
same nucleus. In this case the {\bf G4Quasmon} class can not be the head
class of the model any more. That is why the new head class 
{\bf G4QEnvironment} was made, which can adopt a vector of projectile
hadrons ({\bf G4QHadronVector}) and can create a vector of quasmons
({\bf G4QuasmonVector}). After that all quasmons start the energy
dissipation process in parallel in the same nucleus. The
{\bf G4QEnvironment} instance can be used both for vacuum and for
nuclear matter. If the {\bf G4QEnvironment} is created for vacuum
there can be only one {\bf G4Quamon} instance inside, so for hadronic
interactions the model is not changed.

\section{Structure of C++ classes in CHIPS.}

\noindent \qquad The general scheme of the model defines a hierarchy of C++
classes:

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \fbox{G4QEnvironment}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ \ $\left| {}\right| $

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \fbox{G4QuasmonVector}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ $\ \left| {}\right| $

\ \ \ \ \ \ \ \ \ \ \ \ \ =============\fbox{G4Quasmon}===========

\ \ \ \ \ \ \ \ \ \ \ \ \ $\left| {}\right| $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ \ $\left| {}\right| $ \ \ \ \ \ \ \ \ \ $\left|
{}\right| $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $\left|
{}\right| $

\fbox{G4QNucleus} \ \ \fbox{G4QHadronVector} \ \fbox{G4QCHIPSWorld} \ \fbox{%
G4QChipolino}

\fbox{G4QCandidateVector} \ \ \ \ \ \ \ \ \ \ \ \ \ $\left| {}\right| $\ \ \
\ \fbox{G4QParticleVector}\ \ \ \ \ \ \ \ \ \ $\ \ \ \ \ \ \left| {}\right| $

\ \ \ $\ \ \ \ \ \ \ \ \left| {}\right| $\ \ \ \ \ \ \fbox{G4QCandidate} \ \ 
$\left| {}\right| $\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $\ \left|
{}\right| $\ \ \ \ \ \ \ \ \ \ \ $\ \ \ \ \ \ \ \ \ \ \left| {}\right| $

\ \ \ \ $\ \ \ \ \ \ \ \left| {}\right| $\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \fbox{G4QHadron} \ \ \ \ \ \ \ \ \ \ $\left| {}\right| 
$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $\left| {}\right| $

\ \ \ \ $\ \ \ \ \ \ \ \left| {}\right| $\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \fbox{G4QParticle%
} \ \ \ \ \ \ \ \ \ \ \ \ \ $\left| {}\right| $

\ \ \ \ $\ \ \ \ \ \ \ \left| {}\right| $\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \fbox{G4QDecayChannelVector%
} \ $\left| {}\right| $

\ \ \ \ $\ \ \ \ \ \ \ \left| {}\right| $\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \fbox{%
G4QDecayChannel} \ \ \ \ $\left| {}\right| $

\ \ \ \ \ \ \fbox{G4QParentClusterVector} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \fbox{G4QPDGCodeVector} \ \ $\left| {}\right| $

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \fbox{%
G4QParentCluster} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \fbox{G4QPDGCode}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \fbox{G4QContent}

It is necessary to make a few comments about this structure. This time let
us start from the bottom. As it was already pointed out in the
Introduction the basic class in CHIPS is {\bf G4QContent} (quark
content). This class is the basic class for the quasmon definition. The
quasmon makes the generalization of the notion of the hadron. The
hadron is
formalized by a C++ class {\bf G4QPDGCode }(particle with a code from a
Particle Data Group table). Another hadronic case of quasmon is
{\bf G4QParentCluster}. The parent clusters are created in nuclear
medium and used in the quark exchange mechanism of the energy dissipation
process. The vector of the {\bf G4QPDGCode} objects
({\bf G4QPDGCodeVector}) is used in the {\bf G4DecayChannel} class, which is
made for a set of particles in which primary particle can decay.
But an unstable particle can have several channels of decay, so
the {\bf G4QParticle} class uses the {\bf G4QDecayChannelVector}. The world
of particles ({\bf G4QCHIPSWorld}) in the model is just a
{\bf G4QParticleVector}. Only one instance of the {\bf G4QCHIPSWorld} is created
in the C++ heap and each {\bf G4Quasmon} class has a static pointer to this
instance of the {\bf G4QCHIPSWorld}. So this is a kind of a static data base
which contains particle properties necessary for the {\bf G4QHadron}
definition. So the creator of the {\bf G4QHadron} just gets a pointer to the
corresponding particle in the static {\bf G4QCHIPSWorld} data base. There is
another intermediate generalization of the hadron object, the 
{\bf G4QNucleus} class, which inherits properties of the {\bf G4QHadron} class.
It has a lot of additional nuclear properties but to inherit hadronic
features any nucleus should have a PDG code.

        In the CHIPS generator the nuclear code has 8 digits, starting
with 9. The second digit (L in the scheame below) defines a number of
$\Lambda $\ particles in the nucleus, the following three digits (PPP)
define a number of protons, and the last three digits (NNN) define the
number of neutrons in the nucleus. So the PDG code of the nucleus (or
nuclear cluster) has a form {\it 9LPPPNNN}. In the CHIPS event generator an
additional Q code is used, which helps to numerate particles included in the 
{\bf G4QCHIPSWorld} data base (Q=0 means that this particle is not in the 
{\bf G4QCHIPSWorld} data base). All these particles are listed in the tables
below. A particle and the corresponding antiparticle has the same Q code but
their PDG codes have opposite signs. The upper index of the name in the
table usually means a charge except for $\eta _{0}^{/}$(958), $f_{2}^{/}$(1525),
$\Lambda_{3/2}^{\ast}$(1520), and \ $\Lambda _{7/2}^{\ast }$(2100).
The lower index of the name
according to the PDG rule means spin (2S+1). Spin of the particle can be
calculated as an integer half of the last digit of the PDG code. This is not
true for the simple 8 digits codes for the nuclear clusters, which do
not contain the information about the spin at all, but it is true even for
the unusually coded $f_{0}^{0}$ hadrons (first of which is a
$\sigma $\ meson, which is an S-wave state of the $\pi ^{0}\pi ^{0}$\ system,
the second is $f_{0}^{0}$(980) and the third is $f_{0}^{0}$(1500))\thinspace.

\begin{tabular}{llllllllllllllllll}
{\bf  Q} & {\it  PDG} & H & {\bf Q} & {\it PDG} & H &
{\bf  Q} & {\it  PDG} & H & {\bf Q} & {\it PDG} & H &
{\bf  Q} & {\it  PDG} & H & {\bf Q} & {\it PDG} & H \\ 
{\bf  0} & {\it   22} & $\gamma $ &
{\bf 12} & {\it 3122} & $\Lambda_{1/2}^{0}$ &
{\bf 24} & {\it 1114} & $\Delta _{3/2}^{-}$ &
{\bf 36} & {\it  215} & $a_{2}^{+}$ &
{\bf 48} & {\it 3326} & $\Xi _{5/2}^{0}$ &
{\bf 60} & {\it 3118} & $\Sigma _{7/2}^{-}$ \\ 
{\bf  1} & {\it  110} & $f_{0}^{0}$ &
{\bf 13} & {\it 3112} & $\Sigma _{1/2}^{-}$ &
{\bf 25} & {\it 2114} & $\Delta _{3/2}^{0}$ &
{\bf 37} & {\it  225} & $f_{2}^{0}$ &
{\bf 49} & {\it  117} & $\rho _{3}^{0}$ &
{\bf 61} & {\it 3218} & $\Sigma _{7/2}^{0}$ \\ 
{\bf  2} & {\it  220} & $f_{0}^{0}$ &
{\bf 14} & {\it 3212} & $\Sigma _{1/2}^{0}$ &
{\bf 26} & {\it 2214} & $\Delta _{3/2}^{+}$ &
{\bf 38} & {\it  315} & $K_{2}^{0}$ &
{\bf 50} & {\it  217} & $\rho _{3}^{+}$ &
{\bf 62} & {\it 3228} & $\Sigma _{7/2}^{+}$ \\ 
{\bf  3} & {\it  330} & $f_{0}^{0}$ &
{\bf 15} & {\it 3222} & $\Sigma _{1/2}^{+}$ &
{\bf 27} & {\it 2224} & $\Delta _{3/2}^{++}$ &
{\bf 39} & {\it  325} & $K_{2}^{+}$ &
{\bf 51} & {\it  227} & $\omega _{3}^{0}$ &
{\bf 63} & {\it 3318} & $\Xi _{7/2}^{-}$ \\ 
{\bf  4} & {\it  111} & $\pi _{0}^{0}$ &
{\bf 16} & {\it 3312} & $\Xi _{1/2}^{-}$ &
{\bf 28} & {\it 3124} & $\Lambda _{3/2}^{0}$ &
{\bf 40} & {\it  335} & $f_{2}^{/}$ &
{\bf 52} & {\it  317} & $K_{3}^{\ast 0}$ &
{\bf 64} & {\it 3328} & $\Xi _{7/2}^{0}$ \\ 
{\bf  5} & {\it  211} & $\pi _{0}^{+}$ &
{\bf 17} & {\it 3322} & $\Xi_{1/2}^{0}$ &
{\bf 29} & {\it 3114} & $\Sigma _{3/2}^{-}$ &
{\bf 41} & {\it 2116} & $N_{5/2}^{0}$ &
{\bf 53} & {\it  327} & $K_{3}^{\ast +}$ &
{\bf 65} & {\it 3338} & $\Omega _{7/2}^{-}$ \\ 
{\bf  6} & {\it  221} & $\eta _{0}^{0}$ &
{\bf 18} & {\it  113} & $\rho _{1}^{0} $ &
{\bf 30} & {\it 3214} & $\Sigma _{3/2}^{0}$ &
{\bf 42} & {\it 2216} & $N_{5/2}^{+}$ &
{\bf 54} & {\it  337} & $\varphi _{3}^{0}$ &
{\bf 66} & {\it  119} & $a_{4}^{0}$ \\ 
{\bf  7} & {\it  311} & $K_{0}^{0}$ &
{\bf 19} & {\it  213} & $\rho _{1}^{+}$ & 
{\bf 31} & {\it 3224} & $\Sigma _{3/2}^{+}$ &
{\bf 43} & {\it 3126} & $\Lambda _{5/2}^{\ast }$ &
{\bf 55} & {\it 1118} & $\Delta _{7/2}^{-}$ &
{\bf 67} & {\it  219} & $a_{4}^{+}$ \\ 
{\bf  8} & {\it  321} & $K_{0}^{+}$ &
{\bf 20} & {\it  223} & $\omega _{1}^{0} $ &
{\bf 32} & {\it 3314} & $\Xi _{3/2}^{-}$ &
{\bf 44} & {\it 3116} & $\Sigma _{5/2}^{-}$ &
{\bf 56} & {\it 2118} & $\Delta _{7/2}^{0}$ &
{\bf 68} & {\it  229} & $f_{4}^{0}$ \\ 
{\bf  9} & {\it  331} & $\eta _{0}^{/}$ &
{\bf 21} & {\it  313} & $K_{1}^{\ast 0}$ &
{\bf 33} & {\it 3324} & $\Xi _{3/2}^{0}$ &
{\bf 45} & {\it 3216} & $\Sigma _{5/2}^{0}$ &
{\bf 57} & {\it 2218} & $\Delta _{7/2}^{+}$ &
{\bf 69} & {\it  319} & $K_{4}^{0}$ \\ 
{\bf 10} & {\it 2112} & $n_{1/2}^{0}$ &
{\bf 22} & {\it  323} & $K_{1}^{\ast +}$ &
{\bf 34} & {\it 3334} & $\Omega _{3/2}^{-}$ &
{\bf 46} & {\it 3226} & $\Sigma _{5/2}^{+}$ &
{\bf 58} & {\it 2228} & $\Delta _{7/2}^{++}$ &
{\bf 70} & {\it  329} & $K_{4}^{+}$ \\ 
{\bf 11} & {\it 2212} & $p_{1/2}^{+}$ &
{\bf 23} & {\it  333} & $\varphi _{1}^{0}$ &
{\bf 35} & {\it  115} & $a_{2}^{0}$ &
{\bf 47} & {\it 3316} & $\Xi _{5/2}^{-}$ &
{\bf 59} & {\it 3128} & $\Lambda _{7/2}^{\ast }$ &
{\bf 71} & {\it  339} & $f_{4}^{/}$
\end{tabular}

\bigskip

Only isotope symmetric nuclear clusters are considered in the CHIPS world. As
there are separate tables for hadrons and for nuclear fragments, there is an
overlap in naming. In particular for the neutron one can find {\it 2112}
(Q=10) and {\it 90000001} (Q=72), for proton {\it 2212 (Q=11)} and {\it %
90001000} (Q=73), for lambda {\it 3122 (Q=12)} and {\it 91000000} (Q=74).
Internally in the program one can find strange codes such as {\it 89999999}
for anti-neutron or even {\it 90999999} for K0. The PDG coding of the
generator supports such codes, but in the output such codes should not
appear. The nuclear fragment coding includes 8 light isofragments (fragments
contaning isobars: {$p\Delta ++$}, {$n\Delta -$}, {$\Delta ++ \Delta ++$},
 {$\Delta - \Delta -$},) {$pp\Delta ++$}, {$nn\Delta -$},
 {$p\Delta ++ \Delta ++$}, {$p\Delta - \Delta -$}, which have Q-codes
from 71 to 79). The PDG codes of the isonuclei contain negative
numbers of protons or neutrons, so they can look strange. E.g. the PDG
code for the {$p\Delta ++ \Delta ++$} fragment is 90004999. The last
999 mean that the number of neuterons is -1 and 1 is subtracted from
the number of protons, so the number of protons is 5. The same rule can
help to determine the number of protons (-1) and neutrons (5) from the
PDG code 89999005 in case of the {$p\Delta - \Delta -$}
state. Hopefully the CHIPS user never meet such codes, as the codes
with negative number of baryons in the PDG code are internal and
usually decay before coming in the output. E.g. the {$p\Delta ++$}
state decays in two protons and positive pion.

        The structure of the following table for the normal nuclei and
hypernuclei can be easily extrapolated, so the PDG coding of the
generator covers by far more nuclear fragments than are listed in the table.

\bigskip

\begin{tabular}{llllllllllll}
{\bf   Q} & {\it      PDG} & H & {\bf Q} & {\it PDG} & H &
{\bf   Q} & {\it      PDG} & H & {\bf Q} & {\it PDG} & H \\ 
{\bf  80} & {\it 90000001} & n &
{\bf 109} & {\it 92001002} & $\Lambda \Lambda t$ &
{\bf 138} & {\it 91005004} & $\Lambda $B$^{8}$ &
{\bf 167} & {\it 91006006} & $\Lambda $C$^{12}$ \\ 
{\bf  81} & {\it 90001000} & p &
{\bf 110} & {\it 92002001} & $\Lambda \Lambda $He$^{3}$ &
{\bf 139} & {\it 92003004} & $\Lambda \Lambda $Li$^{7}$ &
{\bf 168} & {\it 91007005} & $\Lambda $N$^{12}$ \\ 
{\bf  82} & {\it 91000000} & $\Lambda $ &
{\bf 111} & {\it 90002004} & He$^{6} $ &
{\bf 140} & {\it 92004003} & $\Lambda \Lambda $Be$^{7}$ &
{\bf 169} & {\it 92005006} & $\Lambda \Lambda $B$^{11}$ \\ 
{\bf  83} & {\it 90000002} & nn &
{\bf 112} & {\it 90003003} & Li$^{6}$ & 
{\bf 141} & {\it 90004006} & Be$^{10}$ &
{\bf 170} & {\it 92006005} & $\Lambda \Lambda $C$^{11}$ \\ 
{\bf  84} & {\it 90001001} & d/np &
{\bf 113} & {\it 90004002} & Be$^{6}$ & 
{\bf 142} & {\it 90005005} & B$^{10}$ &
{\bf 171} & {\it 90006008} & C$^{14}$\\ 
{\bf  85} & {\it 90002000} & pp &
{\bf 114} & {\it 91002003} & $\Lambda $He$^{5}$ &
{\bf 143} & {\it 90006005} & C$^{10}$ &
{\bf 172} & {\it 90007007} & N$^{14}$ \\ 
{\bf  86} & {\it 91000001} & $\Lambda $n &
{\bf 115} & {\it 91003002} & $\Lambda $Li$^{5}$ &
{\bf 144} & {\it 91004005} & $\Lambda $Be$^{9}$ &
{\bf 173} & {\it 90008006} & O$^{14}$ \\ 
{\bf  87} & {\it 91001000} & $\Lambda $p &
{\bf 116} & {\it 92001003} & $\Lambda \Lambda $H$^{4}$ &
{\bf 145} & {\it 91005004} & $\Lambda $B$^{9}$ & 
{\bf 174} & {\it 91006007} & $\Lambda $C$^{13}$ \\ 
{\bf  88} & {\it 92000000} & $\Lambda \Lambda $ &
{\bf 117} & {\it 92002002} & $\Lambda \Lambda $He$^{4}$ &
{\bf 146} & {\it 92003005} & $\Lambda \Lambda $Li$^{8}$ &
{\bf 175} & {\it 91007006} & $\Lambda $N$^{13}$ \\ 
{\bf  89} & {\it 90001002} & t &
{\bf 118} & {\it 92003001} & $\Lambda \Lambda $Li$^{4}$ &
{\bf 147} & {\it 92004004} & $\Lambda \Lambda $Be$^{8}$ &
{\bf 176} & {\it 92005007} & $\Lambda \Lambda $B$^{12}$ \\ 
{\bf  90} & {\it 90002001} & He$^{3}$ &
{\bf 119} & {\it 90003004} & Li$^{7}$ &
{\bf 148} & {\it 92005003} & $\Lambda \Lambda $B$^{8}$ &
{\bf 177} & {\it 92006006} & $\Lambda \Lambda $C$^{12}$ \\ 
{\bf  91} & {\it 91000002} & $\Lambda $nn &
{\bf 120} & {\it 90004003} & Be$^{7}$ &
{\bf 149} & {\it 90005006} & B$^{11}$ &
{\bf 178} & {\it 92007005} & $\Lambda \Lambda $N$^{12}$ \\ 
{\bf  92} & {\it 91001001} & $\Lambda $d &
{\bf 121} & {\it 91002004} & $\Lambda $He$^{6}$ &
{\bf 150} & {\it 90006005} & C$^{11}$ &
{\bf 179} & {\it 90007008} & N$^{15}$ \\ 
{\bf  93} & {\it 91002000} & $\Lambda $pp &
{\bf 122} & {\it 91003003} & $\Lambda $Li$^{6}$ &
{\bf 151} & {\it 91004006} & $\Lambda $Be$^{10}$ &
{\bf 180} & {\it 90008007} & O$^{15}$ \\ 
{\bf  94} & {\it 92000001} & $\Lambda \Lambda $n &
{\bf 123} & {\it 91004002} & $\Lambda $Be$^{6}$ &
{\bf 152} & {\it 91005005} & $\Lambda $B$^{10}$ & 
{\bf 181} & {\it 91006008} & $\Lambda $C$^{14}$ \\ 
{\bf  95} & {\it 92001000} & $\Lambda \Lambda $p &
{\bf 124} & {\it 92002003} & $\Lambda \Lambda $He$^{5}$ &
{\bf 153} & {\it 91006004} & $\Lambda $C$^{10} $ &
{\bf 182} & {\it 91007007} & $\Lambda $N$^{14}$ \\ 
{\bf  96} & {\it 90003001} & H$^{4}$ &
{\bf 125} & {\it 92003002} & $\Lambda \Lambda $Li$^{5}$ &
{\bf 154} & {\it 92004005} & $\Lambda \Lambda $Be$^{9}$ &
{\bf 183} & {\it 91008006} & $\Lambda $O$^{14}$ \\ 
{\bf  97} & {\it 90002002} & He$^{4}$ &
{\bf 126} & {\it 90003005} & Li$^{8}$ &
{\bf 155} & {\it 92005004} & $\Lambda \Lambda $B$^{9}$ &
{\bf 184} & {\it 92006007} & $\Lambda \Lambda $C$^{13}$ \\ 
{\bf  98} & {\it 90001003} & Li$^{4}$ &
{\bf 127} & {\it 90004004} & Be$^{8}$ &
{\bf 156} & {\it 90005007} & B$^{12}$ &
{\bf 185} & {\it 92007006} & $\Lambda \Lambda $N$^{13}$ \\ 
{\bf  99} & {\it 91001002} & $\Lambda t$ &
{\bf 128} & {\it 90005003} & B$^{8} $ &
{\bf 157} & {\it 90006006} & C$^{12}$ &
{\bf 186} & {\it 90007009} & N$^{16}$ \\ 
{\bf 100} & {\it 91002001} & $\Lambda $He$^{3}$ &
{\bf 129} & {\it 91003004} & $\Lambda $Li$^{7}$ &
{\bf 158} & {\it 90007005} & N$^{12}$ &
{\bf 187} & {\it 90008008} & O$^{16}$ \\ 
{\bf 101} & {\it 92000002} & $\Lambda \Lambda $nn &
{\bf 130} & {\it 91004003} & $\Lambda $Be$^{7}$ &
{\bf 159} & {\it 91005006} & $\Lambda $B$^{11}$ & 
{\bf 188} & {\it 90009007} & F$^{16}$ \\ 
{\bf 102} & {\it 92001001} & $\Lambda \Lambda $d &
{\bf 131} & {\it 92002004} & $\Lambda \Lambda $He$^{6}$ &
{\bf 160} & {\it 91006005} & $\Lambda $C$^{11} $ &
{\bf 189} & {\it 91007008} & $\Lambda $N$^{15}$ \\ 
{\bf 103} & {\it 92002000} & $\Lambda \Lambda $pp &
{\bf 132} & {\it 92003003} & $\Lambda \Lambda $Li$^{6}$ &
{\bf 161} & {\it 92004006} & $\Lambda \Lambda $Be$^{10}$ &
{\bf 190} & {\it 91008007} & $\Lambda $O$^{15}$ \\ 
{\bf 104} & {\it 90002003} & He$^{5}$ &
{\bf 133} & {\it 92004002} & $\Lambda \Lambda $Be$^{6}$ &
{\bf 162} & {\it 92005005} & $\Lambda \Lambda $B$^{10}$ &
{\bf 191} & {\it 92006008} & $\Lambda \Lambda $C$^{14}$ \\ 
{\bf 105} & {\it 90003002} & Li$^{5}$ &
{\bf 134} & {\it 90004005} & Be$^{9}$ &
{\bf 163} & {\it 92006004} & $\Lambda \Lambda $C$^{10}$ &
{\bf 192} & {\it 92007007} & $\Lambda \Lambda $N$^{14}$ \\ 
{\bf 106} & {\it 91003001} & $\Lambda $H$^{4}$ &
{\bf 135} & {\it 90005004} & B$^{9}$ &
{\bf 164} & {\it 90006007} & C$^{13}$ &
{\bf 193} & {\it 92008006} & $\Lambda \Lambda $O$^{14}$ \\ 
{\bf 107} & {\it 91002002} & $\Lambda $He$^{4}$ &
{\bf 136} & {\it 91003005} & $\Lambda $Li$^{8}$ &
{\bf 165} & {\it 90007006} & N$^{13}$ &
{\bf 194} & {\it 90008009} & O$^{17}$ \\ 
{\bf 108} & {\it 91001003} & $\Lambda $Li$^{4}$ &
{\bf 137} & {\it 91004004} & $\Lambda $Be$^{8}$ &
{\bf 166} & {\it 91005007} & $\Lambda $B$^{12}$ & 
{\bf 195} & {\it 90009008} & F$^{17}$
\end{tabular}

In future this infinite table will be restricted as the lane of stability
shifts from the line of the mirror nuclei. E.g. F$^{18}$ nucleus is already $\beta
^{+}$ radioactive. On the other hand, the experience of simulation of nuclear
fragmentation shows that the probability to radiate a fragment heavier
than O$^{16}$ is negligibly small. So in future the Q codes starting
with 194 will be used for the fission fragments (the lightest parts of
the fission fragments). With these heavy fragments it is
planned to simulate a fission process which can be very important for
low energy photo-nuclear reactions. It can be the same quark exchange
mechanism, but the nuclear clusterization procedure should be
generalized for the heavy fission fragments.

\qquad Now let us come back to the structure of C++ classes in the CHIPS
model. Both hadrons and nuclear fragments can be candidates
({\bf G4QCandidate} inherits properties of the {\bf G4QHadron}
class) to the secondaries in the reaction and the CHIPS model
makes a competition between them. So it is necessary to have a
{\bf G4QCandidateVector} class. In the case of hadronization in vacuum
the competition between the candidates is clear as only the
probabilities to fuse quark-antiquark or quark-diquark should be
calculated as it is explained in \cite{CHIPS1} (Appendix C). In
the case of the quark exchange hadronization the situation is more
complicated as the same fragment, say He$^{4}$, can be radiated as a result
of quark exchange with different H$^{4}$, He$^{4}$, and Li$^{4}$ clusters or
even with $\Lambda $t or $\Lambda $He$^{3}$ clusters, which are considered
as parent clusters in the model\cite{CHIPS2} (Appendix D). In fact,
the {\bf G4QParentCluster} is not a nuclear fragment; it contains only
its PDG code as an integer number and a quark content of the exchange
quark pair which is necessary to create the secondary fragment from
the parent cluster. So it does not inherit the properties of the 
{\bf G4QNucleus} or {\bf G4QHadron} and uses only {\bf G4QContent} class.
Another hadronic object which is used in the CHIPS event generator is a
chipolino. The {\bf G4QChipolino} is an object which can be
represented only by two hadrons e.g.
$\pi ^{+}\pi ^{+}$ or $\pi ^{+}$K$^{+}$. The chipolinos as well as $nn$ and
$pp$ nuclear fragments are completely internal in the model and should
not appear in the output {\bf G4QHadronVector}. The PDG code of all
chipolinos is 10, so the {\bf G4QChipolino} class can inherit the
{\bf G4QPDGCode} properties while it is not included in the {\bf
G4QCHIPSWorld} data base as it does not have a fixed mass value and
has only one possible channel of decay (decay into the two
hadrons only).

        This is the total hierarchy of C++ classes of the CHIPS event generator.
It was intended to be linear and but for the {\bf G4QCHIPSWorld},
{\bf G4QChipolino,} and {\bf G4QParentCluster} it is. There is
intention to keep this simple structure in future. The disadvantage
of this kind of strategy is the necessity to work with large classes.
The biggest class of the model is still {\bf G4Quasmon}
(about 4400 lines), then a big one is {\bf G4QNucleus} class (about 2900
lines, it containes the hadron-level EVA model of nuclear evaporation)
and then a new part, {\bf G4QEnvironment} class, which is almost as
big as the  {\bf G4Quasmon} class (about 4100 lines) and it probably
will grow up in future as it deals with the first interaction issue.

\section{CHIPStest example and usage of the CHIPS model.}

\noindent \qquad This section gives step by step comments for the
{\bf CHIPStest} program to make understanding of the basic member
functions of the CHIPS event generator easier. It can be useful for
the novice user of C++. So the text of the main {\bf CHIPStest.cc}
file is just reproduced in bold together with some comments. It is
necessary to point out that this program which can be distributed
together with the GEANT4 or the CHIPS event generator is not a part
of the CHIPS event generator. This is just a tool for the standard
test for the event generator, but it can be successfuly used for
the physics analysis.

{\bf //\#define debug}

{\bf //\#define pdebug}

// If these flags are uncommented it opens the debugging prints. This is an
example of a debugging method, which is widely used in the CHIPS event
generator.

{\bf \#include 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
iostream.h%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
}

{\bf \#include 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
fstream.h%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
}

{\bf \#include 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
iomanip.h%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
}

{\bf \#include ''G4ios.hh''}

// These are just useful standard headers for I/O. The {\bf G4ios.hh }stands
for unification in working on different platforms.

{\bf \#include ''G4QEnvironment.hh''}

// This is the main and, in fact, the only header of the CHIPS model

{\bf int main()}

{\bf \{}

// Here the main program CHIPStest starts

{\bf \ \ G4cout%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''Prepare chips.hbook file for HBOOK histograms''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
G4endl;}

// Pay your attention to the fact that if you use the GEANT4 rules
you must use {\bf G4cout }instead of {\bf cout}, {\bf G4cerr} instead of
cerr, and {\bf G4endl} instead of {\bf endl} of C++.

{\bf \ \ G4cout.setf(ios::scientific, ios::floatfield);}

// This fixes formats of output for the {\bf G4cout} stream.

{\bf \ \ ifstream inFile(''chipstest.in'', ios::in);}

// This is the definition of the input file where you can change the
parameters of the model without recompiling of the code (see example of
values below).

{\bf \ \ G4double temperature;}

// The main parameter of the CHIPS model known as a critical
temperature T$_{c}$. It is a good idea to use {\bf G4double} instead
of standard C++ {\bf double} and {\bf G4int} instead of just
{\bf int}, as the {\bf G4} variables are independent of the word
length on the particular platform.

{\bf \ \ G4double ssin2g;}

// This is a s/u sea-factor which defines the s-quark suppression in respect
to u and d quarks.

{\bf \ \ G4double etaetap;}

// This parameter is important only for $\eta $ production, which consists
of not only quarks but sometimes of gluons too.

{\bf \ \ G4double momb;}

// This is a value of the momentum of the incident particle. All momentum
and energy values in CHIPS are in MeV.

{\bf \ \ G4double enb;}

// Energy of virtual incident particle. If enb=0 (real particle), energy is
automatically calculated using momb value.

{\bf \ \ G4double cP;}

// A clasterization parameter. If dA is a number of nucleons in the dense
region of the nucleus, then $\frac{cP}{dA}$ is a clusterization probability,
which is called $\omega $ in \cite{CHIPS2} (Appendix D).

{\bf \ \ G4double fN;}

// A number of quasi-free nucleons on the nuclear periphery is defined by
the {\bf fN}$\cdot ${\bf A} value. The {\bf fN} parameter is named
$\varepsilon _{1}$ in \cite{CHIPS2} (Appendix D). It increases a
probability to find quasi-free nucleons calculated for only the dense
nuclear matter (the nuclear perifery is not so dence).

{\bf \ \ G4double fD;}

// A number of peripheral dinucleon clusters is defined by the
{\bf dN}$\cdot ${\bf A} value. The {\bf dN} parameter is named
$\varepsilon _{2}$ in \cite{CHIPS2} (Appendix D). It increases a
probability to find dinucleons calculated for the dense nuclear
matter. The number of quasy free nucleons in the dense region is
calculated as dA=A$\cdot $(1-fN-fD).

{\bf \ \ G4double rM;}

// This parameter can reduce (%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
1) or increase (%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
1) the quark fusion mechanism in respect to the quark exchange mechanism in
nuclear matter. The user can vary it from 0 to $\infty .$

{\bf \ \ G4double sA;}

// This is a part of 4$\pi $ sector in which the secondary pions can be
captured by the nucleus. As the limit is in terms of cos(), this parameter
varies from -1 to 1 and in the present version of the CHIPS event
generator it has some meaning only for the antiproton annihilation on
nuclei (see Appendix B for details).

{\bf \ \ G4int nop;}

// A number of particles considered as candidates of hadronization and
initialized in {\bf G4QCHIPSWorld.}

{\bf \ \ G4int pPDG;}

// The PDG code of the projectile. Only one projectile is used in this test
program.

{\bf \ \ G4inttPDG;}

// The PDG code of the target. Target is always at rest and in the ground
state, so its mass is automatically calculated.

{\bf \ \ G4int nEvt;}

// A number of events to be simulated. These are just declarations for the
input parameters in the {\bf CHIPStest} program.

\ \ {\small \ }{\bf inFile%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
temperature%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
ssin2g%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
etaetap%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
nop%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
momb%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
enb%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
pPDG}

{\bf \ \ \ \ \ \ \ \ \ \ \ 
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
tPDG%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
nEvt%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
fN%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
fD%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
cP%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
rM%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
sA;}

// This is how the user can read parameters from the {bf chipstest.in} file to
the {\bf CHIPStest} program. The standard input file {\bf chipstest.in}
contains only one line:

{\it 180.00 0.10 0.30 164 25. 0. 22 90020020 2000 0.40 0.04 4.00 1.00 0.40 }.

Usually it is necessary only to change the PDG
codes of the projectile and of the target and the momentum of the incident
particle (unless the particle is virtual and instead of 0 for the energy the
real value of the energy is given). The clusterization parameters
are more or less the same for all nuclei. For a number of
reactions the model has not been tuned yet, so it is necessary to have in
mind, that the meson production can be controlled by the {\bf rM} parameter
and the production of the strange particles can be controlled by the
{\bf ssin2g} parameter. The contribution of the secondary interactions
(now only for the annihilation of the antibaryon on nuclei at rest)
is controlled by the {\bf sA} parameter. The $\eta $\ production is
controlled by the {\bf etaetap} parameter. If very heavy secondary
nuclear fragments are under investigation the limit for the possible
clusters {\bf nop} can be increased.

{\bf \ \ G4QCHIPSWorld aWorld(nop);}

// Here the {\bf G4QCHIPSWord} is created in a heap with {\bf nop}
particles. The CHIPS event generator on fly will try to create new instances
of the {\bf G4CHIPSWorld}, but as the World is already once created, the
program gives only a pointer to the already created World. Using this
pointer the program knows how many particles are defined in the World and
tries to use them as possible candidates for hadronization. The smaller this
number the faster the program, but the more restricted range of types of
the secondary nuclear fragments can be generated.

{\bf \ \ G4QNucleus::SetParameters(fN,fD,cP,rM);}

// This member function defines the static parameters for the nuclear
clusterization and relative weight for the vacuum quark fusion hadronization
in the particular nucleus. It is possible that the weight of vacuum
hadronization {\bf rM} can be reduced in the heavy nuclei, but up to now it
was not necessary, so it is normally 1. Just to see what can happen if only
the quark exchange hadronization mechanism is working, one can set this
parameter to 0.

{\bf \ \ G4Quasmom::SetParameters(temperature,ssin2g,etaetap);}

// This member function defines the static parameters of quasmons. The temperature
should not be changed as it is defined by
the energy dependance of the pion multiplicity in the $p\bar{p}$ and
$e^{+}e^{-}$ reactions \cite{CHIPS1} (Appendix D) and by the mass
spectrum of hadrons\cite{massSpectr}. The second parameter is proportional
to the yield of strange particles and it can be tuned by the user. The third
parameter can be varied only in the case of $\eta $ production.

{\bf \ \ G4QEnvironment::SetParameters(sA);}

// Here more parameters of the first interaction can be added later. The sA
parameter can be varied only for anti-proton annihilation on the nuclei.

{\bf \ \ ofstream outFile(''chipstest.out'', ios::out);}

{\bf \ \ outFile.setf(ios::scientific, ios::floatfield);}

// Definition of the output file and formate definition for output numbers.
It can be important only for the length of the output ASCII file.

{\bf \ \ G4double mp=G4QPDGCode(pPDG).GetMass();}

// This is a good example of how one can get the mass of the particle using its
PDG code: the intermediate instance of the {\bf G4QPDGCode} class is created
for the PDG code of the projectile particle and the {\bf GetMass()} member
function gives a mass value for this particle.

{\bf \ \ G4double ep=sqrt(mp*mp+momb*momb);}

// It is a good idea to initialize a variable of C++ immediately at the
creation point. So the value of the projectile energy is calculated even
before it is known if this particle virtual or real.

\ {\bf \ if(enb%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
0.) ep=enb;}

// If particle is virtual, then the energy is selected from the input file.

{\bf \ \ G4double mt=G4QPDGCode(tQPDG).GetMass();}

// The same method of mass extraction is used for the target, so it is
equally good for photons, hadrons or nuclei.

{\bf \ \ G4QContent pQC=Q4QPDGCode(pPDG).GetQuarkContent();}

{\bf \ \ G4int cp=pQC.GetCharge();}

{\bf \ \ G4int ct=Q4QPDGCode(tPDG).GetQuarkContent().GetCharge();}

// Here {\bf Q4QPDGCode(tPDG).GetQuarkContent()} is an intermediate instance
of {\bf G4QContent} class.

{\bf \#ifdef debug}

{\bf \ \ G4cout%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''Main: projQC=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
pQC%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'', projCharge=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
pc}

\ \ \ \ \ \ \ \ \ \ \ \ \ {\bf 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'', targetCharge=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
ct%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
G4endl;}

{\bf \#endif}

// This printing can be opened if the {\bf debug} flag definition above is
uncommented.

\ {\bf \ G4int totC=cp+ct;}

// Total charge of the reaction to be checked in every event.

\ {\bf \ G4LorentzVector proj4Mom(0.,0.,momb,ep);}

// The {\bf G4LorentzVector} is a very useful class (originally {\bf %
LorentzVector}) of CLHEP Library adopted by GEANT4. It is widely used in the
CHIPS event generator.

\ \ {\bf G4double fEvt=nEvt;}

// This is the simplest way to convert integer to double. To convert
{\bf double} into {\bf integer} one can use {\bf iv=static\_cast%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
int%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
(fv)} to avoid compiler warnings.

\ {\bf \ G4double sumE=0.;}

// Counter of $\eta $

{\bf \ \ G4double sumK=0.;}

// Counter of kaons

{\bf \ \ G4double sumG=0.;}

// Counter for events with $\gamma $

{\bf \ \ G4doublesumT=0.;}

// Sum of $\gamma $\ energies over events with $\gamma $

\ {\bf \ G4double sumN=0.; }

// Counter for events with $\pi ^{-}$

{\bf \ \ G4double sum0=0.; }

//Counter for events with $\pi ^{0}$

\ {\bf \ G4double sumP=0.; }

// Counter for events with $\pi ^{+}$

\ {\bf \ G4double sum1N=0.; }

// Counters for event with only neutrons

\ {\bf \ G4double sumNN=0.; }

//Counter for events with neutrons

\ {\bf \ G4double sumPP=0.; }

// Counter for events with protons

{\bf \ \ G4double sumAL=0.; }

// Counter for events with $\alpha $. This is just resetting of counters.

{\bf \ \ for (G4int ir=0; ir%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
nEvt; ir++)}

{\bf \ \{}

// This is just a loop over nEvt events.

\ {\bf \ \ \ \ G4int iRandCount = nEvt\%100;}

// Normally a number of events is of the order of hundreds, thousands or
millions, so the low digits are used to make a sample of events in case of
multiple call of the {\bf CHIPStest} program. E.g. if one calls
{\bf CHIPStest} 3 times with the numbers of events 2001, 2002, and 2003, all
three samples will be completely different and the statistics can be added,
if one call {\bf CHIPStest} three times with the numbers of events 2000,
2000, and 2000, then all three samples must be identical, otherwise it
becomes impossible to find dip errors.

\ \ {\bf \ \ \ while(iRandCount%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
0)}

{\bf \ \ \ \ \ \{}

{\small \ \ \ }{\bf \ \ \ \ \ \ G4double vRandCount = G4UniformRand();}

// The {\bf G4UniformRand()} is another useful routine adopted by GEANT4
from CLHEP Library.

{\bf \ \ \ \ \ \ \ \ \ iRandCount - -;}

{\bf \ \ \ \ \ \}}

// This is a {\bf while} loop to shift random numbers.

\ \ {\bf \ \ \ if(!(ir\%1000) \&\& ir)}

{\bf \ \ \ \ \ \ G4cout%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''CHIPStest: ''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
ir%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'' events are simulated''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
G4endl;}

// This is how every 1000 events the {\bf CHIPStest} informs the user that
the program is still alive.

{\bf \ \ \ \ \ G4LorentzVector totSum=G4LorentzVector(0.,0.,momb,ep+mt);}

// This is how the total 4-momentum of the reaction can be made for the
future check in every event (It can be prepared beyond the loop and be
copied similarly to the total charge in the next line).

{\bf \ \ \ \ \ G4int totCharge=totC;}

// A copy of the total charge.

{\bf \ \ \ \ \ G4QHadronVector projHV;}

// Now instead of only one projectile CHIPS adopts a set of projectiles. Of
cause the vector can consist of only one particle as in this particular
case. This vector is created in C++ stack, not in C++ heap, so it is
automatically deleted in the end of the loop (but not pointers and not
instances to which pointers indicate!).

{\bf \ \ \ \ \ G4QHadron* iH= new G4QHadron(pProg,proj4Mom);}

// In this line the {\bf G4QHadron} instance is created in the C++ heap and 
{\bf iH} is just a pointer to this instance of the class, so every time when
the user creates something in C++ heap he becomes responsible for the
destruction of the created instance of the class, otherwise the undeleted
garbage is collected in the C++ heap and this results in the memory leak.
There is no garbage collection service in C++!

{\bf \ \ \ \ \ G4QEnvironment* pan = new G4QEnvironment(projHV, tPDG);}

// This is the main line of the test program. The instance of the
interaction class {\bf G4QEnvironment} is created here in C++ heap and
should be destructed as soon as possible.

{\bf \ \ \ \ \ G4std::for\_each(projHV.begin(), projHV.end(), DeleteQHadron());}
{\bf \ \ \ \ \ projHV.clear();}

// CLEAR here stands for excluding of the pointers and DESTROY stands for
deleting of the instances of classes to which pointers indicate, so
the {\bf iH} pointer can be used to delete the corresponding instance
of the {\bf G4QHadron} class. It is important to understand that by deleting unnecessary
instances of classes the user can avoid problems with the memory leak;

{\bf \ \ \ \ \ G4QHadronVector* output = pan-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
Fragment();}

// This is the point in the test program, where some convention in C++
should be settled. At first glance nothing new is created in this line and
the user is not responsible for the garbage collection. But which class
created the instance of this output {\bf G4QHadronVector}? - Obviously the 
{\bf pan} which is an instance of the {\bf G4QEnvironment} class. Then it is
responsible for the garbage collection and clearing, destroying and deleting
of instances in the destructor of {\bf G4QEnvironment}. In this case if
the user tries to delete the instance of the {\bf G4QEnvironment} class
as soon as possible, the {\bf output} vector will be lost. So the
{\bf pan} delete can be postponed unless all the information is taken out from
the {\bf output}. That is how it was done in the original CHIPS code.
But the GEANT4 Collaboration prefers to share the responsibility. It is
recommended to keep the small {\bf output} instance for a long time and
delete the large {\bf pan} instance as soon as possible. In this case
CHIPS creates the output  {\bf G4QHadronVector} in the heap and does
not take any responsibility for its deleting! If an unexperienced user
does not clear, destroy and delete the {\bf output}, then this should
be a problem of him... So be careful and follow this example in
detail in your own new classes or in new {\bf main}'s, otherwise after
a number of events you will be stopped by the ''memory overflow''
diagnostics. So any time, when you create a pointer remember
that you are responsible to delete the instance to which this pointer
indicates.

{\bf \ \ \ \ \ delete pan;}

// Here it is. The {\bf pan} is already disappeared, but the {\bf output}
still exists as a smile of Cheshire Cat.

{\bf \ \ \ \ \ G4int tNH = output-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
size();}

// This gives to the user a number of {\bf G4QHadron} instances in the
{\bf output} vector.

{\bf \#ifdef pdebug}

{\bf \ \ \ \ \ \ G4cout%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''DONE: ir=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
ir%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'': A\#of Hadrons=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
tNH%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
G4endl;}

{\bf \#endif}

// An example of debug printing for another flag {\bf pdebug}.

{\bf \ \ \ \ \ G4double EGamma =0.;}

// Just a sum of $\gamma $ energies for the particular event.

{\bf \ \ \ \ \ G4int npt=0;}

{\bf \ \ \ \ \ G4int nGamma=0;}

{\bf \ \ \ \ \ G4int nP0=0;}

{\bf \ \ \ \ \ G4int nPP=0;}

{\bf \ \ \ \ \ G4int nPN=0;}

{\bf \ \ \ \ \ G4int nKaons=0;}

{\bf \ \ \ \ \ G4int nEta=0;}

{\bf \ \ \ \ \ G4int nAlphas=0;}

{\bf \ \ \ \ \ G4int nPhotons=0;}

{\bf \ \ \ \ \ G4int nProtons=0;}

{\bf \ \ \ \ \ G4int nNeutrons=0;}

{\bf \ \ \ \ \ G4int nSpNeut=0;}

{\bf \ \ \ \ \ G4int nSpAlph=0;}

{\bf \ \ \ \ \ G4int nOmega=0;}

{\bf \ \ \ \ \ G4int nDec=0;}

// These are just counters for the particular event, which are
explained below.

\ \ \ \ {\bf \ G4bool alarm=false;}

// This flag is used for emergency exception in case of some serious error
found in the {\bf output} vector.

{\bf \ \ \ \ \ for (G4int ind=0; ind%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
tNH; ind++)}

{\bf \ \ \ \ \ \ \{}

// The loop over the output hadrons starts here.

{\bf \ \ \ \ \ \ \ \ G4QHadron* curH=output-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
operator[](ind);}

// Now as the user has a pointer to the {\bf output }in the C++ heap, not to
the {\bf output} instance in the C++ stack, it is necessary to use {\bf %
output-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
operator[](ind)} instead of {\bf output[ind]} (which is much more
readable; be careful: derefferencing does not work!) the way it was in
original CHIPS code, when instead of {\bf G4QHadronVector* output} the
{\bf G4QHadronVector output} was returned to the user and the user was not
responsible for deleting the vector itself as the vector was deleted in
stack automatically. The possible problem could associated with the pointers.
When the vector is deleted the pointers in the vector still remain
and to escape the memory leak one needs to CLEAR the vector first and then
delete it. So making a copy of the pointer to the instance you get
a useful tool to delete one by one the {\bf G4QHadron }instances of
the {\bf output} vector using {\bf delete curH }command.

\ {\bf \ \ \ \ \ \ \ G4double m=curH-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetMass();}

// So you see the {\bf GetMass()} member function is pretty common for
different CHIPS classes in other words this is an overloaded member
function. The same thing can be said about {\bf Get4Momentum()} or
{\bf GetQC()} ({\bf GetQuarkContent()} in historically first classes,
which will be corrected in future), {\bf GetPDGCode()},
{\bf GetQPDG()} (the difference is that {\bf GetPDGCode()} returns
just a {\bf G4int} value and {\bf GetQPDG()} returns
the instance of the {\bf G4QPDGCode} class, which can answer a lot of
questions and make a lot of actions). So {\bf m} is just a mass value for
the hadron in the {\bf output} vector.

{\bf \ \ \ \ \ \ \ \ G4LorentzVector lorV=curH-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
Get4Momentum();}

// This is a 4-momentum of the hadron. Be careful, the accuracy of a
computer is restricted, so the mass which is calculated from energy and
momentum ({\bf lorV.m()}) coming from complicated kinematical calculations,
can be slightly (usually not more than a few KeV) different from the basic
mass. But even worse can happen. If there is a mistake in the program one
can get a hadron under or above mass shell. It should be checked:

{\bf \ \ \ \ \ \ \ \ \ if(abs(m-lorV.m())%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
.003)}

{\bf \ \ \ \ \ \ \ \ \ \{}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ G4cerr%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''CHIPStest: m=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
lorV.m()%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'' \# ''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
m}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'', d=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
lorV.m()-m%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
G4endl;}

{\bf \ \ \ \ \ \ \ \ \ \ \ alarm=true;}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ //G4Exception(''CHIPStest: Wrong mass'');}

{\bf \ \ \ \ \ \ \ \ \ \}}

// Here another output flow {\bf G4cerr} is used. According to the GEANT4
convention this flow comes to the screen even when the {\bf G4cout} flow is
directed to the file. This property can be useful. The {\bf G4Exception}
normally just stops the program, but it can be treated by a head routine to
avoid unnecessary stops in a big program. In this particular version of the 
{\bf CHIPStest} this line is commented and the {\bf alarm} flag is
used instead.

{\bf \ \ \ \ \ \ \ \ G4int d=curH-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetNFragments();}

// This was a very important value as it helps to navigate the {\bf output }
vector. For the real output hadron it should be zero. It means that this
particle did not decay. If it did (as e.g. $\rho $ meson), then it is still
in the {\bf output} vector, but it is marked by a {\bf d} number different
from zero. One can ignore the hadrons with non zero NFragments values or use
this value to reconstruct the original scheme of fragmentation. But in
the present version this feature is not used. All intermediate hadrons
are suppressed now and should not appear in the output. Nevertheless
it is safer to check this value as in future versions this
possibility can be opened or there can appear a flag, which opens or
closes this option.

{\bf \ \ \ \ \ \ \ \ G4ThreeVector p = lorV.vect();}

// This is another CLHEP class adopted by GEANT4. It is just a 3-vector part
of the 4-vector (a 3-momentum vector or a space vector)

{\bf \ \ \ \ \ \ \ \ G4doublee=lorV.e();}

// This is an example how energy can be extracted from the 4-vector.

{\bf \ \ \ \ \ \ \ \ G4int c=curH-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetPDGCode();}

// Extracts an {\it integer} PDG code of the hadron (remember that it can be
a photon, if PDG=22).

{\bf \ \ \ \ \ \ \ \ \ if(!d\&\&(c==90000002%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
c==90002000%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
c==92000000))}

{\bf \ \ \ \ \ \ \ \ \ \{}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ G4cerr%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''CHIPStest: ***Dibaryon*** PDG=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
c%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
G4endl;}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ alarm=true;}

{\bf \ \ \ \ \ \ \ \ \ \}}

// If the hadron did not decay and it is a dibaryon consisting of identical
baryons, then this is an error in the program.

{\bf \ \ \ \ \ \ \ \ if(!d) npt++;}

// It just filters decayed hadrons and counts final hadrons.

{\bf \ \ \ \ \ \ \ \ if(d) nDec+=d;}

// This counts how many hadrons are products of decay (not clear in case of
cascade decays!)

{\bf \ \ \ \ \ \ \ \ if(c==223) nOmega++;}

{\bf \ \ \ \ \ \ \ \ if(c==22) nPhotons++;}

{\bf \ \ \ \ \ \ \ \ if(c==311%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
c==321%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
c==-311%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
c==-321) nKaons++;}

{\bf \ \ \ \ \ \ \ \ if(c==221) nEta++;}

{\bf \ \ \ \ \ \ \ \ if(c==90002002) nAlphas++;}

{\bf \ \ \ \ \ \ \ \ if(c==2212%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
c--90001000) nProtons++;}

{\bf \ \ \ \ \ \ \ \ if(c==2112%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
c==90000001) nNeutrons++;}

{\bf \ \ \ \ \ \ \ \ if((c==2112%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
c==90000001)\&\&abs(e-1005.)%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
3.) nSpNeut++;}

{\bf \ \ \ \ \ \ \ \ if(!d \&\& c==90002002 \&\& e-m%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
7.) nSpAlph++;}

{\bf \ \ \ \ \ \ \ \ if(c==111) nP0++;}

{\bf \ \ \ \ \ \ \ \ if(c==-211) nPN++;}

{\bf \ \ \ \ \ \ \ \ if(c==211) nPP++;}

{\bf \ \ \ \ \ \ \ \ if(c==22) nGamma++;}

{\bf \ \ \ \ \ \ \ \ if(c==22) EGamma+=e;}

// These are just self explaining counters.

{\bf \ \ \ \ \ \ \ \ if(!d) totCharge-=curH-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetCharge();}

// The total charge is reduced. It should be zero at the end if the
charge is conserved in the event.

{\bf \ \ \ \ \ \ \ \ if(!d) totSum-=lorV;}

// The total 4-momentum is reduced. It should be zero at the end.

{\bf \ \ \ \ \ \}}

// Loop over output hadrons ends here.

{\bf \ \ \ \ \ \ G4double ss=abs(totSum.t())+abs(totSum.x())}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
+abs(totSum.y())+abs(totSum.z());}

// That is what should be zero when the residual 4-momentum is zero.

{\bf \ \ \ \ \ \ //if(totCharge%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
ss%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
0.005)}

{\bf \ \ \ \ \ \ if(totCharge%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
ss%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
0.005%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
alarm)}

{\bf \ \ \ \ \ \ //if(totCharge%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
ss%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
0.005%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
alarm%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
nGamma)}

// There was a big fight to suppress $\gamma $ output as usually it means
that the program does not find further hadronic fragmentation channels... In
some versions, where $\gamma $'s are suppressed this diagnostic print can be
uncommented, so be careful and comment it if the G4Exception stops here.
The same is true for the other diagnostic prints (including the check
of the dibaryon pairs). If you find the error, comment the check, inform
authors, attaching the main {\bf CHIPStest.cc} code and the
{\bf chipstest.in} files, and continue working.

{\bf \ \ \ \ \ \ //if(totCharge%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
ss%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
0.005%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
alarm%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
nSpNeut)}

{\bf \ \ \ \ \ \ //if(totCharge%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
ss%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
0.005%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
alarm%
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
nSpAlph)}

{\bf \ \ \ \ \ \ \{}

{\bf \ \ \ \ \ \ \ \ \ G4cerr%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''***CHIPStest:n=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
ir%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'': \#ofH=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
tNH}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'',s4M=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
totSum%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'',sC=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
totCharge%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
G4endl;}

// In case an error is found, the diagnostics print starts here

{\bf \ \ \ \ \ \ \ \ \ for (int indx=0; indx%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
tNH; indx++)}

{\bf \ \ \ \ \ \ \ \ \ \{}

// A short loop over hadrons starts here. The {\bf int} is used here
instead of {\bf G4int} just to demonstrate that sometimes it is not a bad
idea to use a short notation in simple cases. Here {\bf indx} is always a
small number, so nobody cares about the word length. Another point is that
we use {\bf indx} instead of {\bf ind }as the{\bf \ ind }is still flying in
the air since the previous loop over hadrons. Another choice would be to
write {\bf for(ind=0; ind%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
tNH;ind++)} not declaring the {\bf ind} second time.

\ {\bf \ \ \ \ \ \ \ \ \ \ \ G4QHadron* curH=output-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
operator[](indx);}

// It is in the other {\it name space}, so we can use the same name for the
pointer and following variables.

{\bf \ \ \ \ \ \ \ \ \ \ \ \ G4double m=curH-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetMass();}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ G4LorentzVector lorV=curH-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
Get4Momentum();}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ G4int d=curH-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetNFragments();}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ G4ThreeVector p = lorV.vect();}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ G4double e=lorV.e();}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ G4int c=curH-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetPDGCode();}

// Many other useful parameters can be calculated, e.g. {\bf ap=lorV.rho()}
is an absolute value of the 3-momentum and the {\bf cost=lorV.pz()/ap} is
cos($\theta $). A lot of other functions associated with the G4LorentzVector
class can be found in the manual for the CLHEP library mentioned above.

{\bf \ \ \ \ \ \ \ \ \ \ \ \ G4cerr%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''\#''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
indx%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''(''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
d%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''), PDG=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
c%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'', m/LV=''}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
m%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
lorV%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'',T=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
lorV.e()-m%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
G4endl;}

{\bf \ \ \ \ \ \ \ \ \ \}}

// End of the diagnostics print. Pay attention to the way of
printing of the {\bf lorV}. There is some special method of printing in
this class. CHIPS classes normally have such overloaded methods of printing
either. So you can try to print instances of CHIPS classes (try with simple
classes, as the complicated classes do not have such methods, and it must be
improved in future).

{\bf \ \ \ \ \ \ \ \ G4Exception(''***CHIPStest:ALARM/ch/en/mom is not
conserved'');}

{\bf \ \ \ \ \ \ \}}

// This is the postponed exception which follows the complete diagnostics
print.

{\bf \ \ \ \ \ \ sum0+=nP0;}

{\bf \ \ \ \ \ \ sumP+=nPP;}

{\bf \ \ \ \ \ \ sumN+=nPN;}

{\bf \ \ \ \ \ \ G4int nPions=nP0+nPP+nPN;}

{\bf \ \ \ \ \ \ sumG+=nGamma;}

{\bf \ \ \ \ \ \ sumT+=EGamma;}

{\bf \ \ \ \ \ \ if(nAlphas)sumAL++;}

{\bf \ \ \ \ \ \ if(nProtons)sumPP++;}

{\bf \ \ \ \ \ \ if(nNeutrons)sumNN++;}

{\bf \ \ \ \ \ \ if(nNeutrons\&\&!nProtons\&\&!nAlphas) sum1N++;}

{\bf \ \ \ \ \ \ if(nKaons) sumK++;}

{\bf \ \ \ \ \ \ if(nEta)sumE++;}

{\bf \ \ \ \ \ \ if(nPhotons)nPions=11;}

{\bf \ \ \ \ \ \ if(nKaons==2\&\&npt==2) nPions-1;}

{\bf \ \ \ \ \ \ else if(nKaons) nPions=10;}

{\bf \ \ \ \ \ \ G4std::for\_each(output-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
begin(), output-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
end(), DeleteQHadron());}

{\bf \ \ \ \ \ \ output-> clear();}

// Here the user cleans up the pointers and delete the {\bf G4QHadron}
instances in the {\bf output} vector (the garbage collection
responsibility). This is how it can be done for the STL vectors of pointers.
Any CHIPS {\bf G4QClassVector} has the {\bf DeleteQClass()} member
function, which deletes the instance to which the pointer of the STL
vector indicates.


{\bf \ \ \ \}}

{\bf \ \ \ cerr%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''Relative yields: pi-=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
sumN/fEvt%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'',pi+=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
sumP/fEvt}

{\bf \ \ \ \ \ \ \ \ \ \ 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'',pi0=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
sum0/fEvt%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'',K=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
sumK/fEvt}

{\bf \ \ \ \ \ \ \ \ \ \ 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'',eta=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
sumE/fEvt%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'',gamma=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
sumG/fEvt}

{\bf \ \ \ \ \ \ \ \ \ \ 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''(%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
E%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
sumT/sumG%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''),n=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
sumNN/fEvt}

{\bf \ \ \ \ \ \ \ \ \ \ 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'',p=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
sumPP/fEvt%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'',alpha=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
sumAL/fEvt}

{\bf \ \ \ \ \ \ \ \ \ \ 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'',onlyN=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
sum1N/fEvt%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
endl;}

// The loop over the events ends here. The {\bf cerr} is used just to be
sure that the final printing comes to the screen not to the file. The {\bf %
G4cerr} is not used here as it uses a scientific notation for parameter
printing, which make the output line too long.

{\bf \ \ return EXIT\_SUCCESS;}

\}

// This is a traditional finish of the main in GEANT4 (it closes what should
be closed).

\section{Approximation of photonuclear cross sections.}

\noindent \qquad The approximation of photonuclear cross sections
covers all energies from the threshold of the hadron production to
the formally infinit energy. The total energy region is subdivided in
three main regions: 
the GDR region, the $\Delta$ region, and the Reggeon-Pomeron
region, and two intermediate regions: the ``quasi-deuteron'' region,
which is between the GDR region and the $\Delta$ region, and the
``Ropper'' region, which is between the $\Delta$ region and the
Reggeon-Pomeron region.

        In the GEANT4 photonuclear data base there are about 50 nuclei,
for which the photonuclear absorbtion cross sections have been
measured. Taking into accout that for heavy nuclei at low energies the
cross sections of the photoproduction of neuterons is close to the
photonuclear absorbtion cross section the data base can be easily
enlarged, but at the current release it was reduced to 14
nuclei: $^1$H, $^2$H, $^4$He, $^6$Li, $^7$Li, $^9$Be, $^{12}$C, $^{16}$O,
$^{27}$Al, $^{40}$Ca, Cu, Sn, Pb, U.

        In all regions the $e=log(E)$ scale (where E is an energy of the
incedent photon) was used, to make the future
simulation of the electronuclear reactions easier. So the power law, which is
characteristic to the GDR region and for the Reggeon-Pomeron region,
looks like an exponent. For the $\Delta$ isobar the unusual
logarithmic Breit-Wigner form was used.
        In the GDR region it was found that the GDR can be subdivided in
two contributions. According to the CHIPS approach, which includes the
nonrelativistic phase space of nucleons to explain evaporation, the
GDR maximum should be described by the power law, so for the most
nuclei only two powers $p_1$=4 and $p_2$=8 were used (for $A
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
12$ it is 3 and 6, for $A
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
8$ it is 2 and 4, for $A
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
4$ it is 1 and 2). This power law was cut by
the nuclear-barrier-reflection function, which looks like a threshold.
The threshold function, which is universal for all regions, has a form
\begin{equation}
th(e,b,s)=\frac{1}{1+exp(\frac{b-e}{s})}.
\label{threshold}
\end{equation}
Either of the GDR contributions has the following form: 
$GDR(e,p,b,c,s)=th(e,b,s)\cdot exp(c-p\cdot e)$.
The b, c, and s parameters are A-dependent. The values of $p_1$ and
$p_2$ are already mentioned above. The values $b_1$, $b_2$, $c_1$,
$c_2$, $s_1$, and $s_2$ were found for the listed 14 nuclei and
interpolated for other nuclei.

        The $\Delta$ isobar region was parametrized in a form:
\begin{equation}
\Delta (e,d,f,g,r,q)=\frac{d\cdot th(e,f,g)}{1+r\cdot (e-q)^2}.
\label{Isobar}
\end{equation}
Here the parameter q can be interpreted as a position of the $\Delta$
isobar and the r parameter can be interpreted as the reversed
width. The A-dependence of these parameters (where $a=log(A)$) are

\begin{itemize}
\item  $d=0.41\cdot A$ (for $^1$H it is 0.55, for $^2$H it is 0.88),
which means that the $\Delta$ yield is proportional
to A; 

\item  $f=5.13-.00075\cdot A$; $g=.09$ ($g=.04$ for $A
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
7$), where the value of
$exp(f)$ shows how the pion threshold depends on A. It is clear that
the threshold becomes 140 MeV only for uranium; for the rest of the nuclei
it is higher. It can be explained by the $\Delta+N\rightarrow N+N$ reaction,
which can take place in nuclear medium below the pion threshold. 

\item  $q=5.84-\frac{.09}{1+.003\cdot A^2}$, which means that the
``mass'' of the $\Delta$ isobar moves to lower energies; the reason
can be the same as for the pion threshold.

\item $r=11.9-a\cdot 1.24$ (for $^1$H it is 18.), that is, the reversed width becoming
smaller with A, which means that the width increases; the reason can
be the same.
\end{itemize}


The transition ``Ropper'' (r postfix) and the ``quasi-deuteron''
(d postfix) contributions were approximated, using the same form
of parametrization (similar to the $\Delta$ contribution, but
without the pion threshold factor):
\begin{equation}
Tr(e,v,w,u)=\frac {v}{1+w\cdot (e-u)^2}.
\label{Transition}
\end{equation}

It should be noted, that for $^1$H and $^2$H instead of the
``quasi-deuteron'' contribution, which is almost zero for these
nuclei the third barionic resonance was used, so the parameters for
these two nuclei are quite different, but trivial and do not have
any A-dependence.
 
The values of parameters are ($a=log(A)$):
\begin{itemize}
\item  $v_{d}=\frac {exp(-1.7+a\cdot 0.84)}{1+exp(7\cdot (2.38-a))}$,
which shows that the A-dependence of the
``quasi-deuteron'' region is stronger than $A^{0.84}$. The
denominator is necessary to emphasize that this contribution disappears
for light nuclei
(in fact it takes place somewhere between $^6$Li and $^7$Li). For $^1$H
it is .078 and for $^2$H it is .08, so the high delta
contribution does not look really growing; its relative contribution
disappears with A.

\item  $u_{d}=3.7$; $w_d=0.4$, the experimental information is not
enough to vary these parameters for the position and for the width
of the ``quasi-deuteron'' contribution. For $^1$H and for
 $^2$H they are 6.93 and 90, which possibly indicates on the $Delta$(1600)
and $\Delta$(1620) contributions.


\item  $v_{r}=exp(-2.+a\cdot 0.84)$, the A-dependence for both transition regions
appeared to be the same ($A^{0.84}$). For $^1$H it is 0.22 and
for $^2$H it is 0.34.

\item $u_{r}=6.46+a\cdot 0.061$ (for $^1$H and for $^2$H it is 6.57),
so the ``mass'' of the ``Ropper'' starts with the 1440 MeV value and
moves to the greater value with A.

\item $w_{r}=0.1+a\cdot 1.65$ (for $^1$H it is 20. and for $^2$H it is 15.).
\end{itemize}


In fact, what is called the transition ``Ropper'' contribution, can
not be identified with real resonance, as this is really the formal
transition contribution. It becomes clear from the Regge-Pomeron
contribution. It was parametrized in the following form:
\begin{equation}
RP(e,h)=h\cdot th(7.,0.2)\cdot (0.0116\cdot exp(e\cdot 0.16)+0.4\cdot exp(-e\cdot 0.2)),
\label{Regge}
\end{equation}
where $h=A\cdot exp(-a\cdot (0.885+0.0048\cdot a))$.

The result of the approximation is shown in Fig.~\ref{photonuc} for the 6 of the
14 nuclei.
\begin{figure}
  \resizebox{1.00\textwidth}{!}
{
   \includegraphics{photonuclear.eps}
}
\caption{Photoabsorbtion cross sections for 6 basic nuclei.}
\label{photonuc}
\end{figure}


\section{Approximation of the electronuclear cross sections.}

\noindent \qquad The approximation of the electronuclear cross
sections is based on the method of equivalent photons. Qualitatively an
electron can be considered as a flux of equivalent photons, which
interacts with nuclei according to the photonuclear cross section. The letter
condition restrict the $Q^2$ of the equivalent photons. The basic idea
of the method was stated by E. Fermi and developed by C. F. von
Weizsacker and E. J. Williams in 1934. In this chapter we use the
formula from \cite{chpd.eqPhotons}, which is
\begin{equation}
dn(y)=-\frac {2\alpha}{\pi}\cdot log(y) dlog(y),
\label{eqPh}
\end{equation}
where $y=\frac {\nu}{E}$, E is the energy of the electron and $\nu$ is
the energy of the equivalent photon. For the similation purposes
this function should be multiplied by the photonuclear cross section
and integrated:
\begin{equation}
\sigma_{eA}=log(E)\cdot \int \sigma_{\gamma A}(\nu )dlog(\nu ) -
\int log(\nu )\cdot \sigma_{\gamma A}(\nu )dlog(\nu ),
\label{electroNuc}
\end{equation}
the integration for each particular $E$ is done from the threshold
energy , where the $\sigma_{\gamma A}(\nu)$
becomes not zero, till the electron energy $E$, where the equivalent
photon spectrum drops to zero.
So these integrals should be parametrized as a function of the upper
limit. We call the first integral $I_1(E)$ and the second
$I_2(E)$. These two functions were prepared for all 14 nuclei, which
were discussed in the previous chapter, and for the intermediate
nuclei they are interpolated.
        After the cross section is calculated the values of
$log(E)\cdot I_1(E)-I_2(E)$ is known and can be used for the
randomization of the equivalent photon energy $\nu$. If $r$ is the
random number than the equation 
\begin{equation}
log(\nu)\cdot I_1(\nu)-I_2(\nu)=r\cdot (log(E)\cdot I_1(E)-I_2(E))
\label{EqPhEq}
\end{equation}
should be solved

Up to 2 GeV the $I_i$ functions were tabulated, but beyond 2 GeV they
are functional. Unfortunately it was not possible to use the same
Reggeon-Pomeron function, which was defined in the previous chapter
(Eq.\ref{Regge}), as the contribution of the resonances is still high
at 2 GeV, to make the photonuclear crossection smooth at 2 GeV the
Reggeon part of Eq.\ref{Regge} was changed and the Pomeron part was
left the same:
\begin{equation}
RP(e,h)=h\cdot (0.0116\cdot exp(e\cdot 0.16)+1.*exp(-e\cdot 0.26)),
\label{newRegge}
\end{equation}
This function starts from 2 GeV, so it does not need the threshold
part. The multiplication by unit is not a mistake as
it is 0.75 for $^1$H, 0.78 for $^1$H, and .9 for other nuclei
lighter than oxigen. So the $I_i$ in the functional part can be
analitically integrated and then the Eq. \ref{EqPhEq} can be solved by
the Newton's method. Fortunately the equation is quite linear.

That is how the primary electron is split in the model in the secondary electron
and the equivalent photon under the condition of the following
photonuclear interaction of the equivalent photon.

It must be mentioned that there are different definitions for the
equivalent photons. At high energies it sometimes expands to the
virtual photons with high $Q^2$. An advantage is that
the hard processes appear in the model, but the disadvantage of this
approach is that in this case the $\sigma_{\gamma^*A}$ is not
known. The only guess is that
$\sigma_{\gamma^*A}=\sigma_{\gamma A}(W^2)$,
 where $W^2 = M^2+2\cdot \nu \cdot M - Q^2$ instead of the
$s=M^2+2\cdot E_\gamma \cdot M$ in the photonuclear reaction. But it
is known that even shadowing effect is different for the real and
virtual photonuclear reactions \cite{Shadowing}.

Nevertheless, having in mind the possible future development and
to compare the different approaches, we consider the formula for the
hard processes, whic according to \cite{Guilo} is
\begin{equation}
dn(y)=\frac{\alpha}{2\pi}\left[
(2-2y+y^2)log)\left( \frac{Q^2_{max}}{Q^2_{min}} \right) -
2(1-y)\left( 1-\frac{Q^2_{max}}{Q^2_{min}} \right)
\right]\cdot log(y)
\label{EqPhHigh}
\end{equation}
was considered.
At high energies the second term can be neglected in comparison to the
first term. The $Q^2_{min}=\frac{m^2y^2}{1-y}$, where $m$ is a mass of
the electron, and the $Q^2_{max}$. In the case of almost real equivalent
photons it should be of the order of $m^2$, and then in the small $y$ region
one gets just Eq.\ref{eqPh}. The more accurate formula in the low $y$
region is
\begin{equation}
dn(y)=\frac{2\alpha}{\pi}(1-y)\left[ log(y)+C \right] \cdot log(y),
\label{EqPhNew}
\end{equation}
where C is a constant defined by the $Q^2_{max}$ and the second
term. When $y$ becomes close to unit the additional $(1-y)$ term
reduces the probability for the hard photons and the C-term increases
it, so there is a kind of a compensation. On the basis of this
estimate we kept the equivalent photon distribution in the simple form
of the Eq. \ref{eqPh}, which is good enough for the simulation in
matter. Only extensive measurements of the electronuclear hadron
production cross section can force us to improve the simple approach because

\begin{itemize}
\item  The Eq.\ref{eqPh} covariant, that is independent on the energy
of the electron. The equivalent photon method gives a kind
of a ``photonic structure function'' of the electron, so the $y$
variable is similar to the $x$ variable in the structure functions of
hadrons. In case of the Eq.\ref{eqPh} the intergal of the number of
equivalent photons fom $y$ to 1 diverges as $log^2(y)$, which is elegant
and simple. If $C$ in the Eq.\ref{EqPhNew} is energy independent and is
just a constant or a function of only $y$, it can be covariant either,
but nobody proposed such formula.

\item  Even if the part of photons with high $Q^2$ is added and the
equivalent photon flux increases at large $y$, even then, according
to \cite{Electronuc}, the cross section of the virtual photons melts
resonances and become smaller in respect to the $Q^2=0$ cross
sections, so this additional part becomes less important.

\item  The Eq.\ref{EqPhNew} is created, tested and used only for the
high energies and it is not clear how good it is at low energies,
which are important for the electromagnetic shower simulation in matter.
\end{itemize}



\section{GEANT4 interface joining the String model and the CHIPS.}

\noindent \qquad The basic assumption of this joining is the energy
loss of the high energy hadron in nuclear matter (about 1 GeV/fm)

\section{Conclusion.}

\noindent \qquad This Manual for the release of CHIPS in GEANT4 is
made not only for the blind im matter simulation of the hadronic
processes, but for those users, who would like to improve the
interaction part of the CHIPS event generator for their own
specific reactions. For these users some advice concerning the
data presentation can be useful.

This is a good idea to use a normalized invariant function $\rho (k)$%
\[
\rho =\frac{2E\cdot d^{3}\sigma }{\sigma _{tot}\cdot d^{3}p}\propto \frac{%
d\sigma }{\sigma _{tot}\cdot pdE}, 
\]
where $\sigma _{tot}$\ is a total cross section of the reaction. So the
simple rule is to divide the distribution over the hadron energy (E) by the
momentum and by the reaction cross section. The argument $k$ can be
calculated for any outgoing hadron or fragment as 
\[
k=\frac{E+p-B\cdot m_{N}}{2}, 
\]
which has a meaning of the energy of the primary quark-parton. As the
spectrum of the quark partons is universal for all the secondary hadrons or
fragments, the distributions over this parameter have similar shape for all
the secondaries. They should differ only approaching the kinematic limits or
in the evaporation region. This feature is useful for any analysis of
experimental data independently of the CHIPS model.

The released version of the CHIPS event generator is not perfect yet, so in case
of an error it is necessary to distinguish between the error of the test
program ({\bf CHIPStest.cc}) and the error in the body of the generator.
Usually the error printing contains the address of the routine, but sometimes
the name is abbreviated so that instead of the {\bf G4QEnvironment }one can
find {\bf G4QE}, instead of the {\bf G4Quasmon} the {\bf G4Q} is used, or
instead of the {\bf G4QNucleus} only the {\bf G4QN} appears. The errors in
the {\bf CHIPStest.cc} can be easily analyzed. Even if sometimes energy or
charge is not conserved, just exclude this check and keep going. On the
other hand, if the error is in the body it is difficult to fix. The normal
procedure is to uncomment the flags of the debugging prints in the
corresponding part of the source code and try to find out the reason. Anyway
inform authors about the error. Do not forget to attach the
{\bf CHIPStest.cc} and the {\bf chipstest.in} files.

The concluding remarks should be made about the parameters of the model. The main
parameter (the critical temperature T$_{c}$) should not be varied. A big set
of data confirms {\bf 180 MeV} while from the mass spectrum of hadrons
it can be found more precisely as 182 MeV. The clusterization
parameter is {\bf 4.} which is just about 4$\pi /3.$
If the quark exchange starts at the mean distance between baryons in the
dense part of the nucleus, then the radius of the clusterization sphere is
twice bigger than ''the radius of the space, occupied by the baryon''.
It gives 8 for the parameter, but the space, occupied by the baryon can not
be spheric; only cubic subdivision of space is possible so the factor $\pi
/6 $ appears. But this is a rough estimate, so {\bf 4} or even {\bf 5} can be
tried. The surface parameter fD is slightly varying with A growing
from 0 to 0.04. For the present CHIPS version the recomended
parameters for low energies are

\begin{tabular}{llllllllll}
{\bf A} & {\bf T} & {\bf s/u} & {\bf eta} & {\bf noP} & {\bf fN} & {\bf fD}
& {\bf Cp} & {\bf rM} & {\bf sA} \\ 
{\bf Li} & 180. & 0.1 & 0.3 & 223 & .4 & .00 & 4. & 1.0 & 0.4 \\ 
{\bf Be} & 180. & 0.1 & 0.3 & 223 & .4 & .00 & 4. & 1.0 & 0.4 \\ 
{\bf  C} & 180. & 0.1 & 0.3 & 223 & .4 & .00 & 4. & 1.0 & 0.4 \\ 
{\bf  O} & 180. & 0.1 & 0.3 & 223 & .4 & .02 & 4. & 1.0 & 0.4 \\ 
{\bf  F} & 180. & 0.1 & 0.3 & 223 & .4 & .03 & 4. & 1.0 & 0.4 \\ 
{\bf Al} & 180. & 0.1 & 0.3 & 223 & .4 & .04 & 4. & 1.0 & 0.4 \\ 
{\bf Ca} & 180. & 0.1 & 0.3 & 223 & .4 & .04 & 4. & 1.0 & 0.4 \\ 
{\bf Cu} & 180. & 0.1 & 0.3 & 223 & .4 & .04 & 4. & 1.0 & 0.4 \\ 
{\bf Ta} & 180. & 0.1 & 0.3 & 223 & .4 & .04 & 4. & 1.0 & 0.4 \\ 
{\bf  U} & 180. & 0.1 & 0.3 & 223 & .4 & .04 & 4. & 1.0 & 0.4
\end{tabular}

The parameter of the vacuum hadronization weight can be bigger for the light
nuclei and smaller for the heavy nuclei, but 1. is a good guess. The s/u
parameter is not yet tuned, as it demands the strange particles production
data. A guess is that if a lot of $u\bar{u}$ and $d\bar{d}$ pairs come in
the reaction as in the $p\bar{p}$ interaction the parameter can be 0.1, in
other cases it is closer to 0.3 as in other event generators. But the best
idea is just do not touch any parameters for the first experience with the
CHIPS event generator. Just change the incident momentum, the PDG code of
the projectile, and the CHIPS stile PDG code of the target.

\section{Appendix A. Public member functions of CHIPS.}

\noindent \qquad A lot of private encapsulated member functions are used in
classes of CHIPS. It is not necessary to know about these member functions
even for users which would like to develop some parts of the CHIPS event
generator or to add additional classes. The only public member functions of
the CHIPS event generator are listed and briefly commented. The total length
of the {\it .cc} files of the model is about 12400 lines and it includes
about 270 constructors, public functions and operators. Each line of this
code is a hidden, encapsulated parameter, so it is not strange, that it fits
so extended sample of data (sorry, this is a joke).

\subsection{G4QEnvironment (about 4100 lines)}

// === {\it Constructors} ===

{\bf G4QEnvironment(const G4QHadronVector\& projHadrons,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf const G4int
targPDG);}

// This is a constructor used and explained in the {\bf CHIPStest} program.

{\bf G4QEnvironment (const G4QEnvironment\& right);}

// This is a copy-constructor (for the original in the C++ stack).

{\bf \thinspace G4QEnvironment (G4QEnvironment* right);}

// This is a copy-constructor (for the original in the C++ heap).

// === {\it Overloaded operators} ===

{\bf const \thinspace G4QEnvironment\& operator=(const G4QEnvironment\&
right);}

// This is a copy operator similar to the copy-constructors above.

{\bf int operator==(const G4QEnvironment \&right) const;}

// This operator returns true if the body values of two {\bf G4QEnvironment}
objects are the same.

{\bf int operator!=(const G4QEnvironment \&right) const;}

// This operator returns true if the body values of two {\bf G4QEnvironment}
objects are the same.

\thinspace \thinspace

// === {\it Static functions} ===

{\bf static void SetParameters(G4double solAn, G4bool efFlag=false, G4double}

{\bf \ \ \ \ \ \ \ \ \ \ piThresh=141.4, G4double mpisq=20000.,G4double
dinum=1880.);}

// Definition of the internal parameters which were partially used and
explained in the {\bf CHIPStest} program. The solAn parameter defines the
limits of the solid angle in which the secondary hadrons are absorbed by the
nucleus after the primary peripheral interaction (annihilatio) with on
nucleon \ relatively far from the surface of the nucleus. The limits are in
terms of cos($\theta $), so this parameter can be varied from -1 to 1. The 
{\bf piThresh, mpisq, dinum} parameters defines up to which CM energy ({\bf E%
}$_{thresh}$) the model must use the photon-captured-by-quark mechanism (%
{\bf E}$_{thresh}$={\bf piThresh+(mpisq+projM2)*dinum, }where{\bf \ projM2 }%
is a squared mass of the projectile $\gamma $; it is 0 in case of real
photon and -Q$^{2}$ \ in case of virtual photon). The default values of
these parameters are shown.

// === {\it Selectors} ===

{\bf G4QNucleus GetEnvironment() const;}

// Select the {\bf G4QNucleus }environment of this {\bf G4QEnvironment}
instance (if it is vacuum, then PDG code of the {\bf G4QNucleus} is
90000000).

{\bf G4QuasmonVector* GetQuasmons();}

// Select a vector of quasmons for this {\bf G4QEnvironment} instance.

\thinspace

// === {\it Modifiers} ===

{\bf G4QHadronVector* Fragment();}

// The main action member function, which was used and explained in the {\bf %
CHIPStest} program.

// === {\it General functions} ===

{\bf G4ThreeVector RndmDir();}

// This is a general purpose function, which can be interesting for the
users independent of the G4QEnvironment class itself. It returns the random
direction in the 3D space. Hopefully such function already exists in the
standard libraries, so in future it will be substituted by the standard one
and probably excluded from the G4QEnvironment class. This is true for the 
{\it general functions} of all classes of the CHIPS event generator and is
said only once, here. Hopefully tere is a gfeneral function for this in GEANT4.

\subsection{G4Quasmon (about 4400 lines)}

// === {\it Constructors} ===

{\bf G4Quasmon(G4QContent qQContent=G4QContent(0,0,0,0,0,0),}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ G4LorentzVector
q4M=G4LorentzVector(0.,0.,0.,0.),}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ G4LorentzVector
ph4M=G4LorentzVector(0.,0.,0.,0.));}

// The main constructor, including default-constructor, which is just
vacuum. The very minimum for the {\bf G4Quasmon} object \ is quark content,
the total CM energy can be zero, as all quarks in the model (including
s-quark and diquarks) are massless quark-partons. If the total CM energy is
not zero, then energy dissipation can be possible. The third parameter gives
the 4-momentum of the photon, which can be used in the internal quark
exchange hadronization act.

{\bf \thinspace G4Quasmon(const G4Quasmon\& right);}

// This is a copy-constructor (for the original in the C++ stack).

{\bf \thinspace G4Quasmon(G4Quasmon* right);}

// This is a copy-constructor (for the original in the C++ heap).

// === {\it Overloaded operators} ===

{\bf const \thinspace G4Quasmon\& operator=(const G4Quasmon\& right);}

// This is a copy operator similar to the copy-constructors above.

{\bf int operator==(const G4Quasmon \&right) const;}

// This operator returns true if the body values of two {\bf G4Quasmon}
objects are the same.

{\bf int operator!=(const G4Quasmon \&right) const;}

// This operator returns true if the body values of two {\bf G4Quasmon}
objects are the same.

\thinspace \thinspace

// === {\it Static functions} ===

{\bf static void SetParameters(G4double temperature, G4bool ssin2g,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ {\bf G4double etaetap);}

// Definition of the internal parameters which were used and explained in
the {\bf CHIPStes} program.

{\bf static void SetTemper(G4double temperature);}

{\bf static void SetSOverU(G4bool ssin2g);}

{\bf static void SetEtaSup(G4double etaetap);}

// The parameters can be set separately.

// === {\it Selectors} ===

{\bf G4Qdouble GetTemper() const;}

{\bf G4Qdouble GetSOverU() const;}

{\bf G4Qdouble GetEtaSup() const;}

// Extraction of the current parameters of the {\bf G4Quasmon} instance.
This change of parameters is used in the model e.g. in the case of
antiproton annihilation on nucleus at rest. In this case the first interaction has
parameters of the proton-antiproton annihilation, which were separately tuned and
the second interaction has the parameters, defined by CHIPStest for the antiproton
annihilation on nuclei.

{\bf G4LorentzVector Get4Momentum() const;}

// Returns the 4-momentum of this {\bf G4Quasmon} instance.

{\bf G4QContent GetQC() const;}

// Returns the quark content of this {\bf G4Quasmon} instance.

{\bf G4QPDGCode GetQPDG() const;}

// Returns the {\bf G4QPDGCode} instance for this {\bf G4Quasmon} instance.

{\bf G4int GetStatus() const;}

// Returns the status of this {\bf G4Quasmon} instance.

\begin{itemize}
\item  status=-1 means PANIC, the quasmon can not make fragments in this
environment;

\item  status=0 means that the quasmon is empty, it is done, it is
equivalent to vacuum now, it is already history;

\item  status=1 means that the quasmon successfully fragmented;

\item  status=2 means that nothing was done with the quasmon by chance;

\item  status=3 means that the quasmon tried to fragment but did not succeed
by some good reason (such as Coulomb barrier...);

\item  status=4 means that this quasmon was just created and never fragmented.
\end{itemize}

\thinspace

// === {\it Modifiers} ===

{\bf G4QHadronVector* Fragment(G4QNucleus\& nucEnviron, G4int nQ);}

// The main action member function of the {\bf G4Quasmon} class. It adopts
the nuclear environment from the {\bf G4QEnvironment} class (and can return it
in the modified by the hadronization form) uses a total number of alive
quasmons in the environment ({\bf status}$\neq ${\bf 0}). This value is
important, as the algorithm of the quasmon fragmentation is much
easier, if the quasmon does not have any competitors around and can
get the responsibility for the termination of the hadronization process.

{\bf void ClearOutput();}

// The G4Quasmon object as a predecessor of the G4QEnvironment object has
the {\bf G4QHadronVector output }very similar to the {\bf G4QHadronVector
output} of the {\bf G4QEnvironment} class, which was discussed in the
example. But as the fragmentations of all quasmons in the environment are
made in parallel, it is possible for one quasmon to fragment a few times. So
the output should be CLEANED, but it should not be destroyed as its
instances of G4QHadrons can be used in the {\bf G4QHadronVector output} of
the {\bf G4QHadronVector output}\ instance.

{\bf void InitQuasmon(G4QContent qQContent, G4LorentzVector q4M);}

// If Quasmon came into real trouble and declared PANIC, it is not necessary
to kill it and then recreate it, it will do to reinitialize the quasmon.

{\bf void IncreaseBy(const G4Quasmon* pQuasm);}

// Sometimes it is necessary to merge quasmons. In future this member
function should be transformed to the overloaded {\bf operator+=}.

{\bf void KillQuasmon();}

// Kill does not mean destruct. The dead quasmon is just a vacuum quasmon (%
{\bf status=0}), which is kept in history.

\subsection{G4QNucleus : public G4QHadron (about 2900 lines)}

// === {\it Constructors} ===

{\bf G4QNucleus();}

// A default constructor, which defines the nucleus as vacuum.

{\bf G4QNucleus(G4int nucPDG);}

// A constructor, which defines the nucleus at rest, using its PDG code.

{\bf G4QNucleus(G4int nucPDG, G4LorentzVector p);}

// Similar to the previous one, but here the nucleus can move.

{\bf G4QNucleus(G4int z, G4int n, G4int s);}

// A constructor, which defines the nucleus at rest, using a number of
protons {\bf p}, a number of neutrons {\bf n}, and a number of ${\bf \Lambda 
}$\ in it.

{\bf G4QNucleus(G4int z, G4int n, G4int s, G4LorentzVector p);}

// Similar to the previous one, but here the nucleus can move.

{\bf \thinspace G4QNucleus(const G4QNucleus\& right);}

// This is a copy-constructor (for the original in the C++ stack).

{\bf \thinspace G4QNucleus(G4QNucleus* right);}

// This is a copy-constructor (for the original in the C++ heap).

// === {\it Overloaded operators} ===

{\bf const \thinspace G4QNucleus\& operator=(const G4QNucleus\& right);}

// This is a copy operator similar to the copy-constructors above.

{\bf int operator==(const G4QNucleus \&right) const;}

// This operator returns true if the body values of two {\bf G4QNucleus}
objects are the same.

{\bf int operator!=(const G4QNucleus \&right) const;}

// This operator returns true if the body values of two {\bf G4QNucleus}
objects are the same.

{\bf G4QNucleus operator+=(const G4QNucleus\& rhs);}

{\bf G4QNucleus operator-=(const G4QNucleus\& rhs);}

// Helps to add or subtract nuclear cluster from this nucleus.

{\bf G4QNucleus operator*=(const G4int\& rhs);}

// Multiply nucleus by some value. This overloaded function is made just for
generalization.

{\bf ostream\& operator%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
(ostream\& lhs, G4QNucleus\&rhs);}

{\bf ostream\& operator%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
(ostream\& lhs, const G4QNucleus\&rhs);}

//These overload functions help to print the nucleus as an instance.

\thinspace \thinspace

// === {\it Static functions} ===

{\bf static void SetParameters(G4double fN, G4bool fD, G4double cP,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ {\bf G4double mR=1.);}

// Definition of the internal parameters which were used and explained in
the {\bf CHIPStes} program.

\thinspace

// === {\it Selectors} ===

{\bf G4int GetPDG() const;}

// Get the PDG code of the nucleus. In future it can be extracted and the
inherited {\bf G4QHadron::GetPDGCode()} function can be used.

{\bf G4int GetZ() const;}

{\bf G4int GetN() const;}

{\bf G4int GetS() const;}

// Return numbers of protons, neutrons, and $\Lambda $\ correspondingly.

{\bf G4int GetA() const;}

// Returns atomic weight (a baryon number) of the nucleus (A=Z+N+S).

{\bf G4int GetDZ() const;}

{\bf G4int GetDN() const;}

{\bf G4int GetDS() const;}

{\bf G4int GetDA() const;}

// Return numbers of protons, neutrons, $\Lambda $\ and atomic weight of the
dense region of the nucleus correspondingly.

{\bf G4int GetMaxClust() const;}

// Returns the maximum baryon number for clusters existing in this
particular instance of {\bf G4QNucleus} class.

{\bf G4double GetProbability(G4int bn=0) const;}

// Returns a probability to find the cluster with given baryon number. There
is internal array of \ 256 values in the body of this class, where the
calculated probabilities of clusterization are stored. In case of default 
{\bf bn=0}, returns a bias factor for the vacuum (quark fusion) mechanism of
hadronization (which is normally 1.).

{\bf G4double GetMZNS() const;}

// If the G4QNucleus was not initialized by PDG code, but by z, n, and s,
then sometimes the inherited method {\bf G4QHadron::GetMass()} can fail. In
this case this method, which calculate the ground state mass, using the z,
n, and s, can be useful. And it is a bit faster.

{\bf G4double GetGSMass() const;}

// This is another historical method of extraction of nuclear (not hadronic)
mass. This is almost a synonym of the previous one. The last two member
functions can disappear in future, and only the inherited 
{\bf G4QHadron::GetMass()}\ function can be the only method.

{\bf G4QContent GetQCZNS() const;}

// In the case of hadron-nucleus instance this function is much faster then the
general member inhertited from the {\bf G4QHadron::GetQC()} class.

\thinspace

// === {\it Modifiers} ===

{\bf G4bool EvaporateBaryon(G4QHadron* h1, G4QHadron* h2);}

// This is a member function for any nucleus even for stable nuclei. The
evaporation modeling described in \cite{CHIPS2} is all in this member
function. It is not considered as an essential part of the CHIPS morel, as
it is a hadron level model, not quark level model. It is much simpler. But
there is a lot of common features, as in the case of evaporation one
still can use well integrable nonrelativistic model of heavy nucleons. So if
the CHIPS model deals with massless quark-partons, which means, that this is
an ultra relativistic model, then EVA (this is a provisional name, which is
used for the evaporation model) deals with baryons (and nuclear clusters),
the mass of which is much bigger than the typical kinetic energy of one
participant. That is why it can be called as not relativistic model. So if
CHIPS inherits properties of LIPS (Lorenz Invariant Phase Space), then EVA
inherits properties of GIPS (Galilean Invariant Phase Space). The EVA can be
used absolutely independently of CHIPS by users who would like to evaporate
nuclei and use the CHIPS generator only as a library of classes. So it is
necessary to create an instance of the {\bf G4QNucleus} class (say {\bf N}),
then create two instances of G4QHadron class (h1 and h2), and make a call
for the function: {\bf if(!N.EvaporateBarion(h1,h2)) \{cout%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''Did not succeeded''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
endl;\}}. So this function returns boolean{\it \ true}, if evaporation
succeeded. If it did then one hadron contains the evaporated Baryon (nuclear
fragment) and the other contains the residual nucleus (which in case of
light nuclei can be a hadron or a small nuclear fragment either). At present
the EVA member function can evaporate not only baryons, but alpha particles
too. It was necessary at low excitation energies. May be in future other
fragments can appear in the output. To find more details about the call of
the function and the treatment of the secondary hadrons one should look in the 
current {\bf G4QEnvironment.cc} file.

{\bf G4bool SplitBaryon();}

// To avoid the situation, when the nucleus is above the ground state, but
below a threshold of radiation of any nuclear fragment, this function is
written. It checks if it is possible to radiate a baryon or an $\alpha $. If
it is, then it returns boolean. So this function is a selector, not
modifier. It appeared after the EVA member function just to support the
logic of explanation.

{\bf void InitByPDG(G4init newPDG);}

{\bf void InitByQC(G4QContent newQC);}

// These two member functions help to reinitialize already existing nucleus
rather than destruct it and then recreate (In future can be one overloaded
function {\bf Reinitialize}).

{\bf void IncProbability(G4int bn);}

// Increment a probability for the cluster with baryon number {\bf bn} (a
mean number of such clusters in the nucleus) by 1.

{\bf void Increase(G4int PDG,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf G4LorentzVector
LV=G4LorentzVector(0.,0.,0.,0.));}

{\bf void Increase(G4QContent QC,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf G4LorentzVector
LV=G4LorentzVector(0.,0.,0.,0.));}

// An overloaded function which increases this nucleus by a hadron.

{\bf void Reduce(G4int PDG);}

// Opposite to previous action. The residual nucleus is in the ground state.
In future it will be overloaded for G4QContent.

{\bf void CalculateMass();}

// It is always difficult to say what is the mass of the nucleus. If it is
excited, then its mass is different from the ground state mass. That is why
there are so many complications with the mass of nucleus. If the Nucleus is
defined only by PDG code (or quark content), then the CalculateMass() member
function can create a Lorentz vector of the nucleus at rest with the ground
state mass. It may be a good idea to include this action automatically
as a default, but it would make the creation of fake nuclei to be a long
process, while it is necessary to use it only as a pointer to some trivial
member function. So at present this function is separated and users should
use it manually.

{\bf void SetMaxClust(G4int clBN);}

// If this is a heavy nucleus, then the clusters up to A=dA can be calculate
(which may be good for the fission process!), but now the baryon number
of clusters is restricted by a baryon number of highest fragment in the {\bf %
G4QCHIPSWorld}. So the process of calculation of cluster probabilities can
need some special restriction. This is what this member function is doing.

{\bf G4int UpdateClusters(G4bool din);}

// Calculate probabilities for clusters in this nucleus. Returns the largest
baryon number of cluster. The {\bf din} flag is normally {\it false}, but in
case of search for a cluster, which is necessary e.g. for pion capture, this
flag, if it is {\it true}, suppresses the cases, when the state of nucleus
is randomized in such a way that there is no clusters in the nucleus and
interaction can not happen.

{\bf void PrepareCandidates(G4QCandidateVector\& theQCandidates);}

// Using the {\bf G4QCandidateVector} this member function calculates
pre-probabilities for nuclear clusters, which usually means the probability
to find the particular nuclear cluster in this nuclear matter.

// === {\it General functions} ===

{\bf G4int RandomizeBinom(G4double p, G4int N);}

// Returns {\bf n} randomized according to the binomial law with probability 
{\bf p} for total number of {\bf N} particles.

{\bf G4double CoulombBarr(const G4double\& cZ, const G4double\& cA,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
{\bf G4double dZ=0., G4double dA=0.);}

// Calculates binding of the cluster with the charge {\bf cZ} and the baryon
number {\bf cA}. The conditional {\bf dZ} and {\bf dA} parameters have the
same meaning as in the following member function.

{\bf G4double CoulombBarr(const G4double\& cZ, const G4double\& cA,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
{\bf G4double dZ=0., G4double dA=0.);}

// Calculates a height of the coulomb barrier for this nucleus and a cluster
with the charge {\bf cZ} and the baryon number {\bf cA}. If before this (%
{\bf cZ},{\bf cA}) cluster the other cluster with {\bf dZ} (charge) and {\bf %
dA} (baryon number) was conditionally radiated from this nucleus then the 
{\bf dZ }and {\bf dA} values should be given as the input parameters. In
this case the coulomb barrier can be smaller.

{\bf G4double CoulBarPenProb(const G4double\& CB, const G4double\& E,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \ \ \ \ {\bf const G4int\& cZ, const G4int\& cA);}

// Calculate a probability for the over-barrier penetration for the
particular height of the Coulomb Barrier {\bf CB}, kinetic energy of the
cluster {\bf E}, and baryon number of the cluster {\bf B}. The penetration
probability is calculated according to \cite{PenCB}. It should be noted,
that the probability is reduced even for neutrons, which does not have any
Coulomb Barrier.

\subsection{G4QHadron (about 500 lines)}

// === {\it Constructors} ===

{\bf G4QHadron();}

// A default constructor.

{\bf G4QHadron(G4LorentzVector p);}

// Only kinematical constructor, which can be used if only the DecayIn...
member functions are necessary.

{\bf G4QHadron(G4int PDGcode,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf G4LorentzVector
p=G4LorentzVector(0.,0.,0.,0.));}

// These overloaded constructor creates a hadron with parameters from the 
{\bf G4QCHIPSWorld} data base. Pay attention that in the similar {\bf %
G4QNucleus} constructor the input arguments are reversed to alert the user.

{\bf G4QHadron(G4QContent QC,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf G4LorentzVector
p=G4LorentzVector(0.,0.,0.,0.));}

{\bf G4QHadron(G4QPDGCode QPDG,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf G4LorentzVector
p=G4LorentzVector(0.,0.,0.,0.));}

// These are similar overloaded constructors.

{\bf G4QHadron(G4int PDGCode, G4double m, G4QContent QC);}

{\bf G4QHadron(G4QPDGCode QPDG, G4double m, G4QContent QC);}

// These overloaded constructors can be used to create a hadron for a
general {\it quasmon} or a {\it chipolino (at rest)}.

{\bf G4QHadron(G4int PDGCode, G4LorentzVector p, G4QContent QC);}

{\bf G4QHadron(G4QPDGCode QPDG, G4LorentzVector p, G4QContent QC);}

// The same for the moving hadron-quasmon (hadron-chipolino).

{\bf G4QHadron(G4QParticle* pPart, G4double maxM);}

// This constructor is used for a construction of a resonance with
distributed mass (the {\bf pPart} is a pointer to the resonance in the {\bf %
G4QCHIPSWorld} data base). The mass value is randomized at the construction
time and limited from above by the {\bf maxM }value.

{\bf G4QHadron(const G4QHadron\& right);}

// This is a copy-constructor (for the original in the C++ stack).

{\bf \thinspace G4QHadron(G4QHadron* right);}

// This is a copy-constructor (for the original in the C++ heap).

// === {\it Overloaded operators} ===

{\bf const \thinspace G4QHadron\& operator=(const G4QHadron\& right);}

// This is a copy operator similar to the copy-constructors above.

{\bf int operator==(const G4QHadron \&right) const;}

// This operator returns true if the body values of two {\bf G4QHadron}
objects are the same.

{\bf int operator!=(const G4QHadron \&right) const;}

// This operator returns true if the body values of two {\bf G4QHadron}
objects are the same.

\thinspace

// === {\it Selectors} ===

{\bf G4int GetPDGCode() const;}

// Get the PDG code of the hadron.

{\bf G4int GetQCode() const;}

// Get the Q code (particle ID in the {\bf G4QCHIPSWorld} data base) of the
hadron. If it is negative, then this particle is not in the CHIPS data base.

{\bf G4QPDGCode GetQPDG() const;}

// Get G4QPDGCodee class for this hadron. After that all member functions of
this class (see below) can be used.

{\bf G4LorentzVector Get4Momentum() const;}

// Returns the 4-momentum of the hadron.

{\bf G4QContent GetQC() const;}

// Returns the quark content of the hadron.

{\bf \thinspace G4double GetMass() const;}

// Returns the mass of the hadron.

{\bf \thinspace G4double GetMass2() const;}

// Returns the squared mass of the hadron (in comparison to the
G4LorentzVector.m2(), which is faster than G4LorentzVector.m(), this
function is slower than the previous one)..

{\bf \thinspace G4double GetWidth() const;}

// Returns the width of the hadron if the hadron is an unstable resonance,
oterwise returns 0.

{\bf G4int GetNFragments() const;}

// Return a number of secondary particles if the hadron decayed in the {\bf %
G4QHadronVector}.

{\bf G4int GetCharge() const;}

// Returns the charge of the hadron.

{\bf G4int GetBaryonNumber() const;}

// Returns the baryon number of the hadron.

// === {\it Modifiers} ===

{\bf void SetQC(const G4QContent\& newQC);}

// Set new quark content for the hadron. This is a kind of reinitialization
of the hadron. The references (\&) to the input parameters are widely used
in the CHIPS event generator to make its understanding easier for users with
FORTRAN background.

{\bf void Set4Momentum(const G4Lorentzvector\& aMom);}

{\bf void SetQPDG(const G4QPDGCode\& QPDG);}

{\bf void SetNFragments(const G4int\& nf);}

// These modifiers are just opposite to the corresponding selectors above.

{\bf void NegPDGCode();}

// Makes an anti-particle out of the particle.

{\bf void MakeAntiHadron();}

// This member function makes the same job as previous, but it is smarter:
it does not make negative quark content and negative PDG code, if this is
true neutral hadron (anti-hadron coincide with hadron). So these two member
functions are different.

// === {\it General functions} ===

{\bf G4double RandomizeMass(G4QParticle* pPart, G4double maxM);}

// Randomizes the mass value for resonances, {\bf pPart} is a pointer to the
particle in the {\bf G4QCHIPSWorld} and the {\bf maxM }is the upper limit
for the randomized mass value.

{\bf G4bool DecayIn2(G4LorentzVector\& f4Mom, G4LorentzVector\& s4Mom);}

// Purely kinematical member function of decay of the particle with
4-momentum of this hadron in two particles, masses of which are defined by
masses of the input {\bf G4LorentzVector}s {\bf f4Mom} and {\bf s4Mom}. The
result comes back in the same 4-vectors (that is why they are not {\bf %
const, }which is used only for input parameters to be sure that this
parameter is not changed by reference in the member function).

{\bf G4bool CorMDecayIn2(G4double corM, G4LorentzVector\& f4Mom);}

// This member function makes a special kind of correction for the result of
decay in two particles. It changes the mass of this hadron, leaving the
direction of other particle the same in the Center of Mass System (CMS) as
it is defined by the {\bf f4Mom} 4-vector. The {\bf f4Mom} 4-vector is
updated (corrected) the residual 4-vector is assigned to this hadron (now
having the new mass value {\bf corM}).

{\bf G4bool CorEDecayIn2(G4double corE, G4LorentzVector\& f4Mom);}

// This member function makes another special kind of correction for the
result of decay in two particles. It adds some Laboratory System (LS) energy 
{\bf corE} to this hadron and subtract it from the particle with the {\bf %
f4Mom} 4-vector. The direction in CMS, defined by the {\bf f4Mom} 4-vector
is kept.

{\bf G4bool RelDecayIn2(G4LorentzVector\& f4Mom, G4LorentzVector\&}

{\bf s4Mom, G4LorentzVector\& dir, G4double maxCost, G4double minCost=-1.);}

// This member function is quite similar to the general {\bf DecayIn2}\
member function, but it can randomize the cos(theta) value of decay in CMS
in the interval ({\bf minCost},{\bf maxCost}) in respect to the direction,
which is defined by the {\bf dir} 4-vector.

{\bf G4bool DecayIn3(G4LorentzVector\& f4Mom, G4LorentzVector\& s4Mom,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf G4LorentzVector\&
s4Mom);}

//Decays this hadron in three particles. All member functions above return 
{\it true} if the decay succeeded and {\it false} if it does not.

\subsection{G4QChipolino (about 500 lines)}

// === {\it Constructors} ===

{\bf G4QChipolino();}

// A default constructor.

{\bf G4QChipolino(G4QContent QC);}

{\bf G4QChipolino(const G4QChipolino\& right);}

// This is a copy-constructor (for the original in the C++ stack).

{\bf \thinspace G4QChipolino(G4QChipolino* right);}

// This is a copy-constructor (for the original in the C++ heap).

// === {\it Overloaded operators} ===

{\bf const \thinspace G4QChipolino\& operator=(const G4QChipolino\& right);}

// This is a copy operator similar to the copy-constructors above.

{\bf int operator==(const G4QChipolino \&right) const;}

// This operator returns true if the body values of two {\bf G4QChipolino}
objects are the same.

{\bf int operator!=(const G4QChipolino \&right) const;}

// This operator returns true if the body values of two {\bf G4QChipolino}
objects are the same.

{\bf ostream\& operator%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
(ostream\& lhs, G4QChipolino\& rhs);}

// This is a member function, which prints the content of the chipolino.

\thinspace

// === {\it Selectors} ===

{\bf G4double GetMass() const;}

{\bf G4double GetMass2() const;}

// Returns the mass and the squared mass of the chipolino (extracts from
4-vector, the last is faster).

{\bf G4QPDGCode GetQPDG1();}

{\bf G4QPDGCode GetQPDG2();}

// These member functions return {\bf G4QPDGCode}s of hadrons, the
chipolino consists of.

{\bf G4QContent GetQContent() const;}

//Returns the quark content of the chipolino.

{\bf G4QContent GetQContent1() const;}

{\bf G4QContent GetQContent2() const;}

// These member functions return quark contents of hadrons, the
chipolino consists of.

\thinspace

// === {\it Modifiers} ===

{\bf void SetHadronQPDG(const G4QPDGCode\& QPDG);}

// Sets the {\bf G4QPDGCode}\ for the chipolino. This is a kind of
reinitialization.

{\bf void SetHadronPDGCode(const G4int\& PDGCode);}

{\bf void SetHadronQCont(const G4QContent\& QC);}

// These two member functions reinitialize the chipolino, using integer PDG
code or quark content.

\subsection{G4QCandidate : public G4QHadron (about 100 lines)}

// === {\it Constructors} ===

{\bf G4QCandidate();}

{\bf G4QCandidate(G4int PDGcode);}

// In fact this is the only possible constructor for this simple class.

{\bf G4QCandidate(const G4QCandidate\& right);}

{\bf G4QCandidate(G4QCandidate* right);}

// These are copy-constructors.

// === {\it Overloaded operators} ===

{\bf const \thinspace G4QCandidate\& operator=(const G4QCandidate\& right);}

// This is a copy operator similar to the copy-constructors above.

{\bf int operator==(const G4QCandidate \&right) const;}

// This operator returns true if the body values of two {\bf G4QCandidate}
objects are the same.

{\bf int operator!=(const G4QCandidate \&right) const;}

// This operator returns true if the body values of two {\bf G4QCandidate}
objects are the same.

\thinspace

// === {\it Selectors} ===

{\bf G4ParentCluster* TakeParClust(G4int nPC);}

// Returns pointer to the parent cluster {\bf \# nPC}.

{\bf G4int GetPClustEntries() const;}

// Returns a number of parent clusters for this candidate.

{\bf G4bool GetPossibility() const;}

// {\it True} if this candidate can be radiated in this particular act of
hadronization.

{\bf G4bool GetParPossibility() const;}

// Returns {\it true} if this candidate can play a role of the parent
cluster.

{\bf G4double GetKMin() const;}

// The minimum {\it k} (momentum of primary quark-parton) value for
production of this kind of candidate-hadron.

{\bf G4double GetEBMass() const;}

// The bound mass of the candidate in the nuclear environment, which does
not include the quasmons.

{\bf G4double GetNBMass() const;}

// The bound mass of the candidate in total nucleus (in fact this is true if
there is only one quasmon; if there are a number of quasmons, then only
quantum numbers of the current quasmon are added to the environment, other
quasmons are not taken into account).

{\bf G4double GetDenseProbability() const;}

// The probability to find this cluster-candidate in the dense region of the
nucleus.

{\bf G4double GetPreProbability() const;}

// The probability to find this candidate in total nucleus.

{\bf G4double GetRelProbability() const;}

// A kind of final calculated probability for the candidate, after taking
into account all kinematical and quark counting factors.

{\bf G4double GetIntegProbability() const;}

// Integrated probability up to this candidate (for the randomization
purposes).

{\bf G4double GetSecondRelProb() const;}

{\bf G4double GetSecondIntProb() const;}

// Spare emergency probabilities, based on just kinematic bounds, which can
be used if normal way of the competition has failed. Now they are not used.
They are historic and can disappear in this class in future.

// === {\it Modifiers} ===

{\bf void ClearParClustVect();}

// This is a very important member function, which cleans up pointers of the
parent cluster vector and destroys the {\bf G4QParentCluster} instances, so
that this vector of the candidate can be reused in another act of
hadronization.

{\bf void FillPClustVect(G4QParentCluster* pCl);}

// This member function fills appropriate parent clusters for this candidate
one by one.

{\bf void SetPossibility( G4bool choice);}

{\bf void SetParPossibility(G4bool choice);}

{\bf void SetKMin(G4double kmin);}

{\bf void SetDenseProbability(G4double prep);}

{\bf void SetPreProbability(G4double prep);}

{\bf void SetRelProbability(G4double relP);}

{\bf void SetIntegProbability(G4double intP);}

{\bf void SetIntegProbability(G4double intP);}

{\bf void SetSecondRelProb(G4double relP);}

{\bf void SetSecondIntProb(G4double intP);}

{\bf void SetEBMass(G4double newMass);}

{\bf void SetNBMass(G4double newMass);}

// The meaning of these modifiers is clarified for the corresponding
selectors above.

\subsection{G4QParentCluster (about 100 lines)}

/ === {\it Constructors} ===

{\bf G4QParentCluster(G4int PDGCode=0);}

// This constructor acts both as a default constructor and as a formal
constructor.

{\bf G4QParentCluster(G4int PDGcode, G4double prob);}

// In fact this is the only complete constructor for this simple class, as
the parent cluster without any defined probability should not exist.

{\bf G4QParentCluster(const G4QParentCluster\& right);}

{\bf G4QParentCluster(G4QParentCluster* right);}

// These are copy-constructors.

// === {\it Overloaded operators} ===

{\bf const \thinspace G4QParentCluster\& operator=(const G4QParentCluster\&
right);}

// This is a copy operator similar to the copy-constructors above.

{\bf int operator==(const G4QParentCluster \&right) const;}

// This operator returns true if the body values of two {\bf G4QParentCluster%
} objects are the same.

{\bf int operator!=(const G4QParentCluster \&right) const;}

// This operator returns true if the body values of two {\bf G4QParentCluster%
} objects are the same.

{\bf ostream\& operator%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
(ostream\& lhs, G4QParentCluster\& rhs);}

{\bf ostream\& operator%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
(ostream\& lhs, const G4QParentCluster\& rhs);}

// These are member functions which print the content of the parent
cluster.\thinspace

// === {\it Selectors} ===

{\bf G4QContent GetTransQC() const;}

// Get quark content of the quark exchange, which is necessary to shift this
parent cluster to the master-candidate (similar to a meson in Feynman
diagrams).

{\bf G4int GetPDGCode() const;}

// Returns the PDG code of the parent cluster.

{\bf G4int GetNQPar2() const;}

// Returns the {\bf n-2} value, where{\bf \ n} is a number of degrees of
freedom in the parent cluster. It is necessary for randomization of the
secondary quark-parton and should be the same after selection of the
candidate as it was in time of the probability calculation.

{\bf G4double GetProbability() const;}

// Returns the probability for this parent cluster to be transformed to the
outgoing candidate. Sum of all probabilities for parent clusters,
appropriate for the candidate is a probability for the candidate.

{\bf G4double GetLow() const;}

{\bf G4double GetHigh() const;}

// These member functions return limits for randomization of the momentum of
the secondary quark parton for this particular candidate.

{\bf G4double GetEBMass() const;}

{\bf G4double GetEBind() const;}

{\bf G4double GetNBMass() const;}

{\bf G4double GetNBind() const;}

// Return bound masses and binding energies of the parent cluster in respect
to the environment and to the total nucleus as it was explained for the {\bf %
G4QCandidate }class.

// === {\it Modifiers} ===

{\bf void SetTransQC(G4QContent newTrans);}

{\bf void SetPDGCode(G4int newPDGCode);}

{\bf void SetNQPart2(G4int nm2);}

{\bf void SetProbability(G4double probab);}

{\bf void SetLow(G4double loLim);}

{\bf void SetHigh(G4double hiLim);}

{\bf void SetEBMass(G4double bMass);}

{\bf void SetEBind(G4double bEn);}

{\bf void SetNBMass(G4double bMass);}

{\bf void SetNBind(G4double bEn);}

// The meaning of these modifiers is clarified for the corresponding
selectors above.

\subsection{G4QCHIPSWorld (about 100 lines)}

// === {\it Constructors} ===

{\bf G4QCHIPSWorld(G4int nOfParts=0);}

// This constructor plays roles of both a default constructor and a formal
constructor.

{\bf G4QCHIPSWorld(const G4QCHIPSWorld\& right);}

{\bf G4QCHIPSWorld(G4QCHIPSWorld* right);}

// These are a copy-constructors.

// === {\it Overloaded operators} ===

{\bf const \thinspace G4QCHIPSWorld\& operator=(const G4QCHIPSWorld\& right);%
}

// This is a copy operator similar to the copy-constructors above.

// === {\it Selectors} ===

{\bf G4QParticle* GetQParticle( G4int PDG) const;}

{\bf G4QParticle* GetQParticle(G4QPDGCode QPDG) const;}

{\bf G4QParticle* GetQParticle(G4QPDGCode* QPDG) const;}

// Overloaded selectors for a particle with some specific PDG code, instance
of \ G4QPDGCode class. Return a pointer to the corresponding particle in the 
{\bf G4QCHIPSWorld }data base{\bf .}

\subsection{G4QParticle (about 700 lines)}

// === {\it Constructors} ===

{\bf G4QParticle();}

{\bf G4QParticle(G4int PDGcode);}

// In fact this is the only complete constructor for this simple class.

{\bf G4QParticle(const G4QParticle\& right);}

{\bf G4QParticle(G4QParticle* right);}

// These are copy-constructors.

// === {\it Overloaded operators} ===

{\bf const \thinspace G4QParticle\& operator=(const G4QParticle\& right);}

// This is a copy operator similar to the copy-constructors above.

{\bf int operator==(const G4QParticle \&right) const;}

// This operator returns true if the body values of two {\bf G4QParticle}
objects are the same.

{\bf int operator!=(const G4QParticle \&right) const;}

// This operator returns true if the body values of two {\bf G4QParticle}
objects are the same.

{\bf ostream\& operator%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
(ostream\& lhs, G4QParticle\& rhs);}

// These are member functions which print the content of the
particle.\thinspace

// === {\it Selectors} ===

{\bf G4QContent GetQContent() const;}

//Returns quark content of the particle. In future all {\bf Get/SetQContent}
member functions can be reduced to the {\bf Get/SetQC} form for unification
of overloading. There is still a possibility to mix GetQContent with
GetQCode, but QC became a common notation for the quark content and the Q
code is more internal and should not be necessary for the user.

{\bf G4QDecayChanVector GetDecayVector() const;}

// Returns a vector of the {\bf G4QDecayChan} instances, in which sets of
particles, in which this particle can decay are collected together with the
corresponding branching.

{\bf G4QPDGCode GetQPDG() const;}

// Return the {\bf G4QPDGCode} descriptor for this particle.

{\bf G4double GetMass() const;}

{\bf G4double GetWidth() const;}

//Return the mass and the width ($\Gamma $) of the mass distribution for the
particle.

{\bf G4int GetPDGCode() const;}

// Returns the PDG code of the particle.

{\bf G4int GetQCode() const;}

// Returns the specific ID in the {\bf G4QCHIPSWorld} data base.

{\bf G4int GetSpin() const;}

// Returns the 2s+1 value.

{\bf G4int GetCharge() const;}

{\bf G4int GetStrange() const;}

{\bf G4int GetBaryNum() const;}

// Return the charge, the strangeness, and the baryon number for the
particle.

{\bf G4double MinMassOfFragm();}

// Returns the minimum mass sum for different decay channels of this
particle.

// === {\it Modifiers} ===

{\bf G4QDecayChanVector InitDecayVector(D4int QCode);}

// Initialize or reinitialize the particle, using the Q code of the particle
in the {\bf G4QCHIPSWorld} data base, returns the vector of decay channels
for decay. This function is mostly used for the fake particle with the
default constructor, to find out the decay channels for the particle. In
future it can be duplicated for the PDG code and overloaded for the {\bf %
G4QPDGCode} descriptor.

{\bf void InitPDGParticle(G4int thePDGCode);}

{\bf void InitQParticle(G4int theQCode);}

// These reinitializers can not be overloaded as both have integer input
parameter.

\subsection{G4QDecayChannel (about 100 lines)}

// === {\it Constructors} ===

{\bf G4QDecayChannel();}

{\bf G4QDecayChannel(G4QPDGCodeVector secHadr,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf G4double
probLimit=1.);}

// This is a general constructor for this simple class, filling a vector of
particle together with the branching value {\bf probLimit.}

{\bf G4QDecayChannel(G4double pLev, G4int PDG1, G4int PDG2,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf G4int
PDG3=0);}

// This is how the decay channel can be created directly with the PDG codes
of the secondary particles. The CHIPS event generator does not support decay
in more than three particles, so decays with higher multiplicities should be
interpreted as decays with the intermediate resonance (which they are in
reality). It is difficult to find the case of decay in the PDG table, when
this is impossible (at least for the SU(3) part).

{\bf G4QDecayChannel(const G4QDecayChannel\& right);}

{\bf G4QDecayChannel(G4QDecayChannel* right);}

// These are copy-constructors.

// === {\it Overloaded operators} ===

{\bf const \thinspace G4QDecayChannel\& operator=(const G4QDecayChannel\&
right);}

// This is a copy operator similar to the copy-constructors above.

{\bf int operator==(const G4QDecayChannel \&right) const;}

// This operator returns true if the body values of two {\bf G4QDecayChannel}
objects are the same.

{\bf int operator!=(const G4QDecayChannel \&right) const;}

// This operator returns true if the body values of two {\bf G4QDecayChannel}
objects are the same.

{\bf ostream\& operator%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
(ostream\& lhs, G4QDecayChannel\& rhs);}

// These are member functions which print the content of the decay
channel.\thinspace

// === {\it Selectors} ===

{\bf G4double GetDecayChanLimit() const;}

// Returns the branching value.

{\bf G4double GetMinMass() const;}

// Return the minimum sum of the masses of the secondary particles. It is
correct even in case of intermediate resonances, as the minimum resonance
mass is the minimum mass of its fragments.

{\bf G4QPDGCodeVector GetVecOfSecHadrons() const;}

// Return the vector of {\bf G4QPDGCode}\ descriptors for the secondary
particles.

// === {\it Modifiers} ===

{\bf void SetDecayChanLimit(G4double newDecChanLim);}

// One should be careful, as probabilities of decay are kept in the
integrated form, ready for randomization.

{\bf void SetMinMass(G4double newMin Mass);}

{\bf void SetVecOfSecHadrons(G4QPDGCodeVector hadV);}

// The meaning of these modifiers is clarified for the corresponding
selectors above.

\subsection{G4QPDGCode (about 1100 lines)}

// === {\it Constructors} ===

{\bf G4QPDGCode(G4int PDGCode=0);}

// This is a general constructor by PDG code.

{\bf G4QPDGCode(G4QContent QCont);}

// This is a general constructor by quark content.

{\bf G4QPDGCode(const G4QPDGCode\& right);}

{\bf G4QPDGCode(G4QPDGCode* right);}

// These are copy-constructors.

// === {\it Overloaded operators} ===

{\bf const \thinspace G4QPDGCode\& operator=(const G4QPDGCode\& right);}

// This is a copy operator similar to the copy-constructors above.

{\bf int operator==(const G4QPDGCode\& rhs) const;}

{\bf int operator==(const G4int\& rhs) const;}

// These operators return true (\#0) if the body values of two {\bf %
G4QPDGCode} objects are the same. Right hand side can be identified by the
PDG code.

{\bf int operator!=(const G4QPDGCode\& rhs) const;}

{\bf int operator!=(const G4int\& rhs) const;}

// These operators return true (\#0) if the body values of two {\bf %
G4QPDGCode} objects are the same. Right hand side can be identified by the
PDG code.

{\bf G4int operator+=(const G4QPDGCode\& rhs);}

{\bf G4int operator-=(const G4QPDGCode\& rhs);}

{\bf G4int operator+=(const G4int\& rhs);}

{\bf G4int operator-=(const G4int\& rhs);}

// Increments and decrements of the PDG code.

{\bf G4int operator*=(const G4int\& rhs);}

{\bf G4int operator/=(const G4int\& rhs);}

// In this case the right hand side is just an integer value.

{\bf G4int operator+(const G4QPDGCode\& lhs, const G4QPDGCodes\& rhs);}

{\bf G4int operator+(const G4QPDGCode\& lhs, const G4int\& rhs);}

{\bf G4int operator+(const G4int\& lhs, const G4QPDGCodes\& rhs);}

{\bf G4int operator-(const G4QPDGCode\& lhs, const G4QPDGCodes\& rhs);}

{\bf G4int operator-(const G4QPDGCode\& lhs, const G4int\& rhs);}

{\bf G4int operator-(const G4int\& lhs, const G4QPDGCodes\& rhs);}

{\bf G4int operator*(const G4QPDGCode\& lhs, const G4QPDGCodes\& rhs);}

{\bf G4int operator*(const G4QPDGCode\& lhs, const G4int\& rhs);}

{\bf G4int operator*(const G4int\& lhs, const G4QPDGCodes\& rhs);}

{\bf G4int operator/(const G4QPDGCode\& lhs, const G4QPDGCodes\& rhs);}

{\bf G4int operator/(const G4QPDGCode\& lhs, const G4int\& rhs);}

{\bf G4int operator/(const G4int\& lhs, const G4QPDGCodes\& rhs);}

{\bf G4int operator\%(const G4QPDGCode\& lhs, const G4int\& rhs);}

// The overloaded operators, defined beyond the {\it name space} of the
class header.

{\bf ostream\& operator%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
(ostream\& lhs, G4QPDGCode\& rhs);}

{\bf ostream\& operator%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
(ostream\& lhs, const G4QPDGCode\& rhs);}

// These are member functions which print the content of the decay
channel.\thinspace

// === {\it Selectors} ===

{\bf G4double GetMass();}

{\bf G4double GetMass2();}

{\bf G4double GetWidth();}

{\bf G4double GetNuclMass(G4int Z, G4intN, G4int S);}

{\bf G4double GetNuclMass(G4int PDGCode);}

// All kinds of selectors for the mass and width of the particle with this
descriptor. Last two overloaded functions are more general functions than
selectors.

{\bf G4QContent GetQuarkContent() const;}

// This is an antique name of the early development stage, in future can be
changed to the overloaded {\bf GetQC()}.

{\bf G4QContent GetExQContent(G4int i, G4int o) const;}

// It returns the quark content of the fake meson of the Feynman diagram to
the quark exchange act. SU(3) quarks{\bf \ i} (incoming quark-parton) and 
{\bf o} (out coming quark-parton) are numerated as follows: d (0), u (1),
s(2).

{\bf G4int GetBaryNum() const;}

{\bf G4int GetSpin() const;}

{\bf G4int GetCharge() const;}

{\bf G4int GetPDGCode() const;}

{\bf G4int GetQCode() const;}

// Return the baryon number, 2s+1, the charge, the PDG code, and Q code
correspondingly.

{\bf G4int GetGetRelCrossIndex(G4int i, G4int o) const;}

// It gives a shift of index (Q code) for the quark exchange, defined by{\bf %
\ i} and {\bf o} (see above), with which one can find the parent cluster in
the {\bf G4QCHIPSWorld} data base.

{\bf G4int GetNumOfComb(G4int i, G4int o) const;}

// Returns a number of combinations for the quark exchange.

{\bf G4int GetTotNumOfComb(G4int i) const;}

// This is a total number of possible combinations for the quark exchange in
case of incoming of the quark-parton of the kind {\bf i} (see above).

{\bf G4bool TestRealNeutral();}

// Returns true, if the particle with this PDG code coincide with its
antiparticle.

// === {\it Modifiers} ===

{\bf void SetPDGCode(G4int newPDGCode);}

{\bf void InitByQCont(G4QContent QCont);}

{\bf void InitByQCode(G4init QCode);}

// These three reinitializers can be over partially overloaded
(unfortunately not for Q code and PDG code).

{\bf void NegPDGCode();}

// Makes an antiparticle out of this particle.

\subsection{G4QContent (about 400 lines)}

// === {\it Constructors} ===

{\bf G4QContent(G4int d=0, G4int u=0, G4int s=0,}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf \ G4int ad=0, G4int au=0, G4int
as=0,);}

// This is a default constructor and the only general constructor for the
quark content. Please, pay attention to the sequence of quarks. Each integer
number means a number of quarks of this kind.

{\bf G4QContent(const G4QContent\& right);}

{\bf G4QContent(G4QContent* right);}

// These are copy-constructors.

// === {\it Overloaded operators} ===

{\bf const \thinspace G4QContent\& operator=(const G4QContent\& right);}

// This is a copy operator similar to the copy-constructors above.

{\bf int operator==(const G4QContent\& rhs) const;}

// This operator returns true (\#0) if the body values of two {\bf G4QContent%
} objects are the same.

{\bf int operator!=(const G4QContent\& rhs) const;}

// This operator returns true (\#0) if the body values of two {\bf G4QContent%
} objects are the same.

{\bf G4int operator+=(const G4QContent\& rhs);}

{\bf G4int operator-=(const G4QContent\& rhs);}

{\bf G4int operator+=(const G4int\& rhs);}

{\bf G4int operator-=(const G4int\& rhs);}

// Increments and decrements of the quark content.

{\bf G4int operator*=(G4int\& rhs);}

{\bf G4int operator*=(const G4int\& rhs);}

// In this case the right hand side is just an integer value.

{\bf G4int operator+(const G4QContent\& lhs, const G4QContent\& rhs);}

{\bf G4int operator-(const G4QContent\& lhs, const G4QContent\& rhs);}

// The overloaded operators, defined beyond the {\it name space} of the
class header.

{\bf ostream\& operator%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
(ostream\& lhs, G4QContent\& rhs);}

{\bf ostream\& operator%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
(ostream\& lhs, const G4QContent\& rhs);}

// These are member functions which print the content of the decay
channel.\thinspace

// === {\it Selectors} ===

{\bf G4int GetCharge() const;}

{\bf G4int GetBaryonNumber() const;}

{\bf G4int GetStrangness() const;}

// Return the charge, the baryon number, and the strangeness for this quark
content (strangeness of $\Lambda $\ is 1, strangeness of K$^{+}$ is -1).

{\bf G4int GetSPDGCode() const;}

// Return PDG code of particle with minimum mass for this quark content.

{\bf G4int GetZNSPDGCode() const;}

{\bf G4int NOfCombinations(const G4QContent\& rhs) const;}

// Return a number of combinations of the quark content {\bf rhs} in this
quark content. In future it will be transformed to overloaded {\bf operator/=%
}.

{\bf G4int GetQ() const;}

{\bf G4int GetAQ() const;}

{\bf G4int GetTot() const;}

// Return a number of quarks, a number of antiquarks, and the total number
of quarks correspondingly.

{\bf G4int GetP() const;}

{\bf G4int GetN() const;}

{\bf G4int GetL() const;}

{\bf G4int GetAP() const;}

{\bf G4int GetAN() const;}

{\bf G4int GetAL() const;}

// Return a number of protons, neutrons, $\Lambda $, antiprotons,
antineutrons anti-$\Lambda $ in this quark content correspondingly.

{\bf G4int GetD() const;}

{\bf G4int GetU() const;}

{\bf G4int GetS() const;}

{\bf G4int GetAD() const;}

{\bf G4int GetAU() const;}

{\bf G4int GetAS() const;}

// Return a number of each kind of quarks in this quark content.

{\bf G4int GetNetD() const;}

{\bf G4int GetNetU() const;}

{\bf G4int GetNetS() const;}

{\bf G4int GetNetAD() const;}

{\bf G4int GetNetAU() const;}

{\bf G4int GetNetAS() const;}

// Return a net number of quarks, that is subtract antiquarks of the same
flavor from quarks and vise versa.

{\bf G4int GetDD() const;}

{\bf G4int GetUU() const;}

{\bf G4int GetSS() const;}

{\bf G4int GetUD() const;}

{\bf G4int GetDS() const;}

{\bf G4int GetUS() const;}

{\bf G4int GetADAD() const;}

{\bf G4int GetAUAU() const;}

{\bf G4int GetASAS() const;}

{\bf G4int GetAUAD() const;}

{\bf G4int GetADAS() const;}

{\bf G4int GetAUAS() const;}

// Return a number of corresponding diquarks in the quark content.

{\bf G4bool CheckNegative() const;}

// Return true if at least one number of 6 is negative. It means that there
is an error in the program.

{\bf G4QContent IndQ (G4int ind=0);}

{\bf G4QContent IndAQ (G4int ind=0);}

// These functions are a kind of an iterator as they return a quark content
for one quark with the index ind. E.g. if {\bf QC=(3,5,2,4,1,1)}, then {\bf %
IndQ(1)=(1,0,0,0,0,0)}, {\bf IndQ(5)=(0,1,0,0,0,0)}, {\bf IndQ(10)} return
the error message and call {\bf G4Exception}, {\bf IndAQ(5)=(0,0,0,0,0,1)}.
The {\bf GetQ()} and {\bf GetAQ()} (see above) should be used before to
avoid errors.

{\bf \thinspace G4QContent SplitChipo(G4double mQ);}

// Split some hadron from this quasmon state with mass {\bf mQ}. Very useful
for chipolino-quasmon as helps to understand in which hadrons it can be
split.

// === {\it Modifiers} ===

{\bf void Anti();}

// Change quarks to antiquarks and vise versa.

{\bf void SubtractHadron(G4QContent hQC);}

// Returns {\it true} if it is possible to subtract hQC quark content\ from
this quark content.

{\bf void SubtractPi0();}

// Returns {\it true} if it is possible to subtract $\pi ^{0}$\ from this
quark content.

{\bf void SubtractPion();}

// Returns {\it true} if it is possible to subtract any pion\ from this
quark content.

{\bf void SubtractKaon();}

// Returns {\it true} if it is possible to subtract any kaon\ from this
quark content.

{\bf void SetD(G4int n=0);}

{\bf void SetU(G4int n=0);}

{\bf void SetS(G4int n=0);}

{\bf void SetAD(G4int n=0);}

{\bf void SetAU(G4int n=0);}

{\bf void SetAS(G4int n=0);}

// Set the particular kind of quarks.

{\bf void IncD(G4int n=1);}

{\bf void IncU(G4int n=1);}

{\bf void IncS(G4int n=1);}

{\bf void IncAD(G4int n=1);}

{\bf void IncAU(G4int n=1);}

{\bf void IncAS(G4int n=1);}

// Increment the particular kind of quarks.

{\bf void IncQAQ(const G4int\& nQAQ=1, const G4double\& sProb=1.);}

// Increment the quark content by {\bf nQAQ} quark-antiquark pairs. The {\bf %
sProb} parameter is s/u value, which is normally taken from the input
parameters.

{\bf void Dec(G4int n=1);}

{\bf void Dec(G4int n=1);}

{\bf void Dec(G4int n=1);}

{\bf void Dec(G4int n=1);}

{\bf void Dec(G4int n=1);}

{\bf void Dec(G4int n=1);}

// Decrement the particular kind of quarks.

{\bf void DecQAQ(const G4int\& nQAQ=1);}

// Decrement the quark content by {\bf nQAQ} quark-antiquark pairs.

\section{Appendix B. Development of the interaction part of the generator.}

\noindent \qquad In this appendix the interaction part of the
{\bf G4QEnvironment} class is considered. If necessary it can be developed by the
user, as it does not cover all possible cases of interactions with quasmon
creation.

Let us start with the private member function
{\bf PrepareInteractionProbabilities}:

{\bf void G4QEnvironment::PrepareInteractionProbabilities(const G4QContent\&}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
{\bf projQC, G4double AP)}

{\bf \{}

// Probability of interaction with the cluster can depend on quark content
of the projectile {\bf projQC }and may be of the momentum of the projectile 
{\bf AP} to have a special case for the interaction at rest (not used up to
now!).

\ \ {\bf G4double sum=0.;}

// Increasing sum of probabilities.

\ \ {\bf G4double probab=0.;}

// Prototype of the calculated probability (fake initialization by 0.).

\ \ {\bf G4double denseB=0.;}

// Counter of quasi-free baryons from the dense region.

\ \ {\bf G4double allB=0.}

// Counter of all quasi-free baryons

{\bf \ \ \ G4int pPDG=projQC.GetSPDGCode();}

// Get the PDG of the projectile with minimum mass for the quark content (it
works for the photons as they have zero quark content).

\ \ {\bf for (G4int index=0; index%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
theCandidates.size(); index++)}

\ \ {\bf \{}

// The loop over all candidates starts.

{\bf \ \ \ \ \ \ G4QCandidate* curCand=theQCandidates[index];}

// Get a pointer to the current candidate.

{\bf \ \ \ \ \ \ G4int cPDG=curCand-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetPDGCode();}

// Get a PDG code of the candidate (at this point only clusters can be
candidates for the interaction).

{\bf \ \ \ \ \ \ if(cPDG%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
80000000\&\&cPDG!=90000000)}

{\bf \ \ \ \ \ \ \{}

// Anyway this is the standard filter for clusters. Hopefully this is not
necessary. It is historic and should be corrected in future. But on the
other hand, in some reactions the virtual mesons in baryons can be
considered as a partial target (t-channel diagrams in the Feynman notation),
so it can transform rather than disappear.

{\bf \ \ \ \ \ \ \ \ \ G4Nucleus cN(cPDG);}

// This is how a symbolic nucleus at rest can be created using the PDG code
of the cluster.

{\bf \ \ \ \ \ \ \ \ \ G4int zc=cN.GetZ();}

{\bf \ \ \ \ \ \ \ \ \ G4int nc=cN.GetN();}

{\bf \ \ \ \ \ \ \ \ \ G4int sc=cN.GetS();}

{\bf \ \ \ \ \ \ \ \ \ G4int ac=cN.GetA();}

// This is how the numbers of protons, neutrons, $\Lambda $, and all baryons
can be found for the cluster.

\ \ \ \ \ \ \ \ {\bf G4double nOfCl=curCand-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetPreProbability();}

\ \ \ \ \ \ \ \ {\bf G4double dOfCl=curCand-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetDenseProbability();}

// These are correspondingly the probability to find the cluster in the
nucleus and find the cluster in the dense region of the nucleus.

{\bf \ \ \ \ \ \ \ \ \ if(ac==1)}

{\bf \ \ \ \ \ \ \ \ \ \{}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ allB+=nOfCl;}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ denseB+=dOfCl;}

{\bf \ \ \ \ \ \ \ \ \ \}}

// For the quasi-free baryons the corresponding sums are collected.

{\bf \ \ \ \ \ \ \ \ \ G4QContent pQC=curCand-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetQC();}

// The quark content of the candidate (parent cluster).

{\bf \ \ \ \ \ \ \ \ \ G4int pC=progQC.GetCharge();}

// The charge of the projectile.

{\bf \ \ \ \ \ \ \ \ \ G4QContent qQC=pQC+projQC;}

// The quark content of the possible compound quasmon.

{\bf \ \ \ \ \ \ \ \ \ G4QPDGCode qQPDG(qQC);}

// The {\bf G4QPDGCode} descriptor for the possible compound quasmon.

{\bf \ \ \ \ \ \ \ \ \ G4int qC=qQPDG.GetQCode()}

// This is the Q code for the possible compound quasmon.

\thinspace {\bf \ } \ \ \ \ \ \ \ {\bf G4int rPDG=qQC.GetSPDGCode();}

// Get the PDG of the hadron with minimum mass for the quark content of the
possible compound quasmon.

{\bf \ \ \ \ \ \ \ \ \ G4double pI=abs(zc-nc);}

// This is an absolute isotopic shift for the nuclear cluster.

{\bf \ \ \ \ \ \ \ \ \ G4double baryn=qQC.GetBaryonNumber();}

{\bf \ \ \ \ \ \ \ \ \ G4double charge=qQC.GetCharge();}

{\bf \ \ \ \ \ \ \ \ \ G4double qI=abs(baryn-charge-charge);}

// The baryon number, the charge and the absolute isotopic shift for the
possible compound quasmon.

{\bf \ \ \ \ \ \ \ \ \ G4double fact=1./pow(2.,pI);}

// This is a very important point. Only the clusters with the absolute
isotopic shifts less than 3 are used in the generator (see the table above).
It was suggested, that the probability for cluster to be created drops down
with the absolute isotopic shift from the line of mirror nuclei ($\alpha $%
-nuclei). The suggested suppression is calculated in this line. So according
to the chosen restriction for the set of clusters the suppression factor for
the clusters with the absolute isotopic shift more then 2 is equal 0.

{\bf \ \ \ \ \ \ \ \ \ if(pPDG==-211\&\&AP%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
10. 
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert} }%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
pPDG==22\&\&AP%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
140.)}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf \ probab=dOfCl*ac*fact;}

\ \ \ \ \ \ \ {\bf \ else \ probab=nOfCl*ac*fact;}

// So in this version of the generator the probability for the reactions
below the pion production threshold is proportional to the number of
clusters in the dense region of nucleus, to the number of nucleons and to
the isotopic suppression factor. For other reactions it is proportional to
the number of clusters in all nucleus. The user can change this line and try
any other method of calculation of the probability, e.g. use the {\bf nOfCl }%
instead of the {\bf dOfCl.} In future many possible choices should be
selected, using input parameters.

{\bf \ \ \ \ \ \}}

{\bf \ \ \ \ \ \ else probab=0.;}

// The probability is 0 for the candidates, which are not the nuclear
clusters. This can be changed in future.

{\bf \ \ \ \ \ \ sum+=probab;}

{\bf \ \ \ \ \ \ curCand-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
SetIntegProbability(sum);}

// The integrated sum of probabilities is incremented for future
randomization of probabilities

{\bf \ \ \ \}}

// End of the loop over nuclear clusters.

{\bf \ \ \ if(allB%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
0.) f2all=(allB-denseB)/allB;}

{\bf \ \ \ else \ \ \ \ \ \ \ \ \ f2all=0.;}

{\bf \}}

// End of the member function

This private member function is used in the other private member function of
the {\bf G4QEnvironment} class with the name {\bf CreateQuasmon}. It
reflects a kind of dynamics of the interaction:

{\em {\bf void G4QEnvironment::CreateQuasmon(const G4QContent\& projQC,}}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ {\em {\bf const G4Lorentz Vector\& proj4M) (a fragment).}}

\{

\ \ {\bf static const G4double mNeut=G4QPDGCode(2112).GetMass();}

\ \ {\bf static const G4double mProt=G4QPDGCode(2212).GetMass();}

\ \ {\bf static const G4double mLam=G4QPDGCode(3122).GetMass();}

\ \ {\bf static const G4double mPi=G4QPDGCode(2112).GetMass();}

\ \ {\bf static const G4double mPi2=mPi*mPi;}

\ \ {\bf static const G4QContent neutQC(2,1,0,0,0,0);}

\ \ {\bf static const G4QContent protQC(2,1,0,0,0,0);}

\ \ {\bf static const G4QContent lambQC(2,1,0,0,0,0);}

\ \ {\bf static const G4QNucleus vacuum(90000000);}

// These are convenient constants which are permanently used in this
function (analogue of the parameter {\bf PARAMETER} in FORTRAN)

\ \ {\bf G4QContent valQ(0,0,0,0,0,0);}

\ \ {\bf G4LorentzVector q4Mom(0.,0.,0.,0.,);}

// Prototypes of the quark content and 4-momentum for the future quasmon.

\ \ {\bf nBarClust=1;}

\ \ {\bf G4double projE=proj4M.e();}

{\bf \ \ \ if(projE%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
0.)}

{\bf \ \ \ \{}

{\bf \ \ \ \ \ \ G4cerr%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''G4QEnv::CQ: pE=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
projE%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
0, QC=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
projQC%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
G4endl;}

{\bf \ \ \ \ \ \ G4Exception(''***G4QEnvironment::CreateQuasmon: Energy of
projectile?);}

{\bf \ \ \ \}}

// Total energy of the projectile can not be negative (in this version of
the program, in general one can use the negative energy for the virtual
projectile).

{\bf \ \ \ G4double projM2=proj4M.m2();}

{\bf \ \ \ G4int targPDG=theEnvironment.GetPDG();}

{\bf \ \ \ if(targPDG%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
80000000\&targPDG!=90000000)}

{\bf \ \ \ \{}

// The target has the nuclear coding and can be treated as a nucleus

\ \ \ \ \ {\bf G4bool pbpt=projE%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
PiPrThresh+(M2ShiftVir+projM2)/DiNuclMass;}

// This is the condition of the photonuclear interaction below the pion
production threshold. The parameters {\bf PiPrThresh}, {\bf M2ShiftVir}, and 
{\bf DiNuclMass}\ can be defined by the user (see the parameter definition
routine for the G4QEnvironment) or the default values can be used.

\ \ \ \ \ {\bf G4bool din=false;}

\ \ \ \ \ {\bf if(abs(projM2-mPi2)%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
.00001\&\&projE-mPi%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
0.1\&\&projPDG==-211}

\ \ \ \ \ \ \ \ {\bf 
%TCIMACRO{\TEXTsymbol{\vert}}%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{\vert} }%
%BeginExpansion
\mbox{$\vert$}%
%EndExpansion
\ pbpt\&\&projPDG==22) din=true;}

// The {\bf din} flag shows, that quasi-free nucleons can not be used for
the interaction (as in the case of the capture of the real pion at rest or
photonuclear reactions below the pion production threshold) and only
clusters with the baryon number more than 1 must be used for the interaction.

\ \ \ \ \ {\bf G4int envZ=theEnvironment.GetZ();}

\ \ \ \ \ {\bf G4int envN=theEnvironment.GetN();}

\ \ \ \ \ {\bf G4int envS=theEnvironment.GetS();}

\ \ \ \ \ {\bf G4int tgMass=theEnvironment.GetMass();}

\ \ \ \ \ {\bf theEnvironment.SetMaxClust(nBarClust);}

// The environment is an instance of the {\bf G4QNucleus} class and a number
of clusters which can be used for the interaction can be restricted by the
predefined {\bf nBarClust }value.

\ \ \ \ \ {\bf nBarClust=theEnvironment.UpdateClusters(din);}

// The clusters are calculated up to the previously defined {\bf nBarClust}
value, but the dense region of the nucleus can be too small and this high
level of clusterization can not be reached, then the new, lower restriction
is returned. The {\bf din} flag is used to suppress such cases of
clusterization, when only quasi-free nucleons exist ({\bf nBarClust==1}).

\ \ \ \ \ {\bf theEnvironment.PrepareCandidates(theQCandidates);}

// This function filters the transferred vector of candidates to the
hadronization process and fix the preprobability values, which are
probabilities to find the cluster in this nuclear environment or just 1 (or
other suppression factor given in the parameters) for hadrons, which can be
created according to the quark fusion mechanism in vacuum.

\ \ \ \ \ {\bf G4bool eFlag=false;}

// There are two possibilities to work with the vector of the projectile
hadrons. First is old fashioned, belonging to the time when multi-quasmon
version was not developed. This is the energy flow (energy flux) approach,
when all the projectiles are considered as a jet and interact with the
nuclear cluster as one quasmon (it is not one hadron any more as it is a
bunch of hadrons, which can be characterized only by the quark content). So
this mechanism is used if the {\bf eFlag} is {\it true}. But the default
value in the present version is {\it false}, which means that each of the
hadrons interact independently and create a separate quasmon.

\ \ \ \ \ {\bf G4int efCounter=0;}

\ \ \ \ \ {\bf G4QContent EnFlQC(0,0,0,0,0,0);}

\ \ \ \ \ {\bf G4LorentzVector ef4Mom(0.,0.,0.,0.);}

// These are the counter of projectiles, the prototype of total quark
content for the energy flux jet and the prototype for its 4-momentum. They
are used internally for the annihilation at rest case and can be a good
example (along with the {\bf CHIPStest }program) for the {\it external
interfaces} to the CHIPS event generator. While such interfaces are created
and then meet some errors, one should look in this fragment to be sure that
nothing is changed in the generator performance.

\ \ \ \ \ {\bf G4int projPDG=projQC.GetSPDGCode();}

// Just checks if this quark content can be interpreted as a hadron.

\ \ \ \ \ {\bf G4double proj3m=proj4M.rho();}

// Get the absolute value of the 3-momentum of the projectile for future
cuts.

\ \ \ \ \ {\bf G4int baryn=projQC.GetBaryonNumber();}

// Get the baryon number of the projectile jet to disentangle the antibaryon
at rest for the pre-annihilation on the nuclear surface.

\ \ \ \ \ {\bf if(baryn==-1 \&\& proj3M%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
10.)}

\ \ \ \ \ {\bf \{}

// This is the case of the pre-annihilation on the nuclear surface.

\ \ \ \ \ \ \ \ {\bf G4double zpn=envZ+envN;}

{\bf \ \ \ \ \ \ \ \ G4double rnd=(zpn+envS)*G4UniforRand();}

{\bf \ \ \ \ \ \ \ \ G4int targBPDG=0;}

{\bf \ \ \ \ \ \ \ \ G4int targNPDG=90000000;}

{\bf \ \ \ \ \ \ \ \ G4int targQC(0,0,0,0,0,0);}

{\bf \ \ \ \ \ \ \ \ if(rnd%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
envN)}

{\bf \ \ \ \ \ \ \ \ \{}

{\bf \ \ \ \ \ \ \ \ \ \ \ targBPDG=2112;}

{\bf \ \ \ \ \ \ \ \ \ \ \ targNPDG=90000001;}

{\bf \ \ \ \ \ \ \ \ \ \ \ targQC= neutQC;}

{\bf \ \ \ \ \ \ \ \ \ \}}

{\bf \ \ \ \ \ \ \ \ \ else if(rnd%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
zpn)}

{\bf \ \ \ \ \ \ \ \ \{}

{\bf \ \ \ \ \ \ \ \ \ \ \ targBPDG=2212;}

{\bf \ \ \ \ \ \ \ \ \ \ \ targNPDG=90001000;}

{\bf \ \ \ \ \ \ \ \ \ \ \ targQC= protQC;}

{\bf \ \ \ \ \ \ \ \ \}}

{\bf \ \ \ \ \ \ \ \ else}

{\bf \ \ \ \ \ \ \ \ \{}

{\bf \ \ \ \ \ \ \ \ \ \ \ targBPDG=3122;}

{\bf \ \ \ \ \ \ \ \ \ \ \ targNPDG=91000000;}

{\bf \ \ \ \ \ \ \ \ \ \ \ targQC= lambQC;}

{\bf \ \ \ \ \ \ \ \ \}}

// This is the standard procedure (can be another member function!) to
select a baryon from the nucleus. The neutQC, protQC, and lambQC quark
contents are defined in the {\it static const} parameters of the function
(analogue of the DATA operator in FORTRAN, but in respect to this operator in
C++ these instances are preserved by the {\it const} prefix, which makes
this parameter the {\it read only} one).

\ \ \ \ \ \ \ {\bf theEnvironment.Reduce(targNPDG);}

// After the baryon was chosen for the interaction (annihilation) it should
be extracted from the environment.

\ \ \ \ \ \ \ {\bf G4double resMass=theEnviront.GetGSMass();}

// This is the new mass for the environment. The environment is always at
rest and in the ground state in the model. Up to now it was enough for the
dynamic simulation. So even if it was excited, this excitation will be
transferred to the baryon to get rid of it. But the CHIPS event generator
did not meet the excited nuclear targets up to now.

\ \ \ \ \ \ \ {\bf G4double barMass=tgMass-resMass;}

// This is the bounded mass{\bf \ }of the baryon in nuclear matter, which is
ready for the annihilation act.

\ \ \ \ \ \ \ \ {\bf tgMass=resMass;}

// The target mass must be updated.

{\bf \ \ \ \ \ \ \ \ q4Mom=G4LorentzVector(0,0,0,barMass)+proj4M;}

{\bf \ \ \ \ \ \ \ \ valQ=targQC+projQC;}

{\bf \ \ \ \ \ \ \ \ G4Quasmon* pan=new G4Quasmon(valQ,q4Mom);}

// Here the quasmon for the annihilation system is created and the function
takes the responsibility to delete it.

{\bf \ \ \ \ \ \ \ \ G4QNucleus vE=vacuum;}

{\bf \ \ \ \ \ \ \ \ G4QHadronVector* output=pan-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
Fragment(vE,1);}

// The act of fragmentation (annihilation) is made here. The fragmentation
function is informed that it happens in vacuum (the vacuum variable is
defined in the {\it static const} part of the function) and this is the only
({\bf 1}) quasmon in the environment (which is trivial for the vacuum
hadronization). The {\bf output} is another object which should be deleted
by the function.

{\bf \ \ \ \ \ \ \ \ delete pan;}

// So the delete-responsibility is transferred to the {\bf output} now.

\ \ \ \ \ \ \ {\bf G4QHadronvector input;}

// This is not necessary to take responsibility to delete this vector
itself, but as far as any vector is created (even in the C++ stack, not in
the C++ heap) it is necessary to clean up the pointers and may be (this is
recommended to avoid the memory leak) the instances, to which this pointers
indicate.

{\bf \ \ \ \ \ \ \ \ G4int trgPDG=theEnvironment.GetPDG();}

{\bf \ \ \ \ \ \ \ \ G4LorentzVector targ4M(0.,0.,0.,resMass);}

// The new target for the residual environment{\bf .}

\ \ \ \ \ \ \ {\bf G4int tNH=output-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
size();}

// This is just a number of the secondary hadrons (mesons), which should be
considered in the selection loop (see below).

{\bf \ \ \ \ \ \ \ \ G4Threevector dir = RndmDir();}

// In case of the annihilation at rest the direction, in which the solid
angle is tested for the selection of the projectile particles in the second
act of interaction, is random. At high energies it can depend on the
direction of the primary projectile. But in this case the incident parameter
and the nuclear geometry should be taken into account. So the dir is a
randomly directed unit 3-vector.

{\bf \ \ \ \ \ \ \ \ for(G4int ind=0; ind%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
tNH; ind++)}

{\bf \ \ \ \ \ \ \ \ \{}

// Loop over hadrons of the {\bf output }vector starts here.

{\bf \ \ \ \ \ \ \ \ \ \ \ G4QHadron* curHadr=output-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
operator[](ind);}

{\bf \ \ \ \ \ \ \ \ \ \ \ G4int shDFL=curHadr-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetNFragments();}

{\bf \ \ \ \ \ \ \ \ \ \ \ G4LorentzVector sh4m=curHadr-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
Get4Momentum();}

{\bf \ \ \ \ \ \ \ \ \ \ \ G4ThreeVector shDIR=sh4m.vect().unit();}

// This is how the conveyer of the member functions can be used to get the
unit vector in the direction of the 3-momentum of the secondary hadron.

{\bf \ \ \ \ \ \ \ \ \ \ \ if (!shDFL)}

{\bf \ \ \ \ \ \ \ \ \ \ \ \{}

// This is the standard filter for the particles, which already decayed.
Only final particles are the candidates for the secondary interaction.

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ if(dir.dot(shDIR)%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
SolidAngle)}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}

// The particles inside the cos(), corresponding to the {\bf SolidAngle}
parameter are selected. The {\bf SolidAngle} parameter varies from -1 to 1.

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if(efFlag)}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ G4QContent shQC=curHadr-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetQC();}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ef4Mom+=sh4m;}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ EnFlQC+=shQC;}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ effCounter++;}

// One projectile quasmon, made of the set of selected hadrons is collected
here.

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ else}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ G4QHadron* mqHadron=new
G4QHadron(curHadr);}

// The new hadron is created in the C++ heap as the copy of the hadron in the
annihilation {\bf output} and the following line is the {\bf delete}
equivalent.

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ input.push\_back(mqHadron);}

// This is very useful function of the vector template, which is used by the
GEANT4 Collaboration. This function just fills the {\bf input} vector for
the secondary interaction with the nucleus.

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}

// The selection process based on the solid angle stops here

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ else}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ G4QHadron* curHadron=new
G4QHadron(curHadr);}

// The new hadron is created in the C++ heap as the copy of the hadron in the
annihilation {\bf output} and the following line is the {\bf delete}
equivalent.

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ theQHadrons.push\_back(curHadron);}

// Here the particles, produced in the peripheral annihilation act, are sent
to the {\bf output }vector of the {\bf G4QEnvironment:Fragment()} function.

\ \ \ \ \ \ \ \ \ \ \ \ \ \}

// The direct filling stops here

{\bf \ \ \ \ \ \ \ \ \ \ \ \}}

// The filtering of decayed particles stops here.

{\bf \ \ \ \ \ \ \ \ \}}

// This is the end of the loop over the hadrons of the {\bf output} vector
of the peripheral annihilation act. \ \ 

{\bf \ \ \ \ \ \ \ G4std::for\_each(output-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
begin(), output-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
end(), DeleteQHadron());}

// This is a very important function for vectors as it clears the pointers
and deletes the instances of the vector.

\ \ \ \ \ \ \ {\bf delete output;}

{\bf \ \ \ \ \ \ \ \ if(!efFlag)}

{\bf \ \ \ \ \ \ \ \ \{}

// This is the multi-quasmon case

{\bf \ \ \ \ \ \ \ \ \ \ \ if(!(input.size())) return;}

// If no one of secondaries penetrates the nucleus, then just go out without
interaction and without any quasmon creation.

{\bf \ \ \ \ \ \ \ \ \ \ \ G4Quasmon fakeQ;}

// This is just a fake quasmon, which is created, to find out which
parameters are defined by the user for this reaction. These are static
parameters, so any new created instance of the {\bf G4Qusmon} class has the
parameters defined by the user. This is necessary as the parameters must be
recovered after the parameters for the annihilation process are temporary
substituted instead of the parameters defined by the user.

{\bf \ \ \ \ \ \ \ \ \ \ \ G4QTemper=fake.GetTemper();}

{\bf \ \ \ \ \ \ \ \ \ \ \ G4double QSOverU=fakeQ.GetSOverU();}

{\bf \ \ \ \ \ \ \ \ \ \ \ G4double QEtaSup=fakeGetEtaSup();}

{\bf \ \ \ \ \ \ \ \ \ \ \ G4Quasmon::SetParameters(180.,.1,.3);}

// These hardwired parameters are defined according to the paper \cite
{CHIPS1}.

{\bf \ \ \ \ \ \ \ \ \ \ \ G4QEnvironment* muq=}

\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\bf new
G4QEnvironment(input,theEnvironment.GetPDG());}

// This is the temporary interaction inside this interaction.

{\bf \ \ \ \ \ G4std::for\_each(input.begin(), input.end(), DeleteQHadron());}
{\bf \ \ \ \ \ projHV.clear();}

// This is an important point. The input vector was created in the C++
stack, not in the C++ heap, so we do not need to delete it, it is deleted
automatically in this {\it name space}, but we need to {\it clear} the
pointers and {\it destroy} instances of this vector.

{\bf \ \ \ \ \ \ \ \ \ \ \ theEnvironment=muq-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetEnvironment();}

// Now we should use the result of this temporary internal interaction. The
first result is the residual nuclear environment after the interaction
(creation of quasmons in nuclear matter).

\ \ \ \ {\bf \ \ \ \ \ \ G4QuasmonVector* outQ=muq-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetQuasmons();}

// The {\bf outQ} vector must be deleted as the copy of the internal quasmons
is made by the {\bf GetQuasmon()} function according to the GEANT4
convention.

\ {\bf \ \ \ \ \ \ \ \ \ delete muq;}

// So this is a kind of the rule: we delete the instance of the class, when
we get the output of this class. No parameters, which were defined by
the user can be recovered.

{\bf \ \ \ \ \ \ \ \ \ \ \ G4Quasmon::SetParameters(QTemper,QSOverU,QEtaSup);%
}

{\bf \ \ \ \ \ \ \ \ \ \ \ G4int nMq=outQ-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
size();}

{\bf \ \ \ \ \ \ \ \ \ \ \ if(nMQ) for(G4int mh=0; mh%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
nMQ; mh++)}

{\bf \ \ \ \ \ \ \ \ \ \ \ \{}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ G4Quasmon* curQ=new G4Quasmon(0utQ-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
operator[](mh));}

// The new copy is created for the temporary quasmon and the delete
equivalent for this copy is the next line.

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ theQuasmons.push\_back(curQ);}

{\bf \ \ \ \ \ \ \ \ \ \ \ \}}

{\bf \ \ \ \ \ \ G4std::for\_each(outQ-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
begin(), outQ-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
end(), DeleteQuasmon());}


// The quasmons were copied from the temporary interaction environment to
this one, so they must be destroyed in the temporary one.

{\bf \ \ \ \ \ \ \ \ \ \ \ delete outQ;}

{\bf \ \ \ \ \ \ \ \ \}}

{\bf \ \ \ \ \ \ \ \ else if(!efCounter) return;}

// If this the energy flow (flux) case and no particles were collected for
it, then just return without any further interaction and without any quasmon
creation.

\ \ \ \ \ {\bf \}}

// The case of the preannihilation on the nuclear surface stops here.

{\bf \thinspace\ \ \ \ \ \ else EnFlQC=projQC;}

// If this is not the antibaryon then the quark content of the projectile is
used in the same way as the quark content of the projectile quasmon.

\ \ \ \ \ {\bf G4double EnFlP=ef4Mom.rho();}

// This is an absolute value of the 3-momentum of the projectile

\ \ \ \ \ {\bf PrepareInteractionProbabilities(EnFlQC,EnFlP);}

// This function prepares the probabilities for the clusters. For the sake
of restriction on the isotopic shift and the baryon number of the cluster
the quark content and the 3-momentum of the projectile is transferred to
this function. After that the cluster is selected according to the
calculated probabilities and the projectile makes a compound quasmon with
the selected cluster. This is how the quasmons are created in the nuclear
matter.

\ \ \ \ \ {\bf G4int nCandid = theQCandidates.size();}

// A number of the cluster-candidates.

\ \ \ \ \ {\bf G4double maxP=TheQCandidates[nCandid-1]-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetIntegProbability();}

// Total sum of all probabilities

\ \ \ \ \ {\bf G4double totP=maxP*G4UniformRand();}

\ \ \ \ \ {\bf if(!totP)}

\ \ \ \ \ {\bf \{}

{\bf \ \ \ \ \ \ \ \ G4cerr%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''***G4QEnv::CreateQ: nC=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
nCandid}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'', maxP=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
maxP%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
'', QE=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
theEnvironment%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
G4endl;}

{\bf \ \ \ \ \ \ \ \ G4Exception(''G4QEnvironment::CreateQuasmon:}

{\bf \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Can not select a
cluster for the interaction'');}

\ \ \ \ \ {\bf \}}

\ \ \ \ \ {\bf G4int i=0;}

\ \ \ \ \ {\bf while(theCandidates[i]-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetIntegProbability()%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
totP) i++;}

// This is the standard randomization procedure for the integrated
probabilities

\ \ \ \ \ {\bf G4QCandidate* curCand = theQCandidates[i];}

// This is a pointer to the chosen cluster

\ \ \ \ \ {\bf G4QContent curQC=curCand-%
%TCIMACRO{\TEXTsymbol{>}}%
%BeginExpansion
\mbox{$>$}%
%EndExpansion
GetQC();}

\ \ \ \ \ {\bf G4QNucleus targClust(curQC.GetP(), curQC.GetN(),
curQC.GetL());}

// This is a historic method of the nucleus definition one can just use {\bf %
G4QNucleus(curQC)}.

\ \ \ \ \ {\bf theEnvironment.Reduce(targClust.GetPDG());}

// The environment

\ \ \ \ \ {\bf G4double envMass=theEnvironment.GetGSMass();}

\ \ \ \ \ {\bf if(projPDG==22\&\&pbpt)}

\ \ \ \ \ {\bf \{}

{\bf \ \ \ \ \ \ \ \ q4Mom=G4LorentzVector(0.,0.,0.,tgMass-envMass);}

{\bf \ \ \ \ \ \ \ \ valQ=targClust.GetQCZNS();}

{\bf \ \ \ \ \ \ \ \ G4Quaxmon* curQuasmon=new G4Quasmon(valQ, q4Mom,
proj4M);}

{\bf \ \ \ \ \ \ \ \ theQuasmons.push\_back(curQuasmon);}

\ \ \ \ \ {\bf \}}

\ \ \ \ \ {\bf else}

\ \ \ \ \ {\bf \{}

{\bf \ \ \ \ \ \ \ \ q4Mom=proj4M+G4LorentzVector(0.,0.,0.,tgMass-envMass);}

{\bf \ \ \ \ \ \ \ \ valQ=EnFlQC+targClust.GetQCZNS();}

{\bf \ \ \ \ \ \ \ \ G4Quasmon* curQuasmon=new G4Quasmon(valQ, q4Mom);}

{\bf \ \ \ \ \ \ \ \ theQuasmons.push\_back(curQuasmon);}

{\bf \ \ \ \ \ \ \}}

{\bf \ \ \ \}}

{\bf \ \ \ else}

{\bf \ \ \ \{}

// This is an important point: the target must have a nuclear coding in this
version. In future any hadron as a target can be included.

{\bf \ \ \ \ \ \ G4cerr%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
''***G4QEnv::CQ: Strange targPDG=''%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
targPDG%
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
%TCIMACRO{\TEXTsymbol{<}}%
%BeginExpansion
\mbox{$<$}%
%EndExpansion
G4endl;}

{\bf \ \ \ \ \ \ G4Exception(''***G4QEnvironment::CreateQuasmon: Impossible
target'');}

{\bf \ \ \ \}}

{\bf \}}

// End of the CreateQuasmon member function

\section{Appendix C. Nucleon-Antinucleon Annihilation at Rest}

In the CHIPS model any excited hadronic system is considered to be a
quasmon, a bubble containing massless quarks (quark-parton plasma).
Quark-partons of the quasmon are homogeneously distributed over the  
invariant phase space. The quasmon can be considered as a bubble of
the 3-dimensional Feynman-Wilson \cite{Feynman-Wilson}\  parton gas. A
quark fusion mechanism is applied to the successive fragmentation of a
quasmon into hadrons. The model can be considered as a generalization
of the chiral bag model of hadrons \cite{Chiral_Bag}\  in which
any hadron consists of a few quark-partons. Any interaction between
hadrons is modeled as purely kinematical effect of quark exchange
reaction, and any quasmon decay is modeled as a quark fusion
of two quark-partons in the quasmon. 
This approach does not pretend to be a dynamical model. It can be 
considered also as a generalization of the well-known hadronic phase
space distribution \cite{GENBOD}\  approach, because it generates not only
angular and momentum distributions for a given set of hadrons but the
multiplicity distribution for different kinds of hadrons too. In
comparison with other parton models \cite{Parton_Models}\  the CHIPS
model is 3-dimensional.

The invariant phase space distribution as a paradigm of thermalized
chaos is applied to quarks, and simple kinematical mechanisms are used
to model the hadronization of quarks into hadrons. Any quark-parton in
a quasmon has a possibility to pick up another quark-parton from the
same hadronic system (quark fusion mechanism) or exchange with a
quark-parton of the neighboring quasmon (quark exchange
mechanism). The kinematical condition for these mechanisms is that the
secondary hadrons must be produced on their mass shell. In case of
massless quarks the hadronization process can be easily integrated and
modeled. That is why -- for the sake of acceleration of the algorithm
-- we consider u, d, and s quarks to be massless in spite of their
known nonzero mass values. Indirectly the quark mass is taken
into account in the masses of outgoing hadrons. The selection of the
type of the outgoing hadron is performed using combinatorial and
kinematical factors which would allow given hadron to be emitted, 
taking into account conservation laws.  In the present version of CHIPS 
all mesons with 3-digit PDG Monte Carlo codes \cite{CHdetail.PDG} up to 
spin $4$\ and all baryons with 4-digit PDG codes up to spin 
$\frac{7}{2}$\ are implemented. 

The only non-kinematical concept of the model is the hypothesis of
critical temperature of the quasmon, which has its almost 35-year-old 
history, starting with \cite{Hagedorn}.
It is based on the experimental
observation of regularities in the inclusive spectra of hadrons
produced in different reactions at high energies. The concept of
critical temperature is used in the method of calculating the number
of quark-partons in a quasmon. In an infinite thermalized system the
mean energy of partons is $2T$\ per particle, where $T$\ is the
temperature of the system. For the finite system of $N$\ partons with
total center-of-mass energy $M$\ the invariant phase space integral
($\Phi _{N}$) is proportional to $M^{2N-4}$, where according to the
dimensional counting rule $2N$\ comes from
$\prod\limits_{i=1}^{N}\frac{d^{3}p_{i}}{E_{i}}$, and $4$\ comes from
the energy and momentum conservation $\delta ^{4}($\b{P}$-\sum
$\b{p}$_{i})$\ function. On the other hand, at a temperature $T$\ the
statistical density of states is proportional to
$e^{-\frac{M}{T}}$. So the probability to find a system of $N$\ 
quark-partons in a state with mass $M$\ is $dW \propto
M^{2N-4}e^{-\frac{M}{T}}dM$.  For this kind of a probability
distribution the mean value of $M^{2}$\ can be calculated as
\begin{equation}
<M^{2}>=4N(N-1)\cdot T^{2}.  \label{temperature}
\end{equation}

When $N$\ goes to infinity one can obtain for massless particles the
well-known $<M>\equiv \sqrt{<M^{2}>}=2NT$\ result. If a nucleon is
excited, for example by absorbing energy from an incident real or
virtual photon, the number of partons in the newly formed quasmon is
determined by equation (\ref{temperature}). As the number of
quark-partons in the quasmon is set this way, the spectrum of
quark-partons can be calculated using the same $\Phi _{N}\propto
M^{2N-4}$\ relation applied to the residual $N-1$\ quarks. As a
result, the quark-parton spectrum can be calculated as:
\begin{equation}
\frac{dW}{kdk}\propto (M_{N-1})^{2N-6},
\end{equation}
where $M_{N-1}$\ is an effective mass of the residual $N-1$\ 
quark-partons. 
It can be calculated as a function of the total mass $M$:
\begin{equation}
M_{N-1}^{2}=M^{2}-2kM,  \label{m_n-1}
\end{equation}
where $k$\ is the energy of the primary quark-parton in the 
center-of-mass system (CMS) of $N$\ partons. The resulting
equation for the quark-parton spectrum is:
\begin{equation}
\frac{dW}{kdk}\propto (1-\frac{2k}{M})^{N-3}.  \label{spectrum_1}
\end{equation}

In this paper we consider only the quark fusion mechanism of
hadronization, as the quark exchange mechanism can take place only in
nuclear matter when a quasmon has neighboring nucleons. To dissociate
a quasmon into a residual quasmon and an outgoing hadron one needs to
calculate the probability for two quark-partons to have the effective
mass of the outgoing hadron. To do that it is necessary to calculate
the spectrum of the second quark-parton.  The secondary spectrum can
be calculated in the same way as the primary spectrum
(\ref{spectrum_1}) where $N$\ should be substituted by $N-1$. Using
(\ref{m_n-1}) the spectrum can be written in the form
\begin{equation}
\frac{dW}{q dq }\propto \left( 1-\frac{2q }{M\sqrt{1-
\frac{2k}{M}}}\right) ^{N-4},  \label{spectrum_2}
\end{equation}
where $q$\ is the energy of the second quark-parton in the CMS
of $N-1$\ quark-partons.

An additional equation comes from the mass shell condition for the
outgoing hadron:
\begin{equation}
\mu^2 = 2 \frac{k}{\sqrt{1-\frac{2k}{M}}} 
 \cdot q \cdot (1-\cos \theta ),  \label{hadron}
\end{equation}
where $\mu$\ is a mass of the outgoing hadron, and $\theta$\ is the angle
between the momentum directions of the two quark-partons in the CMS 
of $N-1$\ quarks. Now the
kinematical quark fusion probability can be calculated for any primary
quark-parton with energy $k$\ as an integral:
\begin{eqnarray}
P(k,M,\mu )=&&\int \left( 1-\frac{2q }{M\sqrt{1-\frac{2k}{M}}}\right)
^{N-4} \nonumber\\
 && \times\  \delta \left( \mu ^{2}-\frac{2kq (1-\cos \theta )}{\sqrt{1-
\frac{2k}{M}}}\right) q dq d\cos \theta .\ \ \ \ 
\end{eqnarray}
Using the $\delta$-function\footnote{\protect{
If $g(x_0)$=0, $\int f(x)\delta\left[g(x)\right]dx = 
\int \frac{f(x)\delta\left[g(x)\right]}{g^\prime(x)} dg(x) = 
\frac{f(x_0)}{g^\prime(x_0)}$
}}
to perform the integration over $q$\ one gets: 
\begin{eqnarray}
P(k,M,\mu )=&&\int \left( 1-\frac{\mu ^{2}}{Mk(1-\cos \theta )}\right)
^{N-4} \nonumber\\
 && \times\ \left( \frac{\mu ^{2}\sqrt{1-\frac{2k}{M}}}{2k(1-\cos \theta )}
\right)^{2}d\left(\frac{1-\cos \theta }{\mu ^{2}}\right) ,\ \ 
\end{eqnarray}
or 
\begin{eqnarray}
P(k,M,\mu )=&&\frac{M-2k}{4k}\int \left(1-\frac{\mu ^{2}}{Mk(1 - 
\cos\theta)}\right) ^{N-4} \nonumber\\
 && \times\ d\left(1-\frac{\mu ^{2}}{Mk(1-\cos \theta )}\right).
\end{eqnarray}
The maximum value of 
$z=1-\frac{2q }{M_{N-1}}=1-\frac{\mu ^{2}}{Mk(1-\cos \theta )}$\ is 
\begin{equation}
z_{\max }=1-\frac{\mu ^{2}}{2Mk},
\end{equation}
when $\cos \theta =-1$, and the minimum value of $z$ is $0$\ when $\cos\theta
= 1- \frac{\mu ^{2}}{M\cdot k}$. So the range of $\theta$\ is:
$-1<\cos \theta < 1-\frac{\mu ^{2}}{M\cdot k}$. The integrated
kinematical quark fusion probability (in the range from 0 to $z$) is
\begin{equation}
\frac{M-2k}{4k\cdot (N-3)}\cdot z^{N-3}  \label{z_probab}
\end{equation}
and the total kinematical probability of hadronization of the
quark-parton with energy $k$\ to a hadron with mass $\mu$\ is
\begin{equation}
\frac{M-2k}{4k \cdot (N-3)} \cdot z_{\max}^{N-3}. 
                                   \label{tot_kin_probab}
\end{equation}
Equations (\ref{z_probab}) and (\ref{tot_kin_probab}) can be used for
randomization of $z$:
\begin{equation}
z=\sqrt[N-3]{R}\cdot z_{\max },  \label{z_random}
\end{equation}
where R is a random number uniformly distributed in the interval (0,1).

The equation (\ref{tot_kin_probab}) can be used to create a
competition between different hadrons in the hadronization process. In
calculating relative probabilities for different hadrons one can use
only a $z_{\max }^{N-3}$\ term in (\ref{tot_kin_probab}) as the rest is
a constant for all candidates for the outgoing hadron, 
but in addition
it is necessary to take into account the quark content of a candidate $h$
and its spin $s_h$. As a result the relative probability can be
calculated as
\begin{equation}
P_h(k,M,\mu )=(2s_h+1)\cdot z_{\max }^{N-3}\cdot C_{Q}^{h},  
                                         \label{rel_prob}
\end{equation}
where $C_{Q}^{h}$\ is the number of combinations of the quark content
of the particular candidate from the quark content of the
quasmon. We used the following quark wave functions for $\eta$\ 
and $\eta ^{\prime }$\ mesons: $\eta
=\frac{\bar{u}u+\bar{d}d}{2}-\frac{\bar{s}s}{\sqrt{2}}$, $\eta
^{\prime }=\frac{\bar{u}u+\bar{d}d}{2}+\frac{\bar{s}s}{\sqrt{2}}$. No
mixing was assumed for the $\omega $\ and $\phi $\ meson states:
$\omega =\frac{ \bar{u}u+\bar{d}d}{\sqrt{2}}$, $\varphi
=\bar{s}s$. Using these relative probabilities one can randomly
generate the type of the outgoing hadron.

There is one more model restriction to the hadronization process. We
assume that the quark content of the residual quasmon must have 
the quark content of either one or two real hadrons. When
quantum numbers of a quasmon, determined by its quark content, cannot
be represented by quantum numbers of a real hadron, the quasmon is
considered to be a virtual hadron molecule such as $\pi ^{+}\pi ^{+}$\ 
or $K^{+}\pi ^{+}$, in which case it is defined in the CHIPS model 
as the Chipolino pseudo-particle.

To fuse quark-partons and create the decay of the quasmon into the
selected hadron and a residual quasmon, one needs to randomly generate
the residual quasmon mass $m$, which in fact is the mass of the
residual $N-2$ quarks. Using an equation similar to (\ref{m_n-1}) one
finds that
\begin{equation}
m^{2}=z\cdot (M^{2}-2kM).  \label{m(z)}
\end{equation}
Now using equation (\ref{z_random}), the mass value of the residual 
quasmon can be randomized as 
\begin{equation}
m^{2}=(M-2k)\cdot (M-\frac{\mu ^{2}}{2k})\cdot \sqrt[N-3]{R}.
\label{res_quasmon}
\end{equation}
Thus, the final state hadron at this step is generated as a product of
the two-particle decay of the initial quasmon into the hadron and the
residual quasmon with the generated mass value.

This iterative hadronization process continues while the residual
quasmon mass remains greater than $m_{\min }$, where the definition of
$m_{\min }$\ depends on the type of quasmon (hadron-type, or
Chipolino-type). For the hadron-type residual quasmon
\begin{equation}
 m_{\min }=m_{\min }^{QC}+m_{\pi ^{0}},  \label{m_min}
\end{equation}
where $m_{\min }^{QC}$\ is the minimum hadron mass for the residual
quark content (QC). For the Chipolino-type residual quasmon consisting
of hadrons $h_1$\ and $h_2$\ 
\begin{equation}
 m_{\min }=m_{h_1}+m_{h_2}. \label{m_min_chipolino}
\end{equation}
These conditions assure that the quasmon in the iterative process 
has always enough energy to decay into at least two final state
hadrons, conserving four-momentum and charge.

If the remaining CMS energy of the residual quasmon falls below
$m_{\min}$, then the hadronization process finishes by a final
two-particle decay.  If the parent quasmon is a Chipolino consisting
of hadrons $h_1$\ and $h_2$, then a binary decay of the parent quasmon
into $m_{h_1}$\ and $m_{h_2}$\ takes place.  If the parent quasmon is
not a Chipolino then the decay into $m_{\min}^{QC}$\ and $m_h$\ takes
place. The decay into $m_{\min}^{QC}$\ and $m_\pi^0$\ is
always possible in this case because of condition (\ref{m_min}).

If the residual quasmon is not Chipolino-type, and $m>m_{\min}$, the
hadronization loop can still be finished by the resonance production
mechanism, modeled following the concept of parton - hadron duality
\cite{Duality}.  If the residual quasmon mass
value $m$\ is in the vicinity of some resonance with the same quark
content (e.g. $\rho$\ or $K^{\ast }$), there is a probability for the
residual quasmon to convert to this resonance.\footnote{For the
comparison of the quark contents, the quark content of the quasmon is
reduced by canceling of the quark-antiquark pairs of the same flavor.}
In the present version of the CHIPS event generator the probability to
convert to the resonance is calculated as
\begin{equation}
P_{\rm{res}}=\frac{m_{\min }^{2}}{m^{2}}.  \label{res_probab}
\end{equation}
With this probability the resonance with the squared mass value
$m_{r}^{2}$\ closest to $m^{2}$\ is selected, and the binary decay of
the quasmon into $m_{h}$\ and $m_{r}$\ takes place.

In the future when experimental data will be more detailed one can
take into account angular momentum conservation, and also C-, P- and
G-parity conservation. In the present version of the CHIPS event
generator, $\eta $\ and $\eta ^{\prime }$\ are suppressed by a factor
$0.3$. The factor was tuned for the experiments on antiproton
annihilation at rest in liquid hydrogen and can be different for other
hadronic reactions. One can vary it when describing other reactions.

In addition to this parameter we had two more parameters. One of them
is the suppression of heavy quark production (the so-called $s/u$\ 
parameter) \cite{JETSET}. For the proton-antiproton annihilation at rest 
the strange quark-antiquark sea was found to be suppressed by the
factor $s/u = 0.1$.  It
is less than $s/u = 0.3$, which is used as a default in the JETSET
\cite{JETSET} event generator. It can be because quarks and
anti-quarks of colliding hadrons are forming an initial non-strange
sea, and the strange sea is suppressed by the OZI rule
\cite{OZI}. This is a complicated question which is still being
discussed by theorists \cite{OZI_violation} and demands further
experimental measurements. The $s/u$\ parameter can be different for
other reactions. In particular, for the e$^{+}$e$^{-}$\ reactions it can
be closer to 0.3.

The temperature parameter $T$\ has been fixed at $T=180$\ MeV. In
earlier versions of the model we have found that using such a value we
could successfully reproduce spectra of outgoing hadrons in different
types of medium-energy reactions.

\begin{figure}
  \resizebox{1.00\textwidth}{!}
{
   \includegraphics{mommul.eps}
}
\caption{Left figure (a): momentum distribution of charged pions
produced in proton-antiproton annihilation at rest. Points with
errors: experiment \protect\cite{pispectrum}, histogram: CHIPS MC. The
experimental spectrum is normalized to the measured average charged pion
multiplicity 3.0. Right figure (b): pion multiplicity
distribution. Points are taken from compilations of experimental data
\protect\cite{pap_exdata}, histogram: CHIPS MC. The number of events 
with kaons in the final state is shown in the bin corresponding to the pion
multiplicity 9, where no real 9-pion events are generated or observed
experimentally. The percentage of annihilation events with kaons in
the model is close to the cited experimental value of 6\% \cite{pap_exdata}.
}
\label{mommul}
\end{figure}
\begin{figure}
  \resizebox{1.00\textwidth}{!}
{
   \includegraphics{channels.eps}
}
\caption{Branching probabilities for different channels in
proton-antiproton annihilation at rest. Points with errors: experiment
\protect\cite {pap_exdata}, histogram: CHIPS MC. }
\label{channels}
\end{figure}

We used these parameters to fit not only the spectrum of pions
(Fig.~\ref{mommul},a) and the multiplicity distribution for pions
(Fig.~\ref{mommul},b) but also branching ratios of various measured
\cite{pap_exdata,pispectrum}\  exclusive channels (Figs.
~\ref{channels},~\ref{threechan},~\ref{twochan}).  In
Fig.~\ref{twochan} one can see many decay channels with higher meson
resonances. The relative contribution of the events with meson
resonances produced in the final state is 30 - 40 percent, roughly in
agreement with experiment. The agreement between the model and
experiment for particular decay modes is within a factor of 2-3 except for
the branching ratios to higher resonances, for which it is not
completely clear what is the definition of a resonance in a concrete
experiment.  In particular, for the $a_{2}\omega $\ channel the mass sum
of final hadrons is 2100 MeV with a full width of about 110 MeV while
the total initial energy of the p\={p} annihilation reaction is only
1876.5 MeV. This decay channel can be formally simulated by an event
generator using the tail of the Breit-Wigner distribution for the
$a_{2}$\ resonance, but it is difficult to imagine how the $a_{2}$\ 
resonance can be identified $2\Gamma $\ away from its mean mass value
experimentally. 

To model fragmentation into baryons the POPCORN idea \cite{POPCORN}, 
which assumes the existence of diquark-partons, was used. This
assumption of massless diquarks is somewhat inconsistent at low
energies, as is the assumption of massless s-quarks, but it is simple
and it helps to generate baryons the same way as mesons.

Baryons are heavy, and the baryon production in p\={p} annihilation
reactions at medium energies is very sensitive to the value of
temperature. If the temperature is low, the baryon yield is small, and
the mean multiplicity of pions increases very noticeably with CMS energy
(Fig.~\ref{apcmul}).  For higher temperature values the baryon yield
reduces the pion multiplicity at higher energies.  The existing
experimental data \cite{Energy_Dep}\ (Fig.~\ref{apcmul}) can be
considered as a kind of ``thermometer'' for the model. This
``thermometer'' confirms the critical temperature value of about 200
MeV.

\begin{figure}
  \resizebox{1.00\textwidth}{!}
{
   \includegraphics{threechn.eps}
}
\caption{Branching probabilities for different channels with
three-particle final states in proton-antiproton annihilation at
rest. Points with errors: experiment \protect\cite{pap_exdata},
histogram: CHIPS MC. }
\label{threechan}
\end{figure}
\begin{figure}
  \resizebox{1.00\textwidth}{!}
{
   \includegraphics{twochn.eps}
}
\caption{Branching probabilities for different channels with
two-particle final states in proton-antiproton annihilation at
rest. Points with errors: experiment \protect\cite{pap_exdata},
histogram: CHIPS MC. }
\label{twochan}
\end{figure}
\begin{figure}
  \resizebox{1.00\textwidth}{!}
{
   \includegraphics{apcmul.eps}
}
\caption{Average meson multiplicities in proton-antiproton and in
electron-positron annihilation, as a function of the CMS energy of the
interacting hadronic system. Points with errors: experiment
\protect\cite {Energy_Dep}, lines: CHIPS MC calculation at different
values of the critical temperature parameter $T$. }
\label{apcmul}
\end{figure}


The CHIPS model presented is an attempt to use the set of simple rules
governing microscopic quark-level behavior to model macroscopic
hadronic systems with a large number of degrees of freedom. Apart from
the natural rules of conservation of quantum numbers and relativistic
kinematics, the hypothesis of {\em{quark fusion}} and the hypothesis
of a {\em{critical temperature}} are implemented.

The {\em{quark fusion}} hypothesis determines the rules of production
of the final state hadrons, with energy spectra reflecting the
momentum distribution of quarks in the system.

Qualitatively, the hypothesis of a {\em{critical temperature}} assumes
that the quark-gluon hadronic system (quasmon) 
cannot be heated above a certain temperature. Adding
more energy to the hadronic system increases the number of constituent
quark-partons, keeping the temperature constant. The critical
temperature $T=180-200$ MeV is the principal parameter of the model.


In this paper we have shown that such an approach, in combination with
reasonable model assumptions on the mechanism of final state quasmon
conversion into hadron resonances, 
may be used successfully to model hadron multiplicities
and spectra in multifragmentation processes of nucleon-antinucleon
annihilation.

The essential part of the model is that it can be only implemented in
full in the form of a computer code -- Monte Carlo event generator.It
can be used as a tool for the Monte Carlo simulation of a wide
spectrum of hadronic reactions.
The CHIPS event generator can be used not only for the
``phase-space background'' calculations in place of the standard
GENBOD routine \cite{GENBOD}\ but even for taking into account the
reflection of resonances in connected final hadron combinations. Thus
it can be useful for the physics analysis too, while the main range of
its application is the simulation of the evolution of hadronic and
electromagnetic showers in matter at medium energies.

\section{Appendix D. Nuclear pion capture at rest and photonuclear
   reactions below the $\Delta$(3,3) resonance}


The CHIPS computer code is a quark-level three-dimensional event generator 
for the fragmentation of hadronic systems into hadrons. An important
feature of the model is a homogeneous distribution of asymptotically
free quark-partons over the invariant phase space, applied to the
fragmentation of different types of excited hadronic systems
including nucleon excitations, hadronic systems produced in
$e^{+}e^{-}$ interactions, high energy nuclear excitations,
etc.. Exclusive event generation which models multiple hadron
production conserving energy, momentum, and charge generally results
in a good description of particle multiplicities and spectra in
multihadron fragmentation processes. All this makes it possible to use
the CHIPS event generator in exclusive modeling of hadron cascades in
materials.

When compared with the first ``in vacuum'' version of the model,
described in  Appendix C, modeling of hadronic fragmentation
in nuclear matter is more complicated, because of the much greater number
of possible secondary fragments, but the hadronization process itself
is simpler in a certain way.  In vacuum, the quark-fusion mechanism 
requires a quark-parton partner from the external (as in
JETSET \cite{JETSET}) or internal (Quasmon itself in Appendix C)
quark-antiquark sea. In nuclear matter, there is
a second possibility: quark exchange with the neighboring hadronic
system, a nucleon or nuclear multinucleon cluster. Thus in nuclear
matter the spectra of secondary hadrons and nuclear fragments may be
considered as a reflection of the quark-parton energy spectrum in a Quasmon. In
the case of inclusive spectra that are steeply decreasing with energy, and
correspondingly steeply decreasing spectra of the quark-partons in a
Quasmon, only those secondary hadrons which get the maximum energy 
from the primary quark-parton with energy $k$ are contributing to the inclusive
spectra. This extreme situation requires the exchanged quark-parton
with energy $q$, coming back to the Quasmon from the cluster, to move in
the opposite direction with respect to the primary quark-parton. As a
result the hadronization quark exchange process becomes
one-dimensional along the direction of $k$.  If a neighboring nucleon
or nuclear cluster with bound mass $\tilde{\mu}$ absorbs the primary
quark-parton and radiates the exchanged quark-parton in the opposite
direction, then the energy of the outgoing fragment is $E=\tilde{\mu}+k-q$,
and the momentum is $p=k+q$. Both energy and momentum of the outgoing
nuclear fragment are known (as well as the mass $\tilde{\mu}$\ of the nuclear
fragment in nuclear matter), so the momentum of the primary quark-parton
can be reconstructed using the approximate relation
\begin{equation}
k=\frac{p+E-B\cdot m_{N}}{2},  \label{k}
\end{equation}
where $B$\ is the baryon number of the outgoing fragment
($\tilde{\mu}\approx B\cdot m_{N}$, and $m_{N}$\ is the nucleon
mass). 
In \cite{K_parameter}\ it was shown that the invariant
inclusive spectra of pions, protons, deuterons, and tritons in
proton-nucleus reactions at 400~GeV \cite{FNAL}\ have not only the same
exponential slope but almost coincide when they are plotted as a
function of $k=\frac{p+E_{\rm{kin}}}{2}$.  Using data at 10~GeV 
\cite{FAS}, it was shown that the parameter $k$\ defined by
equation~(\ref{k}) is appropriate also for the description of secondary
antiprotons produced in high energy nuclear reactions. This means that
the extreme assumption of one-dimensional hadronization is a good
approximation, not only for the quark exchange mechanism but for the
quark fusion mechanism as well. In the one-dimensional case, assuming
that $q$\ is the momentum of the second quark fusing with the primary
quark-parton with energy $k$, the total energy of the outgoing hadron
is $E=q+k$\ and the momentum is $p=k-q$.  In the one-dimensional case the
secondary quark-parton must move in the opposite direction with
respect to the primary quark-parton; otherwise the mass of the outgoing
hadron would be zero.  So we get for mesons $k=\frac{p+E}{2}$, in
accordance with equation~(\ref{k}). In the case of antiproton radiation, the
baryon number of the Quasmon is increased by one, and the primary
antiquark-parton will spend its energy to build up the mass of the
antiproton by picking up an anti-diquark. Thus, the energy conservation law
for antiproton radiation looks like $E+m_{N}=q+k$\ and hence
$k=\frac{p+E+m_{N}}{2}$, which is again in accordance with
equation~(\ref{k}).

This one-dimensional quark exchange mechanism was proposed in 1984
\cite{K_parameter}.  Even in its approximate form it was useful in the
analysis of inclusive spectra of hadrons and nuclear fragments in
hadron-nuclear reactions at high energies. Later the same approach was
used in the analysis of nuclear fragmentation in electro-nuclear
reactions \cite{TPC}. Also in 1984 the quark-exchange
mechanism developed in the framework of the non-relativistic quark model
was found to be important for the explanation of the short distance
features of $NN$\ interactions \cite{NN QEX}. Later it was
successfully applied to the $K^{-}p$\ interactions \cite{Kp QUEX}. The
idea of the quark exchange mechanism between nucleons was useful even
for the explanation of the EMC effect \cite{EMC}. For the non-relativistic
quark model, the quark exchange technique was developed as an 
alternative to the Feynman diagram technique at short distances
\cite{QUEX}.

The CHIPS event generator models quark exchange processes, taking into
account kinematical and combinatorial factors for asymptotically free
quark-partons. The naive picture of the quark-exchange mechanism is
tunneling of quark-partons from the asymptotically free region of one
hadron to the asymptotically free region of another hadron. To
conserve color, another quark-parton from the neighboring hadron must
replace the first quark-parton in the Quasmon. It makes the tunneling
mutual, and the process has to be quark exchange.

The experimental data available on multihadron production
at high energies show regularities in the secondary
particle spectra that can be related to the simple kinematical,
combinatorial, and phase space rules of such quark exchange and fusion
mechanisms. The CHIPS model combines these mechanisms
consistently in the form of a computational algorithm and an event
generator.

\begin{figure}[tbp]
\resizebox{1.00\textwidth}{!}
{
   \includegraphics{diagram.eps}
}
\caption{Diagram of quark exchange mechanism. }
\label{diagram}
\end{figure}

Figure~\ref{diagram} shows the quark exchange diagram which
helps to keep track of the kinematics of the quark-exchange process.
It was shown in Appendix C, that a Quasmon (Q in
Fig.~\ref{diagram}) is kinematically determined by a few
asymptotically free quark-partons homogeneously distributed over
the invariant phase space. The Quasmon mass $M$\ is related to the number
of quark-partons $N$ through
\begin{equation}
<M^{2}>=4N(N-1)\cdot T^{2},  \label{temperatureII}
\end{equation}
where $T$ is the temperature of the system.

The spectrum of quark partons can be calculated as
\begin{equation}
\frac{dW}{k^{\ast }dk^{\ast}}\propto 
 \left(1-\frac{2k^{\ast}}{M} \right)^{N-3},  \label{spectrum_1II}
\end{equation}
where $k^{\ast}$\ is the energy of the primary quark-parton in the 
center-of-mass system (CMS) of the Quasmon. After the primary quark-parton is
randomized and the neighboring cluster (parent cluster -- PC in
Fig.~\ref{diagram}) with the bound mass $\tilde{\mu}$\ is selected, the
quark exchange process starts. To follow the process kinematically one
should imagine a colored compound system consisting of the bound
parent cluster and the primary quark with energy $k$\ in the
laboratory system (LS)
\begin{equation}
k=k^{\ast }\cdot \frac{E_{N}+p_{N}\cdot \cos (\theta _{k})}{M_{N}},
\end{equation}
where $M_{N}$, $E_{N}$\ and $p_{N}$\ are mass, energy, and momentum of
the Quasmon in the LS. The mass of the compound system 
(CF in Fig.~\ref{diagram}) is
$\mu _{c}=\sqrt{(\tilde{\mu}+k)^{2}}$, where $\tilde{\mu}$\ and $k$\
are corresponding four-vectors. This colored compound system decays into a
free outgoing nuclear fragment with mass $\mu$\ (F in
Fig.~\ref{diagram}) and the recoiling quark with energy $q$\ (in CMS of
$\tilde{\mu}$, which coincides with LC in the present version of the
model, as no internal motion of clusters is considered). At this point
one should recall that a colored residual Quasmon with mass
$M_{N-1}$\ (CRQ in Fig.~\ref{diagram}) is left after radiation of
$k$. The last action is to fuse the CRQ and the recoil quark $q$. The
resulting residual quasmon (RQ in Fig.~\ref{diagram}) should have its
minimum mass higher than $M_{\min}$, which is determined by the
minimum mass of a hadron (or Chipolino, double-hadron as defined in
Appendix C) with the same quark content. All
quark-antiquark pairs with the same flavor should be canceled in the
minimum mass calculations. In CMS of $\mu_{c}$\ this restriction can
be written as
\begin{equation}
2q\cdot (E-p\cdot \cos \theta_{qCQ})+M_{N-1}^{2}>M_{\min }^{2},
\label{min_mass}
\end{equation}
where $E$ is the energy and $p$\ is the momentum of the colored residual
Quasmon with mass $M_{N-1}$\ in CMS of $\mu _{c}$. Then the
restriction for $\cos\theta_{qCQ}$\ is
\begin{equation}
\cos \theta _{qCQ}<\frac{2qE-M_{\min }^{2}+M_{N-1}^{2}}{2qp}.
\label{cost_restriction}
\end{equation}
It implies that 
\begin{equation}
q>\frac{M_{N-1}^{2}-M_{\min }^{2}}{2\cdot (E+p)}.  \label{resid_rest}
\end{equation}

A second restriction comes from the nuclear Coulomb barrier for charged
particles. We calculate the Coulomb barrier in a simple form:
\begin{equation}
E_{CB}=\frac{Z_{F}\cdot
Z_{R}}{A_{F}^{\frac{1}{3}}+A_{R}^{\frac{1}{3}}}\ (\rm{MeV}),
\label{CoulBar}
\end{equation}
where $Z_{F}$\ and $A_{F}$\ are charge and atomic weight of the
fragment, and $Z_{R}$\ and $A_{R}$\ are charge and atomic weight of the
residual nucleus. The obvious restriction is
\begin{equation}
   q<k+\tilde{\mu}-\mu -E_{CB}.  \label{cb_rest}
\end{equation}

The restrictions (\ref{resid_rest})\ and (\ref{cb_rest})\ are
complementary to the restrictions from the quark exchange mechanism
which should be calculated. The spectrum of recoiling quarks is similar
to the $k^{\ast}$\ spectrum in Quasmon (\ref{spectrum_1II}):
\begin{equation}
  \frac{dW}{q\ dq\ d\cos \theta }\propto 
  \left(1-\frac{2q}{\tilde{\mu}}\right)^{n-3}, \label{spectrum_2II}
\end{equation}
where $n$\ is the number of quark-partons in the nuclear cluster.  We
consider it to be equal to $3 A_{C}$, where $A_{C}$\ is the atomic
weight of the parent cluster. Tunneling of quarks from one nucleon to
another makes the phase space common for all quark-partons of the
cluster.

An additional equation follows from the mass shell condition for the
outgoing fragment,
\begin{equation}
\mu ^{2}=\tilde{\mu}^{2}+2\tilde{\mu}\cdot k-2\tilde{\mu}\cdot q-2k\cdot
q\cdot (1-\cos \theta _{kq}),  \label{hadronII}
\end{equation}
where $\theta _{kq}$ is the angle between quark-partons in LS. From this
equation $q$ can be calculated as 
\begin{equation}
q=\frac{\tilde{\mu}\cdot (k-\Delta )}{\tilde{\mu}+k\cdot 
(1-\cos \mathit{\theta }_{\mathit{kq}})},  \label{q-cos}
\end{equation}
where $\Delta $ is the covariant binding energy of the cluster 
$\Delta =\frac{\mu ^{2}-\tilde{\mu}^{2}}{2\tilde{\mu}}$. 
The quark exchange probability integral can be written in the form: 
\begin{eqnarray}
&&P(k,\tilde{\mu},\mu )=  \nonumber \\
&&\int \delta \left[ \mu ^{2}-\tilde{\mu}^{2}-2\tilde{\mu}\cdot k+2\tilde{\mu
}\cdot q+2k\cdot {q}\cdot (1-\cos \theta _{kq})\right]   \nonumber \\
&&\ \ \ \ \ \ \ \ \times \ \left( 1-\frac{2{q}}{\tilde{\mu}}\right) ^{n-3}{q}
d{q\cdot }d\cos \theta _{kq}.
\end{eqnarray}
Using the $\delta$-function to make the integration over ${q}$\ one 
gets: 
\begin{eqnarray}
P(k,\tilde{\mu},\mu ) &=&\int \left( 1-\frac{2(k-\Delta )}{\tilde{\mu}
+k(1-\cos \theta _{\mathit{kq}})}\right) ^{n-3}  \nonumber \\
&&\times \ \frac{\tilde{\mu}(k-\Delta )}{2[\tilde{\mu}+k(1-\cos \mathit{
\theta }_{\mathit{kq}})]^{2}}d\mathit{\cos \theta }_{\mathit{kq}}
\end{eqnarray}
or 
\begin{eqnarray}
P(k,\tilde{\mu},\mu ) &=&\int \left( 1-\frac{2(k-\Delta )}{\tilde{\mu}
+k(1-\cos \theta _{\mathit{kq}})}\right) ^{n-3}  \nonumber \\
&&\times \ \left( \frac{\tilde{\mu}(k-\Delta )}{\tilde{\mu}+k(1-\cos 
\mathit{\theta }_{\mathit{kq}})}\right) ^{2}  \nonumber \\
&&\times \ d \left( \frac{\tilde{\mu}+k(1-\cos 
\mathit{\theta }_{\mathit{kq}})}{\tilde{\mu}(k-\Delta )}\right).
\end{eqnarray}
The result of the integration is 
\begin{eqnarray}
&&P(k,\tilde{\mu},\mu )=\frac{\tilde{\mu}}{4k(n-2)}  \nonumber \\
&&\times \ \left[ \left( 1-\frac{2(k-\Delta )}{\tilde{\mu}+2k}\right)
_{\rm{high}}^{n-2}-\left( 1-\frac{2(k-\Delta )}{\tilde{\mu}}\right)
_{\rm{low}}^{n-2}%
\right] .  \label{QUEX_Int}
\end{eqnarray}
For randomization it is convenient to make $z$ a random parameter 
\begin{equation}
z=1-\frac{2(k-\Delta )}{\tilde{\mu}+k(1-\cos 
\theta_{\mathit{kq}})}=1-\frac{2{q}}{\tilde{\mu}}.  \label{z(q)}
\end{equation}
From (\ref{QUEX_Int}) one can find the high and the low limits of the
randomization. The first limit is a limit for $k$: $k>\Delta$. It is
similar to the restriction for Quasmon fragmentation in vacuum:
$k^{\ast}>\frac{\mu^{2}}{2M}$. The second limit is
$k=\frac{\mu^{2}}{2\tilde{\mu}}$, when the low limit of randomization
becomes equal to zero. If $k<\frac{\mu^{2}}{2\tilde{\mu}}$, then
$-1<\cos\theta_{kq}<1$\ and
$z_{\rm{low}}=1-\frac{2(k-\Delta)}{\tilde{\mu}}$. If
$k>\frac{\mu^{2}}{2\tilde{\mu}}$, then the range of $\cos\theta
_{kq}$\ is $-1<\cos\theta_{kq}<\frac{\mu^{2}}{k\tilde{\mu}}-1$\ and
$z_{\rm{low}}=0$.  This value of $z_{\rm{low}}$\ should be corrected
using the Coulomb barrier restriction (\ref{cb_rest}), and the value of
$z_{\rm{high}}$ should be corrected using the minimum residual Quasmon
restriction (\ref{resid_rest}). In the case of a Quasmon with momentum much
less than $k$ it is possible to impose tighter restrictions than
(\ref{resid_rest}) because the direction of motion of the CRQ is
opposite to $k$. So
$\cos\theta_{qCQ}=-\cos\mathit{\theta}_{\mathit{kq}}$, and from
(\ref{q-cos}) one can find that
\begin{equation}
\cos \theta_{qCQ} =1-\frac{\tilde{\mu}\cdot (k-\Delta -q)}{k\cdot q}.
\label{cos_q}
\end{equation}
So in this case the equation (\ref{resid_rest})\ can be replaced by
the more stringent one: 
\begin{equation}
q>\frac{M_{N-1}^{2}-M_{\min }^{2}+2\frac{p\cdot 
\tilde{\mu}}{k}(k-\Delta )}{2\cdot (E+p+\frac{p\cdot \tilde{\mu}}{k})}.
\end{equation}

The integrated kinematical quark exchange probability (in the range
from $z_{\rm{low}}$ to $z_{\rm{high}}$) is 
\begin{equation}
\frac{\tilde{\mu}}{4k(n-2)}\cdot z^{n-2},  \label{z_probabII}
\end{equation}
and the total kinematical probability of hadronization of the quark-parton
with energy $k$ into a nuclear fragment with mass\ $\mu $ is 
\begin{equation}
\frac{\tilde{\mu}}{4k(n-2)}\cdot 
\left( z_{\rm{high}}^{n-2}-z_{\rm{low}}^{n-2}\right).
\label{tot_kin_probabII}
\end{equation}
This can be compared with the vacuum probability of the quark fusion mechanism 
from Appendix C: 
\begin{equation}
\frac{M-2k}{4k(N-3)}z_{\max }^{N-3}.
\end{equation}
The similarity is very important, as the absolute probabilities
define the competition between vacuum and nuclear channels.

Equations (\ref{z_probabII})\ and (\ref{tot_kin_probabII})\ can be used for
randomization of $z$: 
\begin{equation}
z=z_{\rm{low}}+\sqrt[n-2]{R}\cdot (z_{\rm{high}}-z_{\rm{low}}), 
 \label{z_randomII}
\end{equation}
where $R$\ is a random number, uniformly distributed in the interval (0,1).

Equation (\ref{tot_kin_probabII})\ can be used to control the competition
between different nuclear fragments and hadrons in the hadronization
process, but in contrast to the case of ``in vacuum'' hadronization 
it is not enough to
take into account only quark combinatorics of the Quasmon and the outgoing
hadron. In the case of hadronization in nuclear matter, different parent bound
clusters should be taken into account as well. For example, 
tritium can be radiated as a
result of quark exchange with a bound tritium cluster or as a result of
quark exchange with a bound $^3$He cluster.

To calculate the yield of fragments it is necessary to calculate the
probability to find a cluster with certain proton and neutron content
in a nucleus. One could consider any particular probability as an
independent parameter, but in such a case the process of tuning the model
would be difficult. We proposed the following scenario of
clusterization. A gas of quasi-free nucleons is close to the phase
transition to a liquid phase bound by strong quark exchange
forces. Precursors of the liquid phase are nuclear clusters, which may
be considered as ``drops'' of the liquid phase within the nucleus. Any
cluster can meet another nucleon and absorb it (making it bigger),
or it can release one of the nucleons (making it smaller).  The
first parameter $\varepsilon_{1}$\ is the percentage of quasi-free
nucleons not involved in the clusterization process. The rest of the
nucleons ($1-\varepsilon_{1}$) clusterize. 
We assume that since on the periphery of the nucleus the density 
is lower, one can consider only dibaryon clusters, and neglect 
triple-baryon clusters.
Still we denote the number of nucleons
clusterized in dibaryons on the periphery by the parameter
$\varepsilon_{2}$.  In the dense part of the nucleus, strong quark
exchange forces make clusters out of quasi-free nucleons with high
probability.  To characterize the distribution of clusters the parameter
$\omega$\ of clusterization probability was used.

If the number of nucleons involved in clusterization is
$a=(1-\varepsilon_{1}-\varepsilon _{2})\cdot A$, then the probability
to find a cluster consisting of $\nu$\ nucleons is defined by the 
distribution 
\begin{equation}
P_{\nu }\propto C_{\nu }^{a}\cdot \omega ^{\nu -1},
\end{equation}
where $C_{\nu }^{a}$ is the corresponding binomial coefficient. 
The coefficient of proportionality can be found from the equation 
\begin{equation}
a=b\cdot \sum\limits_{\nu =1}^{a}\nu \cdot C_{\nu }^{a}\cdot \omega ^{\nu
-1}=b\cdot a\cdot (1+\omega )^{a-1}.
\end{equation}
Thus, the number of clusters consisting of $\nu$\ nucleons is 
\begin{equation}
P_{\nu }=\frac{C_{\nu }^{a}\cdot \omega ^{\nu -1}}{(1+\omega )^{a-1}}.
\end{equation}
For clusters with an even number of nucleons we used only isotopically
symmetric configurations ($\nu=2n$, $n$\ protons and $n$\ neutrons) and
for odd clusters ($\nu =2n+1$) we used only two configurations: $n$\
neutrons with $n+1$\ protons and $n+1$\ neutrons with $n$\
protons. This restriction, which we call ``isotopic focusing'', 
can be considered as an empirical rule of the CHIPS model
which helps to describe data. It is applied in the case of nuclear
clusterization (isotopically symmetric clusters) and in the case of
hadronization in nuclear matter.  In the hadronization process the
Quasmon is shifted from isotopic symmetric state (e.g., by capturing
a negative pion) and transfers excessive charge to the outgoing nuclear
cluster. This tendency is symmetric with respect to the Quasmon and
the parent cluster.

The temperature parameter used to calculate the number of
quark-partons in a Quasmon (see equation~\ref{temperatureII}) was chosen 
to be $T=180$ MeV, which is the same as in Appendix C.

The CHIPS model is mostly a model of fragmentation conserving
energy, momentum, and charge. But to compare it with experimental data
one needs to model also the first interaction of the projectile with the
nucleus.  For proton-antiproton annihilation this was easy, as we
assumed that in the interaction at rest, a proton and antiproton always
create a Quasmon. In the case of pion capture the pion can be captured by
different clusters. We assumed that the probability of capture is
proportional to the number of nucleons in a cluster.  After the
capture the Quasmon is formed, and the CHIPS generator produces
fragments consecutively and recursively, choosing at each step the
quark-parton four-momentum $k$, the type of parent and outgoing fragment,
and the four-momentum of the exchange quark-parton $q$, to produce
a final state hadron and the new Quasmon with less energy.

In the CHIPS model we consider this process as a chaotic process
with large number of degrees of freedom and do not take into account
any final state interactions of outgoing hadrons. Nevertheless, when
the excitation energy dissipates, and in some step the Quasmon mass
drops below mass shell, the quark-parton mechanism of hadronization
fails. To model the event exclusively, it becomes necessary to
continue fragmentation at the hadron level. Such fragmentation process
is known as nuclear evaporation. It is modeled using the
non-relativistic phase space approach.  In the non-relativistic case the
phase space of nucleons can be integrated as well as in the
ultra-relativistic case of quark-partons.

The general formula for the non-relativistic phase space can be found starting
with the phase space for two particles $\tilde{\Phi}_{2}$. It is
proportional to the CMS momentum:
\begin{equation}
\tilde{\Phi}_2(W_2) \propto \sqrt{W_2},  \label{F2}
\end{equation}
where $W_2$\ is a total kinetic energy of the two non-relativistic
particles.  If the phase space integral is known for $n-1$\ hadrons
then it is possible to calculate the phase space integral for $n$\
hadrons:
\begin{eqnarray}
\tilde{\Phi}_{n}(W_n) &=&\int \tilde{\Phi}_{n-1}(W_{n-1}) \cdot
\delta (W_{n}-W_{n-1}-E_{\rm{kin}})  \nonumber \\
&&\times \sqrt{E_{\rm{kin}}}dE_{\rm{kin}} dW_{n-1}.  \label{Fn} 
\end{eqnarray}
Using (\ref{F2})\ and (\ref{Fn})\ one can find that 
\begin{equation}
\tilde{\Phi}_{n}(W_n)\propto W_{n}^{\frac{3}{2}n-\frac{5}{2}}
\end{equation}
and the spectrum of hadrons, defined by the phase space of residual
$n-1$ nucleons, can be written as 
\begin{equation}
\frac{dN}{\sqrt{E_{\rm{kin}}}dE_{\rm{kin}}} \propto 
\left(1-\frac{E_{\rm{kin}}}{W_{n}}\right)^{\frac{3}{2}n-4}.
\label{evap_spectr}
\end{equation}
This spectrum can be randomized. The only problem is from which level one
should measure the thermal kinetic energy when most nucleons in nuclei
are filling nuclear levels with zero temperature. To model the evaporation
process we used this unknown level as a parameter $U$\ of the evaporation
process. Comparison with experimental data gives $U=1.7$ MeV. Thus, the
total kinetic energy of $A$\ nucleons is 
\begin{equation}
W_{A}=U\cdot A+E_{\rm{ex}},
\end{equation}
where $E_{\rm{ex}}$ is the excitation energy of the nucleus.

To\  be\  radiated,\ \  the nucleon\ \  should\ \  overcome\ \  the threshold 
\begin{equation}
U_{\rm{thresh}}=U+U_{\rm{bind}}+E_{CB},
\end{equation}
where $U_{\rm{bind}}$\ is a separation energy of the nucleon, and
$E_{CB}$\ is the Coulomb barrier energy which is non-zero only for
positive particles and can be calculated using formula
(\ref{CoulBar}).

Among several experimental investigations of nuclear
pion capture at rest we have selected four published results which
constitute, in our opinion, a representative data set covering a wide
range of target nuclei, types of produced hadrons and nuclei
fragments, and their energy range. In the first publication
\cite{MIPHI}\ the spectra of charged fragments (protons, deuterons,
tritium, $^{3}$He, $^{4}$He) in pion capture were measured on
17 nuclei within one experimental setup. To verify the spectra we
compared them for a carbon target with detailed measurements of the
spectra of charged fragments given in Ref.~\cite{Mechtersheimer}. In
addition, we took $^{6}$Li spectra for a carbon
target from the same paper.

The neutron spectra were added from Ref.~\cite{Cernigoi} and
Ref.~\cite{Madey}. We present data and Monte Carlo distributions as 
the invariant phase space function
$f=\frac{d\sigma}{pdE}$\ depending on the variable
$k=\frac{p+E_{\rm{kin}}}{2}$\ as defined in equation~(\ref{k}).

Spectra on $^{9}$Be, $^{12}$C, $^{28}$Si ($^{27}$Al for secondary
neutrons), $^{59}$Co ($^{64}$Cu for secondary neutrons), and
$^{181}$Ta\ are shown in Figures~\ref{be0405}\ through~\ref{ta73108}.
The data are described well, including the total energy spent in the
reaction to yield the particular type of fragments.

The evaporation process for nucleons is described well, too.  It is
exponential in $k$, and looks especially impressive for Si/Al and
Co/Cu data, where the Coulomb barrier is low, and one can see proton
evaporation as a continuation of the evaporation spectra from
secondary neutrons. This way the exponential behavior of the
evaporation process can be followed over 3 orders of
magnitude. Clearly seen is\ the\ transition region at\ \ $k \approx
90$\ MeV\ \ (kinetic energy $15-20$\ MeV)\ \ between the quark-level
hadronization process and the hadron-level evaporation process. For
light target nuclei the evaporation process becomes much less
prominent.

The $^{6}$Li spectrum on a carbon target exhibits an interesting regularity
when plotted as a function of $k$: it practically coincides with the
spectrum of $^{4}$He fragments, and shows exponential behavior in a
wide range of $k$, corresponding to a few orders of magnitude in the
invariant cross section.  To keep the figure readable, 
we did not plot the $^{6}$Li spectrum
generated by CHIPS. It coincides with the 
$^{4}$He spectrum at $k > 200$\ MeV, and underestimates lithium
emission at lower energies, similarly to the $^{3}$He and tritium data.

Between the region where hadron-level processes dominate and the
kinematic limit all hadronic spectra slopes become close when plotted
as a function of $k$. In addition to this general behavior there is an
effect of strong proton-neutron splitting. For protons and neutrons
it reaches almost an order of magnitude. To model such splitting in
the CHIPS generator, the mechanism of ``isotopic focusing'' was used,
which locally transfers the negative charge from the pion to the first
radiated nuclear fragment.

\begin{table}
\caption{Clusterization parameters}
\label{tab:1}
\begin{tabular}{llllll}
\hline\noalign{\smallskip}
& $^{9}$Be & $^{12}$C & $^{28}$Si & $^{59}$Co & $^{181}$Ta \\
\noalign{\smallskip}\hline\noalign{\smallskip}
$\varepsilon_{1}$ & 0.45 & 0.40 & 0.35 & 0.33 & 0.33 \\
$\varepsilon_{2}$ & 0.15 & 0.15 & 0.05 & 0.03 & 0.02 \\
$\omega $ & 5.00 & 5.00 & 5.00 & 5.00 & 5.00 \\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}

Thus, the model qualitatively describes all typical features of the
pion capture process. The question is what can be extracted from the
experimental data with this tool. The clusterization parameters are
listed in Table~\ref{tab:1}. No formal fitting procedure has been
performed. A balanced qualitative agreement with all data was used to
tune the parameters. The difference between the $\frac{\varepsilon
_{2}}{\varepsilon _{1}}$\ ratio and the parameter $\omega$\ (which is
the same for all nuclei) is an indication that there is a
phase transition between the gas phase and the liquid phase of the
nucleus. The large value of the parameter $\omega$, determining the
average size of a nuclear cluster, is critical in describing 
the model spectra
at large $k$, where the fragment spectra approach the kinematical
limits.

Using the same parameters of clusterization we compared the data
\cite{Ryckbosch} on $\gamma$\ absorption on Al and Ca nuclei
(Fig.~\ref{gam62}) with the CHIPS results. One can see that the
spectra of secondary protons and deuterons are qualitatively described
by the CHIPS model.

\begin{figure}[tbp]
\resizebox{1.00\textwidth}{!}
{
   \includegraphics{be0405k.eps}
}
\caption{\protect{Comparison of the CHIPS model results with
experimental data on proton, neutron, and nuclear fragment production
in the capture of negative pions on $^9$Be.
Proton~\cite{MIPHI} and neutron~\cite{Cernigoi}\ experimental spectra
are shown in the upper left panel by open circles and open squares,
respectively. The model calculations are shown by the two
corresponding solid lines. The same arrangement
is used to present $^{3}$He~\cite{MIPHI}
and tritium~\cite{MIPHI}
spectra in the lower left panel. Deuterium~\cite{MIPHI} 
and $^{4}$He~\cite{MIPHI} spectra are
shown in the right panels of the figure by open squares
and lines (CHIPS model). The average kinetic
energy carried away by each nuclear fragment is shown in the panels
by the two numbers: first is the average calculated using the
experimental data shown; second is the model result.}}
\label{be0405}
\end{figure}

\begin{figure}[tbp]
\resizebox{1.00\textwidth}{!}
{
   \includegraphics{c0606k.eps}
}
\caption{\protect{Same as in Figure~\ref{be0405}, for 
pion capture on $^{12}$C. The experimental neutron spectrum
is taken from \cite{Madey}. In addition, the detailed data on
charged particle production, including the $^{6}$Li spectrum, taken from
Ref.~\cite{Mechtersheimer}, are superimposed on the plots as a series of
dots.}}
\label{c0606}
\end{figure}

\begin{figure}[tbp]
\resizebox{1.00\textwidth}{!}
{
   \includegraphics{si1414k.eps}
}
\caption{\protect{Same as in Figure~\ref{be0405}, for
pion capture on $^{28}$Si nucleus. The experimental neutron spectrum
is taken from~\cite{Madey}, for the reaction on $^{27}$Al.}}
\label{si1414}
\end{figure}

\begin{figure}[tbp]
\resizebox{1.00\textwidth}{!}
{
   \includegraphics{co2732k.eps}
}
\caption{\protect{Same as in Figure~\ref{be0405}, for 
pion capture on $^{59}$Co. The experimental neutron spectrum
is taken from~\cite{Madey}, for the reaction on $^{64}$Cu.}}
\label{co2732}
\end{figure}

\begin{figure}[tbp]
\resizebox{1.00\textwidth}{!}
{
   \includegraphics{ta73108k.eps}
}
\caption{\protect{Same as in Figure~\ref{be0405}, for 
pion capture on $^{181}$Ta. The experimental neutron
spectrum is taken from~\cite{Madey}.}}
\label{ta73108}
\end{figure}

\begin{figure}[tbp]
\resizebox{0.70\textwidth}{!}
{
   \includegraphics{gam62.eps}
}
\caption{\protect{Comparison of CHIPS model with 
experimental data~\cite{Ryckbosch} on
proton and deuteron production at $90^{\circ}$ 
in photonuclear reactions on $^{27}$Al
and $^{40}$Ca at 59 -- 65 MeV. Open circles and solid squares represent the
experimental proton and deuteron spectra, 
respectively. Solid 
and dashed lines show the results of the corresponding CHIPS model
calculation. Statistical errors in the CHIPS results are not shown and
can be judged by the point-to-point variations in the lines. The
comparison is absolute, using the values of total
photonuclear cross section 3.6 mb for Al and 5.4 mb for Ca, 
as given in Ref.~\cite{Ahrens}.
}}
\label{gam62}
\end{figure}

The CHIPS model covers a wide spectrum of hadronic reactions with a
large number of degrees of freedom. In the case of nuclear reactions the
CHIPS generator helps to understand phenomena such as an order of
magnitude splitting of neutron and proton spectra, high yield of
energetic nuclear fragments, and emission of nucleons which
kinematically can be produced only if seven or more nucleons are involved
in the reaction.

The CHIPS generator allows to extract collective parameters of a
nucleus such as clusterization. The qualitative conclusion based on the fit
to the experimental data is that the main fraction of nucleons is 
clusterized, at least in
heavy nuclei. The nuclear clusters can be considered
as drops of a liquid nuclear phase. The quark exchange makes
the phase space of quark-partons of each cluster common, stretching
kinematic limits for particle production.

The hypothetical quark exchange process is important not only for the
nuclear clusterization, but for the nuclear hadronization process,
too. The quark exchange between the excited cluster (Quasmon) and a
neighboring nuclear cluster, even at low excitation level, operates with
quark-partons at energies comparable with the nucleon mass. As a
result it easily reaches the kinematic limits of the reaction,
revealing the multinucleon nature of the process.

Up to now the most underdeveloped part of the model has been the initial
interaction between projectile and target. That is why we started
with proton-antiproton annihilation and pion capture on nuclei at
rest, which do not involve any interaction cross section. The further
development of the model will require a better understanding
of the mechanism of the first interaction.  However, we believe that
even the basic model will be useful in the understanding the nature of
multihadron fragmentation, and because of its features, is a suitable
candidate for the hadron production and hadron cascade parts of the
newly developed event generation and detector simulation Monte Carlo
computer codes.

\section{Appendix E. Modeling of real and virtual photon
  interactions with nuclei below pion production threshold.}


In the example of
the photonuclear reaction discussed in the Appendix D, namely
the description of $90^{\circ}$ proton and deuteron spectra in
$A({\gamma},X)$ reactions at $E_{\gamma} = 59-65$ MeV, the assumption
on the initial Quasmon excitation mechanism was the same. The
description of the $90^{\circ}$ data was satisfactory, but the
generated data showed very little angular dependence, as the velocity
of Quasmons produced in the initial state was small, and the
fragmentation process was almost isotropic.  Experimentally, the
angular dependence of secondary protons in photo-nuclear reactions is
quite strong even at low energies (see, for example,
Ref.~\cite{Ryckebusch}). This is a challenging experimental fact which
is difficult to explain in any model. It's enough to say that if the
angular dependence of secondary protons in the $\gamma ^{40}$Ca
interaction at 60 MeV is analyzed in terms of relativistic boost, then
the velocity of the source should reach $0.33 c$; hence the mass
of the source should be less than pion mass. The main subject of the present
publication is to show that the quark-exchange mechanism used in the
CHIPS model can not only model the clusterization of nucleons in nuclei
and hadronization of intranuclear excitations into nuclear fragments, but
can also model complicated mechanisms of interaction of photons and
hadrons in nuclear matter.

In Ref. Appendix D we defined a quark-exchange diagram which
helps to keep track of the kinematics of the quark-exchange process
(see Fig.~1 in Apendix D). To apply the same diagram to
the first interaction of a photon with a nucleus, it is necessary to
assume that the quark-exchange process takes place in nuclei
continuously, even
without any external interaction. Nucleons with high momenta do not
leave the nucleus because of the lack of excess energy. The
hypothesis of the CHIPS model is that the quark-exchange forces
between nucleons \cite{NN QEX}\ continuously create clusters in normal
nuclei. Since a low-energy photon (below the pion production threshold)
cannot be absorbed by a free nucleon, other absorption mechanisms
involving more than one nucleon have to be used.

The simplest scenario is photon absorption by a quark-parton in
the nucleon. At low energies and in vacuum this does not work because there
is no corresponding excited baryonic state. But in nuclear matter
there is a possibility to exchange this quark with a neighboring nucleon
or a nuclear cluster. The diagram for the process is shown in
Fig.~\ref{diagram1}. In this case the photon is absorbed by a
quark-parton from the parent cluster $\rm{PC}_1$, and then 
the secondary nucleon or cluster $\rm{PC}_2$
absorbs the entire momentum of the quark and photon. The exchange
quark-parton $q$ restores the balance of color, producing the 
final-state hadron F and the residual Quasmon RQ. The process looks like a 
knockout of a quasi-free nucleon or cluster out of the nucleus. It should be
emphasized that in this scenario the CHIPS event generator
produces not only ``quasi-free'' nucleons but ``quasi-free'' fragments
too. The yield of these quasi-free nucleons or fragments is
concentrated in the forward direction.

The second scenario which provides for an angular dependence is the absorption
of the photon by a colored fragment ($\rm{CF}_2$ 
in Fig.~\ref{diagram2}). In this
scenario, both the primary quark-parton with momentum $k$ and the photon
with momentum $q_{\gamma}$ are absorbed by a parent cluster ($\rm{PC}_2$ in
Fig.~\ref{diagram2}), and the recoil quark-parton with momentum $q$
cannot fully compensate the momentum $k+q_{\gamma}$. 
As a result the radiation of the
secondary fragment in the forward direction becomes more probable.

In both cases the angular dependence is defined by the first act of
hadronization. The further fragmentation of the residual Quasmon is
almost isotropic.

\begin{figure}[tbp]
\resizebox{0.70\textwidth}{!}
{
   \includegraphics{diagram1.eps}
}
\caption{\protect{Diagram of photon absorption in the quark
exchange mechanism. $\rm{PC}_{1,2}$ stand for parent clusters 
with bound masses
$\tilde{\mu}_{1,2}$, participating in the quark-exchange. $\rm{CF}_{1,2}$
stand for the colored nuclear fragments in the process of quark
exchange. F($\mu$) denotes the outgoing hadron with mass $\mu$ in the
final state. RQ is the residual Quasmon which carries the rest of the 
excitation energy and momentum. $M_{\min}$ characterizes 
its minimum mass defined by its quark content. Dashed lines indicate
colored objects. The photon is absorbed by a
quark-parton $k$ from the parent cluster $\rm{PC}_1$.
}}
\label{diagram1}
\end{figure}

\begin{figure}[tbp]
\resizebox{0.70\textwidth}{!}
{
   \includegraphics{diagram2.eps}
}
\caption{\protect{Diagram of photon absorption in the 
quark-exchange mechanism. The notation is the same as in
Fig.~\ref{diagram1}. The photon is absorbed by the colored fragment
$\rm{CF}_2$.
}}
\label{diagram2}
\end{figure}

It was shown in Appendix C that the energy spectrum of quark
partons in a Quasmon can be calculated as
\begin{equation}
\frac{dW}{k^{\ast }dk^{\ast }}\propto 
\left(1-\frac{2k^{\ast }}{M} \right)^{N-3},  \label{spectrum_1III}
\end{equation}
where $k^{\ast }$ is the energy of the primary quark-parton in the Center
of Mass System (CMS) of the Quasmon, $M$\ is the mass of the Quasmon, 
and $N$, the number of
quark-partons in the Quasmon, can be calculated from the equation
\begin{equation}
<M^{2}>=4\cdot N\cdot (N-1)\cdot T^{2}.  \label{temperatureIII}
\end{equation}
Here $T$ is the temperature of the
system.

In the first scenario of the $\gamma A$ interaction
(Fig.~\ref{diagram1}), as both interacting particles are massless, we
assumed that the cross section for the interaction of the photon with a
particular quark-parton is proportional to the charge of the quark-parton
squared, and inversely proportional to the mass of the photon-parton
system $s$, which can be calculated as
\begin{equation}
s=2\omega k(1-\cos (\theta _{k})).  \label{s}
\end{equation}
Here $\omega $\ is the energy of the photon, and $k$ is the energy of
the quark-parton in the Laboratory System (LS):
\begin{equation}
k=k^{\ast }\cdot \frac{E_{N}+p_{N}\cdot \cos (\theta _{k})}{M_{N}}.
\end{equation}
In the case of a virtual photon, equation~(\ref{s}) can be written as
\begin{equation}
s=2k(\omega -q_{\gamma}\cdot \cos (\theta _{k})),
\end{equation}
where $q_{\gamma}$ is the momentum of the virtual photon. In both cases 
equation~(\ref{spectrum_1III}) transforms into
\begin{equation}
\frac{dW}{dk^{\ast }}\propto \left(1-\frac{2k^{\ast }}{M} \right)^{N-3},
\end{equation}
and the angular distribution in $\cos (\theta _{k})$\ converges to a
$\delta $-function: in the case of a real photon 
$\cos (\theta _{k})=1$, and
in the case of a virtual photon 
$\cos (\theta _{k})=\frac{\omega }{q_{\gamma}}$.

In the second scenario for the photon interaction 
(Fig.~\ref{diagram2}) we assumed
that both the photon and the primary quark-parton, randomized
according to 
equation~(\ref{spectrum_1III}), enter the parent cluster $\rm{PC}_2$,
and after that the normal procedure of quark exchange
continues, in which the recoiling quark-parton $q$ returns 
to the first cluster.

An additional parameter in the model is the relative contribution of
both mechanisms. As a first approximation we assumed equal
probability, but in the future, when more detailed data are obtained,
this parameter can be adjusted.

\begin{figure}[tbp]
\resizebox{0.80\textwidth}{!}
{
   \includegraphics{gam62.eps}
}
\caption{\protect{Comparison of the CHIPS model results (lines in the
figure) with the 
experimental data~\cite{Ryckbosch} on
proton spectra at $90^{\circ}$ 
in the photonuclear reactions on $^{40}$Ca at 59--65 MeV (open
circles),
and proton spectra at $60^{\circ}$ (triangles) and $150^{\circ}$ 
(diamonds).
Statistical errors in the CHIPS results are not shown but
can be judged by the point-to-point variations in the lines. The
comparison is absolute, using the value of total
photonuclear cross section of 5.4 mb for Ca, 
as given in Ref.~\cite{Ahrens}.
} }
\label{gam62III}
\end{figure}

\begin{figure}[tbp]
\resizebox{0.80\textwidth}{!}
{
   \includegraphics{gamm_c0606_e123.eps}
}
\caption{\protect{Comparison of the CHIPS model results (lines in the
figure) with the 
experimental data~\cite{Harty} on
proton spectra at $57^{\circ}$, $77^{\circ}$, $97^{\circ}$, 
$117^{\circ}$, and $127^{\circ}$
in the photonuclear reactions on $^{12}$C at 123 MeV (open
circles).
The value of the total
photonuclear cross section was set at 1.8 mb.
}  }
\label{gam_123}
\end{figure}

\begin{figure}[tbp]
\resizebox{0.80\textwidth}{!}
{
   \includegraphics{gamm_c0606_e151.eps}
}
\caption{\protect{Same as in Fig.~\ref{gam_123}, for the photon energy
151 MeV.}}
\label{gam_151}
\end{figure}

\begin{figure}[tbp]
\resizebox{0.80\textwidth}{!}
{
   \includegraphics{vgam_c0606k.eps}
}
\caption{\protect{Comparison of the CHIPS model results (line in the
figure) with the experimental data~\cite{Bates} (open circles) on the
proton spectrum measured in parallel kinematics in the
$^{12}$C(e,e$^{\prime}$p)\ reaction at an energy transfer equal to 210
MeV and momentum transfer equal to 585 MeV/$c$.  Statistical errors in
the CHIPS result are not shown but can be judged by the point-to-point
variations in the line.  The relative normalization is arbitrary.
}  }
\label{vgam}
\end{figure}

We begin the comparison with the data on proton production in the 
$^{40}$Ca$(\gamma,X)$\ reaction at $90^{\circ}$\ at 59--65 MeV
\cite{Ryckbosch}, and at $60^{\circ}$\ and $150^{\circ}$\ at 60 MeV
\cite{Abeele}.  We analyzed these data together to compare the angular
dependence generated by CHIPS with experimental data. The data are
presented as a function of 
the invariant inclusive cross section 
$f=\frac{d\sigma }{p_{p}dE_{p}}$\ depending on the variable 
$k=\frac{T_{p}+p_{p}}{2}$, 
where $T_{p}$\ and $p_{p}$\ are the kinetic energy and the momentum of the
secondary proton. As one can see from Fig.~\ref{gam62III}, the angular
dependence of the proton yield in photoproduction on $^{40}$Ca at $60$ MeV is
reproduced quite well by the CHIPS event generator.

The second set of measurements that we use for the benchmark
comparison deals with the secondary proton yields in
$^{12}$C$(\gamma,X)$ reactions at 123 and 151 MeV \cite{Harty}, 
which is still below the pion production threshold on
a free nucleon. Inclusive spectra of protons have been measured in 
$\gamma ^{12}$C reactions at $57^{\circ}$, $77^{\circ}$, $97^{\circ}$, 
$117^{\circ}$, and $127^{\circ}$. 
Originally, these data were presented as a function of 
the missing energy. We present the data in Figs.~\ref{gam_123} 
and \ref{gam_151} together with CHIPS calculations in
the form of the invariant inclusive cross section dependent on $k$. 
All parameters of the model such as temperature $T$ and parameters
of clusterization for the particular nucleus were the same as in 
Appendix D, where pion capture spectra were fitted.
The agreement between the experimental data and the CHIPS model results is
quite remarkable. Both data and calculations show significant strength
in the proton yield cross section up to the kinematical limits of the
reaction. The angular distribution in the model is not as prominent as
in the experimental data, but agrees well qualitatively.

Using the same parameters, we applied the CHIPS event generator to the
$^{12}$C(e,e$^{\prime }$p) reaction measured in Ref.\cite{Bates}. The
proton spectra were measured in parallel kinematics in the interaction
of virtual photons with energy $\omega = 210$ MeV and momentum
$q_{\gamma} = 585$ MeV/$c$. To account for the experimental conditions
in the CHIPS event generator, we have selected protons generated in
the forward direction with respect to the direction of the virtual
photon, with the relative angle $\Theta_{qp} < 6^{\circ}$.  The CHIPS
generated distribution and the experimental data are shown in
Fig.~\ref{vgam} in the form of the invariant inclusive cross section as a
function of $k$.  The CHIPS event generator works only with ground
states of nuclei so we did not expect any narrow peaks for
$^{1}p_{3/2}$-shell knockout or for other shells. Nevertheless we
found that the CHIPS event generator fills in the so-called
``$^{1}s_{1/2}$-shell knockout'' region, which is usually artificially
smeared by a Lorentzian~\cite{Lorentzian}.  In the regular
fragmentation scenario the spectrum of protons below $k = 300$ MeV is
normal; it falls down to the kinematic limit. The additional yield at
$k > 300$ MeV is a reflection of the specific first act of
hadronization with the quark exchange kinematics. The slope increase
with momentum is approximated well by the model, but it is obvious
that the yield close to the kinematic limit of the $2 \rightarrow 2$
reaction can only be described in detail if the excited states of the
residual nucleus are taken into account.

The angular dependence of the proton yield in low-energy photo-nuclear
reactions is described in the CHIPS model and event generator. The
most important assumption in the description is the hypothesis of a
direct interaction of the photon with an asymptotically free quark in
the nucleus, even at low energies. This means that asymptotic freedom of
QCD and dispersion sum rules~\cite{sum_rules} can in some way be
generalized for low energies.  The knockout of a proton from a nuclear
shell or the homogeneous distributions of nuclear evaporation cannot
explain significant angular dependences at low energies.

The same mechanism appears to be capable of modeling proton yields in
such reactions as the $^{16}$C(e,e$^{\prime }$p) reaction measured at MIT
Bates \cite{Bates}, where it was shown that the region of missing
energy above 50 MeV reflects ``two-or-more-particle knockout'' (or the
``continuum'' in terms of the shell model). The CHIPS model may help
to understand and model such phenomena.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%****************************
\begin{thebibliography}{}
\bibitem{STAND_ALONE}  \noindent M. V. Kossov, Manual for the CHIPS
event generator,High Energy Accelerator Research Organization (KEK)
Internal 2000-17, February 2001, H/R

\bibitem{CHIPS1}  \noindent P. V. Degtyarenko, M. V. Kossov, and H.P.
Wellisch, Chiral invariant phase space event generator, I.
Nucleon-antinucleon annihilation at rest, Eur. Phys. J. A {\bf 8}, 217-222
(2000).

\bibitem{CHIPS2}  P. V. Degtyarenko, M. V. Kossov, and H. P. Wellisch,
Chiral invariant phase space event generator, II.Nuclear pion capture at
rest, Eur. Phys. J. A 9, (be published) (2001).

\bibitem{CHIPS3}  P. V. Degtyarenko, M. V. Kossov, and H. P. Wellisch,
Chiral invariant phase space event generator, III Photonuclear reactions
below $\Delta $(3,3) excitation, Eur. Phys. J. A 9, (be published) (2001).

\bibitem{GEANT4}  S. Giani et al., Geant4: Object Oriented Toolkit for
Simulation in HEP, LCB status report CERN/LHCC/98-44, November 1998.

\bibitem{MC2000}  J. P. Wellisch, On hadronic models in GEANT4, Program
and Book of Abstracts.International Conference on Advanced Monte Carlo for
Radiation Physics, Particle Transport Simulation and Applications, 23-26
October 2000, IST,Lisbon, Portugal, p. 330.

\bibitem{massSpectr}  M. V. Kossov, CHIPS: masses of hadrons. (be
published).

\bibitem{chpd.eqPhotons}  L. D. Landau, E. M. Lifshitz, ``Course of
Theoretical Physics'' v.4, part 1, ``Relativistic Quantum Theory'',
Pergamon Press, paragraph 96, The method of equivalent photons.

\bibitem{Shadowing}  J. Eickmeyer et al. Phys. Rev. Letters {\bf 36 }(1976)
289-291.

\bibitem{Guilo}  D'Agostini, Hard Scattering Process in High Energy
Gamma-Induced Reactions, DESY 94-169, September 1994.

\bibitem{Electronuc}  F. W. Brasse et al. Nuclear Physics {\bf B39 }(1972)
421-431.

\bibitem{PenCB}  A. Lepretre et al. Nuclear Physics {\bf A390 }(1982)
221-239.

\bibitem{K_parameter}  M.V. Kossov and L.M. Voronina, Preprint ITEP
165-84, Moscow (1984)

\bibitem{DINREG} P.V. Degtyarenko and M.V. Kossov, Preprint ITEP
11-92, Moscow (1992)

\bibitem{ARGUS} P.V. Degtyarenko et al., Z. Phys. A - Atomic Nuclei,
{\textbf{335}} (1990) 231

\bibitem{TPC} P.V. Degtyarenko et al., Phys. Rev. C {\textbf{50}} (1994)
R541

\bibitem{GDINR} P.V. Degtyarenko, \textit{Applications of the photonuclear
fragmentation model to radiation protection problems}, in:
Proceedings of Second Specialist's Meeting on Shielding Aspects of
Accelerators, Targets and Irradiation Facilities (SATIF-2), CERN,
Geneva, Switzerland, 12-13 October 1995, published by Nuclear Energy
Agency, Organization for Economic Co-operation and Development, pages
67 - 91 (1996)

\bibitem{sum_rules}  C. Bernard, A. Duncan, J. LoSecco, and S. Weinberg,
Phys. Rev. D \textbf{12} (1975) 792;

 E. Poggio, H. Quinn, and S. Weinberg, Phys. Rev. D \textbf{13} (1976) 1958

\bibitem{Feynman-Wilson}  K.G. Wilson, Proc. Fourteenth Scottish
Universities Summer School in Physics (1973), eds R. L. Crawford, R.
Jennings (Academic Press, New York, 1974)

\bibitem{Chiral_Bag} C.A.Z. Vasconcellos et al., Eur. Phys. J. C 
{\textbf{4}} (1998) 115;

G.A. Miller, A.W. Thomas, S. Theberge, Phys. Lett. B {\textbf{91}} (1980)
192;

C.E. de Tar, Phys. Rev. D {\textbf{24}} (1981) 752;

M.A.B. B\'{e}g, G.T. Garvey, Comments Nucl. Part. Phys. {\textbf{18}}
(1988) 1

\bibitem{Parton_Models} B. Andersson, G. Gustafson, G. Ingelman,
T. Sj\"{o}strand, Phys. Rep. {\textbf{97}} (1983) 31

\bibitem{CHdetail.PDG}  Monte Carlo particle numbering scheme, in: 
 Particle Data Group, \textit{Review of Particle Physics}, 
 Eur. Phys. J. C {\textbf{3}} (1998) 180

\bibitem{Hagedorn} R. Hagedorn, Nuovo Cimento Suppl. {\textbf{3}} (1965) 147

\bibitem{Duality} Yu.L. Dokshitzer, V.S. Fadin and V.A. Khoze,
Phys. Lett. {\textbf{115B}} (1982) 242L

\bibitem{JETSET} T. Sj\"{o}strand, Comp. Phys. Comm. {\textbf{92}} (1994)
74

\bibitem{GENBOD} F. James, \textit{Monte Carlo Phase Space}, CERN 68-15
(1968)

\bibitem{OZI}  S. Ocubo, Phys. Lett. {\textbf{5}} (1963) 165;

G. Zweig, CERN Preprint 8419/TH-412 (1964);

I. Iizuka, Progr. Theor. Phys. Suppl. {\textbf{37}} (1966) 21

\bibitem{OZI_violation} V.E. Markushin, M.P. Locher,
Eur. Phys. J. A {\textbf{1}} (1998) 91

\bibitem{pap_exdata}  C. Amsler, Rev.Mod.Phys. {\textbf{70}} (1998) 1293;

C. Amsler and F. Myher, Annu. Rev. Nucl. Part. Sci. {\textbf{41}} (1991)
219

\bibitem{pispectrum} J. Sedlak and V. Simak, Sov. J. Part. Nucl. 
{\textbf{19}} (1988) 191

\bibitem{POPCORN} B. Andersson, G. Gustafson, T. Sj\"{o}strand, Nucl.
Phys. B {\textbf{197}}(1982) 45;

B. Andersson, G. Gustafson, T. Sj\"{o}strand, Physica Scripta {\textbf{32}}
(1985) 574

\bibitem{Energy_Dep} P. Gregory et al., Nucl. Phys. B {\textbf{102}} (1976)
189

\bibitem{FNAL}  V.I.~Efremenko et al., Phys. Rev. C \textbf{22} (1980) 700.

\bibitem{FAS}  S.V~Boyarinov et al., Phys. At. Nucl. \textbf{56}
(1993) 72.

\bibitem{NN QEX}  K.~Maltman and N.~Isgur, Phys. Rev. D \textbf{29} (1984) 952.

\bibitem{Kp QUEX}  K.~Maltman and N.~Isgur, Phys. Rev. D \textbf{34} (1986)
1372.

\bibitem{EMC}  P.~Hoodbhoy and R.~J.~Jaffe, Phys. Rev. D \textbf{35}
(1987) 113.

\bibitem{QUEX}  N.~Isgur, Nucl. Phys. \textbf{A497} (1989) 91.

\bibitem{MIPHI}  A.~I.~Amelin et al., ``Energy spectra of charged particles
in the reaction of $\pi^-$ absorption at rest by $^{6,7}$Li, $^{9}$Be, $%
^{10,11}$B, $^{12}$C, $^{28}$Si, $^{40}$Ca, $^{59}$Co, $^{93}$Nb, $%
^{114,117,120,124}$Sn, $^{169}$Tm, $^{181}$Ta and $^{209}$Bi nuclei'',
Moscow Physics and Engineering Institute Preprint No. 034-90, Moscow, 1990.

\bibitem{Mechtersheimer}  G.~Mechtersheimer et al., Nucl. Phys. 
                          \textbf{A324} (1979) 379.

\bibitem{Cernigoi}  C.~Cernigoi et al., Nucl. Phys. \textbf{A456} (1986) 599.

\bibitem{Madey}  R.~Madey et al., Phys. Rev. C \textbf{25} (1982) 3050.

\bibitem{Ryckbosch}  D.~Ryckbosch et al., Phys. Rev. C \textbf{42} (1990) 444.

\bibitem{Ahrens}  J.~Ahrens et al.,  Nucl. Phys. \textbf{A446} (1985) 229c.

\bibitem{Ryckebusch} Jan~Ryckebusch et al., Phys. Rev. C \textbf{49} (1994)
2704.

\bibitem{Abeele} C.~Van~den~Abeele; private communication cited
in the reference: Jan~Ryckebusch et al., Phys. Rev. C \textbf{49} (1994)
2704.

\bibitem{Harty} P.D.~Harty et al. (unpublished); 
private communication cited
in the reference: Jan~Ryckebusch et al., Phys. Rev. C \textbf{49} (1994)
2704.

\bibitem{Bates}  L.B.~Weinstein et al., Phys. Rev. Lett. \textbf{64} (1990)
1646.

\bibitem{Lorentzian}  J.P.~Jeukenne and C.~Mahaux, Nucl. Phys. A \textbf{394}
(1983) 445.

\end{thebibliography}

\end{document}
