source: trunk/Documentation/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch03s05.html@ 901

Last change on this file since 901 was 901, checked in by garnier, 17 years ago

Add Geant4 Documentation at 8.12.2008

File size: 9.9 KB
Line 
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">
2function 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. 
9Event
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. 
11Toolkit 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. 
13Event
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. 
15Representation 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
18contains all inputs and outputs of the simulated event. This class
19object 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
21obtained 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. 
24Structure of an event
25</h3></div></div></div><p>
26A <span class="emphasis"><em>G4Event</em></span> object has four major types of information. Get
27methods 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. 
31Event 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. 
38Trajectory 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. 
45Hits
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. 
52Digitization
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. 
56Mandates 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
59event. 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. 
91User 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. 
95Stacking 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
100of the <span class="emphasis"><em>G4TrackStack</em></span> class. By default, all <span class="emphasis"><em>G4Track</em></span>
101objects 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
103not used. However, tracks may be routed to the other two stacks by
104the user-defined <span class="emphasis"><em>G4UserStackingAction</em></span> concrete class.
105</p><p>
106If the methods of <span class="emphasis"><em>G4UserStackingAction</em></span> have been
107overridden 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
109event, <span class="emphasis"><em>G4StackManager</em></span> checks to see if any tracks left over
110from the previous event are stored in the <span class="emphasis"><em>postpone-to-next-event
111stack</em></span>. If so, it attemps to move them to the <span class="emphasis"><em>urgent</em></span>
112stack. But first the <code class="literal">PrepareNewEvent()</code> method of
113<span class="emphasis"><em>G4UserStackingAction</em></span> is called. Here tracks may be
114re-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
118until 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
120the <span class="emphasis"><em>waiting</em></span> stack may be sent to the <span class="emphasis"><em>urgent</em></span> stack,
121retained in the <span class="emphasis"><em>waiting</em></span> stack or postponed to the next
122event.
123</p><p>
124Details of the user-defined methods of
125<span class="emphasis"><em>G4UserStackingAction</em></span> and how they affect track stack
126management are given in <a href="ch06s03.html" title="6.3. 
127User 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. 
130Run
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. 
132Event Generator Interface
133</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.