#!/bin/bash #------------------------------------------------------------------------------ # This script connects the Event Display to the Consumer-Server/Logger # according to the parameters given as input. # #------------------------------------------------------------------------------ # Set file name used in the tcl file. export FILENAME= export RUN_NUMBER="" export EVENT_NUMBER="" export DEBUG_SCRIPT="" export WORK_DIR=$PWD #------------------------------------------------------------------------------ export OPTIND=1 while getopts :i:r:v OPT; do case $OPT in i) # input file export FILENAME=$OPTARG if [ .$DEBUG_SCRIPT != . ] ; then echo FILENAME = $FILENAME fi ;; r) # run_number:event_number export RUN_NUMBER=`echo $OPTARG | sed 's/:/ /g' | awk '{print $1}'` export EVENT_NUMBER=`echo $OPTARG | sed 's/:/ /g' | awk '{print $2}'` ;; v) # run_number:event_number export DEBUG_SCRIPT=yes ;; *) echo OTHER: $OPT $OPTARG usage ;; esac done #------------------------------------------------------------------------------- if [ .$FILENAME == "." ] ; then echo "" echo "Usage: run_evd -i " echo " " exit fi # Try to make the user's PATH length smaller by removing directories # that he/she may have in PATH but are not needed for this script. If # the PATH is too long, some commands may fail. shorterpath=`dropit cern ximage java gtools www emacs debugger root pine ghost tex kai gdb tcl` [ -n "${shorterpath}" ] && PATH=${shorterpath} if [ -z "${CDFSOFT2_DIR}" ] then echo " OOPS, you must have cdfsoft2 set up before running evd " echo " quitting " echo " " exit 1 fi #get the host name using HOST or HOSTNAME variables if [ -z "${HOST}" ] then if [ -z "${HOSTNAME}" ] then echo " OOPS, neither HOST nor HOSTNAME are defined " echo " quitting " echo " " exit 1 else thishost=`echo $HOSTNAME` fi else thishost=`echo $HOST` fi #check out if we are on the online(b0) or offline machine subnet=`nslookup 2> /dev/null $thishost | cut -s -f 3 -d "." | tail -1` if [ ${subnet} -eq 236 ] ; then # set online db variable here export DBlong=on export DBshort=on else # set offline db variable here export DBlong=off export DBshort=of fi # Begin the event display. source ~cdfsoft/cdf2.shrc setup cdfsoft2 `cat $WORK_DIR/.base_release` srt_setup -a exefile=`which evd.exe` $exefile $WORK_DIR/cdfopr/tcl/evd.tcl -g -i $FILENAME exit