\chapter{Hits and Digitization} \section{Design Philosophy} In {\sc Geant4} a {\it hit} 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 {\it digit}, represents a detector output, such as an ADC/TDC count or a trigger signal. A {\it digit} is created from one or more hits and/or other {\it digits}. Given the wide variety of {\sc Geant4} applications, ways of describing detector sensitivity and the quantities to be stored in the {\it hits} and {\it digits} vary greatly. This category therefore provides only abstract classes for both detector sensitivity and {\it hits}/{\it digits}. It also provides tools for organizing the {\it hits}/{\it digits} into collections. \section{Class Design} \begin{itemize} \item {\bf G4SensitiveDetectorManager} - a list of G4SensitiveDetectors. \item {\bf G4HitsStructure} - 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. \item {\bf G4VSensitiveDetector} - an abstract class of all of sensitive volumes. \item {\bf G4HitsCollection} - a collection of hits. Instantiates an RWCollection class. \item {\bf G4VHit} - this class has all the information about a particular hit caused by a single step. \item {\bf G4VDigitizer} - the class of objects which transform the hits deposited by particles into digitizations. \item {\bf G4DigitizerManager} - the (single) object dispatching common messages to individual digitizers. \item {\bf G4VDigi} - an abstract (base) class for all G4 digitizations. This could be data as simple as a singe byte, or as complex as an Ntuple. \item {\bf G4DigiStructure} - digitizations are organized as a structure, which could be anything between a single value and an Ntuple. \end{itemize} The object-oriented design of the 'hit' related classes is shown in the following class diagrams. The diagrams are described in the Booch notation. Fig. \ref{figure:hit-1} shows the general management of hit classes. Fig. \ref{figure:hit-2} shows the OO design of user-related hit classes. Fig. \ref{figure:hit-3} shows the OO design of the readout geometry. \begin{figure} \begin{center} \includegraphics[angle=0,scale=0.55]{OOAnalysisDesign/Hit/classDgmHitMain.eps} \vspace{10pt} \caption{Overview of hit classes management} \label{figure:hit-1} \end{center} \end{figure} \begin{figure} \begin{center} \includegraphics[angle=0,scale=0.5]{OOAnalysisDesign/Hit/classDgmHitUser.eps} \vspace{10pt} \caption{User hit classes} \label{figure:hit-2} \end{center} \end{figure} \begin{figure} \begin{center} \includegraphics[angle=0,scale=0.6]{OOAnalysisDesign/Hit/classDgmReadoutGeom.eps} \vspace{10pt} \caption{Readout geometry} \label{figure:hit-3} \end{center} \end{figure} \section{Status of this chapter} 27.06.05 section on design philosophy added (from Geant4 general paper) by D.H. Wright \\