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

<!-- ******************* Section (Level#1) ****************** -->
<sect1 id="sect.DsgnFuncHitDig">
<title>
Hits and Digitization
</title>


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

<para>
In Geant4 a <emphasis role="italic">hit</emphasis> is a snapshot of a 
physical interaction or an accumulation of interactions of a track or 
tracks in a ``sensitive'' detector component.  A digitization, or 
<emphasis role="italic">digit</emphasis>, represents a detector output, 
such as an ADC/TDC count or a trigger signal.  
A <emphasis role="italic">digit</emphasis> is created from one or 
more hits and/or other <emphasis role="italic">digits</emphasis>.  
</para>

<para>
Given the wide variety of Geant4 applications, ways of describing detector 
sensitivity and the quantities to be stored in the 
<emphasis role="italic">hits</emphasis> and 
<emphasis role="italic">digits</emphasis> vary greatly.  This category 
therefore provides only abstract classes for both detector sensitivity and 
<emphasis role="italic">hits</emphasis>/<emphasis role="italic">digits</emphasis>.  
It also provides tools for organizing the 
<emphasis role="italic">hits</emphasis>/<emphasis role="italic">digits</emphasis> 
into collections.
</para>

</sect2>

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

<para>
<itemizedlist spacing="compact">
  <listitem><para>
    <emphasis role="bold">G4SensitiveDetectorManager</emphasis> -
    a list of G4SensitiveDetectors.
  </para></listitem> 
  <listitem><para>
    <emphasis role="bold">G4HitsStructure</emphasis> -
    a tree-like structure of G4Hit collections. Each branch represents the 
    hits in given sub-detector.  For example, the first level of branches 
    may consist of a tracker, ECAL, and HCAL, while the second level, in HCAL,
    consists of the barrel and endcaps. Finally the barrel may have phi-slices, 
    Z-slices, etc.
   </para></listitem>
   <listitem><para>
     <emphasis role="bold">G4VSensitiveDetector</emphasis> -
     an abstract class of all of sensitive volumes.
   </para></listitem>
   <listitem><para>
     <emphasis role="bold">G4HitsCollection</emphasis> -
     a collection of hits. Instantiates an RWCollection class.
   </para></listitem>
   <listitem><para>
     <emphasis role="bold">G4VHit</emphasis> -
     this class has all the information about a particular hit caused by a 
     single step.
   </para></listitem>
   <listitem><para>
     <emphasis role="bold">G4VDigitizer</emphasis> -
     the class of objects which transform the hits deposited by particles into 
     digitizations.
   </para></listitem>
   <listitem><para>
     <emphasis role="bold">G4DigitizerManager</emphasis> -
     the (single) object dispatching common messages to individual digitizers.
   </para></listitem>
   <listitem><para>
     <emphasis role="bold">G4VDigi</emphasis> -
     an abstract (base) class for all G4 digitizations.  This could be data as 
     simple as a singe byte, or as complex as an Ntuple.
   </para></listitem>
   <listitem><para>
     <emphasis role="bold">G4DigiStructure</emphasis> -
     digitizations are organized as a structure, which could be anything
     between a single value and an Ntuple.
   </para></listitem>
</itemizedlist> 
</para>

<para>
The object-oriented design of the 'hit' related classes is shown in the 
following class diagrams. The diagrams are described in the Booch notation.  
<xref linkend="fig.DsgnFuncHitDig_1" /> shows the general management of hit classes.
<xref linkend="fig.DsgnFuncHitDig_2" /> shows the OO design of user-related hit classes.
<xref linkend="fig.DsgnFuncHitDig_3" /> shows the OO design of the readout geometry.

<figure id="fig.DsgnFuncHitDig_1">
<title>
Overview of hit classes management
</title>
<mediaobject>
  <imageobject role="fo">
    <imagedata
fileref="./AllResources/OOAnalysisDesign/Hit/classDgmHitMain.jpg" format="JPG" contentwidth="10.0cm"  align="center" />
  </imageobject>
  <imageobject role="html">
    <imagedata fileref="./AllResources/OOAnalysisDesign/Hit/classDgmHitMain.jpg" format="JPG" contentwidth="120%" align="center" />
  </imageobject>
</mediaobject>
</figure>


<figure id="fig.DsgnFuncHitDig_2">
<title>
User hit classes
</title>
<mediaobject>
  <imageobject role="fo">
    <imagedata
fileref="./AllResources/OOAnalysisDesign/Hit/classDgmHitUser.jpg" format="JPG"
contentwidth="10.0cm" align="center" />
  </imageobject>
  <imageobject role="html">
    <imagedata fileref="./AllResources/OOAnalysisDesign/Hit/classDgmHitUser.jpg" format="JPG" contentwidth="120%" align="center" />
  </imageobject>
</mediaobject>
</figure>

<figure id="fig.DsgnFuncHitDig_3">
<title>
Readout geometry
</title>
<mediaobject>
  <imageobject role="fo">
    <imagedata fileref="./AllResources/OOAnalysisDesign/Hit/classDgmReadoutGeom.jpg" format="JPG" contentwidth="10.0cm" align="center" />
  </imageobject>
  <imageobject role="html">
    <imagedata fileref="./AllResources/OOAnalysisDesign/Hit/classDgmReadoutGeom.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 section on design philosophy 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>
