#!/bin/bash ################################################################# # This script sets up and runs the prompt offline reco # # Data gets put in a dir named after the run number in the # $DATADIRBASE dir (default in ~/data) # Never overwrite existing data, make a new directory if necessary # and give it a unique (sequential) number # # it is possible to override the default rec.C by putting a symlink # rec.C in homedir. # # origin: Mikolaj Krzewicki, Nikhef, Mikolaj.Krzewicki@cern.ch ################################################################# if [ $# -lt 2 ] then echo "" echo " Usage: `basename $0` RunNumber GDCnumber [Trigger]" echo " (don't use the Trigger argument unless you're really sure what you're doing!)" echo "" exit 999 fi DATADIRBASE="/local/home/daq/data/current" RECMACRO="$ALICE_ROOT/test/cosmic/rec.C" PROMPTOFFLINEMACRO="/local/home/daq/alisoft/macros/RunPromptOffline.C" #override the default rec.C if ~/rec.C exists and is symlink if [ -h $HOME/rec.C ] then echo "" echo "~/rec.C will override the default rec.C" read -n 1 -p "Do you want to use the new one? [Y/n]" ans if [[ $ans == "Y" || $ans == "y" || $ans == "" ]] then RECMACRO="$HOME/rec.C" echo "" echo "OK, using $RECMACRO" echo "" else echo "" echo "OK, using $RECMACRO" echo "" fi fi # data gets put in a dir named after the run number DATADIR="${DATADIRBASE}/${1}_OnlineDisplay" # never overwrite existing data, make a new directory if necessary # and give it a unique (sequential) number BIGGESTNUMBER=0 DIRNUMBER=0 if [ -d ${DATADIR} ] then for x in ${DATADIR}*; do DIRNUMBER=`echo ${x} | sed -e s%${DATADIR}_*%%` if [[ ${DIRNUMBER} == "" ]] then DIRNUMBER="0" fi if [[ ${DIRNUMBER} -ge ${BIGGESTNUMBER} ]] then BIGGESTNUMBER=$((DIRNUMBER+1)) fi done DATADIR=${DATADIR}_${BIGGESTNUMBER} fi mkdir ${DATADIR} cp ${RECMACRO} ${DATADIR} cd ${DATADIR} if [ $# -eq 3 ] then alieve ${PROMPTOFFLINEMACRO}\(${1},${2},${3}\) | tee alieve.log else alieve ${PROMPTOFFLINEMACRO}\(${1},${2}\) | tee alieve.log fi