1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 3. Toolkit Fundamentals</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="index.html" title="Geant4 User's Guide for Application Developers"><link rel="prev" href="ch02s10.html" title="2.10. How to Visualize the Detector and Events"><link rel="next" href="ch03s02.html" title="3.2. Global Usage Classes"><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">Chapter 3. |
---|
9 | Toolkit Fundamentals |
---|
10 | </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s10.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch03s02.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="chap.ToolkitFundamentals"></a>Chapter 3. |
---|
11 | Toolkit Fundamentals |
---|
12 | </h2></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.ClassCate"></a>3.1. |
---|
13 | Class Categories and Domains |
---|
14 | </h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.ClassCate.WhatIsClassCate"></a>3.1.1. |
---|
15 | What is a class category? |
---|
16 | </h3></div></div></div><p> |
---|
17 | In the design of a large software system such as Geant4, it is |
---|
18 | essential to partition it into smaller logical units. This makes |
---|
19 | the design well organized and easier to develop. Once the logical |
---|
20 | units are defined independent to each other as much as possible, |
---|
21 | they can be developed in parallel without serious interference. |
---|
22 | </p><p> |
---|
23 | In object-oriented analysis and design methodology by Grady Booch |
---|
24 | [<span class="citation"> |
---|
25 | <a href="bi01.html#biblio.booch1994"> |
---|
26 | Booch1994 |
---|
27 | </a> |
---|
28 | </span>] |
---|
29 | , class categories are used to |
---|
30 | create logical units. They are defined as "clusters of classes that |
---|
31 | are themselves cohesive, but are loosely coupled relative to other |
---|
32 | clusters." This means that a class category contains classes which |
---|
33 | have a close relationship (for example, the "has-a" relation). |
---|
34 | However, relationships between classes which belong to different |
---|
35 | class categories are weak, i.e., only limitted classes of these |
---|
36 | have "uses" relations. The class categories and their relations are |
---|
37 | presented by a class category diagram. The class category diagram |
---|
38 | designed for Geant4 is shown in the figure below. Each box in the |
---|
39 | figure represents a class category, and a "uses" relation by a |
---|
40 | straight line. The circle at an end of a straight line means the |
---|
41 | class category which has this circle uses the other category. |
---|
42 | |
---|
43 | </p><div class="figure"><a name="fig.G4ClassCategory"></a><div class="figure-contents"><div class="mediaobject" align="center"><img src="./AllResources/Fundamentals/classCategory.gif" align="middle" alt="Geant4 class categories"></div></div><p class="title"><b>Figure 3.1. |
---|
44 | Geant4 class categories |
---|
45 | </b></p></div><p><br class="figure-break"> |
---|
46 | </p><p> |
---|
47 | The file organization of the Geant4 codes follows basically the |
---|
48 | structure of this class cateogory. This <span class="emphasis"><em>User's Manual</em></span> |
---|
49 | is also organized according to class categories. |
---|
50 | </p><p> |
---|
51 | In the development and maintenance of Geant4, one software team |
---|
52 | will be assigned to a class category. This team will have a |
---|
53 | responsibility to develop and maintain all classes belonging to the |
---|
54 | class category. |
---|
55 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.ClassCate.ClassCateInGeant4"></a>3.1.2. |
---|
56 | Class categories in Geant4 |
---|
57 | </h3></div></div></div><p> |
---|
58 | The following is a brief summary of the role of each class category |
---|
59 | in Geant4. |
---|
60 | |
---|
61 | </p><div class="orderedlist"><ol type="1" compact><li><p><span class="bold"><strong>Run and Event</strong></span> |
---|
62 | </p><p>These are categories related to the generation of events, |
---|
63 | interfaces to event generators, and any secondary particles |
---|
64 | produced. Their roles are principally to provide particles to be |
---|
65 | tracked to the Tracking Management. |
---|
66 | </p><p> |
---|
67 | </p></li><li><p><span class="bold"><strong>Tracking and Track</strong></span> |
---|
68 | </p><p>These are categories related to propagating a particle by |
---|
69 | analyzing the factors limiting the step and applying the relevant |
---|
70 | physics processes. The important aspect of the design was that a |
---|
71 | generalized Geant4 physics process (or interaction) could perform |
---|
72 | actions, along a tracking step, either localized in space, or in |
---|
73 | time, or distributed in space and time (and all the possible |
---|
74 | combinations that could be built from these cases). |
---|
75 | </p><p> |
---|
76 | </p></li><li><p><span class="bold"><strong>Geometry and Magnetic Field</strong></span> |
---|
77 | </p><p>These categories manage the geometrical definition of a detector |
---|
78 | (solid modeling) and the computation of distances to solids (also |
---|
79 | in a magnetic field). The Geant4 geometry solid modeler is based on |
---|
80 | the ISO STEP standard and it is fully compliant with it, in order |
---|
81 | to allow in future the exchange of geometrical information with CAD |
---|
82 | systems. A key feature of the Geant4 geometry is that the volume |
---|
83 | definitions are independent of the solid representation. By this |
---|
84 | abstract interface for the G4 solids, the tracking component works |
---|
85 | identically for various representations. The treatment of the |
---|
86 | propagation in the presence of fields has been provided within |
---|
87 | specified accuracy. An OO design allows us to exchange different |
---|
88 | numerical algorithms and/or different fields (not only B-field), |
---|
89 | without affecting any other component of the toolkit. |
---|
90 | </p><p> |
---|
91 | </p></li><li><p><span class="bold"><strong>Particle Definition and Matter</strong></span> |
---|
92 | </p><p>These two categories manage the the definition of materials and |
---|
93 | particles. |
---|
94 | </p><p> |
---|
95 | </p></li><li><p><span class="bold"><strong>Physics</strong></span> |
---|
96 | </p><p>This category manages all physics processes participating in the |
---|
97 | interactions of particles in matter. The abstract interface of |
---|
98 | physics processes allows multiple implementations of physics models |
---|
99 | per interaction or per channel. Models can be selected by energy |
---|
100 | range, particle type, material, etc. Data encapsulation and |
---|
101 | polymorphism make it possible to give transparent access to the |
---|
102 | cross sections (independently of the choice of reading from an |
---|
103 | ascii file, or of interpolating from a tabulated set, or of |
---|
104 | computing analytically from a formula). Electromagnetic and |
---|
105 | hadronic physics were handled in a uniform way in such a design, |
---|
106 | opening up the physics to the users. |
---|
107 | </p><p> |
---|
108 | </p></li><li><p><span class="bold"><strong>Hits and Digitization</strong></span> |
---|
109 | </p><p>These two categories manage the creation of hits and their use |
---|
110 | for the digitization phase. The basic design and implementation of |
---|
111 | the Hits and Digi had been realized, and also several prototypes, |
---|
112 | test cases and scenarios had been developed before the |
---|
113 | alpha-release. Volumes (not necessarily the ones used by the |
---|
114 | tracking) are aggregated in sensitive detectors, while hits |
---|
115 | collections represent the logical read out of the detector. |
---|
116 | Different ways of creating and managing hits collections had been |
---|
117 | delivered and tested, notably for both single hits and calorimetry |
---|
118 | hits types. In all cases, hits collections had been successfully |
---|
119 | stored into and retrieved from an Object Data Base Management |
---|
120 | System. |
---|
121 | </p><p> |
---|
122 | </p></li><li><p><span class="bold"><strong>Visualization</strong></span> |
---|
123 | </p><p>This manages the visualization of solids, trajectories and hits, |
---|
124 | and interacts with underlying graphical libraries (the |
---|
125 | Visualization class category). The basic and most frequently used |
---|
126 | graphics functionality had been implemented already by the |
---|
127 | alpha-release. The OO design of the visualization component allowed |
---|
128 | us to develop several drivers independently, such as for OpenGL, Qt and |
---|
129 | OpenInventor (for X11 and Windows), DAWN, Postscript (via DAWN) and |
---|
130 | VRML. |
---|
131 | </p><p> |
---|
132 | </p></li><li><p><span class="bold"><strong>Interfaces</strong></span> |
---|
133 | </p><p>This category handles the production of the graphical user |
---|
134 | interface (GUI) and the interactions with external software |
---|
135 | (OODBMS, reconstruction etc.). |
---|
136 | </p><p> |
---|
137 | </p></li></ol></div><p> |
---|
138 | </p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s10.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch03s02.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">2.10. |
---|
139 | How to Visualize the Detector and Events |
---|
140 | </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.2. |
---|
141 | Global Usage Classes |
---|
142 | </td></tr></table></div></body></html> |
---|