Import Geant4 7.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 12:11:21 +02:00
parent 516dbf1a58
commit d93e1e39a9
5384 changed files with 125662 additions and 82444 deletions
+30 -327
View File
@@ -1,4 +1,4 @@
$Id: README,v 1.11 2001/11/13 07:06:01 stanaka Exp $
$Id: README,v 1.12 2005/02/15 14:08:11 johna Exp $
Note: Specific graphics systems must be instantiated in a high level
library to avoid circular dependencies. Also, some specifically need
@@ -9,15 +9,15 @@ RegisterGraphicsSystems() cannot be called from G4VisManager's
constructor; it is called from G4VisManager::Initialise(). So we ask
the user:
(a) to write a subclass of G4VisManager and implement
RegisterGraphicsSystems(). See
visualization/include/MyVisManager.hh/cc as an example.
RegisterGraphicsSystems(). This is most easily done by
including G4VisExecutive.hh.
(b) instantiate the subclass.
(c) invoke the Initialise() method of the subclass.
For example, in your main():
...
#ifdef G4VIS_USE
// Instantiate and initialise Visualization Manager.
G4VisManager* visManager = new MyVisManager;
G4VisManager* visManager = new G4VisExecutive;
visManager -> SetVerboseLevel (Verbose);
visManager -> Initialise ();
#endif
@@ -26,7 +26,7 @@ For example, in your main():
See, for example, examples/novices/N02/exampleN02.cc.
1) Decide which graphics systems drivers you want. By default you get:
ASCIITree, DAWNFILE, GAGTree, HepRepFile, RayTracer, VRMLFILE.
ASCIITree, DAWNFILE, GAGTree, HepRepFile, HepRepXML, RayTracer, VRMLFILE.
For others, the choice depends on what graphics libraries you have
access to. Set the appropriate environment variables. Here are
@@ -36,8 +36,6 @@ See, for example, examples/novices/N02/exampleN02.cc.
# with network connection
# (for remote visualization)
setenv G4VIS_BUILD_OPACS_DRIVER 1 # Uses OPACS graphics libraries
setenv G4VIS_BUILD_OPENGLX_DRIVER 1 # Uses OpenGL libraries
setenv G4VIS_BUILD_OPENGLXM_DRIVER 1 # Uses OpenGL and Motif
# libraries
@@ -57,11 +55,11 @@ See, for example, examples/novices/N02/exampleN02.cc.
setenv DAWN_HOME /user/local/bin
set path=( $path $DAWN_HOME )
setenv OPACS_HOME ~/private/GEANT4/OPACS
setenv OGLHOME /usr/local
setenv OGLFLAGS "-I$(OGLHOME)/include"
setenv OGLLIBS "-L$OGLHOME/lib -lMesaGLU -lMesaGL"
setenv OIVHOME /usr/local
If you are going to use widgets, then you might need to set the
environment variable:
@@ -90,7 +88,8 @@ See, for example, examples/novices/N02/exampleN02.cc.
*******************************************************************
NOTE THAT IF YOU CHANGE ANY OF THE ABOVE ENVIRONMENT VARIABLES THEN
YOU WILL HAVE TO REPEAT THE ABOVE OPERATIONS.
YOU WILL HAVE TO REPEAT THE ABOVE OPERATIONS, INCLUDING REBUILDING
THE LIBRARY MAP.
*******************************************************************
@@ -102,7 +101,6 @@ See, for example, examples/novices/N02/exampleN02.cc.
installed in (1,2) above. Here are the current possibilities:
setenv G4VIS_USE_DAWN 1
setenv G4VIS_USE_OPACS 1
setenv G4VIS_USE_OPENGLX 1
setenv G4VIS_USE_OPENGLXM 1
setenv G4VIS_USE_OIX 1
@@ -114,7 +112,7 @@ See, for example, examples/novices/N02/exampleN02.cc.
examples/novices/N02/exampleN02.cc to see a use of this.
The graphics systems are instantiated and registered when you
execute MyVisManager::Initialise() (or MyVisManager::Initialize()).
execute G4VisExecutive::Initialise() (or G4VisExecutive::Initialize()).
Note also that you can register graphics systems directly, e.g.,
pVisManager->RegisterGraphicsSystem ( new DAWNFILE ). You can also
register your own graphics system, e.g.,
@@ -134,9 +132,9 @@ See, for example, examples/novices/N02/exampleN02.cc.
*******************************************************************
NOTE THAT IF YOU CHANGE ANY OF THE ABOVE ENVIRONMENT VARIABLES THEN
YOU WILL HAVE TO REPEAT THE ABOVE gmake clean AND gmake COMMANDS, OR
AT THE VERY LEAST, RECOMPILE YOUR MAIN PROGRAM AND YOUR DERIVED VIS
MANAGER CLASS, E.G.,
touch myprog.cc; touch src/MyVisManager.cc; gmake
AT THE VERY LEAST, RECOMPILE YOUR PROGRAM THAT INCLUDES G4VisExecutive.hh,
E.G.,
touch myprog.cc; gmake
*******************************************************************
@@ -200,18 +198,6 @@ export DAWN_GUI_ALWAYS=1
#export G4DAWNFILE_VIEWER=NONE # Uncomment if DAWN is not available.
#export PATH=$PATH:$DAWN_HOME # Now in /usr/local.
########## OPACS graphics
export G4VIS_BUILD_OPACS_DRIVER=1
export G4VIS_USE_OPACS=1
export OPACS_HOME=$disc2/OPACS
export OPACS_VERSION=v3
export OPACS_SYSTEM=Linux-gxx
export OCONFIG=Linux
. $OPACS_HOME/OPACS/$OPACS_VERSION/setup.sh
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$disc2/HEPVis/new/Linux-gxx-SF/
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$disc2/SoFree/new/Linux-gxx
OPATH="$OPATH $G4INSTALL/source/visualization/test/OPACS"
########### OpenGL
export G4VIS_BUILD_OPENGLX_DRIVER=1
export G4VIS_USE_OPENGLX=1
@@ -237,8 +223,6 @@ export G4UI_USE_TERMINAL=1
export G4UI_BUILD_GAG_SESSION=1
export G4UI_USE_GAG=1
export G4UI_BUILD_XM_SESSION=1
export G4UI_USE_XM=1
export G4UI_BUILD_WO_SESSION=1
export G4UI_USE_WO=1
### #export G4UI_BUILD_XAW_SESSION=1
### #export G4UI_USE_XAW=1
@@ -258,329 +242,48 @@ fi
Appendix B: Sample session
--------------------------
The Visualization Manager has been constructed with verbosity == 1.
The Visualization Manager has been constructed with verbosity == c
(confirmations).
$ test19 tcsh 1
RunManager is constructing....
**********************************************
Geant4 version $Name: geant4-07-00-cand-01 $
(29-Jun-2001)
Copyright : Geant4 Collaboration
**********************************************
conv: Total cross sections from a parametrisation. Good description from 1.5 MeV to 100 GeV for all Z.
e+e- energies according Bethe-Heitler
PhysicsTables from 1.022 MeV to 100 GeV in 100 bins.
...
Constructing Visualization Manager....
Initialising Visualization Manager....
The following graphics systems drivers are supported in the GEANT4 distribution:
*************************************************************
Geant4 version $Name: geant4-07-01 $ (17-December-2004)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
*************************************************************
ASCIITree (prints geometry hierarchy)
DAWN (socket connection to the Fukui Renderer DAWN) High quality technical renderer.
Features: exact hidden line, hidden surface algorithms.
high (unlimited) resolution.
renders to PostScript for viewing and/or hardcopy.
remote rendering.
off-line rendering.
graphical user interface.
Disadvantages: compute intensive, takes time (use a fast graphics
system, such as OpenGL, to select view, then copy
to this renderer - /vis~/copy/view, /vis~/set/view).
DAWNFILE (file connection to the Fukui Renderer DAWN ) High quality technical renderer.
Features: exact hidden line, hidden surface algorithms.
high (unlimited) resolution.
renders to PostScript for viewing and/or hardcopy.
remote rendering.
off-line rendering.
graphical user interface.
connection via g4.prim file to Fukui Renderer DAWN etc.
Disadvantages: compute intensive, takes time (use a fast graphics
system, such as OpenGL, to select view, then copy
view parameters to this renderer:
"/vis/viewer/set/all <OpenGL-view>".
GAGTree (prints geometry hierarchy, connectable to GAG
user interface)
OPACS (the Orsay Package)
OpenGLIX (direct/immediate drawing on X Windows)
Dumb single buffered X Window, No Graphics Database.
Advantages: does not gobble server memory.
good for drawing steps and hits.
Disadvantages: needs G4 kernel for re-Draw.
cannot take advantage of graphics accelerators.
OpenGLSX (display List/stored drawing on X Windows)
Dumb double buffered X Window with Graphics Database.
Advantages: uses display lists as graphics database.
fastest possible redraw, e.g., on simple change
of viewpoint.
uses client-server model for remote viewing
(but only if you have a full client-server
implementation of OpenGL, i.e., not Mesa).
Disadvantages: not advised for viewing large numbers of steps
and/or hits, because it gobbles memory for database.
OpenGLIXm (with Motif widgets)
Smart single buffered X Window, No Graphics Database.
Advantages: resizeable, and has Motif-based view-control panel.
does not gobble server memory.
good for drawing steps and hits.
Disadvantages: currently locks out GEANT4 commands, until "exit".
needs G4 kernel for re-Draw.
cannot take advantage of graphics accelerators.
OpenGLSXm (with Motif widgets)
Smart double buffered X Window with Graphics Database.
Advantages: resizeable, and has Motif-based view-control panel.
uses display lists as graphics database.
fastest possible redraw, e.g., on simple change
of viewpoint.
uses client-server model for remote viewing
(but only if you have a full client-server
implementation of OpenGL, i.e., not Mesa).
Disadvantages: currently locks out GEANT4 commands, until "exit".
not advised for viewing large numbers of steps
and/or hits, because it gobbles memory for database.
Open Inventor Open Inventor Window/View/Scene.
Advantages: Open Inventor feature set (interactivity, scene control).
Disadvantages: Requires Open Inventor license ($$), Hepvis library (Free).
RayTracer (produces JPEG file)
VRML1 (produces VRML 1 file over network)
VRML1FILE (produces VRML 1 file locally )
VRML2 (produces VRML 2 file over network)
VRML2FILE (produces VRML 2 file locally )
The following graphics systems drivers are installed on your system:
ASCII Tree (produces ASCII file of geometry hierarchy)
DAWN (socket connection to the Fukui Renderer DAWN)
DAWNFILE (file connection to the Fukui Renderer DAWN)
GAG Tree (produces ascii file of geometry hierarchy for GAG)
OPACS (the Orsay Package)
OpenGLIX (direct/immediate drawing on X Windows)
OpenGLSX (display List/stored drawing on X Windows)
OpenGLIXm (with Motif widgets)
OpenGLSXm (with Motif widgets)
Open Inventor X11
RayTracer (produces JPEG file)
VRML1 (produces VRML 1 file over network)
VRML2 (produces VRML 2 file over network)
VRML1FILE (produces VRML 1 file locally)
VRML2FILE (produces VRML 2 file locally)
You have instantiated your own Visualization Manager, inheriting
G4VisManager and implementing RegisterGraphicsSystems(), in which
you should, normally, instantiate drivers which do not need
external packages or libraries, namely:
ASCIITree, DAWNFILE, GAGTree, RayTracer, VRMLFILE
and, optionally, drivers under control of the following
environment variables:
G4VIS_USE_DAWN
G4VIS_USE_OPACS
G4VIS_USE_OPENGLX
G4VIS_USE_OPENGLXM
G4VIS_USE_OIX
G4VIS_USE_VRML
See visualization/include/MyVisManager.hh/cc, for example.
In your main() you will have something like:
#ifdef G4VIS_USE
G4VisManager* visManager = new MyVisManager;
visManager -> SetVerboseLevel (Verbose);
visManager -> Initialize ();
#endif
(Don't forget to delete visManager;)
Registering additional graphics systems....
Visualization Manager instantiating...
Visualization Manager initialising...
Registering graphics systems...
G4VisManager::RegisterGraphicsSystem: ASCIITree (ATree) registered.
G4VisManager::RegisterGraphicsSystem: DAWNFILE (DAWNFILE) registered.
G4VisManager::RegisterGraphicsSystem: GAGTree (GAGTree) registered.
G4VisManager::RegisterGraphicsSystem: G4HepRep (HepRepXML) registered.
G4VisManager::RegisterGraphicsSystem: G4HepRepFile (HepRepFile) registered.
G4VisManager::RegisterGraphicsSystem: RayTracer (RayTracer) registered.
G4VisManager::RegisterGraphicsSystem: VRML1FILE (VRML1FILE) registered.
G4VisManager::RegisterGraphicsSystem: VRML2FILE (VRML2FILE) registered.
G4VisManager::RegisterGraphicsSystem: FukuiRenderer (DAWN) registered.
G4VisManager::RegisterGraphicsSystem: Wo registered.
G4VisManager::RegisterGraphicsSystem: Xo registered.
G4VisManager::RegisterGraphicsSystem: OpenGLImmediateX (OGLIX) registered.
G4VisManager::RegisterGraphicsSystem: OpenGLStoredX (OGLSX) registered.
G4VisManager::RegisterGraphicsSystem: OpenGLImmediateXm (OGLIXm) registered.
G4VisManager::RegisterGraphicsSystem: OpenGLStoredXm (OGLSXm) registered.
G4VisManager::RegisterGraphicsSystem: OpenInventorX (OIX) registered.
G4VisManager::RegisterGraphicsSystem: VRML1 (VRML1) registered.
G4VisManager::RegisterGraphicsSystem: VRML2 (VRML2) registered.
G4VisManager::RegisterGraphicsSystem: OpenInventorXt (OIX) registered.
You have successfully chosen to use the following graphics systems.
Current available graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
GAGTree (GAGTree)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
FukuiRenderer (DAWN)
Wo
Xo
OpenGLImmediateX (OGLIX)
OpenGLStoredX (OGLSX)
OpenGLImmediateXm (OGLIXm)
OpenGLStoredXm (OGLSXm)
OpenInventorX (OIX)
VRML1 (VRML1)
VRML2 (VRML2)
Reading test19.g4m file....
# This is test19.g4m
#
# Switch on echoing of commands and history mechanism.
#
/control/saveHistory
#
# John's personal preferences
/vis/viewer/set/lightsMove true
G4VisCommandsViewerSet::SetNewValue: no current viewer.
/vis/viewer/set/hiddenMarker true
G4VisCommandsViewerSet::SetNewValue: no current viewer.
#/vis/verbose 10
#
# See list of detector possibilities.
/test19det/detector
Available detectors:
0) Part of original test calorimeter
1) Example1 (LBNO, no rotation)
2) Example2 (embryo LBNO, rotated volumes)
3) A parametrised volume
4) MyDetector
Choose by specifying integer parameter.
# Select detector.
#/test19det/detector 1
#/test19det/detector 4
#
# Initialise run, i.e., create geometry, set cuts, etc.
/run/initialize
#
# Set gun for demo (detector 1)
#/gun/particle e+
#/gun/position 0 -100 0 cm
#/gun/direction 0 1 0
#
# for drawing the tracks
/tracking/storeTrajectory 1
# if too many tracks cause core dump =storeTrajectory 0
#
# Create empty scene.
/vis/scene/create
/vis/scene/notifyHandlers
G4Scene::AddWorldIfEmpty: The scene was empty,
"world" has been added.
New empty scene "scene-0" created.
#
# Add volume to scene - "world" is default.
/vis/scene/add/volume
G4Scene::AddRunDurationModel: model "G4PhysicalVolumeModel expHall_P.0"
is already in the run-duration list of scene "scene-0".
/vis/scene/notifyHandlers
#
# See list of graphics systems possibilities.
help /vis/sceneHandler/create
#
# Create a scene handler for a specific graphics system.
# Edit the next line(s) to choose another graphic system
#/vis/sceneHandler/create DAWNFILE
#/vis/sceneHandler/create DAWN
#/vis/sceneHandler/create OGLIXm
#/vis/sceneHandler/create OGLSXm
#/vis/sceneHandler/create OGLIX
/vis/sceneHandler/create OGLSX
G4VisManager::SetCurrentGraphicsSystem: system now OpenGLStoredX
Graphics system set to OpenGLStoredX
1 OpenGLStoredX scene handlers extanct.
New scene handler "scene-handler-0" created.
/vis/sceneHandler/attach
Scene "scene-0" attached to scene handler "scene-handler-0.
#/vis/sceneHandler/create VRML1
#/vis/sceneHandler/create VRML1FILE
#/vis/sceneHandler/create Xo
#/vis/sceneHandler/create Wo
#
# Add world volume.
/vis/scene/add/volume
G4Scene::AddRunDurationModel: model "G4PhysicalVolumeModel expHall_P.0"
is already in the run-duration list of scene "scene-0".
/vis/scene/notifyHandlers
/vis/scene/add/axes 0 0 0 2 m
/vis/scene/notifyHandlers
Axes have been added to scene "scene-0".
/vis/scene/add/text 0 0 0 mm 50 -120 -200 exampleN03
/vis/scene/notifyHandlers
Text "exampleN03" has been added to scene "scene-0".
#
# Add scale
/vis/scene/add/scale
/vis/scene/notifyHandlers
Scale of 1 m has been added to scene "scene-0".
#
# Create a viewer.
/vis/viewer/create
Got standard cmap
Window name: viewer-0 (OpenGLStoredX)
G4VisManager::CreateViewer: new viewer created: view parameters are:
View parameters and options:
Drawing style: wireframe
Representation style: polyhedron
Culling: on
Culling invisible objects: on
Density culling: off
Culling daughters covered by opaque mothers: off
Section flag: false
Cutaway flag: false
Explode flag: false
No. of sides used in circle polygon approximation: 24
Viewpoint direction: (0,0,1)
Up vector: (0,1,0)
Field half angle: 0
Zoom factor: 1
Current target point: (0,0,0)
Dolly distance: 0
Light does not move with camera
Relative lightpoint direction: (1,1,1)
Actual lightpoint direction: (1,1,1)
Derived parameters for standard view of object of unit radius:
Camera distance: 1
Near distance: 1e-06
Far distance: 2
Front half height: 1
View geometry: true
View hits : true
View digits : true
Default VisAttributes:
G4VisAttributes: visible, daughters visible, colour: (1,1,1,1)
linestyle: solid, line width: 1
drawing style unforced
Default TextVisAttributes:
G4VisAttributes: visible, daughters visible, colour: (0,0,1,1)
linestyle: solid, line width: 1
drawing style unforced
Default marker: G4VMarker: position: (0,0,0), world size: 0, screen size: 5
fill style: no fill
No Visualization Attributes
Global marker scale: 1
Marker not hidden by surfaces.
Window size hint: 600x600
Auto refresh: false
NOTE: objects with visibility flag set to "false" will not be drawn!
"/vis/set/culling off" to Draw such objects.
Also see other "/vis/set" commands.
New viewer "viewer-0 (OpenGLStoredX)" created.
#
/vis/viewer/set/lineSegmentsPerCircle 100
Number of line segements per circle in polygon approximation is 100
/vis/viewer/refresh
Refreshing viewer "viewer-0 (OpenGLStoredX)"...
OpenInventorXt (OIX)
...