Contents Previous Next Geant4 User's Guide
For Application Developers
Toolkit Fundamentals


3.5 Event


3.5.1 Representation of an event

G4Event represents an event. An object of this class contains all inputs and outputs of the simulated event. This class object is constructed in G4RunManager and sent to G4EventManager. The event currently being processed can be obtained via the getCurrentEvent() method of G4RunManager.

3.5.2 Structure of an event

A G4Event object has four major types of information. Get methods for this information are available in G4Event.
Primary vertexes and primary particles
Details are given in Section 3.6.

Trajectories
Trajectories are stored in G4TrajectoryContainer class objects and the pointer to this container is stored in G4Event. The contents of a trajectory are given in 5.1.6.

Hits collections
Collections of hits generated by sensitive detectors are kept in G4HCofThisEvent class object and the pointer to this container class object is stored in G4Event. See Section 4.4 for the details.

Digits collections
Collections of digits generated by digitizer modules are kept in G4DCofThisEvent class object and the pointer to this container class object is stored in G4Event. See Section 4.5 for the details.

3.5.3 Mandates of G4EventManager

G4EventManager is the manager class to take care of one event. It is responsible for:

3.5.4. Stacking mechanism

G4StackManager has three stacks, named urgent, waiting and postpone-to-next-event, which are objects of the G4TrackStack class. By default, all G4Track objects are stored in the urgent stack and handled in a "last in first out" manner. In this case, the other two stacks are not used. However, tracks may be routed to the other two stacks by the user-defined G4UserStackingAction concrete class.

If the methods of G4UserStackingAction have been overridden by the user, the postpone-to-next-event and waiting stacks may contain tracks. At the beginning of an event, G4StackManager checks to see if any tracks left over from the previous event are stored in the postpone-to-next-event stack. If so, it attemps to move them to the urgent stack. But first the PrepareNewEvent() method of G4UserStackingAction is called. Here tracks may be re-classified by the user and sent to the urgent or waiting stacks, or deferred again to the postpone-to-next-event stack. As the event is processed G4StackManager pops tracks from the urgent stack until it is empty. At this point the NewStage() method of G4UserStackingAction is called. In this method tracks from the waiting stack may be sent to the urgent stack, retained in the waiting stack or postponed to the next event.

Details of the user-defined methods of G4UserStackingAction and how they affect track stack management are given in Section 6.2.


About the authors