2 # ----------------------------------------------------------------
3 # This script sets the default environment variables for
4 # Alice Geant4 based prototype
5 # Options: -g verbose mode
6 # local recomended local configuration
8 # by I. Hrivnacova, 18.8.1998
10 # sh version modified by I. Gonzalez 2.3.2000
13 # ==================================================================
14 # Alice configuration options:
15 # Please define your selection with the variables below.
16 # ==================================================================
22 # If set: the provided Geant4 version and not the default one is set
23 #export AG4_VERSION=2.0_opt_global
26 # ====== AG4_VISUALIZE
27 # Set/Unset to get/avoid Geant4 visualisation.
28 export AG4_VISUALIZE=1
33 # Set/Unset to get OPACS as a Geant4 visualisation driver.
39 # If set: the secondary particles are not tracked immediatelly
40 # when they are created but after the urgent stack is exhausted
41 # If not set: the G4 default stacking is used
46 # ====== AG4_NOPHYSICS
47 # If set: only geantino or charged geantino can be shooted
48 #export AG4_NOPHYSICS=1
52 # ====== AG4_MAKESHLIB
53 # If set: shared libraris are created
54 export AG4_MAKESHLIB=1
59 # If set: the environment for using Objectivity is set. Not available on Linux?
65 # Resolve input parameters
72 -g) VERBOSE="YES"; shift 1;;
73 local) LOCAL="YES"; shift 1;;
79 # ==================================================================
81 # ==================================================================
84 if [ "$LOCAL" = "NO" ]; then
90 # ALICE base directory
91 ALICE_BASE=/afs/cern.ch/alice/offline
94 # Geant4 base directory
95 G4_BASE=${ALICE_BASE}/geant4
98 # LHC++ base directory
99 LHCXX_BASE=/afs/cern.ch/sw/lhcxx/specific/@sys
102 # Root base directory
103 ROOT_BASE=/afs/cern.ch/alice/library/root
104 # to be removed after aCC support will be defined
105 # in the offline in a standard way
106 if [ `uname` = "HP-UX" ]; then
107 ROOT_BASE=/afs/cern.ch/alice/library/.hp_ux102/root.2.23.aCC
111 # IRST code check tool base directory
112 export IRST_BASE=/afs/cern.ch/alice/offline/geant4/tools/IRST
115 # Objectivity base directory
116 OBJY_BASE="/afs/cern.ch/rd45/objectivity"
120 # recommended local installation
124 # ALICE base directory
128 # Geant4 base directory
132 # LHC++ base directory
136 # Root base directory
137 ROOT_BASE=$HOME/dev/root
140 # IRST code check tool base directory
141 export IRST_BASE=$HOME/dev/tools/IRST
146 #....................................... SKIP ................................
148 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
149 # You should not need to change
150 # the lines below this one
151 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
154 # Alice Geant4 install directory
156 export AG4_INSTALL=$ALICE_ROOT/AliGeant4
158 # Set variables depending on other variables
159 # if opacs is selected then select also visualize
160 if [ $AG4_OPACS ]; then
161 export AG4_VISUALIZE=1
165 if [ "$VERBOSE" = "YES" ]; then
167 echo " =========================================="
168 echo " ALICE Geant4 environment configuration"
169 echo " =========================================="
172 # Some output on the selections...
175 if [ $AG4_VISUALIZE ]; then
176 echo "Geant4 visualisation is selected."
178 echo "Geant4 visualisation is NOT selected."
180 if [ $AG4_OPACS ]; then
181 echo "OPACS driver is selected."
183 echo "OPACS driver is NOT selected."
185 if [ $AG4_TOY ]; then
186 echo "Toy geometry is selected"
188 echo "Full geometry is selected"
190 if [ $AG4_STACKING ]; then
191 echo "The ALICE default stacking will be used."
193 echo "The Geant4 default stacking will be used."
195 if [ $AG4_NOPHYSICS ]; then
196 echo "Only geantino or charged geantino can be shooted."
198 echo "Full physics has been selected."
200 if [ $AG4_ODBMS ]; then
201 echo "The environment for using Objectivity will be set."
203 echo "No Geant4 Persistency."
209 # ROOT Alice definitions & options
210 # ==================================
212 if [ "$ROOTSYS" = "" ]; then
213 export ROOTSYS=$ROOT_BASE
215 if [ "$VERBOSE" = "YES" ]; then
219 echo "ROOTSYS set to $ROOTSYS"
223 # ODBMS Alice definitions & options
224 # ==================================
226 if [ "$VERBOSE" = "YES" ]; then
228 echo "ODBMS & Objectivity"
229 echo "==================="
231 if [ $AG4_ODBMS ]; then
232 if [ "$VERBOSE" = "YES" ]; then
233 echo Setting ODBMS Alice definitions & options...
237 export ALBOOT_DIR=$AG4_INSTALL/ObjyDatabase
238 export ALBOOT_NAME=Alice
239 export ALBOOT=$ALBOOT_DIR/$ALBOOT_NAME
240 if [ ! -d $ALBOOT_DIR ]; then
241 echo " Making new directory $ALBOOT_DIR ..."
245 if [ "$VERBOSE" = "YES" ]; then
246 echo Unsetting ODBMS Alice definitions \& options...
254 # Objectivity G4 options
255 # according to run/example5/g4odbms_setup.sh
257 if [ $G4ODBMS ]; then
258 export OBJY_VERS=4.0.2
259 if [ -r $OBJYDEV/objyenv.sh ]; then
260 . $OBJYDEV/objyenv.sh
261 if [ "$VERBOSE" = "YES" ]; then
262 echo "Environment for Objectivity has been set."
265 export HEP_ODBMS_DIR=$HEPDEV/HepODBMS/0.0
266 export HEP_ODBMS_INCLUDES=$HEP_ODBMS_DIR/include
272 # ==================================
274 if [ "$VERBOSE" = "YES" ]; then
276 echo "Geant4 env. variables..."
277 echo "============================"
279 if [ "$AG4_VERSION" = "" ]; then
280 export G4INSTALL=$G4_BASE/geant4
282 export G4INSTALL=$G4_BASE/g4dev/geant4.$AG4_VERSION
285 if [ "$AG4_MAKESHLIB" = "" ]; then
288 export G4MAKESHLIB=$G4INSTALL/config/makeshlib.sh
291 # path to data files needed by hadronic processes
292 export G4LEVELGAMMADATA=$G4INSTALL/data/PhotonEvaporation
294 # This is architecture dependent...
296 if [ "$SYSTEM" = "HP-UX" ]; then
297 export G4SYSTEM="HP-aCC"
298 #export G4USE_OSPACE=1 # compiling with Object Space STL
300 if [ "$SYSTEM" = "Linux" ]; then
301 export G4SYSTEM="Linux-g++"
303 if [ "$SYSTEM" = "OSF1" ]; then
304 export G4SYSTEM="DEC-cxx"
305 #export G4NO_STD_NAMESPACE=1 # compiling with non ISO/ANSI setup
307 if [ "$SYSTEM" = "SunOS" ]; then
308 export G4SYSTEM="SUN-CC"
309 export G4USE_OSPACE=1 # compiling with Object Space STL
311 if [ "$VERBOSE" = "YES" ]; then
312 echo "Architecture is $SYSTEM"
313 echo "Geant4 is istalled in $G4INSTALL"
314 echo "Geant4 architecture type is $G4SYSTEM"
315 if [ $G4USE_OSPACE ]; then
316 echo "ObjectSpace will be used for STL"
323 # ==================================
326 if [ -d $LHCXX_BASE/CLHEP/new ]; then
327 export CLHEP_BASE_DIR=$LHCXX_BASE/CLHEP/new
328 if [ "$SYSTEM" = "OSF1" ]; then
330 export CLHEP_BASE_DIR=$LHCXX_BASE/CLHEP/1.5.0.0
332 if [ "$SYSTEM" = "SunOS" ]; then
334 export CLHEP_BASE_DIR=$LHCXX_BASE/CLHEP/1.5.0.0
337 echo "WARNING: CLHEP has not been found in the default path."
338 if [ "$VERBOSE" = "YES" ]; then
339 echo " Please set the variable CLHEP_BASE_DIR to its base path"
340 echo " Example: export CLHEP_BASE_DIR=/afs/cern.ch/sw/lhcxx/specific/@sys/CLHEP/pro"
343 if [ "$VERBOSE" = "YES" ]; then
344 echo "CLHEP base directory: $CLHEP_BASE_DIR"
350 # ==================================
353 if [ $AG4_VISUALIZE ]; then
354 if [ "$VERBOSE" = "YES" ]; then
355 echo "G4 Visualization env. variables..."
361 if [ "$VERBOSE" = "YES" ]; then
362 echo "* X11 with Motif..."
364 export G4UI_BUILD_XM_DRIVER=1
365 export G4UI_BUILD_XM_SESSION=1
371 if [ "$VERBOSE" = "YES" ]; then
372 echo "* Fukui Renderer (DAWN)..."
374 export G4VIS_BUILD_DAWN_DRIVER=1
375 export G4VIS_BUILD_DAWNFILE_DRIVER=1
376 export G4VIS_USE_DAWN=1
377 export G4VIS_USE_DAWNFILE=1
378 export G4DAWNFILE_VIEWER=david
379 export DAWN_HOME=${G4_BASE}/tools/bin
380 if [ "`echo ${PATH} | grep ${DAWN_HOME} `" = "" ]; then
381 export PATH=$PATH:$DAWN_HOME
383 export G4DAWN_MULTI_WINDOW=1
384 if [ `uname` = "Linux" ]; then
385 export G4DAWN_NAMED_PIPE=1
388 if [ "$VERBOSE" = "YES" ]; then
389 if [ $G4VIS_USE_DAWN ]; then
390 echo " Dawn driver activated"
392 if [ $G4VIS_USE_DAWNFILE ]; then
393 echo " Dawn file driver activated"
395 if [ $G4DAWNFILE_VIEWER ]; then
396 echo " Dawn file viewer set to ${G4DAWNFILE_VIEWER}"
398 if [ $DAWN_HOME ]; then
399 echo " Dawn home path set to ${DAWN_HOME}"
401 if [ $G4DAWN_MULTI_WINDOW ]; then
402 echo " Dawn multi window selected"
404 if [ $G4DAWN_NAMED_PIPE ]; then
405 echo " Dawn named pipe selected"
411 # Set colors for overlappings
412 export DAVID_RAINBOW_FLAG=1
413 #export DAVID_HIGHLIGHT_COLOR_R=r
414 #export DAVID_HIGHLIGHT_COLOR_G=g
415 #export DAVID_HIGHLIGHT_COLOR_B=b
417 # If set volumes names are shown
418 export DAVID_DISPLAY_PVNAME=1
419 # If set supresses the call to dawn
420 #export DAVID_NO_VIEW=1
421 export DAVID_EPSILON_3D=0.001
423 if [ "$1" = "-g" ]; then
424 if [ $DAVID_RAINBOW_FLAG ]; then
425 echo " DAVID Rainbow mode is ON"
427 if [ $DAVID_HIGHLIGHT_COLOR_R ]; then
428 echo " DAVID Highlight color (Red) set to ${DAVID_HIGHLIGHT_COLOR_R}"
430 if [ $DAVID_HIGHLIGHT_COLOR_G ]; then
431 echo " DAVID Highlight color (Green) set to ${DAVID_HIGHLIGHT_COLOR_G}"
433 if [ $DAVID_HIGHLIGHT_COLOR_B ]; then
434 echo " DAVID Highlight color (Blue) set to ${DAVID_HIGHLIGHT_COLOR_B}"
436 if [ $DAVID_DISPLAY_PVNAME ]; then
437 echo " DAVID will display intersected volumes name"
439 if [ $DAVID_DISPLAY_PVNAME ]; then
440 echo " Dawn will not be called from DAVID"
442 if [ $DAVID_EPSILON_3D ]; then
443 echo " DAVID tolerance set to ${DAVID_EPSILON_3D}"
450 if [ "$VERBOSE" = "YES" ]; then
453 export G4VIS_BUILD_OPENGLX_DRIVER=1
454 export G4VIS_BUILD_OPENGLXM_DRIVER=1
455 export G4VIS_USE_OPENGLX=1
456 export G4VIS_USE_OPENGLXM=1
457 export OGLHOME=/usr/local
458 export OGLLIBS="-L$OGLHOME/lib -lMesaGLU -lMesaGL"
459 if [ "$SYSTEM" = "HP-UX" ]; then
460 export OGLLIBS="-L/usr/lib $OGLLIBS"
462 if [ "$SYSTEM" = "OSF1" ]; then
463 # temporarily excluded
464 # due to problems with Root
465 unset G4VIS_BUILD_OPENGLX_DRIVER
466 unset G4VIS_BUILD_OPENGLXM_DRIVER
467 unset G4VIS_USE_OPENGLX
468 unset G4VIS_USE_OPENGLXM
472 if [ "$VERBOSE" = "YES" ]; then
473 if [ $G4VIS_USE_OPENGLX ]; then
474 echo " OpenGL and X11 driver activated"
476 if [ $G4VIS_USE_OPENGLXM ]; then
477 echo " OpenGL with Motif extension driver activated"
479 if [ $OGLHOME ]; then
480 echo " OpenGL path set to ${OGLHOME}"
482 if [ $OGLLIBS ]; then
483 echo " OpenGL libraries set to ${OGLLIBS}"
490 if [ "$VERBOSE" = "YES" ]; then
491 echo "* OpenInventor..."
493 #export G4VIS_USE_OPENINVENTOR=1
494 #export OIHOME=whatever
495 #export HEPVISDIR=something
496 if [ "$VERBOSE" = "YES" ]; then
497 if [ $G4VIS_USE_OPENINVENTOR ]; then
498 echo " OpenInventor driver activated"
499 echo " OpenInventor path is ${OIHOME}"
500 echo " HepVis path is ${HEPVISDIR}"
507 if [ "$VERBOSE" = "YES" ]; then
510 export G4VIS_BUILD_VRML_DRIVER=1
511 export G4VIS_BUILD_VRMLFILE_DRIVER=1
512 export G4VIS_USE_VRML=1
513 export G4VIS_USE_VRMLFILE=1
514 #Set preferred vrml viewer to be invoked in this mode
515 export G4VRMLFILE_VIEWER=vrweb
516 #Set host name for VRML1 visualization.... the g4vrmlview machine!
517 export G4VRML_HOST_NAME=nohost
518 #Command to run java listener for VRML driver
519 #alias javavrml "java -classpath $G4_BASE/tools/bin/java g4vrmlview vrweb"
521 if [ "$VERBOSE" = "YES" ]; then
522 if [ $G4VIS_USE_VRML ]; then
523 echo " VRML driver activated"
524 echo " Host Name for remote visualization is ${G4VRML_HOST_NAME}"
526 if [ $G4VIS_USE_VRMLFILE ]; then
527 echo " VRML file driver activated"
528 echo " VRML viewer set to ${G4VRMLFILE_VIEWER}"
535 if [ "$VERBOSE" = "YES" ]; then
536 echo "* Ray Tracer..."
538 #export G4VIS_BUILD_RAYTRACER_DRIVER=1
539 #export G4VIS_USE_RAYTRACER=1
540 if [ "$VERBOSE" = "YES" ]; then
541 if [ $G4VIS_USE_RAYTRACER ]; then
542 echo " Ray tracing driver activated"
549 if [ "$VERBOSE" = "YES" ]; then
550 echo "* Geant Adaptative GUI (GAG)..."
552 export G4UI_BUILD_GAG_SESSION=1
553 export G4UI_USE_GAG=1
554 export MOMOPATH=${G4_BASE}/tools/GAG/tcltk
555 if [ "`echo ${PATH} | grep ${MOMOPATH} `" = "" ]; then
556 export PATH=$PATH:$MOMOPATH
558 NCLASSPATH=".:${G4_BASE}/tools/swing-1.0.3/swingall.jar:${G4_BASE}/tools/GAG/java/GAG.jar"
559 if [ "$CLASSPATH" = "" ]; then
560 export CLASSPATH=$NCLASSPATH
562 if [ "`echo ${CLASSPATH} | grep ${NCLASSPATH} `" = "" ]; then
563 export CLASSPATH="${CLASSPATH}:${NCLASSPATH}"
567 if [ "$VERBOSE" = "YES" ]; then
568 if [ $G4UI_USE_GAG ]; then
569 echo " GAG UI activated"
570 echo " Momo path set to $MOMOPATH"
571 echo " NOTE: Run "\'tmomo\' "to use Momo (TK/Tcl version)"
572 echo " The path to the java GAG code was updated"
573 echo " NOTE: Run "\'java gag\'" to use GAG (java version)"
579 if [ "$VERBOSE" = "YES" ]; then
580 echo Unsetting G4 Visualization env. variables...
584 unset G4UI_BUILD_XM_DRIVER
585 unset G4UI_BUILD_XM_SESSION
589 unset G4VIS_BUILD_DAWN_DRIVER
590 unset G4VIS_BUILD_DAWNFILE_DRIVER
592 unset G4VIS_USE_DAWNFILE
593 unset G4DAWNFILE_VIEWER
595 unset G4DAWN_MULTI_WINDOW
596 if [ "$SYSTEM" = "Linux" ]; then
597 unset G4DAWN_NAMED_PIPE
601 unset DAVID_RAINBOW_FLAG
602 unset DAVID_HIGHLIGHT_COLOR_R
603 unset DAVID_HIGHLIGHT_COLOR_G
604 unset DAVID_HIGHLIGHT_COLOR_B
605 unset DAVID_DISPLAY_PVNAME
607 unset DAVID_EPSILON_3D
610 unset G4VIS_BUILD_OPENGLX_DRIVER
611 unset G4VIS_BUILD_OPENGLXM_DRIVER
612 unset G4VIS_USE_OPENGLX
613 unset G4VIS_USE_OPENGLXM
618 #unset G4VIS_USE_OPENINVENTOR
621 unset G4VIS_BUILD_VRML_DRIVER
622 unset G4VIS_BUILD_VRMLFILE_DRIVER
624 unset G4VIS_USE_VRMLFILE 1
625 unset G4VRMLFILE_VIEWER
626 unset G4VRML_HOST_NAME
629 unset G4UI_BUILD_GAG_SESSION
638 if [ $AG4_OPACS ]; then
639 if [ "$VERBOSE" = "YES" ]; then
642 export AG4_VISUALIZE=1
645 # OpenGL: needed by OPACS
647 export G4VIS_BUILD_OPENGLX_DRIVER=1
648 export G4VIS_USE_OPENGLX=1
649 export OGLHOME=/usr/local
650 export OGLLIBS="-L$OGLHOME/lib -lMesaGLU -lMesaGL"
651 if [ "$SYSTEM" = "HP-UX" ]; then
652 export OGLLIBS="-L/usr/lib $OGLLIBS"
658 export G4VIS_BUILD_OPACS_DRIVER=1
659 export G4UI_BUILD_WO_DRIVER=1
660 export G4UI_BUILD_WO_SESSION=1
661 export G4VIS_USE_OPACS=1
663 export OPACS_HOME=$G4_BASE/tools/OPACS
664 #export OPACS_HOME=/afs/cern.ch/rd44/dev/OPACS
665 if [ "$SYSTEM" = "Linux" ]; then
666 export G4_OPACS_WIDGET_SET=lesstif
668 export G4_OPACS_WIDGET_SET=Xm
670 . $OPACS_HOME/OPACS/v3/setup.sh
671 export WOENVIRONMENT=$AG4_INSTALL/bin/Alice.odb
672 export OPATH="$OPATH $G4INSTALL/environments/OPACS/usr"
673 if [ "$VERBOSE" = "YES" ]; then
674 if [ $G4VIS_USE_OPACS ]; then
675 echo " OPACS driver activated"
676 echo " OPACS path set to $OPACS_HOME"
680 if [ "$VERBOSE" = "YES" ]; then
681 echo "* Unsetting OPACS driver env. variables ..."
683 unset G4VIS_BUILD_OPACS_DRIVER
684 unset G4UI_BUILD_WO_DRIVER
685 unset G4UI_BUILD_WO_SESSION
686 unset G4VIS_USE_OPACS
689 unset G4_OPACS_WIDGET_SET
696 # path to AliGeant4 config scripts
698 if [ "`echo ${PATH} | grep ${AG4_INSTALL}/config `" = "" ]; then
699 if [ "$VERBOSE" = "YES" ]; then
700 echo Adding ${AG4_INSTALL}/config to the path...
702 export PATH=${PATH}:${AG4_INSTALL}/config
706 # path to shared libraries
708 if [ "$SYSTEM" = "HP-UX" ]; then
710 SHLIBVARNAME=SHLIB_PATH
712 if [ "$SYSTEM" = "Linux" ]; then
713 SHLIBVAR=$LD_LIBRARY_PATH
714 SHLIBVARNAME=LD_LIBRARY_PATH
716 if [ "$SYSTEM" = "OSF1" ]; then
717 SHLIBVAR=$LD_LIBRARY_PATH
718 SHLIBVARNAME=LD_LIBRARY_PATH
720 if [ "$SYSTEM" = "SunOS" ]; then
721 SHLIBVAR=$LD_LIBRARY_PATH
722 SHLIBVARNAME=LD_LIBRARY_PATH
725 if [ "`echo ${SHLIBVAR} | grep ${G4INSTALL}/lib/${G4SYSTEM} `" = "" ]; then
726 if [ "$VERBOSE" = "YES" ]; then
727 echo Adding ${G4INSTALL}/lib/${G4SYSTEM} to the shared libraries path...
729 SHLIBVAR="${G4INSTALL}/lib/${G4SYSTEM}:${SHLIBVAR}"
732 export $SHLIBVARNAME=$SHLIBVAR
736 # Remove unneeded variables. If this is not done the vars. remain in the env.
750 echo "Default ALICE environment for GEANT4 has been set."