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=1.0_test
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
300 if [ "$SYSTEM" = "Linux" ]; then
301 export G4SYSTEM="Linux-g++"
303 if [ "$VERBOSE" = "YES" ]; then
304 echo "Architecture is $SYSTEM"
305 echo "Geant4 is istalled in $G4INSTALL"
306 echo "Geant4 architecture type is $G4SYSTEM"
307 if [ $G4USE_OSPACE ]; then
308 echo "ObjectSpace will be used for STL"
315 # ==================================
318 if [ -d $LHCXX_BASE/CLHEP/new ]; then
319 export CLHEP_BASE_DIR=$LHCXX_BASE/CLHEP/new
321 echo "WARNING: CLHEP has not been found in the default path."
322 if [ "$VERBOSE" = "YES" ]; then
323 echo " Please set the variable CLHEP_BASE_DIR to its base path"
324 echo " Example: export CLHEP_BASE_DIR=/afs/cern.ch/sw/lhcxx/specific/@sys/CLHEP/pro"
327 if [ "$VERBOSE" = "YES" ]; then
328 echo "CLHEP base directory: $CLHEP_BASE_DIR"
334 # ==================================
337 if [ $AG4_VISUALIZE ]; then
338 if [ "$VERBOSE" = "YES" ]; then
339 echo "G4 Visualization env. variables..."
345 if [ "$VERBOSE" = "YES" ]; then
346 echo "* X11 with Motif..."
348 export G4UI_BUILD_XM_DRIVER=1
349 export G4UI_BUILD_XM_SESSION=1
355 if [ "$VERBOSE" = "YES" ]; then
356 echo "* Fukui Renderer (DAWN)..."
358 export G4VIS_BUILD_DAWN_DRIVER=1
359 export G4VIS_BUILD_DAWNFILE_DRIVER=1
360 export G4VIS_USE_DAWN=1
361 export G4VIS_USE_DAWNFILE=1
362 export G4DAWNFILE_VIEWER=david
363 export DAWN_HOME=${G4_BASE}/tools/bin
364 if [ "`echo ${PATH} | grep ${DAWN_HOME} `" = "" ]; then
365 export PATH=$PATH:$DAWN_HOME
368 export G4DAWN_MULTI_WINDOW=1
369 if [ `uname` = "Linux" ]; then
370 export G4DAWN_NAMED_PIPE=1
373 if [ "$VERBOSE" = "YES" ]; then
374 if [ $G4VIS_USE_DAWN ]; then
375 echo " Dawn driver activated"
377 if [ $G4VIS_USE_DAWNFILE ]; then
378 echo " Dawn file driver activated"
380 if [ $G4DAWNFILE_VIEWER ]; then
381 echo " Dawn file viewer set to ${G4DAWNFILE_VIEWER}"
383 if [ $DAWN_HOME ]; then
384 echo " Dawn home path set to ${DAWN_HOME}"
386 if [ $G4DAWN_MULTI_WINDOW ]; then
387 echo " Dawn multi window selected"
389 if [ $G4DAWN_NAMED_PIPE ]; then
390 echo " Dawn named pipe selected"
395 # Set colors for overlappings
396 export DAVID_RAINBOW_FLAG=1
397 #export DAVID_HIGHLIGHT_COLOR_R=r
398 #export DAVID_HIGHLIGHT_COLOR_G=g
399 #export DAVID_HIGHLIGHT_COLOR_B=b
401 # If set volumes names are shown
402 export DAVID_DISPLAY_PVNAME=1
403 # If set supresses the call to dawn
404 #export DAVID_NO_VIEW=1
405 export DAVID_EPSILON_3D=0.001
407 if [ "$1" = "-g" ]; then
408 if [ $DAVID_RAINBOW_FLAG ]; then
409 echo " DAVID Rainbow mode is ON"
411 if [ $DAVID_HIGHLIGHT_COLOR_R ]; then
412 echo " DAVID Highlight color (Red) set to ${DAVID_HIGHLIGHT_COLOR_R}"
414 if [ $DAVID_HIGHLIGHT_COLOR_G ]; then
415 echo " DAVID Highlight color (Green) set to ${DAVID_HIGHLIGHT_COLOR_G}"
417 if [ $DAVID_HIGHLIGHT_COLOR_B ]; then
418 echo " DAVID Highlight color (Blue) set to ${DAVID_HIGHLIGHT_COLOR_B}"
420 if [ $DAVID_DISPLAY_PVNAME ]; then
421 echo " DAVID will display intersected volumes name"
423 if [ $DAVID_DISPLAY_PVNAME ]; then
424 echo " Dawn will not be called from DAVID"
426 if [ $DAVID_EPSILON_3D ]; then
427 echo " DAVID tolerance set to ${DAVID_EPSILON_3D}"
434 if [ "$VERBOSE" = "YES" ]; then
437 export G4VIS_BUILD_OPENGLX_DRIVER=1
438 export G4VIS_BUILD_OPENGLXM_DRIVER=1
439 export G4VIS_USE_OPENGLX=1
440 export G4VIS_USE_OPENGLXM=1
441 if [ "$SYSTEM" = "Linux" ]; then
442 export OGLHOME=/usr/local
443 export OGLLIBS="-L$OGLHOME/lib -lMesaGLU -lMesaGL"
445 export OGLHOME=$LHCXX_BASE/OpenGL/pro
448 if [ "$VERBOSE" = "YES" ]; then
449 if [ $G4VIS_USE_OPENGLX ]; then
450 echo " OpenGL and X11 driver activated"
452 if [ $G4VIS_USE_OPENGLXM ]; then
453 echo " OpenGL with Motif extension driver activated"
455 if [ $OGLHOME ]; then
456 echo " OpenGL path set to ${OGLHOME}"
458 if [ $OGLLIBS ]; then
459 echo " OpenGL libraries set to ${OGLLIBS}"
466 if [ "$VERBOSE" = "YES" ]; then
467 echo "* OpenInventor..."
469 #export G4VIS_USE_OPENINVENTOR=1
470 #export OIHOME=whatever
471 #export HEPVISDIR=something
472 if [ "$VERBOSE" = "YES" ]; then
473 if [ $G4VIS_USE_OPENINVENTOR ]; then
474 echo " OpenInventor driver activated"
475 echo " OpenInventor path is ${OIHOME}"
476 echo " HepVis path is ${HEPVISDIR}"
483 if [ "$VERBOSE" = "YES" ]; then
486 export G4VIS_BUILD_VRML_DRIVER=1
487 export G4VIS_BUILD_VRMLFILE_DRIVER=1
488 export G4VIS_USE_VRML=1
489 export G4VIS_USE_VRMLFILE=1
490 #Set preferred vrml viewer to be invoked in this mode
491 export G4VRMLFILE_VIEWER=vrweb
492 #Set host name for VRML1 visualization.... the g4vrmlview machine!
493 export G4VRML_HOST_NAME=nohost
494 #Command to run java listener for VRML driver
495 #alias javavrml "java -classpath $G4_BASE/tools/bin/java g4vrmlview vrweb"
497 if [ "$VERBOSE" = "YES" ]; then
498 if [ $G4VIS_USE_VRML ]; then
499 echo " VRML driver activated"
500 echo " Host Name for remote visualization is ${G4VRML_HOST_NAME}"
502 if [ $G4VIS_USE_VRMLFILE ]; then
503 echo " VRML file driver activated"
504 echo " VRML viewer set to ${G4VRMLFILE_VIEWER}"
511 if [ "$VERBOSE" = "YES" ]; then
512 echo "* Ray Tracer..."
514 #export G4VIS_BUILD_RAYTRACER_DRIVER=1
515 #export G4VIS_USE_RAYTRACER=1
516 if [ "$VERBOSE" = "YES" ]; then
517 if [ $G4VIS_USE_RAYTRACER ]; then
518 echo " Ray tracing driver activated"
525 if [ "$VERBOSE" = "YES" ]; then
526 echo "* Geant Adaptative GUI (GAG)..."
528 export G4UI_BUILD_GAG_SESSION=1
529 export G4UI_USE_GAG=1
530 export MOMOPATH=${G4_BASE}/tools/GAG/tcltk
531 if [ "`echo ${PATH} | grep ${MOMOPATH} `" = "" ]; then
532 export PATH=$PATH:$MOMOPATH
535 NCLASSPATH=".:${G4_BASE}/tools/swing-1.0.3/swingall.jar:${G4_BASE}/tools/GAG/java/GAG.jar"
536 if [ "$CLASSPATH" = "" ]; then
537 export CLASSPATH=$NCLASSPATH
539 if [ "`echo ${CLASSPATH} | grep ${NCLASSPATH} `" = "" ]; then
540 export CLASSPATH="${CLASSPATH}:${NCLASSPATH}"
544 if [ "$VERBOSE" = "YES" ]; then
545 if [ $G4UI_USE_GAG ]; then
546 echo " GAG UI activated"
547 echo " Momo path set to $MOMOPATH"
548 echo " NOTE: Run "\'tmomo\' "to use Momo (TK/Tcl version)"
549 echo " The path to the java GAG code was updated"
550 echo " NOTE: Run "\'java gag\'" to use GAG (java version)"
555 if [ "$VERBOSE" = "YES" ]; then
556 echo Unsetting G4 Visualization env. variables...
560 unset G4UI_BUILD_XM_DRIVER
561 unset G4UI_BUILD_XM_SESSION
565 unset G4VIS_BUILD_DAWN_DRIVER
566 unset G4VIS_BUILD_DAWNFILE_DRIVER
568 unset G4VIS_USE_DAWNFILE
569 unset G4DAWNFILE_VIEWER
571 unset G4DAWN_MULTI_WINDOW
572 if [ "$SYSTEM" = "Linux" ]; then
573 unset G4DAWN_NAMED_PIPE
577 unset DAVID_RAINBOW_FLAG
578 unset DAVID_HIGHLIGHT_COLOR_R
579 unset DAVID_HIGHLIGHT_COLOR_G
580 unset DAVID_HIGHLIGHT_COLOR_B
581 unset DAVID_DISPLAY_PVNAME
583 unset DAVID_EPSILON_3D
586 unset G4VIS_BUILD_OPENGLX_DRIVER
587 unset G4VIS_BUILD_OPENGLXM_DRIVER
588 unset G4VIS_USE_OPENGLX
589 unset G4VIS_USE_OPENGLXM
594 #unset G4VIS_USE_OPENINVENTOR
597 unset G4VIS_BUILD_VRML_DRIVER
598 unset G4VIS_BUILD_VRMLFILE_DRIVER
600 unset G4VIS_USE_VRMLFILE 1
601 unset G4VRMLFILE_VIEWER
602 unset G4VRML_HOST_NAME
605 unset G4UI_BUILD_GAG_SESSION
614 if [ $AG4_OPACS ]; then
615 if [ "$VERBOSE" = "YES" ]; then
618 export AG4_VISUALIZE=1
621 # OpenGL: needed by OPACS
623 export G4VIS_BUILD_OPENGLX_DRIVER=1
624 export G4VIS_USE_OPENGLX=1
625 if [ `uname` = "Linux" ]; then
626 export OGLHOME=/usr/local
627 export OGLLIBS="-L$OGLHOME/lib -lMesaGLU -lMesaGL"
629 export OGLHOME=$LHCXX_BASE/OpenGL/pro
635 export G4VIS_BUILD_OPACS_DRIVER=1
636 export G4UI_BUILD_WO_DRIVER=1
637 export G4UI_BUILD_WO_SESSION=1
638 export G4VIS_USE_OPACS=1
640 export OPACS_HOME=$G4_BASE/tools/OPACS
641 #export OPACS_HOME=/afs/cern.ch/rd44/dev/OPACS
642 if [ "$SYSTEM" = "Linux" ]; then
643 export G4_OPACS_WIDGET_SET=lesstif
645 export G4_OPACS_WIDGET_SET=Xm
647 . $OPACS_HOME/OPACS/v3/setup.sh
648 export WOENVIRONMENT=$AG4_INSTALL/bin/Alice.odb
649 export OPATH="$OPATH $G4INSTALL/environments/OPACS/usr"
650 if [ "$VERBOSE" = "YES" ]; then
651 if [ $G4VIS_USE_OPACS ]; then
652 echo " OPACS driver activated"
653 echo " OPACS path set to $OPACS_HOME"
657 if [ "$VERBOSE" = "YES" ]; then
658 echo "* Unsetting OPACS driver env. variables ..."
660 unset G4VIS_BUILD_OPACS_DRIVER
661 unset G4UI_BUILD_WO_DRIVER
662 unset G4UI_BUILD_WO_SESSION
663 unset G4VIS_USE_OPACS
666 unset G4_OPACS_WIDGET_SET
673 # path to Alice executable and config scripts
675 if [ "`echo ${PATH} | grep ${AG4_INSTALL}/bin/${G4SYSTEM} `" = "" ]; then
676 if [ "$VERBOSE" = "YES" ]; then
677 echo Adding $AG4_INSTALL/bin/$G4SYSTEM to the path...
679 export PATH=$PATH:$AG4_INSTALL/bin/$G4SYSTEM
681 if [ "`echo ${PATH} | grep ${AG4_INSTALL}/config `" = "" ]; then
682 if [ "$VERBOSE" = "YES" ]; then
683 echo Adding ${AG4_INSTALL}/config to the path...
685 export PATH=${PATH}:${AG4_INSTALL}/config
689 # path to shared libraries
691 if [ "$SYSTEM" = "HP-UX" ]; then
693 SHLIBVARNAME=SHLIB_PATH
695 if [ "$SYSTEM" = "Linux" ]; then
696 SHLIBVAR=$LD_LIBRARY_PATH
697 SHLIBVARNAME=LD_LIBRARY_PATH
699 if [ "`echo ${SHLIBVAR} | grep ${AG4_INSTALL}/lib/${G4SYSTEM} `" = "" ]; then
700 if [ "$VERBOSE" = "YES" ]; then
701 echo Adding ${AG4_INSTALL}/lib/${G4SYSTEM} to the shared libraries path...
703 SHLIBVAR="${AG4_INSTALL}/lib/${G4SYSTEM}:${SHLIBVAR}"
706 if [ "`echo ${SHLIBVAR} | grep ${G4INSTALL}/lib/${G4SYSTEM} `" = "" ]; then
707 if [ "$VERBOSE" = "YES" ]; then
708 echo Adding ${G4INSTALL}/lib/${G4SYSTEM} to the shared libraries path...
710 SHLIBVAR="${G4INSTALL}/lib/${G4SYSTEM}:${SHLIBVAR}"
713 export $SHLIBVARNAME=$SHLIBVAR
717 # Remove unneeded variables. If this is not done the vars. remain in the env.
731 echo "Default ALICE environment for GEANT4 has been set."