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.

Toolkit Fundamentals3.5. Event3.5.1. Representation of an eventG4Event represents an event. An object of this class contains all inputs and outputs of the simulated event. Thisclass object is constructed in G4RunManager and sent to G4EventManager. The event currently being processedcan be obtained via the getCurrentEvent() method of G4RunManager.3.5.2. Structure of an eventA G4Event object has four major types of in<strong>for</strong>mation. Get methods <strong>for</strong> this in<strong>for</strong>mation are available in G4Event.Primary vertexes and primary particlesDetails are given in Section 3.6.TrajectoriesTrajectories are stored in G4TrajectoryContainer class objects and the pointer to this container is stored inG4Event. The contents of a trajectory are given in Section 5.1.6.Hits collectionsCollections of hits generated by sensitive detectors are kept in G4HCofThisEvent class object and the pointerto this container class object is stored in G4Event. See Section 4.4 <strong>for</strong> the details.Digits collectionsCollections of digits generated by digitizer modules are kept in G4DCofThisEvent class object and the pointerto this container class object is stored in G4Event. See Section 4.5 <strong>for</strong> the details.3.5.3. Mandates of G4EventManagerG4EventManager is the manager class to take care of one event. It is responsible <strong>for</strong>:• converting G4PrimaryVertex and G4PrimaryParticle objects associated with the current G4Event object toG4Track objects. All of G4Track objects representing the primary particles are sent to G4StackManager.• Pop one G4Track object from G4StackManager and send it to G4TrackingManager. The current G4Track objectis deleted by G4EventManager after the track is simulated by G4TrackingManager, if the track is marked as"killed".• In case the primary track is "suspended" or "postponed to next event" by G4TrackingManager, it is sentback to the G4StackManager. Secondary G4Track objects returned by G4TrackingManager are also sent toG4StackManager.• When G4StackManager returns NULL <strong>for</strong> the "pop" request, G4EventManager terminates the current processingevent.• invokes the user-defined methods beginOfEventAction() and endOfEventAction() from theG4UserEventAction class. See Section 6.3 <strong>for</strong> details.3.5.4. Stacking mechanismG4StackManager has three stacks, named urgent, waiting and postpone-to-next-event, which are objects of theG4TrackStack class. By default, all G4Track objects are stored in the urgent stack and handled in a "last in firstout" manner. In this case, the other two stacks are not used. However, tracks may be routed to the other two stacksby the user-defined G4UserStackingAction concrete class.If the methods of G4UserStackingAction have been overridden by the user, the postpone-to-next-event and waitingstacks may contain tracks. At the beginning of an event, G4StackManager checks to see if any tracks left overfrom the previous event are stored in the postpone-to-next-event stack. If so, it attemps to move them to the urgentstack. But first the PrepareNewEvent() method of G4UserStackingAction is called. Here tracks may be reclassifiedby the user and sent to the urgent or waiting stacks, or deferred again to the postpone-to-next-event stack.48

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

Saved successfully!

Ooh no, something went wrong!