Import Geant4 9.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:58:43 +02:00
parent 96c8bcd0af
commit b79225fb37
7544 changed files with 245407 additions and 91099 deletions
+34 -43
View File
@@ -1,4 +1,4 @@
$Id: 00README,v 1.9 2007/11/25 19:37:24 kmura Exp $
$Id: 00README,v 1.11 2008/12/03 07:47:59 kmura Exp $
==========================================================================
Geant4Py
@@ -17,8 +17,8 @@ Python
- only 2.x is tested.
Geant4
- 7.0 or later
- should be built in "global" and "shared" libraries.
- 8.0 or later
- should be built in "GLOBAL" and "SHARED" libraries.
- All header files should be collected into $(G4INSTALL)/include
by "make includes"
@@ -27,16 +27,13 @@ CLHEP
- should be built in shared library.
- Building shared objects is supported since version 1.9.
BOOST-Python
- version 1.32 or later
(Optional)
ROOT
Before Starting:
----------------
In dafault situation, Geant4 creates and uses "granular static libraries".
But, the Python interface requires "global shared library".
But, the Python interface requires "GLOBAL SHARED library".
If you donot build your Geant4 libraries in global shared mode,
you have to recreate your instance additionally.
@@ -48,10 +45,7 @@ How to Install:
---------------
There is a configuraton script for building the package.
# ./configure --help
shows help message;
# ./configure --help
`configure' configures Geant4Py to adapt to many kinds of systems.
Usage: ./configure SYSTEM [OPTION]... [VAR=VALUE]...
@@ -63,22 +57,18 @@ Options:
Installation directories:
--prefix=PREFIX Installation prefix [./]
--libdir=DIR Python modules installaion dir [PREFIX/lib]
--incdir=DIR Header installaion dir [PREFIX/include]
--libdir=DIR Python modules dir [PREFIX/lib]
Fine tuning of the library path:
--with-g4-incdir=DIR Geant4 header dir [$G4INCLUDE]
--with-g4-libdir=DIR Geant4 library dir [$G4LIB/$G4SYSTEM]
--with-g4-version=NUM Geant4 version (700/701/710/711)
Not required after ver.8.0
--with-clhep-incdir=DIR CLHEP header dir [$CLHEP_INCLUDE_DIR]
--with-clhep-libdir=DIR CLHEP library dir [$CLHEP_LIB_DIR]
--with-clhep-lib=LIB library name of libCLHEP.so [CLHEP|$CLHEP_LIB]
--with-python-incdir=DIR Python header dir [/usr/include/python],
--with-python-incdir=DIR Python header dir [/usr/include/python(2.#)],
(location of pyconfig.h)
--with-python-libdir=DIR Python library dir [/usr/lib]
--with-python-libdir=DIR Python library dir [/usr/lib(64)]
--with-boost-incdir=DIR BOOST-C++ header dir [/usr/include],
(location of boost/)
@@ -87,36 +77,37 @@ Fine tuning of the library path:
--with-package-dir=DIR Geant4 Package dir
--with-gdml-incdir=DIR GDML header dir
--with-gdml-libdir=DIR GDML library dir
--with-extra-dir=DIR Install path for extra packages [/usr/local]
--with-xercesc-incdir=DIR Xerces-C header dir [/usr/include]
--with-xercesc-libdir=DIR Xerces-C library dir [/usr/lib]
--with-xercesc-libdir=DIR Xerces-C library dir [/usr/lib(64)]
Enable/disable options: prefix with either --enable- or --disable-
openglx OpenGL support [auto]
openglx OpenGLX support [auto]
openglxm OpenGLXm support [disable, $G4VIS_USE_OPENGLXM]
raytracerx RayTracerX support [disable, $G4VIS_USE_RAYTRACERX]
g4gdml GDML support (G4 module) [disable]
gdml GDML support (external, experimental) [disable]
also specifying inc/lib directories
Supported Architectures:
linux for Linux gcc 3.x and 4.x
linux for Linux gcc 3.x and 4.x (32bit)
linux64 for Linux gcc 3.x and 4.x (64bit, alias to linuxx8664gcc)
linuxx8664gcc for AMD Opteron and Intel EM64T Linux gcc 3.x and 4.x
macosx for MacOS X with gcc
macosx for MacOSX with gcc (Tiger/Leopard and Xcode)
You can specify all parameters adopting your environment.
For example,
# ./configure linux
For example,
# ./configure linux64 (miserable)
--with-g4-incdir=/opt/heplib/Geant4/geant4.8.1/include
--with-g4-libdir=/opt/heplib/Geant4/geant4.8.1/slib/Linux-g++
--with-clhep-incdir=/opt/heplib/CLHEP/2.0.2.2/include
--with-clhep-libdir=/opt/heplib/CLHEP/2.0.2.2/lib
--with-clhep-lib=CLHEP-2.0.2.2
# ./configure linux64 (smart)
--with-package-dir=/opt/heplib/Geant4/packages/9.1.2
# ./confugre linux64 (intelligent or haphazard ?)
The configuration script will create config/config.gmk, which describes
your envrionment.
@@ -143,7 +134,7 @@ Some libraries paths are already specified via "-rpath" linker option,
so these paths do not have to be added to "LD_LIBRARY_PATH".
* Geant4
* CLHEP
* Boost
* boost-python library
* $(INSTALL_PATH)/lib
* $(G4PY_EXLIB_LIBDIR) specified in a module makefile.
@@ -152,25 +143,25 @@ You can import Geant4Py modules in Python just like
>>> import Geant4
or
>>> from Geant4 import *
Notes:
-----
1) >> IMPORTANT <<
All users' libraries should be build in shared libaries.
All users' libraries should be build in SHARED libaries.
2) Development Environment:
OS: SuSE Linux 10.3 (x86-64)
g++ : 4.2.1
Python: 2.5.1
OS: SuSE Linux 11.0 (x86-64)
g++ : 4.3.1
Python: 2.5.2
CLHEP: 1.9.3.2 / 2.0.3.2
BOOST-Python: 1.33.1
ROOT: 5.16/00
ROOT: 5.20/00
3) Tested environment:
Linux 32/64-bit
SuSE 11.0 10.3
SL3.4 SL4.5 SL5.1
Ubuntu 8.0.4
MacOSX 10.5 (Leopard)
Have A Fun!!
Koichi Murakami <Koichi.Murakami@kek.jp>
-97
View File
@@ -1,97 +0,0 @@
<<<How to install Geant4Py in Mac OSX>>>
H. Yoshida and K. Murakami
16 November 2006 for Geant4-8.2 release
Geant4Py package can be installed in Linux or Mac OS X systems. Documentation
on the installation and the latest version is available at
www-geant4.kek.jp/projects/Geant4Py.
This text is a supplementary document dedicated to Mac OS X. The following
installation procedure was tested on a MacBook; Mac OS X 10.4.8 (8L2127), and
Darwin-8.8.1.
0) General remarks
You have to install ALL packages from the system DVD, including supplementary
packages and Xcode packages. Then, OpenGL must work.
a. Compilation of Geant4 libraries;
*.dylib must be created and all header files must be assembled. So
%make global; make includes
b. Linker;
If ld (linker) complains "Undefined symbols", try
%setenv MACOSX_DEPLOYMENT_TARGET 10.4
c. Path of the Dynamic Libraries ;
If you have used Configure script to make the Geant4 libraries, the paths
to the dylibs are set automatically. The environment variables can be
checked in $G4INSTALL/.config/bin/Darwin-g++/env.csh.
d. X window;
For visialization with OpenGL, you have to start Xserver and
%setenv DISPLAY localhost:0.0
1) Installation of Python 2.4.3
The latest Mac products (as of October 2006) include Python 2.3 by
default. This is not bad for the basic installation of Geant4Py, but some
examples here require Python 2.4 which provides advanced OS related
functionalities. So, we recommend you to install Python 2.4.3. (Python 2.5 is
already published but we don't tested it with respect to boost_python
wrappers.)
Visit the Python language Web site; http://www.python.org/download/mac/ and
follow the instructions. Universal-MacPython-2.4.3-*.dmg is available
there. Or the site http://pythonmac.org/packages/ provides also *.dmg package,
too.
2) Installation of Boost-Python
Visit the site http://boost.org/ and download boost-1_33_1, the latest
version. Then, run the configure script and then make libboost_python.dylib.
Please make install it to the default prefix directory, i.e., /usr/local, for
simplcity.
3) Compilation of Geant4Py
If you have installed Python-2.4 and Boost-1_33_1 as above, you can configure
Geant4Py as below;
./configure macosx --with-python-incdir=/usr/local/include/python2.4\
--with-python-libdir=/usr/local/lib/python2.4\
--with-boost-incdir=/usr/local/include/boost-1_33_1\
--with-boost-libdir=/usr/local/lib\
--with-boost-python-lib=boost_python-1_33_1
And then, %make; make install. The libraries will be installed in
$G4INSTALL/environments/g4py/lib whose path must be added to PYTHONPATH.
If you want to enjoy examples/education, wxPython package is necessary.
4) Installation of wxPython
Download the latest version of wxPython from http://www.wxpython.org/ and
create the library. The next instructions are taken from the above Web page.
%cd $WXDIR
%mkdir bld
%cd bld
%../configure --prefix=/opt/wx/2.7 \
--with-mac\
--with-opengl \
--enable-debug \
--enable-geometry \
--enable-graphics_ctx \
--enable-sound --with-sdl \
--enable-mediactrl \
--enable-display \
--disable-debugreport
And then make; make install.
You have to setenv/export PYTHONPATH, adding /opt/wx/2.7
5) Run
g4py/examples/education/lesson1/Lesson1Wx.py and lesson2/Lesson2Wx.py are
exaples, using wxPython GUI toolkits. Run them,
%python Lesson1Wx.py
+2 -3
View File
@@ -1,5 +1,5 @@
# $Id: GNUmakefile,v 1.1 2006/02/27 09:29:42 kmura Exp $
# $Name: geant4-09-01 $
# $Id: GNUmakefile,v 1.2 2008/12/03 07:43:41 kmura Exp $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py
# ===========================================================
@@ -20,5 +20,4 @@ clean:
uninstall:
@-\rm -f -r $(Q_LIBDIR)
@-\rm -f -r $(Q_INCDIR)
+45 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.32 2007/11/25 19:37:33 kmura Exp $
$Id: History,v 1.45 2008/12/04 10:30:04 kmura Exp $
-------------------------------------------------------------------
=========================================================
@@ -13,6 +13,50 @@ Geant4Py is a Geant4-Python bridge.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
3 December 2008 K.Murakami (tagged)
- modified for the 9.2 releaase.
* G4Material, G4Isotope, G4Element
30 November 2008 K.Murakami
- GDML is merged to G4GDML package (g4gdml->gdml)
add write functionality
30 June 2008 K. Murakami
- brushup python scripts (accroding with PEP-8)
- emcalculator.py : move to site-modules
- add G4CrossSectionHandler
- EZgeom package is moved to geometry/ezgeom
25 June 2008 K. Murakami
- configure : fix a wrong incdir variable.
- config/sys/linux.gmk, linuxx8664gcc :
add -fpermissive compile option for gcc 4.3
12 June 2008 K. Murakami (1.6.1)
- configure : fix echo -n problem, add --with-extra-dir flag
- tools/g4autobuild : add treatment of XERCESCROOT
- tools/g4pack : fix echo -n problem
4 June 2008 K. Murakami
- add G4AtomicShells
- update configure script (compatible with Debian/Ubuntsu sh)
- cleanup config/*.gmk
- configire: improve search for python include path
27 May 2008 K.Murakami
- add some random engines
22 May 2008 K.Murakami
- fix typo in G4VModularPhysicsList
13 March 2008 K.Murakami (1.6.0)
- use G4Version.hh directly, instead pyG4Version.hh
- configure script updated
28 February 2008 K.Murakami
- fix pyPhysicsList.cc compilation error
- fix pyG4GDMLParser.cc compilation error
- G4GDML is automatically detected by configure script
26 November 2007 K.Murakami
- add G4 GDML module support
+1 -9
View File
@@ -1,4 +1,4 @@
# $Id: g4compile.gmk,v 1.2 2006/08/08 05:11:44 kmura Exp $
# $Id: g4compile.gmk,v 1.3 2008/06/05 02:25:08 kmura Exp $
# ===========================================================
# Script for building a Boost-Python module
# ===========================================================
@@ -15,19 +15,11 @@ G4PY_INCFLAGS := -I$(Q_G4_INCDIR)
G4PY_INCFLAGS += -I$(Q_CLHEP_INCDIR)
G4PY_LOPT += -L$(Q_CLHEP_LIBDIR) -l$(Q_CLHEP_LIB)
# geant4 version
G4PY_INCFLAGS += -I$(G4PY_INSTALL)/source/version
# finished
CXXFLAGS += $(INCFLAGS)
CXXFLAGS += $(G4PY_INCFLAGS)
LOPT += $(G4PY_LOPT)
# Geant4 version
ifdef Q_G4_VERSION
CXXFLAGS += -DG4VERSION_NUMBER=$(Q_G4_VERSION)
endif
# ===========================================================
# Script for building a module
# ===========================================================
+3 -13
View File
@@ -1,4 +1,4 @@
# $Id: g4py.gmk,v 1.5 2007/11/25 19:37:55 kmura Exp $
# $Id: g4py.gmk,v 1.6 2008/12/01 10:14:14 kmura Exp $
# ===========================================================
# Makefile for building Python module with Boost.Python
#
@@ -40,17 +40,7 @@ G4PY_INCFLAGS += -I$(G4PY_INSTALL)/source/version
# boost patch
G4PY_INCFLAGS += -I$(G4PY_INSTALL)/source/boost
# GDML
# gdml
ifeq ($(Q_ENABLE_GDML), 1)
G4PY_INCFLAGS += -I$(Q_GDML_INCDIR)/Common/Writer
G4PY_INCFLAGS += -I$(Q_GDML_INCDIR)/Common/Saxana
G4PY_INCFLAGS += -I$(Q_GDML_INCDIR)/Common/Schema
G4PY_INCFLAGS += -I$(Q_GDML_INCDIR)/G4Binding/G4Writer
G4PY_INCFLAGS += -I$(Q_GDML_INCDIR)/G4Binding/G4Processor
G4PY_INCFLAGS += -I$(Q_GDML_INCDIR)/G4Binding/G4Evaluator
G4PY_LOPT += -L$(Q_GDML_LIBDIR) \
-lSaxana -lProcesses -lWriter \
-lG4Evaluator -lG4Processor -lG4Subscribers -lG4Writer
CPPFLAGS += -DENABLE_GDML
endif
+2 -6
View File
@@ -1,4 +1,4 @@
# $Id: module.gmk,v 1.3 2007/11/25 19:38:03 kmura Exp $
# $Id: module.gmk,v 1.5 2008/12/01 06:48:57 kmura Exp $
# ===========================================================
# Script for building a Boost-Python module
# ===========================================================
@@ -32,7 +32,7 @@ ifneq ($(Q_BOOST_LIBDIR), /usr/lib)
endif
endif
LOPT += -l$(Q_BOOST_PYTHON_LIB)
LOPT += -lboost_python
# Xerces-C ...
ifdef Q_XERCESC_INCDIR
@@ -56,10 +56,6 @@ CXXFLAGS += $(INCFLAGS)
ifdef COMPILE_G4PY
CXXFLAGS += $(G4PY_INCFLAGS)
# Geant4 version
ifdef Q_G4_VERSION
CXXFLAGS += -DG4VERSION_NUMBER=$(Q_G4_VERSION)
endif
LOPT += $(G4PY_LOPT)
endif
@@ -1,15 +1,7 @@
# $Id: GNUmakefile,v 1.3 2006/06/14 08:23:52 kmura Exp $
# $Name: geant4-09-01 $
# $Id: script-install.gmk,v 1.2 2008/12/03 07:36:08 kmura Exp $
# ===========================================================
# Makefile for building Geant4Py modules
# Script for installing modules
# ===========================================================
include ../../../config/config.gmk
include $(G4PY_INSTALL)/config/g4py.gmk
include $(G4PY_INSTALL)/config/sys/$(Q_SYSTEM).gmk
install_dir := $(Q_LIBDIR)/EZsim
pys := $(wildcard *.py)
pycs := $(patsubst %.py, %.pyc, $(pys))
pyos := $(patsubst %.py, %.pyo, $(pys))
@@ -22,7 +14,7 @@ all: $(pycs) $(pyos)
install: $(pycs) $(pyos)
@echo ... intall "*.py" into $(install_dir)
@if [ ! -d $(install_dir) ]; then install -d $(install_dir); fi
@install -m 755 $(pys) $(pycs) $(pyos) $(install_dir)
@install -m 644 $(pys) $(pycs) $(pyos) $(install_dir)
clean:
@-\rm -f $(pycs) $(pyos)
+2 -2
View File
@@ -1,4 +1,4 @@
# $Id: site-install.gmk,v 1.4 2006/06/14 08:23:12 kmura Exp $
# $Id: site-install.gmk,v 1.5 2008/12/01 06:49:05 kmura Exp $
# ===========================================================
# Script for installing modules
# ===========================================================
@@ -7,7 +7,7 @@ ifndef PACKAGE
PACKAGE := .
endif
install_dir := $(Q_LIBDIR)/$(PACKAGE)
install_dir := $(Q_LIBDIR)/g4py/$(PACKAGE)
install: $(module_name)
@echo ... intall $(module_name) into $(install_dir)
+11 -18
View File
@@ -1,5 +1,5 @@
# $Id: linux.gmk,v 1.6 2007/11/13 08:04:34 kmura Exp $
# $Name: geant4-09-01 $
# $Id: linux.gmk,v 1.9 2008/12/01 10:14:36 kmura Exp $
# $Name: geant4-09-02 $
# ===========================================================
# System specific terms
# ===========================================================
@@ -9,6 +9,7 @@ CXX := g++ -m32
ifdef COMPILE_WITH_BOOST
CXXFLAGS := -fPIC -ftemplate-depth-255 -finline-functions -Wno-inline
CXXFLAGS += -fpermissive
CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB
CXXFLAGS += -O2
ifndef DEBUG
@@ -24,6 +25,7 @@ endif
ifdef COMPILE_G4PY
CXXFLAGS := -fPIC -ansi -pipe
CXXFLAGS += -ftemplate-depth-255 -finline-functions
CXXFLAGS += -fpermissive
CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB
CXXFLAGS += -O2
ifndef DEBUG
@@ -53,27 +55,18 @@ ifdef Q_BOOST_LIBDIR
rpath0 := $(Q_BOOST_LIBDIR)
endif
ifdef G4PY_EXLIB_LIBDIR
rpath1 := $(G4PY_EXLIB_LIBDIR)
endif
ifdef COMPILE_G4PY
#rpath2 := $(Q_G4_LIBDIR):$(Q_CLHEP_LIBDIR)
ifneq ($(Q_G4_LIBDIR), $(BOOST_LIBDIR))
rpath2 := $(Q_G4_LIBDIR)
endif
rpath1 := $(Q_G4_LIBDIR)
ifneq ($(Q_CLHEP_LIBDIR), $(Q_G4_LIBDIR))
rpath3 := $(Q_CLHEP_LIBDIR)
rpath2 := $(Q_CLHEP_LIBDIR)
endif
ifeq ($(Q_ENABLE_GDML), 1)
ifneq ($(Q_GDML_LIBDIR), $(Q_G4_LIBDIR))
rpath3 += :$(Q_GDML_LIBDIR)
endif
endif
rpath4 := $(Q_LIBDIR)
endif
rpathflag := -Wl,-rpath,$(rpath0):$(rpath1):$(rpath2):$(rpath3):$(rpath4)
ifdef G4PY_EXLIB_LIBDIR
rpath3 := $(G4PY_EXLIB_LIBDIR)
endif
rpathflag := -Wl,-rpath,$(rpath0):$(rpath1):$(rpath2):$(rpath3)
ifdef CPPVERBOSE
define build-library
+11 -18
View File
@@ -1,5 +1,5 @@
# $Id: linuxx8664gcc.gmk,v 1.6 2007/11/13 08:04:34 kmura Exp $
# $Name: geant4-09-01 $
# $Id: linuxx8664gcc.gmk,v 1.9 2008/12/01 10:14:36 kmura Exp $
# $Name: geant4-09-02 $
# ===========================================================
# System specific terms
# ===========================================================
@@ -9,6 +9,7 @@ CXX := g++ -m64
ifdef COMPILE_WITH_BOOST
CXXFLAGS := -fPIC -ftemplate-depth-255 -finline-functions -Wno-inline
CXXFLAGS += -fpermissive
CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB
CXXFLAGS += -O2
ifndef DEBUG
@@ -24,6 +25,7 @@ endif
ifdef COMPILE_G4PY
CXXFLAGS := -fPIC -ansi -pipe
CXXFLAGS += -ftemplate-depth-255 -finline-functions
CXXFLAGS += -fpermissive
CXXFLAGS += -DBOOST_PYTHON_DYNAMIC_LIB
CXXFLAGS += -O2
ifndef DEBUG
@@ -53,27 +55,18 @@ ifdef Q_BOOST_LIBDIR
rpath0 := $(Q_BOOST_LIBDIR)
endif
ifdef G4PY_EXLIB_LIBDIR
rpath1 := $(G4PY_EXLIB_LIBDIR)
endif
ifdef COMPILE_G4PY
#rpath2 := $(Q_G4_LIBDIR):$(Q_CLHEP_LIBDIR)
ifneq ($(Q_G4_LIBDIR), $(BOOST_LIBDIR))
rpath2 := $(Q_G4_LIBDIR)
endif
rpath1 := $(Q_G4_LIBDIR)
ifneq ($(Q_CLHEP_LIBDIR), $(Q_G4_LIBDIR))
rpath3 := $(Q_CLHEP_LIBDIR)
rpath2 := $(Q_CLHEP_LIBDIR)
endif
ifeq ($(Q_ENABLE_GDML), 1)
ifneq ($(Q_GDML_LIBDIR), $(Q_G4_LIBDIR))
rpath3 += :$(Q_GDML_LIBDIR)
endif
endif
rpath4 := $(Q_LIBDIR)
endif
rpathflag := -Wl,-rpath,$(rpath0):$(rpath1):$(rpath2):$(rpath3):$(rpath4)
ifdef G4PY_EXLIB_LIBDIR
rpath3 := $(G4PY_EXLIB_LIBDIR)
endif
rpathflag := -Wl,-rpath,$(rpath0):$(rpath1):$(rpath2):$(rpath3)
ifdef CPPVERBOSE
define build-library
+3 -3
View File
@@ -1,9 +1,9 @@
# $Id: macosx.gmk,v 1.4 2006/08/10 08:49:08 kmura Exp $
# $Name: geant4-09-01 $
# $Id: macosx.gmk,v 1.5 2008/12/01 06:47:39 kmura Exp $
# $Name: geant4-09-02 $
# ===========================================================
# System specific terms
#
# MacOSX 10.4 (Tiger) gcc 4.0.1
# MacOSX 10.4 (Tiger/Leopard) gcc 4.0.1
# Note: gc-3.3 is not valid for this setup.
# ===========================================================
+158 -160
View File
@@ -1,5 +1,5 @@
#! /bin/sh -
#$Id: configure,v 1.7 2007/11/25 19:37:44 kmura Exp $
#$Id: configure,v 1.15 2008/12/03 07:48:55 kmura Exp $
# ======================================================================
# A configure script for Geant4Py
# ======================================================================
@@ -10,6 +10,20 @@ IFS='
PATH=/bin:/usr/bin
export PATH
# ======================================================================
# testing the echo features
# ======================================================================
if `(echo "testing\c"; echo 1,2,3) | grep c > /dev/null` ; then
if `(echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn > /dev/null`; then
ac_n= ac_c='
' ac_t=' '
else
ac_n=-n ac_c= ac_t=
fi
else
ac_n= ac_c='\c' ac_t=
fi
# ======================================================================
# help message
# ======================================================================
@@ -26,22 +40,18 @@ Options:
Installation directories:
--prefix=PREFIX Installation prefix [./]
--libdir=DIR Python modules installaion dir [PREFIX/lib]
--incdir=DIR Header installaion dir [PREFIX/include]
--libdir=DIR Python modules dir [PREFIX/lib]
Fine tuning of the library path:
--with-g4-incdir=DIR Geant4 header dir [\$G4INCLUDE]
--with-g4-libdir=DIR Geant4 library dir [\$G4LIB/\$G4SYSTEM]
--with-g4-version=NUM Geant4 version (700/701/710/711)
Not required after ver.8.0
--with-clhep-incdir=DIR CLHEP header dir [\$CLHEP_INCLUDE_DIR]
--with-clhep-libdir=DIR CLHEP library dir [\$CLHEP_LIB_DIR]
--with-clhep-lib=LIB library name of libCLHEP.so [CLHEP|\$CLHEP_LIB]
--with-python-incdir=DIR Python header dir [/usr/include/python],
--with-python-incdir=DIR Python header dir [/usr/include/python(2.#)],
(location of pyconfig.h)
--with-python-libdir=DIR Python library dir [/usr/lib]
--with-python-libdir=DIR Python library dir [/usr/lib(64)]
--with-boost-incdir=DIR BOOST-C++ header dir [/usr/include],
(location of boost/)
@@ -50,24 +60,21 @@ Fine tuning of the library path:
--with-package-dir=DIR Geant4 Package dir
--with-gdml-incdir=DIR GDML header dir
--with-gdml-libdir=DIR GDML library dir
--with-extra-dir=DIR Install path for extra packages [/usr/local]
--with-xercesc-incdir=DIR Xerces-C header dir [/usr/include]
--with-xercesc-libdir=DIR Xerces-C library dir [/usr/lib]
--with-xercesc-libdir=DIR Xerces-C library dir [/usr/lib(64)]
Enable/disable options: prefix with either --enable- or --disable-
openglx OpenGLX support [auto]
openglxm OpenGLXm support [disable, \$G4VIS_USE_OPENGLXM]
raytracerx RayTracerX support [disable, \$G4VIS_USE_RAYTRACERX]
g4gdml GDML support (G4 module) [disable]
gdml GDML support (external, experimental) [disable]
also specifying inc/lib directories
Supported Architectures:
linux for Linux gcc 3.x and 4.x
linux for Linux gcc 3.x and 4.x (32bit)
linux64 for Linux gcc 3.x and 4.x (64bit, alias to linuxx8664gcc)
linuxx8664gcc for AMD Opteron and Intel EM64T Linux gcc 3.x and 4.x
macosx for MacOSX with gcc (Tiger and XCode 2.3)
macosx for MacOSX with gcc (Tiger/Leopard and Xcode)
EOF
}
@@ -85,13 +92,12 @@ current_dir=`pwd`
g4_incdir=${G4INCLUDE:-/zzz}
g4_libdir=${G4LIB:+$G4LIB/$G4SYSTEM}
g4_libdir=${g4_libdir:-/zzz}
g4_version=${G4VERSION_NUMBER:-auto}
clhep_incdir=${CLHEP_INCLUDE_DIR:-/zzz}
clhep_libdir=${CLHEP_LIB_DIR:-/zzz}
clhep_lib=${CLHEP_LIB:-CLHEP}
python_incdir=/usr/include/python
python_incdir=/zzz
boost_incdir=/usr/include
boost_python_lib=boost_python
@@ -103,22 +109,23 @@ enable_raytracerx=${enable_raytracerx:-0}
enable_physicslist=0
enable_g4gdml=0
enable_gdml=0
gdml_incdir=/zzz
gdml_libdir=/zzz
xercesc_incdir=/usr/include
extra_dir=/usr/local
# checking system
case $1 in
linux|linuxx8664gcc|macosx)
linux|linux64|linuxx8664gcc|macosx)
system=$1
echo -n "Checking for system type ... "
if [ $system = linux64 ]; then
system=linuxx8664gcc
fi
echo $ac_n "Checking for system type ... $ac_c"
if [ ! -e "config/sys/$system.gmk" ]; then
echo "no"
echo -n "### Invalid system type. "
echo $ac_n "### Invalid system type. $ac_c"
echo "Please taka a look in config/sys/."
exit -1
fi
@@ -157,17 +164,15 @@ do
clhep_libdir=$optarg/lib ;;
--with-g4-incdir=*) g4_incdir=$optarg ;;
--with-g4-libdir=*) g4_libdir=$optarg ;;
--with-g4-version=*) g4_version=$optarg ;;
--with-clhep-incdir=*) clhep_incdir=$optarg ;;
--with-clhep-libdir=*) clhep_libdir=$optarg ;;
--with-clhep-lib=*) clhep_lib=$optarg ;;
--with-extra-dir=*) extra_dir=$optarg ;;
--with-python-incdir=*) python_incdir=$optarg ;;
--with-python-libdir=*) python_libdir=$optarg ;;
--with-boost-incdir=*) boost_incdir=$optarg ;;
--with-boost-libdir=*) boost_libdir=$optarg ;;
--with-boost-python-lib=*) boost_python_lib=$optarg ;;
--with-gdml-incdir=*) gdml_incdir=$optarg ;;
--with-gdml-libdir=*) gdml_libdir=$optarg ;;
--with-xercesc-incdir=*) xercesc_incdir=$optarg ;;
--with-xercesc-libdir=*) xercesc_libdir=$optarg ;;
# ---------------------------------------------------------------
@@ -177,10 +182,6 @@ do
--disable-openglxm ) enable_openglxm=0 ;;
--enable-raytracerx ) enable_raytracerx=1 ;;
--disable-raytracerx ) enable_raytracerx=0 ;;
--enable-g4gdml ) enable_g4gdml=1 ;;
--disable-g4gdml ) enable_g4gdml=0 ;;
--enable-gdml ) enable_gdml=1 ;;
--disable-gdml ) enable_gdml=0 ;;
# ---------------------------------------------------------------
-*)
echo "Unrecognized option: $1"
@@ -196,105 +197,98 @@ done
# check variables
arch=32
if [ $system == linuxx8664gcc ]; then
if [ $system = linuxx8664gcc ]; then
arch=64
fi
shlib=so
if [ $system == macosx ]; then
if [ $system = macosx ]; then
shlib=dylib
fi
echo -n "Checking for prefix ... "
extra_incdir=$extra_dir/include
if [ $arch = 64 ];then
extra_libdir=$extra_dir/lib64
else
extra_libdir=$extra_dir/lib
fi
echo $ac_n "Checking for prefix ... $ac_c"
echo $prefix
echo -n "Checking for lib dir ... "
echo $ac_n "Checking for lib dir ... $ac_c"
libdir=${libdir:-$prefix/lib}
echo $libdir
echo -n "Checking for include dir ... "
incdir=${incdir:-$prefix/include}
echo $libdir
echo -n "Checking for G4 include dir ... "
echo $ac_n "Checking for G4 include dir ... $ac_c"
if [ ! -d "$g4_incdir" ]; then
echo "no"
echo -n "### $g4_incdir (g4-incdir) does not exist. "
echo $ac_n "### $g4_incdir (g4-incdir) does not exist. $ac_c"
echo "Try --with-g4-incdir option."
exit -1
fi
echo "$g4_incdir"
echo -n "Checking for G4 lib dir ... "
echo $ac_n "Checking for G4 lib dir ... $ac_c"
if [ ! -d "$g4_libdir" ]; then
echo "no"
echo -n "### $g4_libdir (g4-libdir) does not exist. "
echo $ac_n "### $g4_libdir (g4-libdir) does not exist. $ac_c"
echo "Try --with-g4-libdir option."
exit -1
fi
echo "$g4_libdir"
echo -n "Checking for G4 version ... "
case $g4_version in
auto|700|701|710|711)
echo "$g4_version"
;;
*)
echo "no"
echo "### $g4_version (g4-version) is invalid (700/701/710/711)."
exit -1
;;
esac
if [ "$g4_version" = "auto" ]; then
if [ ! -f "$g4_incdir"/G4Version.hh ]; then
echo "### G4Version.hh does not exist. Try --with-g4-version option."
exit -1
fi
fi
# ---
echo -n "Checking for CLHEP include dir ... "
echo $ac_n "Checking for CLHEP include dir ... $ac_c"
if [ ! -d "$clhep_incdir" ]; then
echo "no"
echo -n "### $clhep_incdir (clhep-incdir) does not exist. "
echo $ac_n "### $clhep_incdir (clhep-incdir) does not exist. $ac_c"
echo "Try --with-clhep-incdir option."
exit -1
fi
echo "$clhep_incdir"
echo -n "Checking for CLHEP lib dir ... "
echo $ac_n "Checking for CLHEP lib dir ... $ac_c"
if [ ! -d "$clhep_libdir" ]; then
echo "no"
echo -n "### $clhep_libdir (clhep-libdir) does not exist. "
echo $ac_n "### $clhep_libdir (clhep-libdir) does not exist. $ac_c"
echo "Try --with-clhep-libdir option."
exit -1
fi
echo "$clhep_libdir"
echo -n "Checking for CLHEP lib name ... "
echo $ac_n "Checking for CLHEP lib name ... $ac_c"
if [ ! -f "$clhep_libdir"/lib${clhep_lib}.${shlib} ]; then
echo "no"
echo -n "### lib${clhep_lib}.${shlib} (clhep-lib) does not exist. "
echo $ac_n "### lib${clhep_lib}.${shlib} (clhep-lib) does not exist. $ac_c"
echo "Try --with-clhep-lib option."
exit -1
fi
echo "lib${clhep_lib}.${shlib}"
# ---
echo -n "Checking for Python include dir (pyconfig.h) ... "
echo $ac_n "Checking for Python include dir (pyconfig.h) ... $ac_c"
# check version
set python python2.5 python2.4 python2.3 python2.2
for aincdir in $*
do
if [ -d /usr/include/$aincdir ]; then
python_incdir=/usr/include/$aincdir
break
fi
done
if [ ! -f "$python_incdir"/pyconfig.h ]; then
echo "no"
echo -n "### $python_incdir (python-incdir) is invalid. "
echo $ac_n "### $python_incdir (python-incdir) is invalid. $ac_c"
echo "Try --with-python-incdir option."
exit -1
fi
echo "$python_incdir"
echo -n "Checking for Python lib dir ... "
echo $ac_n "Checking for Python lib dir ... $ac_c"
if [ ! $python_libdir ]; then
if [ $arch == 64 ]; then
if [ $arch = 64 ]; then
python_libdir=/usr/lib64
else
python_libdir=/usr/lib
@@ -302,51 +296,90 @@ if [ ! $python_libdir ]; then
fi
if [ ! -d "$python_libdir" ]; then
echo "no"
echo -n "### $python_libdir (python-libdir) does not exist. "
echo $ac_n "### $python_libdir (python-libdir) does not exist. $ac_c"
echo "Try --with-python-libdir option."
exit -1
fi
echo "$python_libdir"
# ---
echo -n "Checking for Boost include dir (boost/python.hpp) ... "
echo $ac_n "Checking for Boost include dir (boost/python.hpp) ... $ac_c"
set $boost_incdir $extra_incdir
for adir in $*
do
if [ -f "$adir"/boost/python.hpp ]; then
boost_incdir=$adir
break
fi
done
if [ ! -f "$boost_incdir"/boost/python.hpp ]; then
echo "no"
echo -n "### $boost_incdir (boost-incdir) is invalid. "
echo $ac_n "### $boost_incdir (boost-incdir) is invalid. $ac_c"
echo "Try --with-boost-incdir option."
exit -1
fi
echo "$boost_incdir"
echo -n "Checking for Boost lib dir ... "
echo $ac_n "Checking for Boost version ... $ac_c"
cat > conftest.cc <<EOF
#include <boost/version.hpp>
int main() {
if (BOOST_VERSION >= 103200)
return 0;
else
return 1;
}
EOF
g++ -o conftest conftest.cc > /dev/null 2>&1
./conftest
q_boost_version=$?
rm conftest.cc conftest
if [ $q_boost_version = 0 ]; then
echo "ok"
else
echo "boost version >= 1.32.00 is required."
exit -1
fi
echo $ac_n "Checking for Boost lib dir ... $ac_c"
if [ ! $boost_libdir ]; then
if [ $arch == 64 ]; then
if [ $arch = 64 ]; then
boost_libdir=/usr/lib64
else
boost_libdir=/usr/lib
fi
fi
set $boost_libdir $extra_libdir
for adir in $*
do
if [ -f "$adir"/lib${boost_python_lib}.${shlib} ]; then
boost_libdir=$adir
break
fi
done
if [ ! -d "$boost_libdir" ]; then
echo "no"
echo -n "### $boost_libdir (boost-libdir) does not exist. "
echo $ac_n "### $boost_libdir (boost-libdir) does not exist. $ac_c"
echo "Try --with-boost-libdir option."
exit -1
fi
echo "$boost_libdir"
echo -n "Checking for Boost Python lib name ... "
echo $ac_n "Checking for Boost Python lib name ... $ac_c"
if [ ! -f "$boost_libdir"/lib${boost_python_lib}.${shlib} ]; then
echo "no"
echo -n "### lib${boost_python_lib}.${shlib} (boost-python-lib) does not exist. "
echo "Try --with-boost-libdir option."
echo $ac_n "### lib${boost_python_lib}.${shlib} (boost-python-lib) does not exist. $ac_c"
echo "Try --with-boost-python-lib option."
exit -1
fi
echo "lib${boost_python_lib}.${shlib}"
# ---
echo -n "Checking for OpenGL support ..."
echo $ac_n "Checking for OpenGL support ...$ac_c"
if [ -f "$g4_libdir"/libG4OpenGL.${shlib} ]; then
if [ $enable_openglx == 0 ]; then
if [ $enable_openglx = 0 ]; then
echo "disabled"
else
echo "yes"
@@ -357,63 +390,37 @@ else
fi
# ---
echo -n "Checking for physics list support ..."
echo $ac_n "Checking for physics list support ...$ac_c"
if [ -f "$g4_incdir"/QGSP.hh ]; then
enable_physicslist=1
fi
if [ $enable_physicslist == 0 ]; then
if [ $enable_physicslist = 0 ]; then
echo "no"
else
echo "yes"
fi
# ---
echo -n "Checking for G4GDML support ..."
if [ $enable_g4gdml == 0 ]; then
echo "no"
else
if [ -f "$g4_incdir"/G4GDMLParser.hh ]; then
echo "yes"
else
echo "no"
echo "### G4 GDML component is not found."
exit -1
fi
fi
# ---
echo -n "Checking for GDML support ..."
if [ $enable_gdml == 0 ]; then
echo "no"
else
echo $ac_n "Checking for GDML support ...$ac_c"
if [ -f "$g4_incdir"/G4GDMLParser.hh ]; then
echo "yes"
fi
if [ $enable_gdml == 1 ]; then
echo -n "Checking for GDML include dir ..."
if [ -d "$gdml_incdir"/G4Binding ]; then
echo "yes"
else
echo "no"
echo "### $gdml_incdir/G4Binding does not exist. "
echo "Try --with-gdml-incdir option."
exit -1
fi
echo -n "Checking for GDML lib dir ..."
if [ -f "$gdml_libdir"/libG4Processor.so ]; then
echo "yes"
else
echo "no"
echo "### $gdml_libdir/libG4Processor.so does not exist. "
echo "Try --with-gdml-libdir option."
exit -1
fi
enable_gdml=1
else
echo "no"
enable_gdml=0
fi
# ---
if [ $enable_g4gdml == 1 -o $enable_gdml == 1 ]; then
echo -n "Checking for Xerces-C include dir ..."
if [ $enable_gdml = 1 ]; then
echo $ac_n "Checking for Xerces-C include dir ...$ac_c"
set $xercesc_incdir $extra_incdir
for adir in $*
do
if [ -d "$adir/xercesc" ]; then
xercesc_incdir=$adir
break
fi
done
if [ -d "$xercesc_incdir/xercesc" ]; then
echo "yes"
else
@@ -423,26 +430,35 @@ if [ $enable_g4gdml == 1 -o $enable_gdml == 1 ]; then
exit -1
fi
echo -n "Checking for Xerces-C lib dir ..."
echo $ac_n "Checking for Xerces-C lib dir ...$ac_c"
if [ ! $xercesc_libdir ]; then
if [ $arch == 64 ]; then
if [ $arch = 64 ]; then
xercesc_libdir=/usr/lib64
else
xercesc_libdir=/usr/lib
fi
fi
if [ -f "$xercesc_libdir"/libxerces-c.so ]; then
set $xerces_libdir $extra_libdir
for adir in $*
do
if [ -f "$adir"/libxerces-c.${shlib} ]; then
xercesc_libdir=$adir
break
fi
done
if [ -f "$xercesc_libdir"/libxerces-c.${shlib} ]; then
echo "yes"
else
echo "no"
echo "### $xercesc_libdir/libxerces-c.so does not exist. "
echo "### $xercesc_libdir/libxerces-c.${shlib} does not exist. "
echo "Try --with-xercesc-libdir option."
exit -1
fi
fi
# ---
echo -n "Writing config.gmk ... "
echo $ac_n "Writing config.gmk ... $ac_c"
make_config=config/config.gmk
@@ -459,17 +475,11 @@ Q_SYSTEM := $system
Q_PREFIX := $prefix
Q_LIBDIR := $libdir
Q_INCDIR := $incdir
Q_G4_INCDIR := $g4_incdir
Q_G4_LIBDIR := $g4_libdir
EOF
if [ $g4_version != auto ]; then
cat >> $make_config <<EOF
Q_G4_VERSION := $g4_version
EOF
fi
cat >> $make_config <<EOF
@@ -489,18 +499,10 @@ Q_ENABLE_RAYTRACERX := $enable_raytracerx
Q_ENABLE_PHYSICSLIST := $enable_physicslist
Q_ENABLE_G4GDML := $enable_g4gdml
Q_ENABLE_GDML := $enable_gdml
EOF
if [ $enable_gdml == 1 ]; then
cat >> $make_config <<EOF
Q_GDML_INCDIR := $gdml_incdir
Q_GDML_LIBDIR := $gdml_libdir
EOF
fi
if [ $enable_g4gdml == 1 -o $enable_gdml == 1 ]; then
if [ $enable_gdml = 1 ]; then
cat >> $make_config <<EOF
Q_XERCESC_INCDIR := $xercesc_incdir
Q_XERCESC_LIBDIR := $xercesc_libdir
@@ -508,35 +510,31 @@ EOF
fi
echo "done"
echo -n "Writing config.status ... "
echo $ac_n "Writing config.status ... $ac_c"
echo $arguments > config.status
echo "done"
# ---
echo ""
echo -n "Enabled support for"
echo $ac_n "Enabled support for$ac_c"
if [ $enable_openglx = 1 ]; then
echo -n " openglx"
echo $ac_n " openglx$ac_c"
fi
if [ $enable_openglxm = 1 ]; then
echo -n " openglxm"
echo $ac_n " openglxm$ac_c"
fi
if [ $enable_raytracerx = 1 ]; then
echo -n " raytracerx"
echo $ac_n " raytracerx$ac_c"
fi
if [ $enable_physicslist = 1 ]; then
echo -n " physicslist"
fi
if [ $enable_g4gdml = 1 ]; then
echo -n " g4gdml"
echo $ac_n " physicslist$ac_c"
fi
if [ $enable_gdml = 1 ]; then
echo -n " gdml"
echo $ac_n " gdml$ac_c"
fi
echo "."
@@ -26,7 +26,7 @@
//
// $Id: DetectorConstruction.cc,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
@@ -25,7 +25,7 @@
//
//
// $Id: DetectorConstruction.hh,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: DetectorMessenger.cc,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: DetectorMessenger.hh,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -1,5 +1,5 @@
# $Id: GNUmakefile,v 1.2 2007/07/06 06:41:39 kmura Exp $
# $Name: geant4-09-01 $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
@@ -25,7 +25,7 @@
//
//
// $Id: PhysListEmStandard.cc,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: PhysListEmStandard.hh,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: PhysicsList.cc,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: PhysicsList.hh,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: PhysicsListMessenger.cc,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: PhysicsListMessenger.hh,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: PrimaryGeneratorAction.cc,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: PrimaryGeneratorAction.hh,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: RunAction.cc,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: RunAction.hh,v 1.1 2007/06/21 15:18:32 jjacquem Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: pyTestEm0.cc,v 1.2 2007/07/06 06:41:59 kmura Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// pyTestEm0.cc
//
@@ -7,7 +7,7 @@
# ==================================================================
from Geant4 import *
import demo_wp
import MedicalBeam
import g4py.MedicalBeam
import ROOT
# ==================================================================
@@ -190,7 +190,7 @@ gRunManager.SetUserAction(myEA)
#pg.SetParticlePosition(G4ThreeVector(0.,0.,-50.)*cm)
# medical beam
beam= MedicalBeam.Construct()
beam= g4py.MedicalBeam.Construct()
beam.particle= "proton"
beam.kineticE= 230.*MeV
#beam.particle= "gamma"
@@ -1,5 +1,5 @@
# $Id: GNUmakefile,v 1.1 2006/05/11 04:35:32 kmura Exp $
# $Name: geant4-09-01 $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: MyDetectorConstruction.cc,v 1.3 2006/06/29 15:28:11 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// MyDetectorConstruction.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: MyDetectorConstruction.hh,v 1.3 2006/06/29 15:28:13 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// MyDetectorConstruction.hh
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: MyMaterials.cc,v 1.3 2006/06/29 15:28:16 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// MyMaterials.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: MyMaterials.hh,v 1.3 2006/06/29 15:28:19 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// MyMaterials.hh
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: MyPhysicsList.cc,v 1.3 2006/06/29 15:28:21 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// MyPhysicsList.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: MyPhysicsList.hh,v 1.3 2006/06/29 15:28:23 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// MyPhysicsList.hh
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: Particles.cc,v 1.3 2006/06/29 15:28:25 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// Particles.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: PhysicsListEMstd.cc,v 1.3 2006/06/29 15:28:29 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// PhysicsListEMstd.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: pydemo_wp.cc,v 1.3 2006/06/29 15:28:40 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// pydemo_wp.cc
//
@@ -77,9 +77,9 @@ gRunManager.SetUserAction(mySA)
# set particle gun
pg= myPGA.particleGun
pg.SetParticleByName("proton")
pg.SetParticleEnergy(230.*HEPUnit.MeV)
pg.SetParticleEnergy(230.*MeV)
pg.SetParticleMomentumDirection(G4ThreeVector(0., 0., 1.))
pg.SetParticlePosition(G4ThreeVector(0.,0.,-20.)*HEPUnit.cm)
pg.SetParticlePosition(G4ThreeVector(0.,0.,-20.)*cm)
gRunManager.Initialize()
@@ -1,258 +0,0 @@
\documentclass{article}
\title{How to EZsim using the site-modules of Geant4Py?}
\author{ H. Yoshida \and K. Murakami}
\begin{document}
\maketitle
\section{g4py/site-modules}
Currently site-modules have the following wrapper modules:
\begin{itemize}
\item EZsim
\begin{itemize}
\item EZgeom : main topic of this document
\begin{itemize}
\item ezgeom
\end{itemize}
\end{itemize}
\item geometries : examples of wrapping
\begin{itemize}
\item ExN01geom
\item ExN03geom
\end{itemize}
\item materials : pre-defined materials
\begin{itemize}
\item NISTmaterials
\end{itemize}
\item physics\_lists : examples of wrapping
\begin{itemize}
\item EMSTDpl
\item ExN01pl
\item ExN03pl
\item (GenericPhysicsList)
\end{itemize}
\item primaries : pre-defined particle guns
\begin{itemize}
\item MedicalBeam
\item ParticleGun
\end{itemize}
\end{itemize}
\section{The levels of Python wrapping}
The application of these site modules are stored in
\begin{itemize}
\item tests : many test examples
\item examples/demos/water\_phantom : voxelized water phantom and scoring
\item examples/education
\begin{itemize}
\item lesson1 : measurement of the mass attenuation coefficients
\item lesson2 : exampleN03
\end{itemize}
\end{itemize}
In general, Python wrapping can be applied in various levels.
This can be seen, for example, in the above examples which demonstrate how the
geometries are constructed. We cite two examples how site modules can be used,
and how existing C++ classes can be wrapped to co-work within the framework of
Geant4Py.
\subsection{Full Python case}
The script examples/education/lesson1/Lesson1.py uses the Phtyon modules of
EZgeom. It defines a simple absorber box, using EZgeom module. Its material,
dimensions, colors etc. are modifiable by using Python methods.
\subsection{Wrapping an existing C++ geometry}
The script examples/education/lesson2/ExN03.py uses the geometry of
exampleN03 as it is (ExN03DetectorConstruction).
The modules in site-modules/geometries/ExN03geom wrap these C++ classes and
their methods like exposes its methods like "SetAbsorberMaterial",
"SetAbsorberThickness", "GeometryUpdated" etc..
It also used wrapped "ExN03PhysicsList".
So, ExN03.py script do nothing for the geometry and physics list. It simply
initialized them.
\section{Closer look: Full Python case}
Exposed modules by the EZgeom module are following:
\begin{itemize}
\item Construct() :
\item SetWorldMaterial(material)
\item SetWorldVisibility(bool)
\item ResizeWorld(dx, dy, dz)
\item ResetWorld(dx, dy, dz)
\end{itemize}
Also exposed are modules in the G4EzVolume class.
\begin{itemize}
\item CreateBoxVolume, Tube/Cone/Sphere/Orb
\item Set(Get)Sold
\item Set(Get)Material
\item Set(Get)Color
\item Set(Get)Visibility
\item
\item Placeit()
\item ReplicateIt()
\item VoxelizeIt()
\item
\item SetSensitiveDetector
\end{itemize}
In addition, you can use global names like gMaterialTable etc. which are
defined in the g4py/source and exposed in the widest name space under
Boost-python. You can easily get the list of all g* modules from ipython
shell, once you import Geant4 modules.
Let us explain how to use the above modules, taking the script in
examples/education/lesson1/Leson1.py as an example.
It starts by lines to import modules:
\begin{verbatim}
1: from Geant4 import *
2: import NISTmaterials
3: from EZsim import EZgeom
4: from EZsim.EZgeom import G4EzVolume
5: import EMSTDpl
6: import ParticleGun
7: from time import *
8: import sys
\end{verbatim}
In line 1 you import all exposed modules of Geant4.
From the line 2 to 6, you import relevant site-modules. Lines 7 and 8 is to
import generic Python modules.
Then you define a Python class "Configure" for initialization.
\begin{verbatim}
def Configure():
NISTmaterials.Construct() # NIST materials predefined in g4py
EZgeom.Construct() # initialize
EMSTDpl.Construct() # initialize the physics list
ParticleGun.Construct() # initialize the particle gun
gControlExecute("gun.mac") # this is one of the globals
\end{verbatim}
Now you define the concrete geometry.
\begin{verbatim}
def ConstructGeom():
print "* Constructing geometry..."
# materils
galactic = G4Material.GetMaterial("G4_Galactic", 1)
water = G4Material.GetMaterial("G4_WATER", 1)
# world
EZgeom.SetWorldMaterial(galactic)
EZgeom.ResizeWorld(120.*cm, 120.*cm, 100.*cm)
# water phantom ; logical and physical volumes
global water_phantom, water_phantom_pv
water_phantom= G4EzVolume("WaterPhantom")
water_phantom.CreateBoxVolume(water, 110.*cm, 110.*cm, 10.*cm)
#Place the water phantom in the vacuum!!
water_phantom_pv = water_phantom.PlaceIt(G4ThreeVector(0.,0.,0.*cm))
\end{verbatim}
Here water\_phantom is the logical volume, while water\_phantom\_pv is the
physical volume. These variables are defined as global for later use.
If you want to change the material of the water\_phantom with the lead, for
example, you define lead by makinging its instance from the pre-defined list
and SetMaterial().
\begin{verbatim}
lead = G4Material.GetMaterial("G4_Pb", 1)
water_phantom.SetMaterial(lead)
\end{verbatim}
To print out the name of the materialof the logical volume,
\begin{verbatim}
print water_phantom.Getmaterial().GetName()
\end{verbatim}
If you want to change the dimensions of the water\_phantom, you have to get
its instance of the solid, and then SetZHalfLength().
\begin{verbatim}
solid = EZgeom.G4EzVolume.GetSold(water_phantom)
solid.SetZHalfLength(thickness * mm/2.0)
\end{verbatim}
If you want to relocate the water phantom, i.e., water\_phantom\_pv,
\begin{verbatim}
water_phantom_pv.SetTransformation(G4TreeVector(, ,))
\end{verbatim}
You can use any Geant4 commands with gApplyUICommand() method.
You simply provide it with strings, as seen in the next code fragment.
\begin{verbatim}
eventNum = self.eventVar.get()
for i in range(eventNum):
gunYZpos = str(i-eventNum/2) + ". -20. cm"
gApplyUICommand("/gun/position 0. " + gunYZpos)
gRunManager.BeamOn(1)
sleep(0.01)
\end{verbatim}
With the above code fragment, you use "eventVar" which is supplied by the
"Scale" widget. You repeat gRunManager.BeamOn(1), after a sleep of every
o.o1 second. You use gApplyUICommand() to change the gun's YZ position before
every shoot.
\section{Closer study: wrapped C++ classes case}
The script file in g4py/examples/education/lesson2/ExN03.py is an example.
The C++ classes of geometry and physics list of exampleN03 are exposed with
mo modifications. To expose them, wrapper classes, pyExN03geom.cc and
pyExN03pl.cc are created and stored in ExN03geom/ and ExN03pl/ respectively.
They are pre-compiled and shared libraries; ExN03geom.so, and ExN03pl.so are
stored in the g4py/lib/site-modules library repository.
ExN03geom exposes all the methods defined in ExN03DetectorConstruction.
ExN03.py in lesson2 initializes the geometry and physics list by simply using
the exposed classes;
\begin{verbatim}
from Geant4 import *
import NISTmaterials
import ExN03geom
import ExN03pl
exN03geom = ExN03geom.ExN03DetectorConstruction()
gRunManager.SetUserInitialization(exN03geom)
exN03PL = ExN03pl.ExN03PhysicsList()
gRunManager.SetUserInitialization(exN03PL)
\end{verbatim}
ExN03.py provides the widgets to choose a material with the Checkbutton,
to set the thickness with the Scale widget etc. It provides a "Run" button
to do /run/beamOn equivalent.
Just before "beamOn", the geometry is modified like;
\begin{verbatim}
def cmd_beamOn(self):
exN03geom.SetAbsorberMaterial(self.materialVar.get())
exN03geom.SetAbsorberThickness(self.thickVar.get() * mm/2.0)
exN03geom.UpdateGeometry()
exN03PL.SetDefaultCutValue(self.cutVar.get() * mm)
exN03PL.SetCutsWithDefault()
exN03geom.SetMagField(self.magVar.get() * tesla)
\end{verbatim}
Here, self.xxxVar.get() are the values (String or Double) supplied by the
Checkbutton or Scale widgets.
The on/off of each process is done using the global name gProcessTable.
\begin{verbatim}
def cmd_setProcess(self):
for i in self.processList:
if self.processVar[i].get() == 0:
gProcessTable.SetProcessActivation(i, 0)
print "Process " + i + " inactivated"
else:
gProcessTable.SetProcessActivation(i, 1)
print "Process " + i + " activated"
\end{verbatim}
Here "processList" is a list of the names of processes like below and
"processVar" contains the on/off values of the Checkbuttons for respective
processes.
\begin{verbatim}
self.processList = ["phot", "compt", "conv", "msc", "eIoni", "eBrem", "annih
il","muIoni", "muBrems"]
\end{verbatim}
\end{document}
@@ -6,11 +6,11 @@
# - using site-module packages
# ==================================================================
from Geant4 import *
import NISTmaterials
from EZsim import EZgeom
from EZsim.EZgeom import G4EzVolume
import EMSTDpl
import ParticleGun
import g4py.NISTmaterials
import g4py.ezgeom
from g4py.ezgeom import G4EzVolume
import g4py.EMSTDpl
import g4py.ParticleGun
from time import *
import sys
@@ -22,23 +22,23 @@ def Configure():
# setup for materials
# ------------------------------------------------------------------
# simple materials for Qgeom
NISTmaterials.Construct()
g4py.NISTmaterials.Construct()
# ------------------------------------------------------------------
# setup for geometry
# ------------------------------------------------------------------
#Qgeom.Construct()
EZgeom.Construct() # initialize
#g4py.Qgeom.Construct()
g4py.ezgeom.Construct() # initialize
# ------------------------------------------------------------------
# setup for physics list
# ------------------------------------------------------------------
EMSTDpl.Construct()
g4py.EMSTDpl.Construct()
# ------------------------------------------------------------------
# setup for primary generator action
# ------------------------------------------------------------------
ParticleGun.Construct()
g4py.ParticleGun.Construct()
gControlExecute("gun.mac")
# ==================================================================
@@ -58,8 +58,8 @@ def ConstructGeom():
lead = G4Material.GetMaterial("G4_Pb", 1)
water = G4Material.GetMaterial("G4_WATER", 1)
absorber = {"air":air, "aluminum":aluminum, "iron":iron, "lead":lead, "water":water, "gold":gold}
EZgeom.SetWorldMaterial(galactic)
EZgeom.ResizeWorld(120.*cm, 120.*cm, 100.*cm)
g4py.ezgeom.SetWorldMaterial(galactic)
g4py.ezgeom.ResizeWorld(120.*cm, 120.*cm, 100.*cm)
# water phantom
global water_phantom, water_phantom_pv
@@ -84,7 +84,6 @@ HepRandom.setTheSeed(20050830L)
Configure()
ConstructGeom()
# ------------------------------------------------------------------
# go...
# ------------------------------------------------------------------
@@ -99,7 +98,6 @@ gControlExecute("oglx.mac")
from Tkinter import *
class App(Frame):
def init(self):
@@ -131,7 +129,7 @@ class App(Frame):
thick.grid(row=3, column=1, columnspan=5, sticky=W)
#get logical volume and set its half length
self.solid = EZgeom.G4EzVolume.GetSold(water_phantom)
self.solid = g4py.ezgeom.G4EzVolume.GetSold(water_phantom)
#particle row=4
particleLabel = Label(self, bg="green", text="Particle")
@@ -1,9 +1,11 @@
#!/usr/bin/python
from Geant4 import *
import NISTmaterials
from EZsim import EZgeom
from EZsim.EZgeom import G4EzVolume
import ExN03pl
import ParticleGun
import g4py.NISTmaterials
import g4py.ezgeom
from g4py.ezgeom import G4EzVolume
import g4py.ExN03pl
import g4py.ParticleGun
from time import *
import sys
from subprocess import *
@@ -17,22 +19,22 @@ def Configure():
# setup for materials
# ------------------------------------------------------------------
# simple materials for Qgeom
NISTmaterials.Construct()
g4py.NISTmaterials.Construct()
# ------------------------------------------------------------------
# setup for geometry
# ------------------------------------------------------------------
EZgeom.Construct() # initialize
g4py.ezgeom.Construct() # initialize
# ------------------------------------------------------------------
# setup for physics list of N03
# ------------------------------------------------------------------
ExN03pl.Construct()
g4py.ExN03pl.Construct()
# ------------------------------------------------------------------
# setup for primary generator action
# ------------------------------------------------------------------
ParticleGun.Construct()
g4py.ParticleGun.Construct()
gControlExecute("gun.mac")
# ==================================================================
@@ -54,8 +56,8 @@ def ConstructGeom():
water = G4Material.GetMaterial("G4_WATER", 1)
absorber = {"air":air, "aluminum":aluminum, "iron":iron, "lead":lead, "water":water, "gold":gold
}
EZgeom.SetWorldMaterial(galactic)
EZgeom.ResizeWorld(120.*cm, 120.*cm, 100.*cm)
g4py.ezgeom.SetWorldMaterial(galactic)
g4py.ezgeom.ResizeWorld(120.*cm, 120.*cm, 100.*cm)
# water phantom
global water_phantom, water_phantom_pv
@@ -490,7 +492,7 @@ class MyApp(wx.Frame):
bxsizer.Add(wx.StaticLine(panel), 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5)
bxsizer.Add(self.eventNo.sizer, 0, wx.EXPAND)
self.solid = EZgeom.G4EzVolume.GetSold(water_phantom)
self.solid = g4py.ezgeom.G4EzVolume.GetSold(water_phantom)
panel.SetSizer(bxsizer)
bxsizer.Fit(self)
@@ -6,11 +6,11 @@
# - using site-module packages
# ==================================================================
from Geant4 import *
import NISTmaterials
from EZsim import EZgeom
from EZsim.EZgeom import G4EzVolume
import ExN03pl
import ParticleGun
import g4py.NISTmaterials
import g4py.ezgeom
from g4py.ezgeom import G4EzVolume
import g4py.ExN03pl
import g4py.ParticleGun
from time import *
import sys
@@ -22,23 +22,23 @@ def Configure():
# setup for materials
# ------------------------------------------------------------------
# simple materials for Qgeom
NISTmaterials.Construct()
g4py.NISTmaterials.Construct()
# ------------------------------------------------------------------
# setup for geometry
# ------------------------------------------------------------------
#Qgeom.Construct()
EZgeom.Construct() # initialize
#g4py.Qgeom.Construct()
g4py.ezgeom.Construct() # initialize
# ------------------------------------------------------------------
# setup for physics list
# ------------------------------------------------------------------
ExN03pl.Construct()
g4py.ExN03pl.Construct()
# ------------------------------------------------------------------
# setup for primary generator action
# ------------------------------------------------------------------
ParticleGun.Construct()
g4py.ParticleGun.Construct()
gControlExecute("gun.mac")
# ==================================================================
@@ -58,8 +58,8 @@ def ConstructGeom():
lead = G4Material.GetMaterial("G4_Pb", 1)
water = G4Material.GetMaterial("G4_WATER", 1)
absorber = {"air":air, "aluminum":aluminum, "iron":iron, "lead":lead, "water":water, "gold":gold}
EZgeom.SetWorldMaterial(galactic)
EZgeom.ResizeWorld(120.*cm, 120.*cm, 100.*cm)
g4py.ezgeom.SetWorldMaterial(galactic)
g4py.ezgeom.ResizeWorld(120.*cm, 120.*cm, 100.*cm)
# water phantom
global water_phantom, water_phantom_pv
@@ -131,7 +131,7 @@ class App(Frame):
thick.grid(row=3, column=1, columnspan=5, sticky=W)
#get logical volume and set its half length
self.solid = EZgeom.G4EzVolume.GetSold(water_phantom)
self.solid = g4py.ezgeom.G4EzVolume.GetSold(water_phantom)
#particle row=4
particleLabel = Label(self, bg="green", text="Particle")
@@ -6,10 +6,10 @@
# using site-module packages
# ==================================================================
from Geant4 import *
import Qmaterials, NISTmaterials
import ExN03geom
import ExN03pl
import ParticleGun, MedicalBeam
import g4py.Qmaterials, g4py.NISTmaterials
import g4py.ExN03geom
import g4py.ExN03pl
import g4py.ParticleGun, g4py.MedicalBeam
import sys
from time import *
from subprocess import *
@@ -30,7 +30,7 @@ HepRandom.setTheSeed(20050830L)
# ------------------------------------------------------------------
# NIST materials
#NISTmaterials.Construct()
#g4py.NISTmaterials.Construct()
# ------------------------------------------------------------------
# setup for geometry
@@ -38,13 +38,13 @@ HepRandom.setTheSeed(20050830L)
# normal way for constructing user geometry
exN03geom= ExN03geom.ExN03DetectorConstruction()
exN03geom= g4py.ExN03geom.ExN03DetectorConstruction()
gRunManager.SetUserInitialization(exN03geom)
# 2nd way, short-cut way
#ExN01geom.Construct()
#ExN03geom.Construct()
#g4py.ExN01geom.Construct()
#g4py.ExN03geom.Construct()
# magnetic field
#exN03geom.SetMagField(0.1 * tesla)
@@ -53,23 +53,23 @@ gRunManager.SetUserInitialization(exN03geom)
# setup for physics list
# ------------------------------------------------------------------
# normal way for constructing user physics list
exN03PL= ExN03pl.ExN03PhysicsList()
exN03PL= g4py.ExN03pl.ExN03PhysicsList()
gRunManager.SetUserInitialization(exN03PL)
# 2nd way, short-cut way
#ExN01pl.Construct()
#EMSTDpl.Construct()
#g4py.ExN01pl.Construct()
#g4py.EMSTDpl.Construct()
# ------------------------------------------------------------------
# setup for primary generator action
# ------------------------------------------------------------------
# normal way for constructing user physics list
#pgPGA= ParticleGun.ParticleGunAction()
#pgPGA= g4py.ParticleGun.ParticleGunAction()
#gRunManager.SetUserAction(pgPGA)
#pg= pgPGA.GetParticleGun()
# 2nd way, short-cut way
pg= ParticleGun.Construct()
pg= g4py.ParticleGun.Construct()
# set parameters of particle gun
pg.SetParticleByName("e-")
@@ -1,11 +1,13 @@
#!/usr/bin/python
#### 2006 Sep 26, the first draft version
## Wired not yet. g4pipe control and Popen
from Geant4 import *
import Qmaterials, NISTmaterials
import ExN03geom
import ExN03pl
import ParticleGun, MedicalBeam
import g4py.Qmaterials, g4py.NISTmaterials
import g4py.ExN03geom
import g4py.ExN03pl
import g4py.ParticleGun, g4py.MedicalBeam
import sys
from time import *
from subprocess import *
@@ -27,20 +29,20 @@ HepRandom.setTheSeed(20050830L)
# NIST materials
#NISTmaterials.Construct()
#g4py.NISTmaterials.Construct()
# ------------------------------------------------------------------
# setup for geometry
# ------------------------------------------------------------------
# normal way for constructing user geometry
exN03geom= ExN03geom.ExN03DetectorConstruction()
exN03geom= g4py.ExN03geom.ExN03DetectorConstruction()
gRunManager.SetUserInitialization(exN03geom)
# 2nd way, short-cut way
#ExN01geom.Construct()
#ExN03geom.Construct()
#g4py.ExN01geom.Construct()
#g4py.ExN03geom.Construct()
# magnetic field
#exN03geom.SetMagField(0.1 * tesla)
@@ -49,23 +51,23 @@ gRunManager.SetUserInitialization(exN03geom)
# setup for physics list
# ------------------------------------------------------------------
# normal way for constructing user physics list
exN03PL= ExN03pl.ExN03PhysicsList()
exN03PL= g4py.ExN03pl.ExN03PhysicsList()
gRunManager.SetUserInitialization(exN03PL)
# 2nd way, short-cut way
#ExN01pl.Construct()
#g4py.ExN01pl.Construct()
# ------------------------------------------------------------------
# setup for primary generator action
# ------------------------------------------------------------------
# normal way for constructing user physics list
#pgPGA= ParticleGun.ParticleGunAction()
#pgPGA= g4py.ParticleGun.ParticleGunAction()
#gRunManager.SetUserAction(pgPGA)
#pg= pgPGA.GetParticleGun()
# 2nd way, short-cut way
pg= ParticleGun.Construct()
pg= g4py.ParticleGun.Construct()
# set parameters of particle gun
pg.SetParticleByName("e-")
+5 -5
View File
@@ -5,8 +5,8 @@
# Plotting photon cross sections and stopping power with ROOT
# ==================================================================
from Geant4 import *
import NISTmaterials
from EZsim import *
import g4py.NISTmaterials
import g4py.ezgeom
# ==================================================================
# geometry setup
@@ -16,15 +16,15 @@ from EZsim import *
# setup
# ------------------------------------------------------------------
def Configure():
NISTmaterials.Construct()
EZgeom.Construct()
g4py.NISTmaterials.Construct()
g4py.ezgeom.Construct()
# ------------------------------------------------------------------
# constructing geometry
# ------------------------------------------------------------------
def SetMaterial(material_name):
material= gNistManager.FindOrBuildMaterial(material_name)
EZgeom.SetWorldMaterial(material)
g4py.ezgeom.SetWorldMaterial(material)
# ==================================================================
+4 -3
View File
@@ -5,14 +5,15 @@
# Plotting photon cross sections and stopping power
# ==================================================================
from Geant4 import *
import ExN03pl
import g4py.ExN03pl
import g4py.emcalculator
import EmPlot
# initialize
EmPlot.Configure()
# user physics list
ExN03pl.Construct()
g4py.ExN03pl.Construct()
# target material
material= "G4_Cu"
@@ -30,7 +31,7 @@ for n in range(-3, 3):
# calculate stopping power
pname= "e-"
dedx_list= CalculateDEDX(pname, material, elist, 1)
dedx_list= g4py.emcalculator.CalculateDEDX(pname, material, elist, 1)
xlist_tot=[]
xlist_ioni=[]
xlist_brems=[]
+4 -3
View File
@@ -5,14 +5,15 @@
# Plotting photon cross sections and stopping power
# ==================================================================
from Geant4 import *
import ExN03pl
import g4py.ExN03pl
import g4py.emcalculator
import EmPlot
# initialize
EmPlot.Configure()
# user physics list
ExN03pl.Construct()
g4py.ExN03pl.Construct()
# target material
material= "G4_Pb"
@@ -30,7 +31,7 @@ for n in range(-3, 4):
# calculate cross sections
xsection_list= CalculatePhotonCrossSection(material, elist, 1)
xsection_list= g4py.emcalculator.CalculatePhotonCrossSection(material, elist, 1)
xlist_tot=[]
xlist_comp=[]
xlist_pe=[]
+388 -530
View File
@@ -1,531 +1,389 @@
<?xml version="1.0" encoding="UTF-8" ?>
<gdml xmlns:gdml="http://cern.ch/2001/Schemas/GDML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="GDMLSchema/gdml.xsd" >
<define>
<rotation name="tube0xc18410invoxel0xc15240r" unit="degree" x="-90" y="-0" z="0" />
<position name="cal0xc188b0inAREA_LV0xc14980p" unit="mm" x="100" y="0" z="20" />
<position name="cal0xc18820inAREA_LV0xc14980p" unit="mm" x="50" y="0" z="20" />
<position name="cal0xc18790inAREA_LV0xc14980p" unit="mm" x="0" y="0" z="20" />
<position name="cal0xc18700inAREA_LV0xc14980p" unit="mm" x="-50" y="0" z="20" />
<position name="cal0xc18670inAREA_LV0xc14980p" unit="mm" x="-100" y="0" z="20" />
<position name="voxel0xc18140inAREA_LV0xc14980p" unit="mm" x="140" y="0" z="-50" />
<position name="voxel0xc180b0inAREA_LV0xc14980p" unit="mm" x="120" y="0" z="-50" />
<position name="voxel0xc18020inAREA_LV0xc14980p" unit="mm" x="100" y="0" z="-50" />
<position name="voxel0xc17f90inAREA_LV0xc14980p" unit="mm" x="80" y="0" z="-50" />
<position name="voxel0xc17f00inAREA_LV0xc14980p" unit="mm" x="60" y="0" z="-50" />
<position name="voxel0xc17e70inAREA_LV0xc14980p" unit="mm" x="40" y="0" z="-50" />
<position name="voxel0xc168c0inAREA_LV0xc14980p" unit="mm" x="20" y="0" z="-50" />
<position name="voxel0xc16830inAREA_LV0xc14980p" unit="mm" x="0" y="0" z="-50" />
<position name="voxel0xc167a0inAREA_LV0xc14980p" unit="mm" x="-20" y="0" z="-50" />
<position name="voxel0xc16710inAREA_LV0xc14980p" unit="mm" x="-40" y="0" z="-50" />
<position name="voxel0xc179d0inAREA_LV0xc14980p" unit="mm" x="-60" y="0" z="-50" />
<position name="voxel0xc17940inAREA_LV0xc14980p" unit="mm" x="-80" y="0" z="-50" />
<position name="voxel0xc178b0inAREA_LV0xc14980p" unit="mm" x="-100" y="0" z="-50" />
<position name="voxel0xc17820inAREA_LV0xc14980p" unit="mm" x="-120" y="0" z="-50" />
<position name="voxel0xc17790inAREA_LV0xc14980p" unit="mm" x="-140" y="0" z="-50" />
<position name="voxel0xc17700inAREA_LV0xc14980p" unit="mm" x="140" y="0" z="-70" />
<position name="voxel0xc17670inAREA_LV0xc14980p" unit="mm" x="120" y="0" z="-70" />
<position name="voxel0xc175e0inAREA_LV0xc14980p" unit="mm" x="100" y="0" z="-70" />
<position name="voxel0xc17550inAREA_LV0xc14980p" unit="mm" x="80" y="0" z="-70" />
<position name="voxel0xc174c0inAREA_LV0xc14980p" unit="mm" x="60" y="0" z="-70" />
<position name="voxel0xc17430inAREA_LV0xc14980p" unit="mm" x="40" y="0" z="-70" />
<position name="voxel0xc173a0inAREA_LV0xc14980p" unit="mm" x="20" y="0" z="-70" />
<position name="voxel0xc17310inAREA_LV0xc14980p" unit="mm" x="0" y="0" z="-70" />
<position name="voxel0xc17280inAREA_LV0xc14980p" unit="mm" x="-20" y="0" z="-70" />
<position name="voxel0xc171f0inAREA_LV0xc14980p" unit="mm" x="-40" y="0" z="-70" />
<position name="voxel0xc17160inAREA_LV0xc14980p" unit="mm" x="-60" y="0" z="-70" />
<position name="voxel0xc170d0inAREA_LV0xc14980p" unit="mm" x="-80" y="0" z="-70" />
<position name="voxel0xc17040inAREA_LV0xc14980p" unit="mm" x="-100" y="0" z="-70" />
<position name="voxel0xc16fb0inAREA_LV0xc14980p" unit="mm" x="-120" y="0" z="-70" />
<position name="voxel0xc16f20inAREA_LV0xc14980p" unit="mm" x="-140" y="0" z="-70" />
<position name="voxel0xc16e90inAREA_LV0xc14980p" unit="mm" x="140" y="0" z="-90" />
<position name="voxel0xc16e00inAREA_LV0xc14980p" unit="mm" x="120" y="0" z="-90" />
<position name="voxel0xc16d70inAREA_LV0xc14980p" unit="mm" x="100" y="0" z="-90" />
<position name="voxel0xc16ce0inAREA_LV0xc14980p" unit="mm" x="80" y="0" z="-90" />
<position name="voxel0xc16c50inAREA_LV0xc14980p" unit="mm" x="60" y="0" z="-90" />
<position name="voxel0xc16bc0inAREA_LV0xc14980p" unit="mm" x="40" y="0" z="-90" />
<position name="voxel0xc16b30inAREA_LV0xc14980p" unit="mm" x="20" y="0" z="-90" />
<position name="voxel0xc16aa0inAREA_LV0xc14980p" unit="mm" x="0" y="0" z="-90" />
<position name="voxel0xc16a10inAREA_LV0xc14980p" unit="mm" x="-20" y="0" z="-90" />
<position name="voxel0xc16980inAREA_LV0xc14980p" unit="mm" x="-40" y="0" z="-90" />
<position name="voxel0xc16920inAREA_LV0xc14980p" unit="mm" x="-60" y="0" z="-90" />
<position name="voxel0xc15dc0inAREA_LV0xc14980p" unit="mm" x="-80" y="0" z="-90" />
<position name="voxel0xc166b0inAREA_LV0xc14980p" unit="mm" x="-100" y="0" z="-90" />
<position name="voxel0xc16620inAREA_LV0xc14980p" unit="mm" x="-120" y="0" z="-90" />
<position name="voxel0xc16590inAREA_LV0xc14980p" unit="mm" x="-140" y="0" z="-90" />
<position name="voxel0xc16500inAREA_LV0xc14980p" unit="mm" x="140" y="0" z="-110" />
<position name="voxel0xc16470inAREA_LV0xc14980p" unit="mm" x="120" y="0" z="-110" />
<position name="voxel0xc163e0inAREA_LV0xc14980p" unit="mm" x="100" y="0" z="-110" />
<position name="voxel0xc16350inAREA_LV0xc14980p" unit="mm" x="80" y="0" z="-110" />
<position name="voxel0xc162c0inAREA_LV0xc14980p" unit="mm" x="60" y="0" z="-110" />
<position name="voxel0xc16230inAREA_LV0xc14980p" unit="mm" x="40" y="0" z="-110" />
<position name="voxel0xc161a0inAREA_LV0xc14980p" unit="mm" x="20" y="0" z="-110" />
<position name="voxel0xc16110inAREA_LV0xc14980p" unit="mm" x="0" y="0" z="-110" />
<position name="voxel0xc16080inAREA_LV0xc14980p" unit="mm" x="-20" y="0" z="-110" />
<position name="voxel0xc15ff0inAREA_LV0xc14980p" unit="mm" x="-40" y="0" z="-110" />
<position name="voxel0xc15f60inAREA_LV0xc14980p" unit="mm" x="-60" y="0" z="-110" />
<position name="voxel0xc15ed0inAREA_LV0xc14980p" unit="mm" x="-80" y="0" z="-110" />
<position name="voxel0xc158b0inAREA_LV0xc14980p" unit="mm" x="-100" y="0" z="-110" />
<position name="voxel0xc15d30inAREA_LV0xc14980p" unit="mm" x="-120" y="0" z="-110" />
<position name="voxel0xc15ca0inAREA_LV0xc14980p" unit="mm" x="-140" y="0" z="-110" />
<position name="voxel0xc15c10inAREA_LV0xc14980p" unit="mm" x="140" y="0" z="-130" />
<position name="voxel0xc15b80inAREA_LV0xc14980p" unit="mm" x="120" y="0" z="-130" />
<position name="voxel0xc15af0inAREA_LV0xc14980p" unit="mm" x="100" y="0" z="-130" />
<position name="voxel0xc15a60inAREA_LV0xc14980p" unit="mm" x="80" y="0" z="-130" />
<position name="voxel0xc159d0inAREA_LV0xc14980p" unit="mm" x="60" y="0" z="-130" />
<position name="voxel0xc15940inAREA_LV0xc14980p" unit="mm" x="40" y="0" z="-130" />
<position name="voxel0xc15820inAREA_LV0xc14980p" unit="mm" x="20" y="0" z="-130" />
<position name="voxel0xc15790inAREA_LV0xc14980p" unit="mm" x="0" y="0" z="-130" />
<position name="voxel0xc15700inAREA_LV0xc14980p" unit="mm" x="-20" y="0" z="-130" />
<position name="voxel0xc15670inAREA_LV0xc14980p" unit="mm" x="-40" y="0" z="-130" />
<position name="voxel0xc15610inAREA_LV0xc14980p" unit="mm" x="-60" y="0" z="-130" />
<position name="voxel0xc15580inAREA_LV0xc14980p" unit="mm" x="-80" y="0" z="-130" />
<position name="voxel0xc154c0inAREA_LV0xc14980p" unit="mm" x="-100" y="0" z="-130" />
<position name="voxel0xc15430inAREA_LV0xc14980p" unit="mm" x="-120" y="0" z="-130" />
<position name="voxel0xc15380inAREA_LV0xc14980p" unit="mm" x="-140" y="0" z="-130" />
</define>
<materials>
<element Z="7" formula="N" name="Nitrogen0xc03430" >
<atom value="14.0067" />
</element>
<element Z="8" formula="O" name="Oxygen0xc03600" >
<atom value="15.9994" />
</element>
<material formula=" " name="Vacuum0xc041f0" >
<D value="1e-25" />
<fraction n="0.7" ref="Nitrogen0xc03430" />
<fraction n="0.3" ref="Oxygen0xc03600" />
</material>
<element Z="18" formula="Ar" name="Argon0xc03b70" >
<atom value="39.948" />
</element>
<material formula=" " name="Air0xc04770" >
<D value="0.0012929" />
<fraction n="0.755078" ref="Nitrogen0xc03430" />
<fraction n="0.232116" ref="Oxygen0xc03600" />
<fraction n="0.0128064" ref="Argon0xc03b70" />
</material>
<material Z="18" formula=" " name="ArgonGas0xc051f0" >
<D value="0.00166042" />
<atom value="39.948" />
</material>
<element Z="6" formula="C" name="Carbon0xc032a0" >
<atom value="12.011" />
</element>
<element Z="1" formula="H" name="Hydrogen0x950310" >
<atom value="1.00794" />
</element>
<material formula=" " name="Ethane0xc060e0" >
<D value="0.00126349" />
<fraction n="0.798879" ref="Carbon0xc032a0" />
<fraction n="0.201121" ref="Hydrogen0x950310" />
</material>
<element Z="18" formula=" " name="ArgonGas0xc05a70" >
<atom value="39.948" />
</element>
<material formula=" " name="ArEthane0xc063b0" >
<D value="0.00146196" />
<fraction n="0.567878" ref="ArgonGas0xc05a70" />
<fraction n="0.345213" ref="Carbon0xc032a0" />
<fraction n="0.0869089" ref="Hydrogen0x950310" />
</material>
<material Z="14" formula=" " name="SiliconWafer0xc06e40" >
<D value="2.33" />
<atom value="28.0855" />
</material>
<material Z="13" formula=" " name="Al0xc07d10" >
<D value="2.7" />
<atom value="26.98" />
</material>
<material Z="26" formula=" " name="Iron0xc08580" >
<D value="7.87" />
<atom value="55.847" />
</material>
<material Z="82" formula=" " name="Lead0xc08ce0" >
<D value="11.35" />
<atom value="207.2" />
</material>
<material formula=" " name="Scinti0xc097f0" >
<D value="1.032" />
<fraction n="0.922579" ref="Carbon0xc032a0" />
<fraction n="0.077421" ref="Hydrogen0x950310" />
</material>
<element Z="14" formula="Si" name="Silicon0xc039a0" >
<atom value="28.0855" />
</element>
<material formula=" " name="Quartz0xc09a30" >
<D value="2.64" />
<fraction n="0.467435" ref="Silicon0xc039a0" />
<fraction n="0.532565" ref="Oxygen0xc03600" />
</material>
<element Z="11" formula="Na" name="Sodium0xc037c0" >
<atom value="22.9898" />
</element>
<element Z="53" formula="I" name="Iodine0xc03d40" >
<atom value="126.904" />
</element>
<material formula=" " name="NaI0xc0a290" >
<D value="3.67" />
<fraction n="0.153373" ref="Sodium0xc037c0" />
<fraction n="0.846627" ref="Iodine0xc03d40" />
</material>
<element Z="55" formula="Cs" name="Cesium0xc03f60" >
<atom value="132.905" />
</element>
<material formula=" " name="CsI0xc0aab0" >
<D value="4.51" />
<fraction n="0.511549" ref="Cesium0xc03f60" />
<fraction n="0.488451" ref="Iodine0xc03d40" />
</material>
</materials>
<solids>
<box aunit="radian" lunit="mm" name="AREA0xc145c0" x="300" y="300" z="300" />
<box aunit="radian" lunit="mm" name="voxel0xc151b0" x="20" y="200" z="20" />
<tube aunit="degree" deltaphi="360" lunit="mm" name="tube0xc181d0" rmax="9.5" rmin="0" startphi="0" z="200" />
<box aunit="radian" lunit="mm" name="cal0xc184a0" x="50" y="50" z="60" />
</solids>
<structure>
<volume name="tube0xc18280" >
<materialref ref="Al0xc07d10" />
<solidref ref="tube0xc181d0" />
</volume>
<volume name="voxel0xc15240" >
<materialref ref="Vacuum0xc041f0" />
<solidref ref="voxel0xc151b0" />
<physvol>
<volumeref ref="tube0xc18280" />
<rotationref ref="tube0xc18410invoxel0xc15240r" />
</physvol>
</volume>
<volume name="cal0xc18530" >
<materialref ref="CsI0xc0aab0" />
<solidref ref="cal0xc184a0" />
</volume>
<volume name="AREA_LV0xc14980" >
<materialref ref="Vacuum0xc041f0" />
<solidref ref="AREA0xc145c0" />
<physvol>
<volumeref ref="cal0xc18530" />
<positionref ref="cal0xc188b0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="cal0xc18530" />
<positionref ref="cal0xc18820inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="cal0xc18530" />
<positionref ref="cal0xc18790inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="cal0xc18530" />
<positionref ref="cal0xc18700inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="cal0xc18530" />
<positionref ref="cal0xc18670inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc18140inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc180b0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc18020inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17f90inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17f00inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17e70inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc168c0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16830inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc167a0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16710inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc179d0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17940inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc178b0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17820inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17790inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17700inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17670inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc175e0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17550inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc174c0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17430inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc173a0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17310inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17280inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc171f0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17160inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc170d0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc17040inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16fb0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16f20inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16e90inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16e00inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16d70inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16ce0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16c50inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16bc0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16b30inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16aa0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16a10inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16980inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16920inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15dc0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc166b0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16620inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16590inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16500inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16470inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc163e0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16350inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc162c0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16230inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc161a0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16110inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc16080inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15ff0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15f60inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15ed0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc158b0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15d30inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15ca0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15c10inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15b80inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15af0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15a60inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc159d0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15940inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15820inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15790inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15700inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15670inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15610inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15580inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc154c0inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15430inAREA_LV0xc14980p" />
</physvol>
<physvol>
<volumeref ref="voxel0xc15240" />
<positionref ref="voxel0xc15380inAREA_LV0xc14980p" />
</physvol>
</volume>
</structure>
<setup name="Default" version="1.0" >
<world ref="AREA_LV0xc14980" />
</setup>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gdml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://service-spi.web.cern.ch/service-spi/app/releases/GDML/GDML_2_10_0/src/GDMLSchema/gdml.xsd">
<define/>
<materials>
<material Z="13" name="Al0x932cf0" state="solid">
<D unit="g/cm3" value="2.7"/>
<atom unit="g/mole" value="26.98"/>
</material>
<element Z="7" name="Nitrogen0x90fe50">
<atom unit="g/mole" value="14.00674"/>
</element>
<element Z="8" name="Oxygen0x91dc40">
<atom unit="g/mole" value="15.9994"/>
</element>
<material name="Vacuum0x916cf0" state="gas">
<D unit="g/cm3" value="1e-25"/>
<fraction n="0.7" ref="Nitrogen0x90fe50"/>
<fraction n="0.3" ref="Oxygen0x91dc40"/>
</material>
<element Z="55" name="Cesium0x90eed0">
<atom unit="g/mole" value="132.90543"/>
</element>
<element Z="53" name="Iodine0x61aa70">
<atom unit="g/mole" value="126.90447"/>
</element>
<material name="CsI0x935a90" state="solid">
<D unit="g/cm3" value="4.51"/>
<fraction n="0.511548751606463" ref="Cesium0x90eed0"/>
<fraction n="0.488451248393537" ref="Iodine0x61aa70"/>
</material>
</materials>
<solids>
<tube aunit="deg" deltaphi="360" lunit="mm" name="tube0x941cb0" rmax="9.5" rmin="0" startphi="0" z="200"/>
<box lunit="mm" name="voxel0x93f120" x="20" y="200" z="20"/>
<box lunit="mm" name="cal0x941f60" x="50" y="50" z="60"/>
<box lunit="mm" name="AREA0x93e380" x="300" y="300" z="300"/>
</solids>
<structure>
<volume name="tube0x941d60">
<materialref ref="Al0x932cf0"/>
<solidref ref="tube0x941cb0"/>
</volume>
<volume name="voxel0x93f1a0">
<materialref ref="Vacuum0x916cf0"/>
<solidref ref="voxel0x93f120"/>
<physvol name="tube0x941ee0">
<volumeref ref="tube0x941d60"/>
<rotation name="tube0x941ee0_rot" unit="deg" x="-90" y="0" z="0"/>
</physvol>
</volume>
<volume name="cal0x941fe0">
<materialref ref="CsI0x935a90"/>
<solidref ref="cal0x941f60"/>
</volume>
<volume name="AREA_LV0x93e970">
<materialref ref="Vacuum0x916cf0"/>
<solidref ref="AREA0x93e380"/>
<physvol name="voxel0x93f2d0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f2d0_pos" unit="mm" x="-140" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f370">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f370_pos" unit="mm" x="-120" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f3f0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f3f0_pos" unit="mm" x="-100" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f4a0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f4a0_pos" unit="mm" x="-80" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f520">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f520_pos" unit="mm" x="-60" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f5c0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f5c0_pos" unit="mm" x="-40" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f640">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f640_pos" unit="mm" x="-20" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f6c0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f6c0_pos" unit="mm" x="0" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f740">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f740_pos" unit="mm" x="20" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f570">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f570_pos" unit="mm" x="40" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f880">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f880_pos" unit="mm" x="60" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f900">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f900_pos" unit="mm" x="80" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93f980">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f980_pos" unit="mm" x="100" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93fa00">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93fa00_pos" unit="mm" x="120" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93fa80">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93fa80_pos" unit="mm" x="140" y="0" z="-130"/>
</physvol>
<physvol name="voxel0x93fb00">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93fb00_pos" unit="mm" x="-140" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x93fb80">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93fb80_pos" unit="mm" x="-120" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x93f7c0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93f7c0_pos" unit="mm" x="-100" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x93fd10">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93fd10_pos" unit="mm" x="-80" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x93fd90">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93fd90_pos" unit="mm" x="-60" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x93fe10">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93fe10_pos" unit="mm" x="-40" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x93fe90">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93fe90_pos" unit="mm" x="-20" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x93ff10">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93ff10_pos" unit="mm" x="0" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x93ff90">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93ff90_pos" unit="mm" x="20" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x940010">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940010_pos" unit="mm" x="40" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x940090">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940090_pos" unit="mm" x="60" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x940110">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940110_pos" unit="mm" x="80" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x940190">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940190_pos" unit="mm" x="100" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x940210">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940210_pos" unit="mm" x="120" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x940290">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940290_pos" unit="mm" x="140" y="0" z="-110"/>
</physvol>
<physvol name="voxel0x940310">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940310_pos" unit="mm" x="-140" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x940390">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940390_pos" unit="mm" x="-120" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x940410">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940410_pos" unit="mm" x="-100" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x93fc00">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93fc00_pos" unit="mm" x="-80" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x93fc80">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x93fc80_pos" unit="mm" x="-60" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x9406a0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x9406a0_pos" unit="mm" x="-40" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x940720">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940720_pos" unit="mm" x="-20" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x9407a0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x9407a0_pos" unit="mm" x="0" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x940820">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940820_pos" unit="mm" x="20" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x9408a0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x9408a0_pos" unit="mm" x="40" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x940920">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940920_pos" unit="mm" x="60" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x9409a0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x9409a0_pos" unit="mm" x="80" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x940a20">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940a20_pos" unit="mm" x="100" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x940aa0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940aa0_pos" unit="mm" x="120" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x940b20">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940b20_pos" unit="mm" x="140" y="0" z="-90"/>
</physvol>
<physvol name="voxel0x940ba0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940ba0_pos" unit="mm" x="-140" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x940c20">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940c20_pos" unit="mm" x="-120" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x940ca0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940ca0_pos" unit="mm" x="-100" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x940d20">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940d20_pos" unit="mm" x="-80" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x940da0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940da0_pos" unit="mm" x="-60" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x940e20">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940e20_pos" unit="mm" x="-40" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x940ea0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940ea0_pos" unit="mm" x="-20" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x940f20">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940f20_pos" unit="mm" x="0" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x940fa0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940fa0_pos" unit="mm" x="20" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x941020">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x941020_pos" unit="mm" x="40" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x9410a0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x9410a0_pos" unit="mm" x="60" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x941120">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x941120_pos" unit="mm" x="80" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x9411a0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x9411a0_pos" unit="mm" x="100" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x941220">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x941220_pos" unit="mm" x="120" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x9412a0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x9412a0_pos" unit="mm" x="140" y="0" z="-70"/>
</physvol>
<physvol name="voxel0x941320">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x941320_pos" unit="mm" x="-140" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x9413a0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x9413a0_pos" unit="mm" x="-120" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x941420">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x941420_pos" unit="mm" x="-100" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x9414a0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x9414a0_pos" unit="mm" x="-80" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x941520">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x941520_pos" unit="mm" x="-60" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x940490">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940490_pos" unit="mm" x="-40" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x940510">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940510_pos" unit="mm" x="-20" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x940590">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940590_pos" unit="mm" x="0" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x940610">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x940610_pos" unit="mm" x="20" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x9419b0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x9419b0_pos" unit="mm" x="40" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x941a30">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x941a30_pos" unit="mm" x="60" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x941ab0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x941ab0_pos" unit="mm" x="80" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x941b30">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x941b30_pos" unit="mm" x="100" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x941bb0">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x941bb0_pos" unit="mm" x="120" y="0" z="-50"/>
</physvol>
<physvol name="voxel0x941c30">
<volumeref ref="voxel0x93f1a0"/>
<position name="voxel0x941c30_pos" unit="mm" x="140" y="0" z="-50"/>
</physvol>
<physvol name="cal0x942110">
<volumeref ref="cal0x941fe0"/>
<position name="cal0x942110_pos" unit="mm" x="-100" y="0" z="20"/>
</physvol>
<physvol name="cal0x942190">
<volumeref ref="cal0x941fe0"/>
<position name="cal0x942190_pos" unit="mm" x="-50" y="0" z="20"/>
</physvol>
<physvol name="cal0x942210">
<volumeref ref="cal0x941fe0"/>
<position name="cal0x942210_pos" unit="mm" x="0" y="0" z="20"/>
</physvol>
<physvol name="cal0x942290">
<volumeref ref="cal0x941fe0"/>
<position name="cal0x942290_pos" unit="mm" x="50" y="0" z="20"/>
</physvol>
<physvol name="cal0x942310">
<volumeref ref="cal0x941fe0"/>
<position name="cal0x942310_pos" unit="mm" x="100" y="0" z="20"/>
</physvol>
</volume>
</structure>
<setup name="Default" version="1.0">
<world ref="AREA_LV0x93e970"/>
</setup>
</gdml>
@@ -1,56 +0,0 @@
#!/usr/bin/python
# ==================================================================
# An example for reading a GDML file
#
# ==================================================================
from Geant4 import *
from Geant4.G4g4gdml import *
import ExN01pl, ParticleGun
# ==================================================================
# user actions in python
# ==================================================================
class MyDetectorConstruction(G4VUserDetectorConstruction):
"My Detector Construction"
def __init__(self):
G4VUserDetectorConstruction.__init__(self)
self.world= None
self.gdml_parser= G4GDMLParser()
# -----------------------------------------------------------------
def __del__(self):
pass
# -----------------------------------------------------------------
def Construct(self):
self.gdml_parser.Read("qgeom.gdml")
self.world= self.gdml_parser.GetWorldVolume()
return self.world
# ==================================================================
# main
# ==================================================================
# set geometry
myDC= MyDetectorConstruction()
gRunManager.SetUserInitialization(myDC)
# minimal physics list
ExN01pl.Construct()
# set primary generator action
ParticleGun.Construct()
# initialize
gRunManager.Initialize()
# visualization
gApplyUICommand("/vis/open OGLIX")
gApplyUICommand("/vis/scene/create")
gApplyUICommand("/vis/scene/add/volume")
gApplyUICommand("/vis/sceneHandler/attach")
gApplyUICommand("/vis/viewer/set/viewpointThetaPhi 90. -90.")
+7 -17
View File
@@ -4,9 +4,7 @@
#
# ==================================================================
from Geant4 import *
from Geant4.G4gdml import *
import ExN01pl, ParticleGun
import g4py.ExN01pl, g4py.ParticleGun
# ==================================================================
# user actions in python
@@ -17,24 +15,16 @@ class MyDetectorConstruction(G4VUserDetectorConstruction):
def __init__(self):
G4VUserDetectorConstruction.__init__(self)
self.world= None
self.sxp= SAXProcessor()
self.config= ProcessingConfigurator()
self.gdml_parser= G4GDMLParser()
# -----------------------------------------------------------------
def __del__(self):
self.sxp.Finalize()
pass
# -----------------------------------------------------------------
def Construct(self):
self.sxp.Initialize()
self.config.SetURI("qgeom.gdml")
self.config.SetSetupName("Default")
self.sxp.Configure(self.config)
self.sxp.Run()
self.world= GDMLProcessor.GetInstance().GetWorldVolume()
self.gdml_parser.Read("qgeom.gdml")
self.world= self.gdml_parser.GetWorldVolume()
return self.world
@@ -47,10 +37,10 @@ myDC= MyDetectorConstruction()
gRunManager.SetUserInitialization(myDC)
# minimal physics list
ExN01pl.Construct()
g4py.ExN01pl.Construct()
# set primary generator action
ParticleGun.Construct()
g4py.ParticleGun.Construct()
# initialize
gRunManager.Initialize()
+10 -10
View File
@@ -4,23 +4,21 @@
#
# ==================================================================
from Geant4 import *
from Geant4.G4gdml import *
import Qmaterials, Qgeom
import ExN01pl, ParticleGun
import g4py.Qmaterials, g4py.Qgeom
import g4py.ExN01pl, g4py.ParticleGun
# ==================================================================
# main
# ==================================================================
# set geometry
Qmaterials.Construct()
Qgeom.Construct()
g4py.Qmaterials.Construct()
g4py.Qgeom.Construct()
# minimal physics list
ExN01pl.Construct()
g4py.ExN01pl.Construct()
# set primary generator action
ParticleGun.Construct()
g4py.ParticleGun.Construct()
# initialize
gRunManager.Initialize()
@@ -36,6 +34,8 @@ gApplyUICommand("/vis/viewer/set/viewpointThetaPhi 90. -90.")
print "\n*** write to a GDML file..."
navigator= gTransportationManager.GetNavigatorForTracking()
world_volume= navigator.GetWorldVolume()
gdml_writer= G4GDMLWriter("GDMLSchema/gdml.xsd", "qgeom.gdml")
gdml_writer.DumpGeometryInfo(world_volume)
gdml_parser = G4GDMLParser()
gdml_parser.Write("qgeom.gdml", world_volume)
@@ -1,41 +0,0 @@
# $Id: GNUmakefile,v 1.3 2006/08/10 08:50:18 kmura Exp $
# $Name: geant4-09-01 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
include ../../../config/config.gmk
# -----------------------------------------------------------
# library
# -----------------------------------------------------------
SUBDIR := ezgeom
.PHONY: all cleanall
all:
@cd $(SUBDIR) && $(MAKE)
@$(MAKE) $(module_name)
installall:
@cd $(SUBDIR) && $(MAKE) install
@$(MAKE) install
cleanall:
@cd $(SUBDIR) && $(MAKE) clean
@-rm -f $(module_name)
@-rm -f *.o
# -----------------------------------------------------------
# module
# -----------------------------------------------------------
# python module name
PACKAGE := EZsim#
MODULE := EZgeom#
include $(G4PY_INSTALL)/config/g4py.gmk
include $(G4PY_INSTALL)/config/module.gmk
include $(G4PY_INSTALL)/config/site-install.gmk
CXXFLAGS += -I./$(SUBDIR)
LOPT += -L./$(SUBDIR) -lezgeom
@@ -1,17 +0,0 @@
# $Id: GNUmakefile,v 1.2 2006/08/08 05:26:19 kmura Exp $
# $Name: geant4-09-01 $
# ===========================================================
# Makefile for building Geant4Py site-modules
# ===========================================================
include ../../../../config/config.gmk
LIBRARY := libezgeom#
include $(G4PY_INSTALL)/config/g4py.gmk
include $(G4PY_INSTALL)/config/module.gmk
install:
@echo ... intall $(lib_name) into $(Q_LIBDIR)
@if [ ! -d $(Q_LIBDIR) ]; then install -d $(Q_LIBDIR); fi
@install -m 755 $(LIBRARY).$(soext) $(Q_LIBDIR)
@@ -1,20 +0,0 @@
# $Id: __init__.py,v 1.1 2006/02/27 09:46:31 kmura Exp $
"""
# ==================================================================
# [EZsim]
# a site-module of Geant4Py
#
# A package for easy simulation
#
# ==================================================================
"""
# ==================================================================
# import submodules
# ==================================================================
import EZgeom
#import EZdetector
# ==================================================================
# globals, which start with "g"
# ==================================================================
+5 -10
View File
@@ -1,14 +1,14 @@
# $Id: GNUmakefile,v 1.3 2006/07/12 01:56:23 kmura Exp $
# $Name: geant4-09-01 $
# $Id: GNUmakefile,v 1.4 2008/12/01 07:23:29 kmura Exp $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py site-modules
# ===========================================================
include ../config/config.gmk
SUBDIR := geometries materials physics_lists primaries utils
SUBDIR += EZsim
SUBDIR := geometries materials processes physics_lists primaries
SUBDIR += utils python
.PHONY: all install clean uninstall
.PHONY: all install clean
all:
@for dir in $(SUBDIR); do (cd $$dir && $(MAKE)); done;:
@@ -19,8 +19,3 @@ install:
clean:
@for dir in $(SUBDIR); do (cd $$dir && $(MAKE) clean); done;:
uninstall:
@-\rm -f -r $(Q_LIBDIR)/site-modules
@-\rm -f $(Q_LIBDIR)/lib*.so
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: ExN01DetectorConstruction.cc,v 1.4 2006/06/29 15:29:10 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// ExN01DetectorConstruction.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: ExN01DetectorConstruction.hh,v 1.4 2006/06/29 15:29:12 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// ExN01DetectorConstruction.hh
//
@@ -1,5 +1,5 @@
# $Id: GNUmakefile,v 1.2 2006/04/25 10:25:12 kmura Exp $
# $Name: geant4-09-01 $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: pyExN01geom.cc,v 1.4 2006/06/29 15:29:14 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// pyExN01geom.cc
//
@@ -25,7 +25,7 @@
//
//
// $Id: ExN03DetectorConstruction.cc,v 1.5 2006/12/01 02:37:01 kmura Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
@@ -25,7 +25,7 @@
//
//
// $Id: ExN03DetectorConstruction.hh,v 1.5 2006/12/01 02:37:01 kmura Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
@@ -25,7 +25,7 @@
//
//
// $Id: ExN03DetectorMessenger.cc,v 1.1 2006/12/01 02:37:01 kmura Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
@@ -25,7 +25,7 @@
//
//
// $Id: ExN03DetectorMessenger.hh,v 1.1 2006/12/01 02:37:01 kmura Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
@@ -1,5 +1,5 @@
# $Id: GNUmakefile,v 1.2 2006/04/25 10:25:12 kmura Exp $
# $Name: geant4-09-01 $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: pyExN03geom.cc,v 1.4 2006/06/29 15:29:21 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// pyExN03geom.cc
//
@@ -1,10 +1,10 @@
# $Id: GNUmakefile,v 1.2 2006/04/25 10:25:12 kmura Exp $
# $Name: geant4-09-01 $
# $Id: GNUmakefile,v 1.3 2008/12/01 07:07:05 kmura Exp $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py site-modules
# ===========================================================
SUBDIR := Qgeom ExN01geom ExN03geom
SUBDIR := Qgeom ExN01geom ExN03geom ezgeom
.PHONY: all install clean cleanlib
@@ -1,5 +1,5 @@
# $Id: GNUmakefile,v 1.2 2006/04/25 10:25:12 kmura Exp $
# $Name: geant4-09-01 $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: QDetectorConstruction.cc,v 1.4 2006/06/29 15:29:24 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// QDetectorConstruction.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: QDetectorConstruction.hh,v 1.4 2006/06/29 15:29:26 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// QDetectorConstruction.hh
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: pyQgeom.cc,v 1.4 2006/06/29 15:29:29 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// pyQgeom.cc
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: EzDetectorConstruction.cc,v 1.3 2006/06/29 15:28:43 gunter Exp $
// $Name: geant4-09-01 $
// $Id: EzDetectorConstruction.cc,v 1.1 2008/12/01 07:07:34 kmura Exp $
// $Name: geant4-09-02 $
// ====================================================================
// EzDetectorConstruction.cc
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: EzDetectorConstruction.hh,v 1.3 2006/06/29 15:28:46 gunter Exp $
// $Name: geant4-09-01 $
// $Id: EzDetectorConstruction.hh,v 1.1 2008/12/01 07:07:34 kmura Exp $
// $Name: geant4-09-02 $
// ====================================================================
// EzDetectorConstruction.hh
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EzVolume.cc,v 1.3 2006/06/29 15:28:52 gunter Exp $
// $Name: geant4-09-01 $
// $Id: G4EzVolume.cc,v 1.1 2008/12/01 07:07:34 kmura Exp $
// $Name: geant4-09-02 $
// ====================================================================
// G4EzVolume.cc
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EzVolume.hh,v 1.3 2006/06/29 15:28:55 gunter Exp $
// $Name: geant4-09-01 $
// $Id: G4EzVolume.hh,v 1.1 2008/12/01 07:07:34 kmura Exp $
// $Name: geant4-09-02 $
// ====================================================================
// G4EzVolume.hh
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EzVoxelParameterization.cc,v 1.3 2006/06/29 15:28:58 gunter Exp $
// $Name: geant4-09-01 $
// $Id: G4EzVoxelParameterization.cc,v 1.1 2008/12/01 07:07:34 kmura Exp $
// $Name: geant4-09-02 $
// ====================================================================
// G4EzVoxelParameterization.cc
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EzVoxelParameterization.hh,v 1.3 2006/06/29 15:29:01 gunter Exp $
// $Name: geant4-09-01 $
// $Id: G4EzVoxelParameterization.hh,v 1.1 2008/12/01 07:07:34 kmura Exp $
// $Name: geant4-09-02 $
// ====================================================================
// G4EzVoxelParameterization.hh
//
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EzWorld.cc,v 1.4 2006/08/25 05:13:16 kmura Exp $
// $Name: geant4-09-01 $
// $Id: G4EzWorld.cc,v 1.1 2008/12/01 07:07:34 kmura Exp $
// $Name: geant4-09-02 $
// ====================================================================
// G4EzWorld.cc
//
@@ -38,7 +38,6 @@
#include "G4PVPlacement.hh"
#include "G4VisAttributes.hh"
#include "G4RunManager.hh"
#include "pyG4Version.hh"
G4VPhysicalVolume* G4EzWorld::world= G4EzWorld::CreateWorld();
@@ -68,11 +67,7 @@ G4VPhysicalVolume* G4EzWorld::CreateWorld
//////////////////////////////////////////////////////////
{
// default matetial is "vacuum"
#if G4VERSION_NUMBER >= 800
G4Material* vacuum= G4Material::GetMaterial("_Vacuum", false);
#else
G4Material* vacuum= G4Material::GetMaterial("_Vacuum");
#endif
if(vacuum==0) {
G4Element* elN= new G4Element("_N", "", 7., 14.00674*g/mole);
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EzWorld.hh,v 1.3 2006/06/29 15:29:07 gunter Exp $
// $Name: geant4-09-01 $
// $Id: G4EzWorld.hh,v 1.1 2008/12/01 07:07:34 kmura Exp $
// $Name: geant4-09-02 $
// ====================================================================
// G4EzWorld.hh
//
@@ -1,14 +1,14 @@
# $Id: GNUmakefile,v 1.1 2007/11/25 19:39:37 kmura Exp $
# $Name: geant4-09-01 $
# $Id: GNUmakefile,v 1.1 2008/12/01 07:07:34 kmura Exp $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
include ../../config/config.gmk
include ../../../config/config.gmk
# python module name
MODULE := G4g4gdml#
MODULE := ezgeom#
include $(G4PY_INSTALL)/config/g4py.gmk
include $(G4PY_INSTALL)/config/module.gmk
include $(G4PY_INSTALL)/config/install.gmk
include $(G4PY_INSTALL)/config/site-install.gmk
@@ -23,12 +23,12 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: pyEzgeom.cc,v 1.3 2006/06/29 15:28:49 gunter Exp $
// $Name: geant4-09-01 $
// $Id: pyEzgeom.cc,v 1.1 2008/12/01 07:07:34 kmura Exp $
// $Name: geant4-09-02 $
// ====================================================================
// pyEZgeom.cc
//
// [EZgeom]
// [ezgeom]
// a site-module of Geant4Py
//
// An easy way to build geometry
@@ -114,7 +114,7 @@ using namespace pyEZgeom;
// Expose to Python
// ====================================================================
BOOST_PYTHON_MODULE(EZgeom) {
BOOST_PYTHON_MODULE(ezgeom) {
class_<G4EzVolume>("G4EzVolume", "an easy way of geometry configuration")
.def(init<const G4String&>())
@@ -1,5 +1,5 @@
# $Id: GNUmakefile,v 1.2 2006/04/25 10:28:34 kmura Exp $
# $Name: geant4-09-01 $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py site-modules
# ===========================================================
@@ -1,5 +1,5 @@
# $Id: GNUmakefile,v 1.2 2006/04/25 10:28:34 kmura Exp $
# $Name: geant4-09-01 $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: NISTmaterials.cc,v 1.4 2006/06/29 15:29:32 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// NISTmaterials.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: pyNISTmaterials.cc,v 1.4 2006/06/29 15:29:34 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// pyNISTmaterials.cc
//
@@ -1,5 +1,5 @@
# $Id: GNUmakefile,v 1.2 2006/04/25 10:28:36 kmura Exp $
# $Name: geant4-09-01 $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: Qmaterials.cc,v 1.4 2006/06/29 15:29:37 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// Qmaterials.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: pyQmaterials.cc,v 1.4 2006/06/29 15:29:40 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// pyQmaterials.cc
//
@@ -1,5 +1,5 @@
# $Id: GNUmakefile,v 1.1 2006/07/12 08:46:18 kmura Exp $
# $Name: geant4-09-01 $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: PhysicsListEMlowE.cc,v 1.1 2006/07/12 08:46:18 kmura Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// PhysicsListEMlowE.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: PhysicsListEMlowE.hh,v 1.1 2006/07/12 08:46:18 kmura Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// PhysicsListEMlowE.hh
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: pyEMLowEpl.cc,v 1.2 2006/07/12 09:18:08 kmura Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// pyEMLowEpl.cc
//
@@ -1,5 +1,5 @@
# $Id: GNUmakefile,v 1.2 2006/04/25 10:31:40 kmura Exp $
# $Name: geant4-09-01 $
# $Name: geant4-09-02 $
# ===========================================================
# Makefile for building Geant4Py modules
# ===========================================================
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: PhysicsListEMstd.cc,v 1.5 2006/07/11 09:55:01 kmura Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// PhysicsListEMstd.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: PhysicsListEMstd.hh,v 1.4 2006/06/29 15:29:46 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// PhysicsListEMstd.hh
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: pyEMSTDpl.cc,v 1.4 2006/06/29 15:29:49 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// pyEMSTDpl.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: ExN01PhysicsList.cc,v 1.4 2006/06/29 15:29:52 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// ExN01PhysicsList.cc
//
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: ExN01PhysicsList.hh,v 1.4 2006/06/29 15:29:55 gunter Exp $
// $Name: geant4-09-01 $
// $Name: geant4-09-02 $
// ====================================================================
// ExN01PhysicsList.hh
//

Some files were not shown because too many files have changed in this diff Show More