2.6.  Hits and Digitization

2.6.1.  Design Philosophy

In Geant4 a 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 digit, represents a detector output, such as an ADC/TDC count or a trigger signal. A digit is created from one or more hits and/or other digits.

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

2.6.2.  Class Design

  • G4VHit - this class has all the information about a particular hit caused by a single step.

  • G4VHitsCollection - base class for a collection of hits.

  • G4THitsCollection - template class for a collection of hits of the (template) type. Implements G4VHitsCollection interface providing efficient storage of hits via allocators.

  • G4HCofThisEvent - container class for collections of hits for the current event.

  • G4VSensitiveDetector - pure virtual class representing a sensitive element responsible for creating and managing associated hits. The user should implement the method ProcessHits a filter and readout geometry (optional) are also allowed.

  • G4SDManager - singleton managing sensitive detectors.

  • G4SDMessengerr - SD manager associated messenger.

  • G4SDStructure - used exclusively used by G4SDManager for handling the tree structure of the user's sensitive detector names. 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.

For digitization features a similar design as for hits is applied:

  • 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.

  • G4VDigiCollection - base class for a collection of digits.

  • G4TDigiCollection - template class for a collection of digits of the (template) type. Implements G4VDigiCollection interface providing efficient storage of digits via allocators.

  • G4DCofThisEvent - container class for collections of digits for the current event.

  • G4VDigitizerModule - the class of objects which transform the hits deposited by particles into digitizations.

  • G4DigiManager - singleton managing digitiser modules.

  • G4DigiMessengerr - Digi manager associated messenger.

The UML class diagram for sensitivity related classes is shown in the following class diagram. Figure 2.12 shows the general management of hit classes.

Overview of hit classes management. Classes in grey represent the main components that a user must subclass to implement a sensitive detector. User is also responsible of creating the binding between G4THitsCollection and its hit class.

Figure 2.12.  Overview of hit classes management. Classes in grey represent the main components that a user must subclass to implement a sensitive detector. User is also responsible of creating the binding between G4THitsCollection and its hit class.