<!-- ******************************************************** -->
<!--  Docbook Version:  For Toolkit Developers Guide          -->
<!-- ******************************************************** --> 

<!-- ******************** Top of Section ******************** -->
<sect1 id="sect.DsgnFuncEvnt">
<title>
Event
</title>

<!-- ******************* Section (Level#2) ****************** -->
<sect2 id="sect.sect.DsgnFuncEvnt.DsgPhlsp">
<title>
Design Philosophy
</title>

<para>
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.
</para>

<para>
In Geant4, objects of the  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.
</para>

<para>
G4Event and its content vertices and particles are independent of 
other classes.  This isolation allows Geant4-based simulation programs 
to be independent of specific choices for physics generators and of specific 
solutions for storing the ``Monte Carlo truth''.  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,
G4Event and its content classes are not persistent.  Instead the user 
must provide the transient-to-persistent conversion.
</para>

</sect2>

<!-- ******************* Section (Level#2) ****************** -->
<sect2 id="sect.sect.DsgnFuncEvnt.ClassDsg">
<title>
Class Design
</title>

<itemizedlist spacing="compact">
  <listitem><para>
    <emphasis role="bold">G4Event</emphasis> - This class represents an event.  
    It is constructed and deleted by G4RunManager or its derived class.
  </para></listitem>
  <listitem><para>
    <emphasis role="bold">G4EventManager</emphasis> - This class controls an 
    event. It must be a singleton and should be constructed by G4RunManager.
  </para></listitem>
  <listitem><para>
    <emphasis role="bold">G4VPrimaryGenerator</emphasis> - 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.
  </para></listitem>
</itemizedlist>

<para>
Booch diagrams for classes related to the event and event generator classes
are shown in <xref linkend="fig.DsgnFuncEvnt_1" /> and 
<xref linkend="fig.DsgnFuncEvnt_2" />.

<figure id="fig.DsgnFuncEvnt_1">
<title>
  Event
</title>
<mediaobject>
  <imageobject role="fo">
    <imagedata fileref="./AllResources/OOAnalysisDesign/Event/classDgmEventManager.jpg"  
               format="JPG" contentwidth="10.0cm" align="center" />
  </imageobject>
  <imageobject role="html">
    <imagedata fileref="./AllResources/OOAnalysisDesign/Event/classDgmEventManager.jpg"  
               format="JPG" contentwidth="120%" align="center" />
  </imageobject>
</mediaobject>
</figure>

<figure id="fig.DsgnFuncEvnt_2">
<title>
  Event Generator
</title>
<mediaobject>
  <imageobject role="fo">
    <imagedata fileref="./AllResources/OOAnalysisDesign/Event/classDgmEventGen.jpg"  
               format="JPG" contentwidth="10.0cm" align="center" />
  </imageobject>
  <imageobject role="html">
    <imagedata fileref="./AllResources/OOAnalysisDesign/Event/classDgmEventGen.jpg"  
               format="JPG" contentwidth="120%" align="center" />
  </imageobject>
</mediaobject>
</figure>
</para>

<!-- ******* Bridgehead ******* -->
<bridgehead role="revisionHistory" renderas='sect4'>
[Status of this chapter]
</bridgehead>

<para>
<simplelist type="var">
  <member>
    27.06.05 design philosophy section added (from Geant4 general paper) by
             D.H. Wright
  </member>
  <member>
    Dec. 2006 Conversion from latex to Docbook verson by K. Amako
  </member>
</simplelist>
</para>

</sect2>
</sect1>


