Monte Carlo Simulation


Home

 

Submit a document (or a link to it)

 

Acronyms

MCSWG = NUSTAR Monte Carlo Simulation Working Group

NDWG = Neutron Detector Working Group

 

Minutes of the MCSWG meeting, Valencia 19th of February 2007

Presentation of the NDWG to the Valencia meeting

School on Monte Carlo simulation with GEANT 4

 

 

Installation guide for the CLHEP and Geant4 packages on a linux machine running Scientific Linux

 

1. Installation of CLHEP

 

Download from the CLHEP homepage and untar/gunzip the clhep source file (clhep-2.0.3.1.tgz in our case)

$> tar -zxvf clhep-X.X.X.X.tgz

Go to the CLHEP directory

$> cd ./2.0.3.1/CLHEP

Red the installation instructions

$> more INSTALL

and follow them

$ cd <build_directory>
 

$> <source_code_direcotry>/configure --prefix=<install_dir>
(Note that files will be installed under /usr/local if you do not specify a prefix.)
 

$> make
(Build temporary copies of libraries and executables.)
 

$> make check
(Run the tests.)
 

$> make install
(Copy libraries, headers, executables, etc. to relevant subdirectories under <install_dir>.)

 

and add the following line to your .basrh file or equivalent if running on a different shell

 

export CLHEP_BASE_DIR=<install_dir>

 

2. Installation of GEANT4

 

Create your geant directory wherever you like. In our case it is called geant4

 

Download there the GEANT4 source files from the GEANT4 download area. The latest version at the time when these instructions were written was

Create a directory called data under your geant4 directory

 

$> mkdir data

 

And download there the data files (various tabulated cross sections, gamma production data...) from the GEANT4 download area.

untar and unzip the geant data files. The following directories should appear (under the data directory)

 

./geant4/data/G4EMLOW4.2
./geant4/data/G4NDL3.10
./geant4/data/PhotonEvaporation2.0
./geant4/data/RadioactiveDecay3.1

 

If no errors appeared you can remove the tar files.

 

Add the following lines to your .bashrc file or equivalent if running on a different shell

 

# G4 definitions

export G4INSTALL=<home_dir>/geant4/geant4.8.2/
export G4SYSTEM=Linux-g++
export G4LIB_BUILD_STATIC=1
export G4LIB_USE_GRANULAR=1
 

# G4UI
export G4UI_BUILD_TERMINAL_SESSION=1
export G4UI_BUILD_XAW_SESSION=1
 

# Visualisation
export G4VIS_BUILD_OPENGLX_DRIVER=0
export G4VIS_BUILD_DAWNFILE_DRIVER=0
 

# Location of your graphics libraries

export OGLHOME=/usr/X11R6/
 

# DATA LIBRARIES
export G4LEVELGAMMADATA=<home_dir>/geant4/data/PhotonEvaporation2.0
export G4RADIOACTIVEDATA=<home_dir>/geant4/data/RadiativeDecay3.1
export G4LEDATA=<home_dir>/geant4/data/G4EMLOW4.2
export NeutronHPCrossSections=<home_dir>/geant4/data/G4NDL3.10

 

Source your .bashrc fuile, go to your $G4INSTALL directory and type

 

$> ./Configure -h

 

for help and

 

$> ./Configure -install

 

for starting the installation

 

You will be asked to answer some questions. Here is what I did for the current installation

 

Would you like to see the instructions? [n] The answer is n or default (just pressing Enter)

 

1) OS : Linux
2) Compiler : g++
To modify default settings, select number above (e.g. 2)
[Press [Enter] for default settings]
The answer is default

 

Do you expect to run these scripts and binaries on multiple machines? [n] The answer is n or default

 

Where is Geant4 source installed? Please check if the directory shown is correct. The answer is default.
 

Specify the path where Geant4 libraries and source files should be installed. Please check if the directory shown is correct. The answer is default.

 

Do you want to copy all Geant4 headers in one directory? [n] The answer is n or default

 

Attention!!! Please verify that the following directories are set properly. If not, the simulations will not work properly!

Please, specify default directory where ALL the Geant4 data is installed:

G4LEVELGAMMADATA:
G4RADIOACTIVEDATA:
G4LEDATA:
NeutronHPCrossSections:


You will be asked about customizing these next.
[ directory ]
Here I had to change it to the proper directory in my machine. The script wanted to place it elsewhere

 

 Please, specify default directory where the Geant4 data is installed:
1) G4LEVELGAMMADATA: <home_dir>/geant4/data/PhotonEvaporation2.0
2) G4RADIOACTIVEDATA: <home_dir>/geant4/data/RadioactiveDecay3.1
3) G4LEDATA: <home_dir>/geant4/data/G4EMLOW4.2
4) NeutronHPCrossSections: <home_dir>/geant4/data/G4NDL3.1
To modify default settings, select number above (e.g. 2)
[Press [Enter] for default settings]
 The answer was default

 

Could not find CLHEP installed on this system!
Please, specify where CLHEP is installed:
CLHEP_BASE_DIR:
Type in the value defined in Section 1. Installation of CLHEP of the current installation guide

 

You can customize paths and library name of you CLHEP installation:

1) CLHEP_INCLUDE_DIR: /afs/ciemat.es/users/mcgeant4/CLHEP2.0.3.1/include
2) CLHEP_LIB_DIR: /afs/ciemat.es/users/mcgeant4/CLHEP2.0.3.1/lib
3) CLHEP_LIB: CLHEP
To modify default settings, select number above (e.g. 2)
[Press [Enter] for default settings]
Please check if the directories shown are correct. The answer was default

 

Do you want to build 'shared' (.so) libraries? [n] The answer was n or default

 

Do you want to build 'global' compound libraries? [n]  The answer was n or default

 

Do you want to compile libraries in DEBUG mode (-g)? [n] The answer was n or default

 

If this variable is set, no UI sessions nor any UI libraries are built.
This can be useful when running a pure batch job or in a user framework
having its own UI system.
Do you want to set this variable ?
[n]
The answer was n or default. Setting the variable means NO graphics interface

 

 

G4UI_BUILD_XAW_SESSION
G4UI_USE_XAW

Specifies to include and use the XAW interfaces in the
application to be built.
The XAW (X11 Athena Widget set) extensions are required to activate
and build this driver.
[n]
The answer was y. Indeed, you want to use the standard X11 libraries except you payed for expensive motif ones or are running alternative graphics libraries.

 

You have selected to use the XAW based user interfaces.
Specify the correct path where XAW is installed in your system.
It was found in /usr/X11R6. Press [Enter] to set this path or type the correct one.
You can set '-' (without quotation) to CANCEL the XAW flag at all:
[/usr/X11R6]
The answer was default. However, please check that the /usr/X11R6/lib/libX11.so is there. Otherwise, point to the correct directory

 

G4UI_BUILD_XM_SESSION
G4UI_USE_XM
Specifies to include and use the XM Motif based user interfaces.
The XM Motif extensions are required to activate and build this
driver.
[n]
The answer was n or default

 

G4VIS_NONE
If this variable is set, no visualization drivers will be built or used.
Do you want to set this variable ?
[n]
The answer was n or default

 

G4VIS_BUILD_OPENGLX_DRIVER
G4VIS_USE_OPENGLX

It is an interface to the de facto standard 3D graphics library,
OpenGL. It is well suited for real-time fast visualization
and prototyping. The X11 version of the OpenGL libraries is
required.
[n]
The answer was y

 

It is an interface to the de facto standard 3D graphics library,
OpenGL. It is well suited for real-time fast visualization
and prototyping. The X11 version of the OpenGL libraries and
the Motif Xm extension is required.
[n]
The answer was n or default

 

G4VIS_BUILD_DAWN_DRIVER
G4VIS_USE_DAWN

DAWN drivers are interfaces to the Fukui Renderer DAWN. DAWN is
a vectorized 3D PostScript processor suited to prepare technical
high quality outputs for presentation and/or documentation.
[n]
The answer was y

G4VIS_BUILD_OIX_DRIVER
G4VIS_USE_OIX
The OpenInventor driver is based on OpenInventor technology
for scientific visualization.
The X11 version of OpenInventor is required.
[n]
The answer was no or default
 

G4VIS_BUILD_RAYTRACERX_DRIVER
G4VIS_USE_RAYTRACERX
Allows for interactive ray-tracing graphics through X11.
The X11 package is required.
[n]
The answer was y

G4VIS_BUILD_VRML_DRIVER
G4VIS_USE_VRML
These driver generate VRML files, which describe 3D scenes to be
visualized with a proper VRML viewer.
[n]
The answer was yes

OGLHOME/include
OGLHOME/lib
You have selected to use OpenGL driver.
Specify the correct path (OGLHOME) where OpenGL is installed in your system.
It was found in /usr. Press [Enter] to set this path or type the correct one.
You can set '-' (without quotation) to CANCEL the OpenGL flag at all:
[/usr]
The answer was default. Could be different in other machines
 

G4LIB_BUILD_G3TOG4
The utility module 'g3tog4' will be built by setting this
variable. NOTE: it requires a valid FORTRAN compiler to be
installed on your system and the 'cernlib' command in the
path, in order to build the ancillary tools!
Do you want to build 'g3tog4' ?
[n]
The answer was no or default

G4LIB_BUILD_ZLIB
Do you want to activate compression for output files
generated by the HepRep visualization driver?
[n]
The answer was no or default

G4ANALYSIS_USE
Activates the configuration setup for allowing plugins to
analysis tools based on AIDA (Astract Interfaces for Data
Analysis). In order to use AIDA features and compliant analysis
tools, the proper environment for these tools will have to be
set (see documentation for the specific analysis tools).
[n]
The answer was no or default
 

Press [Enter] to start installation or use a shell escape to edit config.sh: The answer was Enter or default


And the compilation/linking phase will start. It can take up to several hours depending on the speed of the machine.


 

 

 

Mail comments and suggestions