source: trunk/environments/MOMO/docs/MOMOHelp.html @ 1340

Last change on this file since 1340 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 87.7 KB
Line 
1<html>
2<head>
3<title>
4MOMO Help
5</title>
6</head>
7<body>
8<center>
9<h1>
10<A NAME="TOP">MOMO; Integrated GUI desktop for Geant4 development
11</A></h1><br>
12                                        November 25, 2004
13<br>
14                                        Hajime YOSHIDA
15<br>
16                                        Naruto University of Education
17</center>
18
19<hr>
20<H1>Index</H1><p>
21<OL>
22<LI><A HREF="#1">MOMO and its derived versions </A>
23<LI><A HREF="#2">How to develop Geant4 detector, physics list,
24main program, and makefile, using MOMO </A>
25<LI><A HREF="#3">GGE Geant4 Geometry Editor </A>
26<OL>
27<LI><A HREF="#3-1">Characteristics</A>
28<LI><A HREF="#3-2"> Material Editor and Volume Editor</A>
29<LI><A HREF="#3-3"> Menus of GGE</A>
30<LI><A HREF="#3-4"> Material Editor </A>
31<OL>
32<LI><A HREF="#3-4-1">Periodic Table of Elements </A>
33<LI><A HREF="#3-4-2">Functionalities of the Material Editor </A>
34</OL>
35<LI><A HREF="#3-5">The Logical Volume Editor </A>
36<OL>
37<LI><A HREF="#3-5-1"> Functionalities to define Geant4 logical volumes</A>
38</OL>
39<LI><A HREF="#3-6">The Physical Volume Editor </A>
40<OL>
41<LI><A HREF="#3-6-1"> Limit of Physical volumes Editor</A>
42<LI><A HREF="#3-6-2">Constructors of G4PVPlacement </A>
43<LI><A HREF="#3-6-3"> Single Positioned Volume</A>
44<LI><A HREF="#3-6-4">Repeated Translationally Positioned Volumes </A>
45<LI><A HREF="#3-6-5">Repeated Rotationally Positioned Volumes </A>
46<LI><A HREF="#3-6-6">Replica in the X, Y or Z direction, Replica in rho, phi or Z direction </A>
47</OL>
48<LI><A HREF="#3-7"> Generation of C++ code</A>
49<OL>
50<LI><A HREF="#3-7-1">Naming conventions in GGE </A>
51<LI><A HREF="#3-7-2"> Default values and combo-boxes</A>
52</OL>
53</OL>
54
55<LI><A HREF="#4">GPE Geant4 Physics Editor </A>
56<OL>
57<LI><A HREF="#4-1"> Particle</A>
58<LI><A HREF="#4-2">EM Processes </A>
59<LI><A HREF="#4-3">C++ codes generated by GPE </A>
60<LI><A HREF="#4-4">Persistent file </A>
61</OL>
62
63
64
65<LI><A HREF="#5">MOMO's Companion Files </A>
66<OL>
67<LI><A HREF="#5-1">Momomake.gmk generated by MOMO </A>
68<LI><A HREF="#5-2">Main program generated by MOMO </A>
69</OL>
70<LI><A HREF="#10.5">Makefiles and Environment Variables
71 </A>
72
73<LI><A HREF="#7">GAG and Gain </A>
74<OL>
75<LI><A HREF="#7-1">GAG </A>
76<LI><A HREF="#7-2">Gain </A>
77</OL>
78</OL>
79
80<A HREF="#TOP">TOP</A>
81
82<A NAME="1"><FONT color=#238e23 size=+3><B>1) MOMO and its derived versions </B></FONT>
83</A><br>
84<HR>
85
86Momo is conceived as a kind of integrated GUI desktop for Geant4
87which combines existing  tools like GGE (Geant4 Geometry Editor),
88GPE (Geant4 Physics Editor), GAG (Geant4 Adaptive GUI)
89and Gain (Geant4 adaptive interface for network).
90
91It also  provides user with the capability to create a makefile reflecting his
92environment variables, to create a simple main program which utilises
93C++ source codes generated by GGE and GPE and to compile a running application.
94
95It is completely written in Java and runs on
96any platform running Java like Linux, Windows and Mac.
97Currently supported is Java 1.4 (some functions don't work well with Java 1.5).
98
99At present time, there are three versions of MOMO, which have different way
100to start.
101<DL>
102<DT> Stand-alone version
103<DD>It must be started in the console, using "java" command.
104The jar (Java archive) file MOMO.jar of the standalone version can
105be downloaded from the site below:
106  <a href="http://erpc1.naruto-u.ac.jp/~geant4/Sources.html">Naruto Web server</a>
107
108When its environment and a set of
109companion files are prepared  (explained later), MOMO is capable of
110creating C++ main program, GNU makefile and compiling to make a
111running program.
112
113GAG (Geant4 Adaptive GUI) and gain (Geant4 adaptive interface for network)
114are available to steer
115the execution of Geant4 and are integrated in the present version of MOMO.
116<DT>Java Web Start version
117<DD>
118This version is of exactly the same MOMO as
119 the stand-alone version with digital signature. When user clicks it in
120the Web browser, the jar file is downloaded automatically. Then, it asks
121him whether he wants to start it, trusting the signature.
122<DT> MomoPlugin to JAS3
123<DD> JAS3, when loaded with MomoPlugin.jar,
124offers similar functionalities as above.
125The current version of MomoPlugin.jar lacks some functions
126(creating main program, and makefile) found in
127the stand-alone version, as explained below.
128
129The plugin version can be
130used in conjunction with G4Plugin which steers the execution of
131Geant4. MomoPlugin and G4Plugin are available at SLAC.
132
133The main program must use G4UIrmi class to
134connect to G4Plugin. The front-end class G4UIrmi has a stronger point
135that G4UIGAG in that it is multi-threaded. So, user of G4Plugin + G4UIrmi
136can stop the execution of a long run without exiting, needless to say
137the powerful integrated environment for code development,
138steering the execution of simulation and analysing the results.
139This manual doesn't treat this interesting plugin.
140</DL>
141
142<hr>
143<A HREF="#TOP">BACK</A><BR>
144<A NAME="2"><FONT color=#238e23 size=+3><B>
1452) How to develop detector, physics list, main program, and makefile, using MOMO </B></FONT></A>
146<HR>
147Using MOMO,
148user can create geometry, physics, main C++ classes and a makefile,
149compile them with Geant4 libraries. Schematical diagram is shown below.
150
151<pre>
152   GGE             GPE            MOMO or User    MOMO Env. Panel  MOMO companions
153    |               |                 |              |                   |
154 Geometry.cc   PhysicsList.cc    MySimulation.cc  makefile         *.cc *.hh
155    |               |                 |              |                   |
156 Geometry.o    PhysicsList.o     MySimulation.o   Momomake.gmk          *.o
157       \             \                |             /                  /
158                                 Mysimulation
159                                      /\
160                                      ||
161                                 GAG / Gain / G4Plugin
162</pre>
163
164<hr>
165
166All versions of MOMO, in common,  offers the following key functions;
167<UL>
168<li> GGE  to create detector C++ class files
169<li> GPE  to create physics list C++ class files
170<li> Environment Panel to see and set the Geant4 environment variables which are used in the makefile generated by MOMO
171<li>GAG to start a Geant4 application and to steer its execution
172<li>Gain to start a Geant4 application at a remote site and to steer its execution
173
174</UL>
175
176MOMO has the extra  menus;
177
178<OL>
179<LI>"Project" menus
180<UL>
181<li> the button to create a  simple working main program which uses G4UIGAG interface and visualization drivers which are set on the MOMO's Env panel,
182<li> the button to create a Makefile using the environment variables
183set in the "Environment Panel". This makefile is made so that the
184environment variables set by the user within the "Environment Panel"
185oversede the ones defined in the parent terminal/login shell.
186<LI> the button to compile all the files generated by MOMO and a set
187of companion files to make a running Geant4 executable file.
188</UL>
189<LI>Help menu
190This document is displayed.
191
192</OL>
193MOMO is helped by the followings;
194
195<UL>
196
197<li> A set of  companion files complement the C++ source files generated by MOMO.
198They are stored in the canonical directory structure of Geant4.
199Among them are mandatory user-defined class and visualization manager.
200So MOMO with the companion files provide a complete set of
201running Geant4 simulation, as explained later.
202<li>Examplary MOMO's persistent
203files of geometry and physics list are also included for demonstration.
204
205</UL>
206
207
208<hr>
209</A><A HREF="#TOP">BACK</A>
210<BR><A NAME="3"><FONT color=#238e23 size=+3><B>
2113) GGE Geant4 Geometry Editor</B></FONT>
212<BR>
213<hr>
214
215 GGE, or GEANT4 Geometry  Editor,  is a  tabular tool to "create"  a
216detector geometry of GEANT4.
217From the rows of the tables, filled by user, it generates a <font color=green>
218complete C++ class code lines</font> for  materials and logical volumes.
219
220It is capable of limited  and relatively simple cases of the full geometry,
221including physical volumes, i.e., placing of logical volumes.
222<A NAME="3-1"><h3>
2233-1) Characteristics
224</h3>
225</A><A HREF="#TOP">BACK</A>
226<DL>
227<DT>Tables
228<DD>It provides users with several tables
229into whose cells  users can fill  with their own detector parameters.
230Each row of the tables corresponds to a kind of instantiation or
231application of a certain method of a class.
232<DT>Help user with Geant4 defaults
233<DD>Default values, canonical units of Geant4, pre-defined Geant4 constants
234etc. are visually provided for user's choice.
235<DT>C++ code generation 
236<DD>Using the data in the tables, even if they are partial and imcomplete,
237GGE can generate C++ source codes  for a detector,
238only if the class name of the geometry is supplied.
239<br>
240If user wants so, C++ codes  generated by GGE can be a complete
241description of a detector, including the definition of atoms, materials,
242solids, color attributes,
243logical volumes and physical volumes with rotations and translations.
244  <ul>
245  <li>All necessary class names and their usages of the Geant4 class libraries
246  are applied  in automatic C++ code generation
247  <li>All necessary class definition files are included automatically
248  <li>Necessary local variables such as to define the rotation or translation
249  are created when necessary. Naming conventions are explained later.
250
251  <li>The C++ source codes are saved into files and can be compiled to
252    make a GEANT4 executable.
253  </ul>
254<DT>Persistency and Reuse of detector data
255<DD> Full detector data and material data can be
256saved in the Java's serialization format or in the XML format a la GDML-1.
257It can be reloaded for later reuse.
258
259XML format a la GDML-1 is limited to materials and logical volumes. 
260But XML file
261lacks some items in the MOMO's table due
262to GDML-1's present imcompleteness. Physical volumes aren't
263supported.
264<DT>Companion files and Extra "Project" functions
265<DD>
266
267<UL>
268<li>
269A set of companion files are provided to visualize the geometry and
270to run the simulation with the physics list. Files generated by GGE and GPE
271must be stored in the canonical sub-directories, therein.
272
273Details will be explained later.
274<li>The stand-alone version of MOMO provides three menu buttons;
275 <ul>
276 <li>to generate a simple working main program. User has to supply the
277name of the main program, which MOMO uses for the G4TARGET.
278 <li>to generate Momomake.gmk makefile. The environment variables set by
279a user are included in the Momomake.gmk.
280 <li>to compile all. If MOMOHOME variable is defined to designate the
281 position of the companion files, MOMO starts make command. Or user can
282use this makefile like;
283<pre>
284      %make -f Momomake.gmk
285</pre>
286
287 </DL>
288
289</ol>
290
291<hr>
292</A><A HREF="#TOP">BACK</A><BR>
293<A NAME="3-2">
294<h3>3-2) Material Editor and Volume Editor</h3>
295<BR>
296
297 GGE   consists  of  two tabular editors (material   and   volume)  which  are
298interrelated. <br>
299
300The material editor consists of two tables; one for "material from scratch", another
301for "compound materials".
302<br>
303 Volume editor   consists of two minor editors;
304one for "logical volumes" and another for
305"physical volumes". The logical volume editor allows user to specify complete
306description of logical volumes,
307including solid, material, and visualization attribute.
308<br>
309The Physical volume editor, in contrast, supports  only limited use-cases ; <it>Single
310Positioned Volume</it><it>Repeatedly Positioned  Volumes</it>  with  incremental  copy numbers
311(translational arrangement or axially symmetric arrangement), and
312<it>Replicas </it>(in any axis).
313
314<p>
315<font color=red>Tips!</font>
316<ol>
317<li>GGE/MOMO is based on Java's MVC (Model-View-Control) model, so that any changes
318to any of the tables by a user
319are automatically reflected to the internal data structure of GGE and thus to C++ codes.
320This is true at any moment, so that user can get even imcomplete C++ class files
321at any moment, even without any filled tabular cells, though only the
322class name is mandatory.
323<li>
324The whole detector description can be saved in a persistent file and can
325be loaded for later reuse.
326<li>
327
328
329GGE employs own naming rules to generate C++ codes from the tables. This will
330be explained later.
331</ol>
332<hr>
333</A><A HREF="#TOP">BACK</A><BR>
334<A NAME="3-3">
335<h3>3-3) Menus of GGE</h3>
336<BR>
337
338GGE has a top menu buttons and fill-in text area.
339
340
341<ul>
342<li> text area to specify the class name. This is mandatory to save data or to create C++ source codes.
343<li> menu buttons; Material editor, Volume editor
344        <ul>
345        <li> load, save a persistent file
346           <ul>
347            <li>Java Serialization data format (MOMO-standards),
348              the compatibility with the future version of MOMO isn't garuanteed.
349            <li>XML format (not recommended though with limited functions)
350            </ul>
351        <li> clear the tables
352        <li> generate cc and hh files using the specified class name (Volume editor)
353        </ul> 
354</ul>
355<A NAME="3-4">
356<h3>3-4) Material Editor </h3> <br>
357</A><A HREF="#TOP">BACK</A>
358<BR>
359The material editor
360is composed of two minor tables for
361<ol>
362<li>"material from scratch"
363and
364<li>"compound materials".
365</ol>
366 These tables can be enlengthened as will, if necessary.
367The boundary of the two tables can be moved as will, too.
368<br>
369
370Every row corresponds to one material (scratch or compound).
371A row is filled with selected element(s) and default values, when
372user push the "append" or "insert" button, after selecting a element(s).
373
374<hr>
375</A><A HREF="#TOP">BACK</A><BR>
376<A NAME="3-4-1">
377<h3>3-4-1) Periodic Table of Elements</h3>
378<BR>
379The periodic table is popped up,
380when one of the "append" or "insert" buttons of the tables is pushed.
381<br>
382When an element is chosen by the mouse click, it's label color becomes green.
383Multiple elements (upto 20 at present)
384can be chosen simultaneously for compound materials.
385When a mouse is clicked on the selected element, is is deselected. So, user
386can choose correct element(s).
387<br>
388The foundamental properties of atoms; Z, A, etc. are pre-built in to the
389atomic table and are copied automatically to the table.
390They are also used to create
391C++, XML and Java serialization files,
392even though unseen to the user.
393<br>
394The element window can be hidden at any moment by the close
395button of the window.
396
397<hr>
398<A NAME="3-4-2">
399</A><A HREF="#TOP">BACK</A><BR>
400<h3>
4013-4-2) Functionalities of the Material Editor
402</h3>
403
404<br>
405
406The following functionalities are  implemented;
407<ol>
408<li> <strong>append, insert, edit and delete</strong> a material
409        <ul>
410         <li>    <strong>material from scratch</strong><br>
411                 The  name of an atom, numbers Z and A are
412                 taken from the atomic table. User has to specify its density,
413                temperature and pressure. Canonical units and states can be
414                choosen from the listbox.<br> Although the scratch table shows
415           the names of the elements in the second column,
416                 the corresponding instance in C++ is named "elementX", where
417                "X" represents element's symbol, like "elementH", "elementNa".
418         <li>    <strong> material by combination </strong>(number or fractional ratios). <br>
419           When element(s) is(are) chosen in the  periodic table of
420           atoms</a>, it(they) is(are) copied to tha table of
421           scratch(compound) on the pression of "append"
422           or "insert" button.
423           <br>If user selected multiple elements and pushed
424           "insert" or "append" button of the scratch table, only the
425            first element is copied. When the button of the compound table
426            is pushed, all the selected elements are shown in the third column.
427           <br>
428           To "insert" a row, user
429           has to focus a row before the click on the menu button. A new row
430           is created just below it.
431           <li>  User has to type in the name of a compound material,
432           which is employed as the variable name in verbatim.
433         <li>A pop-up window
434           is displayed when he focuses and click
435                 on a third cell with the label "elements".
436           There, compound by number or by fraction can be specified.
437           The values are copied to the "elements" cell. To confirm, user
438           can enlarge the width of the cell.
439          <li> default  states (and their canonical names)
440                 and values are provided  (material state, temperature,
441                 pressure).
442          <li> canonical physical units  of GEANT4
443                 are shown in selectable combo-boxes.
444          </ul>
445        <li> The first column "<strong>in Use</strong>"  is to mark the
446         materials used in user's detector (logical volumes).
447         The default value is "in Use", when a row is created at the first time.
448          <ul>
449          <li>   Only materials used in the logical volumes can be
450                 automatically checked and marked as "in Use" state by
451            the "Mark the Used Materials" button
452                 on the Logical Volume Table, as seen below.
453           <li>  user can add any materials "in Use" to
454                 have C++ constructors, even when they aren't used in
455                 logical volumes.
456           </ul>
457<li>    <strong> input and output from/to persistent material file </strong>
458        <br>
459        Material tables are saved to a Java's persistent file and can be
460        reused. XML a la GDML format is also provided. Note that GDML is not yet
461        complete and is lacking a part of definitions like material's state etc.
462           <ul>
463           <li>   load, append or save a material file
464            <li>  exemplary persistent material database
465                 file  "PDG.g4mt"  and PDG.xml taken from the PDG data book
466                 are available.
467            </ul>
468</ol>
469
470Not yet implemented are; 
471<ul>
472  <li>material from materials,
473  <li>isotope
474</ul>
475Notice on C++ codes<br>
476MOMO doesn't duplicate the C++ instance of an element, but
477 is not protected against possible duplication
478of "in Use" instances of the same name of compound materials.
479<br>
480<hr>
481<h3>3-4-3) A code fragment generated from the dicom.xml; XML file.</h3>
482<pre>
483// Elements
484G4Element* elementH = new G4Element( "Hydrogen", "H", 1. , 1.00794*g/mole );
485G4Element* elementC = new G4Element( "Carbon", "C", 6. , 12.011*g/mole );
486G4Element* elementN = new G4Element( "Nitrogen", "N", 7. , 14.00674*g/mole );
487G4Element* elementO = new G4Element( "Oxygen", "O", 8. , 15.9994*g/mole );
488G4Element* elementNa = new G4Element( "Sodium", "Na", 11. , 22.989768*g/mole );
489G4Element* elementMg = new G4Element( "Magnesium", "Mg", 12. , 24.305*g/mole );
490G4Element* elementP = new G4Element( "Phosphorus", "P", 15. , 30.973762*g/mole );
491G4Element* elementS = new G4Element( "Sulfur", "S", 16. , 32.066*g/mole );
492G4Element* elementCl = new G4Element( "Chlorine", "Cl", 17. , 35.4527*g/mole );
493G4Element* elementK = new G4Element( "Potassium", "K", 19. , 39.0983*g/mole );
494G4Element* elementCa = new G4Element( "Calcium", "Ca", 20. , 40.078*g/mole );
495G4Element* elementFe = new G4Element( "Iron", "Fe", 26. , 55.845*g/mole );
496
497// Materials from Combination
498
499G4Material* SkeletonSpongiosa = new G4Material("SkeletonSpongiosa",  1159.0*kg/m3,
500     12, kStateUndefined, 273.15*kelvin, 1.0*atmosphere );
501SkeletonSpongiosa->AddElement( elementH, 0.085 );
502SkeletonSpongiosa->AddElement( elementC, 0.404 );
503SkeletonSpongiosa->AddElement( elementN, 0.058 );
504SkeletonSpongiosa->AddElement( elementO, 0.367 );
505SkeletonSpongiosa->AddElement( elementNa, 0.0010 );
506SkeletonSpongiosa->AddElement( elementMg, 0.0010 );
507SkeletonSpongiosa->AddElement( elementP, 0.034 );
508SkeletonSpongiosa->AddElement( elementS, 0.0020 );
509SkeletonSpongiosa->AddElement( elementCl, 0.0020 );
510SkeletonSpongiosa->AddElement( elementK, 0.0010 );
511SkeletonSpongiosa->AddElement( elementCa, 0.044 );
512SkeletonSpongiosa->AddElement( elementFe, 0.0010 );
513
514</pre>
515<hr>
516The above C++ lines are generated from the next fragments of XML file a la GDML
517which was created by MOMO which reloaded this XML file.
518
519<PRE>
520
521&lt;?xml version="1.0" encoding="UTF-8"?&gt;
522&lt;gdml xmlns:gdml="http://cern.ch/2001/Schemas/GDML"
523     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
524     xsi:noNamespaceSchemaLocation="../schema/gdml_1.0.xsd"&gt;
525&lt;!--skip--&gt;
526
527  &lt;materials&gt;
528     &lt;!--Elements--&gt;
529     &lt;element name="Hydrogen" formula="H" Z="1"&gt;
530      &lt;atom value="1.00794"/&gt;
531     &lt;/element&gt;
532     &lt;element name="Carbon" formula="C" Z="6"&gt;
533      &lt;atom value="12.011"/&gt;
534     &lt;/element&gt;
535     &lt;element name="Nitrogen" formula="N" Z="7"&gt;
536      &lt;atom value="14.00674"/&gt;
537     &lt;/element&gt;
538     &lt;element name="Oxygen" formula="O" Z="8"&gt;
539      &lt;atom value="15.9994"/&gt;
540     &lt;/element&gt;
541     &lt;element name="Sodium" formula="Na" Z="11"&gt;
542      &lt;atom value="22.989768"/&gt;
543     &lt;/element&gt;
544     &lt;element name="Magnesium" formula="Mg" Z="12"&gt;
545      &lt;atom value="24.305"/&gt;
546     &lt;/element&gt;
547     &lt;element name="Phosphorus" formula="P" Z="15"&gt;
548      &lt;atom value="30.973762"/&gt;
549     &lt;/element&gt;
550     &lt;element name="Sulfur" formula="S" Z="16"&gt;
551      &lt;atom value="32.066"/&gt;
552     &lt;/element&gt;
553     &lt;element name="Chlorine" formula="Cl" Z="17"&gt;
554      &lt;atom value="35.4527"/&gt;
555     &lt;/element&gt;
556     &lt;element name="Potassium" formula="K" Z="19"&gt;
557      &lt;atom value="39.0983"/&gt;
558     &lt;/element&gt;
559     &lt;element name="Calcium" formula="Ca" Z="20"&gt;
560      &lt;atom value="40.078"/&gt;
561     &lt;/element&gt;
562     &lt;element name="Iron" formula="Fe" Z="26"&gt;
563      &lt;atom value="55.845"/&gt;
564     &lt;/element&gt;
565
566     &lt;!--Materials from Combination--&gt;
567     &lt;material name="SkeletonSpongiosa"&gt;
568         &lt;D type="denstiy" value="1159.0" unit="kg/m3"/&gt;
569         &lt;T type="temperature" value="273.15" unit="kelvin"/&gt;
570         &lt;P type="pascal" value="1.0" unit="atmosphere"/&gt;
571         &lt;fraction n="0.085" ref="H"/&gt;
572         &lt;fraction n="0.404" ref="C"/&gt;
573         &lt;fraction n="0.058" ref="N"/&gt;
574         &lt;fraction n="0.367" ref="O"/&gt;
575         &lt;fraction n="0.0010" ref="Na"/&gt;
576         &lt;fraction n="0.0010" ref="Mg"/&gt;
577         &lt;fraction n="0.034" ref="P"/&gt;
578         &lt;fraction n="0.0020" ref="S"/&gt;
579         &lt;fraction n="0.0020" ref="Cl"/&gt;
580         &lt;fraction n="0.0010" ref="K"/&gt;
581         &lt;fraction n="0.044" ref="Ca"/&gt;
582         &lt;fraction n="0.0010" ref="Fe"/&gt;
583     &lt;/material&gt;
584&lt;!--skip--&gt;
585&lt;/gdml&gt;
586
587</PRE>
588
589<hr>
590
591</A><A HREF="#TOP">BACK</A><BR>
592<A NAME="3-5">
593<h2>
594 3-5) The Logical Volume Editor
595</h2>
596
597<br>
598
599The logical volume editor is composed of
600<UL>
601<LI>three buttons; "append", "insert" and "delete"
602<LI>the logical volume table;
603<br>
604Each row in the table corresponds to an instantiation of
605a Geant4 logical or physical volume constructor. Its arguments
606are specified in the other cells of the row.
607<LI>the button "Mark the Used Materials"
608<LI>the editor for visualization attributes<br>
609When "create" button is pressed, a color chooser popps up. By choosing a color
610and typing its name, it is copied in the editor.
611</UL>
612
613<A NAME="3-5-1">
614<h3>
6153-5-1) Functionalities of the logical volume editor
616</h3>
617</A><A HREF="#TOP">BACK</A><br>
618
619Following functionaliteis are implemented;
620 <ol>
621  <li> <strong> Defining G4LogicalVolumes </strong> <br>
622     Each row of the logical vulume table represents an
623     instance of the G4LogicalVolume constructor.
624     User can append, insert or delete a row with corresponding buttons.<br>
625        The table has following columns;
626      <ul>
627        <li>The first column is to specify  the name of a logical volume.
628        <li> The second column is filled automatically by choosing one of the
629        G4Solid types from the listbox. <br>
630        By clicking on the cell,  user has a pop-up window
631                to edit its parameters and preview with DAWN.
632        <li> The third column is type-in cell for material name
633                 listed in the material editor. All the items already
634                 defined in the Material editor are diaplayed in the form
635                 of the listbox only to choose one.
636        <li> The fourth column is to specify the visualization attribute's 
637          name. All the color names defined in the color chooser lists are
638          displayed to choose one.
639        </ul>
640
641 <li> <strong>Selecting a G4Solid</strong><br>
642   All Geant4 solids can be selected from the solid listbox, located at the
643   right of "Select a Solid" label.
644     <ul>
645        <li>all CSG solids;  box, tube segment, cone segment,
646        symmetric trapezoid, sphere segment, parallel piped,
647        torus segment, HYPE,
648        <li>BREP solids; PolyCone segment and Polygone segment
649     </ul>
650 <li> After selecting a solid tyle, user pushes the "append" or "insert" button
651        and a new row is created in the table.
652 <li>By clicking on the "solid" cell (the second column),
653        a pop up
654        window  appears to specify solid's parameters. User can   
655                <ul>
656                <li> type in parameters and select canonical units of CSG solids
657                <li> add any number of nodes and facets of BREP solids and
658                        type in their parameters and select canonical units
659                <li> preview with DAWN with automatically chosen world size
660                <li> save DAWN format file of the solid
661       
662        </ul>
663<hr>
664      A code fragment of a logical volume "thintube" of
665BREP PolyCone generated by MOMO. Words in red are those typed in by a user.
666<pre>
667G4double DzArray<font color=red>thintube</font>   [] =
668     {-1000.0*micrometer, -750.0*micrometer, -500.0*micrometer, -250.0*micrometer,
669      0.0*micrometer, 250.0*micrometer, 500.0*micrometer, 750.0*micrometer,
670      1000.0*micrometer};
671G4double RminArray<font color=red>thintube</font> [] =
672     {1.0*micrometer, 1.0*micrometer, 1.0*micrometer, 1.0*micrometer, 1.0*micrometer,
673      1.0*micrometer, 1.0*micrometer, 1.0*micrometer, 1.0*micrometer};
674G4double RmaxArray<font color=red>thintube</font> [] =
675      {20.0*micrometer, 16.0*micrometer, 12.0*micrometer, 8.0*micrometer,
676       4.0*micrometer, 8.0*micrometer, 12.0*micrometer, 16.0*micrometer, 20.0*micrometer};
677
678G4BREPSolidPCone *solid<font color=red>thintube</font> = new G4BREPSolidPCone("solidthintube",  //its name
6790.0*mrad,  //its start angle
680270.0*deg, //its opening angle
6819,  //its nZ
682DzArray<font color=red>thintube</font>[0],  //z start
683DzArray<font color=red>thintube</font>,  //z value
684RminArray<font color=red>thintube</font>,  //rmin
685RmaxArray<font color=red>thintube</font> );  //rmax
686
687G4LogicalVolume * logical<font color=red>thintube</font> = new G4LogicalVolume(solid<font color=red>thintube</font>,  //its solid
688<font color=red>carbon</font>,  //its material
689"logical<font color=red>thintube</font>" , //its name
690 0,0,0);
691
692logical<font color=red>thintube</font>->SetVisAttributes(<font color=red>black</font>);
693</pre>
694<hr> 
695 <li> <strong>Defining G4Color</strong><br>
696   The visualization attribute and its name are required by the logical
697   volumes. They
698   can be defined using a graphical color chooser.
699        Each color's  given unique name is listed in the editor panel.
700   The RGB numbers defined by the chooser are taken
701                to generate C++ codes.
702<br>
703An example of code fragments generated by MOMO
704<pre>
705G4VisAttributes * lightblue= new G4VisAttributes( G4Colour(0/255. ,255/255. ,255/255. ));
706</pre>
707
708 <li><strong>"Make the used materials" </strong> button. <br>
709         Clicking this button, GGE scans the materials specified in the
710         logical volume table and marks "in Use" cell (the first column )
711         of the material tables accordingly. All other materials not used in
712   logical volumes are not marked.
713
714         Note that only rows marked "in Use" are used
715                to generate C++ codes.
716             
717</ol>
718<hr>
719</A><A HREF="#TOP">BACK</A><BR>
720<A NAME="3-6">
721<h2>3-6) The Physical Volume Editor</h2>
722
723<BR>
724The physical volume editor consists of five minor tables of different
725way of displacement of a logical volume. Each table is contained in a tabbed pane.
726
727
728<A NAME="3-6-1">
729<h3>3-6-1) Limit of Physical volumes Editor</h3>
730</A><br>
731Compared with the logical volume editor, the physical volume one has limited
732generality. So, if user aren't satisfied with the following simplistic ways
733to place logical volumes, he can use partially generated C++ codes for
734logical volumes etc. as a starting point.
735
736<p>
737<A NAME="3-6-2">
738<h3>3-6-2) Constructors of G4PVPlacement</h3>
739</A><A HREF="#TOP">BACK</A><br>
740Following four types of constructor are implemented,
741according to the types of
742rotation and types of the mother volume.
743  <ol> 
744  <li>   Type 1 constructor = rotation of the frame, physical mother volume
745  <li>   Type 2 constructor = rotation of a body, physical mother volume
746  <li>   Type 3 constructor = rotation of the frame, logical mother volume
747  <li>   Type 4 constructor = rotation of a body, logical mother volume
748  </ol>
749
750
751Next are the example C++ codes generated by MOMO for the above four cases. In the first two cases,
752words in red are those which user typed  in the cells of the editor.
753<OL>
754<LI>"box-bp" and "box-fp" in the first column to specify the pName, i.e., the name of the unstance of G4PVPlacement
755<LI>"box" in the second column to spscify the names of their logical volumes, pLogical. All the names already defined in the logical volume panel are displayed to choose one. In this case, one "box" is used to make different physical volumes.
756<LI>"container" in the pMother, i.e., name of the mother volume. The prefixes "logical" or "physical" are attached according to the type of the mother volume.
757</OL> 
758
759pNames are used as postfixes
760to designate local variables like rotation matrices and rotation angles etc..
761On the contrary, several prefixes are used to differentiate
762instances, like physicalcontainer and logicalcontainer, where only "container" is typed in a cell.
763<br>
764Naming conventions will be explained later.
765
766<hr>
767<pre>
768
769// Single Positioned Placement
770// <font color=green>Body rotation + physical mother</font>
771G4RotationMatrix rotMatrix<font color=red>box-bp</font>;   // unit rotation matrix
772G4double angle<font color=red>box-bp</font> = 0.0*deg;   // rotational angle
773rotMatrix<font color=red>box-bp</font>.rotateX(angle<font color=red>box-bp</font>);  // rot matrix
774
775G4VPhysicalVolume *  <font color=red>box-bp</font>= new G4PVPlacement(G4Transform3D(rotMatrix<font color=red>box-bp</font>,     //rotation
776                 G4ThreeVector(0.0*mm, 0.0*mm, 0.0*mm)),
777                 "<font color=red>box-bp</font>",   //its name  (2nd constructor)
778                 <font color=red>box</font>,         //its logical volume
779                 physical<font color=red>container</font>,              //its mother volume
780                 false,                 //no boolean operation
781                 0);                       //copy number
782
783// <font color=green>Frame rotation + physical mother</font>
784G4RotationMatrix rotMatrix<font color=red>box-fp</font>;   // unit rotation matrix
785G4double angle<font color=red>box-fp</font> = 0.0*deg;   // rotational angle
786rotMatrix<font color=red>box-fp</font>.rotateX(angle<font color=red>box-fp</font>);  // rot matrix
787
788G4VPhysicalVolume *  <font color=red>box-fp</font>= new G4PVPlacement( new G4RotationMatrix(rotMatrix<font color=red>box-fp</font>) ,        // Frame rotation
789                 G4ThreeVector(0.0*mm, 0.0*mm, 0.0*mm),
790                 "<font color=red>box-fp</font>",   // 1st constructor its name
791                 <font color=red>box</font>,         //its logical volume
792                 physical<font color=red>container</font>,      //its mother volume
793                 false, //no boolean operation
794                 0);    //copy number
795
796// <font color=green>Body rotation + logical mother</font>
797
798G4RotationMatrix rotMatrixbox-bl;   // unit rotation matrix
799G4double anglebox-bl = 0.0*deg;   // rotational angle
800rotMatrixbox-bl.rotateX(anglebox-bl);  // rot matrix
801
802
803G4VPhysicalVolume *  box-bl= new G4PVPlacement(G4Transform3D(rotMatrixbox-bl,   //rotation
804                 G4ThreeVector(0.0*mm, 0.0*mm, 0.0*mm)),
805                 box,   //its current logical volume(4th constructor)
806                 "box-bl",    //its name
807                 logicalcontainer,              //its mother volume
808                 false,                 //no boolean operation
809                 0);                       //copy number
810
811// <font color=green>Frame rotation + logical mother</font>
812
813G4RotationMatrix rotMatrixbox-fl;   // unit rotation matrix
814G4double anglebox-fl = 0.0*deg;   // rotational angle
815rotMatrixbox-fl.rotateX(anglebox-fl);  // rot matrix
816
817G4VPhysicalVolume *  box-fl= new G4PVPlacement( new G4RotationMatrix(rotMatrixbox-fl) ,        // Frame rotation
818                 G4ThreeVector(0.0*mm, 0.0*mm, 0.0*mm),
819                 box,   // 3rd constructor its logical volume
820                 "box-fl",    //its name
821                 logicalcontainer,      //its mother volume
822                 false, //no boolean operation
823                 0);    //copy number
824
825</pre>
826<hr>
827Following simple placements are provided in GGE. Every placement is
828contained in independent tabbed pane.
829
830<hr>
831<A HREF="#TOP">BACK</A><BR>
832<A NAME="3-6-3">
833<h3>3-6-3)
834Single Positioned Volume (SPV)</h3> </a><br>
835
836 Each row represents a physical volume
837 which has one-to-one
838correspondence to a logical volume. The C++ code lines are demonstrated just above.<br>
839<font color=red>IMPORTANT!!  The world volume must be
840        defined in the first row of this table.</font>
841
842  <ol>
843   <li> The first column specifies either body or frame rotation.
844   <li> The second column specifies the instance's name of the physical volume
845   <li> The third column specifies the name of the logical volume to be placed
846   <li> The fourth column specifies the type of the mother volume.
847        The mother volume is either
848        null(Master Reference System), logical or physical.
849        The  MARS or the world volume must be specified at the first row.
850   <li> The fifth column specifies the name of the mother volume, if it isn't NULL.
851   <li> The columns 7, 8 and 9-th specify the translation 
852        in the X, Y or Z direction (default is no translation) with a
853        selectable unit of length
854   <li>The 11-th column specifies the axis of rotation  (frame or body);
855         rotation around X, Y or Z axis with an angle in the 12-th column
856   </ol>
857<HR>
858<A HREF="#TOP">BACK</A><BR>
859<A NAME="3-6-4">
860  <h3>3-6-4)
861Repeated Translationally Positioned Volumes  (RTPV Arrangement)</h3></a><br>
862
863 Each row represent a physical volume
864 which consists of any number of copies of a logical volume with incremental copy numbers.
865
866  <ol>
867  <li>The first to 4-th columns are same as above. 
868   <li>The columns 6, 7 and 8-th specify the position of the first copy
869   <li> The 10-th column specifies the direction of placement; X, Y or Z direction
870  <li> The 11-th column specifies the  incremental step size of displacement
871  <li> The last column specifies the number of copies
872  </ol>
873
874
875Next is a fragment of C++ code generated from a line in the table. Here "Boses" is typed in the
876first column, pName. This word is used as the postfix to designate local variables as well as
877the loop variable. "box" is the pLogical, i.e., the name of the logical volume. Here the mother's
878name is typed in as "world" in the pMother cell, and it is physical. The "box" logical volume
879is translated  along X direction from X0 = -100*cm in 10*cm step with the copy numbers "copyBoxes" from 1 to 21.
880
881<pre>
882G4int copy<font color=red>Boxes</font>;
883copy<font color=red>Boxes</font>=0;
884for (G4int <font color=red>Boxes</font>=1; <font color=red>Boxes</font><=21; <font color=red>Boxes</font>++){
885  G4double trans<font color=red>Boxes</font> =-100.0*cm+10.0*cm*(<font color=red>Boxes</font>-1);
886  G4VPhysicalVolume * Boxes = new G4PVPlacement(0,      //no rotation
887                 G4ThreeVector(trans<font color=red>Boxes</font>, 0.0*cm, 0.0*cm),
888                 "<font color=red>Boxes</font>",   //its name
889                 <font color=red>box</font>,         //its logical volume
890                 physical<font color=red>world</font>,            //its mother volume
891                 false,             //no boolean operation
892                 copy<font color=red>Boxes</font>++);      //copy number
893}
894
895</pre>
896
897
898<HR>
899<A HREF="#TOP">BACK</A><BR>
900<A NAME="3-6-5">
901<h3>3-6-5)  Repeated Rotationally Positioned Volumes;  (RRPV Arrangement)
902</h3> </a><BR>
903
904    Each row represents a physical volume
905 which consists of
906 axially symmetric arrangement  of any number of copies of a
907 logical volume with incremental copy numbers.<br>
908
909  <ol>
910  <li> The columns "move", "pName", "pLogic", "MomType" and "pMother" are same as above.
911
912  <li>(X0, Y0, Z0) column specify the position of the center of an axial rotation
913  <li>"Radius" column specifies a radius of axially symmetric arrangement
914  <li>"RotAxis" column specifies the rotational axis ; X, Y or Z
915  <li>"Phi_0" and "dPhi" column specify a starting angle and incremental step angle
916  <li> The last column specifies the number of copies
917  </ol>
918
919A row of the table generates the C++ code lines as below. Here
920"Circle" is the pName.
921The logical volume "box" is
922copied around the Z axis from 0* deg with 30* deg step and with copy number "copyCircle" from 1 to 10.
923The center of rotation (x0Circle, y0Circle, z0Circle) = (-200*mm, 100*mm, 0.0*mm).
924<hr>
925<pre>
926// Active Rotation of Bodies
927G4int copyCircle;
928copyCircle=0;
929G4RotationMatrix rotationMatrixCircle;G4double startCircle = 0.0*deg;
930G4double incCircle = 30.0*deg;
931rotationMatrixCircle.rotateZ(startCircle);
932G4double x0Circle = -200.0*mm;
933G4double y0Circle = 100.0*mm;
934G4double z0Circle = 0.0*mm;
935G4double radiusCircle = 300.0*mm;
936
937for (G4int Circle=1; Circle<=10; Circle++){
938  G4double transCircle = startCircle+incCircle*(Circle-1);
939
940  G4double xCircle, yCircle, zCircle;
941  xCircle = x0Circle + radiusCircle * cos(transCircle);
942  yCircle = y0Circle + radiusCircle * sin(transCircle);
943  zCircle = z0Circle;
944  G4VPhysicalVolume * Circle = new G4PVPlacement(G4Transform3D(rotationMatrixCircle,    //rotate
945                 G4ThreeVector(xCircle, yCircle, zCircle)),
946                 "Circle",   //its name
947                 box,         //its logical volume
948                 physicalworld,            //its mother volume
949                 false,             //no boolean operation
950                 copyCircle++);      //copy number
951  rotationMatrixCircle.rotateZ(incCircle);
952}
953
954</pre>
955
956<HR>
957</A><A HREF="#TOP">BACK</A><BR>
958<A NAME="3-6-6">
959  <h3> 3-6-6, 7) Replica in the X, Y or Z direction,
960   Replica  in rho, phi or Z direction</h3>
961
962
963<ol>
964<li> width (in length or angle) and number of replicas
965<li> offset (in length or angle)
966<li> logical or physical mother volume
967</ol>
968
969Below is the C++ code lines generated from a row in the table. "Sliced" is the pName (the first column).
970"box" is the logical volume to be sliced. pMother is "world" and it is the physical volume.
971The number of replicas along X axis is 1000 with 2.0*micronmeter width and
972with offset of -1.0*mm.
973<hr>
974<pre>
975/ Slicing Translation
976
977G4PVReplica *  physicalSliced= new G4PVReplica("physicalSliced",  //name
978                logicalbox,  // its logical
979                physicalworld,  // its mother
980                kXAxis, // along Axis
981                1000, // No of replicas
982                2.0*micrometer, //  width
983                -1.0*mm); // offset
984
985</pre>
986
987Planned but
988not implemented yet are paremetrised volumes with  linear scaling or  linear rotation.
989
990<hr>
991<A HREF="#TOP">BACK</A><BR>
992<A NAME="3-7">
993<h2>
9943-7) Generation of C++ code
995</h2>
996</A><BR>
997
998GGE has two menu buttons to generate the implementation file and class definition file.
999
1000<ul>
1001<li>C++ code lines are written out to a editor widget and can be edited and saved to a file.
1002        But edited file
1003        loses the correspondence with the tables contents or the persistent file.
1004<li>The required and necessary header files are automatically included; elements, solid types etc.
1005<li>The order of creating instances is following;
1006        <ol>
1007        <li> G4Elements,
1008        <li> G4Material,
1009        <li> G4VisAttributes,
1010        <li> G4Solids,
1011        <li> G4LogicalVolume,
1012        <li> Single Positioned Volumes,
1013        <li> Repeated Volumes,
1014        <li> Replicas
1015        <li> return the instance name of the MARS
1016        </ol>
1017  Order of instantiation inside each section is from the first row to downward.
1018</ul>
1019
1020Here is a sample of automatically generated C++ code</a>
1021 which is created from completely skelton tables but with the class name "MyDetector".
1022
1023<pre>
1024//***** Generated by Geant4 Geometry Editor at  Wed Feb 25 20:27:44 JST 2004 *****
1025
1026//------HeaderFile-
1027 #include "MyDetector.hh"
1028
1029#include "G4UnitsTable.hh"
1030
1031#include "G4VUserDetectorConstruction.hh"
1032
1033#include "globals.hh"
1034#include "G4Material.hh"
1035#include "G4MaterialTable.hh"
1036#include "G4Element.hh"
1037#include "G4ElementTable.hh"
1038#include "G4LogicalVolume.hh"
1039#include "G4ThreeVector.hh"
1040#include "G4PVPlacement.hh"
1041#include "G4PVReplica.hh"
1042#include "G4SDManager.hh"
1043#include "G4VisAttributes.hh"
1044#include "G4Colour.hh"
1045
1046MyDetector::MyDetector()
1047{ ; }
1048MyDetector::~MyDetector()
1049{ ; }
1050G4VPhysicalVolume* MyDetector::Construct( )
1051{
1052// Elements
1053
1054// Materials from Combination
1055
1056
1057// Materials from Scratch
1058
1059
1060// Visualization attributes
1061
1062
1063// Logical  Volumes
1064
1065
1066// Physical Volumes ----  Single Positioned Placement,   Repeated Placement,   Slicing  ---------------------------
1067
1068
1069// Single Positioned Placement
1070
1071
1072// Repeated Placement Translation
1073
1074
1075// Repeated Placement AxialSymmetoric
1076
1077
1078// Slicing Translation
1079
1080
1081// Slicing AxialSymmetric
1082
1083
1084// return the physical World
1085
1086
1087</pre>
1088<hr>
1089Next is the definition file of this skelton class.
1090<hr>
1091<pre>
1092
1093// Geometry Header File
1094//   MyDetector.hh generated by Geant4 Geometry Editor at Wed Feb 25 20:27:44 JST 2004 
1095
1096
1097#ifndef MyDetector_h
1098#define  MyDetector_h  1
1099
1100class G4VPhysicalVolume;
1101#include "G4VUserDetectorConstruction.hh"
1102class  MyDetector:  public G4VUserDetectorConstruction
1103   {      public:
1104      MyDetector();
1105     ~MyDetector();
1106
1107      public:
1108      G4VPhysicalVolume* Construct();
1109  };
1110#endif
1111
1112</pre>
1113
1114<hr>
1115</A><A HREF="#TOP">BACK</A><br>
1116<A NAME="3-7-1">
1117<h3>
11183-7-1) Naming conventions in GGE
1119</h3>
1120<BR>
1121 Knowing GGE's naming convention is helpful to read the generated C++ code as
1122well as using GGE correctly. Look at relevant Geant4 constructors will be very
1123suggestive.
1124
1125<ol>
1126 <li> Elements and materials
1127        <ol>
1128        <li> Elements are named "elementXXX", where XXX stands for the
1129                element's symbol in the periodic table.
1130        <li> materials are named just as you have typed in the second column
1131                of the material window.
1132        </ol>
1133  <li> solids and logical volumes<br>
1134        The "Name" typed in the first (leftmost) column of the "Logical Volume"
1135        is used to name the corresponding solid. If the name "world" is given
1136        to a logical volume of a Box, the G4Solid has an instance "solidworld".
1137   <li> logical and physical volumes<br>
1138        <ol>
1139          <LI> The strings of the  pName (physical or logical) cells filled in the table are used literally as the names of instances.
1140        <li><SPAN STYLE="text-decoration:line-through;">The instance of a physical volume defined by "pName" has
1141          a name prefixed
1142        with "physical", i.,e., instance's name is "physical" + pName ( + =>
1143        string concatenation). "logical" is added to the instance of a logical
1144        volume.</SPAN>
1145        <li><SPAN STYLE="text-decoration:line-through;">In case of SPV (single positioned volume), the columns "pName" (instance of
1146        physical volume) and "pLogical" may have the same strings.</SPAN>
1147        <li>
1148        <SPAN STYLE="text-decoration:line-through;">In case of RVA (repeated volumes arrangement), "pName" is different from
1149        "pLogical" whose copies are repeatedly placed.</SPAN>
1150        </ol>
1151    <li>All variables are named after their proper instances.
1152        See for example, the control variable used in the for loop in the
1153        RVA.
1154                <br>
1155        Another examples are arrays to define BREP geometry.
1156</ol>
1157<hr>
1158</A><A HREF="#TOP">BACK</A><BR>
1159<A NAME="3-7-2">
1160<h3>
11613-7-2) Default values and combo-boxes
1162</h3>
1163
1164<ol>
1165<li> Default optional values of materials
1166        GGE provides default values in a pre-filled columns or with the
1167        combo-boxes. "Use", "State" and "Unit" columns are equipped with
1168        combo-boxes. Temperature and pressure column are pre-filled with
1169        273.15 * kelvin and 1 * atmosphere.
1170<li> Default values in volumes
1171        "Mother Type" is either NULL (mother of all), logical (type 2, 4 constructors)
1172        or physical (type 2 or 4 constructors) in G4PVPlacement.
1173</ol>
1174
1175<hr>
1176<hr>
1177<A NAME="4">
1178<FONT color=#238e23 size=+3><B>
11794)GPE: Geant4 Physics Editor</B></FONT>
1180</A><A HREF="#TOP">BACK</A><BR>
1181<HR>
1182
1183GPE is the GUI tool for the user to be able to define the association
1184between particles and processes.
1185
1186It consists of two parts;
1187<DL>
1188<DT>Physics List Table
1189<DD>This is shown in the upper half of the GPE. Every row represents a
1190  C++ code line to add the doublet of a particle (the first column)
1191 and an EM process (the second column) with the default parameters (from the third through fifth column). The name of a particle  can be copied
1192from the table below by a mouse click.
1193<DT>EM particle table and EM process table
1194<DD>Two tables are displayed in tabbed panes, respectively. User select a particle(s) within the particle table and then click the "Append" button. A new row is created in the Physics List Table  with the default process "Null". Then,
1195user chooses a process and click the "Change process" button.
1196</DL>
1197
1198
1199<HR>
1200</A><A HREF="#TOP">BACK</A><BR>
1201<A NAME="4-1">
1202<H3>4-1)Particle</h3>
1203<BR>
1204
1205GPE helps the user to choose particles to be instantiated.
1206
1207<ol>
1208<li>The user can either choose a set of all particles belonging to a category
1209or to choose an individual particle.
1210The following buttons are shown in the tabbed pane titled "EM Particles".
1211    <UL>
1212    <LI>one of either Bosons, Leptons, Mesons, Baryons, Ions
1213    <LI>all bosons, all leptons, all mesons, all baryons, all ions, all short-lived
1214    </UL>
1215
1216Particles in the category "Shortlived" can be either chosen all at once
1217or not chosen at all.
1218<li>
1219</ol>
1220
1221<h3>
1222 C++ codes for particles instantiation
1223</h3>
1224<br>
1225
1226GPE generates the
1227"ConstructParticle" method as follows;
1228<pre>
1229void MyPhysicsList::ConstructParticle()
1230{
1231     ConstructBosons();
1232     ConstructLeptons();
1233     ConstructMesons();
1234     ConstructBarions();
1235     ConstructIons();
1236     ConstructShortLiveds();
1237}
1238</pre>
1239
1240Then GPE generates codes for each category of particles,
1241
1242<pre>
1243void MyPhysicsList::ConstructBosons()
1244{
1245     G4Geantino::GeantinoDefinition();
1246     ....
1247     ....   
1248}
1249</pre>
1250
1251
1252<HR>
1253</A><A HREF="#TOP">BACK</A><BR>
1254<A NAME="4-2"><h3>
12554-2)EM Processes
1256</h3><BR>
1257
1258
1259With the GPE  the user can
1260choose, associate and register a process to a particle.
1261
1262
1263Merits of GPE¡¡could be as follows;
1264<UL>
1265<LI> user can forget  many lengthy class names of particles and processes
1266<LI> user can forget to specify necessary class definition files
1267<LI> user can forget default values of stepping parameters associated to processes
1268<LI> user can forget how to register doublets of a particle and a process
1269<LI> it is quite easy to test a physics list
1270</UL>
1271
1272
1273<OL>
1274<LI>
1275Process Manager<BR>
1276
1277    Information required to register a process to the process manager, i.e.,
1278    Pointer to the process object and ordering parameter for each DoIt
1279<LI>
1280C++ code <BR>
1281
1282From a row in the Physics List Table GPE generates C++ lines like;
1283<pre>
1284  G4Aprocess* aProcess;
1285  G4ParticleDefinition* particle;
1286
1287  G4ProcessManager* pmanager = particle->GetProcessManager();
1288  if ( aProcess->IsApplicable(*particle) ) {
1289       pmanager->AddProcess(aProcess, idxAtRest, idxAlongStep, idxPostStep):
1290    }
1291
1292</pre>
1293
1294<LI>
1295On a selection of a process, the default (predefined)
1296ordering parameters are given. The user can edit them as will.
1297
1298<LI>
1299Available Processes
1300<UL>
1301Currently implemented in GPE are transportation,
1302electromagnetic and general (only G4Decay).
1303<LI>
1304The following electromagnetic processes are available in GPE;
1305 standard, muon, xray and lowenergy processes.
1306<LI>
1307Transportation and G4Decay are always included by GPE (default).
1308<LI>
1309Hadronic processes and models
1310 aren't implemented.
1311<LI>
1312
1313Excluded processes are parametrization and optical, since both are deeply
1314correlated with the detector geometry.
1315</UL>
1316</OL>
1317<HR>
1318<A HREF="#TOP">BACK</A><BR>
1319<A NAME="4-3"><h3>4-3) C++ codes generated by GPE
1320</h3></A>
1321
1322<OL>
1323<LI>C++ code for "ConstructProcess" method
1324
1325<pre>
1326void MyPhysicsList::ConstructProcess()
1327{
1328     AddTransportation();
1329     ConstructEM();
1330     //ConstructHad();
1331     ConstructGeneral():
1332}
1333
1334void ExN02PhysicsList::ConstructEM()
1335{
1336  theParticleIterator->reset();
1337  while( (*theParticleIterator)() ){
1338    G4ParticleDefinition* particle = theParticleIterator->value();
1339    G4ProcessManager* pmanager = particle->GetProcessManager();
1340    G4String particleName = particle->GetParticleName();
1341
1342// Each if clause corresponds to a row in the PhysicsTable
1343
1344    if (particleName == "gamma") {
1345      pmanager->AddProcess(new G4PhotoElectricEffect(),ordInActive,ordInActive,ordDefault);
1346    }
1347    if (particleName == "gamma") {
1348      pmanager->AddProcess(new G4ComptonScattering(),ordInActive,ordInActive,ordDefault);
1349    }
1350    if (particleName == "gamma") {
1351      pmanager->AddProcess(new G4GammaConversion(),ordInActive,ordInActive,ordDefault);
1352    }
1353    if (particleName == "gamma") {
1354      pmanager->AddProcess(new G4PolarizedComptonScattering(),ordInActive,ordInActive,ordDefault);
1355    }
1356    if (particleName == "e-") {
1357      pmanager->AddProcess(new G4MultipleScattering(),ordInActive,1,1);
1358    }
1359.....
1360.....
1361</pre>
1362
1363
1364
1365
1366<LI>
1367C++ code for ConstructGeneral()
1368
1369<pre>
1370#include "G4Decay.hh"
1371
1372void ExN02PhysicsList::ConstructGeneral()
1373{
1374  G4Decay* theDecayProcess = new G4Decay();
1375  theParticleIterator->reset();
1376  while( (*theParticleIterator)() ){
1377    G4ParticleDefinition* particle = theParticleIterator->value();
1378    G4ProcessManager* pmanager = particle->GetProcessManager();
1379    if (theDecayProcess->IsApplicable(*particle)) {
1380      pmanager ->AddProcess(theDecayProcess);
1381      pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
1382      pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
1383    }
1384  }
1385}
1386
1387</pre>
1388
1389
1390
1391<LI>GPE generates a header file of user's physics list class.
1392<LI>
1393C++ for default cut value can be generated, using user's cut length.
1394(no cut-by-region).
1395<pre>
1396void ExN02PhysicsList::SetCuts()
1397{
1398// defaultCutValue you have typed in is used
1399
1400  if (verboseLevel >1){
1401    G4cout << "ExN02PhysicsList::SetCuts:";
1402  }
1403  SetCutsWithDefault();
1404}
1405</pre>
1406</OL>
1407<A HREF="#TOP">BACK</A><BR>
1408<A NAME="4-4">
1409<h3>4-4) Persistent file</H3></A>
1410<BR>
1411The class name and default cut value are indispensable to make C++ code or to
1412save to the persistent file. The contents of the GPE can be saved to a file
1413in the Java serialization format and can be reused.
1414
1415
1416
1417
1418<HR>
1419<A NAME="5">
1420<FONT color=#238e23 size=+3><B>
14215)MOMO's Companion Files
1422</B></FONT>
1423</A>
1424<BR>
1425<HR>
1426
1427The companion files are included under MomoHome.
1428The files in red are created by  MOMO.
1429<pre>
1430[~/MomoPlugin]$ ls -R MomoHome
1431MomoHome:
1432<font color=red>MomoN02Test.cc             PDGmaterials.xml</font>  include/
1433<font color=red>MomoN02MyDetector.g4dt</font>     README             src/
1434<font color=red>MomoN02PhysicsList.g4ph     Momomake.gmk    dicomVolume.xml</font>    vis.mac
1435
1436MomoHome/include:
1437MomoEventAction.hh    <font color=red>MomoN02PhysicsList.hh</font>          MomoRunAction.hh
1438<font color=red>MomoN02MyDetector.hh</font>  MomoPrimaryGeneratorAction.hh  MomoVisManager.hh
1439
1440MomoHome/src:
1441MomoEventAction.cc    <font color=red>MomoN02PhysicsList.cc</font>          MomoRunAction.cc
1442<font color=red>MomoN02MyDetector.cc</font>  MomoPrimaryGeneratorAction.cc  MomoVisManager.cc
1443</pre>
1444<A HREF="#TOP">BACK</A><BR>
1445<A NAME="5-1">
1446<h3>5-1)Momomake.gmk generated by MOMO</h3>
1447</A><BR>
1448Following is the automatically generated "Momomake.gmk" file. The word in red
1449is the target name specified by the user. In the example,
1450G4WORKDIR and G4BINDIR (in orange) are specified in the relative path (period).
1451Note that the present directory means where momo was started.
1452<pre>
1453##### GNUmakefile #####
1454# ----------------------------------------------------------
1455# Script defining rules and paths for making binaries.
1456# ----------------------------------------------------------
1457# Automatic creation of GNUmakefile for Momo environment.
1458# with users selection of G4TARGET, UI and VIS variables
1459#  Momo is the name of legendary samurai who conquered bad geants. ----   H. Yoshida.
1460
1461name := <font color=red>MomoN02Test</font>
1462G4TARGET := $(name)
1463G4EXLIB := true
1464
1465# Vis/GUI used
1466G4VIS_USE_DAWN := 1
1467G4VIS_USE_DAWNFILE := 1
1468G4VIS_USE_OPENGLX := 1
1469G4VIS_USE_VRML := 1
1470G4VIS_USE_VRMLFILE := 1
1471# Vis/GUI built
1472G4VIS_BUILD_DAWN_DRIVER := 1
1473G4VIS_BUILD_DAWNFILE_DRIVER := 1
1474G4VIS_BUILD_OPENGLX_DRIVER := 1
1475G4VIS_BUILD_VRML_DRIVER := 1
1476G4VIS_BUILD_VRMLFILE_DRIVER := 1
1477
1478# General Envs defined
1479G4SYSTEM:=Linux-g++
1480G4INSTALL:=/home/yoshidah/geant4.6.0.p01
1481<font color=orange>G4WORKDIR:=.
1482G4BINDIR:=./bin/Linux-g++</font>
1483G4USE_STL:=1
1484G4LIB_BUILD_STATIC:=1
1485G4LEDATA:=/home/yoshidah/G4DATA/G4EMLOW2.2
1486G4LEVELGAMMADATA:=/home/yoshidah/G4DATA/PhotonEvaporation
1487G4REALSURFACEDATA:=/home/yoshidah/G4DATA/RealSurface1.0
1488
1489ifndef G4INSTALL
1490   G4INSTALL = ../../..
1491endif
1492
1493.PHONY: all
1494all: lib bin
1495
1496  include $(G4INSTALL)/config/binmake.gmk
1497</pre>
1498
1499<HR>
1500<A NAME="5-2">
1501<h3>5-2)Main program generated by MOMO</h3>
1502</A><A HREF="#TOP">BACK</A><BR>
1503All the following codes are automatically generated by MOMO.
1504The red words are user defined class names, which MOMO uses for
1505code generation. The words in orange can be changed as will.
1506<pre>
1507//##### MOMO Main program #####
1508//# ----------------------------------------------------------
1509//# Automatic creation of the main program for Momo environment.
1510// 2003 December, updated for  geant4.6.0
1511// --------------------------------------------------------------
1512//   MomoN02Test.cc generated by Geant4 Momo
1513//     at Tue Feb 24 09:23:50 JST 2004 
1514
1515
1516// This code implementation is the intellectual property of
1517// the  GEANT4 collaboration.
1518//
1519// By copying, distributing or modifying the Program (or any work
1520// based on the Program) you indicate your acceptance of this statement,
1521// and all its terms.
1522//
1523//
1524#include "G4RunManager.hh"
1525#include "G4UImanager.hh"
1526// Your choice of User Interface driver
1527#include "<font color=orange>G4UIGAG</font>.hh"
1528// Detector geometry generated by Momo's GGE
1529#include "<font color=red>MomoN02MyDetector</font>.hh"
1530// Physics List generated by Momo's GPE
1531#include "<font color=red>MomoN02PhysicsList</font>.hh"
1532// Momo's default PrimaryGeneratorAction
1533#include "MomoPrimaryGeneratorAction.hh"
1534#include "MomoRunAction.hh"
1535#include "MomoEventAction.hh"
1536#ifdef G4VIS_USE
1537#include "MomoVisManager.hh"
1538#endif
1539int main()
1540{
1541  // Construct the default run manager
1542  G4RunManager* runManager = new G4RunManager;
1543  // set mandatory initialization classes
1544  runManager->SetUserInitialization(new <font color=red>MomoN02MyDetector</font>);
1545  runManager->SetUserInitialization(new <font color=red>MomoN02PhysicsList</font>);
1546#ifdef G4VIS_USE
1547  // visualization manager
1548  G4VisManager* visManager = new MomoVisManager;
1549  visManager->Initialize();
1550#endif
1551  // set mandatory user action class
1552  runManager->SetUserAction(new MomoPrimaryGeneratorAction);
1553  // set user action classes to visualise trajectories
1554  runManager->SetUserAction(new MomoRunAction);
1555  runManager->SetUserAction(new MomoEventAction);
1556  // Initialize G4 kernel
1557  runManager->Initialize();
1558  // get the pointer to the User Interface manager
1559  G4UImanager* UI = G4UImanager::GetUIpointer();
1560      G4UIsession * session = new <font color=orange>G4UIGAG</font>;
1561      session->SessionStart();
1562      delete session;
1563  // job termination
1564#ifdef G4VIS_USE
1565  delete visManager;
1566#endif
1567  delete runManager;
1568  return 0;
1569}
1570
1571
1572</pre>
1573
1574
1575
1576
1577<hr>
1578The following document is taken from the Geant4 documents to help
1579MOMO's Environment Panel.<BR>
1580<A NAME="10.5">
1581<FONT color=#238e23 size=+3><B>10.5 Makefiles and Environment
1582Variables</B> </FONT>
1583</A><A HREF="#TOP">BACK</A>
1584<BR><BR>
1585<HR align=center SIZE=7>
1586<BR><BR><!-- ============================================== Section -->This
1587section describes how the GNUmake infrastructure is implemented in Geant4 and
1588provides a quick reference guide for the user/installer about the most important
1589environment variables defined.
1590<P>
1591<H2>10.5.1 The GNUmake system in Geant4</H2>As described in section 2.7.1.1 of
1592this manual, the GNUmake process in Geant4 is mainly controlled by the following
1593GNUmake script files (<KBD>*.gmk</KBD> scripts are placed in
1594<KBD>$G4INSTALL/config</KBD>):
1595<UL>
1596  <LI><KBD>architecture.gmk</KBD>: defining all the architecture specific
1597  settings and paths. System settings are stored in
1598  <KBD>$G4INSTALL/config/sys</KBD> in separate files.
1599  <LI><KBD>common.gmk</KBD>: defining all general GNUmake rules for building
1600  objects and libraries.
1601  <LI><KBD>globlib.gmk</KBD>: defining all general GNUmake rules for building
1602  compound libraries.
1603  <LI><KBD>binmake.gmk</KBD>: defining the general GNUmake rules for building
1604  executables.
1605  <LI><KBD>GNUmake</KBD> scripts: placed inside each directory in the G4
1606  distribution and defining directives specific to build a library (or a set of
1607  sub-libraries) or and executable. </LI></UL>To build a single library (or a set
1608of sub-libraries) or an executable, you must explicitly change your current
1609directory to the one you're interested to and invoke the "<KBD>gmake</KBD>"
1610command from there ("<KBD>gmake global</KBD>" for building a compound library).
1611Here is a list of the basic commands or GNUmake "targets" one can invoke to
1612build libraries and/or executables:
1613<UL>
1614  <LI><KBD>gmake</KBD><BR>This will start the compilation process for building a
1615  kernel library or a library associated to an example. Kernel libraries are
1616  built with maximum granularity, i.e. if a category is a compound one, this
1617  command will build all the related sub-libraries, _not_ the compound one. The
1618  top level <KBD>GNUmakefile</KBD> in <KBD>$G4INSTALL/source</KBD> will also
1619  build in this case a dependency map <KBD>libname.map</KBD> of each library to
1620  establish the linking order automatically at the <KBD>bin</KBD> step. The map
1621  will be placed in <KBD>$G4LIB/$G4SYSTEM</KBD>.
1622  <LI><KBD>gmake global</KBD><BR>It will start the compilation process to build
1623  a single compound kernel library per category. If issued sub-sequently to
1624  "gmake", both installations 'granular' and 'compound' libraries will be
1625  available (NOTE: will consistently increase the disk space required. Compound
1626  libraries will then be selected by default at link time, unless
1627  G4LIB_USE_GRANULAR is specified).
1628  <LI><KBD>gmake bin</KBD> or <KBD>gmake</KBD> (only for examples/)<BR>It will
1629  start the compilation process to build an executable. This command will build
1630  implicitly the library associated to the example and link the final
1631  application. It assumes _all_ kernel libraries are already generated and
1632  placed in the correct <KBD>$G4INSTALL</KBD> path defined for them.<BR>The
1633  linking order is controlled automatically in case libraries have been built
1634  with maximum granularity, and the link list is generated on the fly.
1635</LI></UL><B><KBD>lib/ bin/</KBD> and <KBD>tmp/</KBD> directories</B> 
1636<P>The <KBD>$G4INSTALL</KBD> environment variable specifies where the
1637installation of the Geant4 toolkit should take place, therefore kernel libraries
1638will be placed in <KBD>$G4INSTALL/lib</KBD>. The <KBD>$G4WORKDIR</KBD> 
1639environment variable is set by the user and specifies the path to the user
1640working directory; temporary files (object-files and data products of the
1641installation process of Geant4) will be placed in <KBD>$G4WORKDIR/tmp</KBD>,
1642according to the system architecture used. Binaries will be placed in
1643<KBD>$G4WORKDIR/bin</KBD>, according to the system architecture used. The path
1644to <KBD>$G4WORKDIR/bin/$G4SYSTEM</KBD> should be added to <KBD>$PATH</KBD> in
1645the user environment.
1646<P><!-- ============================================== Section -->
1647<HR>
1648
1649<H2>10.5.2 Environment variables</H2>Here is a list of the most important
1650environment variables defined within the Geant4 GNUmake infrastructure, with a
1651short explanation of their use. We recommend _not_ to override (explicitly or by
1652accident) those environment variables listed here and marked with (!).
1653<UL>
1654  <LI>System configuration
1655  <P>$CLHEP_BASE_DIR<BR>Specifies the path where the CLHEP package is installed
1656  in your system.
1657  <P>$G4SYSTEM (!)<BR>Defines the architecture and compiler currently used. This
1658  variable should be set automatically by the installer script "g4install" (in
1659  case of installation of Geant4) or by the script "g4config" (in case of
1660  pre-installed Geant4 and initial configuration of the user's environment).
1661  <P></P>
1662  <LI>Installation paths
1663  <P>$G4INSTALL<BR>Defines the path where the Geant4 toolkit should be
1664  installed. It should be set by the system installer. By default, it sets to
1665  $HOME/geant4, assuming the Geant4 distribution is placed in $HOME.
1666  <P>$G4BASE (!)<BR>Defines the path to the source code. Internally used to
1667  define $CPPFLAGS and $LDFLAGS for -I and -L directives. It has to be set to
1668  $G4INSTALL/src.
1669  <P>$G4WORKDIR<BR>Defines the path for the user's workdir for Geant4. It is set
1670  by default to $HOME/geant4, assuming the user's working directory for Geant4
1671  is placed in $HOME.
1672  <P>$G4INCLUDE<BR>Defines the path where source header files may be mirrored at
1673  installation by issuing <CODE>gmake includes</CODE> (default is set to
1674  <CODE>$G4INSTALL/include</CODE>)
1675  <P>$G4BIN, $G4BINDIR (!)<BR>Used by the system to specify the place where to
1676  store executables. By default they're set to $G4WORKDIR/bin and
1677  $G4BIN/$G4SYSTEM respectively. The path to $G4WORKDIR/bin/$G4SYSTEM should be
1678  added to $PATH in the user environment. $G4BIN can be overridden.
1679  <P>$G4TMP, $G4TMPDIR (!)<BR>Used by the system to specify the place where to
1680  store temporary files products of the compilation/build of a user application
1681  or test. By default they're set to $G4WORKDIR/tmp and $G4TMP/$G4SYSTEM
1682  respectively. $G4TMP can be overridden.
1683  <P>$G4LIB, $G4LIBDIR (!)<BR>Used by the system to specify the place where to
1684  store libraries. By default they're set to $G4INSTALL/lib and $G4LIB/$G4SYSTEM
1685  respectively. $G4LIB can be overridden.
1686  <P></P>
1687  <LI>Build specific
1688  <P>$G4TARGET<BR>Specifies the target (name of the source file defining the
1689  main()) of the application/example to be built. This variable is set
1690  automatically for the examples and tests placed in $G4INSTALL/examples.
1691  <P>$G4EXEC_BUILD<BR>Flag specifying if to use a secondary template repository
1692  or not for handling template instantiations at the time of building a user
1693  application/example. For internal category tests in Geant4, this variable is
1694  already in the related GNUmakefile. It's however not needed for examples and
1695  tests in $G4INSTALL/examples, where class names are already mangled and
1696  different each other. It applies only on those compilers which make use of
1697  template repositories (see Appendix A.2 of this Guide). The secondary template
1698  repository is set to $G4TREP/exec.
1699  <P>$G4DEBUG<BR>Specifies to compile the code (libraries or examples) including
1700  symbolic information in the object code for debugging. The size of the
1701  generated object code can increase considerably. By default, code is compiled
1702  in optimised mode ($G4OPTIMISE set).
1703  <P>$G4NO_OPTIMISE<BR>Specifies to compile the code (libraries or examples)
1704  without compiler optimisation.
1705  <P>$G4NO_STD_NAMESPACE<BR>To avoid using the <I>std</I> namespace in the
1706  Geant4 libraries.
1707  <P>$G4NO_STD_EXCEPTIONS<BR>To avoid throwing of exceptions in Geant4.
1708  <P>$G4_NO_VERBOSE<BR>Geant4 code is compiled by default in high verbosity mode
1709  ($G4VERBOSE flag set). For better performance, verbosity code can be left out
1710  by defining $G4_NO_VERBOSE.
1711  <P>$G4LIB_BUILD_SHARED<BR>Flag specifying if to build kernel libraries as
1712  shared libraries (libraries will be then used by default). If not set, static
1713  archive libraries are built by default.
1714  <P>$G4LIB_BUILD_STATIC<BR>Flag specifying if to build kernel libraries as
1715  static archive libraries in addition to shared libraries (in case
1716  $G4LIB_BUILD_SHARED is set as well).
1717  <P>$G4LIB_USE_GRANULAR<BR>To force usage of "granular" libraries against
1718  "compound" libraries at link time in case both have been installed. The Geant4
1719  building system chooses "compound" libraries by default, if installed.
1720  </P></LI></UL>
1721<UL>
1722  <LI>UI specific
1723  <P>The most relevant flags for User Interface drivers are just listed here. A
1724  more detailed description is given also in section 2. of this User's Guide.
1725  <P>G4UI_USE_TERMINAL<BR>Specifies to use dumb terminal interface in the
1726  application to be built (default).
1727  <P>G4UI_BUILD_XM_SESSION, G4UI_BUILD_XAW_SESSION<BR>Specifies to include in
1728  kernel library the <I>XM</I> or <I>XAW</I> Motif-based user interfaces.
1729  <P>G4UI_USE_XM, G4UI_USE_XAW<BR>Specifies to use the <I>XM</I> or <I>XAW</I> 
1730  interfaces in the application to be built.
1731  <P>G4UI_BUILD_WO_SESSION, G4UI_USE_WO<BR>Specifies to use the <I>WO</I> user
1732  interface associated to the OPACS tool.
1733  <P>G4UI_BUILD_WIN32_SESSION<BR>Specifies to include in kernel library the
1734  WIN32 terminal interface for Windows systems.
1735  <P>G4UI_USE_WIN32<BR>Specifies to use the WIN32 interfaces in the application
1736  to be built on Windows systems.
1737  <P>G4UI_NONE<BR>If set, no UI sessions nor any UI libraries are built. This
1738  can be useful when running a pure batch job or in a user framework having its
1739  own UI system. </P></LI></UL>
1740<UL>
1741  <LI>Visualization specific
1742  <P>The most relevant flags for visualization graphics drivers are just listed
1743  here. A description of these variables is given also in section 2. of this
1744  User's Guide.
1745  <P>$G4VIS_BUILD_OPENGLX_DRIVER<BR>Specifies to build kernel library for
1746  visualization including the OpenGL driver with X11 extension. It requires
1747  $OGLHOME set (path to OpenGL installation).
1748  <P>$G4VIS_USE_OPENGLX<BR>Specifies to use OpenGL graphics with X11 extension
1749  in the application to be built.
1750  <P>$G4VIS_BUILD_OPENGLXM_DRIVER<BR>Specifies to build kernel library for
1751  visualization including the OpenGL driver with XM extension. It requires
1752  $OGLHOME set (path to OpenGL installation).
1753  <P>$G4VIS_USE_OPENGLXM<BR>Specifies to use OpenGL graphics with XM extension
1754  in the application to be built.
1755  <P>$G4VIS_BUILD_OI_DRIVER<BR>Specifies to build kernel library for
1756  visualization including the OpenInventor driver. It requires $OIHOME and
1757  $HEPVISDIR set (paths to OpenInventor/HepVis installation).
1758  <P>$G4VIS_USE_OI<BR>Specifies to use OpenInventor graphics in the application
1759  to be built.
1760  <P>$G4VIS_BUILD_OIX_DRIVER<BR>Specifies to build the driver for the free X11
1761  version of OpenInventor.
1762  <P>$G4VIS_USE_OIX<BR>Specifies to use the free X11 version of OpenInventor.
1763  <P>$G4VIS_BUILD_OIWIN32_DRIVER<BR>Specifies to build the driver for the free
1764  X11 version of OpenInventor on Windows systems.
1765  <P>$G4VIS_USE_OIWIN32<BR>Specifies to use the free X11 version of OpenInventor
1766  on Windows systems.
1767  <P>$G4VIS_BUILD_OPACS_DRIVER<BR>Specifies to build kernel library for
1768  visualization including the OPACS driver. It requires $OPACSHOME set (path to
1769  OPACS installation).
1770  <P>$G4VIS_USE_OPACS<BR>Specifies to use OpenInventor graphics in the
1771  application to be built.
1772  <P>$G4VIS_BUILD_DAWN_DRIVER<BR>Specifies to build kernel library for
1773  visualization including the driver for DAWN.
1774  <P>$G4VIS_USE_DAWN<BR>Specifies to use DAWN as a possible graphics renderer in
1775  the application to be built.
1776  <P>$G4DAWN_HOST_NAME<BR>To specify the hostname for use with the DAWN-network
1777  driver.
1778  <P>$G4VIS_NONE<BR>If specified, no visualization drivers will be built or
1779  used. </P></LI></UL>
1780<UL>
1781  <LI>Analysis specific
1782  <P>$G4ANALYSIS_USE<BR>Specifies to activate the appropriate environment for
1783  analysis, if an application includes code for histogramming based on
1784  <I>AIDA</I>. Additional setup variables are required
1785  ($G4ANALYSIS_AIDA_CONFIG_CFLAGS, $G4ANALYSIS_AIDA_CONFIG_LIBS) to define
1786  config options for AIDA ("aida-config --cflags" and "aida-config --libs"). See
1787  installation instructions of the specific analysis tools for details.
1788</P></LI></UL>
1789<UL>
1790  <LI>Directory paths to Physics Data
1791  <P>$NeutronHPCrossSections<BR>Path to external data set for Neutron Scaterring
1792  processes.
1793  <P>$G4LEDATA<BR>Path to external data set for low energy electromagnetic
1794  processes.
1795  <P>$G4LEVELGAMMADATA<BR>Path to the data set for Photon Evaporation.
1796  <P>$G4RADIOACTIVEDATA<BR>Path to the data set for Radiative Decay processes.
1797  </P></LI></UL><!-- ============================================== Section -->
1798<HR>
1799
1800<H2>10.5.3 Linking External Libraries with Geant4</H2>The Geant4 GNUmake
1801infrastructure allows to extend the link list of libraries with external (or
1802user defined) packages which may be required for some user's applications to
1803generate the final executable.
1804<P>
1805<H3>10.5.3.1 Adding external libraries which do *not* use Geant4</H3>In the
1806<TT>GNUmakefile</TT> of your application, before including <TT>binmake.gmk</TT>,
1807specify the extra library in <TT>EXTRALIBS</TT> either using the
1808<TT>-L...-l...</TT> syntax or by specifying the full pathname, e.g.: <PRE>  EXTRALIBS := -L&lt;your-path&gt;/lib -l&lt;myExtraLib&gt;
1809or
1810  EXTRALIBS := &lt;your-path&gt;/lib/lib&lt;myExtraLib&gt;.a
1811</PRE>You may also specify <TT>EXTRA_LINK_DEPENDENCIES</TT>, which is added to
1812the dependency of the target executable, and you may also specify a rule for
1813making it, e.g.: <PRE>  EXTRA_LINK_DEPENDENCIES := &lt;your-path&gt;/lib/lib&lt;myExtraLib&gt;.a
1814
1815  &lt;your-path&gt;/lib/lib&lt;myExtraLib&gt;.a:
1816        cd &lt;your-path&gt;/lib; $(MAKE)
1817</PRE>Note that you almost certainly need to augment <TT>CPPFLAGS</TT> for the
1818header files of the external library, e.g.: <PRE>  CPPFLAGS+=-I&lt;your-path&gt;/include
1819</PRE>See table 10.5.1.
1820<P>
1821<CENTER>
1822<TABLE cellPadding=8 border=1>
1823  <TBODY>
1824  <TR>
1825    <TD><PRE> # --------------------------------------------------------------------
1826 # GNUmakefile for the application "sim" depending on module "Xplotter"
1827 # --------------------------------------------------------------------
1828
1829 name := sim
1830 G4TARGET := $(name)
1831 G4EXLIB := true
1832
1833 CPPFLAGS  += -I$(HOME)/Xplotter/include
1834 EXTRALIBS += -L$(HOME)/Xplotter/lib -lXplotter
1835 EXTRA_LINK_DEPENDENCIES := $(HOME)/Xplotter/lib/libXplotter.a
1836
1837 .PHONY: all
1838
1839 all: lib bin
1840
1841 include $(G4INSTALL)/config/binmake.gmk
1842
1843 $(HOME)/Xplotter/lib/libXplotter.a:
1844         cd $(HOME)/Xplotter; $(MAKE)</PRE>
1845  <TR>
1846    <TD align=middle>Table 10.5.1<BR>An example of a customised GNUmakefile
1847      for an application or example using an external module not bound to
1848      Geant4. </TR></TBODY></TABLE></CENTER>
1849<P>
1850<H3>10.5.3.2 Adding external libraries which use Geant4</H3>In addition to the
1851above, specify, in <TT>EXTRALIBSSOURCEDIRS</TT>, a list of directories
1852containing source files in its <TT>src/</TT> subdirectory. Thus, your
1853<TT>GNUmakefile</TT> might contain: <PRE>  EXTRALIBS += $(G4WORKDIR)/tmp/$(G4SYSTEM)/&lt;myApp&gt;/lib&lt;myApp&gt;.a \
1854               -L&lt;your-path&gt;/lib -l&lt;myExtraLib&gt;
1855  EXTRALIBSSOURCEDIRS += &lt;your-path&gt;/&lt;myApp&gt; &lt;your-path&gt;/&lt;MyExtraModule&gt;
1856  EXTRA_LINK_DEPENDENCIES := $(G4WORKDIR)/tmp/$(G4SYSTEM)/&lt;myApp&gt;/lib&lt;myApp&gt;.a
1857
1858  MYSOURCES := $(wildcard &lt;your-path&gt;/&lt;myApp&gt;/src/*cc)
1859  $(G4WORKDIR)/tmp/$(G4SYSTEM)/&lt;myApp&gt;/lib&lt;myApp&gt;.a: $(MYSOURCES)
1860        cd &lt;your-path&gt;/&lt;myApp&gt;; $(MAKE)
1861</PRE>See Table 10.5.2.
1862<P>
1863<CENTER>
1864<TABLE cellPadding=8 border=1>
1865  <TBODY>
1866  <TR>
1867    <TD><PRE># -----------------------------------------------------------------
1868# GNUmakefile for the application "phys" depending on module "reco"
1869# -----------------------------------------------------------------
1870
1871name := phys
1872G4TARGET := $(name)
1873G4EXLIB := true
1874
1875EXTRALIBS += $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/libphys.a \
1876             -L$(HOME)/reco/lib -lreco
1877EXTRALIBSSOURCEDIRS += $(HOME)/phys $(HOME)/reco
1878EXTRA_LINK_DEPENDENCIES := $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/libphys.a
1879
1880.PHONY: all
1881all: lib bin
1882
1883include $(G4INSTALL)/config/binmake.gmk
1884
1885MYSOURCES := $(wildcard $(HOME)/phys/src/*cc)
1886$(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/libphys.a: $(MYSOURCES)
1887        cd $(HOME)/phys; $(MAKE)</PRE>
1888  <TR>
1889    <TD align=middle>Table 10.5.2<BR>An example of a customised GNUmakefile
1890      for an application or example using external modules bound to Geant4.
1891  </TR></TBODY></TABLE></CENTER>
1892<P>
1893<HR>
1894<A NAME="7">
1895<FONT color=#238e23 size=+3><B>7. GAG and Gain</B> </FONT>
1896
1897<BR><BR>
1898<HR align=center SIZE=7>
1899
1900
1901<A NAME="7-1">
1902<h2>7-1  How to use GAG</h2>
1903</A><A HREF="#TOP">BACK</A>
1904<BR>
1905Usage of GAG is simple.
1906<OL>
1907<LI>Click the GAG tab and open the GAG's pane
1908<LI>Click the top left Geant menu and its "Start" button
1909<LI>Choose the Geant4 binary file, using the file chooser and click on it
1910<LI>After a moment, the Geant4 command tree (at left) and parameter panel (at right) are displayed. AT the lower panel is displayed the outputs from Geant4 application.
1911<LI>Click on the nodes or leaves make their help diaplayed. Commands in the opaque characters are inactive ones.
1912<LI>Parameters are either chosen from the list or typed in.
1913<LI> Four buttons are available
1914  <UL>
1915  <li>"Default" button displays the default parameters of the command, if defined
1916  <li>"Current" button displays the current value(s), if available
1917  <li>"Clear" button clear the contents in the parameters cells
1918  <li>"Execute" button starts the command. During the execution, its color isn't in green.
1919  </UL>
1920<LI> Output from the Geant4 are shown in the lower window, if "Log_to_Terminal" button is cheched. This button can be unchecked at any time. "Log_to_File" button can be also cheched or unchecked at any time.
1921<LI>If you want to interrupt the execution, "Kill_Geant4" button is used.
1922</OL>
1923<A NAME="7-2">
1924<h2>7-2  How to use Gain</h2>
1925</A><A HREF="#TOP">BACK</A>
1926
1927<hr>
1928<h3>What is Gain?</h3><p>
1929Gain(Geant4 adaptive interface for network) is a networked GUI tool based on GAG.
1930It inherits almost all features of GAG and has new features to
1931make use of Geant4 running at (a) remote machine(s).
1932<p>
1933Gain runs on a client machine (Windows or Linux),
1934while Geant4 runs on a remote or local server (Linux or Solaris).
1935<p> 
1936
1937It provides two ways to connect to the remote server; SSH mode and Gain socket mode. SSH mode is strongly recommended, since it is as safe as remote SSh
1938connection and it requires G4UIGAG as the Geant4's interface.
1939
1940<dl>
1941<dt> <strong>Gain SSH mode</strong>
1942<dl> Gain has a SSH client fuction and use it to connect to a remote server. Geant4 compiled with G4UIGAG class
1943     can be connected to Gain client. When a SSH connection is established after the authentication,
1944     Gain displays the
1945     remote file browser with which user can choose a Geant4 executable and make it run.
1946     Data  are encrypted during their transfer and are decripted at both side. So, some CPU
1947     power is required for a client machine, if a large amount of data are transfered from
1948     the running Geant4 to Gain. <br> Output from the remote Geant4 are
1949     displayed on the Gain console.
1950      This console can be used as a normal
1951     SSH console and you can type in command directly.<br>
1952     Pluriel remote sessions can be accepted, each displayed in a separate
1953     tabbed pane. A console is attached to each pane/session.
1954<dt> <strong>Gain socket mode</strong>
1955<dl> Gain uses its own way of connecting to a remote server. Remote Geant4 must be compiled with
1956G4UIGainServer class which is distributed in the standard Geant4 package. In this mode, user has to
1957make a Geant4 executable run on the remote server, after having logged in to the remote
1958machine. G4UIGainServer acts as a network server
1959and tells the number of port available for the Gain client. Gain client, after specifying the server and port
1960number, is allowed to connect to the Geant4. Geant4 output
1961</dl>
1962
1963<hr>
1964<h3>How to use Gain</h3>
1965<p>
1966The figure shows a scene when Gain is running in
1967Gain socket mode.
1968<p>
1969In this example,
1970two tabbed panes are displayed to run remote Geant4s running on different servers.
1971
1972
1973<ol>
1974<li>
1975   Gain is started on the Cygwin console. Gain can be started with
1976   Java Web Start.
1977
1978<li>
1979   Top menu  to connect to a server or close (kill) the running G4ant4 or finish Gain.
1980
1981
1982<li> The window to
1983    choose SSh or Gain socket; now SSHINTERFACE is focused   
1984
1985<li>After typing in the remote host name,
1986   SSH login window is shown.
1987
1988<li>
1989When SSH login is accepted, Gain shows the
1990  remore File Chooser. Geant4 with G4UIGAG interface can be started
1991from this chooser.   
1992
1993<li> When Geant4 is started,
1994        Geant4 initialisation output are shown on the cygwin console.
1995
1996
1997
1998
1999<li> After the initialisation phase,
2000 command tree window is available on Gain.   
2001
2002<li> Then, the Gain console is shown below the command tree window.
2003See  the hardcopy
2004of the whole Gain window.
2005This console is the SSH console, so that you can type in Geant4 commands
2006in stead of selecting them in the above command panel.
2007<br>
2008You can shrink the console by single click on the triangle at the left
2009border.
2010
2011<li> 
2012Two ways of ending Geant4 execution are provided.   
2013The command tree provides "exit" command which is just the "exit" of Geant4. On the top
2014menu, "Close one" menu is to send CTRL + C to the running Geant4 process. It can be sent at any
2015moment.
2016
2017</ol>
2018<hr>
2019<h3>Notices on Gain console</h3><br>
2020<ul>
2021<li> At present, Gain's console displays ecerything G4cout from Geant4
2022with G4UIGAG interface. So, strings employed for Gain protocols are
2023displayed. Please ignore lines starting with @@.
2024<li> Gain console demands heavy Windows (X or Windows) power.
2025So, with old graphic accelerators like S3 etc. which are yet common
2026on Linux platforms, speed of console may be very slow. In such cases,
2027shrinking the console pane is a good way to speed up the execution.
2028<li> We have tested Gain over the Internet for a session of more than 24 hours.
2029On Windows XP, We observed some curious deformed tree icons during the session,
2030but the functions were correct and they became normal after some elapsed time.
2031<br>
2032Here is the copy of the long run.
2033<li> The console provides a session of G4UIterminal, and NOT G4UItcsh, at present.
2034<li>If you type "exit" on the console, the execution of Geant4 is stopped.
2035The console is yet a usual ssh console, while the upper windows for
2036the command tree is losing connection to Geant4. If you type in "exit" on the
2037console, it end the ssh session and the whole Gain will be destroyed.
2038</ul>
2039<hr>
2040
2041<address>
2042<a href="mailto:yoshidah@naruto-u.ac.jp">yoshida</a>
2043</address>
2044</body>
2045</html>
2046
2047
2048
2049
2050
2051<HR>
2052<A 
2053href="http://geant4.web.cern.ch/geant4/G4UsersDocuments/Authors/html/subjectsToAuthors.html"><I>About
2054the authors</I></A>
2055
2056
2057
2058<!----    *
2059      Download MOMO.taz and defreeze it
2060    *
2061      Detar it in $HOME/foo/MOMO
2062          o MOMO/src
2063                + MydetectorConstruction.cc, MyPhysicsList.cc
2064          o MOMO/include
2065                + MyDetectorConstruction.hh, MyPhysicsList.hh
2066          o MOMO/GNUmakefile
2067          o MOMO/myDetector.cc
2068          o Macro files for OGLIX and DAWN
2069    *
2070      %make and you have a Geant4 binary in $G4INSTALL/bin/$G4SYATEM
2071
2072
2073
20744) A First Lesson; how to use GGE.
2075
2076Here is a walk-through of how to use GGE.
2077
20784.1) Visualize the prefabricated detector sample
2079        1) In a xterm, type %java gge
2080        2) In the "Volume window", select "Load a Volume file" menu
2081                and double click on "trumpetBREP.g4dt"
2082        3) Click "Makesource" and select "Make C++ code". Have a look of the generated C++ code.
2083        4) Save the C++ code (overwrite the existing one)
2084                in .../GGEmake/src/MyDetectorConstruction.cc" using the file chooser.
2085        5) In another xterm, go to the directory GGEmake/ and type
2086                %make G4TARGET=myGGEdetector
2087
2088                Watch if there is any compilation error. At present,
2089                GGE is made so that it generates correct C++ codes,
2090                if a user uses GGE correctly.
2091
2092                In the example of "trumpetBREP.g4dt", a few warnings are shown on BREP.
2093        6) Check that you have "myGGEdetector" executable, in $(G4INSTALL)/bin/$(G4SYSTEM)
2094        7) In another xterm, type
2095                %java gag
2096               
2097                and with the "Run GEANT4" button, choose and run "myGGEdetector".
2098        8) Use /control/execute command and double click on "GGEdraw.g4m".
2099                To have a better view, use vis~ commands (camera/viewpoint, zoom etc).
2100                You can select DAWNFILE to  draw and have a PS hardcopy.
2101
21024.2) Modify the prefabricated detector
2103 Now let's change the detector configuration. Go to the "Volume" window
2104        and change any part of it, including material.
2105
21064.2.1) Changing materials
2107               
2108        1) First, you have to  "Clear Material" in the Material editor.
2109        2) Then, select "Load material" and double click on "MaterialDB.g4mt".
2110                    Now you have a list of materials.
2111        3) Then, in the "Logical Volume" panel, double click the box you want to change
2112                    and type in the name of the material in the material editor.
2113        4) Change as many materials as you like and push "Used Material" button.
2114                    You see that materials you have typed in are marked "Used" in red.
2115                    If not, you might have mistyped the name of a material.
2116        5) If you want to use additional materials, select  "Use" in the material
2117                   editor (the leftmost column).
2118        6) Push "Makesource" and see your change has been realized in the C++ code.
2119
2120        NOTE!! Be careful that there are no duplicated "Used" materials, when
2121                you load the material DB without "Clear Material".
2122
21234.2.2) Modifying the size parameters of solids
2124
2125        To change the sizes of G4 solids
2126        1) click a "solid" box of the logical volume of your choice.
2127        2) You have a pop-up window to edit the parameters. Change a parameter
2128                        or its unit, as you like.
2129        3) Push "Makesource" and see if your changes have been correctly applied
2130                        to C++ code.
2131        4) In case of BREP solids, the pop-up window has variable number of columns
2132                        to accept any number of nodes.
2133        5) For complicated solids like BREPs, preview may be useful. Click "View"
2134                        button and you have a view with the DAWN renderer. Its g4.prim file
2135                        is also shown in an edit-able widget.
2136
21374.2.3) Changing the type of solid of an existing logical volume
2138   You may want to replace the current G4Solid with another one. In the
2139    present GGE you can't do so directly. You have to "Create" a new logical
2140    volume with the type of solid you want and then delete the unnecessary volume.
2141
2142        1) Choose your new solid with "Select Solid" combo-box.
2143        2) Push "Create" button and you have a pop-up window to input parameters.
2144        3) Type in numbers and select their units. 
2145        4) Preview if you like and then push "OK".
2146        5) Check the C++ code.
2147
21484.2.4) Changing visualization attributes (Color).
2149        1) You have to "Create" a new VisAttributes
2150        2) Upon the "Create" button, you have a Color Chooser.
2151        3) Select RGB (not HSV). Set your color with slide-bars.
2152        4) Give it a name, and push "OK". Then you have a color circle and name in the
2153                VisAttrib panel.
2154        5) Edit the VisAtb box in the LogicalVolume panel.
2155        6) See the C++ code.
2156
21574.2.5) Changing Repeated Volumes
2158
2159
2160
2161
2162"exampleN01.g4dt" contains three "single positioned volumes"
2163                and one "repeated volumes" in the X direction.
2164                Change the parameter of repetition such as the number
2165                or width, or you can add another "repeated volumes"
2166                in another direction.
2167
2168                In "trumpetBREP.g4dt" you can edit BREPs, adding new faces etc..
2169
2170           b) making C++ code "MyDetectorConstruction.cc" and compile.
2171
2172                Finally, back to the step 3 and recompile.
2173
2174
2175        Opening GGE, compile, GAG simultaneously, you can
2176        test and improve the geometry, just like creating
2177        HTML or TeX documents.
2178
2179
2180 2.4) GGEmake; a directory containing the GEANT4 codes to compile and visualize the detector
2181     a) implemented
2182        + GNUmakefile
2183        + myDetector.cc ; main()  with GAG session and visualization manager
2184        + src/ directory contains
2185                + MyDetectorConstruction.cc
2186                + MyPhysicsList.cc
2187                + MyPrimaryGeneratorAction.cc
2188                + MyVisManager.cc
2189        + include/ directory
2190
2191 2.5) compile and visualize with Momo and GAG
2192
2193    a) implemented
2194
2195        + canonical scheme of GEANT4 to compile
2196                + make G4TARGET=myDetector
2197                + the binary is created as $G4INSTALL/bin/G4SYSTEM/myDetector
2198
2199        + Momo (GAG, Compile and GGE buttons)
2200                + rapid cycling of GGE and GAG to edit and view the geometry
2201                + a macro file for visualization (OGLIX default) "DrawDAWN.g4m", etc..
2202
2203     b) not implemented
2204                - automatic "calibration" of the detector with geantino
2205
2206 2.6) exemplary persistent detector files with *.g4dt suffix
2207         + 3D array of lead plates using translational RVArrangement
2208         + BREP Pcones trumpetss  using axially symmetric RVArrangement
2209         + Replicas to form  cylinders
2210
2211-------------------------------------------------------------------------
2212</pre>
2213</font>
2214<hr>
2215<hr>
2216<hr>
2217
2218<font color=red> !!!!!OBSOLETE!!!!!
2219
2220<p>
2221
2222<pre>
22233) Installation
2224
2225The minimum set to get C++ source code
2226        1) GGE.jar file
2227        2) Java interpreter ; java
2228Additional set to compile
2229        3) GEANT4 toolkit with compiled libraries
2230        4) GGEmake directory
2231Additional set to visualise and use GUI
2232        4) DAWN (plus Ghostview) or OGLIX or VRML
2233        5) GAG (Java version) or GAG.jar file
2234Additional too to make life easy
2235        6) Momo to use all the above ingredients; Momo.jar file
2236         (without Momo, you have to invoke GGE, compile and GAG respectively in windows.)
2237
22383.1) Java and Swing
2239We have tested GGE on Unix-en (Linux and Solaris) and Windows (95/NT).
2240
2241 3.1.1) Unix:
2242
2243  + Linux: jdk1.1.3 or later(i.,e., jdk-1.1.6) + Swing-1.0.2
2244        1) jdk1.1.5 may have bugs, while jdk1.1.6 works
2245        2) GGE co-works with Swing-1.0.2 and not with 1.0.1 (or maybe not
2246                with 1.0.3).
2247        3) we are testing the current GGE with JRE1.2-beta04. The present source can be
2248                compiled but doesn't execute correctly. In any case
2249                Sun has announced on 17 August that JDK1.2 will be delayed
2250                till November!!
2251  + Solaris: jdk1.1.6 + swing-1.0.2
2252
2253
2254  We assume that you have
2255        1)jdk1.1.6/bin/java (Java interpreter)  to which paths are set
2256        2)Swing-1.0.2 which is defreezed and placed in $HOME/swing/swingall.jar
2257
2258 3.1.2) Windows:
2259
2260        We use JBuilder2 with  Swing-1.0.2. Note that you have to
2261        eliminate all other libraries than swing-1.0.2, after having
2262        copied it into JBuilder2.
2263
2264        We are trying JDK1.2beta4 + JRE1.2 with JBuilder2.
2265
2266        NOTE! At present we have not Momo/GAG for Windows. So,
2267        you can only create C++ code under the Windows.
2268
22693.2) GGE and related files
2270The latest product of GGE is that of Sep. 24.
2271All *.java, *.class and GGE.jar files are placed in
2272                geant4beta/environments/Momo/java/Momo/GGE
2273
2274Only "GGE.jar" file is necessary to run GGE.
2275
2276        GGE/*.java      GGE source files
2277        GGE/*.class     GGE byte code files
2278        GGE/GGE.jar     jar archive file to which CLASSPATH must be set
2279        GGE/*.g4mt      material database after PDG data
2280        GGE/*.g4dt      exampleN0x detector file
2281C++ source codes and GNUmakefiles to compile with GEANT4 are placed in
2282                geant4beta/environments/Momo/GGEmake.
2283
2284Only geantino is instantiated in the initialization of GEANT4, so that it is quite
2285rapid to have a visualization of the geometry. You can choose DAWN, OpenGL or VRML system.
2286
2287         GGEmake/myGGEdetector.cc               main() program
2288                /GNUmakefile
2289                /src
2290                /src/MyDetectorConstruction.cc  C++ generated by GGE
2291                /src/MyPrimaryGeneratorAction.cc        geantino gun
2292                /src/MyVisManager.cc            DAWN, DAWNFILE, OGLIX, OGLSX, VRML1, VRML1FILE
2293                /src/MyPhysicsList.cc           geantino definition
2294                /include/*.hh
2295                /GGEdraw.g4m                    default macro file to visualize with OGLIX
2296
22973.3) install, setenv and run
2298
2299        %set path=($path jdk1.1.6/bin)          <=== add the path to java and javac
2300        %setenv CLASSPATH .:$HOME/swing/swingall.jar:$HOME/geant4beta/environments/Momo/java/Momo/GGE/GGE.jar
2301
2302
2303  Then in any directory, you can invoke GGE.
2304
2305        %java gge
2306
2307
23083.4) DAWN, Tcl/Tk and Postscript for the preview of CSG or BREP solids
2309 If you don't use GGE's preview button, these are not necessary.
2310
2311 If you want to  preview  G4Solids, you have to install
2312DAWN, Fukui renderer as well as Tcl/Tk wish (Tcl/Tk 8.0) for its GUI.
2313DAWN uses also Postscript to draw *.prim files. 
2314
2315For the visualization of the whole detector, DAWN or  Mesa (for OGLIX)
2316are necessary.
2317
23183.5) GEANT4 toolkit and its environments
2319The visualization manager instantiates DAWN, DAWNFILE, OPENGLIX,
2320OPENGLSX, VRML, VRMLFILE. So, you have to setenv accordingly.
2321
2322
2323</pre>
2324</font>
2325
2326---->
2327
2328</body>
2329</html>
2330
2331
2332
2333
2334
2335
2336
2337
Note: See TracBrowser for help on using the repository browser.