Files
geant4/examples/extended/E02/exampleE02run
T
2016-06-08 15:09:25 +02:00

44 lines
1.1 KiB
Tcsh

#! /bin/csh -f
# setup some variables (example on CERN AFS SUN-CC)
set CWD = `pwd`
set G4ROOT = ${CWD}/../../..
set G4BIN = ${G4ROOT}/bin/SUN-CC
set G4SCHEMA_DIR = ${G4ROOT}/schema
# check some configurations
if ( ! $?G4EXAMPLE_FDID ) then
echo "G4EXAMPLE_FDID is not defined. Stop."
exit 2
endif
if ( ! $?G4EXAMPLE_BOOT ) then
echo "G4EXAMPLE_BOOT is not defined. Stop."
exit 2
endif
if ( ! -e $G4EXAMPLE_BOOT ) then
echo "G4EXAMPLE_BOOT is not found. Run "gmake cleandb" first."
exit 2
endif
# Since the name of the federated database file G4EXAMPLE is hard
# coded into the executable for now, it is neccessary to run it in
# the same directory as $G4EXAMPLE_BOOT.
echo "cd $G4EXAMPLE_BOOT_DIR" ; cd $G4EXAMPLE_BOOT_DIR
if ( $?BACKGROUND ) then
if ( -e exampleE02.log.old ) rm -f exampleE02.log.old
if ( -e exampleE02.log ) mv -f exampleE02.log exampleE02.log.old
${G4BIN}/exampleE02 ${CWD}/exampleE02.in >& ${CWD}/exampleE02.log &
echo "Job exampleE02 submitted..."
sleep 2
echo "tail -f exampleE02.log"
tail -f ${CWD}/exampleE02.log
else
${G4BIN}/exampleE02 ${CWD}/exampleE02.in
endif