2 #################################################################
3 # This script sets up and runs the prompt offline reco
5 # Data gets put in a dir named after the run number in the
6 # $DATADIRBASE dir (default in ~/data)
7 # Never overwrite existing data, make a new directory if necessary
8 # and give it a unique (sequential) number
10 # it is possible to override the default rec.C by putting a symlink
13 # origin: Mikolaj Krzewicki, Nikhef, Mikolaj.Krzewicki@cern.ch
14 #################################################################
19 echo " Usage: `basename $0` RunNumber GDCnumber"
24 DATADIRBASE="/local/home/daq/data/current"
25 RECMACRO="$ALICE_ROOT/test/cosmic/rec.C"
26 PROMPTOFFLINEMACRO="/local/home/daq/alisoft/macros/RunPromptOffline.C"
28 #override the default rec.C if ~/rec.C exists and is symlink
32 echo "~/rec.C will override the default rec.C"
33 read -n 1 -p "Do you want to use the new one? [Y/n]" ans
34 if [[ $ans == "Y" || $ans == "y" || $ans == "" ]]
36 RECMACRO="$HOME/rec.C"
38 echo "OK, using $RECMACRO"
42 echo "OK, using $RECMACRO"
47 # data gets put in a dir named after the run number
48 DATADIR="${DATADIRBASE}/${1}"
50 # never overwrite existing data, make a new directory if necessary
51 # and give it a unique (sequential) number
58 DIRNUMBER=`echo ${x} | sed -e s%${DATADIR}_*%%`
59 if [[ ${DIRNUMBER} == "" ]]
63 if [[ ${DIRNUMBER} -ge ${BIGGESTNUMBER} ]]
65 BIGGESTNUMBER=$((DIRNUMBER+1))
68 DATADIR=${DATADIR}_${BIGGESTNUMBER}
73 cp ${RECMACRO} ${DATADIR}
75 aliroot ${PROMPTOFFLINEMACRO}\(${1},${2}\)