| 1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>3.5. Event</title><link rel="stylesheet" href="../xml/XSLCustomizationLayer/G4HTMLStylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="Geant4 User's Guide for Application Developers"><link rel="up" href="ch03.html" title="Chapter 3. Toolkit Fundamentals"><link rel="prev" href="ch03s04.html" title="3.4. Run"><link rel="next" href="ch03s06.html" title="3.6. Event Generator Interface"><script language="JavaScript">
|
|---|
| 2 | function remote_win(fName)
|
|---|
| 3 | {
|
|---|
| 4 | var url = "AllResources/Detector/geometry.src/" + fName;
|
|---|
| 5 | RemoteWin=window.open(url,"","resizable=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,width=520,height=520")
|
|---|
| 6 | RemoteWin.creator=self
|
|---|
| 7 | }
|
|---|
| 8 | </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.5.
|
|---|
| 9 | Event
|
|---|
| 10 | </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s04.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><th width="60%" align="center">Chapter 3.
|
|---|
| 11 | Toolkit Fundamentals
|
|---|
| 12 | </th><td width="20%" align="right"> <a accesskey="n" href="ch03s06.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.Event"></a>3.5.
|
|---|
| 13 | Event
|
|---|
| 14 | </h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.Event.Represent"></a>3.5.1.
|
|---|
| 15 | Representation of an event
|
|---|
| 16 | </h3></div></div></div><p>
|
|---|
| 17 | <span class="emphasis"><em>G4Event</em></span> represents an event. An object of this class
|
|---|
| 18 | contains all inputs and outputs of the simulated event. This class
|
|---|
| 19 | object is constructed in <span class="emphasis"><em>G4RunManager</em></span> and sent to
|
|---|
| 20 | <span class="emphasis"><em>G4EventManager</em></span>. The event currently being processed can be
|
|---|
| 21 | obtained via the <code class="literal">getCurrentEvent()</code> method of
|
|---|
| 22 | <span class="emphasis"><em>G4RunManager</em></span>.
|
|---|
| 23 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.Event.Struct"></a>3.5.2.
|
|---|
| 24 | Structure of an event
|
|---|
| 25 | </h3></div></div></div><p>
|
|---|
| 26 | A <span class="emphasis"><em>G4Event</em></span> object has four major types of information. Get
|
|---|
| 27 | methods for this information are available in <span class="emphasis"><em>G4Event</em></span>.
|
|---|
| 28 |
|
|---|
| 29 | </p><div class="variablelist"><p class="title"><b></b></p><dl><dt><span class="term">Primary vertexes and primary particles</span></dt><dd><p>
|
|---|
| 30 | Details are given in <a href="ch03s06.html" title="3.6.
|
|---|
| 31 | Event Generator Interface
|
|---|
| 32 | ">Section 3.6</a>.
|
|---|
| 33 | </p></dd><dt><span class="term">Trajectories</span></dt><dd><p>
|
|---|
| 34 | Trajectories are stored in G4TrajectoryContainer class objects
|
|---|
| 35 | and the pointer to this container is stored in <span class="emphasis"><em>G4Event</em></span>.
|
|---|
| 36 | The contents of a trajectory are given in
|
|---|
| 37 | <a href="ch05.html#sect.Track.Traj" title="5.1.6.
|
|---|
| 38 | Trajectory and Trajectory Point
|
|---|
| 39 | ">Section 5.1.6</a>.
|
|---|
| 40 | </p></dd><dt><span class="term">Hits collections</span></dt><dd><p>
|
|---|
| 41 | Collections of hits generated by <span class="emphasis"><em>sensitive detectors</em></span> are
|
|---|
| 42 | kept in <span class="emphasis"><em>G4HCofThisEvent</em></span> class object and the pointer to this
|
|---|
| 43 | container class object is stored in <span class="emphasis"><em>G4Event</em></span>. See
|
|---|
| 44 | <a href="ch04s04.html" title="4.4.
|
|---|
| 45 | Hits
|
|---|
| 46 | ">Section 4.4</a> for the details.
|
|---|
| 47 | </p></dd><dt><span class="term">Digits collections</span></dt><dd><p>
|
|---|
| 48 | Collections of digits generated by <span class="emphasis"><em>digitizer modules</em></span> are
|
|---|
| 49 | kept in <span class="emphasis"><em>G4DCofThisEvent</em></span> class object and the pointer to this
|
|---|
| 50 | container class object is stored in <span class="emphasis"><em>G4Event</em></span>. See
|
|---|
| 51 | <a href="ch04s05.html" title="4.5.
|
|---|
| 52 | Digitization
|
|---|
| 53 | ">Section 4.5</a> for the details.
|
|---|
| 54 | </p></dd></dl></div><p>
|
|---|
| 55 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.Event.ManEvtMan"></a>3.5.3.
|
|---|
| 56 | Mandates of <span class="emphasis"><em>G4EventManager</em></span>
|
|---|
| 57 | </h3></div></div></div><p>
|
|---|
| 58 | <span class="emphasis"><em>G4EventManager</em></span> is the manager class to take care of one
|
|---|
| 59 | event. It is responsible for:
|
|---|
| 60 |
|
|---|
| 61 | </p><div class="itemizedlist"><ul type="disc" compact><li><p>
|
|---|
| 62 | converting <span class="emphasis"><em>G4PrimaryVertex</em></span> and
|
|---|
| 63 | <span class="emphasis"><em>G4PrimaryParticle</em></span>
|
|---|
| 64 | objects associated with the current <span class="emphasis"><em>G4Event</em></span> object to
|
|---|
| 65 | <span class="emphasis"><em>G4Track</em></span> objects. All of <span class="emphasis"><em>G4Track</em></span>
|
|---|
| 66 | objects representing the primary particles are sent to
|
|---|
| 67 | <span class="emphasis"><em>G4StackManager</em></span>.
|
|---|
| 68 | </p></li><li><p>
|
|---|
| 69 | Pop one <span class="emphasis"><em>G4Track</em></span> object from
|
|---|
| 70 | <span class="emphasis"><em>G4StackManager</em></span> and send it to
|
|---|
| 71 | <span class="emphasis"><em>G4TrackingManager</em></span>. The current <span class="emphasis"><em>G4Track</em></span>
|
|---|
| 72 | object is deleted by <span class="emphasis"><em>G4EventManager</em></span> after the track is
|
|---|
| 73 | simulated by <span class="emphasis"><em>G4TrackingManager</em></span>, if the track is marked as
|
|---|
| 74 | "killed".
|
|---|
| 75 | </p></li><li><p>
|
|---|
| 76 | In case the primary track is "suspended" or "postponed to next
|
|---|
| 77 | event" by <span class="emphasis"><em>G4TrackingManager</em></span>, it is sent back to the
|
|---|
| 78 | <span class="emphasis"><em>G4StackManager</em></span>. Secondary
|
|---|
| 79 | <span class="emphasis"><em>G4Track</em></span> objects returned by
|
|---|
| 80 | <span class="emphasis"><em>G4TrackingManager</em></span> are also sent to
|
|---|
| 81 | <span class="emphasis"><em>G4StackManager</em></span>.
|
|---|
| 82 | </p></li><li><p>
|
|---|
| 83 | When <span class="emphasis"><em>G4StackManager</em></span> returns <code class="literal">NULL</code>
|
|---|
| 84 | for the "pop" request, <span class="emphasis"><em>G4EventManager</em></span> terminates the
|
|---|
| 85 | current processing event.
|
|---|
| 86 | </p></li><li><p>
|
|---|
| 87 | invokes the user-defined methods <code class="literal">beginOfEventAction()</code>
|
|---|
| 88 | and <code class="literal">endOfEventAction()</code> from the
|
|---|
| 89 | <span class="emphasis"><em>G4UserEventAction</em></span> class. See
|
|---|
| 90 | <a href="ch06s03.html" title="6.3.
|
|---|
| 91 | User Information Classes
|
|---|
| 92 | ">Section 6.3</a> for details.
|
|---|
| 93 | </p></li></ul></div><p>
|
|---|
| 94 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.Event.Stack"></a>3.5.4.
|
|---|
| 95 | Stacking mechanism
|
|---|
| 96 | </h3></div></div></div><p>
|
|---|
| 97 | <span class="emphasis"><em>G4StackManager</em></span> has three stacks, named
|
|---|
| 98 | <span class="emphasis"><em>urgent</em></span>, <span class="emphasis"><em>waiting</em></span> and
|
|---|
| 99 | <span class="emphasis"><em>postpone-to-next-event</em></span>, which are objects
|
|---|
| 100 | of the <span class="emphasis"><em>G4TrackStack</em></span> class. By default, all <span class="emphasis"><em>G4Track</em></span>
|
|---|
| 101 | objects are stored in the <span class="emphasis"><em>urgent</em></span> stack and handled in a
|
|---|
| 102 | "last in first out" manner. In this case, the other two stacks are
|
|---|
| 103 | not used. However, tracks may be routed to the other two stacks by
|
|---|
| 104 | the user-defined <span class="emphasis"><em>G4UserStackingAction</em></span> concrete class.
|
|---|
| 105 | </p><p>
|
|---|
| 106 | If the methods of <span class="emphasis"><em>G4UserStackingAction</em></span> have been
|
|---|
| 107 | overridden by the user, the <span class="emphasis"><em>postpone-to-next-event</em></span> and
|
|---|
| 108 | <span class="emphasis"><em>waiting</em></span> stacks may contain tracks. At the beginning of an
|
|---|
| 109 | event, <span class="emphasis"><em>G4StackManager</em></span> checks to see if any tracks left over
|
|---|
| 110 | from the previous event are stored in the <span class="emphasis"><em>postpone-to-next-event
|
|---|
| 111 | stack</em></span>. If so, it attemps to move them to the <span class="emphasis"><em>urgent</em></span>
|
|---|
| 112 | stack. But first the <code class="literal">PrepareNewEvent()</code> method of
|
|---|
| 113 | <span class="emphasis"><em>G4UserStackingAction</em></span> is called. Here tracks may be
|
|---|
| 114 | re-classified by the user and sent to the <span class="emphasis"><em>urgent</em></span> or
|
|---|
| 115 | <span class="emphasis"><em>waiting</em></span> stacks, or deferred again to the
|
|---|
| 116 | <span class="emphasis"><em>postpone-to-next-event</em></span> stack. As the event is processed
|
|---|
| 117 | <span class="emphasis"><em>G4StackManager</em></span> pops tracks from the <span class="emphasis"><em>urgent</em></span> stack
|
|---|
| 118 | until it is empty. At this point the <code class="literal">NewStage()</code> method of
|
|---|
| 119 | <span class="emphasis"><em>G4UserStackingAction</em></span> is called. In this method tracks from
|
|---|
| 120 | the <span class="emphasis"><em>waiting</em></span> stack may be sent to the <span class="emphasis"><em>urgent</em></span> stack,
|
|---|
| 121 | retained in the <span class="emphasis"><em>waiting</em></span> stack or postponed to the next
|
|---|
| 122 | event.
|
|---|
| 123 | </p><p>
|
|---|
| 124 | Details of the user-defined methods of
|
|---|
| 125 | <span class="emphasis"><em>G4UserStackingAction</em></span> and how they affect track stack
|
|---|
| 126 | management are given in <a href="ch06s03.html" title="6.3.
|
|---|
| 127 | User Information Classes
|
|---|
| 128 | ">Section 6.3</a>.
|
|---|
| 129 | </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s04.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html"><img src="AllResources/IconsGIF/up.gif" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s06.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">3.4.
|
|---|
| 130 | Run
|
|---|
| 131 | </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="AllResources/IconsGIF/home.gif" alt="Home"></a></td><td width="40%" align="right" valign="top"> 3.6.
|
|---|
| 132 | Event Generator Interface
|
|---|
| 133 | </td></tr></table></div></body></html>
|
|---|