Event
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.
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 .
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
.
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
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
for the details.
Mandates of G4EventManager
G4EventManager is the manager class to take care of one
event. It is responsible for:
converting G4PrimaryVertex and
G4PrimaryParticle
objects associated with the current G4Event object to
G4Track 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
object is 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 sent back to the
G4StackManager. Secondary
G4Track objects returned by
G4TrackingManager are also sent to
G4StackManager.
When G4StackManager returns NULL
for the "pop" request, G4EventManager terminates the
current processing event.
invokes the user-defined methods beginOfEventAction()
and endOfEventAction() from the
G4UserEventAction class. See
for details.
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 .