[904] | 1 | <!-- ******************************************************** --> |
---|
| 2 | <!-- --> |
---|
| 3 | <!-- [History] --> |
---|
| 4 | <!-- Converted to DocBook: Katsuya Amako, Aug-2006 --> |
---|
| 5 | <!-- Changed by: Katsuya Amako, 21-Sep-1998 --> |
---|
| 6 | <!-- Changed by: Dennis Wright, 29-Nov-2001 --> |
---|
| 7 | <!-- Proof read by: Joe Chuma, 28-Jun-1999 --> |
---|
| 8 | <!-- --> |
---|
| 9 | <!-- ******************************************************** --> |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | <!-- ******************* Section (Level#1) ****************** --> |
---|
| 13 | <sect1 id="sect.Event"> |
---|
| 14 | <title> |
---|
| 15 | Event |
---|
| 16 | </title> |
---|
| 17 | |
---|
| 18 | <!-- ******************* Section (Level#2) ****************** --> |
---|
| 19 | <sect2 id="sect.Event.Represent"> |
---|
| 20 | <title> |
---|
| 21 | Representation of an event |
---|
| 22 | </title> |
---|
| 23 | |
---|
| 24 | <para> |
---|
| 25 | <emphasis>G4Event</emphasis> represents an event. An object of this class |
---|
| 26 | contains all inputs and outputs of the simulated event. This class |
---|
| 27 | object is constructed in <emphasis>G4RunManager</emphasis> and sent to |
---|
| 28 | <emphasis>G4EventManager</emphasis>. The event currently being processed can be |
---|
| 29 | obtained via the <literal>getCurrentEvent()</literal> method of |
---|
| 30 | <emphasis>G4RunManager</emphasis>. |
---|
| 31 | </para> |
---|
| 32 | |
---|
| 33 | </sect2> |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | <!-- ******************* Section (Level#2) ****************** --> |
---|
| 37 | <sect2 id="sect.Event.Struct"> |
---|
| 38 | <title> |
---|
| 39 | Structure of an event |
---|
| 40 | </title> |
---|
| 41 | |
---|
| 42 | <para> |
---|
| 43 | A <emphasis>G4Event</emphasis> object has four major types of information. Get |
---|
| 44 | methods for this information are available in <emphasis>G4Event</emphasis>. |
---|
| 45 | |
---|
| 46 | <variablelist><title></title> |
---|
| 47 | <varlistentry> |
---|
| 48 | <term>Primary vertexes and primary particles</term> |
---|
| 49 | <listitem><para> |
---|
| 50 | Details are given in <xref linkend="sect.EventGen" />. |
---|
| 51 | </para></listitem> |
---|
| 52 | </varlistentry> |
---|
| 53 | <varlistentry> |
---|
| 54 | <term>Trajectories</term> |
---|
| 55 | <listitem><para> |
---|
| 56 | Trajectories are stored in G4TrajectoryContainer class objects |
---|
| 57 | and the pointer to this container is stored in <emphasis>G4Event</emphasis>. |
---|
| 58 | The contents of a trajectory are given in |
---|
| 59 | <xref linkend="sect.Track.Traj" />. |
---|
| 60 | </para></listitem> |
---|
| 61 | </varlistentry> |
---|
| 62 | <varlistentry> |
---|
| 63 | <term>Hits collections</term> |
---|
| 64 | <listitem><para> |
---|
| 65 | Collections of hits generated by <emphasis>sensitive detectors</emphasis> are |
---|
| 66 | kept in <emphasis>G4HCofThisEvent</emphasis> class object and the pointer to this |
---|
| 67 | container class object is stored in <emphasis>G4Event</emphasis>. See |
---|
| 68 | <xref linkend="sect.Hits" /> for the details. |
---|
| 69 | </para></listitem> |
---|
| 70 | </varlistentry> |
---|
| 71 | <varlistentry> |
---|
| 72 | <term>Digits collections</term> |
---|
| 73 | <listitem><para> |
---|
| 74 | Collections of digits generated by <emphasis>digitizer modules</emphasis> are |
---|
| 75 | kept in <emphasis>G4DCofThisEvent</emphasis> class object and the pointer to this |
---|
| 76 | container class object is stored in <emphasis>G4Event</emphasis>. See |
---|
| 77 | <xref linkend="sect.Digi" /> for the details. |
---|
| 78 | </para></listitem> |
---|
| 79 | </varlistentry> |
---|
| 80 | </variablelist> |
---|
| 81 | </para> |
---|
| 82 | |
---|
| 83 | </sect2> |
---|
| 84 | |
---|
| 85 | <!-- ******************* Section (Level#2) ****************** --> |
---|
| 86 | <sect2 id="sect.Event.ManEvtMan"> |
---|
| 87 | <title> |
---|
| 88 | Mandates of <emphasis>G4EventManager</emphasis> |
---|
| 89 | </title> |
---|
| 90 | |
---|
| 91 | <para> |
---|
| 92 | <emphasis>G4EventManager</emphasis> is the manager class to take care of one |
---|
| 93 | event. It is responsible for: |
---|
| 94 | |
---|
| 95 | <itemizedlist spacing="compact"> |
---|
| 96 | <listitem><para> |
---|
| 97 | converting <emphasis>G4PrimaryVertex</emphasis> and |
---|
| 98 | <emphasis>G4PrimaryParticle</emphasis> |
---|
| 99 | objects associated with the current <emphasis>G4Event</emphasis> object to |
---|
| 100 | <emphasis>G4Track</emphasis> objects. All of <emphasis>G4Track</emphasis> |
---|
| 101 | objects representing the primary particles are sent to |
---|
| 102 | <emphasis>G4StackManager</emphasis>. |
---|
| 103 | </para></listitem> |
---|
| 104 | <listitem><para> |
---|
| 105 | Pop one <emphasis>G4Track</emphasis> object from |
---|
| 106 | <emphasis>G4StackManager</emphasis> and send it to |
---|
| 107 | <emphasis>G4TrackingManager</emphasis>. The current <emphasis>G4Track</emphasis> |
---|
| 108 | object is deleted by <emphasis>G4EventManager</emphasis> after the track is |
---|
| 109 | simulated by <emphasis>G4TrackingManager</emphasis>, if the track is marked as |
---|
| 110 | "killed". |
---|
| 111 | </para></listitem> |
---|
| 112 | <listitem><para> |
---|
| 113 | In case the primary track is "suspended" or "postponed to next |
---|
| 114 | event" by <emphasis>G4TrackingManager</emphasis>, it is sent back to the |
---|
| 115 | <emphasis>G4StackManager</emphasis>. Secondary |
---|
| 116 | <emphasis>G4Track</emphasis> objects returned by |
---|
| 117 | <emphasis>G4TrackingManager</emphasis> are also sent to |
---|
| 118 | <emphasis>G4StackManager</emphasis>. |
---|
| 119 | </para></listitem> |
---|
| 120 | <listitem><para> |
---|
| 121 | When <emphasis>G4StackManager</emphasis> returns <literal>NULL</literal> |
---|
| 122 | for the "pop" request, <emphasis>G4EventManager</emphasis> terminates the |
---|
| 123 | current processing event. |
---|
| 124 | </para></listitem> |
---|
| 125 | <listitem><para> |
---|
| 126 | invokes the user-defined methods <literal>beginOfEventAction()</literal> |
---|
| 127 | and <literal>endOfEventAction()</literal> from the |
---|
| 128 | <emphasis>G4UserEventAction</emphasis> class. See |
---|
| 129 | <xref linkend="sect.UInfoCls" /> for details. |
---|
| 130 | </para></listitem> |
---|
| 131 | </itemizedlist> |
---|
| 132 | </para> |
---|
| 133 | |
---|
| 134 | </sect2> |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | <!-- ******************* Section (Level#2) ****************** --> |
---|
| 138 | <sect2 id="sect.Event.Stack"> |
---|
| 139 | <title> |
---|
| 140 | Stacking mechanism |
---|
| 141 | </title> |
---|
| 142 | |
---|
| 143 | <para> |
---|
| 144 | <emphasis>G4StackManager</emphasis> has three stacks, named |
---|
| 145 | <emphasis>urgent</emphasis>, <emphasis>waiting</emphasis> and |
---|
| 146 | <emphasis>postpone-to-next-event</emphasis>, which are objects |
---|
| 147 | of the <emphasis>G4TrackStack</emphasis> class. By default, all <emphasis>G4Track</emphasis> |
---|
| 148 | objects are stored in the <emphasis>urgent</emphasis> stack and handled in a |
---|
| 149 | "last in first out" manner. In this case, the other two stacks are |
---|
| 150 | not used. However, tracks may be routed to the other two stacks by |
---|
| 151 | the user-defined <emphasis>G4UserStackingAction</emphasis> concrete class. |
---|
| 152 | </para> |
---|
| 153 | |
---|
| 154 | <para> |
---|
| 155 | If the methods of <emphasis>G4UserStackingAction</emphasis> have been |
---|
| 156 | overridden by the user, the <emphasis>postpone-to-next-event</emphasis> and |
---|
| 157 | <emphasis>waiting</emphasis> stacks may contain tracks. At the beginning of an |
---|
| 158 | event, <emphasis>G4StackManager</emphasis> checks to see if any tracks left over |
---|
| 159 | from the previous event are stored in the <emphasis>postpone-to-next-event |
---|
| 160 | stack</emphasis>. If so, it attemps to move them to the <emphasis>urgent</emphasis> |
---|
| 161 | stack. But first the <literal>PrepareNewEvent()</literal> method of |
---|
| 162 | <emphasis>G4UserStackingAction</emphasis> is called. Here tracks may be |
---|
| 163 | re-classified by the user and sent to the <emphasis>urgent</emphasis> or |
---|
| 164 | <emphasis>waiting</emphasis> stacks, or deferred again to the |
---|
| 165 | <emphasis>postpone-to-next-event</emphasis> stack. As the event is processed |
---|
| 166 | <emphasis>G4StackManager</emphasis> pops tracks from the <emphasis>urgent</emphasis> stack |
---|
| 167 | until it is empty. At this point the <literal>NewStage()</literal> method of |
---|
| 168 | <emphasis>G4UserStackingAction</emphasis> is called. In this method tracks from |
---|
| 169 | the <emphasis>waiting</emphasis> stack may be sent to the <emphasis>urgent</emphasis> stack, |
---|
| 170 | retained in the <emphasis>waiting</emphasis> stack or postponed to the next |
---|
| 171 | event. |
---|
| 172 | </para> |
---|
| 173 | |
---|
| 174 | <para> |
---|
| 175 | Details of the user-defined methods of |
---|
| 176 | <emphasis>G4UserStackingAction</emphasis> and how they affect track stack |
---|
| 177 | management are given in <xref linkend="sect.UInfoCls" />. |
---|
| 178 | </para> |
---|
| 179 | |
---|
| 180 | |
---|
| 181 | </sect2> |
---|
| 182 | </sect1> |
---|