\chapter{Event}

\section{Design Philosophy}

In high energy physics the primary unit of an experimental run is an event.
An event consists of a set of primary particles produced in an interaction,
and a set of detector responses to these particles.

In {\sc Geant4}, objects of the {\it G4Event} class are the primary units of 
a simulation run.  Before the event is processed, it contains primary
vertices and primary particles produced by an external physics generator.  
After the event is processed, it may also contain hits, digitizations ,and 
optionally, trajectories generated by the simulation.  The event category 
manages events and provides an abstract interface to external physics 
generators.

{\it G4Event} and its content vertices and particles are independent of 
other classes.  This isolation allows {\sc Geant4}-based simulation programs 
to be independent of specific choices for physics generators and of specific 
solutions for storing the ``Monte Carlo truth''.  {\it G4Event} avoids 
keeping any transient information which is not meaningful after event 
processing is complete.  Thus the user can store objects of this class for 
processing further down the program chain.  For performance reasons,
{\it G4Event} and its content classes are not persistent.  Instead the user 
must provide the transient-to-persistent conversion.
  
\section{Class Design}

\begin{itemize}

\item {\bf G4Event} - This class represents an event.  It is constructed and
      deleted by G4RunManager or its derived class.

\item {\bf G4EventManager} - This class controls an event.  It must be a 
      singleton and should be constructed by G4RunManager.

\item {\bf G4VPrimaryGenerator} - the abstract base class of all of primary 
      generators.  This class has only one pure virtual method,
      GeneratePrimaryVertex(), which takes a G4Event object, generates a 
      primary vertex and associates primary particles with the vertex.

\end{itemize}

Booch diagrams for classes related to the event and event generator classes
are shown in Figs. \ref{figure:event-1} and \ref{figure:eventGen-1}, 
respectively.

\vspace{10pt}
\begin{figure}
\begin{center}
\includegraphics[angle=0,scale=0.65]{OOAnalysisDesign/Event/classDgmEventManager.eps}
\caption{Event}
\label{figure:event-1}
\end{center}
\end{figure}

\vspace{10pt}
\begin{figure}
\begin{center}
\includegraphics[angle=0,scale=0.65]{OOAnalysisDesign/EventGenerator/classDgmEventGen.eps}
\caption{Event Generator}
\label{figure:eventGen-1}
\end{center}
\end{figure}


\section{Status of this chapter}

27.06.05 design philosophy section added (from Geant4 general paper) by
         D.H. Wright \\

