191 lines
6.0 KiB
Plaintext
191 lines
6.0 KiB
Plaintext
$Id: README,v 1.10 2002/11/14 16:33:48 santin Exp $
|
|
-------------------------------------------------------------------
|
|
|
|
=========================================================
|
|
Geant4 - X-Ray Telescope Example
|
|
=========================================================
|
|
|
|
|
|
NEW: Nov 2002: Migration to AIDA 3.0 - see below
|
|
|
|
|
|
Introduction
|
|
------------
|
|
XrayTel is an advanced Geant4 example based on a realistic simulation of
|
|
an X-ray Telescope. It is based on work carried out by a team of Geant4
|
|
experts to simulate the interaction between X-ray Telescopes XMM-Newton
|
|
and Chandra with low energy protons present in the orbital radiation
|
|
background. The X-ray mirrors are designed to collect x-ray photons at
|
|
grazing-incidence angles and focus them onto detectors at the focal plane.
|
|
However, this mechanism also seems to work for low energy protons which,
|
|
if they reach the detectors in sufficient numbers, can cause damage.
|
|
In this example, the geometry has been simplified by using a single mirror
|
|
shell and no baffles, but all the dimensions and materials are realistic.
|
|
|
|
The aim of this advanced example is to illustrate the use advanced
|
|
GUI, visualisation, particle generation and analysis schemes available
|
|
in Geant4:
|
|
|
|
- the simulation can be run from GAG or the command prompt
|
|
|
|
- macros are provided to display the geometry and particle tracks with
|
|
OpenGL, DAWN Postscript or VRML visualisation
|
|
|
|
- the generation of particles is done via the new General Particle Source
|
|
|
|
- histograming facilities are available through the AIDA 3.0 interfaces.
|
|
|
|
- on-line visualisation of histograms is provided through the AIDA 3.0 interface.
|
|
|
|
In order to be able to use any of these packages, prior installation is
|
|
necessary and a number of environment variables will have to be set.
|
|
|
|
|
|
1. Setting up the environment variables for GAG, Visualisation and
|
|
Analysis options (example based on Linux at CERN)
|
|
|
|
#set up GAG
|
|
setenv G4UI_BUILD_GAG_SESSION 1
|
|
setenv G4UI_USE_GAG 1
|
|
|
|
#set up VRMLview
|
|
setenv G4VIS_BUILD_VRMLFILE_DRIVER 1
|
|
setenv G4VIS_USE_VRML 1
|
|
setenv G4VIS_USE_VRMLFILE 1
|
|
setenv G4VRMLFILE_MAX_FILE_NUM 100
|
|
setenv G4VRMLFILE_VIEWER vrmlview #if installed
|
|
setenv G4VIS_USE_VRML 1
|
|
setenv G4VIS_USE_VRMLFILE 1
|
|
setenv PATH ${PATH}:"/afs/cern.ch/sw/contrib/VRML/bin/Linux"
|
|
|
|
#set up OpenGL or Mesa
|
|
setenv G4VIS_BUILD_OPENGLX_DRIVER 1
|
|
setenv G4VIS_USE_OPENGLX 1
|
|
setenv OGLHOME /afs/cern.ch/sw/geant4/dev/Mesa/Linux-g++
|
|
|
|
#set up DAWN
|
|
setenv G4VIS_BUILD_DAWN_DRIVER 1
|
|
setenv G4VIS_BUILD_DAWNFILE_DRIVER 1
|
|
setenv G4VIS_USE_DAWN 1
|
|
setenv G4VIS_USE_DAWNFILE 1
|
|
setenv PATH ${PATH}:"/afs/cern.ch/sw/geant4/dev/DAWN/Linux-g++"
|
|
|
|
NOTE: The geometry is refreshed on the viewer at the beginning of each run,
|
|
but the tracks are plotted only in case an interesting event occurs.
|
|
This is the case only for about 1 every 10**4 events.
|
|
|
|
|
|
|
|
Analysis
|
|
--------
|
|
Set up for the AIDA 3.0 interface:
|
|
In case the variable G4ANALYSIS_USE is set:
|
|
setenv G4ANALYSIS_USE 1
|
|
relevant information from the simulation is processed in the XrayTelAnalysis class and
|
|
saved, through the AIDA interface, to Histograms and Tuples.
|
|
Compilation and link flags to hook any AIDA compliant system
|
|
are passed to the Geant4 GNUmakefile system by using the "aida-config" tool
|
|
that should come with any AIDA compliant system. Specifically in the GNUmakefile you find the 2 lines
|
|
CPPFLAGS += `aida-config --include`
|
|
LDFLAGS += `aida-config --lib`
|
|
|
|
|
|
|
|
On-line plotting
|
|
----------------
|
|
Set-up for the AIDA 3.0 interface:
|
|
In case the variable G4ANALYSIS_USE_PLOTTER is set:
|
|
setenv G4ANALYSIS_USE_PLOTTER 1
|
|
a new window is opened for on-line plotting.
|
|
NOTE: The histograms are plotted or refreshed only in case an interesting event occurs.
|
|
This is the case only for about 1 every 10**4 events.
|
|
|
|
|
|
You may need to add the AIDA tool path to your run-time library path
|
|
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:`aida-config -r`
|
|
|
|
|
|
|
|
|
|
IMPORTANT WARNING!
|
|
setenv G4ANALYSIS_BUILD 1
|
|
must always be set to build the example even if the analysis option
|
|
is not required
|
|
|
|
|
|
Sources
|
|
-------
|
|
|
|
GAG can be obtained from
|
|
|
|
http://erpc1.naruto-u.ac.jp/~geant4/
|
|
|
|
OpenGL Mesa needs to be installed prior to building Geant4 and can be
|
|
downloaded from
|
|
|
|
http://www.mesa3d.org/download.html
|
|
|
|
DAWN can be obtained from
|
|
|
|
http://133.7.51.8/dawn/
|
|
|
|
VRMLview for Linux can be obtained from
|
|
|
|
|
|
|
|
2. Run
|
|
To execute a sample simulation with visualisation of proton tracks
|
|
reaching the detector run:
|
|
|
|
XrayTel
|
|
|
|
execute command "/control/execute xxxxx.mac"
|
|
|
|
visualisation macros provided are
|
|
- opengl.mac for OpenGL display
|
|
- vrml.mac for VRML display and output file
|
|
- dawn.mac for dawn display and PS output file
|
|
|
|
You may need to add some paths to your run-time libraries env. variable,
|
|
for example:
|
|
$ setenv LD_LIBRARY_PATH $OGLHOME/lib
|
|
|
|
To execute a run without visualisation use
|
|
- test.mac
|
|
|
|
|
|
If the analysis options are set, histograming windows will
|
|
automatically open and the corresponding files will be created.
|
|
A 1D histogram will display the energy distribution of the protons
|
|
that reach the detector at the end of the run.
|
|
|
|
3. Detector description
|
|
|
|
The telescope and detector geometry is defined in
|
|
XrayTelDetectorConstruction.cc
|
|
|
|
4. Physics processes
|
|
|
|
The physics processes are in XrayTelPhysicsList.cc
|
|
The main process in this example is MultipleScattering of the protons
|
|
on the mirror surfaces.
|
|
|
|
5. Event generation
|
|
|
|
This is done using the new General Particle Source. Documentation for
|
|
this can be found in
|
|
|
|
http://www.space.qinetiq.com/geant4/gspm.html
|
|
|
|
6. Analysis
|
|
|
|
Presently, the Anaphe tool (http://www.cern.ch/anaphe)
|
|
(version 5) provides an implementation of AIDA 3.0,
|
|
other packages as JAS will follow soon.
|
|
|
|
To build and execute the example on platforms where there is no
|
|
implementation of the analysis system, the environment variables
|
|
must not be set, except for G4ANALYSIS_BUILD which is required for
|
|
building the executable.
|
|
|