| 1 | <HTML>
|
|---|
| 2 | <TITLE>
|
|---|
| 3 | </TITLE>
|
|---|
| 4 | <!-- Changed by: Katsuya Amako, 21-Sep-1998 -->
|
|---|
| 5 | <!-- Changed by: Dennis Wright, 29-Nov-2001 -->
|
|---|
| 6 | <!-- Proof read by: Joe Chuma, 28-Jun-1999 -->
|
|---|
| 7 |
|
|---|
| 8 | <BODY>
|
|---|
| 9 | <TABLE WIDTH="100%"><TR>
|
|---|
| 10 | <TD>
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 | <A HREF="index.html">
|
|---|
| 14 | <IMG SRC="../../../../resources/html/IconsGIF/Contents.gif" ALT="Contents"></A>
|
|---|
| 15 | <A HREF="run.html">
|
|---|
| 16 | <IMG SRC="../../../../resources/html/IconsGIF/Previous.gif" ALT="Previous"></A>
|
|---|
| 17 | <A HREF="eventGenerator.html">
|
|---|
| 18 | <IMG SRC="../../../../resources/html/IconsGIF/Next.gif" ALT="Next"></A>
|
|---|
| 19 | </TD>
|
|---|
| 20 | <TD ALIGN="Right">
|
|---|
| 21 | <FONT SIZE="-1" COLOR="#238E23">
|
|---|
| 22 | <B>Geant4 User's Guide</B>
|
|---|
| 23 | <BR>
|
|---|
| 24 | <B>For Application Developers</B>
|
|---|
| 25 | <BR>
|
|---|
| 26 | <B>Toolkit Fundamentals</B>
|
|---|
| 27 | </FONT>
|
|---|
| 28 | </TD>
|
|---|
| 29 | </TR></TABLE>
|
|---|
| 30 | <BR><BR>
|
|---|
| 31 |
|
|---|
| 32 | <P ALIGN="Center">
|
|---|
| 33 | <FONT SIZE="+3" COLOR="#238E23">
|
|---|
| 34 | <B>3.5 Event</B>
|
|---|
| 35 | </FONT>
|
|---|
| 36 | <BR><BR>
|
|---|
| 37 |
|
|---|
| 38 | <HR ALIGN="Center" SIZE="7%">
|
|---|
| 39 |
|
|---|
| 40 | <p>
|
|---|
| 41 | <a name="3.5.1">
|
|---|
| 42 | <H2>3.5.1 Representation of an event</H2></a>
|
|---|
| 43 |
|
|---|
| 44 | <i>G4Event</i> represents an event. An object of this class
|
|---|
| 45 | contains all inputs and outputs of the simulated event. This
|
|---|
| 46 | class object is constructed in <i>G4RunManager</i> and
|
|---|
| 47 | sent to <i>G4EventManager</i>. The event currently being
|
|---|
| 48 | processed can be obtained via the <tt>getCurrentEvent()</tt> method
|
|---|
| 49 | of <i>G4RunManager</i>.
|
|---|
| 50 |
|
|---|
| 51 | <a name="3.5.2">
|
|---|
| 52 | <H2>3.5.2 Structure of an event</H2></a>
|
|---|
| 53 |
|
|---|
| 54 | A <i>G4Event</i> object has four major types of information. Get methods
|
|---|
| 55 | for this information are available in <i>G4Event</i>.
|
|---|
| 56 | <dl><dl>
|
|---|
| 57 | <dt>Primary vertexes and primary particles
|
|---|
| 58 | <dd>Details are given in
|
|---|
| 59 | <a href="eventGenerator.html">Section 3.6</a>.
|
|---|
| 60 | <p>
|
|---|
| 61 | <dt>Trajectories
|
|---|
| 62 | <dd>Trajectories are stored in G4TrajectoryContainer class
|
|---|
| 63 | objects and the pointer to this container is stored in <i>G4Event</i>.
|
|---|
| 64 | The contents of a trajectory are given in
|
|---|
| 65 | <a href="../TrackingAndPhysics/tracking.html#5.1.6">5.1.6</a>.<p>
|
|---|
| 66 | <dt>Hits collections
|
|---|
| 67 | <dd>Collections of hits generated by <i>sensitive detectors</i>
|
|---|
| 68 | are kept in <i>G4HCofThisEvent</i> class object and the pointer to
|
|---|
| 69 | this container class object is stored in <i>G4Event</i>. See
|
|---|
| 70 | <a href="../Detector/hit.html">Section 4.4</a> for the details.<p>
|
|---|
| 71 | <dt>Digits collections
|
|---|
| 72 | <dd>Collections of digits generated by <i>digitizer modules</i>
|
|---|
| 73 | are kept in <i>G4DCofThisEvent</i> class object and the pointer to
|
|---|
| 74 | this container class object is stored in <i>G4Event</i>. See
|
|---|
| 75 | <a href="../Detector/digitization.html">Section 4.5</a> for the details.
|
|---|
| 76 | </dl></dl>
|
|---|
| 77 |
|
|---|
| 78 | <a name="3.5.3">
|
|---|
| 79 | <H2>3.5.3 Mandates of <i>G4EventManager</i></H2></a>
|
|---|
| 80 |
|
|---|
| 81 | <i>G4EventManager</i> is the manager class to take care of
|
|---|
| 82 | one event. It is responsible for:
|
|---|
| 83 | <ul>
|
|---|
| 84 | <li>converting <i>G4PrimaryVertex</i> and <i>G4PrimaryParticle</i>
|
|---|
| 85 | objects associated with the current <i>G4Event</i> object to
|
|---|
| 86 | <i>G4Track</i> objects. All of <i>G4Track</i> objects representing
|
|---|
| 87 | the primary particles are sent to <i>G4StackManager</i>.
|
|---|
| 88 | <li>Pop one <i>G4Track</i> object from <i>G4StackManager</i>
|
|---|
| 89 | and send it to <i>G4TrackingManager</i>. The current <i>G4Track</i>
|
|---|
| 90 | object is deleted by <i>G4EventManager</i> after the track is
|
|---|
| 91 | simulated by <i>G4TrackingManager</i>, if the track is marked as
|
|---|
| 92 | "killed".
|
|---|
| 93 | <li>In case the primary track is "suspended" or "postponed to next event"
|
|---|
| 94 | by <i>G4TrackingManager</i>, it is sent back to the
|
|---|
| 95 | <i>G4StackManager</i>. Secondary <i>G4Track</i> objects returned by
|
|---|
| 96 | <i>G4TrackingManager</i> are also sent to <i>G4StackManager</i>.
|
|---|
| 97 | <li>When <i>G4StackManager</i> returns <tt>NULL</tt> for the "pop"
|
|---|
| 98 | request, <i>G4EventManager</i> terminates the current processing
|
|---|
| 99 | event.
|
|---|
| 100 | <li> invokes the user-defined methods <tt>beginOfEventAction()</tt> and
|
|---|
| 101 | <tt>endOfEventAction()</tt> from the <i>G4UserEventAction</i> class. See
|
|---|
| 102 | <a href="../UserActions/OptionalActions.html">Section 6.2</a> for details.
|
|---|
| 103 | <p>
|
|---|
| 104 | </ul>
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 | <a name="3.5.4">
|
|---|
| 108 | <H2>3.5.4. Stacking mechanism</H2></a>
|
|---|
| 109 |
|
|---|
| 110 | <i>G4StackManager</i> has three stacks, named <i>urgent</i>, <i>waiting</i>
|
|---|
| 111 | and <i>postpone-to-next-event</i>, which are objects of the
|
|---|
| 112 | <i>G4TrackStack</i> class. By default, all <i>G4Track</i> objects are
|
|---|
| 113 | stored in the <i>urgent</i> stack and handled in a "last in first out"
|
|---|
| 114 | manner. In this case, the other two stacks are not used. However, tracks
|
|---|
| 115 | may be routed to the other two stacks by the user-defined
|
|---|
| 116 | <i>G4UserStackingAction</i> concrete class.
|
|---|
| 117 | <p>
|
|---|
| 118 | If the methods of <i>G4UserStackingAction</i> have been overridden by the
|
|---|
| 119 | user, the <i>postpone-to-next-event</i> and <i>waiting</i> stacks may
|
|---|
| 120 | contain tracks. At the beginning of an event, <i>G4StackManager</i> checks
|
|---|
| 121 | to see if any tracks left over from the previous event are stored in the
|
|---|
| 122 | <i>postpone-to-next-event stack</i>. If so, it attemps to move them to the
|
|---|
| 123 | <i>urgent</i> stack. But first the <tt>PrepareNewEvent()</tt> method of
|
|---|
| 124 | <i>G4UserStackingAction</i> is called. Here tracks may be re-classified by
|
|---|
| 125 | the user and sent to the <i>urgent</i> or <i>waiting</i> stacks, or
|
|---|
| 126 | deferred again to the <i>postpone-to-next-event</i> stack. As the event is
|
|---|
| 127 | processed <i>G4StackManager</i> pops tracks from the <i>urgent</i> stack
|
|---|
| 128 | until it is empty. At this point the <tt>NewStage()</tt> method of
|
|---|
| 129 | <i>G4UserStackingAction</i> is called. In this method tracks from the
|
|---|
| 130 | <i>waiting</i> stack may be sent to the <i>urgent</i> stack, retained in
|
|---|
| 131 | the <i>waiting</i> stack or postponed to the next event.
|
|---|
| 132 | <p>
|
|---|
| 133 | Details of the user-defined methods of <i>G4UserStackingAction</i> and how
|
|---|
| 134 | they affect track stack management are given in
|
|---|
| 135 | <a href="../UserActions/OptionalActions.html">Section 6.2</a>.
|
|---|
| 136 |
|
|---|
| 137 | <BR><BR>
|
|---|
| 138 | <HR>
|
|---|
| 139 | <A HREF="../../../../Authors/html/subjectsToAuthors.html">
|
|---|
| 140 | <I>About the authors</I></A>
|
|---|
| 141 |
|
|---|
| 142 | </BODY>
|
|---|
| 143 | </HTML>
|
|---|