12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Detector Definition and Responsenient <strong>for</strong> applications which do not need to output event-by-event data but instead just accumulate them. All theG4VPrimitiveScorer classes discussed in Section 4.4.5 use G4THitsMap.G4THitsMap is derived from the G4VHitsCollection abstract base class and all objects of this class are also storedin G4HCofThisEvent at the end of an event. How to access a G4THitsMap object is discussed in the followingsection (Section 4.4.5).4.4.2. Sensitive detectorG4VSensitiveDetectorG4VSensitiveDetector is an abstract base class which represents a detector. The principal mandate of a sensitive detectoris the construction of hit objects using in<strong>for</strong>mation from steps along a particle track. The ProcessHits()method of G4VSensitiveDetector per<strong>for</strong>ms this task using G4Step objects as input. In the case of a "Readout"geometry (see Section 4.4.3), objects of the G4TouchableHistory class may be used as an optional input.Your concrete detector class should be instantiated with the unique name of your detector. The name can beassociated with one or more global names with "/" as a delimiter <strong>for</strong> categorizing your detectors. For examplemyEMcal = new MyEMcal("/myDet/myCal/myEMcal");where myEMcal is the name of your detector. The pointer to your sensitive detector must be set to one ormore G4LogicalVolume objects to set the sensitivity of these volumes. The pointer should also be registered toG4SDManager, as described in Section 4.4.4.G4VSensitiveDetector has three major virtual methods.ProcessHits()This method is invoked by G4SteppingManager when a step is composed in the G4LogicalVolume whichhas the pointer to this sensitive detector. The first argument of this method is a G4Step object of the currentstep. The second argument is a G4TouchableHistory object <strong>for</strong> the ``Readout geometry'' described in the nextsection. The second argument is NULL if ``Readout geometry'' is not assigned to this sensitive detector. In thismethod, one or more G4VHit objects should be constructed if the current step is meaningful <strong>for</strong> your detector.Initialize()This method is invoked at the beginning of each event. The argument of this method is an object ofthe G4HCofThisEvent class. Hit collections, where hits produced in this particular event are stored, canbe associated with the G4HCofThisEvent object in this method. The hit collections associated with theG4HCofThisEvent object during this method can be used <strong>for</strong> ``during the event processing'' digitization.EndOfEvent()This method is invoked at the end of each event. The argument of this method is the same object as theprevious method. Hit collections occasionally created in your sensitive detector can be associated with theG4HCofThisEvent object.4.4.3. Readout geometryThis section describes how a ``Readout geometry'' can be defined. A Readout geometry is a virtual, parallel geometry<strong>for</strong> obtaining the channel number.As an example, the accordion calorimeter of ATLAS has a complicated tracking geometry, however the readoutcan be done by simple cylindrical sectors divided by theta, phi, and depth. Tracks will be traced in the trackinggeometry, the ``real'' one, and the sensitive detector will have its own readout geometry <strong>Geant4</strong> will message tofind to which ``readout'' cell the current hit belongs.127

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!