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 Response}anomaly = 1.165923e-3;sets the muon anomaly by default, the class also comes with the public method:inline void SetAnomaly(G4double a) { anomaly = a; }with which you can set the magnetic anomaly to any value you require.For the moment, the code is written such that field tracking of the spin is done only <strong>for</strong> particles with non-zerocharge. Please, see the Forum posting: http://geant4-hn.slac.stan<strong>for</strong>d.edu:5090/Hyper-News/public/get/emfields/88/3/1.html <strong>for</strong> modifications the user is required to make to facilitateneutron spin tracking.4.4. Hits4.4.1. HitA hit is a snapshot of the physical interaction of a track in the sensitive region of a detector. In it you can storein<strong>for</strong>mation associated with a G4Step object. This in<strong>for</strong>mation can be• the position and time of the step,• the momentum and energy of the track,• the energy deposition of the step,• geometrical in<strong>for</strong>mation,or any combination of the above.G4VHitG4VHit is an abstract base class which represents a hit. You must inherit this base class and derive your ownconcrete hit class(es). The member data of your concrete hit class can be, and should be, your choice.G4VHit has two virtual methods, Draw() and Print(). To draw or print out your concrete hits, these methodsshould be implemented. How to define the drawing method is described in Section 8.9.G4THitsCollectionG4VHit is an abstract class from which you derive your own concrete classes. During the processing of a givenevent, represented by a G4Event object, many objects of the hit class will be produced, collected and associatedwith the event. There<strong>for</strong>e, <strong>for</strong> each concrete hit class you must also prepare a concrete class derived fromG4VHitsCollection, an abstract class which represents a vector collection of user defined hits.G4THitsCollection is a template class derived from G4VHitsCollection, and the concrete hit collection class of aparticular G4VHit concrete class can be instantiated from this template class. Each object of a hit collection musthave a unique name <strong>for</strong> each event.G4Event has a G4HCofThisEvent class object, that is a container class of collections of hits. Hit collections arestored by their pointers, whose type is that of the base class.An example of a concrete hit classExample 4.14 shows an example of a concrete hit class.125

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

Saved successfully!

Ooh no, something went wrong!