1 | <!-- ******************************************************** --> |
---|
2 | <!-- --> |
---|
3 | <!-- [History] --> |
---|
4 | <!-- Changed by: Katsuya Amako, 30-Nov-1998 --> |
---|
5 | <!-- Changed by: Katsuya Amako, 10-Jul-1998 --> |
---|
6 | <!-- Proof read by: Joe Chuma, 30-Jun-1999 --> |
---|
7 | <!-- Changed by: Takashi SasakI, 15-Nov-2001 --> |
---|
8 | <!-- Changed by: Dennis Wright, 27-Nov-2001 --> |
---|
9 | <!-- Converted to DocBook: Katsuya Amako, Aug-2006 --> |
---|
10 | <!-- Changed by: Hisaya Kurashige, 01-Dec-2007 --> |
---|
11 | <!-- Changed by: Hisaya Kurashige, 18-Nov-2009 --> |
---|
12 | <!-- --> |
---|
13 | <!-- ******************************************************** --> |
---|
14 | |
---|
15 | |
---|
16 | <!-- ******************* Section (Level#1) ****************** --> |
---|
17 | <sect1 id="sect.Track"> |
---|
18 | <title> |
---|
19 | Tracking |
---|
20 | </title> |
---|
21 | |
---|
22 | <!-- ******************* Section (Level#2) ****************** --> |
---|
23 | <sect2 id="sect.Track.Basic"> |
---|
24 | <title> |
---|
25 | Basic Concepts |
---|
26 | </title> |
---|
27 | |
---|
28 | <!-- ******* Bridgehead ******* --> |
---|
29 | <bridgehead renderas='sect4'> |
---|
30 | Philosophy of Tracking |
---|
31 | </bridgehead> |
---|
32 | |
---|
33 | <para> |
---|
34 | All Geant4 processes, including the transportation of particles, |
---|
35 | are treated generically. In spite of the name "<emphasis>tracking</emphasis>", |
---|
36 | particles are not <emphasis>transported</emphasis> in the tracking category. |
---|
37 | <emphasis>G4TrackingManager</emphasis> is an interface class which brokers |
---|
38 | transactions between the event, track and tracking categories. An |
---|
39 | instance of this class handles the message passing between the |
---|
40 | upper hierarchical object, which is the event manager, and lower |
---|
41 | hierarchical objects in the tracking category. The event manager is |
---|
42 | a singleton instance of the <emphasis>G4EventManager</emphasis> class. |
---|
43 | </para> |
---|
44 | |
---|
45 | <para> |
---|
46 | The tracking manager receives a track from the event manager and |
---|
47 | takes the actions required to finish tracking it. |
---|
48 | <emphasis>G4TrackingManager</emphasis> aggregates the pointers to |
---|
49 | <emphasis>G4SteppingManager,</emphasis> <emphasis>G4Trajectory</emphasis> and |
---|
50 | <emphasis>G4UserTrackingAction</emphasis>. Also there is a "use" relation to |
---|
51 | <emphasis>G4Track</emphasis> and <emphasis>G4Step</emphasis>. |
---|
52 | </para> |
---|
53 | |
---|
54 | <para> |
---|
55 | <emphasis>G4SteppingManager</emphasis> plays an essential role in tracking the |
---|
56 | particle. It takes care of all message passing between objects in |
---|
57 | the different categories relevant to transporting a particle (for |
---|
58 | example, geometry and interactions in matter). Its public method |
---|
59 | <literal>Stepping()</literal> steers the stepping of the particle. |
---|
60 | The algorithm to handle one step is given below. |
---|
61 | |
---|
62 | <orderedlist spacing="compact"> |
---|
63 | <listitem><para> |
---|
64 | If the particle stop (i.e. zero kinetic energy), each active atRest |
---|
65 | process proposes a step length in time based on the interaction |
---|
66 | it describes. And the process proposing the smallest step length |
---|
67 | will be invoked. |
---|
68 | </para></listitem> |
---|
69 | |
---|
70 | <listitem><para> |
---|
71 | Each active discrete or continuous process must propose a step |
---|
72 | length based on the interaction it describes. The smallest of these |
---|
73 | step lengths is taken. |
---|
74 | </para></listitem> |
---|
75 | |
---|
76 | <listitem><para> |
---|
77 | The geometry navigator calculates "Safety", the distance to the |
---|
78 | next volume boundary. If the minimum physical-step-length from the |
---|
79 | processes is shorter than "Safety", the physical-step-length is |
---|
80 | selected as the next step length. In this case, no further |
---|
81 | geometrical calculations will be performed. |
---|
82 | </para></listitem> |
---|
83 | |
---|
84 | <listitem><para> |
---|
85 | If the minimum physical-step-length from the processes is |
---|
86 | longer than "Safety", the distance to the next boundary is |
---|
87 | re-calculated. |
---|
88 | </para></listitem> |
---|
89 | |
---|
90 | <listitem><para> |
---|
91 | The smaller of the minimum physical-step-length and the |
---|
92 | geometric step length is taken. |
---|
93 | </para></listitem> |
---|
94 | |
---|
95 | <listitem><para> |
---|
96 | All active continuous processes are invoked. Note that the |
---|
97 | particle's kinetic energy will be updated only after all invoked |
---|
98 | processes have completed. The change in kinetic energy will be the |
---|
99 | sum of the contributions from these processes. |
---|
100 | </para></listitem> |
---|
101 | |
---|
102 | <listitem><para> |
---|
103 | The current track properties are updated before discrete |
---|
104 | processes are invoked. In the same time, the secondary |
---|
105 | particles created by processes are stored in SecondaryList. |
---|
106 | The updated properties are: |
---|
107 | <itemizedlist spacing="compact"> |
---|
108 | <listitem><para> |
---|
109 | updating the kinetic energy of the current track particle (note |
---|
110 | that 'sumEnergyChange' is the sum of the energy difference |
---|
111 | before and after each process invocation) |
---|
112 | </para></listitem> |
---|
113 | <listitem><para> |
---|
114 | updating position and time |
---|
115 | </para></listitem> |
---|
116 | </itemizedlist> |
---|
117 | </para></listitem> |
---|
118 | |
---|
119 | <listitem><para> |
---|
120 | The kinetic energy of the particle is checked to see whether |
---|
121 | or not it has been terminated by a continuous process. |
---|
122 | If the kinetic energy goes down to zero, atRest processes |
---|
123 | will be applied at the next step if applicable. |
---|
124 | </para></listitem> |
---|
125 | |
---|
126 | <listitem><para> |
---|
127 | The discrete process is invoked. After the invocation, |
---|
128 | <itemizedlist spacing="compact"> |
---|
129 | <listitem><para> |
---|
130 | the energy, position and time of the current track particle |
---|
131 | are updated, and |
---|
132 | </para></listitem> |
---|
133 | <listitem><para> |
---|
134 | the secondaries are stored in SecondaryList. |
---|
135 | </para></listitem> |
---|
136 | </itemizedlist> |
---|
137 | </para></listitem> |
---|
138 | |
---|
139 | <listitem><para> |
---|
140 | The track is checked to see whether or not it has been |
---|
141 | terminated by the discrete process. |
---|
142 | </para></listitem> |
---|
143 | |
---|
144 | <listitem><para> |
---|
145 | "Safety" is updated. |
---|
146 | </para></listitem> |
---|
147 | |
---|
148 | <listitem><para> |
---|
149 | If the step was limited by the volume boundary, push the |
---|
150 | particle into the next volume. |
---|
151 | </para></listitem> |
---|
152 | |
---|
153 | <listitem><para> |
---|
154 | Invoke the user intervention <emphasis>G4UserSteppingAction</emphasis>. |
---|
155 | </para></listitem> |
---|
156 | |
---|
157 | <listitem><para> |
---|
158 | Handle hit information. |
---|
159 | </para></listitem> |
---|
160 | |
---|
161 | <listitem><para> |
---|
162 | Save data to Trajectory. |
---|
163 | </para></listitem> |
---|
164 | |
---|
165 | <listitem><para> |
---|
166 | Update the mean free paths of the discrete processes. |
---|
167 | </para></listitem> |
---|
168 | |
---|
169 | <listitem><para> |
---|
170 | If the parent particle is still alive, reset the maximum |
---|
171 | interaction length of the discrete process which has occurred. |
---|
172 | </para></listitem> |
---|
173 | |
---|
174 | <listitem><para> |
---|
175 | One step completed. |
---|
176 | </para></listitem> |
---|
177 | |
---|
178 | </orderedlist> |
---|
179 | </para> |
---|
180 | |
---|
181 | |
---|
182 | <!-- ******* Bridgehead ******* --> |
---|
183 | <bridgehead renderas='sect4'> |
---|
184 | What is a Process? |
---|
185 | </bridgehead> |
---|
186 | |
---|
187 | <para> |
---|
188 | Only processes can change information of <emphasis>G4Track</emphasis> |
---|
189 | and add secondary tracks via <literal>ParticleChange</literal>. |
---|
190 | <emphasis>G4VProcess</emphasis> is a base class of all processes and |
---|
191 | it has 3 kinds of <literal>DoIt</literal> and |
---|
192 | <literal>GetPhysicalInteraction</literal> methods in order to |
---|
193 | describe interactions generically. |
---|
194 | If a user want to modify information of <emphasis>G4Track</emphasis>, |
---|
195 | he (or she) SHOULD create a special process for the purpose and |
---|
196 | register the process to the particle. |
---|
197 | </para> |
---|
198 | |
---|
199 | <!-- ******* Bridgehead ******* --> |
---|
200 | <bridgehead renderas='sect4'> |
---|
201 | What is a Track? |
---|
202 | </bridgehead> |
---|
203 | |
---|
204 | <para> |
---|
205 | <emphasis>G4Track</emphasis> keeps 'current' information of the particle. |
---|
206 | (i.e. energy,momentum, position ,time and so on) and has 'static' |
---|
207 | information (i.e. mass, charge, life and so on) also. |
---|
208 | Note that <emphasis>G4Track</emphasis> keeps information at the beginning |
---|
209 | of the step while the <literal>AlongStepDoIt</literal>s are being |
---|
210 | invoked for the step in progress.After finishing all |
---|
211 | <literal>AlongStepDoIt</literal>s, <emphasis>G4Track</emphasis> |
---|
212 | is updated. |
---|
213 | On the other hand, <emphasis>G4Track</emphasis> is |
---|
214 | updated after each invocation of a <literal>PostStepDoIt</literal>. |
---|
215 | </para> |
---|
216 | |
---|
217 | |
---|
218 | <!-- ******* Bridgehead ******* --> |
---|
219 | <bridgehead renderas='sect4'> |
---|
220 | What is a Step? |
---|
221 | </bridgehead> |
---|
222 | |
---|
223 | <para> |
---|
224 | <emphasis>G4Step</emphasis> stores the transient information of a step. This |
---|
225 | includes the two endpoints of the step, <literal>PreStepPoint</literal> and |
---|
226 | <literal>PostStepPoint</literal>, which contain the points' coordinates and |
---|
227 | the volumes containing the points. <emphasis>G4Step</emphasis> also stores the |
---|
228 | change in track properties between the two points. These |
---|
229 | properties, such as energy and momentum, are updated as the various |
---|
230 | active processes are invoked. |
---|
231 | </para> |
---|
232 | |
---|
233 | <!-- ******* Bridgehead ******* --> |
---|
234 | <bridgehead renderas='sect4'> |
---|
235 | What is a ParticleChange? |
---|
236 | </bridgehead> |
---|
237 | |
---|
238 | <para> |
---|
239 | Processes do NOT change any information of <emphasis>G4Track</emphasis> |
---|
240 | directly in their <literal>DoIt</literal>. Instead, they proposes |
---|
241 | changes as a result of interactions |
---|
242 | by using <literal>ParticleChange</literal>. |
---|
243 | After each <literal>DoIt</literal>, <literal>ParticleChange</literal> |
---|
244 | updates <literal>PostStepPoint</literal> based on proposed changes. |
---|
245 | Then, <emphasis>G4Track</emphasis> is updated |
---|
246 | after finishing all <literal>AlongStepDoIt</literal>s and |
---|
247 | after each <literal>PostStepDoIt</literal>. |
---|
248 | </para> |
---|
249 | |
---|
250 | |
---|
251 | |
---|
252 | </sect2> |
---|
253 | |
---|
254 | |
---|
255 | <!-- ******************* Section (Level#2) ****************** --> |
---|
256 | <sect2 id="sect.Track.AccInfo"> |
---|
257 | <title> |
---|
258 | Access to Track and Step Information |
---|
259 | </title> |
---|
260 | |
---|
261 | <!-- ******* Bridgehead ******* --> |
---|
262 | <bridgehead renderas='sect4'> |
---|
263 | How to Get Track Information |
---|
264 | </bridgehead> |
---|
265 | |
---|
266 | <para> |
---|
267 | Track information may be accessed by invoking various |
---|
268 | <literal>Get</literal> methods provided in the <emphasis>G4Track</emphasis> |
---|
269 | class. For details, see the |
---|
270 | <emphasis role="bold">Software Reference Manual</emphasis>. |
---|
271 | Typical information available includes: |
---|
272 | |
---|
273 | <itemizedlist spacing="compact"> |
---|
274 | <listitem><para> |
---|
275 | (x,y,z) |
---|
276 | </para></listitem> |
---|
277 | <listitem><para> |
---|
278 | Global time (time since the event was created) |
---|
279 | </para></listitem> |
---|
280 | <listitem><para> |
---|
281 | Local time (time since the track was created) |
---|
282 | </para></listitem> |
---|
283 | <listitem><para> |
---|
284 | Proper time (time in its rest frame since the track was created ) |
---|
285 | </para></listitem> |
---|
286 | <listitem><para> |
---|
287 | Momentum direction ( unit vector ) |
---|
288 | </para></listitem> |
---|
289 | <listitem><para> |
---|
290 | Kinetic energy |
---|
291 | </para></listitem> |
---|
292 | <listitem><para> |
---|
293 | Accumulated geometrical track length |
---|
294 | </para></listitem> |
---|
295 | <listitem><para> |
---|
296 | Accumulated true track length |
---|
297 | </para></listitem> |
---|
298 | <listitem><para> |
---|
299 | Pointer to dynamic particle |
---|
300 | </para></listitem> |
---|
301 | <listitem><para> |
---|
302 | Pointer to physical volume |
---|
303 | </para></listitem> |
---|
304 | <listitem><para> |
---|
305 | Track ID number |
---|
306 | </para></listitem> |
---|
307 | <listitem><para> |
---|
308 | Track ID number of the parent |
---|
309 | </para></listitem> |
---|
310 | <listitem><para> |
---|
311 | Current step number |
---|
312 | </para></listitem> |
---|
313 | <listitem><para> |
---|
314 | Track status |
---|
315 | </para></listitem> |
---|
316 | <listitem><para> |
---|
317 | (x,y,z) at the start point (vertex position) of the track |
---|
318 | </para></listitem> |
---|
319 | <listitem><para> |
---|
320 | Momentum direction at the start point (vertex position) of the |
---|
321 | track |
---|
322 | </para></listitem> |
---|
323 | <listitem><para> |
---|
324 | Kinetic energy at the start point (vertex position) of the track |
---|
325 | </para></listitem> |
---|
326 | <listitem><para> |
---|
327 | Pinter to the process which created the current track |
---|
328 | </para></listitem> |
---|
329 | </itemizedlist> |
---|
330 | </para> |
---|
331 | |
---|
332 | <!-- ******* Bridgehead ******* --> |
---|
333 | <bridgehead renderas='sect4'> |
---|
334 | How to Get Step Information |
---|
335 | </bridgehead> |
---|
336 | |
---|
337 | <para> |
---|
338 | Step and step-point information can be retrieved by invoking |
---|
339 | various <literal>Get</literal> methods provided in the |
---|
340 | <emphasis>G4Step</emphasis>/<emphasis>G4StepPoint</emphasis> |
---|
341 | classes. For details, see the |
---|
342 | <emphasis role="bold">Software Reference Manual</emphasis>. |
---|
343 | </para> |
---|
344 | |
---|
345 | <para> |
---|
346 | Information in <emphasis>G4Step</emphasis> |
---|
347 | includes: |
---|
348 | |
---|
349 | <itemizedlist spacing="compact"> |
---|
350 | <listitem><para> |
---|
351 | Pointers to <literal>PreStep</literal> and |
---|
352 | <literal>PostStepPoint</literal> |
---|
353 | </para></listitem> |
---|
354 | <listitem><para> |
---|
355 | Geometrical step length (step length before the correction of |
---|
356 | multiple scattering) |
---|
357 | </para></listitem> |
---|
358 | <listitem><para> |
---|
359 | True step length (step length after the correction of multiple |
---|
360 | scattering) |
---|
361 | </para></listitem> |
---|
362 | <listitem><para> |
---|
363 | Increment of position and time between <literal>PreStepPoint</literal> |
---|
364 | and <literal>PostStepPoint</literal> |
---|
365 | </para></listitem> |
---|
366 | <listitem><para> |
---|
367 | Increment of momentum and energy between <literal>PreStepPoint</literal> |
---|
368 | and <literal>PostStepPoint</literal>. (Note: to get the energy deposited in |
---|
369 | the step, you cannot use this 'Delta energy'. You have to use |
---|
370 | 'Total energy deposit' as below.) |
---|
371 | </para></listitem> |
---|
372 | <listitem><para> |
---|
373 | Pointer to <literal>G4Track</literal> |
---|
374 | </para></listitem> |
---|
375 | <listitem><para> |
---|
376 | Total energy deposited during the step - this is the sum of |
---|
377 | <para> |
---|
378 | <itemizedlist spacing="compact"> |
---|
379 | <listitem><para> |
---|
380 | the energy deposited by the energy loss process, and |
---|
381 | </para></listitem> |
---|
382 | <listitem><para> |
---|
383 | the energy lost by secondaries which have NOT been generated |
---|
384 | because each of their energies was below the cut threshold |
---|
385 | </para></listitem> |
---|
386 | </itemizedlist> |
---|
387 | </para> |
---|
388 | </para></listitem> |
---|
389 | <listitem><para> |
---|
390 | Energy deposited not by ionization during the step |
---|
391 | </para></listitem> |
---|
392 | </itemizedlist> |
---|
393 | </para> |
---|
394 | |
---|
395 | <para> |
---|
396 | Information in <emphasis>G4StepPoint</emphasis> |
---|
397 | (<literal>PreStepPoint</literal> and <literal>PostStepPoint</literal>) |
---|
398 | includes: |
---|
399 | |
---|
400 | <itemizedlist spacing="compact"> |
---|
401 | <listitem><para> |
---|
402 | (x, y, z, t) |
---|
403 | </para></listitem> |
---|
404 | <listitem><para> |
---|
405 | (px, py, pz, Ek) |
---|
406 | </para></listitem> |
---|
407 | <listitem><para> |
---|
408 | Momentum direction (unit vector) |
---|
409 | </para></listitem> |
---|
410 | <listitem><para> |
---|
411 | Pointers to physical volumes |
---|
412 | </para></listitem> |
---|
413 | <listitem><para> |
---|
414 | Safety |
---|
415 | </para></listitem> |
---|
416 | <listitem><para> |
---|
417 | Beta, gamma |
---|
418 | </para></listitem> |
---|
419 | <listitem><para> |
---|
420 | Polarization |
---|
421 | </para></listitem> |
---|
422 | <listitem><para> |
---|
423 | Step status |
---|
424 | </para></listitem> |
---|
425 | <listitem><para> |
---|
426 | Pointer to the physics process which defined the current step |
---|
427 | and its <literal>DoIt</literal> type |
---|
428 | </para></listitem> |
---|
429 | <listitem><para> |
---|
430 | Pointer to the physics process which defined the previous step |
---|
431 | and its <literal>DoIt</literal> type |
---|
432 | </para></listitem> |
---|
433 | <listitem><para> |
---|
434 | Total track length |
---|
435 | </para></listitem> |
---|
436 | <listitem><para> |
---|
437 | Global time (time since the current event began) |
---|
438 | </para></listitem> |
---|
439 | <listitem><para> |
---|
440 | Local time (time since the current track began) |
---|
441 | </para></listitem> |
---|
442 | <listitem><para> |
---|
443 | Proper time |
---|
444 | </para></listitem> |
---|
445 | </itemizedlist> |
---|
446 | </para> |
---|
447 | |
---|
448 | <!-- ******* Bridgehead ******* --> |
---|
449 | <bridgehead renderas='sect4'> |
---|
450 | How to Get "particle change" |
---|
451 | </bridgehead> |
---|
452 | |
---|
453 | <para> |
---|
454 | Particle change information can be accessed by invoking various |
---|
455 | <literal>Get</literal> methods provided in the |
---|
456 | <emphasis>G4ParticleChange</emphasis> class. |
---|
457 | Typical information available includes (for details, see the |
---|
458 | <emphasis role="bold">Software Reference Manual</emphasis>): |
---|
459 | |
---|
460 | <itemizedlist spacing="compact"> |
---|
461 | <listitem><para> |
---|
462 | final momentum direction of the parent particle |
---|
463 | </para></listitem> |
---|
464 | <listitem><para> |
---|
465 | final kinetic energy of the parent particle |
---|
466 | </para></listitem> |
---|
467 | <listitem><para> |
---|
468 | final position of the parent particle |
---|
469 | </para></listitem> |
---|
470 | <listitem><para> |
---|
471 | final global time of the parent particle |
---|
472 | </para></listitem> |
---|
473 | <listitem><para> |
---|
474 | final proper time of the parent particle |
---|
475 | </para></listitem> |
---|
476 | <listitem><para> |
---|
477 | final polarization of the parent particle |
---|
478 | </para></listitem> |
---|
479 | <listitem><para> |
---|
480 | status of the parent particle (<emphasis>G4TrackStatus</emphasis>) |
---|
481 | </para></listitem> |
---|
482 | <listitem><para> |
---|
483 | true step length (this is used by multiple scattering to store |
---|
484 | the result of the transformation from the geometrical step length |
---|
485 | to the true step length) |
---|
486 | </para></listitem> |
---|
487 | <listitem><para> |
---|
488 | local energy deposited - this consists of either |
---|
489 | <para> |
---|
490 | <itemizedlist spacing="compact"> |
---|
491 | <listitem><para> |
---|
492 | energy deposited by the energy loss process, or |
---|
493 | </para></listitem> |
---|
494 | <listitem><para> |
---|
495 | the energy lost by secondaries which have NOT been generated |
---|
496 | because each of their energies was below the cut threshold. |
---|
497 | </para></listitem> |
---|
498 | </itemizedlist> |
---|
499 | </para> |
---|
500 | </para></listitem> |
---|
501 | <listitem><para> |
---|
502 | number of secondaries particles |
---|
503 | </para></listitem> |
---|
504 | <listitem><para> |
---|
505 | list of secondary particles (list of <emphasis>G4Track</emphasis>) |
---|
506 | </para></listitem> |
---|
507 | </itemizedlist> |
---|
508 | </para> |
---|
509 | |
---|
510 | </sect2> |
---|
511 | |
---|
512 | |
---|
513 | <!-- ******************* Section (Level#2) ****************** --> |
---|
514 | <sect2 id="sect.Track.SecPar"> |
---|
515 | <title> |
---|
516 | Handling of Secondary Particles |
---|
517 | </title> |
---|
518 | |
---|
519 | <para> |
---|
520 | Secondary particles are passed as <emphasis>G4Track</emphasis>s from a physics |
---|
521 | process to tracking. |
---|
522 | <emphasis>G4ParticleChange</emphasis> provides the following |
---|
523 | four methods for a physics process: |
---|
524 | |
---|
525 | <itemizedlist spacing="compact"> |
---|
526 | <listitem><para> |
---|
527 | <literal>AddSecondary( G4Track* aSecondary )</literal> |
---|
528 | </para></listitem> |
---|
529 | <listitem><para> |
---|
530 | <literal>AddSecondary( G4DynamicParticle* aSecondary )</literal> |
---|
531 | </para></listitem> |
---|
532 | <listitem><para> |
---|
533 | <literal>AddSecondary( G4DynamicParticle* aSecondary, G4ThreeVector |
---|
534 | position )</literal> |
---|
535 | </para></listitem> |
---|
536 | <listitem><para> |
---|
537 | <literal>AddSecondary( G4DynamicParticle* aSecondary, G4double time)</literal> |
---|
538 | </para></listitem> |
---|
539 | </itemizedlist> |
---|
540 | </para> |
---|
541 | |
---|
542 | <para> |
---|
543 | In all but the first, the construction of <emphasis>G4Track</emphasis> is done in |
---|
544 | the methods using information given by the arguments. |
---|
545 | </para> |
---|
546 | |
---|
547 | </sect2> |
---|
548 | |
---|
549 | |
---|
550 | <!-- ******************* Section (Level#2) ****************** --> |
---|
551 | <sect2 id="sect.Track.UserAct"> |
---|
552 | <title> |
---|
553 | User Actions |
---|
554 | </title> |
---|
555 | |
---|
556 | <para> |
---|
557 | There are two classes which allow the user to intervene in the |
---|
558 | tracking. These are: |
---|
559 | |
---|
560 | <itemizedlist spacing="compact"> |
---|
561 | <listitem><para> |
---|
562 | <emphasis>G4UserTrackingAction</emphasis>, and |
---|
563 | </para></listitem> |
---|
564 | <listitem><para> |
---|
565 | <emphasis>G4UserSteppingAction</emphasis>. |
---|
566 | </para></listitem> |
---|
567 | </itemizedlist> |
---|
568 | </para> |
---|
569 | |
---|
570 | <para> |
---|
571 | Each provides methods which allow the user access to the Geant4 |
---|
572 | kernel at specific points in the tracking. For details, see the |
---|
573 | <emphasis role="bold">Software Reference Manual</emphasis>. |
---|
574 | </para> |
---|
575 | |
---|
576 | <para> |
---|
577 | <emphasis role="bold">Note:</emphasis> |
---|
578 | Users SHOULD NOT (and CAN NOT) change <emphasis>G4Track</emphasis> |
---|
579 | in <literal>UserSteppingAction</literal>. |
---|
580 | Only the exception is the <literal>TrackStatus</literal>. |
---|
581 | </para> |
---|
582 | |
---|
583 | </sect2> |
---|
584 | |
---|
585 | |
---|
586 | <!-- ******************* Section (Level#2) ****************** --> |
---|
587 | <sect2 id="sect.Track.Verb"> |
---|
588 | <title> |
---|
589 | Verbose Outputs |
---|
590 | </title> |
---|
591 | |
---|
592 | <para> |
---|
593 | The verbose information output flag can be turned on or off. The |
---|
594 | amount of information printed about the track/step, from brief to |
---|
595 | very detailed, can be controlled by the value of the verbose flag, |
---|
596 | for example, |
---|
597 | |
---|
598 | <informalexample> |
---|
599 | <programlisting> |
---|
600 | G4UImanager* UI = G4UImanager::GetUIpointer(); |
---|
601 | |
---|
602 | UI->ApplyCommand("/tracking/verbose 1"); |
---|
603 | </programlisting> |
---|
604 | </informalexample> |
---|
605 | </para> |
---|
606 | |
---|
607 | </sect2> |
---|
608 | |
---|
609 | |
---|
610 | <!-- ******************* Section (Level#2) ****************** --> |
---|
611 | <sect2 id="sect.Track.Traj"> |
---|
612 | <title> |
---|
613 | Trajectory and Trajectory Point |
---|
614 | </title> |
---|
615 | |
---|
616 | <!-- ******* Bridgehead ******* --> |
---|
617 | <bridgehead renderas='sect4'> |
---|
618 | G4Trajectory and G4TrajectoryPoint |
---|
619 | </bridgehead> |
---|
620 | |
---|
621 | <para> |
---|
622 | <emphasis>G4Trajectory</emphasis> and <emphasis>G4TrajectoryPoint</emphasis> |
---|
623 | are default concrete classes provided by Geant4, which are derived from the |
---|
624 | <emphasis>G4VTrajectory</emphasis> and <emphasis>G4VTrajectoryPoint</emphasis> |
---|
625 | base classes, respectively. |
---|
626 | A <emphasis>G4Trajectory</emphasis> class object is created by |
---|
627 | <emphasis>G4TrackingManager</emphasis> when a <emphasis>G4Track</emphasis> |
---|
628 | is passed from the <emphasis>G4EventManager</emphasis>. |
---|
629 | <emphasis>G4Trajectory</emphasis> has the following data |
---|
630 | members: |
---|
631 | |
---|
632 | <itemizedlist spacing="compact"> |
---|
633 | <listitem><para> |
---|
634 | ID numbers of the track and the track's parent |
---|
635 | </para></listitem> |
---|
636 | <listitem><para> |
---|
637 | particle name, charge, and PDG code |
---|
638 | </para></listitem> |
---|
639 | <listitem><para> |
---|
640 | a collection of <emphasis>G4TrajectoryPoint</emphasis> pointers |
---|
641 | </para></listitem> |
---|
642 | </itemizedlist> |
---|
643 | </para> |
---|
644 | |
---|
645 | <para> |
---|
646 | <emphasis>G4TrajectoryPoint</emphasis> corresponds to a step point along |
---|
647 | the path followed by the track. Its position is given by a |
---|
648 | <emphasis>G4ThreeVector</emphasis>. A <emphasis>G4TrajectoryPoint</emphasis> |
---|
649 | class object is created in the <emphasis>AppendStep()</emphasis> method of |
---|
650 | <emphasis>G4Trajectory</emphasis> and this method is invoked by |
---|
651 | <emphasis>G4TrackingManager</emphasis> at the end of each step. |
---|
652 | The first point is created when the <emphasis>G4Trajectory</emphasis> |
---|
653 | is created, thus the first point is the original vertex. |
---|
654 | </para> |
---|
655 | |
---|
656 | <para> |
---|
657 | The creation of a trajectory can be controlled by invoking |
---|
658 | <emphasis>G4TrackingManager::SetStoreTrajectory(G4bool)</emphasis>. The UI |
---|
659 | command <emphasis>/tracking/storeTrajectory _bool_</emphasis> does the same. The |
---|
660 | user can set this flag for each individual track from his/her |
---|
661 | <emphasis>G4UserTrackingAction::PreUserTrackingAction()</emphasis> method. |
---|
662 | </para> |
---|
663 | |
---|
664 | <note><title></title> |
---|
665 | <para> |
---|
666 | The user should not create trajectories for secondaries in a shower |
---|
667 | due to the large amount of memory consumed. |
---|
668 | </para> |
---|
669 | </note> |
---|
670 | |
---|
671 | <para> |
---|
672 | All the created trajectories in an event are stored in |
---|
673 | <emphasis>G4TrajectoryContainer</emphasis> class object and this object will be |
---|
674 | kept by <emphasis>G4Event</emphasis>. To draw or print trajectories generated in |
---|
675 | an event, the user may invoke the <emphasis>DrawTrajectory()</emphasis> or |
---|
676 | <emphasis>ShowTrajectory()</emphasis> methods of <emphasis>G4VTrajectory</emphasis>, |
---|
677 | respectively, from his/her |
---|
678 | <emphasis>G4UserEventAction::EndOfEventAction()</emphasis>. The geometry must be |
---|
679 | drawn before the trajectory drawing. The color of the drawn |
---|
680 | trajectory depends on the particle charge: |
---|
681 | |
---|
682 | <itemizedlist spacing="compact"> |
---|
683 | <listitem><para> |
---|
684 | negative: red |
---|
685 | </para></listitem> |
---|
686 | <listitem><para> |
---|
687 | neutral: green |
---|
688 | </para></listitem> |
---|
689 | <listitem><para> |
---|
690 | positive: blue |
---|
691 | </para></listitem> |
---|
692 | </itemizedlist> |
---|
693 | </para> |
---|
694 | |
---|
695 | <note><title></title> |
---|
696 | <para> |
---|
697 | Due to improvements in <emphasis>G4Navigator</emphasis>, a track |
---|
698 | can execute more than one turn of its spiral trajectory without |
---|
699 | being broken into smaller steps as long as the trajectory does not |
---|
700 | cross a geometrical boundary. Thus a drawn trajectory may not be |
---|
701 | circular. |
---|
702 | </para> |
---|
703 | </note> |
---|
704 | |
---|
705 | <!-- ******* Bridgehead ******* --> |
---|
706 | <bridgehead renderas='sect4'> |
---|
707 | Customizing trajectory and trajectory point |
---|
708 | </bridgehead> |
---|
709 | |
---|
710 | <para> |
---|
711 | <emphasis>G4Track</emphasis> and <emphasis>G4Step</emphasis> are |
---|
712 | transient classes; they are not available at the end of the event. |
---|
713 | Thus, the concrete classes <emphasis>G4VTrajectory</emphasis> and |
---|
714 | <emphasis>G4VTrajectoryPoint</emphasis> are the only |
---|
715 | ones a user may employ for end-of-event analysis or for |
---|
716 | persistency. As mentioned above, the default classes which Geant4 |
---|
717 | provides, i.e. <emphasis>G4Trajectory</emphasis> and |
---|
718 | <emphasis>G4TrajectoryPoint</emphasis>, |
---|
719 | have only very primitive quantities. The user can customize his/her |
---|
720 | own trajectory and trajectory point classes by deriving directly |
---|
721 | from the respective base classes. |
---|
722 | </para> |
---|
723 | |
---|
724 | <para> |
---|
725 | To use the customized trajectory, the user must construct a |
---|
726 | concrete trajectory class object in the |
---|
727 | <emphasis>G4UserTrackingAction::PreUserTrackingAction()</emphasis> method and |
---|
728 | make its pointer available to <emphasis>G4TrackingManager</emphasis> by using the |
---|
729 | <emphasis>SetTrajectory()</emphasis> method. The customized trajectory point |
---|
730 | class object must be constructed in the <emphasis>AppendStep()</emphasis> method |
---|
731 | of the user's implementation of the trajectory class. This |
---|
732 | <emphasis>AppendStep()</emphasis> method will be invoked by |
---|
733 | <emphasis>G4TrackingManager</emphasis>. |
---|
734 | </para> |
---|
735 | |
---|
736 | <para> |
---|
737 | To customize trajectory drawing, the user can override the |
---|
738 | <emphasis>DrawTrajectory()</emphasis> method in his/her own trajectory class. |
---|
739 | </para> |
---|
740 | |
---|
741 | <para> |
---|
742 | When a customized version of G4Trajectory declares any new class |
---|
743 | variables, <emphasis>operator new</emphasis> and |
---|
744 | <emphasis>operator delete</emphasis> must be |
---|
745 | provided. It is also useful to check that the allocation size in |
---|
746 | <emphasis>operator new</emphasis> is equal to |
---|
747 | <emphasis>sizeof(G4Trajectory)</emphasis>. These two points do not |
---|
748 | apply to <emphasis>G4VTrajectory</emphasis> because it has no |
---|
749 | <emphasis>operator new</emphasis> or <emphasis>operator delete</emphasis>. |
---|
750 | </para> |
---|
751 | |
---|
752 | |
---|
753 | </sect2> |
---|
754 | </sect1> |
---|