Skip to content

Commit 84f33a0

Browse files
committed
Import Geant4 11.0.0 source tree
1 parent 80e2389 commit 84f33a0

File tree

593 files changed

+68589
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

593 files changed

+68589
-1
lines changed

README.rst

-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ If you think you have found a bug in Geant4, please open a ticket on our `Bugzil
3838
Contributing to Geant4
3939
=====
4040
Please see the main `Contribution Guide <./CONTRIBUTING.rst>`_.
41-

environments/g4py/README.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
Geant4Py
2+
========
3+
4+
_A set of python modules for using Geant4_
5+
6+
7+
System Requirements
8+
-------------------
9+
10+
### CMake
11+
Building system is migrated to CMake system.
12+
13+
### Python
14+
15+
Python2.x and Python 3.x (experimental)
16+
17+
### Boost
18+
19+
Boost_Python is needed.
20+
21+
### (Optional)
22+
23+
ROOT for histogramming/analysis
24+
25+
### Tested Platforms
26+
27+
* CentOS7 (Python2)
28+
* Ubuntu 18.04 LTS (Python3)
29+
30+
How to Install
31+
--------------
32+
Before building library, *GEANT4_INSTALL* environment variable should be set.
33+
34+
# export GEANT4_INSTALL=<Geant4 install path> (zsh, bash)
35+
# setenv GEANT4_INSTALL <Geant4 install path> (csh)
36+
(G4 install path is the path specified by "CMAKE_INSTALL_PREFIX" when building Geant4)
37+
38+
then
39+
40+
# mkdir build
41+
# cd build
42+
# cmake ..
43+
# make
44+
# make install
45+
46+
By default, g4py is installed in \<g4py\>/lib(64) directory.
47+
48+
Before doing tests with CTest, you have to set environment variables
49+
for Geant4 data.
50+
51+
# make
52+
# make install
53+
# ctest
54+
55+
performs automatic unit/integration tests with CTest.
56+
57+
How to Use:
58+
-----------
59+
Some environment variables are required at run time.
60+
61+
### *PYTHONPATH*
62+
63+
Python module search directories, given by a colon-separated list of directories, like
64+
65+
66+
# export PYTHONPATH=<g4py>/lib64:<g4py>/lib64/examples:<g4py>/lib64/tests (zsh, bash)
67+
# setenv PYTHONPATH <g4py>/lib64:<g4py>/lib64/examples:<g4py>/lib64/tests (csh)
68+
69+
### *LD_LIBRARY_PATH*
70+
71+
You might need define LD_LIBRARY_PATH for Geant4 libraries.
72+
# export LD_LIBRARY_PATH=<Geant4 install path>/lib (zsh, bash)
73+
# setenv LD_LIBRARY_PATH=<Geant4 install path>/lib (csh)
74+
75+
### Getting started
76+
You can import Geant4Py modules in Python just like
77+
78+
>>> import Geant4

environments/g4py/examples/README

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
-------------------------------------------------------------------
2+
3+
This directory contains a set of examples for Geant4Py.
4+
5+
[demos/water_phantom]
6+
An example of "water phantom dosimetry"
7+
8+
This demo program shows that a Geant4 application well coworks with ROOT
9+
on Python front end. VisManager, PrimaryGeneratorAction, UserAction-s,
10+
histogramming with ROOT are implemented in Python;
11+
+ dose calculation in a water phantom
12+
+ Python overloading of user actions
13+
+ on-line histogramming with ROOT
14+
+ visualization
15+
16+
17+
[education]
18+
Educational examples with Graphical User Interface using TKinter
19+
20+
* lesson1
21+
The first version of the courseware of the mass attenuation coefficient.
22+
23+
* lesson2
24+
GUI interface of ExN03, which can control geometry configuration,
25+
intial particle condition, physics processes, cut value,
26+
magnetic field and visualization outputs.
27+
28+
[emplot]
29+
Examples of plotting photon cross sections and stopping powers with ROOT
30+
31+
[gdml]
32+
Examples of writing/reading user's geometry to/from a GDML file
33+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Hajime Yoshida
2+
3+
******* README of lesson1 ******
4+
5+
26 September 2006
6+
- Lesson1.py as before
7+
- Lesson1withN03.py
8+
- physics is list is taken from examples/novice/N03
9+
- process on/off
10+
- Leson1Wx.py
11+
- same as Lesson1withN03 but
12+
- New GUI toolkit is used and the default Python isn't enough
13+
- wxPython is necessary
14+
15+
16+
26 May 2006 Geant4.8.1
17+
18+
19+
20+
The first version of the courseware of the mass attenuation coefficient
21+
22+
- Lesson1.py
23+
select absorber material
24+
set its thickness upto 500 mm
25+
select beam particle
26+
set its energy upto 100 MeV
27+
set nu of events up to 100
28+
run
29+
30+
and then
31+
zoom in (x1.1) or zoom out (x0.9)
32+
pan in up/down and/or right/left in the unit of mm (type in two
33+
numbers separated by a space)
34+
35+
execute any G4 command but /gun/particle or /gun/energy which are
36+
defined by the above
37+
38+
-oglx.mac
39+
OGLSX => important to make zooming effective after showing trajectories.
40+
41+
if you want to use VRML, you have to specify the directory where *.wrl
42+
file is stored and the VRML viewer to which the path is set:
43+
G4VRMLFILE_DEST_DIR=/home/yoshidah/tmp/
44+
G4VRMLFILE_VIEWER=vrmlview
45+
46+
And you have VRML drivers built.
47+
G4VIS_BUILD_VRML_DRIVER=1
48+
G4VIS_USE_VRMLFILE=1
49+
G4VIS_BUILD_VRMLFILE_DRIVER=1
50+
G4VIS_USE_VRML=1
51+
52+
53+
-gun.mac
54+
This is used only at the initialization time.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
26 Sep 2006
2+
- added Lesson2Wx.py
3+
New version using wxPython
4+
functionas are identical with ExN03.py
5+
6+
26 May 2006
7+
revised 02 July 2006
8+
Geant4.8.1 release
9+
===============================================
10+
Prerequisites for G4 environment variables.
11+
==============================================
12+
13+
This scripts offers the choice of visualization systems;
14+
one among OGLSX (OpenGL stored mode), or VRML2FILE or Wired3.
15+
16+
OGLSX is the default viewer and you need no environment variables.
17+
18+
To use VRML2FILE you have to specify its viewer which is found in your
19+
search path and the destination directory where *.wrl file is stored.
20+
If you don't specify the name of the viewer, you can't choose it on the panel.
21+
For example,
22+
setenv G4VRMLFILE_VIEWER $HOME/bin/vrmlview
23+
setenv G4VRMLFILE_DEST_DIR $HOME/tmp/ <= terminate with /
24+
25+
To use Wired, download it and install under your directory. Java Runtime
26+
Environment is necessary.
27+
Then set, for example;
28+
setenv G4HEPREPFILE_VIEWER $HOME/Wired/bin/wired <= any path you use
29+
setenv G4HEPREPFILE_DIR $HOME/tmp/
30+
setenv G4HEPREPFILE_NAME lesson2_00 <= any name you choose.
31+
setenv G4HEPREPFILE_OVERWRITE 1 <= to reuse the file for "next event"
32+
G4HEPREPFILE_VIEWER isn't an official Geant4 environment variable but is employed
33+
here to control the vissssualization viewers.
34+
The name of the HepRepFile is ${G4HEPREPFILE_NAME}.heprep which will be
35+
stored in ${G4HEPREPFILE_DIR}.
36+
37+
ExN03.py script don't use VRML or Wired if their *_VIEWER isn't set.
38+
But other env variables are also used in the script to look for the
39+
file and to activate the viewer, you have to set all of the above variables
40+
in the shell where you activate ExN03.py script.
41+
42+
43+
NOTICE) VRML viewer blocks the window (modal), so that you have to exit it to
44+
display another run.
45+
46+
********* ExN03.py script ***********
47+
48+
This example id derived from examples/novice/N03.
49+
You can
50+
- choose the materials of absorber and gap
51+
- set the thickness of the absorber and gap
52+
- set the lateral (in YZ plane) size of the sandwitch cal.
53+
- choose an incedent particle
54+
- set its energy
55+
- set the number of events to run
56+
- toggle on/off of the electromagnetic processes
57+
- set cut length
58+
- set magnetic field
59+
- typein any Geant4 command (except related with the above functions) and execute it
60+
61+
How to run it?
62+
%python ExN03.py
63+
64+
You can visualize with OpenGL stored mode or VRML or Wired3
65+
You can choose either of the active viewers by pushing the
66+
radio buttons.
67+
=========================
68+
NOTICE)
69+
70+
VRML viewer runs in the modal action, and you have to exit it
71+
to have a new diaplay for the new run, or you want to switch to
72+
another viewer.
73+
74+
Wired has the "next"/"previous" event button. So to see the next
75+
event, first run and then "next" event. Wired doesn't block G4
76+
and you can have Wired and OGLSX both open.
77+
78+
79+
80+
ExN03-Wired.py is OBSOLETE. Please use ExN03.py
81+
82+
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# - add tests components
2+
add_subdirectory(g4pytest)
3+
add_subdirectory(gtest01)
4+
add_subdirectory(gtest02)
5+
add_subdirectory(gtest03)
6+
add_subdirectory(gtest04)
7+
add_subdirectory(gtest05)
8+
add_subdirectory(gtest06)
9+
add_subdirectory(gtest07)
10+
add_subdirectory(gtest08)

environments/g4py/tests/History

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
-------------------------------------------------------------------
2+
3+
=========================================================
4+
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
5+
=========================================================
6+
7+
Category History file
8+
---------------------
9+
10+
A set of tests for python wrapping of C++ elements.
11+
12+
----------------------------------------------------------
13+
* Reverse chronological order (last date on top), please *
14+
----------------------------------------------------------
15+
16+
Nov.30, 2008 K.Murakami
17+
- gtest01-07: modified with g4py namespace
18+
19+
Aug.07, 2007 K.Murakami
20+
- gtest06 is added.
21+
- gtest07 is added.
22+
23+
Jul.10, 2007 K.Murakami
24+
- gtest05 is added.
25+
26+
Aug.07, 2006 K.Murakami
27+
- gtest04 is added.
28+
29+
Oct.05, 2005 K.Murakami
30+
- test13 is added.
31+
32+
Aug.31, 2005 K.Murakami
33+
- gtest03 is added.
34+
35+
Aug.28, 2005 K.Murakami
36+
- gtest02 is added.
37+
38+
Aug.24, 2005 K.Murakami
39+
- test12 is added.
40+
41+
Aug.09, 2005 K.Murakami
42+
- test11 is added.
43+
44+
Jun.22, 2005 K.Murakami
45+
- gtest00 is removed
46+
47+
Jun.15, 2005 K.Murakami
48+
- test10 is added.
49+
50+
Jun.14, 2005 K.Murakami
51+
- test00- test09 are finished.
52+
- gtest00 is closed.
53+
- gtest01 is launched for Geant4Py basic tests
54+
55+
May 18, 2005 K.Murakami
56+
- just created.
57+

environments/g4py/tests/README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Test Modules
2+
============
3+
4+
This module collects a set of tests for python wrapping of C++ elements.
5+
6+
>**Notes:** <br>
7+
"*testXX*" directories contain tests without Geant4 package. <br>
8+
"*gtestXX*" directories contain tests with Geant4 package.
9+
10+
11+
Basic tests
12+
-----------
13+
14+
| Test | Description |
15+
|:------:|-------------
16+
|test00 | hallo world
17+
|test01 | simple class wrapping
18+
|test02 | simple inheritance
19+
|test03 | singleton w/o public constructor <br> can NOT be compiled.
20+
|test04 | call policies
21+
|test05 | function overloading & default arguments
22+
|test06 | python inheritance from base class
23+
|test07 | enums
24+
|test08 | static member function
25+
|test09 | operators
26+
|test10 | call by-reference
27+
|test11 | no_init
28+
|test12 | indexing a STL vector
29+
|test13 | test for a list argument/return
30+
31+
32+
Function tests
33+
--------------
34+
35+
| Test | Description |
36+
|:------:|-------------
37+
|gtest01 | user application
38+
|gtest02 | test for using site-module packages
39+
|gtest03 | test for EZsim package
40+
|gtest04 | test for getting command tree and command information
41+
|gtest05 | test for constructing CSG geometries in Python
42+
|gtest06 | test for constructing/visualizing boolean geoemtries
43+
|gtest07 | test for checking overlapped geometries
44+
45+

0 commit comments

Comments
 (0)