Python GDML Processors
General Information
NOTE: This page is obsolete and no longer maintained.
Refer to the main GDML Home Page
for the latest version of GDML
This package contains the Python implementation of GDML writers and readers.
It consists of an application-independent part and application-specific
(Geant4, ROOT, etc) bindings. Each version of the package implements a
specific version of the GDML Schema.
Latest Release: PyGDML_1_2_0
Supports GDMLSchema_2_1_1. This release contains the first version of ROOT->GDML writer which allows exporting GDML geometry files
from ROOT. A few improvements has been to also added to the GDML readers, like the possibility of specifying the input file as argument.
Previous releases:
- PyGDML_1_1_0 - Supports GDMLSchema_2_1_0. Moved to ROOT 4.03/04 and SEAL_1_6_2. Bug fix in ROOTBinding affecting boolean solids.
- PyGDML_1_0_0 - Supports GDMLSchema_2_1_0. This is the first release of the Python processors as an indepent package.
It contains a
common part, application-independent, and two application-specific bindings: to ROOT (4.03/02) and to Geant4 (7.0).
The Geant4 binding is
performed using Reflex/PyReflex tools (SEAL_1_6_1). The ROOT binding uses PyROOT library which is part of
the ROOT distribution.
The Example directory contain a simple example ilustrating how, using GDML geometry file, one can run Geant4 and then
visualise the geometry and the hits in ROOT.
How do I...?
- Install the Python GDML processors
- The minimum you need is the PyGDML/Common and
one of the bindings (PyGDML/ROOTBinding or PyGDML/G4Binding). Otherwise you can simply checkout
(or get the tarball) of the whole PyGDML package which then comes also with some examples.
To access LCG CVS you can use the anonymous login:
cvs -d :pserver:anonymous@simu.cvs.cern.ch:/cvs/simu co -r <version> -d <destination> GDML2/PyGDML
where <version> is the tag of the version you want and <destination>
is the directory you want to install PyGDML in (for instance PyGDML)
- Configure and build
- For the ROOT binding you only need to set the environment
variables as in the rootsetup.(c)sh script. There is nothing to be built!
- For the Geant4 binding you first need to set the environnment variables as in the
g4setup.(c)sh script and then create and build the dictionary by issueing 'make' command in
the G4Binding directory.
- To build the examples you need to set the environment as in the script which comes with
the given example and build the appropriate dictionaries (if any) by issueing 'make' command.
- Run
- To load GDML geometry into ROOT you need to execute GDMLROOT.py script
from ROOTBinding/python directory. You can do it by invoking Python interactively,
i.e. 'python -i GDMLROOT.py'. Once the script is executed, you will have access to all ROOT classes
from Python and in particular you will have the GDML geometry converted into TGeo and loaded into memory.
- To load GDML geometry into Geant4 you need to execute GDMLG4.py script from G4Binding/python
directory. You can do it by invoking Python interactively, i.e. 'python -i GDMLG4.py'.
Once the script is exectuted, you have access from Python to the Geant4 classes for which
the dictionary was created and in particular you will have the GDML geometry converted into the
Geant4 geometry and loaded into memory.
PyGDML CVS repository
Downloads
Contact: Witek Pokorski and/or
Radovan Chytracek