Import Geant4 11.0.0 source tree
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
|
||||
///\file "persistency/.README.txt"
|
||||
///\brief Examples persistency README page
|
||||
|
||||
/*! \page Examples_persistency Category "persistency"
|
||||
|
||||
This directory contains a set of persistency examples.
|
||||
|
||||
- \link ExampleP01 P01 \endlink Root I/O example for storing and retrieving calorimeter hits.
|
||||
- \link ExampleP02 P02 \endlink Root I/O example for storing and reading geometry objects.
|
||||
- \link ExampleP03 P03 \endlink Example of detector geometry persistency in ASCII text format.
|
||||
|
||||
- \link Examples_gdml gdml \endlink Set of examples showing usage of the GDML plugin module in Geant4.
|
||||
|
||||
See the README page inside each example for more detail.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,83 @@
|
||||
|
||||
///\file "persistency/P01/.README.txt"
|
||||
///\brief Example P01 README page
|
||||
|
||||
/*! \page ExampleP01 Example P01
|
||||
|
||||
|
||||
\section P01_s1 General description
|
||||
|
||||
This example shows how to store produced hits in a file using
|
||||
the 'reflection' technique for persistency provided by the Reflex tool
|
||||
included in ROOT. The Reflex tool allows to create a dictionary
|
||||
for the hit class, making then possible to save hit objects in a .root
|
||||
file. The general simulation setup (geometry, physics list, user
|
||||
actions, etc...) is taken from ExampleN02.
|
||||
|
||||
The provided makefile produces two executables: 'exampleP01' and
|
||||
'readHits'. The first one is the actual Geant4 simulation application
|
||||
with hits persistency. The second one, is just a simple 'reader' for
|
||||
the produced .root file (you need to specify the name of the .root
|
||||
file as argument).
|
||||
|
||||
|
||||
\section P01_s2 Building and running the example
|
||||
|
||||
This examples requires the ROOT toolkit of version 6 to be installed. The
|
||||
provided CMake file checks for the existence of the package and its version.
|
||||
Once the CMake configuration has been succesfully done, the two executables
|
||||
for this example (exampleP01, readHits) should be built using make
|
||||
(in your CMake build directory):
|
||||
\verbatim
|
||||
make
|
||||
\endverbatim
|
||||
|
||||
When the example is run (using the provided run.mac macro file) ten
|
||||
events are generated and the produced hits will be stored in
|
||||
the hits.root file. In addition, the hits will be printed out on the
|
||||
screen so one can then compare them with the 'reader' output.
|
||||
|
||||
In order to read the persistified hits, a small 'reader' application
|
||||
has been implemented. It can be run in the following way:
|
||||
|
||||
\verbatim
|
||||
<my_binary_directory>/readHits hits.root
|
||||
\endverbatim
|
||||
|
||||
where the argument is the name of the file to be read. All the hits
|
||||
saved in that file will be then read and printed on the screen.
|
||||
|
||||
In addition to that the readHits.C ROOT macro file is provides, which
|
||||
illustrates how one can read the hits file directly from the ROOT
|
||||
prompt.
|
||||
|
||||
\section P01_s3 Remark on dictionary generation
|
||||
|
||||
The dictionary is generated by ${ROOTSYS}/bin/genreflex
|
||||
tool. The header file including headers for all the classes we want to
|
||||
generate the dictionary for should be given as argument. Additionally,
|
||||
a so called selection file (xml) should be provided (with -s flag) to
|
||||
the genreflex tool (see the GNUmakefile). The role of this file is to
|
||||
specify which classes we want to generate the dictionary for. The
|
||||
selection file for our dictionary is in xml/ directory. Please refer
|
||||
to genreflex manual for more details concerning the usage of that
|
||||
tool.
|
||||
|
||||
Concerning generating dictionary for the Geant4 objects, there are
|
||||
also two technical remarks that need to be made here.
|
||||
The Reflex tool requires all the templated classes to be
|
||||
explicitely used somewhere in the included header files in order for
|
||||
the generation of the dictionary to be possible. For those templated
|
||||
classes for which it is not the case, the problem can be very easily
|
||||
solved by instaciating them in the headerfile which is given to
|
||||
genreflex (see includes/ExP01Classes.hh) as argument.
|
||||
The second remark is that there is an unfortunate clash of names as
|
||||
far as G4String class is concerned. The header of G4String class
|
||||
defines __G4String which happens to be the name of a variable used
|
||||
within the generated dictionary code. The solution for that is to do
|
||||
\verbatim
|
||||
#undef __G4String
|
||||
\endverbatim
|
||||
in include/ExP01Classes.hh file.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,82 @@
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
ExampleP01
|
||||
----------
|
||||
|
||||
General description
|
||||
-------------------
|
||||
|
||||
This example shows how to store produced hits in a file using
|
||||
the 'reflection' technique for persistency provided by the Reflex tool
|
||||
included in ROOT. The Reflex tool allows to create a dictionary
|
||||
for the hit class, making then possible to save hit objects in a .root
|
||||
file. The general simulation setup (geometry, physics list, user
|
||||
actions, etc...) is taken from ExampleN02.
|
||||
|
||||
The provided makefile produces two executables: 'exampleP01' and
|
||||
'readHits'. The first one is the actual Geant4 simulation application
|
||||
with hits persistency. The second one, is just a simple 'reader' for
|
||||
the produced .root file (you need to specify the name of the .root
|
||||
file as argument).
|
||||
|
||||
|
||||
Building and running the example
|
||||
--------------------------------
|
||||
|
||||
This examples requires the ROOT toolkit of version 6 to be installed. The
|
||||
provided CMake file checks for the existence of the package and its version.
|
||||
Once the CMake configuration has been succesfully done, the two executables
|
||||
for this example (exampleP01, readHits) should be built using make
|
||||
(in your CMake build directory):
|
||||
|
||||
make
|
||||
|
||||
When the example is run (using the provided run.mac macro file) ten
|
||||
events are generated and the produced hits will be stored in
|
||||
the hits.root file. In addition, the hits will be printed out on the
|
||||
screen so one can then compare them with the 'reader' output.
|
||||
|
||||
In order to read the persistified hits, a small 'reader' application
|
||||
has been implemented. It can be run in the following way:
|
||||
|
||||
<my_binary_directory>/readHits hits.root
|
||||
|
||||
where the argument is the name of the file to be read. All the hits
|
||||
saved in that file will be then read and printed on the screen.
|
||||
|
||||
In addition to that the readHits.C ROOT macro file is provides, which
|
||||
illustrates how one can read the hits file directly from the ROOT
|
||||
prompt.
|
||||
|
||||
|
||||
Remark on dictionary generation
|
||||
-------------------------------
|
||||
|
||||
The dictionary is generated by ${ROOTSYS}/bin/genreflex
|
||||
tool. The header file including headers for all the classes we want to
|
||||
generate the dictionary for should be given as argument. Additionally,
|
||||
a so called selection file (xml) should be provided (with -s flag) to
|
||||
the genreflex tool (see the GNUmakefile). The role of this file is to
|
||||
specify which classes we want to generate the dictionary for. The
|
||||
selection file for our dictionary is in xml/ directory. Please refer
|
||||
to genreflex manual for more details concerning the usage of that
|
||||
tool.
|
||||
|
||||
Concerning generating dictionary for the Geant4 objects, there are
|
||||
also two technical remarks that need to be made here.
|
||||
The Reflex tool requires all the templated classes to be
|
||||
explicitely used somewhere in the included header files in order for
|
||||
the generation of the dictionary to be possible. For those templated
|
||||
classes for which it is not the case, the problem can be very easily
|
||||
solved by instaciating them in the headerfile which is given to
|
||||
genreflex (see includes/ExP01Classes.hh) as argument.
|
||||
The second remark is that there is an unfortunate clash of names as
|
||||
far as G4String class is concerned. The header of G4String class
|
||||
defines __G4String which happens to be the name of a variable used
|
||||
within the generated dictionary code. The solution for that is to do
|
||||
#undef __G4String in include/ExP01Classes.hh file.
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
|
||||
///\file "persistency/P02/.README.txt"
|
||||
///\brief Example P02 README page
|
||||
|
||||
/*! \page ExampleP02 Example P02
|
||||
|
||||
\section P02_s1 General description
|
||||
|
||||
|
||||
This example shows how to store in a binary file and how to
|
||||
read back the geometry tree using the 'reflection' technique for
|
||||
persistency provided by the Reflex tool also included in ROOT. The
|
||||
Reflex tool allows to create a dictionary for the geometry classes,
|
||||
making then possible to save the entire tree in a .root file.
|
||||
|
||||
The provided makefile produces the executable: 'exampleP02'. In order
|
||||
to run it one has to specify the argument, either 'write' or
|
||||
'read'. In the first case the geometry is instaciated in the standard
|
||||
way and then saved into the root file (geo.root). In the second case,
|
||||
the geometry is read from geo.root file.
|
||||
|
||||
|
||||
\section P02_s2 Building and running the example
|
||||
|
||||
This examples requires the ROOT toolkit of version 6 to be installed. The
|
||||
provided CMake file checks for the existence of the package and its version.
|
||||
Once the CMake configuration has been succesfully done, the executable
|
||||
for this example should be built using make
|
||||
(in your CMake build directory):
|
||||
\verbatim
|
||||
make
|
||||
\endverbatim
|
||||
|
||||
\section P02_s3 Remark on dictionary generation
|
||||
|
||||
The dictionary is generated by ${ROOTSYS}/bin/genreflex
|
||||
tool. The header file including headers for all the classes we want to
|
||||
generate the dictionary for should be given as argument. Additionally,
|
||||
a so called selection file (xml) should be provided (with -s flag) to
|
||||
the genreflex tool (see the GNUmakefile). The role of this file is to
|
||||
specify which classes we want to generate the dictionary for. The
|
||||
selection file for our dictionary is in xml/ directory. Please refer
|
||||
to genreflex manual for more details concerning the usage of that
|
||||
tool.
|
||||
|
||||
Concerning generating dictionary for the Geant4 objects, there are
|
||||
also two technical remarks that need to be made here.
|
||||
The Reflex tool requires all the templated classes to be
|
||||
explicitely used somewhere in the included header files in order for
|
||||
the generation of the dictionary to be possible. For those templated
|
||||
classes for which it is not the case, the problem can be very easily
|
||||
solved by instaciating them in the headerfile which is given to
|
||||
genreflex (see includes/ExP02Classes.hh) as argument.
|
||||
The second remark is that there is an unfortunate clash of names as
|
||||
far as G4String class is concerned. The header of G4String class
|
||||
defines __G4String which happens to be the name of a variable used
|
||||
within the generated dictionary code. The solution for that is to do
|
||||
\verbatim
|
||||
#undef __G4String
|
||||
\endverbatim
|
||||
in include/ExP02Classes.hh file.
|
||||
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,61 @@
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
ExampleP02
|
||||
----------
|
||||
|
||||
General description
|
||||
-------------------
|
||||
|
||||
This example shows how to store in a binary file and how to
|
||||
read back the geometry tree using the 'reflection' technique for
|
||||
persistency provided by the Reflex tool also included in ROOT. The
|
||||
Reflex tool allows to create a dictionary for the geometry classes,
|
||||
making then possible to save the entire tree in a .root file.
|
||||
|
||||
The provided makefile produces the executable: 'exampleP02'. In order
|
||||
to run it one has to specify the argument, either 'write' or
|
||||
'read'. In the first case the geometry is instaciated in the standard
|
||||
way and then saved into the root file (geo.root). In the second case,
|
||||
the geometry is read from geo.root file.
|
||||
|
||||
|
||||
Building and running the example
|
||||
--------------------------------
|
||||
|
||||
This examples requires the ROOT toolkit of version 6 to be installed. The
|
||||
provided CMake file checks for the existence of the package and its version.
|
||||
Once the CMake configuration has been succesfully done, the executable
|
||||
for this example should be built using make
|
||||
(in your CMake build directory):
|
||||
|
||||
make
|
||||
|
||||
Remark on dictionary generation
|
||||
-------------------------------
|
||||
|
||||
The dictionary is generated by ${ROOTSYS}/bin/genreflex
|
||||
tool. The header file including headers for all the classes we want to
|
||||
generate the dictionary for should be given as argument. Additionally,
|
||||
a so called selection file (xml) should be provided (with -s flag) to
|
||||
the genreflex tool (see the GNUmakefile). The role of this file is to
|
||||
specify which classes we want to generate the dictionary for. The
|
||||
selection file for our dictionary is in xml/ directory. Please refer
|
||||
to genreflex manual for more details concerning the usage of that
|
||||
tool.
|
||||
|
||||
Concerning generating dictionary for the Geant4 objects, there are
|
||||
also two technical remarks that need to be made here.
|
||||
The Reflex tool requires all the templated classes to be
|
||||
explicitely used somewhere in the included header files in order for
|
||||
the generation of the dictionary to be possible. For those templated
|
||||
classes for which it is not the case, the problem can be very easily
|
||||
solved by instaciating them in the headerfile which is given to
|
||||
genreflex (see includes/ExP02Classes.hh) as argument.
|
||||
The second remark is that there is an unfortunate clash of names as
|
||||
far as G4String class is concerned. The header of G4String class
|
||||
defines __G4String which happens to be the name of a variable used
|
||||
within the generated dictionary code. The solution for that is to do
|
||||
#undef __G4String in include/ExP02Classes.hh file.
|
||||
@@ -0,0 +1,133 @@
|
||||
|
||||
///\file "persistency/P03/.README.txt"
|
||||
///\brief ExampleP03 README page
|
||||
|
||||
/*! \page ExampleP03 Example P03
|
||||
|
||||
This example illustrates the use of the text geometry.
|
||||
|
||||
\section P03_s1 GEOMETRY EXAMPLES
|
||||
|
||||
Several examples of text geometries are provided:
|
||||
|
||||
g4geom_simple.txt :
|
||||
- Simple construction of materials and single placements
|
||||
|
||||
g4geom_matemixt.txt :
|
||||
- Isotopes, elements and materials
|
||||
|
||||
g4geom_boolean.txt :
|
||||
- Boolean solids
|
||||
|
||||
g4geom_reflections.txt :
|
||||
- Reflections
|
||||
|
||||
g4geom_replicas.txt :
|
||||
- Replicas
|
||||
|
||||
g4geom_divisions.txt :
|
||||
- Divisions
|
||||
|
||||
g4geom_paramLinear.txt :
|
||||
- Linear parameterisations
|
||||
|
||||
g4geom_paramSquare.txt :
|
||||
- Square parameterisations
|
||||
|
||||
g4geom_assembly.txt :
|
||||
- Assembly placements
|
||||
|
||||
|
||||
\section P03_s2 HOW TO START ?
|
||||
|
||||
Execute textGeom in 'batch' mode from macro file
|
||||
\verbatim
|
||||
% textGeom run.mac
|
||||
\endverbatim
|
||||
|
||||
It will read the geometry from a file named 'g4geom.txt', and it will create a
|
||||
VRML2 file to visualise the geometry.
|
||||
Therefore if you want to try any of the above-mentioned files, copy it to a
|
||||
file with this name,
|
||||
|
||||
|
||||
\section P03_s3 DEFINING A SENSITIVE DETECTOR
|
||||
|
||||
The detector construction class ExTGDetectorConstructionWithSD shows how to
|
||||
access a volume of the text geometry and assign to it a sensitive detector.
|
||||
To use it, replace at exampleTextGeom.cc the line
|
||||
|
||||
\verbatim
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstruction);
|
||||
\endverbatim
|
||||
|
||||
by
|
||||
|
||||
\verbatim
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstructionWithSD);
|
||||
\endverbatim
|
||||
|
||||
and recompile.
|
||||
|
||||
It will use the geometry from the file 'g4geom_SD.txt'
|
||||
|
||||
|
||||
\section P03_s4 MIXING TEXT AND C++ GEOMETRIES
|
||||
|
||||
The detector construction class ExTGDetectorConstructionWithCpp shows how to
|
||||
create a volume with C++ and place it in the world or inside a volume defined
|
||||
in the text geometry.
|
||||
To use it, replace at exampleTextGeom.cc the line
|
||||
|
||||
\verbatim
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstruction);
|
||||
\endverbatim
|
||||
|
||||
by
|
||||
|
||||
\verbatim
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstructionWithCpp);
|
||||
\endverbatim
|
||||
|
||||
and recompile.
|
||||
|
||||
It will use the geometry from the file 'g4geom_simple.txt'
|
||||
|
||||
|
||||
\section P03_s5 CREATING NEW TAGS IN THE TEXT GEOMETRY: DEFINING CUTS PER REGION
|
||||
|
||||
The detector construction class ExTGDetectorConstructionWithCuts, together with
|
||||
ExTGRCLineProcessor, ExTGRCDetectorBuilder, ExTGRCRegionCutsMgr and
|
||||
ExTGRCRegionData show how to add a couple of tags, ':REGION' and ':CUT', that
|
||||
allow to define cuts per region in your input geometry text file.
|
||||
To use it, replace at exampleTextGeom.cc the line
|
||||
|
||||
\verbatim
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstruction);
|
||||
\endverbatim
|
||||
|
||||
by
|
||||
|
||||
\verbatim
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstructionWithCuts);
|
||||
\endverbatim
|
||||
|
||||
and recompile.
|
||||
|
||||
It will use the geometry from the file 'g4geom_cutsPerRegion.txt'
|
||||
|
||||
|
||||
\section P03_s6 DUMP THE IN-MEMORY GEOMETRY TO TEXT FILE
|
||||
|
||||
The run action, ExTGRunAction, triggers the writing of the in-memory Geant4
|
||||
geometry to a text file.
|
||||
To use it you just have to uncomment in exampleTextGeom.cc the line
|
||||
|
||||
\verbatim
|
||||
runManager->SetUserAction(new ExTGRunAction);
|
||||
\endverbatim
|
||||
|
||||
and it will read the geometry from the file 'g4geom.txt' and will write the
|
||||
geometry in a file named 'geom.txt'
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,117 @@
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
Example TextGeom
|
||||
----------------
|
||||
|
||||
This example illustrates the use of the text geometry.
|
||||
|
||||
1.- GEOMETRY EXAMPLES
|
||||
|
||||
Several examples of text geometries are provided:
|
||||
|
||||
g4geom_simple.txt :
|
||||
- Simple construction of materials and single placements
|
||||
|
||||
g4geom_matemixt.txt :
|
||||
- Isotopes, elements and materials
|
||||
|
||||
g4geom_boolean.txt :
|
||||
- Boolean solids
|
||||
|
||||
g4geom_reflections.txt :
|
||||
- Reflections
|
||||
|
||||
g4geom_replicas.txt :
|
||||
- Replicas
|
||||
|
||||
g4geom_divisions.txt :
|
||||
- Divisions
|
||||
|
||||
g4geom_paramLinear.txt :
|
||||
- Linear parameterisations
|
||||
|
||||
g4geom_paramSquare.txt :
|
||||
- Square parameterisations
|
||||
|
||||
g4geom_assembly.txt :
|
||||
- Assembly placements
|
||||
|
||||
|
||||
2.- HOW TO START ?
|
||||
|
||||
- execute textGeom in 'batch' mode from macro file
|
||||
% textGeom run.mac
|
||||
|
||||
It will read the geometry from a file named 'g4geom.txt', and it will create a
|
||||
VRML2 file to visualise the geometry.
|
||||
Therefore if you want to try any of the above-mentioned files, copy it to a
|
||||
file with this name,
|
||||
|
||||
|
||||
3.- DEFINING A SENSITIVE DETECTOR
|
||||
|
||||
The detector construction class ExTGDetectorConstructionWithSD shows how to
|
||||
access a volume of the text geometry and assign to it a sensitive detector.
|
||||
To use it, replace at exampleTextGeom.cc the line
|
||||
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstruction);
|
||||
|
||||
by
|
||||
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstructionWithSD);
|
||||
|
||||
and recompile.
|
||||
|
||||
It will use the geometry from the file 'g4geom_SD.txt'
|
||||
|
||||
|
||||
4.- MIXING TEXT AND C++ GEOMETRIES
|
||||
|
||||
The detector construction class ExTGDetectorConstructionWithCpp shows how to
|
||||
create a volume with C++ and place it in the world or inside a volume defined
|
||||
in the text geometry.
|
||||
To use it, replace at exampleTextGeom.cc the line
|
||||
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstruction);
|
||||
|
||||
by
|
||||
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstructionWithCpp);
|
||||
|
||||
and recompile.
|
||||
|
||||
It will use the geometry from the file 'g4geom_simple.txt'
|
||||
|
||||
|
||||
5.- CREATING NEW TAGS IN THE TEXT GEOMETRY: DEFINING CUTS PER REGION
|
||||
|
||||
The detector construction class ExTGDetectorConstructionWithCuts, together with
|
||||
ExTGRCLineProcessor, ExTGRCDetectorBuilder, ExTGRCRegionCutsMgr and
|
||||
ExTGRCRegionData show how to add a couple of tags, ':REGION' and ':CUT', that
|
||||
allow to define cuts per region in your input geometry text file.
|
||||
To use it, replace at exampleTextGeom.cc the line
|
||||
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstruction);
|
||||
|
||||
by
|
||||
|
||||
runManager->SetUserInitialization(new ExTGDetectorConstructionWithCuts);
|
||||
|
||||
and recompile.
|
||||
|
||||
It will use the geometry from the file 'g4geom_cutsPerRegion.txt'
|
||||
|
||||
|
||||
6.- DUMP THE IN-MEMORY GEOMETRY TO TEXT FILE
|
||||
|
||||
The run action 'ExTGRunAction' triggers the writing of the in-memory Geant4
|
||||
geometry to a text file.
|
||||
To use it you just have to uncomment in exampleTextGeom.cc the line
|
||||
|
||||
runManager->SetUserAction(new ExTGRunAction);
|
||||
|
||||
and it will read the geometry from the file 'g4geom.txt' and will write the
|
||||
geometry in a file named 'geom.txt'
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
Geant4 Persistency Examples
|
||||
===========================
|
||||
|
||||
This directory contains a set of persistency examples.
|
||||
|
||||
P01 Root I/O example for storing and retrieving calorimeter hits.
|
||||
P02 Root I/O example for storing and reading geometry objects.
|
||||
P03 Example of detector geometry persistency in ASCII text format.
|
||||
|
||||
gdml Set of examples showing usage of the GDML plugin module in Geant4.
|
||||
|
||||
See the README file inside each example for more detail.
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
///\file "persistency/gdml/.README.txt"
|
||||
///\brief Examples gdml README page
|
||||
|
||||
/*! \page Examples_gdml Category "persistency/gdml"
|
||||
|
||||
This directory contains a set of examples showing the usage of the GDML
|
||||
plugin module in Geant4.
|
||||
|
||||
- \link ExampleG01 G01 \endlink Simple example for importing and exporting simple GDML files.
|
||||
|
||||
- \link ExampleG02 G02 \endlink Sample application showing how to import/export different
|
||||
geometry setups, including STEP Tools files and structures
|
||||
integrating them in a real simulation application.
|
||||
|
||||
- \link ExampleG03 G03 \endlink Simple example showing how to import extensions to the GDML
|
||||
schema.
|
||||
|
||||
- \link ExampleG04 G04 \endlink Simple example showing how to associate detector sensitivity
|
||||
to a logical-volume, making use of the auxiliary-information.
|
||||
|
||||
See the README file inside each example for more detail.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,58 @@
|
||||
|
||||
///\file "persistency/gdml/G01/.README.txt"
|
||||
///\brief Example G01 README page
|
||||
|
||||
/*! \page ExampleG01 Example G01
|
||||
|
||||
\section G01_s1 GDML READ/WRITE
|
||||
|
||||
This example demonstrates the usage of the GDML reader and writer. It allows
|
||||
to export geometry descriptions in an application independent format (GDML,
|
||||
Geometry Description Markup Language).
|
||||
The GDML files can be then used to interchange geometries between different
|
||||
applications and users.
|
||||
|
||||
The detector construction consists of a call to GDMLProcessor which parses a
|
||||
GDML file and returns the pointer to the world volume. The user can also write
|
||||
her/his own GDML file and use it as the primary input format for her/his Geant4
|
||||
application.
|
||||
|
||||
Several simple GDML files are provided:
|
||||
- axes.gdml, showing loading and orientation of Cartesian axes;
|
||||
- solids.gdml, list of all supported solids with placement;
|
||||
- scale.gdml, a simple diamond structure made of extruded solids;
|
||||
- divisionvol.gdml, a divided box;
|
||||
- parameterized.gdml, a parameterised box;
|
||||
- pTube.gdml, a parameterised tube;
|
||||
- auxiliary.gdml, showing association of volume with auxiliary information;
|
||||
- etc...
|
||||
|
||||
\section G01_s2 HOW TO BUILD THE EXAMPLE ?
|
||||
|
||||
- You need to have built the persistency/gdml module by having
|
||||
set the -DGEANT4_USE_GDML=ON flag during the CMAKE configuration step,
|
||||
as well as the -DXERCESC_ROOT_DIR=path_to_xercesc flag pointing to
|
||||
the path where the XercesC XML parser package is installed in your system.
|
||||
|
||||
- Compile and link to generate the executable (in your CMAKE build directory):
|
||||
\verbatim
|
||||
make
|
||||
\endverbatim
|
||||
|
||||
|
||||
- Execute the application.
|
||||
- For reading and visualize interactively a GDML file:
|
||||
\verbatim
|
||||
load_gdml [GDML-file-in].gdml
|
||||
\endverbatim
|
||||
|
||||
- For reading, writing and visualize interactively a GDML file:
|
||||
\verbatim
|
||||
load_gdml [GDML-file-in].gdml [GDML-file-out].gdml
|
||||
\endverbatim
|
||||
|
||||
- For reading, writing a GDML file and running in batch a macro:
|
||||
\verbatim
|
||||
load_gdml [GDML-file-in].gdml [GDML-file-out].gdml [macro].in
|
||||
\endverbatim
|
||||
*/
|
||||
@@ -0,0 +1,49 @@
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
GDML read/write
|
||||
---------------
|
||||
|
||||
This example demonstrates the usage of the GDML reader and writer. It allows
|
||||
to export geometry descriptions in an application independent format (GDML,
|
||||
Geometry Description Markup Language).
|
||||
The GDML files can be then used to interchange geometries between different
|
||||
applications and users.
|
||||
|
||||
The detector construction consists of a call to GDMLProcessor which parses a
|
||||
GDML file and returns the pointer to the world volume. The user can also write
|
||||
her/his own GDML file and use it as the primary input format for her/his Geant4
|
||||
application.
|
||||
|
||||
Several simple GDML files are provided:
|
||||
- axes.gdml, showing loading and orientation of Cartesian axes;
|
||||
- solids.gdml, list of all supported solids with placement;
|
||||
- scale.gdml, a simple diamond structure made of extruded solids;
|
||||
- divisionvol.gdml, a divided box;
|
||||
- parameterized.gdml, a parameterised box;
|
||||
- pTube.gdml, a parameterised tube;
|
||||
- auxiliary.gdml, showing association of volume with auxiliary information;
|
||||
- etc...
|
||||
|
||||
HOW TO BUILD THE EXAMPLE ?
|
||||
|
||||
- You need to have built the persistency/gdml module by having
|
||||
set the -DGEANT4_USE_GDML=ON flag during the CMAKE configuration step,
|
||||
as well as the -DXERCESC_ROOT_DIR=<path_to_xercesc> flag pointing to
|
||||
the path where the XercesC XML parser package is installed in your system.
|
||||
|
||||
- Compile and link to generate the executable (in your CMAKE build directory):
|
||||
% make
|
||||
|
||||
- Execute the application.
|
||||
o For reading and visualize interactively a GDML file:
|
||||
% load_gdml [GDML-file-in].gdml
|
||||
|
||||
o For reading, writing and visualize interactively a GDML file:
|
||||
% load_gdml [GDML-file-in].gdml [GDML-file-out].gdml
|
||||
|
||||
o For reading, writing a GDML file and running in batch a macro:
|
||||
% load_gdml [GDML-file-in].gdml [GDML-file-out].gdml [macro].in
|
||||
@@ -0,0 +1,57 @@
|
||||
|
||||
///\file "persistency/gdml/G02/.README.txt"
|
||||
///\brief Example G02 README page
|
||||
|
||||
/*! \page ExampleG02 Example G02
|
||||
|
||||
|
||||
\section G02_s1 EXAMPLE OF USE GDML READER/WRITER IN DETECTOR CONSTRUCTION
|
||||
|
||||
In this directory you can find a example showing how to use GDML module for
|
||||
reading and writing. It is also shown how to Read STEP Tools files.
|
||||
In this example the DetectorConstruction consists of a Simple Detector, then
|
||||
this Detector is filled/written in GDML.
|
||||
The different options for writing and reading GDML files are shown in the
|
||||
Detector Construction: writing modular files, using different schema location,
|
||||
setting parameters for names in GDML file, etc.
|
||||
For more information, please, refer to the GDML Documentation.
|
||||
|
||||
The Geometry is a Simple Detector Box with 4 Subdetectors.
|
||||
This setup shows how to use Reflection Factory, Assembly of Volumes and
|
||||
Parameterisation.
|
||||
Using commands or macros it possible to read or write GDML file.
|
||||
|
||||
\section G02_s2 HOW TO BUILD THE EXAMPLE ?
|
||||
|
||||
|
||||
- You need to have built the persistency/gdml module by having
|
||||
set the -DGEANT4_USE_GDML=ON flag during the CMAKE configuration step,
|
||||
as well as the -DXERCESC_ROOT_DIR=path_to_xercesc flag pointing to
|
||||
the path where the XercesC XML parser package is installed in your system.
|
||||
|
||||
- Compile and link to generate the executable (in your CMAKE build directory):
|
||||
\verbatim
|
||||
% make
|
||||
\endverbatim
|
||||
|
||||
- Execute the application:
|
||||
\verbatim
|
||||
% geotest [macro-file].mac
|
||||
\endverbatim
|
||||
|
||||
You can run this application with the following macro file:
|
||||
|
||||
- write_gdml.mac : This macro will write the Geometry defined in file
|
||||
"test.gdml" and output to a new file wtest.gdml
|
||||
To change this name you can use command :
|
||||
/mydet/writeFile FileName.gdml
|
||||
|
||||
- read_gdml.mac : This macro will read the Geometry from file "test.gdml"
|
||||
To change this name you can use command :
|
||||
/mydet/readFile FileName.gdml
|
||||
|
||||
- read_step.mac : This macro will read the STEP Tool files "mbb.geom" and
|
||||
"mbb.tree" and load them in memory.
|
||||
To change this name you can use command :
|
||||
/mydet/StepFile FileName
|
||||
*/
|
||||
@@ -0,0 +1,47 @@
|
||||
-------------------------------------------------------------------
|
||||
|
||||
Example of use GDML reader/writer in Detector Construction
|
||||
-----------------------------------------------------------
|
||||
|
||||
In this directory you can find a example showing how to use GDML module for
|
||||
reading and writing. It is also shown how to Read STEP Tools files.
|
||||
In this example the DetectorConstruction consists of a Simple Detector, then
|
||||
this Detector is filled/written in GDML.
|
||||
The different options for writing and reading GDML files are shown in the
|
||||
Detector Construction: writing modular files, using different schema location,
|
||||
setting parameters for names in GDML file, etc.
|
||||
For more information, please, refer to the GDML Documentation.
|
||||
|
||||
The Geometry is a Simple Detector Box with 4 Subdetectors.
|
||||
This setup shows how to use Reflection Factory, Assembly of Volumes and
|
||||
Parameterisation.
|
||||
Using commands or macros it possible to read or write GDML file.
|
||||
|
||||
HOW TO BUILD THE EXAMPLE ?
|
||||
|
||||
- You need to have built the persistency/gdml module by having
|
||||
set the -DGEANT4_USE_GDML=ON flag during the CMAKE configuration step,
|
||||
as well as the -DXERCESC_ROOT_DIR=<path_to_xercesc> flag pointing to
|
||||
the path where the XercesC XML parser package is installed in your system.
|
||||
|
||||
- Compile and link to generate the executable (in your CMAKE build directory):
|
||||
% make
|
||||
|
||||
- Execute the application:
|
||||
% geotest [macro-file].mac
|
||||
|
||||
You can run this application with the following macro file:
|
||||
|
||||
write_gdml.mac : This macro will write the Geometry defined in file
|
||||
"test.gdml" and output to a new file wtest.gdml
|
||||
To change this name you can use command :
|
||||
/mydet/writeFile FileName.gdml
|
||||
|
||||
read_gdml.mac : This macro will read the Geometry from file "test.gdml"
|
||||
To change this name you can use command :
|
||||
/mydet/readFile FileName.gdml
|
||||
|
||||
read_step.mac : This macro will read the STEP Tool files "mbb.geom" and
|
||||
"mbb.tree" and load them in memory.
|
||||
To change this name you can use command :
|
||||
/mydet/StepFile FileName
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
///\file "persistency/gdml/G03/.README.txt"
|
||||
///\brief Example G03 README page
|
||||
|
||||
/*! \page ExampleG03 Example G03
|
||||
|
||||
\section G03_s1 EXAMPLE OF DEFINITION OF A GDML EXTENSION WITH ASSOCIATED READER AND WRITER
|
||||
|
||||
|
||||
In this directory you can find an example showing how to extend the GDML
|
||||
schema and plug-in a custom reader and writer to the system for handling
|
||||
the extension.
|
||||
For more information, please, refer to the GDML Documentation.
|
||||
|
||||
The Geometry is a Simple Box to which it is assigned a color as
|
||||
visualization attribute.
|
||||
The entity "color" is defined as part of the "extension" tag and properly
|
||||
implemented in the GDML schema extension placed inside the directory
|
||||
SimpleExtensionSchema.
|
||||
The GDML file implenting the geometry with colors extension is
|
||||
color_extension.gdml, in which the standard "gdml" tag has been replaced
|
||||
by the "gdml_simple_extension" tag, with relative location for the new schema.
|
||||
The GDML file is automatically loaded by the program.
|
||||
It is also possible to use UI commands or macros as arguments to read any
|
||||
standard GDML file.
|
||||
|
||||
\section G03_s2 HOW TO BUILD THE EXAMPLE ?
|
||||
|
||||
- You need to have built the persistency/gdml module by having
|
||||
set the -DGEANT4_USE_GDML=ON flag during the CMAKE configuration step,
|
||||
as well as the -DXERCESC_ROOT_DIR=path_to_xercesc flag pointing to
|
||||
the path where the XercesC XML parser package is installed in your system.
|
||||
|
||||
- Compile and link to generate the executable (in your CMAKE build directory):
|
||||
\verbatim
|
||||
% make
|
||||
\endverbatim
|
||||
|
||||
- Execute the application for reading and visualizing the setup:
|
||||
\verbatim
|
||||
% gdml_ext read_ext.mac
|
||||
\endverbatim
|
||||
|
||||
- Execute the application for also writing the setup:
|
||||
\verbatim
|
||||
% gdml_ext [write_ext.mac]
|
||||
\endverbatim
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,37 @@
|
||||
-------------------------------------------------------------------
|
||||
|
||||
Example of definition of a GDML extension with associated reader and writer
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
In this directory you can find an example showing how to extend the GDML
|
||||
schema and plug-in a custom reader and writer to the system for handling
|
||||
the extension.
|
||||
For more information, please, refer to the GDML Documentation.
|
||||
|
||||
The Geometry is a Simple Box to which it is assigned a color as
|
||||
visualization attribute.
|
||||
The entity "color" is defined as part of the "extension" tag and properly
|
||||
implemented in the GDML schema extension placed inside the directory
|
||||
SimpleExtensionSchema.
|
||||
The GDML file implenting the geometry with colors extension is
|
||||
color_extension.gdml, in which the standard "gdml" tag has been replaced
|
||||
by the "gdml_simple_extension" tag, with relative location for the new schema.
|
||||
The GDML file is automatically loaded by the program.
|
||||
It is also possible to use UI commands or macros as arguments to read any
|
||||
standard GDML file.
|
||||
|
||||
HOW TO BUILD THE EXAMPLE ?
|
||||
|
||||
- You need to have built the persistency/gdml module by having
|
||||
set the -DGEANT4_USE_GDML=ON flag during the CMAKE configuration step,
|
||||
as well as the -DXERCESC_ROOT_DIR=<path_to_xercesc> flag pointing to
|
||||
the path where the XercesC XML parser package is installed in your system.
|
||||
|
||||
- Compile and link to generate the executable (in your CMAKE build directory):
|
||||
% make
|
||||
|
||||
- Execute the application for reading and visualizing the setup:
|
||||
% gdml_ext read_ext.mac
|
||||
|
||||
- Execute the application for also writing the setup:
|
||||
% gdml_ext [write_ext.mac]
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
///\file "persistency/gdml/G04/.README.txt"
|
||||
///\brief Example G04 README page
|
||||
|
||||
/*! \page ExampleG04 Example G04
|
||||
|
||||
|
||||
\section G04_s1 GDML DETECTOR SENSITIVITY
|
||||
|
||||
This example demonstrates the usage of the GDML auxiliary information for
|
||||
associating a sensitive detector to a volume.
|
||||
|
||||
The detector construction consists of a call to GDMLProcessor which parses a
|
||||
GDML file and returns the pointer to the world volume. The user can also write
|
||||
her/his own GDML file and use it as the primary input format for her/his Geant4
|
||||
application.
|
||||
|
||||
A simple GDML files is provided:
|
||||
- auxiliary.gdml, showing association of a volume with the auxiliary
|
||||
information, related to the sensitive detector.
|
||||
|
||||
\section G04_s2 HOW TO BUILD THE EXAMPLE ?
|
||||
|
||||
- You need to have built the persistency/gdml module by having
|
||||
set the -DGEANT4_USE_GDML=ON flag during the CMAKE configuration step,
|
||||
as well as the -DXERCESC_ROOT_DIR=path_to_xercesc flag pointing to
|
||||
the path where the XercesC XML parser package is installed in your system.
|
||||
|
||||
- Compile and link to generate the executable (in your CMAKE build directory):
|
||||
\verbatim
|
||||
% make
|
||||
\endverbatim
|
||||
|
||||
- Execute the application for parsing interactively the GDML file:
|
||||
\verbatim
|
||||
% gdml_det auxiliary.gdml
|
||||
\endverbatim
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,34 @@
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
GDML detector sensitivity
|
||||
-------------------------
|
||||
|
||||
This example demonstrates the usage of the GDML auxiliary information for
|
||||
associating a sensitive detector to a volume.
|
||||
|
||||
The detector construction consists of a call to GDMLProcessor which parses a
|
||||
GDML file and returns the pointer to the world volume. The user can also write
|
||||
her/his own GDML file and use it as the primary input format for her/his Geant4
|
||||
application.
|
||||
|
||||
A simple GDML files is provided:
|
||||
- auxiliary.gdml, showing association of a volume with the auxiliary
|
||||
information, related to the sensitive detector.
|
||||
|
||||
HOW TO BUILD THE EXAMPLE ?
|
||||
|
||||
- You need to have built the persistency/gdml module by having
|
||||
set the -DGEANT4_USE_GDML=ON flag during the CMAKE configuration step,
|
||||
as well as the -DXERCESC_ROOT_DIR=<path_to_xercesc> flag pointing to
|
||||
the path where the XercesC XML parser package is installed in your system.
|
||||
|
||||
- Compile and link to generate the executable (in your CMAKE build directory):
|
||||
% make
|
||||
|
||||
- Execute the application.
|
||||
o For parsing interactively the GDML file:
|
||||
% gdml_det auxiliary.gdml
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
Geant4 GDML Examples
|
||||
====================
|
||||
|
||||
This directory contains a set of examples showing the usage of the GDML
|
||||
plugin module in Geant4.
|
||||
|
||||
G01 Simple example for importing and exporting simple GDML files.
|
||||
G02 Sample application showing how to import/export different
|
||||
geometry setups, including STEP Tools files and structures
|
||||
integrating them in a real simulation application.
|
||||
G03 Simple example showing how to import extensions to the GDML
|
||||
schema.
|
||||
G04 Simple example showing how to associate detector sensitivity
|
||||
to a logical-volume, making use of the auxiliary-information.
|
||||
|
||||
See the README file inside each example for more detail.
|
||||
Reference in New Issue
Block a user