Docstoc

GEANT4-Experience

Document Sample
GEANT4-Experience Powered By Docstoc
					Version 1

G.N. Patrick 20.12.2001

LHCb EXPERIENCE WITH GEANT4 AT RAL

1. Introduction
This note contains some background information on how GEANT4 has been installed and used in standalone mode at RAL. This uses the LHCb software repository as well as locally available libraries.

2. Libraries
In addition to the LHCb software, a number of external libraries are needed to run GEANT4 and these have been installed under the AFS cell: /afs/rl.ac.uk/sw 2.1 Standard Libraries The following standard libraries must be installed: (a) CLHEP This is the Class Library of High Energy Physics and was installed under: /afs/rl.ac.uk/sw/contrib/lhcxx/specific/i386_linux22/CLHEP/ 1.6.0 (b) STL This is the Standard Template Library for classes like C++ containers and strings. Originally, no compiler provided a consistent set of classes, so Tools.h++ (Rogue Wave) was chosen for GEANT4 and an interface provided for when STL became available. However, since GEANT4.1.0 the STL interface has become the only supported option. At RAL, the native STL support for the Linux gcc/egcs-2.91.66 compiler was used. 2.2 Visualisation Libraries In addition to the standard libraries, a number of other packages were installed (sometimes by trial and error) to provide visualisation capability. (a) OPACS This is a visualisation environment based on X-Windows and OpenGL. Underneath this, there are a number of components found to be essential. These were installed under: /afs/rl.ac.uk/sw/contrib/OPACS/ Co Glo Go Ho HTMLo Wo W3o Xo Xx Type manager OpenGL implementation with X11 graphic database over OpenGL "o" histograms, tuples HTML widget Widget manager www library from mosaic2.6 Widget set Utilities

(b) Mesa This is a free 3D graphics library that is compatible with OpenGL and is needed to use the OpenGL drivers for visualisation. This was installed under: /afs/rl.ac.uk/lhcb/Mesa/ 3.2/lib Note that in the Geant documentation you are warned not to use Mesa-3.1 with OpenGL. (c) HEPVis HEPVis is a class library of OpenInventor objects for use in particle physics experiments. This was installed under: /afs/rl.ac.uk/lhcb/sw/contrib/HEPVis/ v5r1p7 (d) SoFree This is a free implementation of Open Inventor. This was installed under: /afs/rl.ac.uk/sw/contrib/SoFree/ (e) DAWN Dawn is a vectorised 3D postscript processor. This enables detailed detector geometries to be saved to an eps file. This was installed under: /rutherford/lhcb-soft1/DAWN/ dawn_3_81a

3. Environment Variables
In order to pick up the necessary libraries, it is essential that the search path is set up correctly. First of all, your current directory needs to be in the path when building/running the G4 executables:
setenv LD_LIBRARY_PATH .:${LD_LIBRARY_PATH}

In addition, the relevant G4 libraries need to be specified:
setenv LD_LIBRARY_PATH /afs/rl.ac.uk/sw/geant4/releases/specific/i386_redhat61/egcs-1.1.2/geant4.3.0/lib:${LD_LIBRARY_PATH}

The system (CERN versions) libraries need to be specified via
setenv LD_LIBRARY_PATH /usr/local/lib:${LD_LIBRARY_PATH}

and the CLHEP libraries via
setenv LD_LIBRARY_PATH /afs/rl.ac.uk/sw/lhcxx/specific/i386_linux22/CLHEP/1.6.0.0/lib:${LD_LIBRARY_PATH}

The external libraries need to be made available with:
setenv LD_LIBRARY_PATH /afs/rl.ac.uk/sw/contrib/HEPVis/v5r1p7/i386_linux22:${LD_LIBRARY_PATH} setenv LD_LIBRARY_PATH /afs/rl.ac.uk/lhcb/Mesa/3.2/lib:${LD_LIBRARY_PATH} setenv LD_LIBRARY_PATH /afs/rl.ac.uk/sw/contrib/OPACS/v3/Linux:${LD_LIBRARY_PATH}

In addition, numerous environment variables need to be set up for visualisation by the user. This is best done within a .cshrc file or by writing a special GEANT4 environment script as shown in Figure 1. The user customisation of the graphics can be tricky, but further information on the options can be obtained from John Allison or Satoshi Tanoka.

##################################################### # Sample .cshrc script for GEANT4 visualisation on Linux # # Author: G.N. Patrick # # Date : 10.08.2001 # Updates: ##################################################### ############## DAWN (Fukui) Renderer setenv G4VIS_BUILD_DAWN_DRIVER 1 setenv G4VIS_BUILD_DAWNFILE_DRIVER 1 setenv G4VIS_USE_DAWN 1 setenv G4VIS_USE_DAWNFILE 1 setenv G4DAWN_MULTI_WINDOWS 1 setenv DAWN_BSD_UNIX_DOMAIN 1 setenv DAWN_GUI_ALWAYS 1 setenv G4DAWN_HOME /rutherford/lhcb-soft1/DAWN/dawn_3_81a/Linux-g++ setenv G4DAWNFILE_VIEWER 1 setenv PATH ${PATH}:${G4DAWN_HOME} setenv G4DAWNFILE_MAX_FILE_NUM 50 setenv G4DAWNFILE_DEST_DIR /home/csf/gpatrick/DAWN/temp ############## Ray Tracer setenv G4VIS_BUILD_RAYTRACER_DRIVER 1 setenv G4VIS_USE_RAYTRACER 1 ############## OPACS #setenv G4VIS_BUILD_OPENGLX_DRIVER 1 #setenv G4VIS_USE_OPACS 1 #setenv OPACS_VERSION v3 #setenv OPACS_SYSTEM Linux-gxx ############## OpenGL setenv G4VIS_BUILD_OPENGLX_DRIVER 1 setenv G4VIS_USE_OPENGLX 1 setenv G4VIS_BUILD_OPENGLXM_DRIVER 1 setenv G4VIS_USE_OPENGLXM 1 setenv XKEYSYMDB /usr/lib/X11/XKeysymDB setenv OGLHOME /usr/X11 ############## OpenInventor setenv G4VIS_BUILD_OPENGLX-DRIVER 1 setenv G4VIS_USE_OIX 1 ############## VRML setenv G4VIS_BUILD_VRML_DRIVER 1 setenv G4VIS_USE_VRML 1 setenv G4VIS_BUILD_VRMLFILE_DRIVER 1 setenv G4VIS_USE_VRMLFILE

Figure 1: Sample initialisation script for GEANT4 visualisation

4. Source Code
The LHCb version (geant4.3.0) of GEANT4 is stored as a dummy package in CMT. This can be retrieved in the usual way, but to run the standard examples both GEANT4 and G4Examples need to be booked out as follows: >cd newmycmt >getpack Sim/GEANT4 v3r0 >cd Sim/GEANT4/v3r0/cmt >source setup.csh >gmake >cd newmycmt >getpack Sim/G4Examples v3r0

5. Building GEANT4 "Example" Executables
The user examples are stored under the G4Examples sub-directory. These can be compiled to build executables as follows: >cd ~newmycmt/Sim/G4Examples/v3r0/cmt >source setup.csh >gmake Note that it is necessary to edit the "requirements" file to specify which of the six examples you wish to run. This creates an executable (assuming ExampleN01) under ~/newmycmt/Sim/G4Examples/v3r0/i386_linux22/ExampleN01.exe which can be run by: >ExampleN01.exe or >qsub ExampleN01.exe interactive session PBS batch job

6. Adapting GEANT4 Examples
The GEANT4 visualisation can be tested by building and executing the file called: ExampleN03.exe In this example, the default visualisation driver (eg. OGLIX) can be selected by editing the macro file: prerunN03.mac. During an interactive session, a number of sample macro files called exN03Vis0.mac - exN03Vis6.mac can then be executed to investigate the different graphical options. A summer student (K. Laihem) took this work forward by adapting ExampleN03 to construct the LHCb RICH2 geometry. This was done by modifying the source files of the example, such as: ExN07DetectorConstruction.cc The details of this work need to be documented separately.


				
DOCUMENT INFO
Shared By:
Tags: GEANT, 4-Exp
Stats:
views:3
posted:11/27/2009
language:English
pages:4
Description: GEANT4-Experience